Hyperbolic equations 1

  • Consider equations with only convection

ft+ufx=0.

  • Assume constant u.
  • This is a linear PDE.
  • Exact solution

f(x,t)=f0(xut),

where f0(x) is the initial f profile. That is, we just shift the domain. This is consistent with this PDE being a wave equation, where the solution advects across the domain without changing shape.

Note

  • The second order wave equation is given by

2f2t=u22f2x.

  • Consider the following system of two first order wave equations:

ft+ugx=0/tftt+ugxt=0

gt+ufx=0u, swap xt order/xugtx+u2fxx=0

  • Now subtract the second equation from the first to recover the second order wave equation:

fttu2fxx=0.

  • This shows that the second order wave equation is equivalent to a system of two first order wave equations.
  • Here, we’ll focus on the first order wave equation.

Methods

  • FTCS
  • Lax
  • Lax Wendroff
  • MacCormack
  • Upwind
  • BTCS

FTCS

ft+ufx=0,

fin+1finΔt+ufi1nfi+1n2Δx=0,

fin+1=finc2(fi+1nfi1n).

  • c=uΔt/Δx
  • O(Δt)
  • O(Δx2)
  • unconditionally unstable
  • Consistent
  • Stencil:
    *     O     *
    
    O     O     O

Lax

  • Fix the instability.
  • Instead of fin use 12(fi1n+fi+1n).

fin+1=12(fi1n+fi+1n)u2(fi+1nfi1n).

  • O(Δt)
  • O(Δx2)
  • Stable for c=uΔtΔx1
    • c1 is the Courant Friedrichs Lewy (CFL) stability criterion
  • Inconsistent
    *     O     *
    
    O     *     O

Lax Wendroff

  • Fix the FTCS method
  • Consider the modified differential equation: MDE
    • When we solve PDEs as finite difference equations (FDEs), the FDE has truncation error (from terms we ignore in the Taylor series).
    • A Taylor series can be used to show the PDE that is equivalent to the FDE we are solving. This equivalent PDE is called the modified differential equation (MDE).
  • PDE:

ft+ufx=0.

  • FTCS:

fin+1finΔt+c2Δt(fi1nfi+1n)=0.

  • Taylor series for f’s:

fin+1=fin+Δtft+12Δt2ftt+, fi1n=finΔxfx+12Δx2fxx+, fi+1n=fin+Δxfx+12Δx2fxx+,

  • Substitute this into FTCS to get the MDE:

ft+ufx=12Δtftt+(higher order terms).

  • Now, the ftt term in this equation can be replaced with u2fxx as follows:

t(ft=ufx)ftt,

=uftx=u(ft)x,

=u2fxx

  • In the last step, we used ft=ufx.
  • Hence, the MDE is:
ft+ufx=12Δtu2fxxerror term.
  • Now, subtract off the error term from the RHS of FTCS:

fin+1finΔt+c2Δt(fi+1nfi1n)=12Δtu2fxx.

  • Finally, discretize the fxx term and rearrange:
fin+1=finc2(fi+1nfi1n)+12c2(fi1n2fin+fi+1n).
  • O(Δt2)
  • O(Δx2)
  • Stable for c=uΔtΔx1
  • Consistent
  • Stencil:
    *     O     *
    
    O     O     O

Note

  • The error terms are now fttt and fxxx third order derivatives in the error terms.
    • Error terms that have even derivatives (like fxx) are diffusive and cause unphysical smoothing in the solution.
    • Error terms that have odd derivatives (like fxxx) are dispersive and cause unphysical wiggles in the solution.

Question

  • Normally, diffusive terms help stability, so why is it that the error term in the FTCS method above (which is a second order, diffusive term) is the cause of the instability?
    • What does this term do physically?
    • Look at the term and consider its form.

MacCormack

  • Was and is widely used
  • Used for systems of equations, nonlinear equations
  • Similar to Crank-Nicolson

ft=ufx=RHS=F.

f=Ftfin+1fin=Fdt=Fdt,

where

F=1Δttt+ΔtFdt.

  • F is the slope in time of f, so F is the average slope.

  • Approximate this average slope as F=12(Fn+Fn+1).

  • Hence, fin+1=fin+Δt2(Fin+Fin+1).

  • If we take an explicit Euler step to f~in+1, then we can evaluate Fin+1 there. Then we can evaluate the above equation explicitly.

    • This would be the equivalent of the Modified Euler method for PDEs.
  • We do this, but

    • When discretizing Fin we use a forward difference: fx=(fi+1fi)/Δx. Denote this as +Fin+1.
    • When discretizing Fin+1 we use a backward difference: fx=(fifi1)/Δx. Denote this as Fin+1.
  • Summary:

    • Predictor:

    f~in+1=finc(fi+1nfin),

    • Corrector:

    fin+1=fin12[c(fi+1nfin)+c(f~in+1f~i1n+1)].

    • This second equation can be written as

      fin+1=12[fin+f~in+1c(f~in+1f~i1n+1)].

  • For the 1-D linear wave equation, this method is the same as the Lax Wendroff method.

  • O(Δt2)

  • O(Δx2)

  • Stable for c=uΔtΔx1

  • Consistent

  • Stencil:

    O     O     *
    
    *     O     O

Upwind method

  • We have seen this already.

  • For positive u we have fin+1=finc(finfi1n).

  • O(Δt)

  • O(Δx)

  • Stable for c=uΔtΔx1

  • Consistent

  • Stencil:

    *     O     *
    
    O     O     *

Second order upwind

  • If we use our old second order one-sided finite difference approximation for fx, the result is unconditionally unstable.
  • Hoffman gives an alternative:

fin+1=finc(finfi1n)c(1c)2(fin2fi1n+fi2n).

  • This equation is exact for the linear 1D wave equation for c=1.

  • O(Δt2)

  • O(Δx2)

  • Stable for c=uΔtΔx2

  • Consistent

  • Stencil:

    *     *     O     *
    
    O     O     O     *

BTCS

fin+1finΔt+u2Δx(fi1n+1fi1n+1)=0.

  • O(Δt)
  • O(Δx2)
  • Unconditionally stable
  • Consistent
  • Unphysical: propagation speed of information, unlike the PDE.
    • The wave lags behind the real answer.
  • Stencil:
    O     O     O
   
    *     O     *

Methods Summary

Method Recommend O(Δt) O(Δx) Approach Stability Comment
FTCS X 1 2 direct, forward in time, central in space NO doesn’t work
Lax X 1 2 average fin c1 inconsistent
Lax Wendroff okay 2 2 fix low order error ftt term c1 hard for nonlinear, systems, multi-D
MacCormack good 2 2 time adv. with avg. RHS slope: c1 good for nonlinear, systems, multi-D
Upwind poor 1 1 very diffusive c1 diffusive, low order
2nd Order Upwind okay 2 2 3 point stencil c2 oscillatory
BTCS poor 1 2 implicit c2 unphysical info. speed