How do I type the code using Runge-Kutta?

13 ビュー (過去 30 日間)
Jacob Graves
Jacob Graves 2018 年 12 月 10 日
コメント済み: Steven Lord 2018 年 12 月 10 日
Write a function that implements the classical Runge-Kutta fourth-order method for the case of a system of four equations with four unknowns. Use this function to solve the system:
x' = u; y' = v; u' = −2x + (3/2)y; v '= (4/3)x − 3y
subject to the initial conditions x(0) = −1, y(0) = 4, u(0) = 1, v(0) = 1. Use a step size ∆t = 0.01 and (a) Plot the values of the four variables as a function of time, each on a different plot, up to t = 15. (b) Plot u(t) (vertical axis) versus x(t) (horizontal axis) for the same range in t.
  1 件のコメント
Steven Lord
Steven Lord 2018 年 12 月 10 日
Since this sounds like a homework assignment, if you show us what you've written to try to solve the problem and ask a specific question about where you're having difficulty we may be able to offer some guidance.
If this isn't a homework assignment, just use the ODE solvers included in MATLAB, like ode45. Or if it is a homework assignment, use the results from ode45 to check your function's answer.

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

回答 (0 件)

カテゴリ

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