solve_heat_3d
Solve the 3D heat equation on a unit cube with explicit FTCS and constant Dirichlet boundaries, returning downsampled arrays and saving the full grid to .npz.
Instructions
Solve u_t = alpha*(u_xx + u_yy + u_zz) on the unit cube with explicit FTCS.
``nx``, ``ny``, ``nz`` are the number of intervals per axis (dx = 1/nx,
...) and ``nt`` the number of time steps. ``initial`` is an expression in
x, y and z; all six faces use the constant Dirichlet value ``boundary``.
The scheme requires r = alpha*dt/min(dx,dy,dz)^2 <= 1/6; larger values are
rejected as unstable. Grids above 500,000 cells are rejected. The full
(t, z, y, x) grid is saved to .npz; returned arrays are downsampled to at
most 20 points per dimension and 20 time points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nt | Yes | ||
| nx | Yes | ||
| ny | Yes | ||
| nz | Yes | ||
| alpha | Yes | ||
| t_end | Yes | ||
| initial | Yes | ||
| boundary | No |