How do I take output from each time step of an ode45 integrator and put this into another function?
Show older comments
I have a system of differential equations, of which I'm trying to solve using the ode45 integrator. I also have a function, say delx, that is dependant on the x(1) component that the ode45 integrator would output.
After giving delx an initial value and using this first value of delx to compute my system using ode45 for time = 0, how do I get delx to then take the outputted values x(1) and x(2), choose x(1) and then put this value into my delx function in order to get a new delx value, and to continue this loop until the final time value?
I.e
Initial Values --> delx value --> ode45 for time = 0:0.01:10 until finish --> takes outputted x(1) from ode45 --> Back to delx value step
Any help is much appreciated.
1 Comment
Jan
on 19 Aug 2012
Do you want to calculate delx during the integration or afterwards using the output of ODE45? For the later case, what is the problem?
Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!