Time-dependent parameter for ODE system

35 ビュー (過去 30 日間)
Ildar Sadreev
Ildar Sadreev 2019 年 11 月 24 日
コメント済み: Ildar Sadreev 2019 年 11 月 26 日
Hello,
suppose I have a system of ODEs for y1 and y2:
d/dt(y1) = a*f(t) - b*y1,
d/dt(y2) = m*y1 - n*y2,
where a, b, m and n are positive constants and f(t) is a time-dependent parameter.
The problem is that f(t) is available only as a vector (not an explicit function of t) on the same time scale as the one used for the ODEs solving.
How could I pass the corresponding value of f into the system of ODEs for the corresponding time?
Your suggestions would be greatly appreciated.
Many thanks,
Ildar

採用された回答

Stephan
Stephan 2019 年 11 月 24 日
編集済み: Stephan 2019 年 11 月 24 日
use interp1 to achieve this - an example of how to do this is here.
  1 件のコメント
Ildar Sadreev
Ildar Sadreev 2019 年 11 月 26 日
Thanks Stephan! It did work.

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

その他の回答 (0 件)

カテゴリ

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