This simulator visualizes the superposition of electric fields created by infinite line charges (perpendicular to the screen) that you draw on a grid. For line charges with strengths $q_i$ at positions $\mathbf{r}_i$, the field at $\mathbf{x}$ in this 2D cross-section is $$ \mathbf{E}(\mathbf{x}) = \frac{1}{2\pi\varepsilon}\sum_i q_i\,\frac{\mathbf{x}-\mathbf{r}_i}{\lVert \mathbf{x}-\mathbf{r}_i\rVert^2}. $$ The force on a test charge $q_\mathrm{test}$ at $\mathbf{x}$ is $\mathbf{F} = q_\mathrm{test}\,\mathbf{E}(\mathbf{x})$. A vertical stack of drawn cells approximates an infinite charged wall. The top and bottom edges are wrapped (periodic boundary), so the field computation wraps vertically across the top and bottom.
Draw positive (red) or negative (blue) charges on the grid. Drag the yellow test charge. Arrows show $\mathbf{E}$; the orange arrow shows the force on the test charge.
Notes
- The simulator uses a softening length to avoid numerical singularities at a charge location.
- Permittivity $\varepsilon$ and a distance scaling factor let you explore relative effects on $\mathbf{E}$ and $\mathbf{F}$.
- The display uses an arctangent mapping to keep arrow lengths readable over a wide dynamic range.