Info

この質問は閉じられています。 編集または回答するには再度開いてください。

any one help me ; how can I insert an array I=[600 400 200 100 0] in my code which solved using runge kutta method (this constant(I) change in my equations)

4 ビュー (過去 30 日間)
mohammad abu abbas
mohammad abu abbas 2018 年 4 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%initial condition t(1)=0; Tg(1)=26;
%step size h=1; tfinal=300; N=ceil(tfinal/h);
%update loop for i=1:N %update time t(i+1)=t(i) + h; %update runge kutta loop k1Tg=fTg(t(i) ,Tg(i) ); k2Tg=fTg(t(i)+h/2,Tg(i)+h/2*k1Tg); k3Tg=fTg(t(i)+h/2,Tg(i)+h/2*k2Tg); k4Tg=fTg(t(i)+h ,Tg(i)+h *k3Tg);
Tg(i+1)=Tg(i)+ h/6*(k1Tg + 2*k2Tg + 2*k3Tg + k4Tg);
end

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by