= Solution
Write $h=\Delta x$, $k=\Delta t$, and assume $a,u$ are sufficiently <smooth> for the following <Taylor expansions>. The <symmetric half-grid diffusion consistency> calculation gives
$$
L_hu=\frac{a(x-h/2)[u(x-h)-u(x)]+a(x+h/2)[u(x+h)-u(x)]}{h^2}=(au_x)_x+h^2E_2+O(h^4),
$$
where
$$
E_2=\frac{a u_{xxxx}}{12}+\frac{a'u_{xxx}}6+\frac{a''u_{xx}}8+\frac{a'''u_x}{24}.
$$
The <normalized local truncation error> of the full update is consequently
$$
\mathcal T_{h,k}=\frac{u(x,t+k)-u(x,t)}k-L_hu=u_t-(au_x)_x+\frac{k}{2}u_{tt}-h^2E_2+O(k^2+h^4).
$$
\b[The PDF prints an <advection equation>, $u_t=a(x)u_x$, whereas this stencil approximates conservative diffusion, $u_t=(au_x)_x$.] For the literal printed equation the leading defect is $(a-a')u_x-a u_{xx}$, which generally does not vanish: the method is \b[inconsistent, with an $O(1)$ normalized defect].
For the intended <variable-coefficient conservative diffusion equation>, the first two terms cancel and $\mathcal T_{h,k}=O(k+h^2)$. Under the parabolic step scaling $k=O(h^2)$, this is \b[$O(h^2)$], while the unnormalized one-step <local truncation error> is $k\mathcal T_{h,k}=O(h^4)$. These two orders use different normalizations. With <numerical stability> and compatible smooth initial and <boundary conditions>, the intended diffusion problem has global error $O(k+h^2)$ on a fixed time interval. Positivity and boundedness of $a$ alone do not justify the displayed <Taylor expansion>; coefficient regularity is also needed for that error formula.
Back to article page