How to force the ode solver to stop when a periodic solution is reached?
4 views (last 30 days)
I am solving a system of 4 non linear ODEs with periodic coefficients of period one year. I want the ode solver to check each year if the solution is the same as the solution of the previous year then it should stop. Otherwise it should run until the finaltime (some fixed number) is reached. So, basically there are two stopping criterion: one is periodicity and the other is finaltime. No idea how to implement this idea.
Although, what i am doing right now is: I am solving the system untill the finaltime is reached and then check the periodicity condition for the last 3 or 4 years (say).
Any kind of suggestion would be helpful.