dsolve isn't solving my symbolic ODE correctly
Show older comments
I'm trying so solve two simple nonhomogeneous ODEs using dsolve. My forcing functions always have the some form, but I am allowing some parameters of the functions to change, i.e. the frequencies and the amplitude. The forced ODEs are:
and
I expect the particular solutions to be sums of sinusoids at the forcing frequencies. If we just take the Fourier transform of the first equation, we find that:
which is just an amplitude gain with no phase shift. The symbolic toolbox sometimes returns a good particular solution (coefficients are actual numbers in my code):
beta_s_sol(t) =
- 0.0444*cos(2.0944*t) - 0.0934*cos(3.1416*t)
but other times it's not correct. For the same system parameters, the gamma solution was:
gamma_s_sol(t) =
-7.7215e-11*exp(-8.6936*t)*(5.7469e+08*exp(8.6936*t)*sin(2.0944*t) - 1.2101e+09*exp(8.6936*t)*sin(3.1416*t))
Is there a known bug in the symbolic toolbox? I'm designing a control system that relies on those particular solutions and when I get two good solutions, the control system works very well. When I don't get the right solution, the control system doesn't work. I may have some fundamental issues elsewhere, but the controller response correlating with the ODE solution issue is pretty convincing to me.
1 Comment
Torsten
on 20 Apr 2022
Is a/b resp. c/d above always positive ? Otherwise, you'll get exp-terms in the solution of the homogenous system.
Accepted Answer
More Answers (1)
Torsten
on 20 Apr 2022
0 votes
Is a/b resp. c/d above always positive ? Otherwise, you'll get exp-terms in the solution of the homogenous system.
Maybe you can just copy the solution here and integrate it as-is in your program code:
5 Comments
Dominic Riccoboni
on 20 Apr 2022
Torsten
on 20 Apr 2022
And why do you make permanent calls to "dsolve" if you could use the above analytical solution for your 2nd order ODE as fixed part of your code ?
Dominic Riccoboni
on 20 Apr 2022
Torsten
on 20 Apr 2022
And these forcing functions do not allow a symbolic solution without giving numerical values to the parameters involved ?
Dominic Riccoboni
on 20 Apr 2022
Edited: Dominic Riccoboni
on 20 Apr 2022
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!