To solve two 2nd order coupled differential equation using ODE45?

1 回表示 (過去 30 日間)
Rohit Singh
Rohit Singh 2021 年 9 月 26 日
コメント済み: Rohit Singh 2021 年 9 月 29 日
I have the the following 2nd order differential equation that is needed to be solved.
..............(1)
....................(2)
The initial state are [3 9] for and respectively.
The time interval is [0: 0.05: 1] i.e 21 time steps.
The and are functions of time available for initial 20 time steps (can take as ones for working example).
I don't have any prior experince with ODE45 . Any guidance to solve this problem will be appreciated.

採用された回答

Alan Stevens
Alan Stevens 2021 年 9 月 26 日
Replace each 2nd order ODE by two 1st order ODEs. e.g. set V1 = X1', V2 = X2', then V1' = (50*sin(f(t) - V1)*V2')/sin(f(t)), V2' = g(t) - etc.
You will also need initial conditions for V1 (X1') and V2 (X2') as well as for X1 and X2.
help ODE45 % for further details.
  2 件のコメント
Star Strider
Star Strider 2021 年 9 月 26 日
@Rohit Singh — If you have the Symbolic Math Toolbox, use odeToVectorField and matlabFunction to do the ‘heavy lifting’ to create the function necessary to use the numeric differential equation solvers. They make it easier, and eliminate the possibility of algebra errors.
There are myriad examples in MATLAB Asnwers.
.
Rohit Singh
Rohit Singh 2021 年 9 月 29 日
Thank you @Star Strider for the guidance.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by