numerical methods for differential equations€¦ · numerical methods for differential equations...

52
Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyperbolics Gustaf S ¨ oderlind and Carmen Ar ´ evalo Numerical Analysis, Lund University Textbooks: A First Course in the Numerical Analysis of Differential Equations, by Arieh Iserles and Introduction to Mathematical Modelling with Differential Equations, by Lennart Edsberg c Gustaf S ¨ oderlind, Numerical Analysis, Mathematical Sciences, Lund University, 2008-09 Numerical Methods for Differential Equations – p. 1/52

Upload: lehanh

Post on 14-Apr-2018

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Numerical Methods for Differential Equations

Chapter 6: Partial differential equations – waves and hyper bolics

Gustaf Soderlind and Carmen Arevalo

Numerical Analysis, Lund University

Textbooks: A First Course in the Numerical Analysis of Differential Equations, by Arieh Iserles

and Introduction to Mathematical Modelling with Differential Equations, by Lennart Edsberg

c© Gustaf Soderlind, Numerical Analysis, Mathematical Sciences, Lund University, 2008-09

Numerical Methods for Differential Equations – p. 1/52

Page 2: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

1. Hyperbolic problems

“Wave” equations with applications

utt = uxx wave equation

ut + cux = 0 linear conservation law

fluids; traffic density

ut + uux = 0 nonlinear conservation law

ut + uux = uxx Burgers equation

seismics (“parabolic wave equation”)

Numerical Methods for Differential Equations – p. 2/52

Page 3: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Hyperbolic problems. . .

ut + uux = −uxxx Korteweg–de Vries’ (KdV) equation

dispersion; solitons

utt = uxx − u Klein–Gordon equation

dispersion; “telegraph equation”;

quantum theory

iut = uxx Schrödinger equation

quantum theory

utt = −uxxxx beam equation

elastic vibration

Numerical Methods for Differential Equations – p. 3/52

Page 4: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Standard hyperbolic model problems

Wave equations utt = c2uxx or ut + cux = 0

Conservation laws ut + (f(u))x = 0 (inviscid flow)

d’Alembert solution u(x, t) = g(x − ct) solvesut + cux = 0 , because ux = g′ ; ut = −c · g′

Note Solution u is constant on the characteristics

x − ct = const.

The characteristics are straight lines in solution domain

Numerical Methods for Differential Equations – p. 4/52

Page 5: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Boundary conditions for ut + cux = 0

c > 0 c < 0

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Bdry cond’s at x = 0 Bdry cond’s at x = 1

Initial conditions are always required

Numerical Methods for Differential Equations – p. 5/52

Page 6: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Example. Traffic flow simulation

Let u(t, x) be the density of cars (per distance unit)

Then total number of cars on road segment [a, b] is

N(t) =

∫ b

a

u dx

Non-overtaking cars at speed v gives car flux vu(t, x)

Hence N =∫

ut dx = influx − outflux, implying

∫ b

a

ut dx = vu(t, a) − vu(t, b) = −

∫ b

a

d(vu)

dxdx

Numerical Methods for Differential Equations – p. 6/52

Page 7: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Traffic flow conservation law

If v is constant, (vu)′ = vux. Hence conservation law

∫ b

a

ut + vux dx = 0 ⇒ ut + vux = 0

Application: “green wave” traffic light control

More realistic model – if speed depends on u, then(vu)′ = v′uux + vux. Nonlinear conservation law

ut + (v + v′u)ux = 0

Interesting phenomena: Stau, pile-ups (shock waves), &c.

Numerical Methods for Differential Equations – p. 7/52

Page 8: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Relation to the wave equation

utt = c2uxx

Factorization of the differential operator

∂2

∂t2− c2 ∂2

∂x2=

(

∂t− c

∂x

)

·

(

∂t+ c

∂x

)

General d’Alembert solution

u(x, t) = G1(x + ct) + G2(x − ct)

Numerical Methods for Differential Equations – p. 8/52

Page 9: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Domain of dependence

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Explicit time stepping gives CFL condition∆t

∆x/ 1

Numerical domain of dependence must cover physical(mathematical) domain of dependence

Numerical Methods for Differential Equations – p. 9/52

Page 10: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

2. The advection equation. Some schemes

ut + ux = 0, 0 ≤ x ≤ 1, t ≥ 0

+ initial cond u(x, 0) = g(x) and bdry cond u(0, t) = φ0(t)

Method of lines SD vl(t) +1

∆x

β∑

k=−α

akvl+k(t) = 0

1. ux ≈ (unl − un

l−1)/∆x (backward difference)

2. ux ≈ (unl+1 − un

l )/∆x (forward difference)

3. ux ≈ (unl+1 − un

l−1)/(2∆x) (symmetric difference)

4. ux ≈ (14un

l+1 + 56un

l − 32un

l−1 + 12un

l−2 −112

unl−3)/∆x

Numerical Methods for Differential Equations – p. 10/52

Page 11: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Consistency order

Theorem The SD method is of order p if and only if

a(z) :=

β∑

k=−α

akzk = log z + O(|z − 1|p+1), z → 1

Proof Let vl(t) := u(l∆x, t). Then

vl +1

∆x

β∑

k=−α

akvl+k =

(

Dt +1

∆x

β∑

k=−α

akExk

)

vl

But Dt = −Dx and Dx = log Ex/∆x, so

vl +1

∆x

β∑

k=−α

akvl+k = −1

∆x

(

log Ex −

β∑

k=−α

akEkx

)

vl

Numerical Methods for Differential Equations – p. 11/52

Page 12: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Consistency order. . .

. . .

vl +1

∆x

β∑

k=−α

akvl+k = −1

∆x

(

log Ex −

β∑

k=−α

akEkx

)

vl

For differentiable functions Ex = I + O(∆x), so

−1

∆x

(

log Ex −

β∑

k=−α

akEkx

)

=c

∆x(Ex − I)p+1 = O(∆xp)

Numerical Methods for Differential Equations – p. 12/52

Page 13: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Some SDs for the advection equation

1. ux ≈ (unl − un

l−1)/∆x implies a(z) = 1 − z−1

Set z = eiθ. Thena(eiθ) = 1− e−iθ = iθ + θ2/2+ · · · = ln z +O(θ2) ⇒ p = 1

2. ux ≈ (unl+1 − un

l )/∆x a(z) = z − 1 ⇒ p = 1

3. ux ≈ (unl+1 − un

l−1)/(2∆x) a(z) = (z − z−1)/2

a(eiθ) = (eiθ − e−iθ)/2 = iθ − iθ3/6 + . . . ⇒ p = 2

4. ux ≈ (14un

l+1 + 56un

l − 32un

l−1 + 12un

l−2 −112

unl−3)/∆x

⇒ p = 4

Numerical Methods for Differential Equations – p. 13/52

Page 14: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Some SDs for the advection equation

Combining an SD of order p1 with a time stepping methodof order p2 produces a method of order min{p1, p2} for theadvection equation

Note Structure of Courant number is ∆t/∆x ≤ . . .

ut + ux = 0 →

j αjun+1−jl

∆t+

k βkunl+k

∆x= 0

(Why is it ∆t/∆x2 in diffusion equation?)

Numerical Methods for Differential Equations – p. 14/52

Page 15: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Upwind/downwind schemes

As exact solution is transported to the right at a constantspeed, information comes from the left!

Upwind schemes use more points to the left than to theright of the current point, when the flow is from left to right

1. ux ≈ (unl −un

l−1)/∆x upwind

2. ux ≈ (unl+1 − un

l )/∆x downwind

3. ux ≈ (12un

l+1 −12un

l−1)/∆x symmetric

4. ux ≈ (14un

l+1 + 56un

l −32un

l−1 + 12un

l−2 −112

unl−3)/∆x upwind

Upwind is necessary for stability

Numerical Methods for Differential Equations – p. 15/52

Page 16: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Construction of FD schemes from SD

Let µ = ∆t/∆x and consider ut + ux = 0

1. ux ≈ (unl − un

l−1)/∆x and ut ≈ (un+1l − un

l )/∆t givesthe upwind (Euler) scheme un+1

l = (1 − µ) unl + µun

l−1

2. ux ≈ (unl+1 − un

l )/∆x and ut ≈ (un+1l − un

l )/∆t givesthe downwind scheme un+1

l = (1 + µ) unl − µun

l+1

3. ux ≈ (un+1l+1 − un+1

l−1 )/(2∆x) combined with the explicitmidpoint rule ut ≈ (un+2

l − unl )/(2∆t) gives

the leapfrog method un+2l = µ (un+1

l−1 − un+1l+1 ) + un

l

Numerical Methods for Differential Equations – p. 16/52

Page 17: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Classical FD schemes for ut + aux = 0

1. The Central difference scheme (always unstable!)

un+1l − un

l

∆t+ a

unl+1 − un

l−1

2∆x= 0

leads toun+1

l = unl +

2(un

l−1 − unl+1)

2. The Lax–Friedrichs scheme (convergent, p = 1)

un+1l =

unl−1 + un

l+1

2+

2(un

l−1 − unl+1)

or

un+1l =

1

2(1 + aµ) un

l−1 +1

2(1 − aµ) un

l+1

Numerical Methods for Differential Equations – p. 17/52

Page 18: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Classical FD schemes for ut + aux = 0. . .

3. The Lax–Wendroff scheme (convergent, p = 2)

un+1l =

2(1 + aµ)un

l−1 + (1 − a2µ2)unl −

2(1 − aµ)un

l+1

Uses auto upwinding dependent on Courant number µ andflow direction a (method coefficients are not symmetric)

4. The Beam–Warming scheme (convergent, p = 2)

un+1l =

2(1 − aµ)(2 − aµ)un

l + aµ(2 − aµ)unl−1 −

2(1 − aµ)un

l−2

Genuine upwind scheme (uses no downwind information)

Numerical Methods for Differential Equations – p. 18/52

Page 19: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Derivation of the Lax–Wendroff scheme

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

2utt + . . .

But ut = −aux implies ∂t = −a∂x, hence utt = a2uxx

u(t + ∆t, x) = u − a∆tux +a2∆t2

2uxx + . . .

So, with Courant number µ = ∆t/∆x,

un+1l =

2(1 + aµ)un

l−1 + (1 − a2µ2)unl −

2(1 − aµ)un

l+1

2nd order accurate as it picks up the first three Taylor terms

Numerical Methods for Differential Equations – p. 19/52

Page 20: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Lax–Wendroff stencil at aµ = 1/2

1

3/8 3/4 −1/8

Note Assymetric coefficients correspond to upwinding

Numerical Methods for Differential Equations – p. 20/52

Page 21: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Lax–Wendroff stencil at aµ = 1

1

1 0 0

Note Information transportation along characteristic!

un+1l = un

l−1

Numerical Methods for Differential Equations – p. 21/52

Page 22: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Lax–Wendroff scheme in matrix form

un+1 = Aun + Dirichlet boundary condition

A =

1 − a2µ2 aµ2

(aµ − 1)aµ2

(aµ + 1) 1 − a2µ2 aµ2

(aµ − 1). . .

aµ2

(aµ + 1) 1 − a2µ2

Numerical Methods for Differential Equations – p. 22/52

Page 23: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Lax–Wendroff matrix, aµ = 1

un+1 = Aun + Dirichlet boundary condition

A =

0 0

1 0 0. . . 0 0

1 0

Note This is a shift matrix, with all eigenvalues λk[A] = 0

Numerical Methods for Differential Equations – p. 23/52

Page 24: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

3. Consistency and stability of FD schemes

Theorem The FD schemeδ∑

k=−γ

bk(µ)un+1l+k =

β∑

k=−α

ck(µ)unl+k

withδ∑

k=−γ

bk(µ) ≡ 1 is of order p if and only if

∑βk=−α ck(µ)zk

∑δk=−γ bk(µ)zk

= z−µ + c(µ)(z−1)p+1 +O(|z−1|p+2), z → 1

Numerical Methods for Differential Equations – p. 24/52

Page 25: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Stability for the advection equation. SD

ut + ux = 0 on −∞ < x < ∞ , with ‖u(·, t)‖22 < ∞, t ≥ 0

vl(t) +1

∆x

β∑

k=−α

akvl+k(t) = 0

Theorem The semi-discretization is stable if and only if

Re

β∑

k=−α

akekiθ ≥ 0 , θ ∈ [0, 2π]

Numerical Methods for Differential Equations – p. 25/52

Page 26: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Stability for the advection equation. FD

δ∑

k=−γ

bk(µ)un+1l+k =

β∑

k=−α

ck(µ)unl+k

Theorem The full discretization is stable if and only if∣

∑βk=−α ck(µ)ekiθ

∑δk=−γ bk(µ)ekiθ

≤ 1, θ ∈ [0, 2π]

Lax–Wendroff |1

2µ(1 + µ)e−iθ + (1 − µ2) −

1

2µ(1 − µ)eiθ|2

= 1 − 4µ2(1 − µ2) sin4 1

2θ ⇒ −1 ≤ µ ≤ 1

Numerical Methods for Differential Equations – p. 26/52

Page 27: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The vector advection equation

For ut + aux = 0, stability must be guaranteed by aµ

For a linear system

ut + Aux = 0, 0 ≤ x ≤ 1, t ≥ 0

with matrix A = V ΛV −1 with real eigenvalues λk[A],

ut + V ΛV −1ux = 0

V −1ut + ΛV −1ux = 0

wt + Λwx = 0

µλk[A] must satisfy the stability condition

Numerical Methods for Differential Equations – p. 27/52

Page 28: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

4. Periodic boundary conditions

In wave phenomena we often have periodicity in t and x

u(0, t) = u(1, t), t ≥ 0

t = 0

t = 1

u(x, 0) = g(x) ⇒ u(x, 1) = g(x)

Dynamics on a torus. Stability analysis is relatively simple

Fourier – von Neumann stability analysis

Numerical Methods for Differential Equations – p. 28/52

Page 29: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Lax–Wendroff matrix with periodic conditions

un+1 = Aun where A is a circulant matrix

A =

1 − a2µ2 aµ2

(aµ − 1) aµ2

(aµ + 1)aµ2

(aµ + 1) 1 − a2µ2 aµ2

(aµ − 1). . .

aµ2

(aµ − 1) aµ2

(aµ + 1) 1 − a2µ2

t = 0

t = 1

u(x, 0) = g(x) ⇒ u(x, 1) = g(x)

Numerical Methods for Differential Equations – p. 29/52

Page 30: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Circulant matrices

Structure of circulant matrices

C(κ) =

κ0 κ1 · · · κd−1

κd−1 κ0 · · · κd−2

......

κ1 κ2 · · · κ0

Circulant matrices are a special class of Toeplitz matrices

Numerical Methods for Differential Equations – p. 30/52

Page 31: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Eigenvalues of circulant matrices

Theorem The eigenvalues of a circulant matrix are

λm[C] =

d−1∑

j=0

κje2mjπi/d =

∑βk=−α ck(µ)e2mπik/d

∑δk=−γ bk(µ)e2mπik/d

Therefore a finite difference scheme with periodic b.c. isstable if and only if

|λm[A(aµ)]| ≤ 1

Fourier – von Neumann stability

Numerical Methods for Differential Equations – p. 31/52

Page 32: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

5. The wave equation

utt = uxx, 0 ≤ x ≤ 1, t ≥ 0

with initial conditions u(x, 0) = g0(x), ut(x, 0) = g1(x)

and Dirichlet conditions u(0, t) = φ0(t), u(1, t) = φ1(t)

Can be rewritten as a 1st order system vt + Avx = 0 with

A =

[

0 1

1 0

]

, λ(A) = ±1

Direct semidiscretization ul −1

∆x2

β∑

k=−α

akul+k = 0

Numerical Methods for Differential Equations – p. 32/52

Page 33: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The wave equation

Theorem The direct SD method is of order p if and only if

β∑

k=−α

akzk = (log z)2 + O(|z − 1|p+2), z → 1

Analogous to first order case but the method for secondorder equations must approximate (log z)2

Numerical Methods for Differential Equations – p. 33/52

Page 34: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Methods for the wave equation

For a linear system of equations a one-sided upwindmethod cannot be used if eigenvalues have different signs

What is “upwind” is determined by eigenvalue signs (whichdetermine the slopes of the characteristics)

Example ut + Aux = 0, A = V ΛV −1, Λ = diag(1,−1)

One can use Lax-Friedrichs but not upwind Euler

Numerical Methods for Differential Equations – p. 34/52

Page 35: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

An semidiscretization for the wave equation

Central difference uxx ≈ (vl−1 − 2vl + vl+1)/∆x2

⇒ a(z) = z−1 − 2 + z

a(eiθ) = i2θ2 +i4

12θ4 + . . .

= (ln z)2 + O(θ4) ⇒ p = 2

Semidiscretization vl = (vl−1 − 2vl + vl+1)/∆x2

Numerical Methods for Differential Equations – p. 35/52

Page 36: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Wave equation. Full discretization

z = f(t, z), t ≥ t0, z(t0) = z0, z′(t0) = z′0

is equivalent to the ODE system

z′ = w ; z(t0) = z0

w′ = f(t, z) ; w(t0) = z′0

Use backward Euler/forward Euler combinationzn+1 = zn + hwn

wn+1 = wn + hf(tn+1, zn+1)

Numerical Methods for Differential Equations – p. 36/52

Page 37: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The Störmer method

Eliminate w to get the Störmer method (p = 2)

zn+2 − 2zn+1 + zn = h2f(tn+1, zn+1)

Apply to the SD vl = 1∆x2 (vl−1 − 2vl + vl+1)

With µ = ∆t/∆x we get the order p = 2 leapfrog scheme

un+2l − 2un+1

l + unl = µ2(un+1

l−1 − 2un+1l + un+1

l+1 )

which is stable with Dirichlet conditions for 0 < µ ≤ 1

Numerical Methods for Differential Equations – p. 37/52

Page 38: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

6. The inviscid Burgers equation

ut + (u2

2)x = ut + uux = 0

with u(x, 0) = g(x) and ‖g‖22 < ∞ on [−∞,∞]

This solution is implicitly characterized by

u = g(x − ut)

for which

ut = −u · g′ ; ux = g′ ⇒ ut + uux = 0

Numerical Methods for Differential Equations – p. 38/52

Page 39: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Inviscid Burgers. . .

ut + uux = 0 ; u(x, 0) = g(x)

Take x, t such that x − ut = const. Then x′(t) = u(x, t)

d

dtu(x(t), t) = x′(t)ux + ut = uux + ut = 0

Along a characteristic, du/dt = 0 ⇒ u(x, t) is constant

Characteristics are straight lines

Numerical Methods for Differential Equations – p. 39/52

Page 40: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Characteristics

Characteristics may collide, creating a discontinuity (shock)

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

One can determine u(x, t) by following the characteristic

Numerical Methods for Differential Equations – p. 40/52

Page 41: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Analytical solution of the Burgers equation

Rewrite equation for characteristicsu = g(x − ut) ⇒

x − ut = x − tg(x − ut) ; ξ := x − ut ⇒

ξ = x − tg(ξ)

◮ Pick x, t

◮ Solve the equation x = g(ξ)t + ξ for ξ

◮ Calculate u(x, t) = (x − ξ)/t

Numerical Methods for Differential Equations – p. 41/52

Page 42: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Solving Burgers equation at a point (x, t)

Example Determine u(0.25, 0.125) when g(x) = e−5x2

Solutionu(0.25, 0.125) = g(ξ) = e−5ξ2

Characteristic: x = e−5ξ2

t + ξ

Solve with fixed point iteration: ξ = 0.25 − 0.125e−5ξ2

ξ = 0.1360, u(0.25, 0.125) = g(ξ) = 0.9116

0 0.2 0.4 0.6 0.8 10

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Numerical Methods for Differential Equations – p. 42/52

Page 43: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Viscous Burgers equation, ut + uux = d · uxx

Numerical Methods for Differential Equations – p. 43/52

Page 44: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Viscous Burgers equation. Characteristics

NoteColliding characteristcs; shock formation (discontinuity)

Numerical Methods for Differential Equations – p. 44/52

Page 45: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

7. Weak solutions of ut + f(u)x = 0

Let ϕ(x, t) be any C1 function with compact supportMultiply ut + f(u)x = 0 by ϕ and integrate:

0

−∞

(ϕut + ϕfx) dx dt = 0

Integrate by parts to see that a solution of the PDE satisfies∫

0

−∞

(ϕtu + ϕxf(u)) dx dt = −

−∞

ϕ(x, 0)u(x, 0) dx

Definition u(x, t) is a weak solution of ut + f(u)x = 0 if itsatisfies the integral equation above

Numerical Methods for Differential Equations – p. 45/52

Page 46: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The Riemann problem

ut + f(u)x = 0 + piecewise constant data

Example Burgers equation ut + uux = 0 with

u(x, 0) =

{

ul, x < 0

ur, x > 0

The solution depends on relation between ul and ur

ul > ur unique weak solution;

ul < ur infinitely many weak solutions, among which

one is stable with respect to perturbations

and physically relevant

Numerical Methods for Differential Equations – p. 46/52

Page 47: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Solutions of the Riemann problem. Shocks

A shock is a discontinuous solution

This occurs for ul > ur, when

u(x, t) =

{

ul, x < s · t

ur, x > s · t

where s = (ul + ur)/2 is the shock speed

Note The shock propagates undamped with speed s in theinviscid Burgers euquation

Numerical Methods for Differential Equations – p. 47/52

Page 48: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Riemann problem. Rarefaction waves

If ul < ur, there is no shock but a rarefaction wave instead

u(x, t) =

ul, x < ult

x/t, ult < x < urt

ur, x > urt

Note The rarefaction wave is continuous but notdifferentiable. The characteristics “fan out” instead ofcolliding as in the previous case

Numerical Methods for Differential Equations – p. 48/52

Page 49: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The Godunov method

Approximate the solution locally by a piecewise constantfunction

ut + f(u)x = 0 ; u(x, 0) = g(x)

Define a piecewise constant function w[0](x, 0) forx ∈ (xl−1/2, xl+1/2] with value (cell average)

u0l =

1

∆x

∫ xl+1/2

xl−1/2

g(x) dx

Numerical Methods for Differential Equations – p. 49/52

Page 50: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Godunov method. . .

With piecewise constant data w[0](x, 0) in each [xl−1, xl],solve the corresponding Riemann problem exactly for0 ≤ t ≤ t1, to get w[0](x, t)

Define the approximate solution at t1 by taking

u1l =

1

∆x

∫ xl+1/2

xl−1/2

w[0](x, t1) dx

Proceed to define a new piecewise constant initial valuew[1](x, t1) := u1

l for x ∈ (xl−1/2, xl+1/2]

Numerical Methods for Differential Equations – p. 50/52

Page 51: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

Godunov method. . .

Cell averages are easy to compute, resulting in

un+1l = un

l − µn[F (unl , u

nl+1) − F (un

l−1, unl )]

where µn = ∆tn/∆x and the flux integral

F (unl , u

nl+1) =

1

∆tn

∫ tn+1

tn

f(w[n](xl+1/2, t)) dt

Note This integral is trivial to compute because w[n] isconstant at xl+1/2 for t ∈ (tn, tn+1)

Numerical Methods for Differential Equations – p. 51/52

Page 52: Numerical Methods for Differential Equations€¦ · Numerical Methods for Differential Equations Chapter 6: Partial differential equations – waves and hyper bolics Gustaf Soderlind

The End

Numerical Methods for Differential Equations – p. 52/52