2-D Laplace Equation Solver
Compute a steady two-dimensional Laplace field on a square with a fixed unit value along the top edge and zero along the other boundaries. The interior is relaxed with Gauss–Seidel iteration until the tolerance or iteration limit is reached.
How this tool works
The five-point Laplacian sets each interior node to the average of its four nearest neighbors: uᵢⱼ=(uᵢ₋₁ⱼ+uᵢ₊₁ⱼ+uᵢⱼ₋₁+uᵢⱼ₊₁)/4 at convergence.
Example
With the top boundary held at 1 and the other sides at 0, the interior harmonic field smoothly transitions between those fixed values with no internal maxima or minima.
Common questions
Why use Gauss–Seidel rather than direct matrix inversion?
It makes the finite-difference iteration transparent and avoids building a large dense matrix. Production solvers often use sparse direct or multigrid methods for much larger meshes.
What does the tolerance measure?
The solver stops when the largest change to any interior node during an iteration falls below the selected tolerance.