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

30.07.

2010

MATH5004-LEC2
FDM: Consistency, stability, converence, and error estimates

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

OUTLINE

 Global error
 Local truncation error
 Convergent method
 Grid refinement analysis
 Stencils for the 2D Laplacian
 Example

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 1
30.07.2010

Definition of the global error


Let 𝐔 = 𝑈 , … , 𝑈 be he solution of finite difference
scheme (assume no round-ff errors),
u = 𝑢(𝑥 ), … , 𝑢(𝑥 ) be the exact solution at grid points.
The global error vector is defined as 𝐄 = 𝐔 − 𝐮.
• The maximum norm (or the infinity norm) is

• The 1-norm is

• The 2-norm is

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

If 𝐄 ≤ 𝐶ℎ , 𝑝 > 0, C is a constant independent of h


the finite difference (FD) scheme is p-th order accurate
Definition A FD scheme is called convergent if lim 𝐄 = 0

Local truncation error
Consider the DE 𝑢 =𝑓 or 𝐿𝑢 = 𝑓 …..(1)

L is the differential operator 𝐿 =


By applying FDM
( )
DE(1) becomes =𝑓
or 𝐿 𝑢 = 𝑓
The local truncation error is 𝑇(𝑥) = 𝐿𝑢 − 𝐿 𝑢
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 2
30.07.2010

For the DE 𝑢 = 𝑓(𝑥)


and the three-point central difference scheme,
the local truncation error is
𝑇(𝑥) = 𝐿𝑢 − 𝐿 𝑢
𝑢 𝑥 + ℎ − 2𝑢 𝑥 + 𝑢(𝑥 − ℎ)
=𝑢 −

𝑢 𝑥 + ℎ − 2𝑢 𝑥 + 𝑢(𝑥 − ℎ)
= 𝑓(𝑥) −

which measures how well the FD discretisation
approximates the DE
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Convergent Method
Definition A finite difference scheme is called consistent if
lim 𝑇 𝑥 = lim 𝐿𝑢 − 𝐿 𝑢 = 0
→ →

To check whether a FD scheme is consistent or not,


we use Taylor expansion.
For the DE 𝑢 = 𝑓 𝑥 , we have
𝑢 𝑥 + ℎ − 2𝑢 𝑥 + 𝑢(𝑥 − ℎ)
𝑇(x) = 𝑢 −


≈− 𝑢 𝑥 = Cℎ
12 So the FD scheme
lim 𝑇 𝑥 = lim Cℎ = 0 is consistent.
→ →
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 3
30.07.2010

As the consistence cannot guarantee a finite difference


work, the stability of a FD scheme is required.
For the model problem, we have
𝐴𝐮 = 𝐅 + 𝐓, 𝐴𝐔 = 𝐅
𝐴(𝐮 − 𝐔) = 𝐓

𝐴𝐄 = 𝐓

A is the coefficient matrix of the FD equations,


F is the modified source term by the BC,
T is the vector of the local truncation error at grid points
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

𝐴𝐄 = 𝐓
If A is non-singular, then

If A is singular, then
may be arbitrary large.

For the central FD scheme, we have

Thus, the global error depends on both the local


truncation error and
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 4
30.07.2010

Definition
A FD method for the elliptic DE is stable if A is
invertible and

where C and ℎ are constants

Theorem
A consistent and stable finite difference scheme is
convergent.

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

Grid refinement analysis


Assume that a method is p-th order accurate, i.e.,

We can divide h by half to get


We then have

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

10

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 5
30.07.2010

Improvement of Accuracy of Solution


Deferred Approach to the Limit
By reducing the value of k and h, i.e., through mesh refinement.
Denote u = true solution,
uh = finite difference solution,
then u = uh + error.
Let uh be the solution of the Laplace equation by using the 5
point scheme, then
u = uh +Ch2 .

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

11

 Based on the above formulae, to accelerate the convergence of


numerical solutions, we could use the so-called deferred
approach to the limit suggested by Richardson.

u = u1 +Chp . (1.1)
If mesh size h is reduced from h to h/2, then

u = u2 +C(h/2)p. (1.2)
where u2 is the approximation obtained with h/2.

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

12

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 6
30.07.2010

From (1.1) and (1.2), by eliminating ℎ , we obtain

2 p u2 - u1 (1.3)
u= p
.
2 - 1
For example, for p = 2,

4u2 - u1
u=
3

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

13

 If p is unknown, it can be estimated from three approximate


solutions at the same point obtained by using different mesh
sizes.
 Let u1 , u2 and u3 are approximations at the same point
obtained respectively using step size h1 , h2 and h3 where
1 1
h3 = h2 = h1
2 4
Then

𝑢 = 𝑢 + 𝐶ℎ ,

𝑢 =𝑢 +𝐶 ℎ ,

𝑢 =𝑢 +𝐶 ℎ ,

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

14

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 7
30.07.2010

from which, we have

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J

15

Elliptic equations
In two space dimensions, a constant-coefficient elliptic
equation has the form
𝑎𝑢 + 𝑏𝑢 + 𝑐𝑢 + ℎ 𝑥, 𝑦, 𝑢, 𝑢 , 𝑢 = 𝑓(𝑥, 𝑦)

where the coefficients 𝑎, 𝑏, 𝑐 satisfy


𝑏 − 4𝑎𝑐 < 0.

Consider the problem


𝑢 +𝑢 = 𝑓(𝑥, 𝑦), 0 ≤ 𝑥, 𝑦 ≤ 1

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

16

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 8
30.07.2010

Stencils for the 2D Laplacian

The five-point stencil The nine-point stencil

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

17

Accuracy and Stability: the five-point stencil

Let ∆𝑥 = ∆𝑦 = ℎ
𝑇(𝑥) = 𝐿𝑢 − 𝐿 𝑢
𝑢 , +𝑢 , +𝑢, +𝑢, − 4𝑢 .
= (𝑢 +𝑢 ) −

1
𝑇 =𝑓 − 𝑢 . +𝑢 . +𝑢. +𝑢 . − 4𝑢 .

1
𝑇 = ℎ 𝑢 +𝑢 + 𝑂(ℎ )
12

The global error 𝐸 = 𝑢(𝑥 , 𝑢 ) − 𝑢


𝐴 E =T
B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

18

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 9
30.07.2010

Accuracy and Stability: the nine-point stencil

∇ 𝑢(𝑥 , 𝑦 )

∇ 𝑢(𝑥 , 𝑦 )

It is noted that the error is still 𝑂 ℎ .

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

19

Since

From DE ∇ 𝑢 = 𝑓, we have

We can obtain a fourth-order accurate method of the


form

∇ 𝑢 = 𝑓 𝑥 ,𝑦 + ∇ 𝑓 𝑥 ,𝑦 ,
12

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

20

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 10
30.07.2010

Example
Given
𝑢 +𝑢 =𝑥 𝑦 , 0 ≤ 𝑥, 𝑦 ≤ 𝜋

𝑢 0, 𝑦 = 0, 𝑢 𝜋, 𝑦 = 1
𝜕𝑢(𝑥, 0)
𝑢 𝑥, 𝜋 = 0, = 1.
𝜕𝑦
For 5 grid points in x-direction and 5-grid points in y-
direction,

• Derive the five-point FD equations of the PDE


• Derive the nine-point FD equations of the PDE

B Wiwatanapataphee 8/16/2020
Curtin University is a trademark of Curtin University of Technology
CRICOS Provider Code 00301J

21

Curtin University is a trademark of Curtin University of Technology


CRICOS Provider Code 00301J 11

You might also like