Using Matlab ODE integrators with the method of lines

2 vues (au cours des 30 derniers jours)
Moshe
Moshe le 15 Juil 2016
Réponse apportée : Torsten le 18 Juil 2016
This is a question about the syntax of Matlab. The context is that I am trying to use one of the ODE integrators (say ode45) to propagate a vector in time, the vector being the values of some function on a grid (I think this is called the method of lines). Oftentimes one would want to apply some correction (say filter out noise) when certain criteria are obeyed (say every fixed number of time steps). Is there an option in one of the integrators to call an auxiliary function to act on the solution? The closest I got is what is called "output function" but that seems to be a way to get information out of the code periodically, not to modify the solution itself.

Réponses (1)

Torsten
Torsten le 18 Juil 2016
Call the ODE-integrator for a small time step, modify the solution and use the modified solution as initial value for the next step, call the ODE-integrator for a second small time step, modify the solution ...
Use a loop to implement the above strategy.
Best wishes
Torsten.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by