cs520: dispersion and dissipation (ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (after all,...

39
CS520: Dispersion and dissipation (Ch. 7) Uri Ascher Department of Computer Science University of British Columbia [email protected] people.cs.ubc.ca/ascher/520.html Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 1 / 26

Upload: others

Post on 14-Mar-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

CS520: Dispersion and dissipation (Ch. 7)

Uri Ascher

Department of Computer ScienceUniversity of British Columbia

[email protected]

people.cs.ubc.ca/∼ascher/520.html

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 1 / 26

Page 2: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion

Outline

Dispersion in the PDE

Numerical dispersion

Dispersion and dissipativity

The classical wave equation

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 2 / 26

Page 3: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

PDE dispersion

Consider hyperbolic PDEs with smooth solutions.

May require long time integration and conservation of physicalquantities such as energy, Hamiltonian.

Note lack of dissipation in PDE.

Get dispersion when waves associated with different wave numberstravel at different speed.

Consider (yes, again) the simplest advection equation first, with aspecial initial value function:

ut + aux = 0,

u(0, x) = u0(x) = e−ıξx .

Solution:

u(t, x) = eıξ(at−x).

- This is a wave propagating with speed a : the phase velocity.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 3 / 26

Page 4: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

PDE dispersion

Consider hyperbolic PDEs with smooth solutions.

May require long time integration and conservation of physicalquantities such as energy, Hamiltonian.

Note lack of dissipation in PDE.

Get dispersion when waves associated with different wave numberstravel at different speed.

Consider (yes, again) the simplest advection equation first, with aspecial initial value function:

ut + aux = 0,

u(0, x) = u0(x) = e−ıξx .

Solution:

u(t, x) = eıξ(at−x).

- This is a wave propagating with speed a : the phase velocity.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 3 / 26

Page 5: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Dispersion relation, phase velocity, group

velocity

More generally (not just for advection), for u0(x) = e−ıξx ,

u(t, x) = eı(ωt−ξx),

where ω = frequency.

Three important basic definitions:

ω = ω(ξ) Dispersion relation

c(ξ) = ω(ξ)ξ Phase velocity

C (ξ) = dω(ξ)dξ Group velocity.

For advection, ω = aξ so C = c = a. The advection PDE isnon-dispersive: phase velocity is independent of wave number.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 4 / 26

Page 6: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Example: linearized KdV

Consider the constant coefficient PDE

ut + ρux + νuxxx = 0.

Dispersion relation: plug in u(t, x) = eı(ωt−ξx), obtaining

ω = ρξ − νξ3.

Phase velocity:c = ρ− νξ2

Here phase velocity depends on the wave number, so this is adispersive PDE. Different waves travel at different speeds.

Group velocity:C = ρ− 3νξ2.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 5 / 26

Page 7: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Example: linearized KdV

Consider the constant coefficient PDE

ut + ρux + νuxxx = 0.

Dispersion relation: plug in u(t, x) = eı(ωt−ξx), obtaining

ω = ρξ − νξ3.

Phase velocity:c = ρ− νξ2

Here phase velocity depends on the wave number, so this is adispersive PDE. Different waves travel at different speeds.

Group velocity:C = ρ− 3νξ2.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 5 / 26

Page 8: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Example: linearized KdV

Consider the constant coefficient PDE

ut + ρux + νuxxx = 0.

Dispersion relation: plug in u(t, x) = eı(ωt−ξx), obtaining

ω = ρξ − νξ3.

Phase velocity:c = ρ− νξ2

Here phase velocity depends on the wave number, so this is adispersive PDE. Different waves travel at different speeds.

Group velocity:C = ρ− 3νξ2.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 5 / 26

Page 9: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Example: linearized KdV

Consider the constant coefficient PDE

ut + ρux + νuxxx = 0.

Dispersion relation: plug in u(t, x) = eı(ωt−ξx), obtaining

ω = ρξ − νξ3.

Phase velocity:c = ρ− νξ2

Here phase velocity depends on the wave number, so this is adispersive PDE. Different waves travel at different speeds.

Group velocity:C = ρ− 3νξ2.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 5 / 26

Page 10: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion PDE dispersion

Outline

Dispersion in the PDE

Numerical dispersion

Dispersion and dissipativity

The classical wave equation

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 6 / 26

Page 11: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Numerical dispersion

Dispersion in advection semi-discretization

Consider dispersion in the semi-discretization of the non-dispersiveadvection equation: Plug vj(t) = eı(ωt−ξjh) in

dvj

dt+

a

2hD0vj = 0.

Obtain dispersion relation

ω =a

hsin(ξh).

So, phase velocity

c = asin(ξh)

ξh,

group velocityC = a cos(ξh).

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 7 / 26

Page 12: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Numerical dispersion

Dispersion in advection semi-discretization

Semi-discretization

dvj

dt+

a

2hD0vj = 0.

Dispersion relation ω = ahsin(ξh).

Phase velocity c = asin(ξh)

ξh .

Group velocity C = a cos(ξh).

Thus, the semi-discretization is dispersive although the PDE isn’t!

Low wave numbers: C ≈ c ≈ a. So, no difficulty here.

High wave numbers: some waves nearly stationary. These areparasitic (spurious) waves: difficulty here.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 8 / 26

Page 13: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Numerical dispersion

Dispersion in advection semi-discretization

Semi-discretization

dvj

dt+

a

2hD0vj = 0.

Dispersion relation ω = ahsin(ξh).

Phase velocity c = asin(ξh)

ξh .

Group velocity C = a cos(ξh).

Thus, the semi-discretization is dispersive although the PDE isn’t!

Low wave numbers: C ≈ c ≈ a. So, no difficulty here.

High wave numbers: some waves nearly stationary. These areparasitic (spurious) waves: difficulty here.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 8 / 26

Page 14: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Numerical dispersion

Dispersion in advection semi-discretization

Semi-discretization

dvj

dt+

a

2hD0vj = 0.

Dispersion relation ω = ahsin(ξh).

Phase velocity c = asin(ξh)

ξh .

Group velocity C = a cos(ξh).

Thus, the semi-discretization is dispersive although the PDE isn’t!

Low wave numbers: C ≈ c ≈ a. So, no difficulty here.

High wave numbers: some waves nearly stationary. These areparasitic (spurious) waves: difficulty here.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 8 / 26

Page 15: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

Outline

Dispersion in the PDE

Numerical dispersion

Dispersion and dissipativity

The classical wave equation

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 9 / 26

Page 16: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

Dispersion in advection full discretization

All full discretizations we have seen for the advection equation exhibitnumerical dispersion!

(After all, they are not meant to approximate high wave numbersolution components well.)

Trouble may be delayed, though not fully eliminated, when usinghigher order methods.

The big difference is that dissipative methods dampen high wavenumber components, hence the spurious waves are dampened too.For instance, expect more trouble with leap-frog than withLax-Wendroff.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 10 / 26

Page 17: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

Dispersion in advection full discretization

All full discretizations we have seen for the advection equation exhibitnumerical dispersion!

(After all, they are not meant to approximate high wave numbersolution components well.)

Trouble may be delayed, though not fully eliminated, when usinghigher order methods.

The big difference is that dissipative methods dampen high wavenumber components, hence the spurious waves are dampened too.For instance, expect more trouble with leap-frog than withLax-Wendroff.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 10 / 26

Page 18: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

Dispersion in leap-frog

Plug vnj = eı(ωnk−ξjh) into vn+1j = vn−1

j − µa(vnj+1 − vnj−1):

sin(ωk) = µa sin(ξh).

µa = .5:

−3 −2 −1 0 1 2 3

−3

−2

−1

0

1

2

3

ξ h

ω k

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 11 / 26

Page 19: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

ut = ux , u0(x) = sin(ηx)e−ηx2.

Set η = 50, µ = 0.5, h = .005π.

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1

−0.5

0

0.5

1u

ExactLax−FriedrichsLax−Wendroff

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1

−0.5

0

0.5

1

x

u

ExactLeap−frogDissipated LF, ε=.5

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 12 / 26

Page 20: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Dispersion and dissipativity

ut = ux , u0(x) = sin(ηx)e−ηx2.

Set η = 50, µ = 0.5, h = .01π.

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1

−0.5

0

0.5

1u

ExactLax−FriedrichsLax−Wendroff

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−1

−0.5

0

0.5

1

x

u

ExactLeap−frogDissipated LF, ε=.5

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 13 / 26

Page 21: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Outline

Dispersion in the PDE

Numerical dispersion

Dispersion and dissipativity

The classical wave equation

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 14 / 26

Page 22: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

The (nonlinear) wave equation

The PDE is 2nd order in time and space:

φtt = c2φxx − V ′(φ), x0 ≤ x ≤ xJ+1, t > 0,

c > 0 is a constant, V (φ) is smooth, V ′(φ) ≡ dV (φ)dφ .

Initial conditions

φ(0, x) = φ0(x), φt(0, x) = φ1(x).

Boundary conditions: periodic on [x0, xJ+1] or Dirichlet:

φ(t, x0) = φ(t, xJ+1) = 0.

May also have absorbing, or radiating BC, designed to ensure thatspurious waves do not propagate back into domain.

For V ′ ≡ 0 can write ut +

(

0 c

c 0

)

ux = 0, u =

(

φt

−cφx

)

.

All in all a far more civilized problem than advection.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 15 / 26

Page 23: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

The (nonlinear) wave equation

The PDE is 2nd order in time and space:

φtt = c2φxx − V ′(φ), x0 ≤ x ≤ xJ+1, t > 0,

c > 0 is a constant, V (φ) is smooth, V ′(φ) ≡ dV (φ)dφ .

Initial conditions

φ(0, x) = φ0(x), φt(0, x) = φ1(x).

Boundary conditions: periodic on [x0, xJ+1] or Dirichlet:

φ(t, x0) = φ(t, xJ+1) = 0.

May also have absorbing, or radiating BC, designed to ensure thatspurious waves do not propagate back into domain.

For V ′ ≡ 0 can write ut +

(

0 c

c 0

)

ux = 0, u =

(

φt

−cφx

)

.

All in all a far more civilized problem than advection.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 15 / 26

Page 24: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

The wave equation

The PDE is 2nd order in time and space:

φtt = c2φxx − V ′(φ), x0 ≤ x ≤ xJ+1, t > 0.

Characteristic curves: dxdt

= ±c .

For the linear case V ′ ≡ 0, the solution of the Cauchy problem is

φ(t, x) =1

2[φ0(x − ct) + φ0(x + ct)] +

1

2c

∫ x+ct

x−ct

φ1(ξ)dξ.

So, it is easy to construct exact solutions if φt(0, x) = 0.

For periodic BC on [−L, L], obtain φ(2lL, x) = φ(0, x) for any integerl ; for Dirichlet BC on [−L, L], obtain φ(4lL, x) = φ(0, x) for anyinteger l .

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 16 / 26

Page 25: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

The wave equation

The PDE is 2nd order in time and space:

φtt = c2φxx − V ′(φ), x0 ≤ x ≤ xJ+1, t > 0.

Characteristic curves: dxdt

= ±c .

For the linear case V ′ ≡ 0, the solution of the Cauchy problem is

φ(t, x) =1

2[φ0(x − ct) + φ0(x + ct)] +

1

2c

∫ x+ct

x−ct

φ1(ξ)dξ.

So, it is easy to construct exact solutions if φt(0, x) = 0.

For periodic BC on [−L, L], obtain φ(2lL, x) = φ(0, x) for any integerl ; for Dirichlet BC on [−L, L], obtain φ(4lL, x) = φ(0, x) for anyinteger l .

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 16 / 26

Page 26: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Hamiltonian semi-discretization

Centred semi-discretization

d2vj

dt2=

c2

h2(vj−1 − 2vj + vj+1)− V ′(vj), j = 1, . . . , J.

Can write this asd2v

dt2= −Bv − V ′(v),

the matrix B is symmetric positive definite.

This is a (separable) Hamiltonian system with

H(v,w) =1

2wTw +

1

2vTBv + V (v),

(so wj =dvjdt, j = 1, . . . , J).

This semi-discretization yields a symplectic map, and it makes senseto discretize it in time using a symplectic method.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 17 / 26

Page 27: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog redux

Apply the symplectic, explicit Verlet method

vn+1j − vnj

k= w

n+1/2j , j = 1, . . . , J,

wn+1/2j − w

n−1/2j

k=

c2

h2

(

vnj−1 − 2vnj + vnj+1

)

− V ′(vnj ).

Eliminate the w ’s, obtaining (for j = 1, 2, . . . , J)

vn+1j − 2vnj + vn−1

j = c2µ2(vnj−1 − 2vnj + vnj+1)− k2V ′(vnj ).

This is the leap-frog method! (but unlike for advection it is compacthere).

The leap-frog method is a favourite method for integrating theclassical wave equation (for variable c(x), too).

But what about dispersion?

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 18 / 26

Page 28: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog redux

Apply the symplectic, explicit Verlet method

vn+1j − vnj

k= w

n+1/2j , j = 1, . . . , J,

wn+1/2j − w

n−1/2j

k=

c2

h2

(

vnj−1 − 2vnj + vnj+1

)

− V ′(vnj ).

Eliminate the w ’s, obtaining (for j = 1, 2, . . . , J)

vn+1j − 2vnj + vn−1

j = c2µ2(vnj−1 − 2vnj + vnj+1)− k2V ′(vnj ).

This is the leap-frog method! (but unlike for advection it is compacthere).

The leap-frog method is a favourite method for integrating theclassical wave equation (for variable c(x), too).

But what about dispersion?

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 18 / 26

Page 29: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog redux

Apply the symplectic, explicit Verlet method

vn+1j − vnj

k= w

n+1/2j , j = 1, . . . , J,

wn+1/2j − w

n−1/2j

k=

c2

h2

(

vnj−1 − 2vnj + vnj+1

)

− V ′(vnj ).

Eliminate the w ’s, obtaining (for j = 1, 2, . . . , J)

vn+1j − 2vnj + vn−1

j = c2µ2(vnj−1 − 2vnj + vnj+1)− k2V ′(vnj ).

This is the leap-frog method! (but unlike for advection it is compacthere).

The leap-frog method is a favourite method for integrating theclassical wave equation (for variable c(x), too).

But what about dispersion?

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 18 / 26

Page 30: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog example: V′ ≡ 0, α = 1, φt(0) ≡ 0

c = 1, φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .02, h = .04.

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

u

Leap−frog scheme

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 19 / 26

Page 31: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog example: V′ ≡ 0, α = 10, φt(0) ≡ 0

c = 1, φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .01, h = .02.

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

u

Leap−frog scheme

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 20 / 26

Page 32: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog example: V′(φ) = sin(φ), α = 1

The sine-Gordon eqn: is solution qualitatively correct?c = 1, φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .005, h = .01.

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x

u

Leap−frog scheme

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 21 / 26

Page 33: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral methods

An important class of high order methods, introduced here in ananecdotal fashion.

For the problem uxx = q(x) apply Fourier transform as a solver,rather than a theoretical tool to analyze stability.

On a uniform mesh, use fast Fourier transform (FFT). Solve pointwisein Fourier space ξ, then return to x using IFFT.

This gives a very high order of accuracy if the BC are periodic, goodfor numerical dispersion.

For our PDE problem with periodic boundary conditions, useleap-frog in time:

vn+1 = vn−1 + 2vn + k2F−1(

−ξ2F(vn))

− k2V ′(vn).

See Section 7.4 for more.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 22 / 26

Page 34: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral methods

An important class of high order methods, introduced here in ananecdotal fashion.

For the problem uxx = q(x) apply Fourier transform as a solver,rather than a theoretical tool to analyze stability.

On a uniform mesh, use fast Fourier transform (FFT). Solve pointwisein Fourier space ξ, then return to x using IFFT.

This gives a very high order of accuracy if the BC are periodic, goodfor numerical dispersion.

For our PDE problem with periodic boundary conditions, useleap-frog in time:

vn+1 = vn−1 + 2vn + k2F−1(

−ξ2F(vn))

− k2V ′(vn).

See Section 7.4 for more.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 22 / 26

Page 35: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral methods

An important class of high order methods, introduced here in ananecdotal fashion.

For the problem uxx = q(x) apply Fourier transform as a solver,rather than a theoretical tool to analyze stability.

On a uniform mesh, use fast Fourier transform (FFT). Solve pointwisein Fourier space ξ, then return to x using IFFT.

This gives a very high order of accuracy if the BC are periodic, goodfor numerical dispersion.

For our PDE problem with periodic boundary conditions, useleap-frog in time:

vn+1 = vn−1 + 2vn + k2F−1(

−ξ2F(vn))

− k2V ′(vn).

See Section 7.4 for more.

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 22 / 26

Page 36: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral l-f: V′(φ) = sin(φ), α = 1, c = 1

φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .002, J = 2000 (h = .01).

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x

u

spectral leap−frog

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 23 / 26

Page 37: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Leap-frog example: V′(φ) = sin(φ), α = 10, c = 1

φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .005, h = .01.

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

u

Leap−frog scheme

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 24 / 26

Page 38: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral l-f: V′(φ) = sin(φ), α = 10, c = 1

φ(0, x) = e−αx2 , −10 ≤ x ≤ 10; tf = 400, k = .002, J = 2000 (h = .01).

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

u

spectral leap−frog

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 25 / 26

Page 39: CS520: Dispersion and dissipation (Ch. 7)ascher/520/chapt07.pdfnumerical dispersion! (After all, they are not meant to approximate high wave number solution components well.) Trouble

Dispersion Wave equation

Spectral l-f: V′(φ) = sin(φ), α = 10, c = 1

φ(0, x) = e−αx2 , tf = 400, k = .001, J = 4000 (h = .005).

−10 −8 −6 −4 −2 0 2 4 6 8 10−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

u

spectral leap−frog

Uri Ascher (UBC) CPSC 520: Dispersion and dissipation Fall 2012 26 / 26