Upwind finite difference scheme (source code)

= Upwind finite difference scheme

For constant-speed advection $u_t+a u_x=0$ with $a>0$, the explicit upwind scheme uses $U_j^{n+1}=(1-\nu)U_j^n+\nu U_{j-1}^n$, $\nu=ak/h$. For $a<0$ the neighbour must be on the other side. When $0\leq\nu\leq1$, the update is a convex combination and is contractive in the maximum <norm> on a periodic grid, or with appropriate controlled inflow data.

On a periodic grid, <Von Neumann stability analysis> gives $G=1-\nu+\nu e^{-i\theta}$ and $|G|^2=1-2\nu(1-\nu)(1-\cos\theta)$, proving the same exact contraction range in the discrete <L2 norm>. Boundary estimates are still required on a finite interval; stable scalar <eigenvalues> of a triangular boundary update alone need not give a mesh-uniform bound.