ODE Solvers how to check conditions in each time step

4 views (last 30 days)
To whom it may concern,
Good afternoon and I hope to reach out to you for a help in MATLAB's ode solvers.
I would like to check if a certain condition holds for the right hand side function, during the numerical integration. I am basically printing a variable inside my right hand side function and seeing the work space output to make sense of the condition.
However, from my rudimentry understanding in solving ODEs, and numerical solvers for the ODEs in MATLAB, I understand that the solver will make a guess(?) in its step size and before it can eventually pick the right step size that ensures the error criteria, for a given time step.
If this is true, I would like to see if the conditon that I want to impose can only be evaluated at the correct steps that the solver choose as it integrates the right hand side function, numerically.
Do you have any insights as to how can I check a specific condition during the numerical intergration of a given right hand side function, specifically for the steps that are chosen by the solver?
Thanks a lot!
Tae
  4 Comments
Torsten
Torsten on 6 Mar 2022
Will the event function be evaluated only at the "correct" solutions?
No, also at test points for t and y.
Could you please help me to better understand the function?
Read about OutputFcn under

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!