Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
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)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%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 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!