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)

조회 수: 3 (최근 30일)
%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