An interactive browser-based visualizer for the heat equation in 1D and 2D, using finite differences (explicit Euler method).
Live demo: https://heat-eq.vercel.app
THERMA solves the heat equation:
-
1D:
$\frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2}$ -
2D:
$\frac{\partial u}{\partial t} = \alpha \nabla^2 u$
using an explicit finite difference scheme with automatic stability control (CFL condition).
- Interactive drawing: Click and drag on the plot to draw custom initial temperature profiles
- 8 presets: Sine wave, Gaussian, step function, triangle, two humps, random, square wave, sawtooth
- Adjustable parameters: Thermal diffusivity, spatial resolution, segment length, simulation speed, brush size
- Boundary conditions: Dirichlet (fixed temperature) and Neumann (insulated/zero flux)
- Real-time visualization: Color-coded temperature profile with space-time heatmap
- Heat brush: Click and drag on the 2D surface to paint heat. Hold to accumulate. Right-click to cool.
- 6 presets: Center hotspot, four corners, ring, cross, random spots, diagonal
- Adjustable parameters: Thermal diffusivity, grid resolution (N x N), domain size, brush radius, brush temperature, simulation speed
- Boundary conditions: Dirichlet (fixed temperature at edges) and Neumann (insulated/zero flux)
- Real-time heatmap: Color-coded 2D temperature field with bilinear interpolation
- Open
index.html(1D) orindex2d.html(2D) in a web browser - In 1D: draw an initial condition or select a preset; in 2D: paint heat with the brush
- Adjust physics parameters (diffusivity, resolution, domain size)
- Set boundary conditions (Dirichlet or Neumann)
- Click Play to run the simulation, or Step to advance manually
- Use the toggle button in the header to switch between 1D and 2D modes
| File | Description |
|---|---|
index.html |
1D Heat Equation Visualizer (default) |
index2d.html |
2D Heat Equation Visualizer |
No dependencies, no build step -- just open in a browser.
Bhaskar Krishnamachari, University of Southern California (USC)
This project is licensed under the PolyForm Noncommercial License 1.0.0.