• 沒有找到結果。

1.6 Stability analysis

2.1.1 Some discretization methods

Let us start from the simplest parabolic equation, the heat equation:

ut= uxx

Leth = ∆x, k = ∆t be the spatial and temporal mesh sizes. Define xj = jh, j ∈ Z and tn= nk, n ≥ 0. Let us abbreviate u(xj, tn) by unj. We shall approximateunj byUjn, whereUjnsatisfies some finite difference equations.

Spatial discretization : The simplest one is that we use centered finite difference approximation foruxx:

uxx = uj+1− 2uj + uj−1

h2 + O(h2) This results in the following systems of ODEs

j(t) = Uj+1(t) − 2Uj(t) + Uj−1(t) h2

or in vector form

U =˙ 1 h2AU whereU = (U0, U1, ...)t,A = diag (1, −2, 1).

23

Homeworks.

1. Derive the 4th order centered finite difference approximation foruxx: uxx = 1

h2(−uj−2+ 16uj−1− 30uj+ 16uj+1− uj+2) + O(h4).

2. Derive a 2nd order centered finite difference approximation for(κ(x)ux)x. Temporal discretization We can apply numerical ODE solvers

• Forward Euler method:

Un+1= Un+ k

h2AUn (1.1)

• Backward Euler method:

Un+1 = Un+ k

h2AUn+1 (1.2)

• 2nd order Runge-Kutta (RK2):

Un+1− Un= k

h2AUn+1/2, Un+1/2= Un+ k

2h2AUn (1.3)

• Crank-Nicolson:

Un+1− Un= k

2h2(AUn+1+ AUn). (1.4)

These linear finite difference equations can be solved formally as Un+1= GUn

where

• Forward Euler: G = 1 +hk2A,

• Backward Euler: G = (1 − hk2A)−1,

• RK2: G = 1 + hk2A +12 hk2

2

A2

• Crank-Nicolson: G = 1+

k 2h2A 1−2h2k A

For the Forward Euler, We may abbreviate it as

Ujn+1= G(Uj−1n , Ujn, Uj+1n ), (1.5) where

G(Uj−1, Uj, Uj+1) = Uj+ k

h2(Uj−1− 2Uj+ Uj+1)

2.1. FINITE DIFFERENCE METHODS FOR THE HEAT EQUATION 25 2.1.2 Stability and Convergence for the Forward Euler method

Our goal is to show under what condition canUjnconverges tou(xj, tn) as the mesh sizes h, k → 0.

To see this, we first see the local error a true solution can produce. Plug a true solutionu(x, t) into (1.1). We get

un+1j − unj = k

h2 unj+1− 2unj + unj−1

+ kτjn (1.6)

where

τjn= Dt,+unj − (ut)nj − (D+Dunj − (uxx)nj) = O(k) + O(h2).

Letenj denote forunj − Ujn. Then substract (1.1) from (1.6), we get en+1j − enj = k

h2 enj+1− 2enj + enj−1

+ kτjn. (1.7)

This can be expressed in operator form:

en+1 = Gen+ kτn. (1.8)

kenk ≤ kGen−1k + kkτn−1k

≤ kG2en−2k + k(kGτn−2k + kτn−1k)

≤ kGne0k + k(kGn−1τ0k + · · · + kGτn−2k + kτn−1k) Suppose G satisfies the stability condition

kGnU k ≤ CkUk for someC independent of n. Then

kenk ≤ Cke0k + C maxmm|.

If the local truncation error has the estimate

maxmmk = O(h2) + O(k) and the initial errore0satisfies

ke0k = O(h2), then so does the global true error satisfies

kenk = O(h2) + O(k) for all n.

The above analysis leads to the following definitions.

Definition 1.6. A finite difference method is called consistent if its local truncation errorτ satisfiesh,kk → 0 as h, k → 0.

Definition 1.7. A finite difference schemeUn+1 = Gh,k(Un) is called stable under the norm k · k in a region(h, k) ∈ R if

kGnh,kU k ≤ CkUk for alln with nk fixed. Here, C is a constant independent of n.

Definition 1.8. A finite difference method is called convergence if the true error keh,kk → 0 as h, k → 0.

In the above analysis, we have seen that for forward Euler method for the heat equation, stability + consistency ⇒ convergence.

2.2 L

2

Stability – von Neumann Analysis

Since we only deal with smooth solutions in this section, theL2-norm or the Sobolev norm is a proper norm to our stability analysis. For constant coefficient and scalar case, the von Neumann analysis (via Fourier method) provides a necessary and sufficient condition for stability. For system with constant coefficients, the von Neumann analysis gives a necessary condition for statbility. For systems with variable coefficients, the Kreiss’ matrix theorem provides characterizations of stability condition.

Below, we giveL2stability analysis. We use two methods, one is the energy method, the other is the Fourier method, that is the von Neumann analysis. We describe the von Neumann analysis below.

Given{Uj}j∈Z, we define

kUk2 =X

j

|Uj|2 and its Fourier transform

U (ξ) =ˆ 1 2π

XUje−ijξ.

The advantages of Fourier method for analyzing finite difference scheme are

• the shift operator is transformed to a multiplier:

T U (ξ) = ed U (ξ),ˆ where(T U )j := Uj+1;

• the Parseval equility

kUk2 = k ˆU k2

≡ Z π

−π| ˆU (ξ)|2dξ.

2.2. L2STABILITY – VON NEUMANN ANALYSIS 27 If a finite difference scheme is expressed as

Ujn+1= (GUn)j = Xm i=−l

ai(TiUn)j,

then U[n+1= bG(ξ) cUn(ξ).

From the Parseval equality,

kUn+1k2 = k [Un+1k2

= Z π

−π| bG(ξ)|2| cUn(ξ)|2

≤ max

ξ | bG(ξ)|2 Z π

−π| cUn(ξ)|2

= | bG|2kUk2 Thus a sufficient condition for stability is

| bG|≤ 1. (2.9)

Conversely, suppose| bG(ξ0)| > 1, from bG being a smooth function in ξ, we can find ǫ and δ such that

| bG(ξ)| ≥ 1 + ǫ for all |ξ − ξ0| < δ.

Let us choose an initial dataU0inℓ2such that cU0(ξ) = 1 for |ξ − ξ0| ≤ δ. Then k cUnk2 =

Z

| bG|2n(ξ)|cU0|2

≥ Z

|ξ−ξ0|≤δ| bG|2n(ξ)|cU0|2

≥ (1 + ǫ)2nδ → ∞ as n → ∞

Thus, the scheme can not be stable. We conclude the above discussion by the following theorem.

Theorem 2.6. A finite difference scheme Ujn+1=

Xm k=−l

akUj+kn

with constant coefficients is stable if and only if G(ξ) :=b

Xm k=−l

ake−ikξ satisfies

−π≤ξ≤πmax | bG(ξ)| ≤ 1. (2.10)

Homeworks.

1. Compute the bG for the schemes: Forward Euler, Backward Euler, RK2 and Crank-Nicolson.

2.3 Energy method

We write the finite difference scheme as

Ujn+1= αUj−1n + βUjn+ γUj+1n , (3.11) where

α, β, γ ≥ 0 and α + β + γ = 1.

We multiply (3.11) byUjn+1on both sides, apply Cauchy-Schwarz inequality, we get

(Ujn+1)2 = αUj−1n Ujn+1+ βUjnUjn+1+ γUj+1n Ujn+1

≤ α

2((Uj−1n )2+ (Ujn+1)2) +β

2((Ujn)2+ (Ujn+1)2) + γ

2((Uj+1n )2+ (Ujn+1)2) Here, we have usedα, β, γ ≥ 0. We multiply this inequality by h and sum it over j ∈ Z. Denote

kUk2:=

X

j

|Uj|2h

1/2

.

We get

kUn+1k2 ≤ α

2(kUnk2+ kUn+1k2) + β

2(kUnk2+ kUn+1k2) +γ

2(kUnk2+ kUn+1k2)

= 1

2(kUnk2+ kUn+1k2).

Here,α + β + γ = 1 is applied. Thus, we get the energy estimate

kUn+1k2 ≤ kUnk2. (3.12)

Homeworks.

1. Can the RK-2 method possess an energy estimate?

2.4. STABILITY ANALYSIS FOR MONTONE OPERATORS– ENTROPY ESTIMATES 29

2.4 Stability Analysis for Montone Operators– Entropy Estimates

Stbility in the maximum norm

We notice that the action ofG is a convex combinition of Uj−1, Uj, Uj+1, provided Such an operator G is called a monotone operator.

Definition 4.9. An operator G : ℓ → ℓsatisfying U ≤ V ⇒ GUgV is called a monotone operator.

Entropy estimates

The property that Un+1 is a convex combination (average) of Un is very important. Given any convex functionη(u), called entropy function, by Jenson’s inequality, we get

η(Ujn+1) ≤ αη(Uj−1n ) + βη(Ujn) + γη(Uj+1n ) (4.14)

This means that the “entropy” decreases in time. In particular, we choose

• η(u) = |u|2, we recover theL2stability, the generalLpstability. Takingp → ∞, we recover Lstability.

• η(u) = |u − c| for any constant c, we obtain X

j

|Ujn+1− c| ≤X

j

|Ujn− c|

This is called Kruzkov’s entropy estimate. We will see this in hyperbolic quations again.

Homeworks.

1. Show that the solution of the difference equation derived from the RK2 satisfies the entropy estimate. What is the condition required onh and k for such entropy estimate?

2.5 Entropy estimate for backward Euler method

In the backward Euler method, the amplification matrix is given by

G = (I − λA)−1 (5.16)

where

λ = k

h2, A = diag(1, −2, 1).

The matrixM := I − λA has the following property:

mii> 0, mij ≤ 0, X

j6=i

|mij| ≤ mii (5.17)

Such a matrix is called an M-matrix.

Theorem 5.7. The inverse of an M-matrix is a nonnegative matrix, i.e. all its entries are non-negative.

I shall not prove this general theorem. Instead, I will find the inverse ofM for the above specific M-matrix. Let us express

M = I − λ diag(1, −2, 1) = 1 + 2λ

2 diag(−a, 2, −a).

Here,

a = 2λ

1 + 2λ, and 0 < a < 1 if h, k > 0.

The general solution of the difference equation

−auj−1+ 2uj − auj+1= 0 (5.18)

has the form:

uj = C1ρj1+ C2ρj2

2.5. ENTROPY ESTIMATE FOR BACKWARD EULER METHOD 31 whereρ1, ρ2are the characteristic roots, i.e. the roots of the polynomial equation

−aρ2+ 2ρ − a = 0.

Now, we define a fundamental solution:

gj = (

ρj1 forj ≥ 0 ρj2 forj < 0 .

We can check thatgj → 0 as |j| → ∞. Moreover, gj satisfies the difference equation (5.18) for

|j| ≥ 1. For j = 0, we have

Thus,M−1 = (gi−j) is a positive matrix (i.e. all its entries are positive). Further more, X

j

gi−j = 1 for all i.

Such a matrix appears commonly in probability theory. It is called transition matrix of a Markov chain.

Let us go back to our backward Euler method for the heat equation. We get that Un+1= (1 − λA)−1= GUn,

with initial dataUj0 = δj. This finite difference equation is conservative, namely,P

jUjnis inde-pendent. This can easily be checked. Thus, we getP

jgj =P

jδj = 1. With this and the positivity ofgj, we can thinkUjn+1is a convex combination ofUjnwith weights gj. Thus,G is a monotone operator.With this property, we can apply Jansen’s inequality to get the entropy estimates:

Theorem 5.8. Letη(u) be a convex function. Let Ujnbe a solution of the difference equation derived from the backward Euler method for the heat equation. Then we have

X

j

η(Ujn) ≤X

j

η(Uj0). (5.19)

Remark. It is important to note that there is no restriction on the mesh sizesh and k for stability for the Backward Euler method.

Homeworks.

1. Can the Crank-Nicolson method for the heat equation satisfy the entropy estimate? What is the condition onh and k?

2.6 Existence Theory

We can prove existence theorem of PDEs through finite difference approximation. In order to do so, let us define continuous and discrete Sobolev spaces and make a connection between them.

The continuous Sobolev space

Hm := {u : R → R|u, u, ..., u(m) ∈ L2(R)}

The discrete Sobolev space for functions defined on gridGh := {jh|j ∈ Z}.

Hhm:= {U : Gh → R|U, Dx,+U, ..., Dx,+m U ∈ ℓ2}.

Here,(Dx,+U )nj := (Uj+1n − Ujn)/h

For any discrete functionUj ∈ Hhmwe can construct a functionu in Hmdefined by u(x) :=X

j

Ujφh(x − xj) (6.20)

whereφh(x) = sinc(x/h). We have

uh(xj) = Uj It can be shown that

kDxmuhk ≡ kDmx,+U k. (6.21)

Similarly, the spaceLk (Hhm) can be embeded into L(Hm) by defining uh,k(x, t) =X

n≥0

X

j

Ujnφk(t)φh(x)

The discrete norm and the continuous norm are equivalent.

2.6.1 Existence via forward Euler method

The forward Euler method for the heat equationut= uxxreads Ujn+1= Ujn+ k

h2 Uj−1n − 2Ujn+ Uj+1n  .

2.6. EXISTENCE THEORY 33 Here, We have seen that we can get the energy estimate:

kUnk ≤ kU0k.

We perform finite difference operation on the above equation, say the forward Euler equation, for instance, letVjn = (Dx,+U )nj := (Uj+1n − Ujn)/h. Then Vjn satisfies the same finite difference equation

Vjn+1 = Vjn+ k

h2 Vj−1n − 2Vjn+ Vj+1n  .

Thus, it also possesses the same energy estimate. Similar estimate forDx,+2 U . In general, we have kDx,+m Unk ≤ kDmx,+U0k. (6.22) If we assume the initial dataf ∈ H2, then we getUn∈ Hh2for alln ≥ 0.

Theorem 6.9. If the initial datau0 ∈ Hm,m ≥ 2 and k/h2 ≤ 1/2, then the solution of forward Euler equation has the estimate

kDx,+m Unk ≤ kDmx,+U0k, kDt,+Unk ≤ kDx,+2 U0k (6.23) Further, the corresponding smoothing functionuh,k has the same estimate and has a subsequence converges to a solutionu(x, t) of the original equation.

Proof. The functionsuh,kare unformly bounded in W1,∞(H2). Hence they have a subsequence converges to a function u ∈ W1,∞(H2) weakly in W1,∞(H2) and strongly in L(H1). The functionsuh,ksatisfy

uh,k(xj, tn+1) − uh,k(xj, tn) = k

h2(uh,k(xj−1, tn) − 2uh,k(xj, tn) + uh,k(xj+1, tn)) Multiply a test smooth function φ, sum over j and n, take summation by part, we can get the subsubsequence converges to a solution ofut= uxxweakly.

2.6.2 A Sharper Energy Estimate for backward Euler method

In this subsection, we will get a sharper energy estimate for solutions obtained from the backward Euler method. Recall the backward Euler method for solving the heat equation is

Ujn+1− Ujn= λ(Uj−1n+1− 2Ujn+1+ Uj+1n+1) (6.24) whereλ = k/h2. An important technique is the summation by part:

X

j

(Uj− Uj−1)Vj = −X

j

Uj(Vj+1− Vj) (6.25)

There is no boundary term because we consider periodic condition in the present case.

We multiply both sides byUjn+1, then sum overj. We get X

j

(Ujn+1)2− Ujn+1Ujn= −λX

j

|Uj+1n+1− Ujn+1|2.

The term

Ujn+1Ujn≤ 1

2((Ujn+1)2+ (Ujn)2) by Cauchy-Schwartz. Hence, we get

1 2

X

j

(Ujn+1)2− (Ujn)2)

≤ −λX

j

|Uj+1n+1− Ujn+1|2

Or

1

2Dt,−kUn+1k2≤ −h2 k

k

h2kDx,+Un+1k = −kDx,+Un+1k2. (6.26) where,

Dt,−Vjn+1 := Vjn+1− Vjn

k , Dx,+Ujn+1:= Uj+1n+1− Ujn+1

h ,

We sum inn from n = 1 to N , we get the following theorem.

Theorem 6.10. For the backward Euler method, we have the estimate

kUNk2+ C XN n=1

kDx,+Unk2 ≤ kU0k2 (6.27)

This gives controls not only onkUnk2 but also onkDx,+Unk.

Homeworks.

1. Show that the Crank-Nicolson method also has similar energy estimate.

2. Can forward Euler method have similar energy estimate?

2.7 Relaxation of errors

In this section, we want to study the evolution of an error. We consider

ut= uxx+ f (x) (7.28)

with initial dataφ. The error enj := u(xj, tn) − Ujnsatisfies

en+1j = enj + λ(enj−1− 2enj + enj+1) + kτjn (7.29)

2.7. RELAXATION OF ERRORS 35 We want to know how error is relaxed to zero from an initial errore0. We study the homogeneous finite difference quation first. That is

en+1j = enj + λ(enj−1− 2enj + enj+1). (7.30) oren+1 = G(un). The matrix is a tridiagonal matrix. It can be diagonalized by Fourier method.

The eigenfunctions and eigenvalues are

vk,j = e2πijk/N, ρk = 1 − 2λ + 2λ cos(2πk/N) = 1 − 4λ sin2(πk/N ), k = 0, ..., N − 1.

Whenλ ≤ 1/2, all eigenvalues are negative except ρ0:

1 = ρ0 > |ρ1| > |ρ2| > · · · . The eigenfunction

v0 ≡ 1.

Hence, the projection of any discrete functionU onto this eigenfunction is the average:P

jUj. Now, we decompose the error into

en=X enkvk Then

en+1k = ρkenk. Thus,

enk = ρnke0k.

We see thatenkdecays exponentially fast excepten0, which is the average ofe0. Thus, the average of initial error never decay unless we choose it zero. To guarantee the average ofe0 is zero, we may chooseUjnto be the cell average ofu(x, tn) in the jth cell:

Ujn= 1 h

Z xj+1/2

xj−1/2

u(x, tn) dx.

instead of the grid data. This implies the initial error has zero local averages, and thus so does the global average.

The contribution of the truncation to the true solution is:

en+1= ρkenk+ ∆tτkn Its solution is

enk = ρnke0k+ ∆t

n−1X

m=0

ρn−1−mk τkm

We see that the termen0 does not tend to zero unlessτ0m = 0. This can be achieved if we choose Uj as well asfjto be the cell averages instead the grid data.

Homeworks.

1. DefineUj := h1Rxj+1/2

xj−1/2 u(x) dx. Show that if u(x) is a smooth periodic function on [0, 1], then

u′′(xj) = 1

h2(Uj−1− 2Uj+ Uj+1) + τ withτ = O(h2).

2.8 Boundary Conditions

2.8.1 Dirichlet boundary condition

Dirichlet boundary condition is

u(0) = a, u(1) = b. (8.31)

The finite difference approximation of uxx at x1 involves u at x0 = 0. We plug the boundary contion:

uxx(x1) = U0− 2U1+ U2

h2 + O(h2) = a − 2U1+ U2

h2 + O(h2) Similarly,

uxx(xN −1) = UN −2− 2UN −1+ UN

h2 + O(h2) = UN −2− 2UN −1+ b

h2 + O(h2)

The unknowns areU1n, ..., UN −1n withN −1 finite difference equations at x1, ..., xN −1. The discrete Laplacian becomes

A =





−2 1 0 · · · 0 0 1 −2 1 · · · 0 0 ... ... ... . .. ... ...

0 0 0 · · · 1 −2



. (8.32)

This discrete Laplacian is the same as a discrete Laplacian with zero Dirichlet boundary condition.

We can have energy estimates, entropy estimates as the case of periodic boundary condition.

Next, we exame how error is relaxed for the Euler method with zero Dirichlet boundary con-dition. From Fourier method, we observe that the eigenfunctions and eigenvalues for the forward Euler method are

vk,j= sin(2πjk/N ), ρk= 1 − 2λ + 2λ cos(2πk/N) = 1 − 4λ sin2(πk/N ), k = 1, ..., N − 1.

In the present case, all eigenvalues

ρi < 1, i = 1, ..., N − 1.

provided the stability condition

λ ≤ 1/2.

2.8. BOUNDARY CONDITIONS 37 Thus, the errorseni decays to zero exponentially for alli = 1, ..., N − 1. The slowest mode is ρ1

which is

ρ1 = 1 − 4λ sin2(π/N ) ≈ 1 − 4 π N

2

and

ρn1



1 − 4 π N

2n

≈ e−4π2t where we have usedk/h2is fixed andnk = t.

2.8.2 Neumann boundary condition

The Neumann boundary condition is

u(0) = σ0, u(1) = σ1. (8.33) We may use the following disrete discretization methods:

• First order:

U1− U0

h = σ0.

• Second order-I:

U1− U0

h = ux(x1/2) = ux(0) + h

2uxx(x0) = σ0+h 2f (x0)

• Second order-II: we use extrapolation

3U0− 2U1+ U2 2h2 = σ0.

The knowns are Ujn with j = 0, ..., N . In the mean time, we add two more equations at the boundaries.

Homeworks.

1. Find the eigenfunctions and eigenvalues for the discrete Laplacian with the Neumann bound-ary condition (consider both first order and second order approximation at boundbound-ary). Notice that there is a zero eigenvalue.

Hint: You may use Matlab to find the eigenvalues and eigenvectors.

Here, I will provide another method. SupposeA is the discrete Laplacian with Neumann boundary condition. A is an (N + 1) × (N + 1) matrix. Suppose Av = λv. Then for j = 1, ..., N − 1, v satisfies

vj−1− 2vj+ vj+1= λvj, j = 1, ..., N − 1.

Forv0, we have

−2v0+ 2v1= λv0. ForvN, we have

−2vN + 2vN −1= λvN. Then this matrix has the following eigenvectors:

vjk= cos(πjk/N ), with eigenvalue

λk= −2 + 2 cos(πk/N) = −4 sin2

πk 2N

 .

Homeworks.

1. Complete the calculation.

2. Consider

ut= uxx+ f (x)

on[0, 1] with Neumann boundary condition u(0) = u(1) = 0. IfR

f (x) dx 6= 0. What wil happen tou as t → ∞?

2.9 The discrete Laplacian and its inversion

We consider the elliptic equation

uxx− αu = f (x), x ∈ (0, 1)

2.9.1 Dirichlet boundary condition

Dirichlet boundary condition is

u(0) = a, u(1) = b (9.34)

The finite difference approximation of uxx at x1 involves u at x0 = 0. We plug the boundary contion:

uxx(x1) = U0− 2U1+ U2

h2 + O(h2) = a − 2U1+ U2

h2 + O(h2) Similarly,

uxx(xN −1) = UN −2− 2UN −1+ UN

h2 + O(h2) = UN −2− 2UN −1+ b

h2 + O(h2)

2.9. THE DISCRETE LAPLACIAN AND ITS INVERSION 39 The unknowns areU1n, ..., UN −1n withN −1 finite difference at x1, ..., xN −1. The discrete Laplacian becomes

A =





−2 1 0 · · · 0 0 1 −2 1 · · · 0 0 ... ... ... . .. ... ... 0 0 0 · · · 1 −2



. (9.35)

This is the discrete Lalacian with Dirichlet boundary condition. In one dimension, we can solve A−1explicitly. Let us solve(A − 2β)−1whereβ = αh2/2. The difference equation

Uj−1− (2 + 2β)Uj+ Uj+1 = 0 has two independent solutionsρ1andρ2, whereρiare roots of

ρ2− (2 + 2β)ρ + 1 = 0.

That is

ρ = 1 + β ±p

(1 + β)2− 1

Whenβ = 0, the two solutions are Uj = 1 and Uj = j. This gives the fundamental solution Gi,j =

 jCi j ≤ i

(N − j)Ci j ≥ i

FromGi,i−1−2Gi,i+ Gi,i+1 = 1 and iCi = (N −i)Ciwe getCi = −(N −i)/N and Ci = −i/N.

Whenβ > 0, the two roots are ρ1 < 1 and ρ2 > 1.

Homeworks.

1. Use matlab or maple to find the fundamental solutionGi,j := (A − 2β)−1withβ > 0.

2. Is it correct thatvi,jhas the following form?

Gi,j =

( ρj−i1 N − 1 > j ≥ i ρj−i2 1 < j < i Let us go back to the original equation:

uxx− αu = f (x)

The above study of the Green’s function of the discrete Laplacian helps us to quantify the the error produced from the source term. IfAu = f and A−1= G, then an error in f , say τ , will produce an error

e = Gτ.

If the off-diagonal part ofG decays exponentially (i.e. β > 0), then the error is “localized,” oth-erwise, it polutes everywhere. The error from the boundary also has the same behavior. Indeed, if β = 0, then The discrete solution is

u(xj) = aG0(j) + bG1(j) +X

j

Gi,jfj

whereG(j) = jh, G1(j) = 1−jh and G = A−1, the Green’s function with zero Dirichlet boundary condition. Here,G0 solves the equation

G0(i − 1) − 2G0(i) + G0(i + 1) = 0, i = 1, ..., N − 1,

forj = 1, ..., N − 1 with G0(0) = 1 and G0(N ) = 0. And G1 solves the same equation with G1(0) = 0 and G1(N ) = 1.

Ifβ > 0, we can see that both G0andG1are also localized.

Project 2. Solve the following equation

uxx− αu + f (x) = 0, x ∈ [0, 1]

numerically with periodic, Dirichlet and Neumann boundary condition. The equilibrium 1. A layer structure

f (x) =

 −1 1/4 < x < 3/4 1 otherwise 2. An impluse

f (x) =

 γ 1/2 − δ < x < 1/2 + δ 0 otherwise

3. A dipole

f (x) =



γ 1/2 − δ < x < 1/2

−γ 1/2 < x < 1/2 + δ 0 otherwise

You may chooseα = 0.1, 1, 10, observe how solutions change as you vary α.

Project 3. Solve the following equation

−uxx+ f (u) = g(x), x ∈ [0, 1]

numerically with Neumann boundary condition. Here,f (u) = F(u) and the potential is F (u) = u4− γu2.

Study the solution as a function ofγ. Choose simple g, say piecewise constant, a delta function, or a dipole.

Chapter 3

Finite Difference Methods for Linear elliptic Equations

3.1 Discrete Laplacian in two dimensions

We will solve the Poisson equation

△u = f in a domainΩ ⊂ R2with Dirichlet boundary condition

u = g on ∂Ω

Such a problem is a core problem in many applications. We may assumeg = 0 by substracting a suitable function fromu. Thus, we limit our discussion to the case of zero boundary condition. Let h be the spatial mesh size. For simplicity, let us assume Ω = [0, 1] × [0, 1]. But many discussion below can be extended to general smooth bounded domain.

3.1.1 Discretization methods

Centered finite difference The Laplacian is approximated by A = 1

h2 (Ui−1,j + Ui+1,j+ Ui,j−1+ Ui,j+1− 4Ui,j) . For the square domain, the indeces run from1 ≤ i, j ≤ N − 1 and

U0,j = UN,j = Ui,0= Ui,N = 0 from the boundary condition.

41

If we order the unknownsU by i + j ∗ (N − 1) with j being outer loop index and i the inner loop index, then the matrix form of the discrete Laplacian is

A = 1

Since this discrete Laplacian is derived by centered finite differencing over uniform grid, it is second order accurate, the truncation error

τi,j := 1

h2 (u(xi−1, yj) + u(xi+1, yj) + u(xi, yj−1) + u(xi, yj+1) − 4u(xi, yj))

= O(h2).

3.1.2 The 9-point discrete Laplacian

The Laplacian is approximated by

29 = 1

One can show by Taylor expansion that

29u = ∇2u + 1

12h24u + O(h4).

Ifu is a solution of ∇2u = f , then

29u = f + 1

12h22f + O(h4).

Thus, we get a 4th order method:

29Uij = fij+h2 12∇2fij

3.2. STABILITY OF THE DISCRETE LAPLACIAN 43

3.2 Stability of the discrete Laplacian

We have seen that the true solution of△u = f with Dirichlet boundary condition satisfies Au = f + τ,

whereA is the discrete Laplacian and τ is the truncation error and satisfies τ = O(h2) in maximum norm. The numerical solutionU satisfies AU = f . Thus, the true error satisfies

Ae = τ,

wheree = u − U. Thus, e satisfies the same equation with right-hand side τ and with the Dirichlet boundary condition. To get the convergence result, we need an estimate ofe in terms of τ . This is the stability criterion ofA. We say that A is stable if there exists some norm k · k and a constant C such that

kek ≤ CkAek.

3.2.1 Fourier method

Since our domainΩ = [0, 1] × [0, 1] and the coefficients are constant, we can apply Fourier trans-form. Let us see one dimensional case first. Consider the Laplaciand2/dx2on domain[0, 1] with Dirichlet boundary condition. The discrete Laplacian isA = h12diag(1, −2, 1), where h = 1/N.

From

A sin(iπkh) = 1

h2 (sin((i + 1)πhk) + sin((i − 1)πhk) − 2 sin(iπhk))

= 2

h2 ((cos(πhk) − 1) sin(iπhk)) .

The above is valid fori = 1, ..., N − 1 and k = 1, ..., N − 1. We also see that sin(iπkh) sat-isfies Dirichlet boundary condition at i = 0 and i = N . we see that the eigenvectors of A are (sin(iπhk))N −1i=1 fork = 1, ..., N − 1. The corresponding eigenvalues are h22(cos(πhk) − 1).

For two dimensional case, the eigenfunctions of the discrete Laplacian are (Uk,ℓ)i,j = sin(iπkh) sin(jπℓh).

The corresponding eigenvalues are λk,ℓ = 2

h2(cos(kπh) + cos(ℓπh) − 2)

= − 4

h2(sin2(kπh/2) + sin2(ℓπh/2)) The smallest eigenvalue (in magnitude) is

λ1,1 = − 8

h2 sin2(πh/2) ≈ −2π2.

To show the stability, we take Fourier transform ofU and A. We then have

h bA ˆU , ˆU i ≥ 2π2k ˆU k2. The left-hand side has h bA ˆU , ˆU i

≤ k bA ˆU kk ˆU k.

Hence, theL2norm of bA has the following estimate:

k bA ˆU k ≥ 2π2k ˆU k.

Thus, we get

k ˆU k ≤ 1

2k bA ˆU k.

From Parseval equality, we have

kUk ≤ 1

2kAUk Applying this stability to the formula:Ae = τ , we get

kek ≤ 1

2kτk = O(h2).

Homeworks.

1. Compute th eigenvalues and eigenfunctions of the 9-point discrete Laplacian on the domain [0, 1] × [0, 1] with zero boundary condition.

3.2.2 Energy method

Below, we use energy method to prove the stability result for discrete Laplacian. We shall prive it for rectangular domain. However, it can be extended to more general domain. To perform energy estimate, we rewrite the discrete Laplacian as

AUi,j = 1

h2(Ui−1,j+ Ui+1,j+ Ui,j−1+ Ui,j+1− 4Ui,j) = ((Dx+Dx−+ Dy+Dy−)U )i,j where

(Dx+U )i,j = Ui+1,j− Ui,j

h

the forward differencing. We multiply the discrete Laplacian by Ui,j, then sum over all i, j. By applying the ummation by part, we get

(AU, U ) = ((Dx+Dx−+ Dy+Dy−)U, U )

= −(Dx−U, Dx−U ) − (Dy−U, Dy−U )

= −k∇hU k2h

3.2. STABILITY OF THE DISCRETE LAPLACIAN 45 Here, the discreteL2norm is defined by

kUk2h=X

i,j

|Ui,j|2h2.

The boundary term does not show up beause we consider the zero Dirichlet boundary problem.

Thus, the discrete Poisson equation has the estimate

k∇hU k2h= |(f, U)| ≤ kf khkUkh. (2.1) Next, for the zero Dirichlet boundary condition, we have Poincare inequality. Before stating the Poincare inequality, we need to clarify the meaning of zero boundary condition in the discrete sense. We define the Sobolev spaceHh,01 to be the completion of the restriction of allC01functions to the grid points under the discreteH1norm. Here,C01function is aC1function that is zero on the boundary; the discreteH1norm is

kUkh,1:= kUkh+ k∇hU kh.

Lemma 2.2. LetΩ be a bounded domain inR2, then there exist a constantd, which is the diameter of the domainΩ, such that for any U ∈ Hh,01 ,

kUkh≤ dk∇hU kh (2.2)

Proof. Let us takeΩ = [0, X]×[0, Y ] as an example for the proof. We assume X = Mh, Y = Nh.

From zero boundary condition, we have Ui,j2 = (

multiply both sides byh2then sum over alli, j, we get kUk2h = X

Similarly, we have

kUk2h ≤ N2

2 h2kDy−U k2h

Thus,

kUk2h ≤ h21

2max{M2, N2}k∇hU k2

≤ d2k∇hU k2h.

With the Poincare inequality, we can obtain two estimates forU .

Proposition 1. Consider the discrete Laplacian with zero boundary condition. We have

kUkh≤ d2kf kh, (2.3)

k∇hU k ≤ dkf kh. (2.4)

Proof. From

k∇hU k2h ≤ kf kh· kUkh

We apply the Poincare inequality to the left-hand side, we obtain kUk2h ≤ d2k∇Uk2h≤ d2kf khkUkh

This yields

kUkh ≤ d2kf kh

If we apply the Poincare inequality to the right-hand side, we get

k∇hU k2h≤ kf kh· kUkh ≤ kf kh· dk∇hU kh

Thus, we obtain

k∇hU k ≤ dkf kh

When we apply this result toAe = τ , we get

kek ≤ d2kτk = O(h2) k∇hek ≤ dkτk = O(h2).

Chapter 4

Finite Difference Theory For Linear Hyperbolic Equations

4.1 A review of smooth theory of linear hyperbolic equations

Hyperbolic equations appear commonly in physical world. The propagation of acoustic wave, electric-magnetic waves, etc. obey hyperbolic equations. Physical characterization of hyperbol-icity is that the signal propagates at finite speed. Mathematically, it means that compact-supported initial data yield compact-supported solutions at all time. This hyperbolicity property has been char-acterized in terms of coefficients of the corresponding linear partial differential equations through Fourier method.

They are two techaniques for hyperbolic equations, one is based on Fourier method (Garding et

They are two techaniques for hyperbolic equations, one is based on Fourier method (Garding et

相關文件