Lax–Friedrichs method

{{Short description|Mathematical method}}

The Lax–Friedrichs method, named after Peter Lax and Kurt O. Friedrichs, is a numerical method for the solution of hyperbolic partial differential equations based on finite differences. The method can be described as the FTCS (forward in time, centered in space) scheme with a numerical dissipation term of 1/2. One can view the Lax–Friedrichs method as an alternative to Godunov's scheme, where one avoids solving a Riemann problem at each cell interface, at the expense of adding artificial viscosity.

Illustration for a Linear Problem

Consider a one-dimensional, linear hyperbolic partial differential equation for u(x,t) of the form:

u_t + a u_x = 0

on the domain

b \leq x \leq c,\; 0 \leq t \leq d

with initial condition

u(x,0) = u_0(x)\,

and the boundary conditions

\begin{align}

u(b,t) &= u_b(t) \\

u(c,t) &= u_c(t).

\end{align}

If one discretizes the domain (b, c) \times (0, d) to a grid with equally spaced points with a spacing of \Delta x in the x-direction and \Delta t in the t-direction, we introduce an approximation \tilde u of u

u_i^n = \tilde u(x_i, t^n) ~~\text{ with }~~

\begin{array}{l}x_i = b + i\,\Delta x ,\\ t^n = n\,\Delta t\end{array}

~~\text{ for }~~

\begin{array}{l}i = 0,\ldots,N ,\\ n = 0,\ldots,M,\end{array}

where

N = \frac{c - b}{\Delta x} ,\, M = \frac{d}{\Delta t}

are integers representing the number of grid intervals. Then the Lax–Friedrichs method to approximate the partial differential equation is given by:

\frac{u_i^{n+1} - \frac{1}{2}(u_{i+1}^n + u_{i-1}^n)}{\Delta t} + a\frac{u_{i+1}^n - u_{i-1}^n}{2\,\Delta x} = 0

Or, rewriting this to solve for the unknown u_i^{n+1},

u_i^{n+1} = \frac{1}{2} \left(u_{i+1}^n + u_{i-1}^n\right) - a\frac{\Delta t}{2\,\Delta x} \left(u_{i+1}^n - u_{i-1}^n\right)

Where the initial values and boundary nodes are taken from

\begin{align}

u_i^0 &= u_0(x_i) \\

u_0^n &= u_b(t^n) \\

u_N^n &= u_c(t^n).

\end{align}

Extensions to Nonlinear Problems

A nonlinear hyperbolic conservation law is defined through a flux function f :

u_t + ( f(u) )_x = 0.

In the case of f(u) = a u , we end up with a scalar linear problem. Note that in general, u is a vector with m equations in it.

The generalization of the Lax-Friedrichs method to nonlinear systems takes the form{{Cite book |last=LeVeque |first=Randall J. |url=https://www.worldcat.org/oclc/828775522 |title=Numerical methods for conservation laws |date=1992 |publisher=Birkhäuser Verlag |isbn=978-3-0348-8629-1 | page=125 |location=Basel |oclc=828775522}}

u_i^{n+1} = \frac{1}{2} \left(u_{i+1}^n + u_{i-1}^n\right) - \frac{\Delta t}{2\,\Delta x} \left( f( u_{i+1}^n ) - f( u_{i-1}^n ) \right).

This method is conservative and first order accurate, hence quite dissipative. It can, however be used as a building block for building high-order numerical schemes for solving hyperbolic partial differential equations, much like Euler time steps can be used as a building block for creating high-order numerical integrators for ordinary differential equations.

We note that this method can be written in conservation form:

u_i^{n+1} = u^n_i - \frac{\Delta t}{ \Delta x} \left( \hat{f}^n_{i+1/2} - \hat{f}^n_{i-1/2} \right),

where

\hat{f}^n_{i-1/2} = \frac{1}{2} \left( f_{i-1} + f_{i} \right) - \frac{ \Delta x}{ 2 \Delta t } \left( u^n_{i} - u^n_{i-1} \right).

Without the extra terms u^n_i and u^n_{i-1} in the discrete flux, \hat{f}^n_{i-1/2} , one ends up with the FTCS scheme, which is well known to be unconditionally unstable for hyperbolic problems.

Stability and accuracy

File:LF-Initial.png

File:LF-Solution.png

This method is explicit and first order accurate in time and first order accurate in space ( O(\Delta t) + O({\Delta x^2}/{\Delta t})) provided u_0(x),\, u_b(t),\, u_c(t) are sufficiently-smooth functions. Under these conditions, the method is stable if and only if the following condition is satisfied:

\left| a\frac{\Delta t}{\Delta x} \right| \leq 1.

(A von Neumann stability analysis can show the necessity of this stability condition.) The Lax–Friedrichs method is classified as having second-order dissipation and third order dispersion.{{Citation | last1=Chu| first1=C. K. | title=Numerical Methods in Fluid Mechanics | publisher=Academic Press | location=New York | series=Advances in Applied Mechanics | isbn=978-0-12-002018-8 | year=1978 | volume=18 | page=304}} For functions that have discontinuities, the scheme displays strong dissipation and dispersion;{{Citation | last1=Thomas | first1=J. W. | title=Numerical Partial Differential Equations: Finite Difference Methods | publisher=Springer-Verlag | location=Berlin, New York | series=Texts in Applied Mathematics | isbn=978-0-387-97999-1 | year=1995 | volume=22 | at=§7.8}} see figures at right.

References

{{reflist}}

  • {{Citation | last1=DuChateau | first1=Paul | last2=Zachmann | first2=David | title=Applied Partial Differential Equations | publisher=Dover Publications | location=New York | isbn=978-0-486-41976-3 | year=2002 | url-access=registration | url=https://archive.org/details/appliedpartialdi00duch }}
  • {{Citation |last1=Press |first1=William H |last2=Teukolsky |first2=SA |last3=Vetterling |first3=WT |last4=Flannery |first4=BP |year=2007 |title=Numerical Recipes: The Art of Scientific Computing |edition=3rd |publisher=Cambridge University Press |publication-place=New York |isbn=978-0-521-88068-8 |chapter=Section 20.1.2. Lax Method |chapter-url=http://apps.nrbook.com/empanel/index.html#pg=1034}}

{{Numerical PDE}}

{{DEFAULTSORT:Lax-Friedrichs method}}

Category:Numerical differential equations

Category:Computational fluid dynamics