Solving a non-standard ODE

1 回表示 (過去 30 日間)
Deepayan Bhadra
Deepayan Bhadra 2017 年 12 月 4 日
コメント済み: Star Strider 2017 年 12 月 8 日
I'm trying to solve an ODE like this: xdot = r(t)-x, where r(t) is a pre-calculated signal array of size 100. Let x(0) = 0. How do I set up the ODE? Thanks a lot.

回答 (1 件)

Nicolas Schmit
Nicolas Schmit 2017 年 12 月 4 日
Create a interpolation of r(t), for example using interp1(), then use the interpolation routine in an ODE solver.
  2 件のコメント
Deepayan Bhadra
Deepayan Bhadra 2017 年 12 月 8 日
I'm not able to understand how this helps exactly. To elaborate, in the ODE45, [t,x] = ode45(@(t,x) (r(t)-x), tspan, x0), obviously I cannot specify r(t) like that. What I want is r(1), r(2), .... to be used at each step of the ODE. How do I modify the ODE45 command?
Star Strider
Star Strider 2017 年 12 月 8 日
See the ode45 documentation with respect to: ODE with Time-Dependent Terms (link).

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

カテゴリ

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