To compute the induced voltage around a loop due to a changing magnetic flux in a linked loop, we need the double integral of [di dj r]/|r|3
where the infinitesimal vectors di compose one loop and dj’s the other. The vector between the points is r.
[p q r] = The triple product of vectors p, q and r = (p × q) · p = [q r p].
My code strongly suggests that this integral depends only on linkage. This is about the code.

The code yields 4π for the double integral which worked after the first clean compile. Its too good to be true—but it seems to be right. It gives near 0 when the curves are not linked!

This serves as a winding number, of sorts, for links!

Here are some integrals for different arrangements of the ellipses. The routine dcir(loop, c, r1, r2) computes points in 3D of an ellipse with center at c and one radius r1 and another r2. dcir can draw any ellipse in 3D.

  dcir(l1, (v){0,   0, 0}, (v){1, 0, 0}, (v){0, 1, 0});
  dcir(l2, (v){1,   0, 0}, (v){1, 0, 0}, (v){0, 0, 1});
s = -12.5663522, 4π =  12.5663706, rm=1.000000e+00

  dcir(l1, (v){0,   0, 0}, (v){1, 0, 0}, (v){0, 1, 0});
  dcir(l2, (v){1.9, 0, 0}, (v){1, 0, 0}, (v){0, 0, 1});
s = -12.5663522, 4π =  12.5663706, rm=1.000000e-01

  dcir(l1, (v){0,   0, 0}, (v){1, 0, 0}, (v){0, 1, 0});
  dcir(l2, (v){2.1, 0, 0}, (v){1, 0, 0}, (v){0, 0, 1});
s =  -0.0000000, 4π =  12.5663706, rm=1.000000e-01

  dcir(l1, (v){0,   0, 0}, (v){1,   0, 0}, (v){0, 1, 0.3});
  dcir(l2, (v){1,   0, 0}, (v){1.2, 0, 0}, (v){0, 0,   1});
s = -12.5663539, 4π =  12.5663706, rm=8.000000e-01

  dcir(l1, (v){0,   0, 0}, (v){0.8, 0, 0}, (v){0, 1, 0});
  dcir(l2, (v){0,   0, 0}, (v){1.2, 0, 0}, (v){0, 0, 1});
s =   0.0000000, 4π =  12.5663706, rm=4.000000e-01

  dcir(l1, (v){0,   0, 0}, (v){1, 0, 0}, (v){0, 1, 0});
  dcir(l2, (v){0,   0, 1}, (v){1, 0, 0}, (v){0, 1, 0});
s =   0.0000000, 4π =  12.5663706, rm=4.000000e-01

Another way of computing these integrals is to replace smooth curves with 3D polygons for this is a topological premise. We then face the task of evaluating the effect of one stick on another. The di × dj part is then constant and the integral is merely (I × J) · (Integral Integral r/|r|3) where I and J are the vectors that are the rods and r is the vector between points on the respective rods.
(I × J) · (Integral Integral r/|r|3) = [I J r0] (Integral Integral 1/|r|3)
where r0 is any vector from one rod to the other—it doesn’t matter which. [I J r0] is 3 times the volume of the convex hull of the two rods.

This explains 4π for the linked case, and 0 otherwise. same subject.


Some fiddling with this code indicates that self induction depends on geometry beyond topology. Small shape changes of the trefoil knot make big changes in the integral. Only similarity transforms seem leave the integral unchanged. This seems to refute a conjecture made by Stan Ulam before he had access to computers as powerful as my laptop.