Solving the Convection-Diffusion Equation in 1D Using Finite Differences

This Demonstration shows the solution of the convection-diffusion partial differential equation (PDE) in one dimension with periodic boundary conditions. You can specify different initial conditions. Selected preconfigured test cases are available from the dropdown menu.
The system is discretized in space and for each time step the solution is found using . The plot shown represents the solution . You can select a 3D or 2D view using the controls at the top of the display.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The convection-diffusion partial differential equation (PDE) solved is , where is the diffusion parameter, is the advection parameter (also called the transport parameter), and is the convection parameter. The domain is with periodic boundary conditions. Initial conditions are given by . You can specify using the initial conditions button. The time step is , where is the multiplier, is the grid size, and is the diffusion parameter. You can change the multiplier using the slider. The total run time of the simulation is specified using the slider labeled "time".
The system solved at each time step is where is the solution of the PDE. The matrix is given by
where and . In the above is taken to be the vector of initial conditions. All values used are assumed to be in SI units.
[1] S. J. Farlow, Partial Differential Equations for Scientists and Engineers, New York: Dover, 1993.
    • 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 »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+