Best ODE solver when there is a parameter discontinuity

조회 수: 14 (최근 30일)
Kevin Bachovchin
Kevin Bachovchin 2013년 8월 14일
Hello,
I have a system of differential equations where one of the parameters changes value abruptly at one point in time. Which ODE solver is the most accurate and most efficient to use in such a situation? I'm trying to use ode45, but when I use a low tolerance, I'm not getting an accurate answer. When I try to tighten, the tolerance, it is taking an extremely long time to run (it's been running over an hour and still hasn't finished).
Thank you, Kevin

채택된 답변

Jan
Jan 2013년 8월 15일
Matlab's integrators cannot handle discontinuities reliably, see e.g. http://www.mathworks.com/matlabcentral/answers/59582#answer_72047. The correct method is to stop the integration at the time point of the change and restart it. Then you can choose the integrator according to the numerical properties of the ODE, most of all its stiffness.
  댓글 수: 2
Kevin Bachovchin
Kevin Bachovchin 2013년 8월 16일
Thanks for your response. I tried what you suggested. Now the first call to ode45 runs fine, but the second call to ode45 runs for a very long time without finishing (or if use a loose tolerance is inaccurate). In the second call to ode45, after the parameter disturbance, I have a controllable variable (which is an algebraic function of the state variables) which takes different values at each point in time. I think this might be what is causing the problem. Do you have any suggestions for dealing with this issue?
Jan
Jan 2013년 8월 17일
The description of the problem is too vague to understand it in detail. Does your function to be integrated depend on a discontinuos parameter? What exactly does "different values at each time point" mean? This would match the parameter "t" also.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by