Runge-Kutta Method

Adrian Down

April 25, 2006

1 Second-order Runge-Kutta method

1.1 Review

Last time, we began to develop methods to obtain approximate solutions to

the diﬀerential equation ˙x=f(t, x(t)) with error of O(h2), where his the

spacing of the mesh used to calculate the approximation. To construct these

methods, our goal was to minimize the local truncation error. We saw that,

in general, the global truncation error should be one order less in h.

Last time, we introduced an approximation that generalized the Modiﬁed

Euler method. The general form of the expression was,

y(t+h)−y(t) = ω1hF (t) + ω2hf (t+αh, y(t) + βhF (t))

where F(t)≡f(t, y(t)). Our proposal was to choose ω1, ω2, α and βsuch

that the local truncation error of the approximation is O(h3), from which we

expect the desired global truncation error to be O(h2).

1.2 Computation

We began to evaluate this condition last time by Taylor expanding the func-

tion fup to second order in h. Since fis a function of two variables, we

used the Taylor formula for multiple dimensions. We obtained,

x(t+h)−x(t) = h(ω1+ω2)F(t) + h2ω2(αf1?βF fx) + O(h3)

where subscripts indicate partial diﬀerentiation. The partial derivatives are

to be evaluated at (t, x(t)).

1

The Taylor series of the left side is easily computed,

x(t+h)−x(t) = h˙x(t) + h2

2¨x(t) + O(h3)

Since these two expression are equal, match terms in hand cancel coef-

ﬁcients, such that only terms of O(h3) remain. Matching terms in hyields

two equations,

(ω1+ω2)F(t) = ˙x(t)ω2(αft+βF fx) = 1

2¨x(t)

The ﬁrst equation can be simpliﬁed using the deﬁnition of f,

F(t) = f(t, x(t)) = ˙x

⇒(ω1+ω2) = 1

The second equation can be solved by taking the time derivative of the

diﬀerential equation. This yields partial derivatives, which can be compared

with those on the left of the equation,

˙x=f(t, x(t)) ⇒¨x=ft+fx˙x

=ft+F fx

⇒ω2αft+ω2βF fx=1

2ft+1

2F fx

This equation must hold for all tand x, so it must be that the coeﬃcients of

the partial derivatives are separately equal,

ω2α=ω2β=1

2

1.3 Solutions

We now have three equations and four unknowns. This system is under-

determined, meaning that we should expect a family of solutions in one

parameter.

One possible choice of parameters is,

ω1=1

2ω2=1

2α= 1 β= 1

2

This choice corresponds to the trapezoid rule approximation scheme.

Another possible choice of parameters is,

ω1= 0 ω2= 1 α=1

2β=1

2

This choice corresponds to the Modiﬁed Euler method developed earlier.

2 Fourth-order Runge-Kutta method

2.1 Motivation

The fourth-order Runge-Kutta method is commonly used in science and en-

gineering applications. However, the computations required are less than

optimal, as we will see.

2.2 Formulation

The approximation scheme for the fourth-order Runge-Kutta approximation

is,

y(t+h)−y(t) = 1

6{F1+ 2F2+ 2F3+F4}

where the Fi’s are recursively deﬁned below.

Note. The Fi’s are constructed such that Fi→F(t, y(t)) as h→0. The

factor of 1

6is to normalize due to the four factors of F. at t= 0.

The deﬁnition of the Fi’s can be understood intuitively as attempts to

evaluate the function fat the midpoint and endpoints of the mesh interval

over which the function is being approximated. F1is the value of the function

fat the left endpoint of the interval,

F1=f(t, y(t))

In the spirit of the Modiﬁed Euler method, F2is analogous to an attempt at

evaluating the function fat the midpoint of the approximation interval,

F2=ft+h

2, y(t) + h

2F1

3

F3is analogous to a second more accurate attempt to evaluate fat the

midpoint of the interval,

F3=ft+h

2, y(t) + h

2F2

F4is an attempt to evaluate fat the right endpoint of the interval,

F4=f(t, f(t) + hF3)

Note. The Fourth-Order Runge-Kutta method can be used in the case that

fis a vector function provided that fis not a function of time. In this case

fis a function only of position. This is called the autonomous case.

3 Multi-step methods

3.1 Motivation

The fourth-order Runge-Kutta method is not computationally optimal be-

cause the function fmust be evaluated four times to calculate the approxima-

tion at each mesh point. Computations could be prohibitive if the function

fis complicated.

Multistep methods attempt to avoid this problem by creating an approx-

imation based on the values of the approximation at previous points. Al-

though such methods reduce computations, some such methods may not be

stable in all situations. When using multi-step methods, it is necessary to

verify the convergence of the method.

3.2 Two-step method

3.2.1 Setup

We ﬁnd an explicit two-step method for obtaining an approximation at the

mesh point t+hbased only on the values of the approximation and the

function Fat the previous two mesh points tand t−h. Forming a general

linear combination of these points,

y(t+h) + a2y(t) + a1y(t−h) = h{A2F(t) + A1F(t−h)}

where F(t) = f(t, y(t)). Our strategy is to choose the coeﬃcients aiand Ai

to make the approximation consistent, meaning that the error is as small as

is reasonable.

4

##### Document information

Uploaded by:
deville

Views: 4643

Downloads :
0

University:
University of California (CA) - UCLA

Subject:
Calculus I

Upload date:
09/10/2011