The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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
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

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.