Docsity

Stability Regions and Runge-Kutta Methods: A Recap, Study notes of Mathematics

Toggle sidebar
bg1
Recap: Last Lecture
Finding Stability Regions
Runge-Kutta Methods
Numerical Solutions to Differential Equations
Lecture Notes #4 — Stability Regions Revisited &
Runge-Kutta Methods
Peter Blomgren,
Department of Mathematics and Statistics
Dynamical Systems Group
Computational Sciences Research Center
San Diego State University
San Diego, CA 92182-7720
http://terminus.sdsu.edu/
Spring 2009
Peter Blomgren, h[email protected]iStability Regions Revisited & RK-Methods — (1/34)
Recap: Last Lecture
Finding Stability Regions
Runge-Kutta Methods
Outline
1Recap: Last Lecture
2Finding Stability Regions
Euler’s Method
Taylor Series Methods
3Runge-Kutta Methods
Introduction
s-stage RK-methods
Types of RK-methods
Derivation
Peter Blomgren, h[email protected]iStability Regions Revisited & RK-Methods — (2/34)
Recap: Last Lecture
Finding Stability Regions
Runge-Kutta Methods
Last Lecture: Quick Review
Euler’s Method:
Analysis: Local Truncation Error (LTE), Consistency,
Accuracy, Stability (Region of Stability), Convergence
Improvements:
Higher order Taylor Series Methods
Multi-Point Methods
Heun’s Method
Euler’s “Midpoint Method”
Peter Blomgren, h[email protected]iStability Regions Revisited & RK-Methods — (3/34)
Recap: Last Lecture
Finding Stability Regions
Runge-Kutta Methods
Stability Regions Revisited
Recall: Euler’s Method
yn+1 =yn+hf (tn,yn),y(t0) = y0
applied to
y′(t) = λy(t)
gives
yn+1 =yn+hλyn= (1 + hλ)yn= (1 + hλ)n+1y0.
The stability criterion is (non-exponential growth):
|1 + hλ| ≤ 1
Peter Blomgren, h[email protected]iStability Regions Revisited & RK-Methods — (4/34)
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Stability Regions and Runge-Kutta Methods: A Recap and more Study notes Mathematics in PDF only on Docsity!

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Numerical Solutions to Differential Equations^ Lecture Notes #4 — Stability Regions Revisited &

Runge-Kutta Methods^ Peter Blomgren, 〈[email protected]

Department of Mathematics and Statistics^ Dynamical Systems GroupComputational Sciences Research Center^ San Diego State UniversitySan Diego, CA 92182-7720^ http://terminus.sdsu.edu/^ Spring 2009 Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (1/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Outline^1 Recap: Last Lecture^2 Finding Stability Regions^ Euler’s Method^ Taylor Series Methods^3 Runge-Kutta Methods^ Introduction^ s-stage RK-methods^ Types of RK-methods^ Derivation^ Peter Blomgren,

〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods Last Lecture: Quick Review^ Euler’s Method:^ Analysis: Local Truncation Error (LTE), Consistency,Accuracy, Stability (Region of Stability), Convergence^ Improvements:^ Higher order Taylor Series Methods^ Multi-Point Methods^ Heun’s Method^ Euler’s “Midpoint Method”^ Peter Blomgren,

〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (3/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods Stability Regions Revisited^ Recall: Euler’s Method

y=^ y+^ hfn+1^ n^

(t,^ y),^ y^ (nn

t) =^ y^00

applied to

′ y (t) =^ λy^ (t) gives^ yn+^

=^ y+^ hλyn^ n^

= (1 +^ hλ)yn

n+1= (1 + hλ) y.^0

The stability criterion is (non-exponential growth):

|1 +^ hλ| ≤^1 Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Euler’s MethodTaylor Series Methods Finding the Stability Region^ How do we find the stability region from the expression

|1 +^ hλ| ≤^1. The boundary of the region is given by1 +^

iθ^ hλ = e⇔

iθ^ hλ = e− 1 ,^ θ^ ∈^ [0,^2

π) -4^ -2^0

2 4 (^4 20) -2 -

Euler’s Method Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (5/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Euler’s MethodTaylor Series Methods Stability Regions for Higher Order Taylor Series Methods^ Consider^ y^ (t) =i+

nk∑^ h(k)y^ (t) +i^ k!^ k=

n+1h(n+1) y^ (n + 1)!^ (ξ),^ ξ∈^ [ti^ i^

,^ t]i i+

′Now, with y ( t) =^ λy^ (t) we have′′^ y^ (t) =

′^2 λy (t) =^ λy (t)

So

(n)n y (t) =^ λy (t) And it follows that^ y^ (t) =i+

nk∑^ (hλ)y^ (t) + i^ k!^ k=

n+1(hλ)(n+1)y^ (n + 1)!^ (ξ),^ ξ∈^ [ti^ i^

,^ t]i i+

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Euler’s MethodTaylor Series Methods Stability Regions for Higher Order Taylor Series Methods^ The stability criterion is given by the relation

y^ (t) =^ y^ (ti+

[^ nk∑^ (hλ)) 0 k!^ k= ]i+

i.e.^

∣^ ∣^ n∣∣k∑^ (hλ)∣∣∣∣≤∣∣^ k!^ k=

Again, the boundary is given by

nk∑^ (hλ)=^ e^ k!^ k=

iθ Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (7/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Euler’s MethodTaylor Series Methods Plotting the Boundary of the Stability Region^ For^ n^ = 4 we have

(^4) (hλ)(hλ)+ 24 32 (hλ)+ + ( 6 2

iθhλ) + 1 − e

matlab〉〉^ z = roots([1/24 1/6 1/2 1 1-exp(i*

θ)])

Now, vary^ θ^ in the interval [

,^2 π), collect all the roots, and plot in the complex plane (

x^ =real(z),^ y

=imag(z)) — -4^ -2^0

2 4 (^4 20) -2 -

Euler’s Method Taylor (n=4)^ Figure:

The circle correspondingto Euler’s Method is included forcomparison. Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

Linear Multistep Methods: Reverse Catch-22^ When we look at Linear Multistep Methods (which use multiplepoints^ y,n

y,^...^ ,^ yn−^1 n

in order to compute−k

y), we will seen+

that they have the reverse problem: —^ for this class of methods it is easy to estimate the local error(⇒^ easy to know when a change in step-size is necessary tomaintain a certain level of local accuracy),^ but the multistep structure makes it hard to change thestep-size...^ Peter Blomgren,

〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (13/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

A General^ s-stage RK method^ A general^

s-stage RK method for the problem′^ y^ (t) =

f^ (t,^ y^ ),^ y^ (t

) =^ y 00

is defined by

y=^ y+^ hn+1^ n^

s∑^ bki^ i i= where the^ ks are multiple estimates of the right-hand-sidei^

f^ (t,^ y^ )

  k= ft+i n^ ch,^ y+^ hi^ n^

 s∑^ ak,^ i,j j j= i^ = 1,^2 ,... ,^ s

with the following row-sum condition

s∑ c=^ ai i,j^ j= i^ = 1,^2 ,... ,^ s Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Example: Heun’s Method is an RK 2-stage Method^ k^1

=^ f^ (t,^ y)^ nn

⇒^ c= 0,^ a^1

= 0,j

k=^ f^ (t^2 n^

+^ h,^ y+^ hkn^1

)^ ⇒^ c= 1,^2

a= 1,^ a^2 ,^1

y=^ yn+1^ n^

[^ k+^ k^1 2 + h^2 ]^ ⇒^ b=^1

(^1) b= 2 2

The^ Butcher Array

describing Heun’s Method caa 1 1 ,^1 1 ,^2 caa^ = 2 2 ,^1 2 ,^2 bb^1

0 0 0 1 1 0 1 /^2 1 /^2

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (15/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Example: Euler’s Midpoint Method^ k=^1

f^ (t,^ y)^ nn

⇒^ c= 0,^ a^1

= 0,j ( k= f^ t 2 n hk^1 + ,^ y+^ n^2 )h ⇒^ c=^2 11 ,^ a=^ ,^2 ,^1 2

a= 0^2 ,^2

y=^ yn+1^ n^

+^ hk^2

⇒^ b= 0,^ b^1

The^ Butcher Array

describing Euler’s Midpoint Method caa 1 1 ,^1 1 ,^2 caa^ = 2 2 ,^1 2 ,^2 bb^1

0 0 0 1 /^2 1 /^2 00

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

The Butcher Array^ The Butcher array for a general

s-stage RK method is caa^1 1 ,^1 1 ,^2

· · ·^ a 1 ,s caa^2 2 ,^1 2 ,^2

· · ·^ a 2 ,s ......... caas^ s,^1 s,^2

· · ·^ a s,s bb· · ·^ b 1 2 s

˜c^ A = T^ ˜b

We define the

s-dimensional vectors

˜ b,^ ˜c^ and the s^ ×^ s-matrix

A:

˜b^ = [b,^ b,... ,^12

T^ b],^ ˜c^ = [s c,^ c,... ,^ c]^12 s^

T^ ,^ A^ = [ai,j

s] i,j=

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (17/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

3 Types of RK-methods, I/III^ Explicit

(e.g.^ Heun’s and Midpoint): If each^ konly depends on previously computedj^

k(i^ <^ j),i^

then the method is

explicit, and the matrix

A^ is strictly lower

triangular (i.e.^

the elements on and above the diagonal are zero). Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation 3 Types of RK-methods, II/III^ Semi-implicit

∗ If A is lower-triangular with non-zero entries on the diagonal,then each kis defined by a non-linear system:i^   k= ft+^ ch,^ yi n^ i^ n

 i∑^ + ak i,j j j= ,^ i^ = 1,^2 ,... ,

s

We have to solve

s^ non-linear (but uncoupled) systems of equations in each iteration... ∗ Butcher (1965) calls these methods “Semi-implicit,” Norsett(1974) “Semi-explicit,” and Alexander (1977) “DiagonallyImplicit RK” or DIRK methods. Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (19/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation 3 Types of RK-methods, III/III^ Implicit

: If A is a general matrix (non-zeros above the diagonal) theneach^ kis defined by a non-linear system:i^  ^ k=^ ft+i^ n^

s∑ ch, y+^ ai n j=  ^ k,^ i^ = 1i,j j ,^2 ,... ,^ s

We have to solve

s^ non-linear^ coupled

systems of equations in each iteration... This is a daunting computational task whichwe will try to avoid! Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

Deriving Explicit 2-stage RK-methods, II/III^ With the following Taylor expansions:^ y=n+^

y+^ hf+^ n^ n^

(^2) h′^3 f^ +^ O(h)^ n^2 k=^ f^1 n k=^ f^ (t^2 n^

+^ ch,^ y+^ c^2 n^2

hk)^1 =^ f+ (chn^2

∂) f^ (t,^ y) + (nn ∂t^

∂chf) f^ (t, 2 nn ∂y^

(^2) y) + O(h)n

We can define the Local Truncation Error^ LTE(h)^ =^

y−^ yn+1^ n−^ b^1 h^

k−^ (1^ −^ b)k^1

2 [h′ =^ f+^ f^ n^ n^2

] (^2) + O(h)^ − [^ ( − bf− (1 − b)^ f+ ( 1 n 1 n^ [^ ∂ch)f+^2 n^ ∂t

])]∂f· fn n ∂y

[^ h∂ = f+n^2 ∂t

]∂ f· f^ −^ bn n ∂y [^ ∂chf+^22 n^ ∂t

]∂f· f^ +^ O(n n ∂y (^2) h)

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (25/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

Deriving Explicit 2-stage RK-methods, III/III^ We have^ LTE(h) =

[^ h∂∂ f+^ n^2 ∂t^ ∂y

] f· f^ −^ bchn n^22 [^ ∂∂f+^ fn^ n^ ∂t^ ∂y

]^2 · f^ +^ O(h)n

Now, if^

h−^ bch^ = 0^222

⇔^2 bc= 1^22 we get LTE(h

(^2) ) ∼ O(h),^ i.e. our 2-stage RK-method is

second

order. The corresponding family of Butcher arrays is

0 0

0 cc^2

0 1 −^1 /(2c)^12

/(2c)^2

Sanity check:

c= 1/2 gives Euler’s Midpoint Method, and^2

c= 1^2

gives Heun’s Method.^ Peter Blomgren,

〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Deriving Explicit Higher Order RK-methods^ We can use the same approach — Taylor expansion and parametermatching, to find higher order explicit RK-methods.^ Natural question:

Is^ this^ the

best^ way^ of

deriving^ the

RK-

methods? Answer:^ There are more elegant methods for deriving the RK-methods. Most of the work was done by Butcher startingin the mid-1960s. The methods depend on defining the^ Frechet derivative

and also requires some basic under- standing of graph theory (“rooted trees.”) Butcher, J.C. (1987),^ The Numerical Analysis of Ordinary DifferentialEquations: Runge-Kutta and General Linear Methods

, Wiley, Chichester.

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (27/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Example: 3-stage RK-method^ c^1

aa 1 ,^1 1 ,^2 a^1 ,^3 caa^2 2 ,^1 2 ,^2

a 2 ,^3 caa^3 3 ,^1 3 ,^2

=a 3 , (^3) bbb 1 2 3

1 /^2 1 /^2

01 − 1 2 01 / 6 2 / 3 1 /^6

k=^ f^ (t,^1 n

y)n ( k= f^ t 2 n hhk^1 + ,^ y+^ n^2

k=^ f^ (t^3 n^

+^ h,^ y−^ hkn^1

  • 2hk) 2 y=^ yn+1^ n^

h+ (k+ 4k^1 +^ k) 3

(See next slide for visualization.)^ Peter Blomgren,

〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

Example: 3-stage RK-method

One Step

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

Figure:^ Different “stages” of onestep of the 3-stage RK method. Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (29/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation

Example: 4-stage RK-method (Attributed to Runge)^ ca^1 1 ,^1

aa 1 ,^2 1 ,^3 a^1 ,^4 caa^2 2 ,^1 2 ,^2

aa 2 ,^3 2 ,^4 caa^3 3 ,^1 3 ,^2

aa 3 ,^3 3 ,^4 caa^4 4 ,^1 4 ,^2

aa 4 ,^3 4 ,^4 bbbb 1 2 3 4

1 /^2 1 /^2

1 /^2 0 1 /

2 0 01 0 0 1 01 / 6 1 / 3 1 /^3 1 /^6

k=^ f^ (t,^1 n

y)n ( k= f^ t 2 n hhk^1 + ,^ y+^ n^2

( k= f^ t 3 n

hkh^2 + , y+ (^) n 2 2

k=^ f^ (t^4 n^

+^ h,^ y+^ hkn^3

y=^ yn+1^ n^

h+ (k+ 2k^1

〉^ Stability Regions Revisited & RK-Methods

— (30/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Example: Runge’s 4-stage method

One Step

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

1.98^2 2.02^ 2.04^ 2.06^ 2.08^ 2.^

2. 1/2^2 y’(t) = ty, y(2)=2 3.2 (^3) 2.8 2.6 2.4 2.2 (^2) 1.

Peter Blomgren,^ 〈[email protected]

〉^ Stability Regions Revisited & RK-Methods

— (31/34)

Recap: Last LectureFinding Stability RegionsRunge-Kutta Methods

Introduction s-stage RK-methodsTypes of RK-methodsDerivation Example: 4-stage RK-method (Attributed to Kutta)^ ca^1 1 ,^1

aaa^1 ,^2 1 ,^3

,^4 caa^2 2 ,^1 2 ,^2

aa 2 ,^3 2 ,^4 caa^3 3 ,^1 3 ,^2

aa 3 ,^3 3 ,^4 caa^4 4 ,^1 4 ,^2

aa 4 ,^3 4 ,^4 bbbb 1 2 3 4

1 /^3 1 /^3

2 /^3 −^1 /^3

1 1 01 / 8 3 /^8 3 /^8 1 /^8

k=^ f^ (t^1 n

,^ y)n ( k= f^ t 2 n hhk^1 + ,^ y+^ n^3

( k= f^ t 3 n

hk 2 h+ , y− (^) n (^3) ) 1 + hk (^23) k=^ f^ (t^4 n^

+^ h,^ y+^ hkn^1

−^ hk+^ hk) 2 3 y=^ yn+1^ n^

h+ (k+ 3k^1

〉^ Stability Regions Revisited & RK-Methods

— (32/34)