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

A9 · Lesson 48 · Lab: Poisson's equation

Potentials from charge, by integration and relaxation

Lesson 47 solved Poisson's equation by hand where symmetry made it one-dimensional. In this lab you'll solve it numerically: integrate a junction's charge twice to get its built-in voltage, relax a two-dimensional grid with a charge inside, see how much over-relaxation speeds convergence, and build potentials by adding up the contributions of small pieces of charge, a ring and a ball, checking each against its formula.

  • The curve is the potential of a uniformly charged ball of radius R, in units where kQR0=1 for a reference radius.
  • Outside, it's kQr, as if all the charge were at the center. Inside, it's a downward parabola, reaching 32 of the surface value at the center.
  • Shrink the ball: the same charge packed tighter raises the center potential, as 3kQ2R says.

Predict

Jacobi relaxation on a 20 × 20 grid takes 369 sweeps to converge. About how many does successive over-relaxation (SOR) with the best factor take?

Name it

One dimension: integrate twice

V′′=−ρ/ε can be integrated directly: the field is E(x)=1ε∫ρdx from a point where E=0, and V(x)=−∫Edx. Cumulative sums (np.cumsum with the trapezoid rule) do both steps on a grid.

Two dimensions: relaxation

On a grid with spacing h, ∇2V=−ρ/ε becomes

Vij=14(Vi+1,j+Vi−1,j+Vi,j+1+Vi,j−1)+h24ρijε
  • Jacobi recomputes every point from the previous sweep's values. Vectorized with NumPy slices, each sweep is fast, but it needs about n2 sweeps.
  • Gauss–Seidel uses each new value as soon as it's computed.
  • SOR moves each point ω times as far as Gauss–Seidel would, with 1<ω<2; the best ω for a square grid is 21+sin⁡(π/n).

Superposition

V(𝐫)=∑kΔq|𝐫−𝐫′| over small pieces of charge. It needs no grid or boundary, just a sum, and it's exact in the limit of small pieces.

Worked example

A ring of radius R carries charge Q. What is the potential on its axis?

Show the solution
  1. Same distance from every piece. Every piece of the ring is the same distance R2+z2 from a point on the axis, so the sum is simply V=kQR2+z2
  2. Put in numbers. For 1 nC on a ring of radius 5 cm, at 12 cm along the axis: V=8.9880.13=69.1V
  3. Compare with a numerical sum. A numerical sum over the ring's pieces gives the same, since every term is equal. Off the axis the distances vary and the sum needs a computer.

Answer V=kQR2+z2, which is 69.1 V for 1 nC on a 5 cm ring at 12 cm.

Worked example

What does the grid equation give for ∇2V=−1 on the unit square with V=0 on the edges?

Show the solution
  1. Relax the grid. Relaxing a 40 × 40 grid until it stops changing gives a dome with its peak at the center, V=0.0736.
  2. Compare with the exact value. The exact value for the continuous problem is 0.073 671, so the grid is within 0.1%.
  3. Interpret. This is the shape of a uniformly loaded square membrane, and of the potential in a uniformly charged square region inside a grounded box.

Answer a dome peaking at V=0.0736 in the center.

Check

A ring of radius 3 cm carries 1 nC. What is the potential on its axis, 12 cm from its center?

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

Check

What is the best SOR factor for a 50 × 50 grid?

Check

A 1D junction has ρ/ε=−1 on −1<x<0 and +r on 0<x<1/r (r = 3), zero elsewhere. On a grid of 20 001 points from −1.5 to 1.5, integrate twice (trapezoid cumulative sums, E=0 and V=0 at the left end, E=∫ρ/ε, V=−∫E), and set Vbi to V at the right end.

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

Check

Solve ∇2V=−1 on the unit square with V=0 on the edges, using vectorized Jacobi on a 41 × 41 grid of points (spacing 1/40) until the largest change in a sweep is below 10−9. Set Vc to the center value.

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

Check

On a 21 × 21 grid with V=1 on the top edge and 0 on the others, count the Gauss–Seidel sweeps (ω=1) and the SOR sweeps (ω=21+sin⁡(π/20)) needed until the largest change in a sweep is below 10−6. Set it_gs and it_sor, and Vc to SOR's center value.

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

Check

Build the potential on the axis of a ring (radius 5 cm, 1 nC) by summing kΔq|𝐫−𝐫′| over 1000 pieces, at z = 12 cm. Set V and formula.

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

Check

Find the potential at the center of a uniformly charged ball (Q = 1 nC, R = 10 cm) by adding thin shells: a shell of radius r and charge dq contributes kdqr at the center. Use 10 000 midpoint shells and set Vc and formula (3kQ2R).

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

Explain why

Why does relaxation on a fine grid converge so slowly, and why does over-relaxation help?

Practice

Keep practicing

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