Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

2 次查看(过去 30 天)
Hi,
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 http://user.it.uu.se/~maya/Courses/BerVetI/Block6_pgm/ode78.m ) 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!

回答(0 个)

此问题已关闭。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by