1. Numerical solution of ordinary and
partial differential Equations
Module 6: Runge-Kutta methods - I
Dr.rer.nat. Narni Nageswara Rao∗
August 2011
1 Single Step Methods
The methods for the solution of the initial value problem
y = f(t, y), y(t0) = y0, t ∈ [t0, b] (1)
can be classified mainly into two types. They are (i) Single step methods
and (ii) Multi step methods.
In single step methods, the solution at any point is obtained using the
solution at only the previous point. Thus, a general single step method can
be written as
yj+1 = yj + hφ(tj+1, tj, yj, yj+1, h) (2)
where φ is a function of the arguments tj, tj+1, yj, yj+1, h and also depends
on f. We often write it as φ(t, y, h). This function φ is called the increment
function. If yj+1 can be obtained simply by evaluating the right hand side
of (2), then the method is called an explicit method. In this case, the
method is of the form
yj+1 = yj + hφ(tj, yj, h) (3)
If the right hand side of (2) depends on yj+1 also, then it is called an implicit
method. The general form in this case is as given in (2).
∗
nnrao maths@yahoo.co.in
1
2. 1.1 Local truncation error or Discretization error
The true(exact) value y(tj) satisfied the equation
y(tj+1) = y(tj) + hφ(tj+1, tj, yj, yj+1, h) + Tj+1
where Tj+1 is called the local truncation error or discretization error of the
method. Therefore, the truncation error is given by
Tj+1 = y(tj+1) − y(tj) − hφ(tj+1, tj, y(tj+1), y(tj), h) (4)
1.2 Order of a method
The order of a method is the largest integer p for which
1
h
Tj+1 = O(hp
) (5)
we now derive single step methods which have different increment functions.
2 Runge-Kutta Methods
The principle involved in the Runge-Kutta methods is explained as follows.
Integrating the Differential equation
y = f(t, y) on the interval [tj, tj+1] (6)
we get
tj+1
tj
dy
dt
dt =
tj+1
tj
f(t, y)dt (7)
By the mean value theorem of integral calculus, we obtain
y(tj+1) = y(tj) + hf(tj + θh, y(tj + θh)), 0 < θ < 1 (8)
Any value of θ ∈ [0, 1] produces a numerical method. Consider the following
cases.
Case θ = 0 when θ = 0, we obtain the approximation
yj+1 = yj + hf(tj, yj) (9)
which is the Euler method.
2
3. Case θ = 1 when θ = 1, we obtain
y(tj+1) = y(tj) + hf(tj + h, y(tj))
we have the numerical method is
yj+1 = yj + hfj+1 (10)
which is the backward Euler method.
If we approximate yj+1 = yj + hfj in (10), that is Euler method, in the
argument of f, we get
yj+1 = yj + hf(tj + h, yj + hfj) (11)
If we put
K1 = hfj
K2 = hf(tj+1, yj + K1)
we get the method as
yj+1 = yj + K2 (12)
Case θ = 1
2
when θ = 1
2
, we obtain
y(tj+1) = y(tj) + hf tj +
h
2
, y tj +
h
2
(13)
However, tj + h
2
is not a nodal point.
If we approximate y tj + h
2
in (13), by Euler method with spacing h/2,
we get
y tj +
h
2
= yj +
h
2
fj
Then, we have the approximation
yj+1 = yj + hf tj +
h
2
, yj +
h
2
fj (14)
If we set
K1 = hfj
K2 = hf tj +
h
2
, yj +
1
2
K1
3
4. then (14) can be written as
yj+1 = yj + K2 (15)
Alternating, if we use the approximation
y tj +
h
2
≈
1
2
[y (tj) + y (tj + h)]
and the Euler method, we obtain
y tj +
h
2
≈
1
2
[f(tj, yj) + f(tj+1, yj + hfj)]
Thus, (13) may be approximated by
yj+1 = yj +
h
2
[f(tj, yj) + f(tj+1, yj + hfj)] (16)
If we set
K1 = hfj
K2 = hf(tj+1, yj + K1)
then, (16) can be written as
yj+1 = yj +
1
2
[K1 + K2] (17)
This method is also called Euler-Cauchy method.
Consider now, the equation (7). The integrand on the right hand side,
f(t, y), is the slope of the solution curve which varies continuously in the inter-
val [tj, tj+1]. In deriving the Euler method given by (9), we may interpret that
the slope of the solution curve, which varies continuously on [tj, tj+1] is ap-
proximated by the slope at the initial point, that is by f(tj, yj) ≈ f(tj, y(tj)).
similarly, the methods given in (10) and (13) may be interpreted as the cases
when the slope of the solution curve on [tj, tj+1] is approximated by a single
slope at the terminal point and mid point respectively.
3 General RK Mehtods
Runge-Kutta methods use a weighted average of slopes on the given interval
[tj, tj+1), instead of a single slope. Thus, the general Runge-Kutta methods
may be defined as
yj+1 = yj + h[weighted average of slopes on the given interval]
4
5. Consider ν slopes on [tj, tj+1]. Define
K1 = hf(tj + c1h, yj + a11K1 + a12K2 + · · · + a1νKν)
K2 = hf(tj + c2h, yj + a21K1 + a22K2 + · · · + a2νKν)
· · · = · · · · · · · · ·
Kν = hf(tj + cνh, yj + aν1K1 + aν2K2 + · · · + aννKν) (18)
The Runge-Kutta method is now defined by
yj+1 = yj + W1K1 + W2K2 + · · · + WνKν (19)
This is also called a ν-stage Runge-Kutta method.
It is a fully implicit method which uses ν evaluations of f. The matrix
of coefficients aij is the full ν × ν matrix
A =
a11 a12 · · · a1ν
a21 a22 · · · a2ν
...
...
...
...
aν1 aν2 · · · aνν
(20)
It is very difficult to derive the fully implicit methods. If in A, we set the
elements in the upper triangular part as zeros, then (18), (19) define Semi
implicit methods, where
K1 = hf(tj + c1h, yj + a11K1)
K2 = hf(tj + c2h, yj + a21K1 + a22K2)
· · · = · · · · · · · · ·
Kν = hf(tj + cνh, yj + aν1K1 + aν2K2 + · · · + aννKν) (21)
If in A, we set the elements on the diagonal and the upper triangular part as
zero, then (18), (19) define explicit methods, where
K1 = hf(tj, yj)
K2 = hf(tj + c2h, yj + a21K1)
K3 = hf(tj + c3h, yj + a31K1 + a32K2)
· · · = · · · · · · · · ·
Kν = hf(tj + cνh, yj + aν1K1 + aν2K2 + · · · + aν,ν−1Kν−1) (22)
As mentioned earlier, the methods defined by (18), (19) or (21), (19) or (22),
(19) should compare with the Taylor series method. Hence, to determine the
5
6. parameters ci’s, ai’s and Wi’s in the Runge-Kutta methods, we expand yj+1
and f’s in powers of h such that it agrees with the Taylor series expansion
of the solution of the differential equation up to a certain number of terms.
Butcher proposed a general way of writing the ν-stage explicit Runge-
Kutta method by the tableau 1.
0
c2 a21
c3 a31 a32
...
...
...
...
cν aν1 aν2 · · · aν,ν−1
W1 W2 · · · Wν−1 Wν
Table 1: Explicit Runge-Kutta method
6