Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: ode45-repeated location events
Replies: 1   Last Post: Apr 3, 2013 2:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten Hennig

Posts: 2,419
Registered: 12/6/04
Re: ode45-repeated location events
Posted: Apr 3, 2013 2:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Hi all,
>
> i'm using the ode45 function in matlab in a certain
> time interval (i.e 80-200 seconds). i want the ode45
> to integrate my ODE until it reaches certain value
> and then stop but! then i want it to go back to a
> certain baseline value (in the y axis) and continue
> the integration (until again, stops and go back to
> baseline if it reaches that same specific value as
> before) throught the entire time interval.
>
> Any help will be appreciated :)


When ode45 reaches the value in question, set
isterminal=1
in the event function.
Then ode45 stops integration.
In the calling program, reset the y-value and
call ode45 again.
This can be done repeatedly in a while-loop until
ode45 reaches the end of the time interval.

Best wishes
Torsten.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.