# Von Neumann stability analysis

In numerical analysis, von Neumann stability analysis (also known as Fourier stability analysis) is a procedure used to check the stability of finite difference schemes as applied to linear partial differential equations.[1] The analysis is based on the Fourier decomposition of numerical error and was developed at Los Alamos National Laboratory after having been briefly described in a 1947 article by British researchers Crank and Nicolson.[2] This method is an example of explicit time integration where the function that defines governing equation is evaluated at the current time. Later, the method was given a more rigorous treatment in an article[3] co-authored by John von Neumann.

## Numerical stability

The stability of numerical schemes is closely associated with numerical error. A finite difference scheme is stable if the errors made at one time step of the calculation do not cause the errors to be magnified as the computations are continued. A neutrally stable scheme is one in which errors remain constant as the computations are carried forward. If the errors decay and eventually damp out, the numerical scheme is said to be stable. If, on the contrary, the errors grow with time the numerical scheme is said to be unstable. The stability of numerical schemes can be investigated by performing von Neumann stability analysis. For time-dependent problems, stability guarantees that the numerical method produces a bounded solution whenever the solution of the exact differential equation is bounded. Stability, in general, can be difficult to investigate, especially when the equation under consideration is nonlinear.

In certain cases, von Neumann stability is necessary and sufficient for stability in the sense of Lax–Richtmyer (as used in the Lax equivalence theorem): The PDE and the finite difference scheme models are linear; the PDE is constant-coefficient with periodic boundary conditions and has only two independent variables; and the scheme uses no more than two time levels.[4] Von Neumann stability is necessary in a much wider variety of cases. It is often used in place of a more detailed stability analysis to provide a good guess at the restrictions (if any) on the step sizes used in the scheme because of its relative simplicity.

## Illustration of the method

The von Neumann method is based on the decomposition of the errors into Fourier series. To illustrate the procedure, consider the one-dimensional heat equation

${\displaystyle {\frac {\partial u}{\partial t}}=\alpha {\frac {\partial ^{2}u}{\partial x^{2}}}}$

defined on the spatial interval ${\displaystyle L}$ , which can be discretized[5] as

${\displaystyle \quad (1)\qquad u_{j}^{n+1}=u_{j}^{n}+r\left(u_{j+1}^{n}-2u_{j}^{n}+u_{j-1}^{n}\right)}$

where

${\displaystyle r={\frac {\alpha \,\Delta t}{\left(\Delta x\right)^{2}}}}$

and the solution ${\displaystyle u_{j}^{n}}$  of the discrete equation approximates the analytical solution ${\displaystyle u(x,t)}$  of the PDE on the grid.

Define the round-off error ${\displaystyle \epsilon _{j}^{n}}$  as

${\displaystyle \epsilon _{j}^{n}=N_{j}^{n}-u_{j}^{n}}$

where ${\displaystyle u_{j}^{n}}$  is the solution of the discretized equation (1) that would be computed in the absence of round-off error, and ${\displaystyle N_{j}^{n}}$  is the numerical solution obtained in finite precision arithmetic. Since the exact solution ${\displaystyle u_{j}^{n}}$  must satisfy the discretized equation exactly, the error ${\displaystyle \epsilon _{j}^{n}}$  must also satisfy the discretized equation.[6] Here we assumed that ${\displaystyle N_{j}^{n}}$  satisfies the equation, too (this is only true in machine precision). Thus

${\displaystyle \quad (2)\qquad \epsilon _{j}^{n+1}=\epsilon _{j}^{n}+r\left(\epsilon _{j+1}^{n}-2\epsilon _{j}^{n}+\epsilon _{j-1}^{n}\right)}$

is a recurrence relation for the error. Equations (1) and (2) show that both the error and the numerical solution have the same growth or decay behavior with respect to time. For linear differential equations with periodic boundary condition, the spatial variation of error may be expanded in a finite Fourier series with respect to ${\displaystyle x}$ , in the interval ${\displaystyle L}$ , as

${\displaystyle \quad (3)\qquad \epsilon (x,t)=\sum _{m=-M}^{M}E_{m}(t)e^{{i}k_{m}x}}$

where the wavenumber ${\displaystyle k_{m}={\frac {\pi m}{L}}}$  with ${\displaystyle m=-M,\dots ,-2,-1,0,1,2,\dots ,M}$  and ${\displaystyle M=L/\Delta x}$ . The time dependence of the error is included by assuming that the amplitude of error ${\displaystyle E_{m}}$  is a function of time. Often the assumption is made that the error grows or decays exponentially with time, but this is not necessary for the stability analysis.

If the boundary condition is not periodic, then we may use the finite Fourier integral with respect to ${\displaystyle x}$ :

${\displaystyle \quad (4)\qquad \epsilon (x,t)=\int _{k=-{\frac {\pi }{\Delta x}}}^{k={\frac {\pi }{\Delta x}}}E_{k}(t)e^{{i}kx}dk}$

Since the difference equation for error is linear (the behavior of each term of the series is the same as series itself), it is enough to consider the growth of error of a typical term:

${\displaystyle \quad (5a)\qquad \epsilon _{m}(x,t)=E_{m}(t)e^{ik_{m}x}}$

if a Fourier series is used or

${\displaystyle \quad (5b)\qquad \epsilon _{k}(x,t)=E_{k}(t)e^{ikx}}$

if a Fourier integral is used.

As the Fourier series can be considered to be a special case of the Fourier integral, we will continue the development using the expressions for the Fourier integral.

The stability characteristics can be studied using just this form for the error with no loss in generality. To find out how error varies in steps of time, substitute equation (5b) into equation (2), after noting that

{\displaystyle {\begin{aligned}\epsilon _{j}^{n}&=E_{m}(t)e^{ik_{m}x}\\\epsilon _{j}^{n+1}&=E_{m}(t+\Delta t)e^{ik_{m}x}\\\epsilon _{j+1}^{n}&=E_{m}(t)e^{ik_{m}(x+\Delta x)}\\\epsilon _{j-1}^{n}&=E_{m}(t)e^{ik_{m}(x-\Delta x)},\end{aligned}}}

to yield (after simplification)

${\displaystyle \quad (6)\qquad {\frac {E_{m}(t+\Delta t)}{E_{m}(t)}}=1+r\left(e^{ik_{m}\Delta x}+e^{-ik_{m}\Delta x}-2\right).}$

Introducing ${\displaystyle \theta =k_{m}\Delta x\in [-\pi ,\pi ]}$  and using the identities

${\displaystyle \qquad \sin \left({\frac {\theta }{2}}\right)={\frac {e^{i\theta /2}-e^{-i\theta /2}}{2i}}\qquad \rightarrow \qquad \sin ^{2}\left({\frac {\theta }{2}}\right)=-{\frac {e^{i\theta }+e^{-i\theta }-2}{4}}}$

equation (6) may be written as

${\displaystyle \quad (7)\qquad {\frac {E_{m}(t+\Delta t)}{E_{m}(t)}}=1-4r\sin ^{2}(\theta /2)}$

Define the amplification factor

${\displaystyle \quad (8)\qquad G\equiv {\frac {E_{m}(t+\Delta t)}{E_{m}(t)}}}$

The necessary and sufficient condition for the error to remain bounded is that ${\displaystyle \vert G\vert \leq 1.}$  Thus, from equations (7) and (8), the condition for stability is given by

${\displaystyle \quad (9)\qquad \left\vert 1-4r\sin ^{2}(\theta /2)\right\vert \leq 1}$

Note that the term ${\displaystyle 4r\sin ^{2}(\theta x/2)}$  is always positive. Thus, to satisfy Equation (9):

${\displaystyle \quad (10)\qquad 4r\sin ^{2}(\theta /2)\leq 2}$

For the above condition to hold for all ${\displaystyle m}$  (and therefore all ${\displaystyle \sin ^{2}(\theta x/2)}$ ). The highest value the sinusoidal term can take is 1 and for that particular choice if the upper threshold condition is satisfied, then so will be for all grid points, thus we have

${\displaystyle \quad (11)\qquad r={\frac {\alpha \Delta t}{\left(\Delta x\right)^{2}}}\leq {\frac {1}{2}}}$

Equation (11) gives the stability requirement for the FTCS scheme as applied to one-dimensional heat equation. It says that for a given ${\displaystyle \Delta x}$ , the allowed value of ${\displaystyle \Delta t}$  must be small enough to satisfy equation (10).

Similar analysis shows that a FTCS scheme for linear advection is unconditionally unstable.

## References

1. ^ Analysis of Numerical Methods by E. Isaacson, H. B. Keller
2. ^ Crank, J.; Nicolson, P. (1947), "A Practical Method for Numerical Evaluation of Solutions of Partial Differential Equations of Heat Conduction Type", Proc. Camb. Phil. Soc., 43: 50–67, doi:10.1007/BF02127704
3. ^ Charney, J. G.; Fjørtoft, R.; von Neumann, J. (1950), "Numerical Integration of the Barotropic Vorticity Equation", Tellus, 2: 237–254, doi:10.3402/tellusa.v2i4.8607
4. ^ Smith, G. D. (1985), Numerical Solution of Partial Differential Equations: Finite Difference Methods, 3rd ed., pp. 67–68
5. ^ in this case, using the FTCS discretization scheme
6. ^ Anderson, J. D., Jr. (1994). Computational Fluid Dynamics: The Basics with Applications. McGraw Hill.CS1 maint: multiple names: authors list (link)