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 件のコメント
Torsten
Torsten 2015 年 6 月 19 日
????

サインインしてコメントする。

回答 (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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by