Jump to content

User:Compsonheir/Numerical diffusion

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Compsonheir (talk | contribs) at 17:13, 18 December 2013 (→‎The modified differential equation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In numerical analysis, computer simulations of continua (such as fluids, solids, or electromagnetic waves) can exhibit a higher diffusivity than the true medium; this is called numerical diffusion. In some instances, numerical diffusion is a nuisance because the object of study is not diffusive at all, such as an ideal fluid. However, numerical diffusion is sometimes introduced on purpose for its stabilizing and smoothing effects.

In addition to numerical diffusion, some discretizations of differential equations introduce numerical dispersion instead. Oftentimes there is a tradeoff between the two effects.

The modified differential equation

One can ascertain whether a numerical approximation to a PDE's solution exhibits numerical diffusion or dispersion by finding a different differential equation to which it is a more accurate solution. If that modified equation is diffusive, then the approximation scheme exhibits numerical diffusion.

An approximation with artificial diffusion

Consider the one-dimensional advection equation

for the unknown function u. This problem has the analytical solution , where u0 is the initial condition; this makes it very easy to use as a benchmark. Let U be an approximation to u computed using the finite difference method, taking the spatial mesh width to be Δx and the timestep to be Δt, with j indexing the spatial coordinate and n the time coordinate.

First, consider the upwind method:

It is known that, provided Δx/Δt > c, the upwind method is accurate to order O(Δx). However, by appealing to Taylor's theorem, one can show[1] that U is a more accurate solution of another partial differential equation, the modified equation. Specifically, U is an O(Δx2)-accurate approximation to the solution of

which is now an advection-diffusion equation with diffusion coefficient

The character of the modified equation tells us a lot about the nature of our numerical approximation. The presence of the diffusive terms means that U will appear smoother and more spread out over time than the true solution u, which is especially pronounced in the propagation of shock waves.

An approximation with artificial dispersion

Now consider a different discretization, the Lax-Wendroff method:

Using Taylor's theorem again, the same analysis as for the upwind method shows that the Lax-Wendroff scheme is an O(Δx3)-accurate solution of the equation

This equation exhibits dispersion rather than diffusion, so that different wavelengths have difference group velocities. In order to ascertain the behavior of the numerical method, we can compute the dispersion relation:

For small k, the frequency ω is approximately linear in k, as it should be. However, for large k, the group velocity moves in the opposite direction as the wave packet should be.

Numerical dispersion relation

Another way to look at numerical diffusion or dispersion is by thinking of the discrete solution as a superposition of waves in the same way that one uses Fourier analysis for the true solution of the differential equation. In so doing, one can define a numerical dispersion relation and a numerical group velocity.


References

  1. ^ R.J. Leveque (2007). Finite Difference Methods for Ordinary and Partial Differential Equations. SIAM. ISBN 978-0-898716-29-0.