MIME-VER-112 — Earth-Field Superposition Exactness#

Date: 2026-04-30 Node under test: mime.nodes.actuation.permanent_magnet.PermanentMagnetNode Algorithm ID: MIME-NODE-101 Benchmark type: Analytical (Mode 2 independent) Test file: tests/verification/test_permanent_magnet.py::test_ver112_earth_field_superposition Acceptance: \(\mathbf{B}_{\text{total, with earth}} - \mathbf{B}_{\text{total, no earth}} \equiv \mathbf{B}_{\text{earth}}\) (atol \(10^{-12}\)); \(\mathbf{B}_{\text{total}}(+\mathbf{B}_{\text{earth}}) - \mathbf{B}_{\text{total}}(-\mathbf{B}_{\text{earth}}) \equiv 2\mathbf{B}_{\text{earth}}\) (atol \(10^{-12}\)).


Goal#

Verify that the node’s Earth-field background superposes exactly onto the magnet’s field — no scaling, no rotation, no leakage into the \(\nabla\mathbf{B}\) output (the Earth field is uniform, so its gradient is zero).

In hardware-bench experiments, the static Earth field (\(\sim 50\,\mu\text{T}\)) is comparable in magnitude to a small distant permanent magnet’s stray field at the experimental working distance, and the response of a magnetised UMR depends on the vector sum of the two. This benchmark guarantees that sum is computed correctly.

Configuration#

Parameter

Value

dipole_moment_a_m2

\(1.0\) A·m²

magnet_radius_m

\(10^{-3}\) m

magnet_length_m

\(2 \times 10^{-3}\) m

field_model

point_dipole

Magnet pose

identity quaternion at origin

Target

\((0, 0, 10\,R_{\text{magnet}})\)

Test Earth field

\(\mathbf{B}_{\text{earth}} = (2 \times 10^{-5}, 1 \times 10^{-5}, -4.5 \times 10^{-5})\) T (asymmetric — all three components nonzero)

JAX precision

x64

Method#

Three node instances are constructed, identical in every parameter except the Earth field:

  1. node_no_earthearth_field_world_t = (0, 0, 0).

  2. node_with_earthearth_field_world_t = +B_earth.

  3. node_neg_earthearth_field_world_t = -B_earth.

Each evaluates field_vector at the same target. The differences are checked element-wise against the analytical expectation:

\[ \mathbf{B}_{\text{pos}} - \mathbf{B}_{\text{no}} = \mathbf{B}_{\text{earth}}, \]
\[ \mathbf{B}_{\text{pos}} - \mathbf{B}_{\text{neg}} = 2\mathbf{B}_{\text{earth}}. \]

Both checks use absolute tolerance \(10^{-12}\) T (a few orders of magnitude tighter than the float64 floor for these magnitudes).

Results#

Both checks pass to absolute tolerance \(10^{-12}\) T. The Earth field adds linearly without scaling or rotation; the magnet contribution is unchanged when the Earth field is flipped.

Verdict: PASS#

The node’s Earth-field treatment is an exact additive superposition. Two corollaries:

  • A consumer can recover the magnet-only field by subtracting the configured earth_field_world_t from the node’s output. (See test_grad_wrt_amplitude in the same test file for an example.)

  • The amplitude scale acts on the magnet contribution only — it does not multiply the Earth field. This is the documented behaviour in _b_total_world.