Where does the current flow? Variational principles, step by step
This page turns the slide deck "Wodurch fließt der Strom?" into an interactive studio. It answers the question first with a live solver. Then it introduces variational principles with three small experiments and derives the Euler–Lagrange equation. Finally it replays every step of the slides: the formula as on the slide, the corrected or completed version, an explanation, and a small lab. Corrections are marked. Background on voltage and U = R·I: Chapter 1. Maxwell's equations: Chapter 2.
A conducting plate, an electrode, and a live solver
Take a thin metal plate, 1 m × 1 m, with sheet conductance σs = 1 S. Put a square electrode at 1 V (0.5–0.7 m, as on slide 11) and ground all four edges. Where does the current flow, and where is heat produced? The solver below relaxes the potential live, one sweep after another. Paint your own electrodes, holes and poorly conducting regions. The right picture shows the potential as a stretched rubber membrane, which is no coincidence (section 2).
Nature often picks the "cheapest" possibility
A function takes a number and returns a number. A functional takes a whole function (a path, a shape, a potential distribution) and returns one number: a length, a travel time, an energy, a power. Many laws of physics can be written as "the real function is the one that makes a functional stationary", and usually that means minimal:
| Principle | Functional | What you get from it |
|---|---|---|
| Fermat | travel time of light | refraction (Snell's law), reflection |
| Hamilton (least action) | ∫(kinetic − potential energy) dt | Newton's laws, all of mechanics |
| Soap film, membrane | area, or stretching energy ∫|∇u|² | Laplace's equation Δu = 0 |
| Dirichlet / minimum dissipation | Joule power P = ∫σ|∇φ|² dV | DC current flow ∇·(σ∇φ) = 0, i.e. Kirchhoff + Ohm |
| Thomson (circuits) | Σ RkIk² with Kirchhoff's current law as a constraint | Kirchhoff's loop rule |
Three small experiments. Each time, play by hand first, then let "nature" (a minimization) decide.
a) Two resistors in parallel
1 A must flow through two parallel resistors. How does it split? Choose the split yourself and watch the heat P.
At the minimum of , with I₁ + I₂ = I fixed (current law), we have : equal voltages. That is the loop rule. Kirchhoff's two laws are "a constraint plus a minimum".
b) Fermat: light refracts
Light goes from A in air to B in water, where it is slower. Drag the point where the ray crosses the surface. The inset shows the travel time.
The fastest path is not the straight line. It bends so that , which is Snell's law, derived from "minimum time".
c) An elastic string
A string between two fixed ends. Drag its points or scramble it. Then relax it: each sweep moves every point to the average of its neighbours.
"Average of the neighbours" is the discrete form of y″ = 0, the Euler–Lagrange equation of . The energy can only go down. In 2D the same rule is eq. (17) of the slides.
How to find the function that minimizes a functional
1. The problem. Find y(x) with fixed end values that makes the functional smallest:
2. Wiggle the solution. Add any variation η that vanishes at the ends, scaled by a number ε:
3. Ordinary calculus. J(ε) is now a normal function of the number ε, with its minimum at ε = 0:
4. Integrate by parts to move the derivative from η′ onto ∂L/∂y′. The boundary term vanishes because η(a) = η(b) = 0:
5. It must hold for every η. Then the bracket itself must be zero (fundamental lemma of the calculus of variations):
6. Free ends. If y(b) is not prescribed, η(b) can be anything and the boundary term must vanish by itself. That gives the natural boundary condition .
7. Several variables (Euler–Ostrogradsky). The same steps, with the divergence theorem in place of integration by parts:
For this gives in the plate and on insulated edges: the complete physics of section 1.
The ε-test, live
A resistive rod from x = 0 (1 V) to x = 1 (0 V): . Pick a variation η and slide ε. If y* is the minimizer, J(ε) is a parabola with a horizontal tangent at ε = 0, whichever η you choose.
Minimum, not just stationary. For a quadratic functional like this one, . The cross term vanishes because of the Euler–Lagrange equation. So the solution is the unique global minimum, and the same holds for the plate's power.
Every formula of the slides, checked, corrected and explained
Click a step, or use ← and → while this section is on screen. ✓ correct = the slide is right and gets more context. ⚠ corrected = there is an error. ✎ note = right, but a condition or a remark is missing. + added = a missing step. Red marks the mistake, yellow marks the fix.
Variational Derivation of Steady Current Flow and Finite Difference Solvers
Step through the derivation from least Joule heat dissipation and the Euler Lagrange equation to Laplace and Poisson PDEs, paired with an interactive Jacobi, Gauss Seidel, and SOR relaxation solver and downloadable Python script.
From the stencil to a solution: Jacobi, Gauss–Seidel and SOR in a race
Replace derivatives by differences (slide 10) and every grid node gets the equation "my value is the average of my four neighbours". There are 1600 such equations for a 40 × 40 grid. All three methods below apply eq. (17) over and over. Jacobi computes every node from the old values. Gauss–Seidel uses each new value immediately. SOR (successive over-relaxation) overshoots each Gauss–Seidel step by a factor ω. The best value is about ω ≈ 2/(1 + sin(π/N)).
All three end up with the same picture, but the cost differs enormously. In practice you use SOR, conjugate gradients, multigrid or a sparse direct solver (scipy.sparse.linalg.spsolve), which handles a 101 × 101 grid in milliseconds. Every one of them solves the same minimization problem.
The slide example as a script you can run
This script reproduces both plots from slide 11 and adds what was missing: the physical grid spacing h in the gradient, current lines, a logarithmic power scale, the total current, the resistance, and the check P = U·I. It needs numpy and matplotlib.
Output (verified): Jacobi iterations: 11435, I = 4.3532 A, R = 0.2297 ohm, P = 4.3532 W = U·I, peak power density on this grid: 77.2 W/m^2.
What to fix on the slides
| Slide | On the slide | Correction | Why |
|---|---|---|---|
| 3, title | "Kirchhoffische Regel" | "Kirchhoffsche Regeln" | spelling; there are two rules (node rule = eq. 1, loop rule = eq. 3) |
| 3, eq. (2) | J⃗ = I⃗ / A | I = ∬ J·dA, and |J| = I/A only for uniform J ⊥ A | current is a scalar; the vector is the current density |
| 3, eq. (6) | ∇²φ = 0 | add "for constant σ"; in general ∇·(σ∇φ) = 0 | ∇·(σ∇φ) = ∇σ·∇φ + σ∇²φ |
| 4, eq. (7) | "Lagrange Funktion" P = ∫σ(∇φ)²dV | P is the functional (total power); the Lagrangian is the integrand σ|∇φ|². State: P → min with φ fixed on the electrodes | without the principle and the boundary conditions the minimization has no meaning |
| 5, eq. (8) | σ left out | "for constant σ" | only a constant factor can be dropped |
| 7, eq. (10) | 2∂φ/∂x₁ · ∂/∂x₁ and 2∂φ/∂x₂ · ∂/∂x₁ | ∂/∂x₁(2∂φ/∂x₁) = 2∂²φ/∂x₁², and ∂/∂x₂(2∂φ/∂x₂) = 2∂²φ/∂x₂² | the operator must act on the term, and the second line needs x₂ |
| 7 → 8 | steps 1, 2, 3, 5 | add step 4: the Euler–Ostrogradsky equation | the equation that everything gets inserted into is missing |
| 8, eq. (11) | ∂/∂x₁ · 2∂φ/∂x₁ | ∂/∂x₁(2∂φ/∂x₁) | brackets make the operator's scope clear |
| 9 | "Mögliche Lösungen" | "Feldgleichung" (field equation) plus boundary conditions | Δφ = 0 alone has infinitely many solutions |
| 9 | x₁, x₂ → x, y | keep one notation | consistency |
| 10, eq. (16) | ¼(…) | add "for Δx = Δy" | otherwise the weights differ |
| 11 (b) | peak 0.162 W/m² | state σ and h; the corner peak is grid-dependent; add P = U·I | field singularity at sharp corners, gradient scaling |
| 12 | AI "potential" image | mark it as decoration | a harmonic potential has no ripples or dips (maximum principle) |
Questions and answers
Why does the real current distribution produce the least heat?
Write any other admissible potential as φ* + η, with η = 0 on the electrodes. Then . Integrating the middle term by parts gives −2∫η∇·(σ∇φ*) dV plus boundary terms. It vanishes because ∇·(σ∇φ*) = 0 inside, η = 0 on the electrodes, and σ∂φ*/∂n = 0 on insulated edges. What remains is P[φ*] plus something positive. A second, equivalent form (Thomson's theorem): for a given total current, the curl-free current distribution is the one with the least heat.
Is it a minimum or just a stationary point?
A true minimum, and a unique one. P is a sum of squares (convex), so there is exactly one stationary point and it is the global minimum. In mechanics, Hamilton's action is often only stationary, so "least action" is a slight misnomer there.
Why does the current crowd at the corners of the electrode?
Seen from the plate, a convex corner of the electrode is a re-entrant 270° corner. There the potential behaves like r2/3, so the field grows like r−1/3, which is infinite in theory. In practice this means hot spots, which is why copper pours and electrodes get rounded corners.
Does this still hold for AC?
Yes, as long as the plate is much smaller than the wavelength and much thinner than the skin depth (quasi-static). At higher frequencies Faraday's law gives ∇×E ≠ 0, so a scalar potential is no longer enough and magnetic energy enters the variational principle (inductance, skin effect).
Why is the iteration so slow, and how do you speed it up?
Each Jacobi sweep only passes information to the next neighbour, so it takes about N² sweeps to cross the grid. SOR cuts this to about N, multigrid to a few dozen sweeps for any N, and sparse direct solvers solve the system in one go. See section 5.
Where does this matter in practice?
IR drop and hot spots in PCB power planes, heating films and defrosters, electrode design in electrochemistry, sheet-resistance measurement (van der Pauw), laser trimming of thick-film resistors, ESD current paths, and electrical impedance tomography in medicine.