Using the Runge-Kutta integration method in a system

Published: 14/03/2018
Using the Runge-Kutta integration method in a system
Source: STACKOVERFLOW.COM

h=0.005; x = 0:h:40; y = zeros(1,length(x)); y(1) = 0; F_xy = ; for i=1:(length(x)-1) k_1 = F_xy(x(i),y(i)); k_2 = F_xy(x(i)+0.5*h,y(i)+0.5*h*k_1); k_3 = F_xy((x(i)+0.5*h),(y(i)+0.5*h*k_2)); k_4 = F_xy((x(i)+h),(y(i)+k_3*h)); y(i+1) = y(i) + (1/6)*(k_1+2*k_2+2*k_3+k_4)*h; end I have the following code, I think it's right. I know there's parts missing on the F_xy because this is my follow up ques

Read more
Related news
Comment
FACEBOOK