• Keine Ergebnisse gefunden

6 Numerical Solution of Parabolic Equations

N/A
N/A
Protected

Academic year: 2021

Aktie "6 Numerical Solution of Parabolic Equations"

Copied!
28
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

6 Numerical Solution of Parabolic Equations

6.1 Some Theory and Examples

Our first example is the so-called initial value problem for the heat equation (u = temperature in an infinitely long wire):

u

t

= u

xx

in Ω = {(x, t) : x ∈ R , 0 < t < T }, u(x, 0) = f (x).

We define the singularity function S(x, t) := 1

4πt exp −x

2

4t

which solves at least the differential equation for t 6= 0.

(2)

Plot of the singularity function

−1

−0.5 0

0.5 1

0 0.02 0.04 0.06 0.08 0.1

0 1 2 3 4

t x

S(x,t)

−1 −0.5 0 0.5 1

0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1

x

t 0.5

0.5 0.5

0.5

1

1

1

1

1.5

1.5

3

Remark: For n spatial coordinates the singularity function is S(x, t) = 1

(4πt)

n/2

exp( −kxk

22

4t ).

(3)

If f satisfies the growth condition

|f (x)| ≤ M exp(Ax

2

) with some constants M ≥ 0, A > 0, so

u(x, t) = (R

−∞

S(x − y, t)f(y) dy, 0 < t < T,

f (x), t = 0,

solves the IVP, if T <

A4

(Poisson’s formula). In particular, u ∈ C( ¯ Ω) and u

t

, u

xx

∈ C(Ω).

The IVP is well-posed.

(4)

As a second example we consider the parabolic initial-boundary value problem,

u

t

= u

xx

for t > 0, 0 < x < 1, u(0, t) = u(1, t) = 0 for t > 0,

u(x, 0) = u

0

(x) for 0 ≤ x ≤ 1,

which modelles the heat flow in a homogeneous thin rod with fixed zero temperature at both ends.

If the initial condition has can be described as a Fourier series in the form

u

0

(x) =

X

j=1

α

j

sin(jπx), (1)

then the solution of the IBVP is u(x, t) =

X α

j

exp(−(jπ)

2

t) sin(jπx).

(5)

Since the functions {sin(jπx)}

j=1

form a complete orthogonal system of the function space L

2

(0, 1), each function u

0

∈ L

2

(0, 1) can be written in the form (1).

The coefficients are given by α

j

= 2

Z

1

0

u

0

(x) sin(jπx) dx.

Example: For u

0

(x) = 1 − 2 x −

12

the coefficients are given by α

j

=

j28π2

sin

2

, (j ∈ N ). Visualisation of some partial sums:

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

N=1 N=3 N=5 N=19 u0(x)

(6)

0 0.5 1

0 0.2 0.4 0.6 0.8 1 0

0.2 0.4 0.6 0.8 1

x t

0 1 2 3 4 5 6 7

10−120 10−100 10−80 10−60 10−40 10−20 100

m

t=0 t=1/2

Fourier series solution of IBVP (2) u

0

(x) = 1 − 2|x −

12

| in domain (x, t) ∈ [0, 1] × [0, 1] (left).

Decay of first 4 nonzero Fourier coefficients of u(t) (right).

(7)

Maximum principle for the heat equation

The uniqueness of the solution and the continuous dependence of the solution the data are a consequence of the following maximum principle:

Let Ω := (0, 1) × (0, T ) and u ∈ C( ¯ Ω) with u

t

, u

xx

∈ C(Ω) be a solution of the heat equation u

t

= u

xx

in Ω.

Then, the maximum of u can be found on the boundary of Ω, i. e. for x = 0, x = 1 or t = 0.

Wy does this maximum principle indeed ensure, that our IBVP is well

posed?

(8)

Neumann boundary conditions

If we replace the homogeneous Dirichlet boundary conditions by homogeneous Neumann conditions

u

x

(0) = u

x

(1) = 0, and if the initial condition can be written in the form

u

0

(x) =

X

j=0

α

j

cos(jπx),

the solution is given by u(x, t) =

X

j=0

α

j

exp(−(jπ)

2

t) cos(jπx).

(9)

6.2 Numerics of the one-dimensional model problem

In the following we consider the initial boundary value problem (IBVP) modelling heat flow in a thin rod with a given time dependent

temperature at the endpoints:

u

t

= κu

xx

, x ∈ (0, 1), t > 0, (2a)

u(0, t) = g

0

(t), t > 0, (2b)

u(1, t) = g

1

(t), t > 0, (2c)

u(x, 0) = u

0

(x), x ∈ [0, 1]. (2d)

The constant κ is the heat conductivity (which we set to one in the following).

Remark: In 2D or 3D the heat equation would be u

t

= κ∆

x

u. One

would set initial data (for t = 0) and boundary data (on ∂Ω).

(10)

We first discretize the IBVP (2) in the spatial variable x only, leaving the time t continuous.

To this end we proceed as in the elliptic case and introduce the grid points

0 = x

0

< x

1

< · · · < x

J

< x

J+1

= 1 using a fixed grid spacing ∆x = 1/(J + 1) and approximate

u

xx

|

x=xj

≈ [A

∆x

u]

j

, j = 1, 2, . . . , J, with

A

∆x

= 1

∆x

2

tridiag(1, −2, 1). (3)

(11)

If u = u(t) denotes the vector with components

u

j

(t) ≈ u(x

j

, t), t > 0, j = 1, 2, . . . , J, then (2) is transformed into the semi-discrete system of ODEs

u

0

(t) = A

∆x

u(t) + g(t), (4a)

u(0) = u

0

, (4b)

with [u

0

]

j

= u

0

(x

j

), j = 1, 2, . . . , J as well as g(t) = 1

∆x

2

[g

0

(t), 0, . . . , 0, g

1

(t)]

T

∈ R

J

.

Obviously, (4) is an IVP for an inhomogeneous linear system of ODEs

with constant coefficient matrix A

∆x

.

(12)

We can now solve (4) with known numerical methods for solving ODEs.

Introducing the fixed time step ∆t > 0, we set

U

jn

≈ [u(t

n

)]

j

≈ u(x

j

, t

n

), t

n

= n∆t.

The approximation of the solution of a time-dependent PDE as a system of ODEs along the “lines” {(x

j

, t) : t > 0} is known as the method of lines.

We will consider in particular the explicit and implicit Euler method and

the trapezoidal rule for solving the resulting ODE system.

(13)

Applying the explicit Euler method to (4) (setting g

0

(t) = g

1

(t) = 0 for now) leads to

U

jn+1

= U

jn

+ ∆t

∆x

2

U

j−1n

− 2U

jn

+ U

j+1n

, 1 ≤ j ≤ J, n = 0, 1, 2 . . . . This corresponds to the finite difference approximation

U

jn+1

− U

jn

∆t

| {z }

≈ut

= U

j−1n

− 2U

jn

+ U

j+1n

∆x

2

| {z }

≈uxx

(5)

of the differential equation (2a).

In matrix notation:

U

n+1

= (I + ∆t A

∆x

)U

n

, n = 0, 1, 2, . . . ,

with U

n

= [U

1n

, U

2n

, . . . , U

Jn

]

>

.

(14)

As usual, we define the local discretization error of the difference scheme (5) to be the residual obtained on inserting the exact solution into the difference scheme:

d(x, t) := u(x, t+∆t)−u(x, t)

∆t − u(x−∆x, t)−2u(x, t) + u(x+∆x, t)

∆x

2

.

Using Taylor expansions in (x, t) one easily obtains:

d

eE

(x, t) = ∆t

2 u

tt

− ∆x

2

12 u

xxxx

+ O(∆t

2

) + O(∆x

4

). (6)

Terminology: the explicit Euler method for solving the heat equation is

consistent of first order in time and of second order in space.

(15)

Besides the asymptotic statement (6) we also require upper bounds for d

eE

(x, t). Truncating the Taylor expansions with a remainder term, we obtain in time

u(x, t + ∆t) = (u + ∆t u

t

) |

(x,t)

+ ∆t

2

2 u

tt

(x, τ ), τ ∈ (t, t + ∆t).

Proceeding analogously in x yields d

eE

(x, t) = ∆t

2 u

tt

(x, τ) − ∆x

2

12 u

xxxx

(ξ, t), ξ ∈ (x − ∆x, x + ∆x), and we obtain, setting µ :=

∆x∆t2

,

|d

eE

(x, t)| ≤ ∆t

2 M

tt

+ ∆x

2

12 M

xxxx

= ∆t 2

M

tt

+ 1

6µ M

xxxx

, (7)

assuming |u

tt

| ≤ M

tt

und |u

xxxx

| ≤ M

xxxx

on [0, 1] × [0, T ].

(16)

Applying the implicit Euler method to (4) one obtains, in place of (5), the implicit difference scheme

U

jn+1

− U

jn

∆t = U

j−1n+1

− 2U

jn+1

+ U

j+1n+1

∆x

2

. (8)

The calculation of U

n+1

from U

n

is seen to require the solution of a linear system of equations with coefficient matrix I − ∆tA

∆x

. Here Taylor expansion results in a local discretization error of

d

iE

(x, t) = − ∆t

2 u

t

+ ∆x

2

12 u

xxxx

+ O(∆t

2

) + O(∆x

4

).

(17)

Applying the trapezoidal rule, which for an ODE y

0

(t) = f(t, y(t)) is given by

y

n+1

= y

n

+ ∆t 2

f(t

n

, y

n

) + f (t

n+1

, y

n+1

) yields another implicit scheme

U

jn+1

− U

jn

∆t = 1 2

U

j−1n

− 2U

jn

+ U

j+1n

∆x

2

+ U

j−1n+1

− 2U

jn+1

+ U

j+1n+1

∆x

2

, which in this context is known as the Crank-Nicolson

1

scheme.

This method requires in each time step the solution of a linear system of equations with the coefficient matrix I −

∆t2

A

∆x

.

For Crank-Nicolson (CN) there holds

d

CN

(x, t) = O(∆t

2

) + O(∆x

2

).

1J. Crank and P. Nicolson, 1947

(18)

6.3 Stability and Convergence

6.3.1 Absolute Stability

In the methods of lines, an ODE solver is applied to the semidiscrete system (4).

Recalling the regions of absolute stability of the explicit and implicit Euler and trapezoidal methods, we are led to investigate the behavior of the eigenvalues of the matrix A

∆x

in (3) as ∆x → 0.

−3 −2 −1 0 1

−2

−1.5

−1

−0.5 0 0.5 1 1.5 2

explicit Euler R(ˆ λ) = 1 + ˆ λ

−1 0 1 2 3

−2

−1.5

−1

−0.5 0 0.5 1 1.5 2

implicit Euler R(ˆ λ) =

1

−2 −1 0 1 2

−2

−1.5

−1

−0.5 0 0.5 1 1.5 2

trapezoidal

R(ˆ λ) =

1+ˆλ/2

(19)

The eigenvalues of A

∆x

(cf. pg. 200) are given by λ

j

= − 4

∆x

2

sin

2

jπ∆x

2 , j = 1, 2 . . . , J.

The eigenvalue of largest magnitude is λ

J

= − 4

∆x

2

sin

2

π

2 (1 − ∆x)

= −4

∆x

2

+ π

2

+ O ∆x

2

. Therefore, in order to satisfy

|R ∆t λ

j

| ≤ 1 for all j = 1, 2, . . . , J in the explicit Euler method, it is necessary that

∆t

∆x

2

≤ 1

2 . (9)

Both implicit Euler and the trapezoidal rule are absolutely stable.

Therefore, as all eigenvalues of A

∆x

lie in the left half plane, the

requirement of absolute stability places no constraints on ∆t.

(20)

6.3.2 The Lax-Richtmyer equivalence theorem

All three methods considered so far are consistent, i. e., at all points (x, t) of the domain we have d(x, t) → 0 as ∆x → 0 and ∆t → 0.

To analyze their convergence, we proceed as in the case of numerical methods for ODEs and consider a finite time interval t ∈ [0, T ], T > 0 as well as a sequence of grids with grid spacings ∆x → 0, ∆t → 0.

We determine whether at every fixed grid point (x

j

, t

n

) also the global error u(x

j

, t

n

) − U

jn

tends to zero uniformly.

Problem: A sequence of grid spacings {(∆x)

k

, (∆t)

k

} can approach

the point (0, 0) in different ways. Will any „refinement curve“ in the

(∆x, ∆t)-plane lead to a convergent method?

(21)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0

0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5

∆ x

t

∆ t = ∆ x2/4

∆ t = ∆ x2/2

∆ t = ∆ x2

∆ t = ∆ x

∆ t = ∆ x/2

Different refinement curves ∆t, ∆x → 0:

red: ∆t/∆x

2

= const, blue: ∆t/∆x = const.

(22)

The appropriate stability concept for the convergence analysis of

numerical methods for solving IVPs for PDEs was developed by Lax

2

and Richtmyer

3

. We assume that ∆t is chosen as a fixed function of ∆x.

Definition 6.1.

A linear finite difference scheme of the form

U

n+1

= B (∆t)U

n

+ g

n

(∆t), n = 0, 1, . . . (10) is called Lax-Richtmyer stable, if for any fixed stopping time T there exists a constant K

T

> 0 such that

kB(∆t)

n

k ≤ K

T

, ∀∆t > 0 and n ∈ N , n∆t ≤ T.

2Peter D. Lax,∗1926

3Robert Davis Richtmyer, 1910–2003

(23)

Theorem 6.2 (Lax-Richtmyer equivalence theorem).

A consistent linear finite difference scheme (10) is convergent if, and only if, it is Lax-Richtmyer stable.

Examples:

For the explicit Euler method applied to (2) the resulting matrix B

eE

(∆t) = I + ∆t A

∆x

is symmetric, implying

kB

eE

(∆t)k

2

= max {|λ| : λ eigenvalue of A} . If condition (9), i. e.

∆t

∆x

2

≤ 1 2

is satisfied, we have kB

eE

(∆t)k

2

≤ 1, implying that the explicit Euler

method is Lax-Richtmyer stable and therefore convergent.

(24)

The implicit Euler and Crank-Nicolson schemes are also Lax-Richtmyer stable but without constraints on the mesh ratio or time step. The matrices B(∆t) are given in these cases by

B

iE

(∆t) = (I − ∆t A

∆x

)

−1

, B

CN

(∆t) =

I − ∆t

2 A

∆x

−1

I + ∆t

2 A

∆x

.

However, since the implicit Euler scheme is consistent of order 2 in x and of order 1 in t, this suggests a time step ∆t ≈ ∆x

2

.

In contrast, the CN scheme (trapezoidal rule) is consistent of order 2 in

both x and t, which suggests a time step ∆t ≈ ∆x (much better for

small ∆x).

(25)

0 0.2 0.4 0.6 0.8 1 10−7

10−6 10−5 10−4 10−3 10−2

t

En

expl. Euler dx=1/10 expl. Euler dx=1/20 Crank Nicolson, dx = 1/10 Crank Nicolson, dx = 1/20

Error E(t

n

) = max

j

|u

nj

− U

jn

| of numerical solution (2) with

g

0

= g

1

= 0 and u

0

(x) = x(1 − x) obtained with explicit Euler method

with ∆t = ∆x

2

/2 and the Crank-Nicolson method with ∆t = ∆x/2.

(26)

Write a Matlab program for solving the parabolic initial-boundary value problem

u

t

= u

xx

for t > 0, 0 < x < 1, u(0, t) = u(1, t) = 0 for t > 0,

u(x, 0) = 3 sin(2πx) for 0 ≤ x ≤ 1.

with the explicit and implicit Euler and the Crank-Nicolson scheme in the time interval [0, 0.1].

Analyze the behaviour of the global discretization error for different refinement curves as ∆t = c∆x

2

(c =

14

,

12

, 1), ∆t = ∆x etc.

Remember that the true solution is given by (cf. pg. 214)

u(x, t) = 3e

−4π2t

sin(2πx).

(27)

Remark

In all three schemes considered so far we were able to show the stronger statement kB(∆t)k ≤ 1, which is sometimes called strong stability.

However, strong stability is not necessary for Lax-Richtmyer stability.

More precisely, for Lax-Richtmyer stability it is necessary that there exists a constant α such that

kB (∆t)k ≤ 1 + α∆t (12)

for all sufficiently small time steps ∆t, which is evident from the inequality

kB(∆t)

n

k ≤ (1 + α∆t)

n

≤ e

αT

, ∀ n∆t ≤ T.

(28)

Goals of Chapter 6

You should know some typical parabolic 1D-examples and their analytic solutions.

You should be able to discretize an IBVP of type (2) in space direction and to formulate the associated ODE system.

You should be able to solve this system with the explicit/implicit Euler and the Crank-Nicolson scheme.

You should know the consistency orders in ∆t and ∆x for all three schemes and the resulting reasonable refinement curves.

You should know about the requirement ∆t ≤

12

∆x

2

for the explicit Euler scheme.

You should have got a rough idea about Lax-Richtmyer stability.

Referenzen

ÄHNLICHE DOKUMENTE

For the solutions found in our two main theorems—fixed initial data and fixed asymptote, respectively—we establish exact convergence rates to solutions of the differential

In this paper, we have introduced a generalized n-dimensional differential transform method to pro- pose a user friendly algorithm to obtain the closed form analytic solution

In the current work we present an idea for accelerating the convergence of the resulted sequence to the solution of the problem by choosing a suitable initial term. The efficiency of

Z.Naturforsch.65a, 453 – 460 (2010); received June 30, 2009 / revised September 16, 2009 In many fields of the contemporary science and technology, systems with delaying links often

This method is applied actively on various differ- ential equations such as the reaction convection diffu- sion equation [22], Laplace equation [23], generalized nonlinear

64a, 420 – 430 (2009); received September 4, 2008 / revised October 14, 2008 In this work, the homotopy perturbation method proposed by Ji-Huan He [1] is applied to solve both

and parabolic partial differential equations subject to temperature overspecification [26], the second kind of nonlinear integral equations [27], nonlinear equations arising in

13:30 MELCOR Wetwell Modeling with SNAP Post Processing SANDIA