Optimizing ODE solver performance for very small step size
古いコメントを表示
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 件のコメント
rahulmittal rahulmittal
2021 年 2 月 21 日
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
2021 年 2 月 21 日
@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
2021 年 2 月 21 日
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
2021 年 2 月 22 日
Jan
2021 年 2 月 22 日
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
2021 年 2 月 23 日
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
2021 年 2 月 23 日
編集済み: Angshuman Podder
2021 年 2 月 23 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
