How do I take output from each time step of an ode45 integrator and put this into another function?

Asked by MParkie on 6 Aug 2012
Latest activity Commented on by Jan Simon on 19 Aug 2012

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 Simon 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?

MParkie

Products

No products are associated with this question.

0 Answers

Contact us