Processing math: 100%

Runge–Kutta method

This online calculator implements the Runge-Kutta method, a fourth-order numerical method to solve the first-degree differential equation with a given initial value.

This page exists due to the efforts of the following people:

Timur

Timur

Michele

Michele

Created: 5 years ago, Last updated: 4 years ago
Creative Commons Attribution/Share-Alike License 3.0 (Unported)

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8400/. Also, please do not modify any references to the original work (if any) contained in this content.

You can use this calculator to solve first-degree differential equation with a given initial value using the Runge-Kutta method AKA classic Runge-Kutta method (because there is a family of Runge-Kutta methods) or RK4 (because it is a fourth-order method).

To use this method, you should have differential equation in the form
y \prime = f(x,y)
and enter the right side of the equation f(x,y) in the y' field below.

You also need initial value as
y(x_0)=y_0
and the point x for which you want to approximate the y value.

The last parameter of a method - a step size, is a step to compute the next approximation of a function curve.

Method details can be found below the calculator.

PLANETCALC, Runge–Kutta method

Runge–Kutta method

Digits after the decimal point: 2
Differential equation
y=y
Approximate value of y
2.72
The file is very large. Browser slowdown may occur during loading and creation.

Approximation

nx{n}y{n}k1k2k3k4y{n+1}
0010.10.110.110.111.11
10.11.110.110.120.120.121.22
20.21.220.120.130.130.131.35
30.301.350.130.140.140.151.49
40.41.490.150.160.160.161.65
50.51.650.160.170.170.181.82
60.61.820.180.190.190.202.01
70.72.010.200.210.210.222.23
80.802.230.220.230.230.252.46
90.902.460.250.260.260.272.72
101.002.72

The Runge-Kutta method

Just like Euler method and Midpoint method, the Runge-Kutta method is a numerical method that starts from an initial point and then takes a short step forward to find the next solution point.

The formula to compute the next point is
y_{n+1}=y_n+\frac{1}{6}(k_1+2k_2+2k_3+k_4) \\ x_{n+1}=x_n+h

where h is step size and

k_1=hf(x_n,y_n) \\ k_2=hf(x_n+\frac{h}{2}, y_n+\frac{k_1}{2}) \\ k_3=hf(x_n+\frac{h}{2}, y_n+\frac{k_2}{2}) \\ k_4=hf(x_n+h, y_n+k_3)

The local truncation error of RK4 is of order O\left(h^5\right), giving a global truncation error of order O\left(h^4\right).

URL copied to clipboard
PLANETCALC, Runge–Kutta method

Comments