Solve the diffusion equation with a stable Crank-Nicolson update. Adjust diffusivity, domain length, grid count, initial condition, and boundary condition while the curve evolves.
The curve represents temperature, concentration, or another scalar quantity diffusing along a one-dimensional domain. Higher diffusivity flattens the curve faster, while the boundary condition controls whether material escapes or remains trapped.
$$\frac{\partial u}{\partial t}=D\frac{\partial^2u}{\partial x^2}$$The Fourier number summarizes how far diffusion has progressed relative to the domain length. Use the animation for physical intuition and the energy chart to confirm that the distribution is smoothing over time.
The same equation appears in heat conduction, dopant diffusion, concentration smoothing, and random-walk models. Treat the result as a one-dimensional idealization: convection, reactions, nonlinear material properties, and multidimensional geometry require a richer model.
Heat diffusion in steel rod: D=1.2e-5 m²/s (thermal diffusivity), L=0.5 m, Ngrid=200, Gaussian IC (sigma=0.05 m, peak=100 K). After t=10 s with Neumann BC: peak drops to 62 K, energy ratio E/E0≈0.38. Crank-Nicolson ensures stability for Fourier number Fo=D*t/L²≈0.48, avoiding oscillations from explicit FTCS schemes. Spatial discretization: dx=0.0025 m, temporal: dt=0.05 s.