Runge Kutta Method, Lecture Notes - Mathematics, Study notes of Calculus

ranga kutta method, second order, computation solution, fourth order, formulation, multi steps, taylor expand the local truncation error

Typology: Study notes

2010/2011

Uploaded on 10/09/2011

deville
deville 🇺🇸

4.7

(23)

390 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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 differential 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 Modified
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 differentiation. The partial derivatives are
to be evaluated at (t, x(t)).
1
pf3
pf4
pf5

Partial preview of the text

Download Runge Kutta Method, Lecture Notes - Mathematics and more Study notes Calculus in PDF only on Docsity!

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 differential equation ˙x = f (t, x(t)) with error of O(h^2 ), where h is 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 Modified Euler method. The general form of the expression was,

y(t + h) − y(t) = ω 1 hF (t) + ω 2 hf (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(h^3 ), from which we expect the desired global truncation error to be O(h^2 ).

1.2 Computation

We began to evaluate this condition last time by Taylor expanding the func- tion f up to second order in h. Since f is 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) + h^2 ω 2 (αf 1 ?βF fx) + O(h^3 )

where subscripts indicate partial differentiation. The partial derivatives are to be evaluated at (t, x(t)).

The Taylor series of the left side is easily computed,

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

h^2 2

x¨(t) + O(h^3 )

Since these two expression are equal, match terms in h and cancel coef- ficients, such that only terms of O(h^3 ) remain. Matching terms in h yields two equations,

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

¨x(t)

The first equation can be simplified using the definition 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 differential 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 =

ft +

F fx

This equation must hold for all t and x, so it must be that the coefficients of the partial derivatives are separately equal,

ω 2 α = ω 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 =

ω 2 =

α = 1 β = 1

F 3 is analogous to a second more accurate attempt to evaluate f at the midpoint of the interval,

F 3 = f

t +

h 2

, y(t) +

h 2

F 2

F 4 is an attempt to evaluate f at the right endpoint of the interval,

F 4 = f (t, f (t) + hF 3 )

Note. The Fourth-Order Runge-Kutta method can be used in the case that f is a vector function provided that f is not a function of time. In this case f is 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 f must be evaluated four times to calculate the approxima- tion at each mesh point. Computations could be prohibitive if the function f is 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 find an explicit two-step method for obtaining an approximation at the mesh point t + h based only on the values of the approximation and the function F at the previous two mesh points t and t − h. Forming a general linear combination of these points,

y(t + h) + a 2 y(t) + a 1 y(t − h) = h {A 2 F (t) + A 1 F (t − h)}

where F (t) = f (t, y(t)). Our strategy is to choose the coefficients ai and Ai to make the approximation consistent, meaning that the error is as small as is reasonable.

3.2.2 Taylor expand the local truncation error

As always, we substitute the exact solution x(t) into the given differential equation to determine the local truncation error. Subtracting the left hand side of the above equation from the right hand side,

LHS − RHS = x(t + h) + a 2 x(t) + a 1 x(t − h) − h {A 2 x˙(t) + A 1 x˙(t − h)}

Our goal is to cancel as many orders of h as possible from the right side of the above expression. Performing the Taylor expansions of the terms in x(t ± h),

x(t + h) + a 2 x(t) + a 1 x(t − h) = {1 + a 2 + a 1 } + h { 1 − a 1 } x˙(t)

h^2 2

{1 + a 1 } x¨(t) +

h^3 3!

{ 1 − a 1 } ...x(t) + O(h^4 )

Taylor expanding the terms in ˙x,

−h {A 2 x˙(t) + A 1 x˙(t − h)} = −h(A 1 + A 2 ) ˙x + h^2 A 1 ¨x(t)

h^3 2

A 1

x(t) + O(h^4 )

3.2.3 Match coefficients of h

As before, match coefficients of terms in powers in h. Since there are four relevant powers of h, we obtain four equations, which determine the four unknowns. Matching powers of h, h^0 1 + a 1 + a 2 = 0 h^1 1 − a 1 = A 1 + A 2

h^2

(1 + a 1 ) = −A 1

h^3

(1 − a 1 ) =

A 1

The solution to this system of linear equations is,

a 1 = − 5 a 2 = 4 A 1 = 2 A 2 = 4 With this choice of coefficients, we can create a two-step approximation that has local truncation error of O(h^4 ), and so we expect the global trunca- tion error to be O(h^3 ). However, we will see that because we have attempted to cancel the third order terms, this method is not stable.