List of basic formulas for Euler and Runge-Kutta methods:
Euler’s method
Euler’s method is used for the numerical solution of ordinary differential equations (ODE) of the first order. The basic formula is:
- The general formula for Euler’s method is:
[
y_{n+1} = y_n + hf(t_n, y_n)
]
where:
- ( y_n ) — the value of the function at the point ( t_n ),
- ( h ) — time step,
- ( f(t_n, y_n) ) is a function describing the right-hand side of the ODE.
Method Runge-Kutty
The Runge-Kutta method is more accurate and is often used to solve ODEs. The most popular is the Runge-Kutta method of the fourth order (RK4):
- Formulas for the 4th-order Runge-Kutta method:
[
k_1 = hf(t_n, y_n)
]
[
k_2 = hf\left(t_n + \frac{h}{2}, y_n + \frac{k_1}{2}\ right)
]
[
k_3 = hf\left(t_n + \frac{h}{2}, y_n + \frac{k_2}{2}\right)
]
[
k_4 = hf(t_n + h, y_n + k_3)
]
[
y_{n+1} = y_n + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)
]
Notes
- ( t_n ) — current time value,
- ( y_n ) — the current value of the function,
- ( h ) — time step,
- ( f(t, y) ) is a function describing the right-hand side of the ODE.