フィルターのクリア

How could I use ode45 to solve a system of three differential eqns in which one differnatial equation has a diferent time span?

1 回表示 (過去 30 日間)
For example:
1#: dx/dt = x+y+z tspan = [0 tf]
2#: dy/dt = x+y+z tspan = [0 tf]
3#: dz/dt = x+y+z tspan = [t1 tf]

採用された回答

Walter Roberson
Walter Roberson 2017 年 10 月 1 日
Is z a constant before t1? If so then you have a situation where the derivative is not continuous. To handle that you need to break up the system into two ode45 calls, one for up to t1 and the other for t1 to tf.
For these purposes it does not matter if you use two different ode functions for the two parts, or if you use a single ode function that figures out which part it is operating in, as long as the behavior of the function does not change within one ode45 call.
  2 件のコメント
Roger Vegeta
Roger Vegeta 2017 年 10 月 1 日
What about if z is not constant before t1? and we have for example:
dx/dt = x+y+z % tspan = [0 tf]
dy/dt = x+y+z % tspan = [0 tf]
dz/dt = x+y % tspan = [0 t1]
dz/dt = x+y+z % tspan = [t1 tf]
Thanks so much!
Walter Roberson
Walter Roberson 2017 年 10 月 1 日
In that situation the derivative dz/dt is not consistent over 0 to tf, so you need to handle the situation the way I indicated, by using two ode calls. You would take the output of the call over [0 t1] to use as the boundary conditions for the [t1 tf] call.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeChemistry についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by