ode event stopping without a zero crossing
Show older comments
I'm having trouble with an ODE45 model I am building and the event function used to terminate the integration. The event function I am using detects a zero crossing (positive direction) to terminate the solver then another function modifies the ode and I'm feeding the end state from the first run into another ode45 call as the initial conditions (similar to ballode example except instead of modifying the initial conditions I am modifying ode).
The first termination occurs correctly but then I am getting a second termination during the subsequent run. The output reports the same event index (ie) as the first run. When I manually run the event function with the terminated state I am finding that the value of the flagged event is not zero.
How can the solver stop and report an event with an event value that is much less than zero?
Any thoughts?
1 Comment
Jason Kozmic
on 15 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!