MA557/MA578/CS557 Lecture 32

24
1 Spring 2003 Prof. Tim Warburton [email protected] MA557/MA578/CS557 Lecture 32

description

MA557/MA578/CS557 Lecture 32. Spring 2003 Prof. Tim Warburton [email protected]. Heat Equation. Recall Lecture 17 where we derived the advection-diffusion equation in 1D. The same type of derivation for the diffusion process of a concentrate C yields in 2D:. Heat Equation. - PowerPoint PPT Presentation

Transcript of MA557/MA578/CS557 Lecture 32

Page 1: MA557/MA578/CS557 Lecture 32

1

Spring 2003

Prof. Tim [email protected]

MA557/MA578/CS557Lecture 32

Page 2: MA557/MA578/CS557 Lecture 32

2

Heat Equation

• Recall Lecture 17 where we derived the advection-diffusion equation in 1D.

• The same type of derivation for the diffusion process of a concentrate C yields in 2D:

2

2 22

2 2

where:

diffusion constant

CD C

t

x y

D

Page 3: MA557/MA578/CS557 Lecture 32

3

Heat Equation

• Our first approach will be an explicit time integration of:

n

n

1

=

for 1:

=

end

N D N Dx x y y

n

rk RKorder

dtD

rk

σ C

σ C D D D D σ

C σ

Page 4: MA557/MA578/CS557 Lecture 32

4

Explicit Numerical Heat Equation

• The trouble is that the discrete diffusion matrix has a large spectral radius:

• We do know that (using the integration by parts formula for the DG operator) that the operator is non-positive.

• We also need to fit the eigenspectrum in the appropriate stability region:

D N D N Dx x y yA D D +D D

Page 5: MA557/MA578/CS557 Lecture 32

5

2

2

2

2 2

2 2

2 2

2 22 2

2

2

2 2

2 2

22

222 2

42

2

, ,

using polynomial

D Dx xD DLy y

L

DxDy

L

D Dx yL L

D Dx yL L

y

L L

x y

L LL L

L

D

x y

kx y

pkh

x

D DC AC C C

D D

DC

D

D C D C

D C D C

C CF C F C

C CF C F C

C inverse inequalities

Page 6: MA557/MA578/CS557 Lecture 32

6

22

2

2

42

2

4

2

,

,max

,

LL

L

L

pkh

pkh

C

C AC C

C ACA

C C

We also know that all the eigenvalues are non-positive real numbers and dt*rho(A) must fit in the stability region..

2

4 which can be small

hdt

p

Page 7: MA557/MA578/CS557 Lecture 32

7

Comment

• We have shown that using an explicit time integration scheme may require very small time steps…

• The root cause of this is that information diffuses through the data domain very quickly..

• We will investigate some schemes which solve globally coupled systems.

Page 8: MA557/MA578/CS557 Lecture 32

8

Backwards Euler Time Integration• Suppose we consider the backwards Euler scheme:

• Iterator:

1

1n n

N D N D nx x y yD

dt

C CM M D D D D C

1

1

1

where:

and:

thus by non-negativity of

(for theory, consider this in the PKDO basis =I)

1 , 0 1

n n

N D N Dx x y y

dt

D

dt D

C AC

A M L M

L M D D D D

L

M

A A

Page 9: MA557/MA578/CS557 Lecture 32

9

Backwards Euler Time Integration

• Suppose we consider the backwards Euler scheme:

• Thus the only conditions for stability are:

• However, accuracy depends on dt. The discretization of the time derivative has a first order truncation error:

1

1n n

N D N D nx x y yD

dt

C CM M D D D D C

, 0dt D

1 1n n n

O dtdt t

C C C

Page 10: MA557/MA578/CS557 Lecture 32

10

Crank-Nicholson

• We replace the right hand side of the discrete scheme with:

1 1

1

1

2

where: 2 2

and:

n n n nN D N Dx x y y

n n

N D N Dx x y y

Ddt

dt dt

D

C C C CM M D D D D

C AC

L LA M M

L M D D D D

Page 11: MA557/MA578/CS557 Lecture 32

11

Diagonalize

• If we apply a change of basis so that the inv(M)*L is diagonal then we decouple the iterator into a sequence of independent scalar iterators:

1

1

where:

1 12 2

n nm m m

m mm

C C

dt dt

Page 12: MA557/MA578/CS557 Lecture 32

12

Quick Result• We can bound the iterator multiplier:

• As long as both the eigenvalues and dt are non-negative then the multiplier is bounded by one and the scheme is stable.

• We have previously shown that L is a non-negative operator.

2

0

1

12

01

max 1

f

df

d

f

Page 13: MA557/MA578/CS557 Lecture 32

13

Crank-Nicholson Accuracy

• We can briefly compute the temporal accuracy:

3

1

2 23

2

11

2

2 2

2 2 4 2

Temporal truncation error

n n

n n

n

n

dt dt

d

O dt

O dt

tdt O dt dt

dt

1 1

1

C AC

L LC M M C

M L M L M L1 1 C

1 M L C

Page 14: MA557/MA578/CS557 Lecture 32

14

ESDIRK4

• A new implicit RK scheme with a lower triangle Butcher tableau has been proposed by Carpenter et al. http://fun3d.larc.nasa.gov/papers/carpenter.pdf

• The linear system to invert at each sub stage is the same.

• The RK scheme comes with an embedded scheme to provide s’th order and (s-1)’th order time approximations:

Page 15: MA557/MA578/CS557 Lecture 32

15

4th Order ESDIRK4 Implicit RK Schemeinitializer + 5 stages

• Iterator: (Ctilde are intermediate values of C, Chat6 is the embedded 3rd order approximation of Cn+1)

1

2 1 221

3 1 2 331 32

4 1 2 3 441 42 43

5 1 2 3 4 551 52 53 54

6 1 2 3 4 561 62 63 64 65

n

n

n

n

n

n

dt a

dt a a

dt a a a

dt a a a a

dt a a a a a

C C

MC MC LC LC

MC MC LC LC LC

MC MC LC LC LC LC

MC MC LC LC LC LC LC

MC MC LC LC LC LC LC

6 1 2 3 4 5 6

1 2 3

1 6

5 6

6

4ˆ ˆ ˆ ˆ ˆ ˆˆ

n

n dt b b b b b b

C C LC LC LC LC LC L

LC

M

C C

CM

Page 16: MA557/MA578/CS557 Lecture 32

16

4th Order ESDIRK4 Implicit RK Scheme

• Iterator: (Ctilde are intermediate values of C, Chat5 is the embedded 3rd order approximation of Cn+1)

1

2 121

3 1 231 32

4 1 2 341 42 43

5 1 2 3 451 52 53 54

6 1 2 3 4 51 2 3 4

6

5

ˆ

n

n

n

n

n

n

dt dt a

dt dt a a

dt dt a a a

dt dt a a a a

dt dt b b b b b

C C

M L C MC LC

M L C MC LC LC

M L C MC LC LC LC

M L C MC LC LC LC LC

M L C MC LC LC LC LC LC

MC

1 2 3 4 5 61 2 3 4 6

6

5

1

ˆ ˆ ˆ ˆ ˆ ˆ

n

n dt b b b b b b

C LC LC LC LC LC LM C

C C

Page 17: MA557/MA578/CS557 Lecture 32

17

4th Order ESDIRK4 Implicit RK Scheme

• If L is a linear operator then:

1

2 121

3 1 231 32

4 1 2 341 42 43

5 1 2 3 451 52 53 54

6 1 2 3 4 51 3

6

2 4 5

ˆˆ n

n

n

n

n

n

n

dt dt a

dt dt a a

dt dt a a a

dt dt a a a a

dt d

dt b

t b b b b b

C C

M L C MC L C

M L C MC L C C

M L C MC L C C C

M L C MC L C C C C

M L C MC L C C C C C

M MC C L

1 2 3 4

1 6

5 61 2 3 4 5 6

ˆ ˆ ˆ ˆ ˆ

n

b b b b b

C C C C

C

C C

C

Page 18: MA557/MA578/CS557 Lecture 32

18

Coefficients

Gamma = 1/4

a21 = 1/4

a31 = 8611/62500

a32 = -1743/31250

a41 = 5012029/34652500

a42 = -654441/2922500

a43 = 174375/388108

a51 = 15267082809/155376265600

a52 = -71443401/120774400

a53 = 730878875/902184768

a54 = 2285395/8070912

bhat1 =4586570599/29645900160bhat2 = 0bhat3 = 178811875/945068544 bhat4 = 814220225/1159782912 bhat5 = -3700637/11593932bhat6 = 61727/225920

b1 = 82889/524892

b2 = 0

b3 = 15625/83664

b4 = 69875/102672

b5 = -2260/8211

Page 19: MA557/MA578/CS557 Lecture 32

19

Implementation Details

• As they are computed we are required to store Ctilde1, Ctilde2, …, Ctilde6 until the end of the 6th ESDIRK stage.

• Each stage 2,3,4,5,6 requires the solution of the same linear system, with different data on the right hand side.

• Chat6 may be computed without solving a linear system.

• The systems can be solved using an iterative (say conjugate gradient) method. i.e. the L matrix does not need to be computed and stored.

• We need to be able to compute (M+dt*gamma*L)*x for a given vector x.

• ||Ctilde6-Chat6|| will give an estimate of the difference between a 3rd order and the 4th order approximation in time. This can be used to estimate the error made in this time step and can suggest a change in dt.

Page 20: MA557/MA578/CS557 Lecture 32

20

Solving the System

• We are going to use an iterative method to solve the following sequence of symmetric matrix problems:

6 1 2 3 4 5 6

1 2 3

1

2 121

3 1 231 32

6 1 2 3 4 51 2 3 4 5

6

1

4 5

6

ˆ ˆ ˆ ˆ ˆ ˆˆ

n

n

n

N D N Dx x y

n

y

n

n

dt dt a

dt dt a a

dt d

dt b b b b

t b b b b

b b

b

L M

C C

M L C MC L C

M L C MC L C C

M L C MC L C C C C C

M MC

D D

C L C C C C C

D

C C

C

D

Page 21: MA557/MA578/CS557 Lecture 32

21

Summary of Temporal Implicit Schemes

• Backwards Euler is unconditionally stable for non-negative diffusion parameter D (i.e. any dt>=0) and first order in dt.

• Crank-Nicholson is unconditionally stable for non-negative diffusion parameter D (i.e. any dt>=0) and second order in dt.

• ESDIRK4 – generalizes to fourth order in dt.

11

2 2n ndt dt

L L

C M M C

11n ndt C M L MC

N D N Dx x y yD L M D D D D

Page 22: MA557/MA578/CS557 Lecture 32

22

Homework 10

Q1) Modify the umDIFFUSION.zip files to solve the diffusion equation with the following time integrators:

a) Backwards Eulerb) Crank-Nicholsonc) ESDIRK4

Q2) Create a domain and determine convergence rates in h for p=1,3,5,7 for a small dt (i.e. make sure the convergence does not bottom out above 1e-10). Repeat for two of the above time integrators.

Q3) Choose p=7 and h small and verify rates of convergence in dt for integration to some fixed time T. Use the one time integrator you did not use in Q2.

Page 23: MA557/MA578/CS557 Lecture 32

23

Homework 10

• This homework can be completed in pairs or individually.

• This homework is due Monday 04/21/03

• Remember – no more than 5 email questions will be replied to for this homework.

Page 24: MA557/MA578/CS557 Lecture 32

24

Discussion of Final Project

• Now is the time to ready your final projects. • Submit a one page description of the PDE you intend to

discretize with DG by 04/21/03

• This is a proposal and may be rejected – requiring a resubmission or assignment of a set of PDEs.

• Include:– List of PDEs to be discretized

– List boundary conditions and initial conditions to be discretized

– Relevance to your own research (if any)

– List of group members (max 3, with one proposal per group)

– Interesting issues (application of PML, creation of specific PML, specific physical application/model…)