1

To solve a single 2nd order differential equation using the 4th order Runge-Kutta method, it is desirable to write the equation as two coupled first order differential equations. Two such coupled 1st order equations are of the general form: $$\frac{dx}{dt}=f(t,x,y) \qquad \frac{dy}{dt}=g(t,x,y)$$ We get the approximate solution $(x_n,y_n)$ at time $t_n, n=1,2,..$ via the iteration $$x_{n+1}=x_n+\frac{h}{6}(k_{n1}+2k_{n2}+2k_{n3}+k_{n4})$$ $$y_{n+1}=y_n+\frac{h}{6}(l_{n1}+2l_{n2}+2l_{n3}+l_{n4})$$ where $$k_{n1}=hf(t_n,x_n,y_n)$$ $$l_{n1}=hg(t_n,x_n,y_n)$$ $$k_{n2}=hf(t_n+h/2,x_n+k_{n1}/2,y_n+l_{n1}/2)$$ $$l_{n2}=hg(t_n+h/2,x_n+k_{n1}/2,y_n+l_{n1}/2)$$ $$k_{n3}=hf(t_n+h/2,x_n+k_{n2}/2,y_n+l_{n2}/2)$$ $$l_{n3}=hg(t_n+h/2,x_n+k_{n2}/2,y_n+l_{n2}/2)$$ $$k_{n4}=hf(t_n+h,x_n+k_{n3},y_n+l_{n3})$$ $$l_{n4}=hg(t_n+h,x_n+k_{n3},y_n+l_{n3})$$

QUESTION:

Now, I am trying to solve a system of 2nd order equations (e.g., two 2nd order equations).

Is it correct if I apply the same method in this case, i.e., can I write each 2nd order equation as two coupled first order equations? In such a case, two 2nd order equations can be written as four 1st order equations.

Richard
  • 585
  • 1
    Yes, that is correct so far. For details and simplifications in the second order case, see also https://math.stackexchange.com/questions/4176684/how-to-implement-a-runge-kutta-method-rk4-for-a-second-order and links there. – Lutz Lehmann Mar 12 '22 at 12:21

0 Answers0