I'm calling Simulink from the command line (sim command) and sometimes
the simulation bombs out due to non-convergence. It returns an error,
??? Error using ==> sim
Nonlinear iteration is not converging with step size reduced to hmin
(3.865299649535626e-020) at time 1.087985128832751e-005. Try reducing
the minimum step size and/or relax the relative error tolerance.
which causes the routine calling the sim command to halt the whole
program (i.e. all the higher functions calling the routine and the short
script calling these).
Is there a way to make the routine calling the sim command ignore the
error and carry on appropriately?
Cheers
Angus
>Here's another one...
>
>I'm calling Simulink from the command line (sim command) and sometimes
>the simulation bombs out due to non-convergence. It returns an error,
>
>??? Error using ==> sim
>Nonlinear iteration is not converging with step size reduced to hmin
>(3.865299649535626e-020) at time 1.087985128832751e-005. Try reducing
>the minimum step size and/or relax the relative error tolerance.
Simulink has reduced the step size to almost nothing making your
simulation lasting *forever*. Try using one of the stiff solvers.
You can always enclos the sim function call in a try...catch block to
handle the error nicely.
Lars
Lars Gregersen
www.rndee.dk
l...@rndee.dk
> On Sat, 01 Jun 2002 17:22:55 +0100, Angus Bryant <at...@cam.ac.uk>
> wrote:
>
> >Here's another one...
> >
> >I'm calling Simulink from the command line (sim command) and sometimes
> >the simulation bombs out due to non-convergence. It returns an error,
> >
> >??? Error using ==> sim
> >Nonlinear iteration is not converging with step size reduced to hmin
> >(3.865299649535626e-020) at time 1.087985128832751e-005. Try reducing
> >the minimum step size and/or relax the relative error tolerance.
>
> Simulink has reduced the step size to almost nothing making your
> simulation lasting *forever*. Try using one of the stiff solvers.
I am already using ode15s...
> You can always enclos the sim function call in a try...catch block to
> handle the error nicely.
Yeah, I realised that just after I posted the message. I'm using eval as
the try/catch function and it works a treat!
Cheers
Angus
It's not clear to me how to use the try/catch statements. Can you please provide your code that handles the convergence error?
Thank you,
David
Angus Bryant <at...@cam.ac.uk> wrote in message <3CFA1AC0...@cam.ac.uk>...