Advection Equation Solver Calculator

Track transported wave shapes across space and time. Compare schemes, errors, and stability with clarity. Export results for class notes, analysis, and quick review.

Computed Result

Shown above the form after submission.

Exact value:
0.367879
Phase shift:
1.200000
Courant number:
0.200000
Best method:
Lax-Wendroff
Upwind: 0.417041 | error 0.049162
Lax-Friedrichs: 0.401520 | error 0.033641
Lax-Wendroff: 0.378218 | error 0.010338

Status: Stable Courant range. Numerical steps used: 60.

Example Data Table

Sample nodes compare the initial field, exact transport, and three common finite difference estimates.

x Initial Exact Upwind Lax-Friedrichs Lax-Wendroff
0.0000 0.000285 0.000000 0.000006 0.003964 0.000010
1.5000 0.600373 0.002745 0.011283 0.094787 0.001335
3.0000 0.129923 0.921610 0.803105 0.530335 0.935988
4.5000 0.000003 0.031778 0.072595 0.197247 0.036481
6.0000 0.000000 0.000000 0.000013 0.004822 0.000001

Formula Used

Linear advection equation: ut + c ux = 0

Exact transported solution: u(x,t) = f(x - ct)

Grid spacing: Δx = L / (N - 1)

Courant number: λ = c Δt / Δx

Upwind scheme: un+1i = uni - λ(uni - uni-1) for positive c

Lax-Friedrichs: un+1i = 0.5(uni+1 + uni-1) - 0.5λ(uni+1 - uni-1)

Lax-Wendroff: second-order transport update using centered slope and curvature correction.

The exact solution shifts the initial profile without changing shape. Numerical schemes approximate that transport and may introduce diffusion or oscillation.

How to Use This Calculator

  1. Choose an initial profile such as Gaussian, sine, square, or triangle.
  2. Enter the position, time, advection velocity, and shape parameters.
  3. Set domain length, grid points, and time step.
  4. Enable periodic wrapping if your domain behaves cyclically.
  5. Press Solve Equation to show the result above the form.
  6. Review exact and numerical values, then inspect errors and stability.
  7. Download CSV for raw values or PDF for a clean report.

Frequently Asked Questions

1. What does this solver compute?

It evaluates the linear advection equation at a chosen position and time. It also compares the exact transported profile against upwind, Lax-Friedrichs, and Lax-Wendroff numerical approximations.

2. Why is the exact solution just a shift?

For constant velocity advection, the initial shape moves rigidly along characteristics. The profile value at x and t equals the initial value located at x minus ct.

3. What is the Courant number?

The Courant number is cΔt/Δx. It measures how far information moves during one time step relative to grid spacing. Many advection schemes are reliable only when its magnitude stays at or below one.

4. Which method is usually most accurate?

Lax-Wendroff often gives sharper results for smooth profiles, while upwind is more diffusive but robust. The best choice depends on profile shape, grid resolution, and stability limits.

5. Why do square pulses look smeared?

Numerical diffusion smooths steep fronts, especially with first-order schemes like upwind and Lax-Friedrichs. Finer grids and smaller time steps can reduce smearing but will not remove it completely.

6. When should I use periodic boundaries?

Use periodic boundaries when your domain wraps around, such as a repeating ring or cyclic interval. A transported feature exiting one side re-enters on the opposite side.

7. What do CSV and PDF exports include?

The CSV export includes key metrics and sample solution rows. The PDF export creates a print-ready report of the page, including results, formulas, instructions, and the example table.

Related Calculators

divergence theorem calculatorhessian matrix calculatorpotential function solverstream function calculatortransport equation solvervibration equation solver

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.