Whittaker's History (1910), reviewed › The review's files › sim/whittaker/partC/

w7_weber_magnetism.py

In the investigation at sim/whittaker/partC/w7_weber_magnetism.py · last changed in commit 28bc522, 22 November 2026 · 4,498 bytes


#!/usr/bin/env python3
"""W7.7: Weber's molecular currents (1852), the Ewing-Gallop pair of magnets
(1890-97) and Curie's laws (1895).

Whittaker 1910, pp. 237-238 (Gallop's example): two magnetic molecules of
moment m fixed at distance c apart, pointing along the line joining them.
  - A field H at right angles turns them; they become perpendicular to the
    line when H = 3 m/c^3, and stay so (saturation).
  - A field along the line, opposed to their direction, leaves them stable
    only while H < m/c^3; beyond it they turn over, and stay turned when H
    is removed (residual magnetism).
This script minimises the energy of the pair numerically to check both
thresholds and to draw the hysteresis.                                 [D]

Terms: m the moment of each molecular magnet (Weber's permanent molecular
current); c their separation; H the applied field; phi_1, phi_2 the angles
of the two moments from the line joining them. Gaussian form: dipole energy
(m^2/c^3)[m1.m2 - 3 (m1.x)(m2.x)], Zeeman energy -m.H.

Run: OMP_NUM_THREADS=1 ~/aspden-review-venv/bin/python3 w7_weber_magnetism.py
"""
import subprocess
import numpy as np
from scipy.optimize import minimize

print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], cwd="/home/doug/aetherscience.org",
                                  capture_output=True, text=True).stdout.strip())

m, cdist = 1.0, 1.0
unit = m / cdist**3

def energy(ph, H):
    p1, p2 = ph
    m1 = np.array([np.cos(p1), np.sin(p1)])
    m2 = np.array([np.cos(p2), np.sin(p2)])
    dip = (m**2 / cdist**3) * (m1 @ m2 - 3 * m1[0] * m2[0])
    return dip - m * (m1 @ H) - m * (m2 @ H)

def relax(ph0, H):
    best = None
    for start in (ph0, ph0 + 0.05, ph0 - 0.05):
        r = minimize(energy, start, args=(H,), method="BFGS")
        if best is None or r.fun < best.fun:
            best = r
    return best.x

print("\n1. Field at right angles to the line (y direction): magnetisation M_y/(2m) against H [D]")
ph = np.array([0.0, 0.0])
for Hy in [0.5, 1.0, 2.0, 2.9, 3.0, 3.5, 5.0]:
    ph = relax(ph, np.array([0.0, Hy * unit]))
    My = (np.sin(ph[0]) + np.sin(ph[1])) / 2
    print(f"   H = {Hy:.1f} m/c^3: M_y/2m = {My:.4f}  (Whittaker: linear at first, saturation at H = 3 m/c^3)")

print("\n2. Field along the line, opposed to the moments: when do they turn over? [D]")
# Stability of the aligned state (phi1 = phi2 = 0) under a field -H along the line:
# the energy's Hessian there has eigenvalues 3 m^2/c^3 - m H (both turning the same
# way) and m^2/c^3 - m H (turning in opposite senses, a scissor). The scissor mode
# goes unstable first, at H = m/c^3. Check the Hessian numerically, then relax
# from a slightly scissored start to see the turn-over and the remanence.
def hessian(ph, H, h=1e-5):
    Hm = np.zeros((2, 2))
    for i in range(2):
        for j in range(2):
            def E(di, dj):
                q = ph.copy(); q[i] += di; q[j] += dj
                return energy(q, H)
            Hm[i, j] = (E(h, h) - E(h, -h) - E(-h, h) + E(-h, -h)) / (4 * h * h)
    return np.linalg.eigvalsh(Hm)

for Hx in (0.5, 0.9, 1.0, 1.1, 2.0, 3.0):
    ev = hessian(np.array([0.0, 0.0]), np.array([-Hx * unit, 0.0]))
    print(f"   H = {Hx:.1f} m/c^3 opposed: Hessian eigenvalues {ev[0]:+.3f}, {ev[1]:+.3f}  "
          f"(analytic: {1-Hx:+.3f} scissor, {3-Hx:+.3f} together)")
ph = np.array([0.02, -0.02])       # a slight scissor
flipped_at = None
for Hx in np.arange(0.0, 2.01, 0.05):
    ph = relax(ph, np.array([-Hx * unit, 0.0]))
    Mx = (np.cos(ph[0]) + np.cos(ph[1])) / 2
    if flipped_at is None and Mx < 0:
        flipped_at = Hx
    if abs(ph[0] - ph[1]) < 1e-6:   # keep a seed of asymmetry so the scissor mode can grow
        ph = ph + np.array([0.02, -0.02])
print(f"   relaxed from a slight scissor: turned over at H = {flipped_at:.2f} m/c^3  (Whittaker: m/c^3)")
# residual magnetism: remove the field
ph = relax(ph, np.array([0.0, 0.0]))
print(f"   field removed: M_x/2m = {(np.cos(ph[0]) + np.cos(ph[1]))/2:+.3f}  (stays reversed: residual magnetism)")

print("\n3. Curie's laws (1895; Whittaker's footnote prints 1845, a misprint) [S]")
print("   Paramagnetic chi = C/T (Langevin 1905 derives it from Weber's oriented moments);")
print("   diamagnetic chi independent of T (Langevin 1905, from Weber's induced molecular")
print("   currents, Larmor's theorem). Both survive; the ferromagnetic case needed Weiss's")
print("   molecular field (1907) and quantum exchange, beyond the Ewing pairs. From memory.")