ODE Solvers how to check conditions in each time step

4 vues (au cours des 30 derniers jours)
Taehun Kim
Taehun Kim le 6 Mar 2022
Commenté : Taehun Kim le 6 Mar 2022
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 commentaires
Torsten
Torsten le 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
Taehun Kim
Taehun Kim le 6 Mar 2022
Thanks for your help! I will look into the link!

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by