PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Math Visualization

Other simulators in this category — or see all 72.

View category →
NewUniversity / research

Advection Schemes: Upwind / LW / MacCormack

Linear advection u_t + cu_x = 0 on a periodic grid: compare upwind diffusion, Lax-Wendroff and MacCormack dispersive ringing, exact pulse translation, L2 error, and CFL ν.

Launch Simulator
NewUniversity / research

Finite Element Poisson Solver (2D)

Triangular P1 finite elements for -Δu=f on a square: assemble stiffness matrices, pin Dirichlet nodes or add natural Neumann flux, solve by CG, and view potential as a colored membrane.

Launch Simulator
NewUniversity / research

Multigrid Relaxation

1D Poisson error dynamics: Jacobi and Gauss-Seidel smooth high-frequency error, while a V-cycle uses residual restriction and coarse-grid correction to remove low-frequency modes.

Launch Simulator
NewUniversity / research

Gaussian Process Regression

Interactive GP regression with RBF and Matérn kernels: tune length scale/noise, add observations by clicking, view posterior mean with uncertainty bands, and sample at max posterior variance.

Launch Simulator
NewUniversity / research

Rössler Attractor

RK4 integration of ẋ=−y−z, ẏ=x+ay, ż=b+z(x−c); period-doubling cascade as c grows.

Launch Simulator
NewSchool

L-Systems (Turtle)

Lindenmayer string rewriting + turtle: Koch, Sierpinski, Hilbert, Heighway dragon, plant.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/Heat Equation: Finite Differences

Heat Equation: Finite Differences

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 number r = αΔ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

Finite differences

0.42
2

FTCS uses u_i^{n+1}=u_i^n+r(u_{i-1}^n−2u_i^n+u_{i+1}^n) and blows up for r>1/2. Backward Euler solves a tridiagonal system and is unconditionally stable but more diffusive.

Shortcuts

  • •Space / Enter — run / pause
  • •P — pause / resume
  • •R — reset

Measured values

r0.42
Δt (α=1)4.20e-5
max |u|1.000
∫u² dx9.71e-2
Explicit CFLok

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.