Runge-kutta for coupled ODEs
问题 I’m building a function in Octave that can solve N coupled ordinary differential equation of the type: dx/dt = F(x,y,…,z,t) dy/dt = G(x,y,…,z,t) dz/dt = H(x,y,…,z,t) With any of these three methods (Euler, Heun and Runge-Kutta-4). The following code correspond to the function: function sol = coupled_ode(E, dfuns, steps, a, b, ini, method) range = b-a; h=range/steps; rows = (range/h)+1; columns = size(dfuns)(2)+1; sol= zeros(abs(rows),columns); heun=zeros(1,columns-1); for i=1:abs(rows) if i=