Loading [MathJax]/jax/output/HTML-CSS/jax.js

Labels

Thursday, June 18, 2020

Runge-Kutta Method

The fourth order Runge-Kutta method (RK4) is the most widely used algorithm for solving an ordinary differential equation.
dy/dx=f(x,y)
yn+1=yn+h6(k1+k2+k3+k4),
where
k1=f(xn,yn)
k2=f(xn+h2,yn+h2k1
k3=f(xn+h2,yn+h2k2
k4=f(xn+h,yn+hk3).

k1 is the slope at the beginning of the interval [xn,xn+h].
k2 is the slope at the midpoint of the interval, using slope k1 to determine the value of y at the point xn+h/2 using Euler's method. 
k3 is again the slope at the midpoint, but now using the slope k2 to determine the y value, y(x0+nh+h/2)=y(x0+nh)+h/2f(x0+nh+h/2,y(x0+nh)+h/2k1).
k4 is the slope at the end of the interval, with its y value determined using k3.
  

No comments:

Post a Comment