Using Matlab ODE integrators with the method of lines

2 次查看(过去 30 天)
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.

回答(1 个)

Torsten
Torsten 2016-7-18
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.

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by