Update the variables in ODE routines?

조회 수: 2 (최근 30일)
Hossein
Hossein 2015년 6월 18일
답변: Andrew Schenk 2015년 6월 19일
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