- Consider equations with only convection
- Assume constant
. - This is a linear PDE.
- Exact solution
where
Note
- The second order wave equation is given by
- Consider the following system of two first order wave equations:
- Now subtract the second equation from the first to recover the second order wave equation:
- 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
- unconditionally unstable
- Consistent
- Stencil:
* O *
O O O
Lax
- Fix the instability.
- Instead of
use
- Stable for
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:
- FTCS:
- Taylor series for
’s:
- Substitute this into FTCS to get the MDE:
- Now, the
term in this equation can be replaced with as follows:
- In the last step, we used
. - Hence, the MDE is:
- Now, subtract off the error term from the RHS of FTCS:
- Finally, discretize the
term and rearrange:
- Stable for
- Consistent
- Stencil:
* O *
O O O
Note
- The error terms are now
and third order derivatives in the error terms.- Error terms that have even derivatives (like
) are diffusive and cause unphysical smoothing in the solution. - Error terms that have odd derivatives (like
) are dispersive and cause unphysical wiggles in the solution.
- Error terms that have even derivatives (like
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
where
-
is the slope in time of , so is the average slope. -
Approximate this average slope as
-
Hence,
-
If we take an explicit Euler step to
, then we can evaluate 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
we use a forward difference: . Denote this as - When discretizing
we use a backward difference: . Denote this as
- When discretizing
-
Summary:
- Predictor:
- Corrector:
-
This second equation can be written as
-
For the 1-D linear wave equation, this method is the same as the Lax Wendroff method.
-
-
-
Stable for
-
Consistent
-
Stencil:
O O *
* O O
Upwind method
-
We have seen this already.
-
For positive
we have -
-
-
Stable for
-
Consistent
-
Stencil:
* O *
O O *
Second order upwind
- If we use our old second order one-sided finite difference approximation for
, the result is unconditionally unstable. - Hoffman gives an alternative:
-
This equation is exact for the linear 1D wave equation for
. -
-
-
Stable for
-
Consistent
-
Stencil:
* * O *
O O O *
BTCS
- 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 | Approach | Stability | Comment | ||
---|---|---|---|---|---|---|
FTCS | X | 1 | 2 | direct, forward in time, central in space | NO | doesn’t work |
Lax | X | 1 | 2 | average |
inconsistent | |
Lax Wendroff | okay | 2 | 2 | fix low order error |
hard for nonlinear, systems, multi-D | |
MacCormack | good | 2 | 2 | time adv. with avg. RHS slope: | good for nonlinear, systems, multi-D | |
Upwind | poor | 1 | 1 | very diffusive | diffusive, low order | |
2nd Order Upwind | okay | 2 | 2 | 3 point stencil | oscillatory | |
BTCS | poor | 1 | 2 | implicit | unphysical info. speed |