Solving odes with ode45 and then checking fixed points for constant behavior,

5 visualizaciones (últimos 30 días)
Update: I just plotted the differences between the dynamical states and the corresponding initial states, and the differences, for all state variables, were 1e-15. I think my fixed point calculations could be legitimate.
Hi there!
I've calculated some fixed points in a dynamical system consisting of several coupled ODEs, and now I want to check that the fixed points behave well in the simulations, as a check that my calculations are correct. I gave ode45 the most stringent tolerances that it was happy with: about 3e-14. And, after simulating for, I think, a pretty long time, I go to plot some of my dynamical state variables vs. time t. In the plots, I see that the state variables are constant for up to 13 or 14 digits after the decimal point.
Can I conclude that these variables are in steady state?
If so, then it appears that my calculated fixed points are legitimate.
Or, can I do better than 13 or 14 digits?
Should I switch to a different ode solver in Matlab?
I think "machine precision" is 15 digits after the decimal point, but I'm a newbie in numerical analysis.
Any thoughts would be greatly appreciated.
Thanks in advance!

Respuesta aceptada

John D'Errico
John D'Errico el 10 de Abr. de 2025
Editada: John D'Errico el 10 de Abr. de 2025
How many times will you ask this question?
Can you do better than 13-14 digits? No. Not in double precision. And a different ODE solver will be a waste of time, since it still will run in double precision!
Can you do the analysis entirely in a symbolic form? Probably, but you will need to learn to use those tools well, being extremely careful not to use any double precision arithmetic, as that will corrupt the digits beyond the 13th and 14th digit. Even a tiny lack of care will yield computational garbage. Far too many people have shown their careful work on this forum, trying to squeeze a few extra digits from a code with symbolic computations, without realizing they were using a few double precision numbers in their work. The result is numerical garbage.
Do you really have a use for that hypothetical 15th, 16th dgit? Will it do you any good, except waste a significant amount of CPU time, of your own time to do the analysis, to write the code? One day, when you pass away, will your obituary proudly state that you computed 17 significant digits on what is essentially a homework problem? Will anyone care? Of course not. It is time for you to put this problem to bed and work on the next problem.
If it really bothers you, I'll help you out. The 15th digit is a 7. Well, maybe. Hey, I've got a 10% chance I am right. Do I get a second guess?
  3 comentarios
John D'Errico
John D'Errico el 10 de Abr. de 2025
Editada: John D'Errico el 10 de Abr. de 2025
But that classic paradox only applies to leading digits as I recall. Its been 45 years since I saw it though. The second digit also had a small effect, but by the time you get down to the lower order digits, they should be effectively uniform.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by