A9 · Lesson 53 · Project
Compute a cable's capacitance from Laplace's equation
A coaxial cable's datasheet lists its capacitance per meter: about 100 pF/m for the common RG-58. For a round coax there's a formula, but for a square trace inside a shield, a pair of wires over a ground plane, or a connector, there isn't, and engineers use field solvers: programs that solve Laplace's equation on a grid and then read off the capacitance. In this project you'll write one, test it against the coax formula, and see how the grid's coarseness limits its accuracy.
Predict
A field solver approximates the round inner conductor by the grid squares inside it. Will it overestimate or underestimate the capacitance?
Underestimate. Keeping only grid points inside the radius makes the inner conductor a little smaller than it should be, and a thinner inner conductor has less capacitance. On a coarse grid the error is a few percent; refining the grid shrinks it.
Name it
The plan
- Set up the geometry. On an grid, mark the inner conductor (points with , held at 1 V) and the outer conductor (points with , held at 0 V). Everything in between is free.
- Relax. Repeatedly replace every free point with the average of its four neighbors until nothing changes (lesson 46).
- Measure the capacitance. The stored energy per unit length is , and . With = 1 V,
where the sum runs over all neighboring pairs of grid points. In two dimensions the grid spacing cancels: and each cell has area .
The exact answer for round coax
By Gauss's law, the field between the conductors is , which integrates to
Your solver should match the potential closely and the capacitance to within a few percent on a modest grid.
Worked example
Estimate RG-58's capacitance: = 0.45 mm, = 1.47 mm, polyethylene with = 2.25.
Show the solution
- Capacitance per meter.
- Compare with datasheets. Datasheets give about 100 pF/m; the real dielectric and conductor dimensions differ slightly from these round numbers.
Answer about 106 pF/m.
Worked example
How do you know the relaxation has converged?
Show the solution
- Run it longer. See whether the answer changes.
- An example. On an 81 × 81 grid with = 8 and = 24 cells, 5000 sweeps and 10 000 sweeps give the same capacitance to six digits.
- What's left. What remains is discretization error from the staircase boundaries, which only a finer grid reduces.
Answer it has converged when running more sweeps no longer changes the answer; the error that remains comes from the grid and needs a finer one.
Check
Step 1. Write coax(N, a, b, iters): an grid centered on the middle, 1 V where (in grid cells), 0 V where , relaxed iters times by four-neighbor averaging on the free points only. Return the grid.
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 capacitance(V) returning the capacitance per meter, over all neighboring pairs, for a 1 V solution. coax is included.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. A coax cable has inner radius 0.45 mm, outer radius 1.47 mm and dielectric = 1.5. What is its capacitance per meter, from the exact formula?
Write units the way you normally would: 1.5 pF/m and 0.0015 nF/m are the same answer.
Explain why
Why does the energy method give capacitance from the potential alone?
A capacitor at voltage stores energy , and that energy lives in the electric field, with density . Since , adding up over the space between the conductors gives the total energy, and dividing by gives . The relaxation supplies at every grid point, so the gradient, and therefore the capacitance, follow directly. It's also forgiving: small errors in change the energy only to second order.
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.