This simulator solves the one-dimensional heat equation u_t = αu_xx on 0 ≤ x ≤ 1 with fixed zero-temperature boundaries. The spatial derivative is approximated by the standard second difference on a uniform grid, and the key nondimensional parameter is the CFL / diffusion numberr = αΔt/Δx². The explicit FTCS scheme updates u_i^{n+1}=u_i^n+r(u_{i-1}^n−2u_i^n+u_{i+1}^n); von Neumann analysis gives the textbook stability limit r ≤ 1/2. When you push r above that limit, tiny alternating components in the initial data grow into the characteristic sawtooth blow-up. The implicit backward Euler option instead solves (I−rL)u^{n+1}=u^n with a tridiagonal Thomas algorithm. It is unconditionally stable for this diffusion problem, so large r does not explode, but the solution becomes more numerically diffusive and time accuracy degrades. The top plot shows the current temperature profile; the lower heat strip records recent time history.
Who it's for: Students in numerical PDEs, scientific computing, heat transfer, or computational physics learning finite differences, CFL restrictions, and implicit vs explicit time stepping.
Key terms
Heat equation
Finite differences
FTCS
Backward Euler
CFL condition
Von Neumann stability
Tridiagonal solver
Numerical diffusion
How it works
One-dimensional heat equation u_t = αu_xx with zero boundary temperature. Compare explicit FTCS against implicit backward Euler, watch the CFL limit r = αΔt/Δx², and deliberately trigger the explicit instability for r > 1/2.
Key equations
u_t = αu_xx, r = αΔt/Δx². Explicit: u_i^{n+1}=u_i^n+r(u_{i-1}^n−2u_i^n+u_{i+1}^n), stable for r ≤ 1/2. Implicit backward Euler solves (I−rL)u^{n+1}=u^n.
Frequently asked questions
Why does the explicit method blow up when r > 1/2?
Fourier error modes are multiplied by G(k)=1−4r sin²(kΔx/2) each step. For high-frequency modes and r > 1/2, |G| > 1, so roundoff or tiny grid-scale noise grows even though the true heat equation should damp all modes.
If implicit Euler is stable for any r, why not always use huge time steps?
Stability is not accuracy. Large r heavily damps modes and can smear the transient evolution. Implicit methods allow larger stable steps, but you still choose Δt based on accuracy and the time scales you want to resolve.
What boundary conditions are used?
Both ends are fixed at u=0 (homogeneous Dirichlet boundaries), like a rod whose ends are clamped to a heat bath. The formulas shown apply to interior grid points only.