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!
