From: Luca Cerone on
Dear all,
I'm trying to solve a simple ODE setting up events.
After having read the documentation and the BALLODE example,
I finally could manage to make it work almost fine.

My issue now is that sometimes the events are missed by the solver
(my event is triggered by the function sin(t)+0.8).

Some points where the function crosses 0 are correctly detected (as well as their directionality), but others are simply ignored by the solver.

Any suggestions on how I can improve this?
Thanks a lot in advance,
Cheers, -Luca
From: Torsten Hennig on
> Dear all,
> I'm trying to solve a simple ODE setting up events.
> After having read the documentation and the BALLODE
> example,
> I finally could manage to make it work almost fine.
>
> My issue now is that sometimes the events are missed
> by the solver
> (my event is triggered by the function sin(t)+0.8).
>
> Some points where the function crosses 0 are
> correctly detected (as well as their directionality),
> but others are simply ignored by the solver.
>
> Any suggestions on how I can improve this?
> Thanks a lot in advance,
> Cheers, -Luca

You could reduce the maximum step size of the
ODE solver.

Take a look at
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/odeset.html#f92-1039598
under Step-Size Properties, variable MaxStep.

Best wishes
Torsten.
 | 
Pages: 1
Prev: plot a 3D function
Next: PCA code