Learning Objectives
By the end of this section, you will be able to:
- Explain why the electric potential satisfies Laplace's equation in every charge-free region.
- Translate physical statements (“this metal is at V”, “infinity is grounded”) into the right Dirichlet boundary conditions.
- Interpret the mean-value property as the physical intuition of electrostatic equilibrium, and Earnshaw's theorem as its consequence.
- Solve a 2D Laplace problem numerically by Jacobi relaxation in plain Python and as a single 3×3 convolution in PyTorch.
- Apply these ideas to capacitors, shielding, conductors near point charges, and image charges.
Why this matters. Laplace's equation is not an exotic PDE you meet once in a textbook and forget — it is the equation a capacitor satisfies, the equation an electron microscope's focusing column satisfies, the equation a grounded shield satisfies, and (because the discrete update is a tiny convolution) the equation deep learning hardware is already optimised to solve.
The Big Picture
Imagine you stretch a soap film across a wire loop that is bent into the shape of two metal plates held at different heights. The film will droop and bulge until it reaches a state of perfect tension equilibrium: no part of the film can be pulled higher or lower without doing work against the rest of the film. That equilibrium shape is a harmonic function. It satisfies .
Electrostatics in a charge-free region is the same story with electrons instead of soap. The wire loop becomes a set of metal electrodes (the “boundary”). The height of the film becomes the electric potential . Tension equilibrium becomes Coulomb equilibrium. Everywhere away from real charges, is the smoothest function that matches the boundary. That is exactly Laplace's equation with Dirichlet conditions.
Three sentence intuition. Charges pin the potential at certain places. Empty space cannot create or destroy potential, so it can only average the values around it. The unique smooth in-between is the harmonic function we call .
From Coulomb to Laplace
What is the Electric Potential?
A single point charge creates the radial electric field . The electric potential at a point is the work per unit charge required to bring a tiny test charge from infinity to that point against this field. For a single point charge it is . Two facts make central:
- The field is its gradient. . So a potential map of a region implies the entire vector field.
- Potential is a scalar. Adding contributions from many charges is just adding numbers; vectors would need component-by-component bookkeeping. That is why physicists solve for first, then differentiate to get .
Deriving Laplace's Equation
Start with Gauss's law in differential form, , where is the local charge density. Substitute :
This is Poisson's equation. In any region of space with — the air between capacitor plates, the vacuum around a charged sphere, the dielectric inside a coaxial cable — it collapses to , Laplace's equation.
| Setting | PDE | What is happening physically |
|---|---|---|
| Region containing charges | ∇²V = -ρ/ε₀ (Poisson) | Charge density sources/sinks the potential. |
| Charge-free region | ∇²V = 0 (Laplace) | V is a harmonic function fixed only by boundary data. |
| On a conductor at rest | V = constant | Free charges have already moved to make E_tangential = 0. |
| At infinity (isolated system) | V → 0 | All field lines terminate; no work is needed to escape. |
Reading tip. The minus sign in is the convention that makes positive charges “push V up” like a Gaussian bump. Section 28.5 already explored Poisson directly; here we restrict ourselves to and exploit harmonicity.
Boundary Conditions in Electrostatics
Laplace's equation on its own has infinitely many solutions. What pins down a unique is the boundary data. In electrostatics the data come from three physical sources:
- Dirichlet (value). A metal electrode is an equipotential. Specifying which voltage you connected each conductor to gives on its surface.
- Neumann (normal derivative). A perfectly insulating wall with no surface charge enforces : no field lines cross it. More generally a surface charge density sets .
- Decay at infinity. For isolated systems we ask as .
Once you have written down (i) the region, (ii) the value of on every piece of its boundary, and (iii) the decay condition at infinity if relevant, the existence-and-uniqueness theorem for Laplace's equation says exactly one harmonic fits. That is what makes the problem well-posed and what makes numerical relaxation reliable.
The Harmonic-Function Intuition
Mean-Value Property — The Soul of Electrostatics
If is harmonic in a region, then at any point inside it,
the average of over any sphere centered at that lies entirely in the region. In one English sentence: a point's potential is the average of the potentials surrounding it. There can be no isolated bumps, no isolated dips. That is the physical meaning of charge-free equilibrium: in empty space, your potential is whatever your neighbours' potentials force you to be, on average.
The Discrete Mean-Value Property
Hover any interior cell. Its value equals the average of its four orthogonal neighbors — the very definition of a discrete harmonic function. This is what Laplace's equation looks like at finite resolution.
Earnshaw's Theorem
Because a harmonic function has no interior maxima or minima, an electrostatic potential cannot trap a charged particle in stable equilibrium using only electrostatic forces. Imagine a point of stable equilibrium for a positive test charge: it would have to sit at a local minimum of , surrounded by higher in every direction. The mean-value property forbids it. This is Earnshaw's theorem, and it is why ion traps, atom traps, and magnetic levitation all use time-varying or magnetic fields to escape the limitation.
Analogy: a flat lake. The height of a calm lake satisfies Laplace's equation locally. Push the lake down at the shoreline (a Dirichlet condition) and the surface bends smoothly; you can never produce a still hill in the middle without piling up water (a source). Same equation, same intuition.
Interactive 2D Laplace Solver
Click and drag on the canvas to paint electrodes at the chosen voltage. Press Start relax and watch the field smooth itself out under the discrete mean-value update. Toggle equipotentials and field arrows to see emerge from the gradient of the potential.
Interactive 2D Laplace Solver
Each interior pixel relaxes toward the average of its four neighbors. Watch the discrete mean-value property fill the box with the smoothest possible potential. Click and drag on the canvas to paint electrodes at the chosen voltage. The arrows are ; the thin curves are equipotentials.
Max change: 0.0000
Things to try:
- Paint a long horizontal bar at +100 V and another at -100 V below it. You have built a parallel-plate capacitor — the field arrows should run from + to - in vertical lines.
- Add a small grounded loop (V = 0) inside the capacitor. The arrows curve around it: this is electrostatic shielding and it is the working principle of a Faraday cage.
- Place two equal-and-opposite point electrodes (use the “dipole” preset). Look at the characteristic figure-eight equipotentials — the same picture you would draw by hand for two opposite point charges.
3D Potential Landscape
Plotting as a height map turns the abstract PDE into a tangible terrain. The electric field is then the direction a marble would roll down. The mean-value property says away from any charge, the terrain has no hills or pits — only saddles and smooth slopes.
3D Potential Landscape
The potential of two point charges plotted as a 3D height field. Where the surface is smooth and locally bowl-shaped or saddle-shaped (i.e. away from charges), it satisfies . The mean-value property says any interior point sits at the average height of a small circle around it — a harmonic surface has no bumps.
Watch what happens at the charge locations themselves: the surface spikes upward over a positive charge and plunges downward over a negative one. At those exact points Laplace's equation fails — Poisson takes over — because charge density is nonzero. Everywhere else, the surface is harmonic.
Numerical Walkthrough by Hand
Before we trust any solver, let us do one by hand. Take a 5×5 grid with the left column held at +100 V and the right column held at 0 V; top and bottom rows grounded too. There are unknown interior values. Each Jacobi sweep replaces every interior cell by the average of its four neighbours from the previous sweep.
Click to expand: full 5×5 by-hand relaxation
Iteration 0 (initial guess): set the interior to zero. Only the left/right plates and the grounded rails carry data.
[[100, 0, 0, 0, 0], [100, 0, 0, 0, 0], [100, 0, 0, 0, 0], [100, 0, 0, 0, 0], [100, 0, 0, 0, 0]]
Iteration 1. Compute, for every interior ,
Only cells adjacent to the +100 V plate see any non-zero neighbours, so only column 1 of the interior updates:
[[100, 0, 0, 0, 0], [100, 25, 0, 0, 0], [100, 25, 0, 0, 0], [100, 25, 0, 0, 0], [100, 0, 0, 0, 0]]
Iteration 2. Now the 25's ripple inward; the corners of column 1 average against the grounded rail too:
[[100, 0.00, 0.00, 0, 0], [100, 31.25, 6.25, 0, 0], [100, 37.50, 6.25, 0, 0], [100, 31.25, 6.25, 0, 0], [100, 0.00, 0.00, 0, 0]]
Iteration 3. Information has now reached column 3:
[[100, 0.00, 0.00, 0.00, 0], [100, 35.94, 9.38, 1.56, 0], [100, 42.19, 12.50, 1.56, 0], [100, 35.94, 9.38, 1.56, 0], [100, 0.00, 0.00, 0.00, 0]]
Keep iterating. After about 48 sweeps every cell has settled to within and you get the converged solution:
[[100, 0.000, 0.000, 0.000, 0], [100, 42.857, 18.750, 7.143, 0], [100, 52.679, 25.000, 9.821, 0], [100, 42.857, 18.750, 7.143, 0], [100, 0.000, 0.000, 0.000, 0]]
Sanity check — the mean-value property. At the center cell :
The middle of the grid genuinely is the four-neighbour average. That is the discrete fingerprint of : every interior cell satisfies it, exactly, at convergence.
Sanity check — symmetry. The problem is symmetric under reflection top-to-bottom and the solution must be too. Rows 1 and 3 are identical and row 2 is the special middle row — that is why the value at is the largest in column 1 (closest to the +100 V plate from the center).
Sanity check — physical sign. Voltages fall off as you move from the +100 V plate toward the 0 V plate, with the fastest drop near the grounded rails. That is exactly what your everyday intuition for a capacitor leaking energy out through grounded walls demands.
Solving Laplace in Plain Python
Here is the same problem in NumPy. The structure of the code mirrors the by-hand walkthrough above one for one, so use the collapsible section as a unit test against the printed output.
Two things to notice. First, every interior cell at convergence equals the average of its four neighbours — the discrete mean-value property, written in code. Second, convergence is slow: a 100×100 grid would need tens of thousands of sweeps. The same idea expressed as a single convolution is much faster on modern hardware.
Laplace as a Convolution in PyTorch
The 4-neighbour average is exactly what you get from convolving the grid with the 3×3 kernel
This is a beautiful and useful coincidence. A solver that takes one CPU pass per cell becomes a single GPU convolution per sweep — the same primitive that powers convolutional neural networks.
On a small 5×5 grid you will not see a speed difference, but the trick scales beautifully: for a 1024×1024 grid, one F.conv2d call replaces a million Python loop iterations. The PDE has not changed; only the runtime has.
The Method of Images
Sometimes you can solve Laplace's equation without solving it — by exploiting uniqueness. Consider a point charge sitting at distance above a large grounded conducting plane. We want in the upper half-space, where there are no other charges, with the boundary condition on the plane and at infinity.
Trick: imagine there is no conductor at all and instead place an image charge at distance below the plane. The combined potential from these two point charges,
is harmonic in the upper half-space (each term is harmonic away from its source) and is exactly zero on the symmetry plane by cancellation. By uniqueness, this is the answer in the upper half-space; the conductor below just happens to support the surface charge needed to maintain it.
The method of images is the closed-form cousin of the numerical solver above. The PDE is the same; the only difference is that here the boundary geometry is simple enough that the answer can be written as the superposition of a handful of potentials. For more general shapes you reach for the relaxation solver you just wrote.
Real-World Applications
| Device / phenomenon | Boundary data | What you solve |
|---|---|---|
| Parallel-plate capacitor | Two conductors at ±V₀, vacuum between | Laplace in the gap → linear V(x) → uniform E. |
| Coaxial cable | Inner conductor at +V, outer shield grounded | Laplace in the dielectric → V(r) ∝ ln(b/r) → 1/r field. |
| Faraday cage / shielded electronics | Cage at one fixed potential, charges outside | Inside the cage, Laplace forces V to be constant → E = 0 inside (shielding). |
| Electron microscope focusing column | Ring electrodes at specified voltages | Laplace gives the field map → electron trajectories from Newton + Lorentz. |
| MEMS / capacitive sensor | Moving conductor near a fixed plate | Re-solve Laplace each frame → capacitance vs. position. |
| Semiconductor device simulation | Doping & contacts as Dirichlet/Neumann data | Poisson in doped regions, Laplace in undoped regions, repeated. |
Modern twist. In computational physics, neural networks are now trained to approximate the Laplace operator itself — physics-informed networks (PINNs) and neural operators — and their loss function is literally on collocation points plus a boundary-data term. The 3×3 kernel you saw earlier is the same kernel a PINN learns from scratch.
Summary
- In every charge-free region the electric potential satisfies ; this follows from Gauss's law and .
- Conductors give Dirichlet data, perfect insulators give Neumann data, and isolated systems require at infinity. These together make the problem well-posed.
- The mean-value property is the physical heart of the equation: every potential is the average of the surrounding potentials. From this follows the maximum principle and Earnshaw's theorem.
- The discrete update is mean-value at finite resolution and is a 3×3 convolution kernel — the bridge between PDEs and modern tensor hardware.
- For symmetric geometries, the method of images gives closed-form answers; for general geometries, relaxation in NumPy or convolution in PyTorch gives reliable numerical ones.
One sentence to remember. Empty space cannot create potential; it can only average the potential of its neighbours. That single statement, repeated at every interior point, is Laplace's equation in electrostatics.