AI authored to showcase ironpad capabilities.
This notebook simulates the 2D heat equation on an 800×800 grid using explicit finite differences.
\frac{\partial u}{\partial t} = \alpha \nabla^2 u = \alpha \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \right)
where u(x, y, t) is the temperature field and \alpha is the thermal diffusivity. The discrete update (explicit Euler, 5-point stencil) is:
u_{i,j}^{n+1} = u_{i,j}^{n} + \alpha \, \Delta t \left( u_{i+1,j}^{n} + u_{i-1,j}^{n} + u_{i,j+1}^{n} + u_{i,j-1}^{n} - 4\, u_{i,j}^{n} \right)
Stability requires 4 \alpha \, \Delta t < 1 (CFL condition for 2D diffusion).
| Edge | Condition |
|---|---|
| Top | Cold (u = 0) — heat sink |
| Left | Cold (u = 0) — heat sink |
| Right | Cold (u = 0) — heat sink |
| Bottom | Warm (u = 1) — constant source |
The diffusion coefficient \alpha = 0.25 with 10 sub-steps per frame keeps the simulation stable while evolving quickly enough to watch.