How can I stop ode15s at point where it fails to meet integration tolerance and then restart from that specific point?

6 views (last 30 days)
Hi, I am solving a system of 1st order ODEs containing 228 equations using ode15s rather than ode45, as ode45 is extremely slow in my system. But, unfortunately, even by reducing the tolerance ( AbsTol and RelTol) to 1e-2 and 1e-3, respectively, the solver stops at around 2.34e5 seconds and gives a warning message : Unable to meet integration tolerance at t= 2.34e5 without reducing the step size below the smallest value.....". I feel I need to deal with events function. Could anyone please help me how can I stop the solver at the point when it fails to meet integration tolerance ( i.e. 2.34e5 seconds in this case) and then restart the solver till the final time?
In ballode code: (<http://www.mathworks.com.au/help/matlab/math/ordinary-differential-equations.html#f1-669698> )
Q.1: ud = get(gcf,'UserData'); if ud.stop break; end what the above codes do??
In summary: I am requesting you all to provide me some suggestions for calling ode15s for 3 ODEs which will:
1) Stop and restart at point where it fails to meet integration tolerance 2) Please also suggest on corresponding event function
Your cooperation will be highly appreciated....
Thanks in advance
Mahmudul
  2 Comments
Marylen Sun
Marylen Sun on 28 Mar 2021
Hi, I would like to try to do something like you ask, i have similar problem,
did you find a way to make odes stop when there's the fail please?
Ioannis Matthaiou
Ioannis Matthaiou on 14 Apr 2021
Hello, check the fact that there might be certain variables during integration that get unreasonably large values and tend towards infinity. Stop the integration after few time steps (e.g. use pause function and uncomment variables) to see if any variables obtain large values. Alternatively, post the code so that people may provide better assistance to your question.
Yiannis

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!