Runge-Kutta Methods
2
Runge-Kutta methods are very popular
because of their good efficiency; and are used in most computer programs for
Runge-Kutta Methods
3
To convey some idea of how the Runge-Kutta
is developed, let’s look at the derivation of
the 2nd order. Two estimates
n n 1
2
n n
1
2 1
n 1
n
,
,
k
y
h
x
hf
k
y
x
hf
k
bk
ak
y
y
Runge-Kutta Methods
4
The initial conditions are:
The Taylor series expansion
n2 n
2 2
n n
n 1
n
,
!
2
,
dx
y
x
y
d
h
dx
y
x
dy
h
x
y
x
y
x
y
f
dx
dy
,
Runge-Kutta Methods
5
From the Runge-Kutta
The definition of the function
Expand the next step
Runge-Kutta
Methods
6
From the Runge-Kutta
Compare with the Taylor series
2 2 yn 1
n
y
a
b
hf
b
h
f
b
h
f
f
y
2
1
2
1
1
b
b
b
a
Runge-Kutta Methods
7
The Taylor series coefficients (3 equations/4 unknowns)
If you select “a” as
If you select “a” as
Note: These coefficient would result in a modified Euler or Midpoint Method
2
1
,
2
1
,
1
b
b
b
a
2
3
,
2
3
,
3
1
,
3
2
b
a
1
,
2
1
2
1
b
Runge-Kutta Method
(2
nd
Order) Example
8
Consider Exact Solution
The initial condition is: The step size is:
Use the coefficients
1
.
0
h
0
1
y
2
y
dx
dy
1
,
2
1
2
1
b
a
x
y
Runge-Kutta Method (2
ndOrder) Example
9
The values are
1 2
i 1
i
1 i
i 2
i i
1
2
1
,
,
k
k
y
y
k
y
h
x
hf
k
y
x
hf
k
Runge-Kutta Method
(2
nd
Order) Example
10
The values are equivalent of Modified Euler
k1 Estimate Solution k2 Exact Error
xn yn y'n hy'n y*n+1 y*' n+1 h(y*'n+1 )
Runge-Kutta Method
(2
nd
Order) Example [b]
11
The values are
Runge-Kutta Method
(2
nd
Order) Example [b]
12
The values are
k1 Estimate Solution k2 Exact Error
xn yn y'n hy'n y*n+1 y*' n+1 h(y*'n+1 ) Exact
Runge-Kutta Methods
13
The Runge-Kutta methods are higher
order approximation of the basic forward integration. These methods provide
solutions which are comparable in
accuracy to Taylor series solution in which higher order derivatives are retained.
Runge-Kutta Methods
14
Method Equations
Euler
(Error of the order h2)
Modified Euler
(Error of the order h3)
Heun
(Error of the order h4)
4th order Runge Kutta
The 4th Order Runge-Kutta
15
The general form of the equations:
The 4th Order Runge-Kutta
16
This is a fourth order function that solves an initial value problems using a four step program to get an estimate of the Taylor series through the fourth
order.
This will result in a local error of O(Dh5)
4
th
-order
Runge-Kutta Method
17
xi xi + h/2 xi + h
f1
f2
f3
f4
1 2 2 2 3 4 6
1
f f
f f
f
Runge-Kutta Method
(4
th
Order) Example
18
Consider Exact Solution
The initial condition is: The step size is:
2
x
y
dx
dy
y
2
2
x
x
2
e
x
0
1
y
1
.
0
The 4th Order Runge-Kutta
19
The example of a single step:
109499 .
0 104988
.
104988 .
Runge-Kutta Method (4th Order)
Example
20
The values for the 4th order Runge-Kutta method
x y f(x,y) k 1 f 2 k 2 f 3 k 3 f 4 k 4 Change Exact
Runge-Kutta Method (4th Order)
Example
21
The values are
equivalent to those of the exact solution. If we were to go out to x=5.
y(5) = -111.4129 (-111.4132)
The error is small
relative to the exact solution.
4th Order Runge-Kutta Method
-10 -8 -6 -4 -2 0 2 4
0 1 2 3 4
X Value
Y
V
a
lu
e
Runge-Kutta Method (4th Order)
Example
22
A comparison between the 2nd order and
the 4th order Runge-Kutta methods show a
slight difference.
Runge Kutta Comparison
-10 -8 -6 -4 -2 0 2 4
0 1 2 3 4
X Value
Y
V
a
lu
e
Exact 2nd order 4th order
Error of the Methods
0.00 2.00 4.00 6.00 8.00 10.00
0 1 2 3 4 5
X Value
A
b
s
o
lu
te
|
E
rr
o
r|
Error 2nd order method
The 4th Order Runge-Kutta
23
Higher order differential equations can be treated as if they were a set of
first-order equations. Runge-Kutta type forward integration solutions can be
The 4th Order Runge-Kutta
24
The general form of the 2nd order
equations:
25
The step sizes are: