Separation of Variables
Uniqueness tells us a boundary-value problem has exactly one answer; it does not tell us how to find it. For boundaries that follow coordinate surfaces (the walls of a rectangular box, a cylinder, a sphere) there is a systematic analytic method: look for solutions that are products of functions of one coordinate each, find the family that fits the zero-potential walls, and add them up as a Fourier series to fit the remaining wall. The result is an exact series solution, and it is the benchmark every numerical field solver in this course is checked against.
The rectangular trough
A long metal trough, infinite in , has width and height . The bottom and sides are grounded; the lid at is held at , insulated from the walls by thin gaps. Inside there is no charge, so with
Separate. Try . Dividing Laplace's equation by gives . A function of alone equals minus a function of alone only if both are a constant, the separation constant:
Fit the homogeneous walls. has solutions and . keeps only ; requires , (the eigenvalues). Then with gives . Each product satisfies Laplace's equation and three of the four walls.
Fit the last wall with a Fourier series. Laplace's equation is linear, so any sum of these products is also a solution:
At this must equal for : a Fourier sine series of a constant (Fourier Series). Using orthogonality of the sines, , which is for odd and zero for even :
The same method solves the heat equation in a plate (Laplace's Equation, Boundary Value Problems).
How fast does it converge? The factor kills high harmonics quickly away from the lid; near the lid convergence is slow, and at the corners the boundary data jump from to , so the series shows the Gibbs overshoot there. Physically the corners are the gaps, where the field is very large.
Symmetry check: the centre of a square
For a square trough (), imagine four problems, each with a different wall at and the others grounded. Their sum has all four walls at , whose solution is everywhere. By symmetry all four give the same value at the centre, so each is . This is an exact check on any solution method.
Worked example
Given: a square trough, , lid at .
Find: the potential at the centre from the first two terms of the series.
Solve: at , :
Check: the symmetry argument gives exactly ; two terms are within . A point closer to the lid needs many more terms.
In Python: partial sums and the field map
import numpy as np
import matplotlib.pyplot as plt
def trough(x, y, a=1.0, b=1.0, V0=10.0, nmax=199):
n = np.arange(1, nmax + 1, 2)[:, None, None] # odd harmonics
x, y = np.broadcast_arrays(np.asarray(x, float), np.asarray(y, float))
# sinh ratio written with exponentials so large n does not overflow
ratio = (np.exp(n*np.pi*(y - b)/a) - np.exp(-n*np.pi*(y + b)/a)) / (1 - np.exp(-2*n*np.pi*b/a))
return np.sum(4*V0/(n*np.pi) * np.sin(n*np.pi*x/a) * ratio, axis=0)
print("terms V(0.5,0.5) V(0.5,0.75) V(0.5,0.95)")
for terms in [1, 2, 3, 10, 100]:
nmax = 2 * terms - 1
vals = [trough(0.5, y, nmax=nmax).item() for y in (0.5, 0.75, 0.95)]
print(f"{terms:5d} {vals[0]:10.4f} {vals[1]:11.4f} {vals[2]:11.4f}")
xs = np.linspace(0, 1, 81); ys = np.linspace(0, 1, 81)
X, Y = np.meshgrid(xs, ys)
V = trough(X, Y)
Ey, Ex = np.gradient(-V, ys, xs)
fig, ax = plt.subplots(figsize=(5, 4.6))
cs = ax.contour(X, Y, V, levels=[0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9], colors="tab:blue")
ax.clabel(cs, fmt="%.0f V", fontsize=8)
ax.streamplot(X, Y, Ex, Ey, color="tab:orange", density=0.8, linewidth=0.8)
ax.set_aspect("equal"); ax.set_xlabel("x / a"); ax.set_ylabel("y / a")
ax.set_title("Square trough, lid at 10 V: equipotentials and E")
plt.show()terms V(0.5,0.5) V(0.5,0.75) V(0.5,0.95)
1 2.5372 5.7638 10.8740
2 2.4990 5.3615 8.2247
3 2.5000 5.4117 9.3858
10 2.5000 5.4053 8.9831
100 2.5000 5.4053 8.9966
At the centre three terms are already exact to four digits; at the partial sums swing by tens of percent over the first three terms and are still off after ten. The equipotentials crowd into the top corners, where the field lines (orange) leave the lid's edges almost horizontally into the grounded walls.
Other coordinate systems
The same three steps work wherever the boundaries are coordinate surfaces; only the functions change. In cylindrical coordinates with no dependence, separation gives and , . A grounded conducting cylinder of radius placed across a uniform field needs only :
The surface field is twice the applied field at the front and back of the cylinder: the field-enhancement factor of a round conductor. A sphere in a uniform field gives a factor of 3 (separation in spherical coordinates, with Legendre polynomials). Such factors are why high-voltage conductors in a strong field are sized for their surface field rather than the average one.
Guided lab: conductive paper
Hand calculation. A square of conductive (resistive) paper with silver-paint or copper-tape electrodes along its edges is a 2-D analogue of the trough: the steady current obeys the same Laplace equation (Resistance of Conductors of Any Shape). Lid at , three edges at , small gaps at the corners: the centre should read and the point a quarter of the side below the lid .
Simulation. The series above, or the finite-difference solver of the next lessons.
What you would measure. Power the electrodes from a bench supply at with the current limit at and probe with a multimeter (COM on the grounded edge). Expect the centre within about of ; the paper's non-uniform sheet resistance and imperfect electrode contacts are the main errors. Mapping the equipotentials with the probe reproduces the contour plot.
Hazards and safe setup. Low voltage and current-limited. Silver paint is solvent-based: ventilate and let it dry before powering.
Pitfalls
- Wrong choice of functions. The oscillating functions () go along the direction with two zero walls; the growing/decaying ones (, ) across.
- Even harmonics. For a constant lid they are exactly zero; including them with nonzero coefficients means an integration error.
- Trusting the series near a discontinuity. At the lid corners, convergence is slow and oscillatory; quote values there with caution.
- Overflow. overflows for large ; use the ratio written with decaying exponentials, as in the code.
Practice
- For a trough with and lid at , estimate at with one term.
- Why must every term of the series vanish at and ?
- A grounded cylinder sits in a uniform field of . Find the largest surface field and charge density.
Answer
- .
- Those walls are at for all ; a sum vanishes there for every only if each does.
- at and ; .
Test yourself
In the trough with grounded walls at and , the allowed separation constants are…
- any real
For a square trough with the lid at and three grounded walls, the potential at the centre is…
Why does the series converge slowly near the lid's corners?
- the sinh terms grow
- the boundary data jump there (Gibbs behaviour)
- Laplace's equation fails at corners
- even harmonics are missing
A grounded conducting cylinder across a uniform field has a maximum surface field of…