Error-function diffusion front (source code)

= Error-function diffusion front
{title2=$u(x,t)=\tfrac12\operatorname{erfc}(x/(2\sqrt{Dt}))$}

Consider the one-dimensional <diffusion equation> on the whole <real line>,
$$
\frac{\partial u}{\partial t}=D\frac{\partial^2u}{\partial x^2},\qquad D>0,
$$
with initial value one for $x<0$ and zero for $x>0$. This is an idealized <Heaviside step function> profile, not a measured material or an apparatus specification. The <heat kernel> gives a <convolution> with the initial profile:
$$
u(x,t)=\int_{-\infty}^{0}\frac{e^{-(x-y)^2/(4Dt)}}{\sqrt{4\pi Dt}}\,dy
=\frac12\operatorname{erfc}\!\left(\frac{x}{2\sqrt{Dt}}\right),\qquad t>0.
$$
The <change of variables> $s=(x-y)/(2\sqrt{Dt})$ turns the <convolution> into a <Gaussian integral> tail. The resulting <similarity variable> $\eta=x/(2\sqrt{Dt})$ shows that the transition width grows like $\sqrt{Dt}$: multiplying elapsed time by four doubles every fixed-profile distance from the original interface.

\Image[/error-function-diffusion-step-profiles.png]
{title=<Diffusion> smooths a step while preserving its similarity profile}
{description=Exact model curves for a unit jump with stipulated $D=1$ in consistent length and time units. Left: the transition broadens at $t=0.04$, $0.25$, and $1$. Right: plotting each against $x/(2\sqrt{Dt})$ collapses all three onto the same curve. No experimental measurements are plotted.}

At every positive time, $u(0,t)=1/2$, while $u(x,t)\to1$ as $x\to-\infty$ and $u(x,t)\to0$ as $x\to+\infty$. For every fixed $x\ne0$, the limit as $t\to0^+$ returns the specified initial value. The value assigned at the single initial discontinuity does not change this <convolution>. The <error function> therefore explains smoothing without pretending that a discontinuous initial profile remains sharp.

Direct <differentiation> checks the <partial differential equation>. Writing $\eta=x/(2\sqrt{Dt})$ gives
$$
u_t=\frac{\eta e^{-\eta^2}}{2\sqrt\pi\,t},\qquad
D u_{xx}=\frac{\eta e^{-\eta^2}}{2\sqrt\pi\,t}.
$$
The model assumes constant <diffusion coefficient>, no <advection>, and no finite-domain boundary effects. For an interpretation as <heat conduction>, the <heat equation> applies to a normalized <temperature> difference under its own material assumptions.