1D Heat Equation

∂u/∂t = D ∇²u — click the rod to set temperature, watch diffusion

Diffusivity D: 0.10
Speed:
t = 0.000
Numerical (FD) Analytic (Gaussian)
Heat Equation: The diffusion equation ∂u/∂t = D∂²u/∂x² governs heat conduction, particle diffusion, and many transport phenomena. Solved numerically here using the explicit finite-difference scheme: u[i,t+1] = u[i,t] + D·dt/dx²·(u[i+1]-2u[i]+u[i-1]). Stability requires D·dt/dx² ≤ 0.5 (CFL condition). Analytic solution for a Gaussian initial condition u(x,0) = A·exp(-x²/2σ²) is u(x,t) = A·σ/√(σ²+2Dt)·exp(-x²/(2(σ²+2Dt))). Click the canvas to add heat to any point on the rod.