B314 of 15
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

B3 · Lesson 14 · Potential and capacitance lab

Computing potentials and capacitance when there's no formula

Formulas exist for spheres, cylinders and infinite plates. A real electrode is a square pad, a trace, an odd-shaped housing, and its capacitance is an integral nobody can do by hand. Field solvers do it numerically, in two ways you'll write in this lab: relaxation, which makes every point of a grid the average of its neighbors until the potential settles, and the method of moments, which splits a conductor into small patches and solves for the charge on each. Along the way you'll add potentials, measure where a field's energy sits, and find the energy that disappears when two capacitors share charge.

  • A square box has its top held at 1 V and the other three sides at 0. The curve is the potential along a vertical line through the box, from the exact series solution.
  • Move the line across the box: the potential always rises from 0 at the bottom to near 1 at the top, fastest near the middle of the box.
  • The readout gives the potential halfway up. Through the center it's exactly 0.25, which you'll reproduce by relaxation in step 2.

Predict

A square metal box has its lid held at 100 V and its other three sides at 0 V, insulated from the lid. What is the potential at the center?

Name it

Relaxation

In a charge-free region, the potential satisfies Laplace's equation, and on a grid that means each point is the average of its four neighbors. Start with any guess, hold the conductors at their voltages, and replace every interior point by its neighbors' average, over and over (Jacobi iteration). The error shrinks by a fixed factor each sweep, close to 1 for fine grids: for a grid 32 cells across, cos⁡π32=0.9952, so 477 sweeps per factor of ten.

The method of moments

Split a conductor's surface into N small patches with unknown charges Qj. The potential at patch i is ∑jPijQj, where Pij=14πε0rij for distant patches and, for a square patch of side s acting on its own center, Pii=ln⁡(1+2)πε0s. Setting every patch to 1 V gives a linear system P𝐐=𝟏, and the capacitance is the total charge, C=∑Qj.

Convergence and extrapolation

Charge crowds toward edges and corners, where uniform patches describe it poorly, so the error falls only about as 1N with N patches along a side. If CN≈C−aN, two solutions combine to cancel the leading error: C≈2C2N−CN (Richardson extrapolation).

Energy checks

The field of a charged sphere of radius R stores kQ22R in total, and the fraction within radius r is 1−Rr: half of it lies within 2R. When a charged capacitor is joined to an uncharged one, charge is conserved but energy isn't: a fraction C2C1+C2 of it is lost in the connection, whatever the resistance.

Worked example

Using superposition, what is the potential at the center of a square box with its top at 100 V and its left side at 40 V, the other two sides grounded?

Show the solution
  1. One side at a time. Each side held at V alone contributes V4 at the center.
  2. Add the two sides. 1004+404=35V That's the same superposition that solves the predict question, applied with two different voltages.
  3. Test a solver. A relaxation solver with both sides set gives 35 V at the center to within its convergence tolerance, which is a quick test for one you've just written.

Answer the center sits at 35 V.

Worked example

A flat square plate 1 m on a side has a capacitance of about 40.8 pF. How does that compare with a disk and a sphere of the same surface area?

Show the solution
  1. Disk. A disk of area 1 m² has radius 0.564 m, and an isolated disk has C=8ε0r=40.0pF
  2. Sphere. A sphere of area 1 m² has radius 0.282 m, and C=4πε0r=31.4pF
  3. Flat shapes against the sphere. The flat shapes hold about 30% more charge per volt than the sphere with the same area, because their charge can spread farther apart.
  4. Square against disk. The square edges out the disk slightly by reaching its corners farther from the center.

Answer the square's 40.8 pF is a little more than the disk's 40.0 pF and about 30% more than the sphere's 31.4 pF.

Worked example

A 10 µF capacitor at 12 V is connected to an uncharged 10 µF capacitor. What happens to the charge and the energy?

Show the solution
  1. Charge is conserved. 120 µC spreads over 20 µF, so both end at 6 V.
  2. Energy before. W1=12×10μF×144=0.72mJ
  3. Energy after. W2=12×20μF×36=0.36mJ
  4. Where it went. Half the energy is gone, turned into heat in the wires (and a little radiation).
  5. The resistance doesn't matter. The amount doesn't depend on the wires' resistance: less resistance makes a larger current for a shorter time, with the same loss.
  6. Switched-capacitor circuits. They pay this loss on every transfer, which is why they move charge in small steps.

Answer both capacitors end at 6 V, sharing the 120 µC, and the energy falls from 0.72 mJ to 0.36 mJ: half is lost as heat.

Check

Step 1. Write potential(q, src, pts) that returns the potential at each point in pts (an M × 3 array) from point charges q (length N) at positions src (N × 3), using k = 8.988 × 10⁹.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 2. Write relax(n, V_top, sweeps) that solves for the potential in a square box with n × n interior points (plus a boundary row on each side), the top row held at V_top and the other sides at 0, by Jacobi iteration with NumPy slices. Return the whole (n + 2) × (n + 2) array.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 3. Write plate_C(a, N) for a flat square plate of side a split into N × N patches: build the matrix P (point-charge terms off the diagonal, ln⁡(1+2)πε0s on it), solve P𝐐=𝟏, and return the capacitance. Then write plate_C_extrapolated(a, N) returning 2C2N−CN. Use ε₀ = 8.854 × 10⁻¹².

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 4. Write energy_within(Q, R, r_out, n) that integrates the field energy density 12ε0E2 of a charged sphere (charge Q, radius R) over spherical shells from R out to r_out, using n steps evenly spaced in ln r with the midpoint rule.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 5. Write share(C1, V1, C2, V2) for two capacitors joined plate to plate: return the common final voltage and the energy lost.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

A 1 µF capacitor at 12 V is joined to an uncharged 2 µF capacitor.

(a)

What voltage do they share?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

(b)

What percentage of the energy is lost?

Check

Jacobi iteration on a grid n = 32 cells across shrinks the error by about cos⁡πn per sweep. How many sweeps reduce it by a factor of ten?

Explain why

Why does the energy lost when two capacitors share charge not depend on the resistance of the wire joining them?

Practice

Keep practicing

4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.