How to programatically stop ode solver execution after fixed amount of computation time?
Afficher commentaires plus anciens
I have an initial value problem whose parameters I want to tune to measurement data. I found that my problem seems to become stiff if one or more parameters have very high values, at least what I observe is that in those cases, the ode45 solver takes a very long time and in most cases I end up terminating the calculation before it finishes. I tried to use instead the ode15s solver, which came to a solution in very short time.
I would like to automate this process somehow, and the easiest solution I can think of is to run the ode45 solver and after a given amount of time, terminate the execution and make a second attempt using the ode15s solver. I am aware of the existence of event triggers, but never worked with them and can't really figure out how I could use them in the context of my problem.
Can someone please draft how to achieve this? Thank you very much!
4 commentaires
Torsten
le 11 Avr 2022
I suggest using ODE15S throughout.
Niklas Barthel
le 12 Avr 2022
No drawbacks concerning precision.
For higher-dimensional problems which are not stiff, using a stiff solver might increase the runtime and the required RAM because of the Jacobian matrix that has to be built in each integration step.
But changing the solver during integration is nonsense in my opinion.
Niklas Barthel
le 20 Avr 2022
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!