1D Heat Equation Solver
Animated finite-difference solution of the diffusion equation ∂u/∂t = α·∂²u/∂x²
Parameters
Controls
Calculated Values
Examples
Gaussian hotspot
Initial concentrated heat at center diffuses outward.
- Grid:
Step function
Sharp temperature discontinuity smooths out.
- Grid:
Visualization
Solving the Heat Equation Numerically
The 1D heat equation ∂u/∂t = α·∂²u/∂x² describes how temperature u evolves in time due to thermal diffusion. α is the thermal diffusivity of the material.
The FTCS (Forward Time, Central Space) scheme discretizes the PDE: u_i^{n+1} = u_i^n + C(u_{i+1}^n − 2u_i^n + u_{i-1}^n) where C = αΔt/Δx².
Stability requires C ≤ 0.5 (von Neumann condition). If C > 0.5, numerical oscillations appear and amplify. The animation shows the temperature profile smoothly diffusing from hot to cold regions.
Boundary conditions: u(0,t) = u(L,t) = 0 (Dirichlet). The initial heat pulse spreads until the rod reaches uniform temperature.
The same algorithm models neutron diffusion, pollutant dispersion, and financial option pricing (Black-Scholes).
Key Concepts
- FTCS: explicit, first-order in time, second-order in space
- CFL condition: C = αΔt/Δx² ≤ 0.5 for stability
- Dirichlet BCs: fixed temperature at boundaries
- Gaussian, step, and sine initial conditions
- Conservation of thermal energy (area under curve decreases to 0)
Real-World Applications
- Heat flow in a metal rod
- Ground temperature penetration
- Chemical diffusion in fluids
- Neutron diffusion in nuclear reactors
Explore Further
- All Computational Physics Calculators
Browse every computational physics solver in this category.
- Statistical & Numerical Methods
Probability and ensemble ideas behind stochastic simulation.
- Statistics in Physics
Why averaging random samples recovers physical expectations.
- Bisection Method
Step in Numerical Methods.
- Newton-Raphson
Step in Numerical Methods.
- ODE Solver
Step in Numerical Methods.
- Monte Carlo Intro
Step in Numerical Methods.
- Physics Constants Reference
SI values for c, G, k_B, ε₀, and more used across solvers.
More computational physics tools
- Gradient Descent
Iteratively minimize f(x) by following the negative gradient with animated path visualization.
- 1D Wave Equation
Leapfrog finite-difference solution to the wave equation with animated wave propagation.
- Numerical Integration
Trapezoidal and Simpson rules to approximate definite integrals with error vs exact solutions.
- ODE Solver
Euler and Runge-Kutta 4 methods for first-order ODEs with comparison to analytic solutions.
- Monte Carlo Intro
Estimate π and integrals by random sampling — introduction to stochastic computational physics.
- Newton-Raphson
Solve nonlinear equations f(x) = 0 with tangent-line iterations — fast when the guess is good.
Physics Equations
Step-by-Step Solution
See how the main results are calculated.
Step 1: The heat equation
Diffusivity α = 0.01 m²/s on a rod of length L = 1 m with an initial half-sine and ends held at u = 0.
Equation:
Step 2: Explicit (FTCS) scheme
Equation:
Explanation:
Forward difference in time, central difference in space, with r = α·Δt/Δx².
Step 3: Stability condition
Calculation:
Result:
Explanation:
The explicit FTCS scheme requires r ≤ ½, otherwise the solution oscillates and diverges.
Step 4: Result after t = 0.2 s
Calculation:
Result:
Frequently Asked Questions (FAQ)
What does instability look like?
Oscillations that grow with time — reduce Δt or increase Δx to satisfy CFL ≤ 0.5.
What is thermal diffusivity α?
α = k/(ρc_p) where k is thermal conductivity, ρ density, and c_p specific heat capacity.
How is this different from the wave equation?
Heat is diffusive (smooths out), waves are hyperbolic (propagate). Heat dissipates energy; waves conserve it.
Practice MCQs
- FTCS stands for:
- CFL condition for heat equation requires:
- The heat equation is a ___ PDE:
- Increasing α makes diffusion:
- Steady-state solution (t → ∞) with u=0 BCs:
- Von Neumann stability for FTCS yields condition:
- If the CFL number exceeds 0.5, the solution will:
- The heat equation is classified as parabolic because:
- Doubling the number of grid points requires Δt to:
- The FTCS scheme is ___ in time and ___ in space:
Related Calculators
These tools connect to the same physics concepts used in this calculator.