Fall 2003 Math 308/501–502
Numerical Methods
3.6, 3.7, 5.3 RungeKutta Methods
Mon, 27/Oct
c
±
2003, Art Belmonte
Summary
Geometrical idea
RungeKutta methods numerically approximate the solution of
y
0
=
f
(
t
,
y
),
y
(
a
)
=
y
0
by using weighted averages of slopes near a point instead of the
single slope involved by following the tangent line at a point.
These methods are much more accurate than Euler’s method.
The secondorder RungeKutta (RK2) method
Let [
a
,
b
] be the interval over which an approximation to the
solution is desired. (Thus
t
=
a
and
t
=
b
are the initial and ﬁnal
values of the independent variable, respectively.) Partition this
interval into
N
subintervals each of length
h
=
(
b

a
)/
N
, called
the
step size
.Le
t
t
0
=
a
and deﬁne
t
k
+
1
=
t
k
+
h
,
for
k
=
0
,
1
,...,
N

1
.
Notice that
t
N
=
b
and the other
t
k
sodeﬁned are the interior
endpoints of the subintervals. These collectively are the discrete
values of the independent variable.
The initial value of the dependent variable is given by the initial
condition,
y
(
a
)
=
y
(
t
0
)
=
y
0
. The other discrete dependent
variable values are computed iteratively as follows.
for
k
=
0to
N

1
s
1
=
f
(
t
k
,
y
k
)
s
2
=
f
(
t
k
+
h
,
y
k
+
hs
1
)
t
k
+
1
=
t
k
+
h
y
k
+
1
=
y
k
+
h
s
1
+
s
2
2
This method is a
singlestep
numerical solver since it depends
only on data obtained from the preceding step. It is a
ﬁxedstep
solver since the lengths of the subintervals of [
a
,
b
] are all equal.
The maximum error in the approximation over the interval [
a
,
b
]
satisﬁes the following upper bound.
maximum error
≤
M
L
±
e
L
(
b

a
)

1
²
h
2
Here
L
=
max
(
t
,
y
)
∈
R
³
³
³
³
∂
f
∂
y
³
³
³
³
where
R
is a rectangle containing the
solution curve. This constant is the same as in Euler’s method.
The constant
M
is different than that in Euler’s method, but it also
depends only on the values of
f
and some of its derivatives over
R
. The fact that
h
occurs to the second power in the error bound is
the reason that we say that this method is a
secondorder
method.
The fourthorder RungeKutta (RK4) method
Let the independent variable values
t
k
be as above. The initial
value of the dependent variable is given by the initial condition,
y
(
a
)
=
y
(
t
0
)
=
y
0
. The other discrete dependent variable values
are computed iteratively as follows.
for
k
=
N

1
s
1
=
f
(
t
k
,
y
k
)
s
2
=
f
´
t
k
+
h
2
,
y
k
+
h
2
s
1
µ
s
3
=
f
´
t
k
+
h
2
,
y
k
+
h
2
s
2
µ
s
4
=
f
(
t
k
+
h
,
y
k
+
3
)
t
k
+
1
=
t
k
+
h
y
k
+
1
=
y
k
+
h
s
1
+
2
s
2
+
2
s
3
+
s
4
6
This method is also a
singlestep
numerical solver since it
depends only on data obtained from the preceding step. It is a
ﬁxedstep
solver since the lengths of the subintervals of [
a
,
b
]are
all equal.
The maximum error in the approximation over the interval [
a
,
b
]
satisﬁes the following upper bound.
maximum error
≤
M
L
±
e
L
(
b

a
)

1
²
h
4
Here
L
=
max
(
t
,
y
)
∈
R
³
³
³
³
∂
f
∂
y
³
³
³
³
where
R
is a rectangle containing the
solution curve. This constant is the same as in Euler’s method.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 comech
 Math, step size, diary file, tspan, function Mfile

Click to edit the document details