physica
The whole physica family in one dependency, plus the equations its domains share.
Seven crates cover Earth's gravity field, satellite gravimetry, gravitational waves, frontier gravity proposals, fusion plasma, magnetism and the constants behind them. They are published separately so a project can take only what it needs; this crate re-exports all of them and adds the one thing none of them can hold alone — the identities that join them, each written as a test.
Install
Every crate is re-exported under its own name, so physica::magnetics::main_field::wmm2025() and
magnetics::main_field::wmm2025() are the same function.
Example: three fields of the Earth through one interface
Gravity, the main magnetic field and the gravitomagnetic field of Earth's spin are all potential fields, so one trait evaluates all three.
use ;
use GravitomagneticDipole;
use wmm2025;
let mut gravity = zeros;
gravity.set;
gravity.set;
let magnetism = wmm2025.at;
let spin = GravitomagneticDipole ;
let fields: = ;
let r = 6_371_200.0 + 450e3;
let values: = fields.iter.map.collect;
assert!; // m/s²
assert!; // nT
assert!; // m/s², and far smaller
Example: the same equation in two domains
use ;
use spinning_shell_field;
// Inside a spinning charged shell the magnetic field is (2/3)(μ₀/4π)Qω/R; inside a spinning
// massive shell, frames are dragged at 4GMω/(3c²R). Swap μ₀/4π for G/c² and charge for mass, and
// gravity is exactly twice as strong — because the graviton has spin 2.
let = ;
let analogue = spinning_shell_field * / ;
let frame_dragging = 4.0 * G * m * omega / ;
assert!;
What is inside
| Re-export | What it covers |
|---|---|
metrology |
The physical constants every crate shares |
geopotential |
Earth's gravity field from spherical harmonics, the .gfc reader, the shared Field trait |
gravimetry |
Gravity missions and quantum sensors, GRACE processing, earthquake gravity, local forward models, atmospheric waves |
gravitational |
Gravitational waves from nanohertz to terahertz: detectors, inspirals, ringdown and remnants, energy, propagation, gravitons, backgrounds, lensing and cosmological distances |
gravitics |
Frontier gravity computed against general relativity and experiment, light in strong gravity, the Schwinger limit, gravity's anomalies, gravitoelectromagnetism |
magnetics |
Earth's magnetic field, magnetohydrodynamics, magnets, space weather |
plasmoid |
Fusion reactivities and Lawson, pinches, plasmoids, aneutronic power, tokamak limits |
analogies |
The cross-domain identities, as doc tests |
The analogies
Each is an exact identity a test asserts, not a loose resemblance.
| Analogy | The shared equation |
|---|---|
| One spherical-harmonic engine | gravity V with GM, R, C̄ ↔ the magnetic field with a², a, g/√(2n+1) |
| Spinning dipoles | both are twice as strong at the pole as at the equator |
| The spin-2 factor | frame dragging inside a spinning shell is exactly 2× its electromagnetic analogue |
| One charge-to-mass constant | √(4πε₀G) behind the extremal black hole, the weak-gravity scale, and the drift at which two protons' magnetism matches their gravity — whose product with the proton ratio is exactly c |
| Pinch and filament | Bennett's μ₀I²/4π ↔ Ostriker's Gλ² |
| Schwinger and Unruh | pair-creation suppression e^(−πE_S/E) is a Boltzmann factor at the Unruh temperature |
| Gravity's vacuum constants | 1/(4πG) and 4πG/c² give 1/√(εμ) = c |
| One plasma, three crates | the plasma frequency and Alfvén speed written in gravitational, magnetics and plasmoid agree: exactly, and to the 2.7×10⁻⁴ the electrons' mass makes |
| Poisson's relation | a magnetised body's anomaly is its gravity gradient: gravimetry's sphere and magnetics' sphere agree to 10⁻¹⁴, and a magnetic survey's pseudo-gravity from geopotential::planar is the gravity survey to 0.17% |
Applications
Taking the whole family at once suits work that crosses domains: evaluating Earth's gravity and magnetic fields along one orbit, checking a frontier proposal against both the relativity and the plasma physics it invokes, or teaching where one equation reappears under another name. For a single domain, depend on that crate alone.
How it is checked
Every analogy above is a doc test, so cargo test asserts each identity to 10⁻¹² or its stated
tolerance. The examples/ directory evaluates three fields of the Earth through one trait and
reproduces NOAA's published WMM2025 value at 100 km altitude. gravity_patent rebuilds the rig
of US 12,417,870 (a ball on a thread between high-voltage coils, claimed to move by a
gravitational field) and simulates it: the field of its coils and leads, every force and torque
on the ball from five crates (charge, polarisation, gas, magnetism, the field's own gravity, and
the claim's own model with its constants), integrated at 1 ms. It is a calibration case for the
physics, so it lives in the examples, not the library. A 3D model of the same rig, computed
with the same equations, is in the repository's
web/ directory.
One of eight crates in physica:
physica (all of them, plus cross-domain analogies) ·
metrology (constants) ·
geopotential (the gravity field) ·
gravimetry (missions and GRACE) ·
gravitational (waves) ·
gravitics (frontier gravity) ·
magnetics (magnetism and MHD) ·
plasmoid (fusion plasma).