Update the variables in ODE routines?

2 次查看(过去 30 天)
Hi everyone,
I have a question concerning the ODE routines. I should model a complicated nonlinear dynamic system in time domain using ode113 (or any other one). I want to ask if it is possible to update the (by derivatives) predicted variables by easily replacing the optimized value in current time step? eg. we have the Y_1 as the variable in first time step and dY_1 its derivative can we update Y_2 while calculating dY_2 just buy putting Y_2 = .... ?
tnx all

回答(1 个)

Andrew Schenk
Andrew Schenk 2015-6-19
The purpose of the ODE solver is to solve for the values of Y given a MATLAB function which provides values of dY. If you want to calculate the value of Y at a given step, the ODE solver does not need to solve for it.
You could accomplish this by removing Y2 as a variable from ode113 and instead use a persistent variable in your MATLAB function to calculate Y2 and track the past states.

类别

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