Function uses the third-order Runge–Kutta scheme

3 ビュー (過去 30 日間)
Can
Can 2022 年 10 月 15 日
編集済み: Jan 2022 年 10 月 15 日
function y = odesRK3(f, t, y0)
n=length(t);
y=nan(length(y0),n);
y(:,1)=y0(:);
for k=1:n-1
h=t(k+1)-t(k);
F1=h*f(t(k),y(:,k));
F2=h*f(t(k)+h/2,y(:,k)+(F1/2));
F3=h*f(t(k)+0.75*h,y(:,k)+(0.75*F1));
y(:,k+1)=y(:,k)+(2*F1+3*F2+4*F3)/9;
end
  2 件のコメント
Torsten
Torsten 2022 年 10 月 15 日
And do you also have a question ?
John D'Errico
John D'Errico 2022 年 10 月 15 日
This must be like a quiz show. We are given the answer, and now we need to guess the question.
I will guess, "What color is the bluebird?"

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by