EM Sandbox 2D:
Finite Difference Poisson Solver
EM Sandbox 2D:
Finite Difference Poisson Solver
1. Interactive demo of parallel plate capacitor with moving dielectric slab
2. Snapshot of the web application
EM Sandbox 2D is an interactive environment for exploring electrostatic potential distributions of a parallel plate capacitor in 2D. The project addresses the classical problem of finding steady-state scalar potential fields in heterogeneous media with prescribed boundary conditions. To solve this, the continuous domain is discretized on a uniform grid and the potential is computed using an iterative relaxation method: values at each grid point are updated repeatedly using weighted averages of neighboring cells that account for local dielectric contrasts. This Gauss-Seidel successive over-relaxation (SOR) converges robustly for typical configurations and is implemented in-place for memory efficiency. The solver supports fixed-potential boundaries and simple Neumann-like side treatments, while the application overlays a real-time visualization and controls for modifying geometries and material properties. The combination of a straightforward finite-difference discretization, an in-place iterative solver, and multiple relaxation steps per animation frame provides a responsive tool for teaching, rapid prototyping, and qualitative investigation of electrostatic phenomena in complex dielectric layouts.
An interactive playground is available here: em2d.mdshahriar.com. All the codes are available in GitHub.