Can anyone help me with a code for Runge-Kutta 4th Order for 3 coupled equations?

2 ビュー (過去 30 日間)
Vineet Patel
Vineet Patel 2018 年 11 月 3 日
回答済み: Prakhar Jain 2018 年 11 月 12 日
Hi All,
I need help with writing a code for Runge-Kutta 4th order equations.
The 3 equations are:
y_1' = -y_2 - y_3
y_2' = y_1 + (k_1 + y_2)
y_3' = k_2 + y_3(y_1 - k_3)
with initials of:
k_1 = k_2 = 0.2
k_3 = 5.7
Any help would be extremely appreciated.
Thank you
  1 件のコメント
John D'Errico
John D'Errico 2018 年 11 月 4 日
Why not try it? Read the help and examples for ODE45. Or, are you asking someone to write a Runge-Kutta code for you?
If you insist, then why not look on the file exchange? Surely you can find some code there.


回答 (1 件)

Prakhar Jain
Prakhar Jain 2018 年 11 月 12 日
Hi Vineet,
You can start learning from here and how to code for Runge-kutta 4th order.
You can also compare your answer with the ODE45 in MATLAB.
Also, refer this file exchange link for further assistance.


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

Community Treasure Hunt

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

Start Hunting!

Translated by