Solve the heat equation ∂T/∂t = α·∂²T/∂x² numerically. Watch temperature profiles evolve with Dirichlet/Neumann/periodic boundary conditions. See Fourier series convergence in real time.
The 1D heat equation is ∂T/∂t = α·∂²T/∂x². Explicit finite difference: T_i^(n+1) = T_i^n + r·(T_{i+1}^n − 2T_i^n + T_{i-1}^n) where r = α·dt/dx². Stability requires r ≤ 0.5. Analytical solution: T(x,t) = Σ aₙ·sin(nπx/L)·e^(−(nπ/L)²·α·t).
Dirichlet (fixed temperature): the bar ends are held at constant temperature — like a metal rod with its ends in ice water and boiling water. Neumann (insulated): no heat flux through the ends — temperature gradient is zero at boundaries. Periodic: the bar wraps around, as if it were a ring.
Any initial temperature distribution can be decomposed into sine modes T(x,0) = Σ aₙ·sin(nπx/L). Higher modes (larger n) decay exponentially faster: amplitude ~ e^(−n²t). This is why heat spreads and smooths out — fine-scale features disappear first, leaving only the slowest-decaying fundamental mode.