What is the Runge-Kutta method?

The Runge-Kutta method

The Runge-Kutta (R-K) technique is an efficient and commonly used approach for solving initial-value problems of differential equations.

It's used to generate high-order accurate numerical methods without the necessity for high-order derivatives of functions. The Runge-Kutta method addresses Euler's method challenge in selecting a sufficiently short step size to provide satisfactory accuracy in problem resolution.

Note: Want to read more about ODEs? Refer here.

Formula

Consider an ordinary differential equation dy/dx=f(x,y)dy/dx = f(x, y) with the initial condition y(x0)=y0y(x_0) = y_0.

The formulae for Runge-Kutta methods are defined as follows.

1st1^{st} order R-K method

The formula is defined as follows:

This equation is equivalent to Euler's method.

2nd2^{nd} order R-K method

The following series of formulae are involved in calculating 2nd2^{nd} order R-K method.

Here,

3rd3^{rd} order R-K method

This level of R-K method comprises the following:

Here,

4th4^{th} order R-K method

The R-K4 method is the most frequently used R-K method for solving differential equations.

The Runge-Kutta method estimates yy for a given position xx. The local truncation errorIt is the error introduced by a single iteration., in this case, is of the order of O(h5)O(h^5), whereas the accumulated errorIt is defined as the error introduced by a many iterations. is on the order of O(h4)O(h^4).

Equations for calculating 4th4^{th} order are stated below:

Here,

  • hh is the interval size

  • k1k_1 is the slope at the beginning using yy

  • k2k_2 is the midpoint slop using yyand k1k_1

  • k3k_3 is again the midpoint slope using yy and k2k_2

  • k4k_4 is the slope at the end of the interval using yy and k3k_3

Example

Find y(0.1)y(0.1) for y=xy4y′=\frac{x-y}{4} , y(0)=1y(0) = 1, with step length 0.10.1 using R-K4 method.

Solution

Given the function yy', y(0)=1,h=0.1,y(0.2)=?y(0)=1,h=0.1,y(0.2)= ?

Step 1: Find k1k_1, k2k_2, k3k_3, and k4k_4using the above-aforementioned formulae for R-K4.

Step 2: Now put the values in yy to get y1y_{1} that leads to the result.

Continue the iterations till the optimized desired outcome is obtained.

Q

Find y(0.3)y(0.3) for y=1y3y′=1-y^3 , y(0.1)=0y(0.1)=0, with step length 0.10.1 using R-K2 method.

A)

0.0999875

B)

0.19965

C)

0.674533

Applications

The R-K methods are widely employed in numerous disciplines, primarily in fluid dynamics and mechanics, to optimize fluid solutions. Simulation and games are two further real-world applications of this method.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved