This question is closed. Reopen it to edit or answer.

How to automatically stop a function execution if it's not running right?

1 view (last 30 days)
I have a problem with running my code. I'm numerically solving a Poincaré map of a dynamical system several times with different initial conditions. If I run it for, i.e. 13 initial conditions it works fine, but when I try it on 1000 initial conditions, some of them reach a PS that just gets nowhere and I don't know how to "forget" that section.
Technically speaking, I'm using ode78 function (downloaded it from ) and I'm using it to calculate every time smaller time spans, till I sometimes get spans arround 1e-13 or so. It's then when ode78 gets stuck (MATLAB keeps running but getting nowhere) and I have to ctrl+C and abort some hours of computation. I've tried to solve the problem by not calling ode78 if time span is less than 1e-13 but it still gets stuck. I can't allow less precision because I would lose a lot of data. Anybody who could tell me why it stills happening?
A solution could be to time-limit ode78 call but I've read it's impossible in MATLAB.
If anybody solves it, he/she would make my da... my week!

Answers (0)


Community Treasure Hunt

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

Start Hunting!