Class 18th Dec

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

numerical methods for

differential equations and


applications

Supervisor: Camile Fraga Delfino Kunz

December 11th and 18th, 2018


What do we have for today?

• IVP stability analysis:


• Zero-stability;
• Absolute stability.
Linear Multistep Method (LMM)

A general Linear Multistep Method (LMM) can be writen like:


r
X r
X
n+j
αj U = k βj f (U n+j , tn+j )
j=0 j=0

where k is the discrete time step.


Observations:
• An r-step method needs starting values U0 , U1 , . . . , Ur −1 ;
• If βr = 0, the method is explicit;
• Else, If βr 6= 0 it is implicit.
Linear Multistep Method (LMM)

Examples
• Explicit Adams-Bashforth methods:
• 1-step: U n+1 = U n + kf (U n )
k
• 2-step: U n+2 = U n+1 + ( −f (U n ) + 3f (U n+1 ) )
2
• Implicit Adams-Moulton methods:
k
• 1-step: U n+1 = U n + ( f (U n ) + f (U n+1 ) )
2
k
• 2-step: U n+2 = U n+1 + ( −f (U n ) + 8f (U n+1 ) + 5f (U n+2 ) )
12
Linear Multistep Method (LMM)

Local Truncation Error (LTE)


Consider the problem u 0 (t) = f (u, t). Let us obtain a general
formula for the LTE for LMM’s:
r r
1X X 
τ (tn+r ) = αj u(tn+j ) − k βj u 0 (tn+j )
k j=0 j=0

where we have used f (u, t) = u 0 (t).

Expanding on Taylor series...


Linear Multistep Method (LMM)
Local Truncation Error (LTE)
Expanding on Taylor Series... Considering that tn+j = tn + jk,
where k is the time step,
1
u(tn+j ) = u(tn ) + jku 0 (tn ) + (jk)2 u 00 (tn ) + . . .
2
1
u (tn+j ) = u (tn ) + jku (tn ) + (jk)2 u 000 (tn ) + . . .
0 0 00
2
Substituting on the LTE,
r r
1X  X 
τ (tn+r ) = αj u(tn ) + (jαj − βj u 0 (tn )+
k j=0 j=0
r
X 1 
k ( (jk) αj − jβj ) u 00 (tn ) + . . .
2

j=0
2
Linear Multistep Method (LMM)
Local Truncation Error (LTE)
The method is consistent if τ → 0 as k → 0 on
r r
1X  X 
τ (tn+r ) = αj u(tn ) + (jαj − βj u 0 (tn )+
k j=0 j=0
r
X 1 
k ( (jk)2 αj − jβj ) u 00 (tn ) + . . .
j=0
2

For this to happen we would require:


r
X r
X r
X
αj = 0, and jαj = βj
j=0 j=0 j=0
Linear Multistep Method (LMM)
Characteristic polynomials

r
X r
X
j
ρ(ζ) = αj ζ and σ(ζ) = βj ζ j
j=0 j=0

Consistency:
Note that ρ(1) = αj and ρ0 (ζ) = jαj ζ j−1 .
P P
The LMM is consistent if

ρ(1) = 0 and ρ0 (1) = σ(1).


Characteristic polynomials
Example
The 2-step Adams-Moulton method
k
U n+2 = U n+1 + ( −f (U n ) + 8f (U n+1 ) + 5f (U n+2 ) )
12
has characteristic polynomials

ρ(ζ) = ζ 2 − ζ
1
σ(ζ) = (−1 + 8ζ + 5ζ 2 )
12
The method is consistent,

ρ(1) = 12 − 1 = 0
1
ρ0 (1) = 1 and σ(1) = (−1 + 8 + 5) = 1 ⇒ ρ0 (1) = σ(1).
12
Linear Multistep Method (LMM)
Starting values
• One difficulty with using LMMs if r > 1 is that we need
starting values U 0 , U 1 , . . . , U r −1 before we can apply the
multistep method.
• Usually we have U 0 from the IVP and U 1 , . . . , U r −1 need
to be generated by some other numerical method.
• The starting values typically depend on k, so we can write
U 0 (k), . . . , U r −1 (k). These values approximate u(t) at
the times t0 = 0, t1 = k, . . . , tr −1 = (r − 1)k and as
k ⇒ 0 each of these times approaches to t0 = 0.
Linear Multistep Method (LMM)

Starting values
The starting values are reasonable if they converge to the
initial value u(0) as k ⇒ 0, that is,

lim U ν (k) = u(0)


k⇒0
Linear Multistep Method (LMM)

Global Error
• It is the difference between the exact solution and the
approximation at a certain value of time T;
• It is cumulative result of the errors introduced in each of
steps of size k = T /N, and the propagation of errors
accumulated earlier steps to later steps;
• These errors may be either be amplified or attenuated
from earlier steps to later steps.
Linear Multistep Method (LMM)

Local Truncation Error


Does not include the effect of prior errors, it is the difference
between one step of an approximate solution and the exact
solution sharing the same initial value and time interval over
that time step.
Example

Consider the problem:


(
u 0 (t) = 0 , t ∈ (0, 1]
u(0) = 0

The exact solution is u(t) = 0, t ∈ [0, 1].

Suppose that we want to use the method

U n+2 − 3U n+1 + 2U n = −kf (U n )

to find the numerical solution.


Example

The method

U n+2 − 3U n+1 + 2U n = −kf (U n )

is consistent. The LTE is given by


1
τn = (u(tn+2 ) − 3u(tn+1 ) + 2u(tn )) + k f (u(tn ))
k
5 00
ku (tn) + o(k 2 )
2
and |τ | → 0 as k → 0. But the global error will not exhibit
convergence.
Example
Applying the method to the problem,

U n+2 − 3U n+1 + 2U n = 0

so we need starting values U 0 and U 1 .


By the initial value, it is given that U 0 = 0.

1st approach: Let us choose U 1 = 0, then we have


U2 = 0 , U3 = 0 , . . . , UN = 0

and the method converges to the exact solution for every


choice of time step k.
Example

2nd approach: Let us choose now U 1 = k.


It is a valid starting value, since U 1 (k) → 0 as k → 0.

If the method is convergent, we should see that U N , the


computed solution at time T = 1, converges to zero as k → 0.
But instead the solution blows up!

Let us see...
Example

The solution for the difference equation


U n+2 = 3U n+1 − 2U n

can be found if we suppose that the solution is given by


U n = C λn . The roots of the characteristic polynomial are
λ = 2 and λ = 1.
Considering the starting values U 0 and U 1 , the solution for the
difference equation is

U n = 2U 0 − U 1 + 2n (U 1 − U 0 )

The solution blows up because λ > 1.


Solving linear difference equations

Consider a general LMM applied to the problem


(
u 0 (t) = 0 , t ∈ (0, 1]
u(0) = 0

it would look like the rth-order difference equation


Xr
αj U n+j = 0
j=0

It require starting values U 0 , U 1 , . . . , U r −1 .


Solving linear difference equations
Suppose, as hypothesis, that the solution has the form

Un = ζn

So substituting on the difference equation, we get


r
X
αj ζ n+j = 0
j=0

where ζ is the root of the polynomial


r
X
ρ(ζ) = αj ζ n+j
j=0
Solving linear difference equations

In general, ρ(ζ) has roots ζ1 , ζ2 , . . . , ζr , and the solution has


the form

U n = c1 ζ1n + c2 ζ2n + . . . + cr ζrn

The constants c1 , c2 , . . . , cr can be uniquely determined by


solving the liner system


 c1 + c2 + . . . + cr = U 0

 c1 ζ1 + c2 ζ2 + . . . + cr ζr = U 1

..


 .
 c ζ r −1 + c ζ r −1 + . . . + c ζ r −1 = U r −1

1 1 2 2 r r
Solving linear difference equations

Remarks:
• If the roots ζ1 , ζ2 , . . . , ζr are, in modulus, greater than
one, the method will not converge.

• Suppose that we have repeated roots ζ1 = ζ2 , then the


solution will be U n = (c1 + nc2 )ζ1n + c3 ζ3n + . . . + cr Urn .

• Now if we have three repeated roots ζ1 = ζ2 = ζ3 , then


the solution will be
U n = (c1 + nc2 + n2 c3 )ζ1n + c4 ζ4n + . . . + cr Urn .
Solving linear difference equations

Example
Consider the IVP
(
u 0 (t) = 0
u(0) = 0

and the LMM


5 1 1
U n+3 − 2U n+2 + U n+1 − U n = kf (U n )
4 4 4
Solving linear difference equations
Example
The LMM applied to the IVP
5 1
U n+3 − 2U n+2 + U n+1 − U n = 0
4 4
The characteristic polynomial is ρ(ζ) = ζ 3 − 2ζ 2 + 45 ζ − 1
4
with roots ζ1 = 1 and ζ2 = ζ3 = 12 . The solution is
 1 n
n
U = c1 + (c2 + c3 n)
2
In this case even with a root equal one the method converges.
It is because
 1 n qe have two repeated roots less than one and the
decay is faster than the growth 1n .
2
Zero-stability
Definition
An r-step LMM is said to be zero-stable if the roots of the
characteristic polynomial ρ(ζ) satisfy

|ζj | ≤ 1 , for j = 1, 2, . . . , r

• If ζj is a repeated root, then we should have ζj < 1.


• Zero-stability tells us that a method will converge if we
take k small enough, but tells us nothing about how
solution will look like for a fixed k.
• We can think of zero-stability as meaning “stable in the
limit as k → 0”.
Zero-stability

Theorem (Dahlquist)
For the LMM applied to the IVP u 0 (t) = f (u, t),
consistency + zero-stability ⇐⇒ convergence

• A consistent zero-stable method is convergent, but it may


have other stability problems that shows up if the time
step k chosen is too large.
Absolute stability
Absolute stability determines if a method gives reasonable
results with a given value of k > 0.

Example: Consider the problem u 0 (t) = λu.


Using Euler method to solve it we get

U n+1 = (1 + kλ)U n

We say that this method is absolutely stable when


|1 + kλ| ≤ 1; otherwise it is unstable. Note that there are two
parameters but only the product z = kλ matters. The method
is stable whenever −2 ≤ Re(z) ≤ 0.
Absolute stability

Definition (stability region):


The region of absolute stability for a LMM is the set of points
z in the complex plane for which the polynomial

π(ζ) = ρ(ζ) − zσ(ζ)

satisfies the root condition, that is, the roots should be, in
modulus, less or equal one. And if there is a repeated root, it
should me less than one.
Stability region

Figure 1: Stability region for a) Euler; b) Backward Euler;


c)Trapezoidal; d)Midpoint. [1]
References

1. Leveque, R. J. Finite Difference Methods for Ordinary


and Partial Differential Equations. SIAM, 2007.

2. Boyce, W.E., DiPrima, R.C. Elementary Differential


Equations and Boundary Value Problems. John Wiley &
Sons,10th ed., 2012.

You might also like