10217

Numerical Solution of the Advection Partial Differential Equation: Finite Differences, Fixed Step Methods

This Demonstration shows some numerical methods for the solution of partial differential equations: in particular we solve the advection equation. We use finite differences with fixed-step discretization in space and time and show the relevance of the Courant–Friedrichs–Lewy stability criterion for some of these discretizations.

DETAILS

It is hard to find reliable numerical methods for the solution of partial differential equations (PDEs). Often they turn out to be either unstable or strongly diffusive, giving inaccurate solutions even to simple equations.
Our case study is one of the simplest PDEs, the advection equation
that describes the propagation of an unchanging shape at constant speed . Trivially, this equation is solved by any function .
To solve it numerically we approximate to a discrete solution defined in a rectangular grid, . For the spatial derivative we use a first-order, centered approximation
.
We can think now of many discrete approximations for the time derivative. The simplest one is the explicit Euler discretization:
.
Then we arrive at the method usually abbreviated FTCS (forward in time, centered in space). Unfortunately, this discretization turns out to be numerically unstable for any value of and .
A first improvement to the FTCS scheme would be to replace the term in the time discretization by an average . This approach, often called the Lax method, is equivalent to adding an artificial diffusion term to the advection equation. The resulting scheme is now stable if it satisfies the Courant–Friedrichs–Lewy condition:
,
where is called the Courant number. However, since we are adding an artificial diffusive term, the scheme becomes too diffusive and therefore inaccurate when . The Lax method gives optimal results for .
Fortunately, the differential equation solver of Mathematica, NDSolve, comes with many numerical schemes that avoid the shortcomings of the FTCS and Lax methods. In this Demonstration you can choose some of these methods with a fixed-step time discretization.
Bibliography:
R. Courant, K. Friedrichs, and H. Lewy, On the Partial Difference Equations of Mathematical Physics, IBM J. Res. Develop., 11, 1967 pp. 215–234.
W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical Recipes: The Art of Scientific Computing, 3rd ed., Cambridge, UK: Cambridge University Press, 2007.
 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.