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 |
|---|---|
|
$1.0$ A·m² |
|
$10^{-3}$ m |
|
$2 \times 10^{-3}$ m |
|
|
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:
node_no_earth—earth_field_world_t = (0, 0, 0).node_with_earth—earth_field_world_t = +B_earth.node_neg_earth—earth_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_tfrom the node’s output. (Seetest_grad_wrt_amplitudein 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.