Optimizing ODE solver performance for very small step size
Mostrar comentarios más antiguos
Hi, I have a function (containing 2 diff. eqns) that needs to be solved. Unfortunately, the time step needed is 1e-11. I think the program will run into a memory issue. Is there any way to save values at a certain time interval? OR Do I need to non-dimensionalize the eqns.?
P.S. I am using the ode45 solver.
8 comentarios
rahulmittal rahulmittal
el 21 de Feb. de 2021
Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.
Jan
el 21 de Feb. de 2021
@Angshuman Podder: The absolute size of the time step does not matter. Remember that "time step" does not have a unit. So Matlab does not know, if it is pico-seconds or years.
The size of the time step does not imply any memory problems. But it would matter, if you have to calculate 1e11 time steps. This would not only exhaust the RAM, but the computing time would be huge also. In other words: While the size of the time step does not matter, the number of steps have an upper limit, if you have limited ressources.
@rahulmittal rahulmittal: Because I do not understand yet, what the problem of the OP exactly is, I'm astonished, that you think you have a similar problem. Please open a new thread here and explain, which problem you exactly have.
Angshuman Podder
el 21 de Feb. de 2021
Why do you need such a tiny step size?
The accumulated rounding errors will dominate the trajectory. The computations might take a day.
If you force the integrator to use a tiny step size, it might be much cheaper to use a fixed step solver. Then you have full control over what is stored as output. Answers: Fixed Step Solvers
Angshuman Podder
el 22 de Feb. de 2021
Jan
el 22 de Feb. de 2021
Not converging? I'm not sure which kind of convergence you expect for the integration of an ODE. But forcing an integrator to perform 10^11 steps sounds clearly like driving a numerical software apart from its purpose. Maybe the ODE is stiff? ODE45 integrates non-stiff ODEs only.
J. Alex Lee
el 23 de Feb. de 2021
Not knowing details, the first thing I would always look at is if the problem can be nondimensionalized to remove units and more easily uncover stiffness. Especially since the plots shown have such huge orders of magnitude.
Angshuman Podder
el 23 de Feb. de 2021
Editada: Angshuman Podder
el 23 de Feb. de 2021
Respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
