Numerical Stability

The explicit scheme is wonderfully simple — but it has a trap. Take the time step too large and the computed solution does not merely lose accuracy; it explodes, swinging to wild oscillations that double every step. A method is stable only if errors stay bounded as it marches forward.

The stability condition

Von Neumann's test asks how the scheme treats a single Fourier mode u_i^n = G^n e^{i k x_i}. Substituting into the update gives an amplification factor

G = 1 - 4r\sin^2\!\Big(\frac{k\,\Delta x}{2}\Big).

Stability needs |G| \le 1 for every mode. The danger is the highest frequency, where \sin^2 = 1 and G = 1 - 4r. Requiring |1 - 4r| \le 1 gives the famous bound

\boxed{\,r = \frac{\alpha\,\Delta t}{\Delta x^2} \le \tfrac12.\,}

Cross r = \tfrac12 and the highest mode has |G| > 1: it grows by a factor each step, flipping sign as it goes, and swamps the true solution. This is a conditional stability — and an expensive one, since halving \Delta x forces \Delta t down by a factor of four.

Push it past one-half

The explicit scheme run on the initial profile \sin x (which should simply decay). The bold curve is the numerical solution after a fixed time; the faint curve is the exact answer e^{-t}\sin x. Keep the mesh ratio r \le \tfrac12 and they agree; nudge r past 0.5 and the numerical curve erupts into a saw-toothed blow-up while the true solution sits quietly near zero.