Runge–Kutta methods
One-step methods to simulate differential equations
Suppose you have an initial value problem (an ordinary differential equation, ODE, with an initial condition):
You want to approximate the solution at times
with a fixed step size h, i.e.
The whole game is: how do we go from
to
without knowing the true curve solution?
The baseline: Euler is “use the slope at the beginning.”
Euler’s method takes the derivative at the left endpoint and pretends it stays constant for one step:
This is fast, but it can be quite inaccurate: the slope usually changes during the interval.
So the natural upgrade is:
If the slope changes, don’t trust just one slope. Consider more.
A first upgrade: the midpoint idea
A simple fix is to estimate the slope in the middle of the interval, where it’s often “more representative”:
compute the slope at the start:
\(k_1=f(t_n,y_n),\)use it to predict a midpoint value:
\(y_n+\frac{h}{2}k_1\)compute the midpoint slope:
\(k_2=f\!\left(t_n+\frac{h}{2},\,y_n+\frac{h}{2}k_1\right),\)step using that slope:
\(y_{n+1}=y_n+h\,k_2.\)
This is another Runge–Kutta method: you take a few slopes and then combine them.
The general pattern: choose slopes, then take a weighted average
An explicit Runge–Kutta method with s “stages” looks like this:
The coefficients
tell you:
where you sample the slopes through the
how each intermediate guess is built, the
\(a_{ij},\)how to combine the slopes at the end, with the
They’re often written in a compact “Butcher tableau”:
The famous one: RK4
The classic 4th-order method (often just called “RK4”) uses four slopes:
If you stare at the final combination, it’s literally a weighted average of slopes, with extra weight on the “middle” ones.
Two practical notes: step size and stiffness
Step size matters. Even a high-order method fails if h is too large for the dynamics you’re trying to resolve. (A fast-oscillating solution needs small steps.)
Stiff problems are special. For stiff equations, explicit RK methods can be forced to take absurdly small steps to remain stable. That’s where implicit RK methods (or other stiff solvers) enter.
We will discuss how to handle implicit Runge-Kutta methods and simulate ODEs with them in a separate post.
---
If you want more posts like this, consider subscribing to the newsletter and sharing the post:



