Runge Kutta for system of differential equations

2 ビュー (過去 30 日間)
Melda Harlova
Melda Harlova 2019 年 5 月 2 日
コメント済み: Melda Harlova 2019 年 5 月 3 日
Hello,
I have to solve the following system with method of Runge Kutta:
y1' = y2
y2'=f(x,y1,y2) with y1(0)=0 and y2(0)=y20
where f(x,y1,y2) = -axy1-y1, a=0.03 and y20 = 0.25
  6 件のコメント
Jan
Jan 2019 年 5 月 3 日
I cannot know, what you want to insert for the questionmarks in
plot(x, y(1,:), x, ??, *)
because you did not explain, what you want to achieve. x=0:h:2*pi can be correct of false depending on what you want as values for x. It is impossible to decide if something is correct or not only based on the code. Knowing its purpose is essential.
By the way, use single quotes instead of the apostrophes:
plot(x, y(1,:), x, ??, *)
% ^ ^ Use '
Melda Harlova
Melda Harlova 2019 年 5 月 3 日
Oh yees, thank u for apostrophes.
In the example that i have instead of question marks is the exact solution. But here in this example i dont know the exact solution what is. Also i dont know if without exact solution will be correct.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by