Engine B (MultiComponentCluster.from_density_profiles) builds Plummer, EFF,
and King density components into ONE shared self-consistent potential (a
single cumulative-trapezoid Poisson pass — no ODE), inverts each component’s DF
by the generic eddington_invert in that shared (optionally
Osipkov-Merritt per component, ), and samples a true joint equilibrium
with no external virial rescale. It complements
Engine A (DF-defined lowered-isothermal/LIMEPY): A
starts from a DF family, B from prescribed densities — and the two engines must
agree where they overlap. Test file:
tests/validation/test_engine_b_physics.py (6 tests; plus the TestEngineB
unit suite in tests/unit/cluster/test_multicomponent.py); figures + PASS/FAIL
gate: scripts/validate_multicomponent_eddington.py.
What is verified¶
Each row maps to assertions in test_engine_b_physics.py; the Measured
column is the standalone validation-script run (2026-06-10, ALL PASS,
11/11; run twice at close-out with identical tables). The headline mix is a
Plummer halo ( pc, 60% of the mass) + EFF core ( pc,
pc, 40%).
Check | Measured | Gate |
|---|---|---|
King A-vs-B radial KS distance (, same seed) | 0.0002 | |
King A-vs-B max (interior bins) | 0.0003 | |
Plummer vs law (untruncated zero point) | ||
Plummer vs exact truncated closed form | ||
Headline theory (DF-weighted oracle) | ||
Headline sampled global (k, unscaled) | 0.4976 | |
Headline predicted hybrid | (the prediction) | |
Headline sampled (3 seeds 16k) | ; max vs pred | |
OM max (4 seeds 20k, 8 bins) | 0.0280 | |
DF-density fidelity (truncation-consistent, ) | (OM build) / (isotropic) | (test gate) |
Gradients AD-vs-FD: halo / mass-fraction / | / / | each |
The King A-vs-B anchor is the trust anchor: the same physical model (, pc) built by two independent engines — A’s lowered-isothermal DF + coupled Poisson ODE vs B’s prescribed King density + Poisson quadrature + Eddington inversion — agrees in the sampled radial CDF (KS 0.0002) and dispersion profile (max dev 0.0003). The exact-quadrature oracle alone is necessary, not sufficient ( holds for any positive in a consistent pair); the cross-engine and closed-form-DF anchors carry the inversion-correctness burden.
Figure¶

Figure 1:Engine B validation summary (scripts/validate_multicomponent_eddington.py,
ALL PASS). (a) King A-vs-B overlay: the two independent
engines coincide bin by bin (max dev 0.0003). (b) Plummer ergodic DF:
the inverter’s on the BT2008 law (log–log), with a
residual inset showing against the power law and
against the exact truncated closed form. (c) DF
fidelity: reconstructed from each component’s table
integrates back to the prescribed
(truncation-consistent form), halo and core. (d) Osipkov-Merritt: sampled
tracks for pc (max dev
0.028). (e) Per-component virial summary — theory oracle, predicted
hybrid expectation, and sampled (3 seeds ± sem): the sampled values
sit on the prediction, not on idealized 0.5 (see below).
Three physics findings of the arc¶
The oracle needs the untruncated zero point. With the truncated zero point the energies shift by and the power law picks up an deviation at even at . The law is tested with (untruncated), and the truncated case is covered by the exact closed form including the boundary term $f(E) = \big[20k(2b^3\sqrt{E} - 2b^2E^{3/2} + \tfrac{6}{5}bE^{5/2}
\tfrac{2}{7}E^{7/2}) + 5kc^4/\sqrt{E}\big]/(\sqrt{8},\pi^2)b = E+c8.86\times10^{-6}$). Zero-point physics is part of the oracle definition.
Not every density mix has an equilibrium — and the gate proves it. The plan’s drafted EFF core in the Plummer-halo shared potential has a genuinely negative Eddington DF (, resolution-independent; verified with the closed-form two-Plummer oracle, since EFF Plummer). The realizability gate refuses such builds, naming the component, its , and a remedy; a close-out sweep located the gate flip between (refused) and (realizable). The headline therefore uses . Realizability is physics, not a numerical nuisance.
The hybrid-sampling plateau is predicted physics, not bias. Engine B samples a hybrid: positions from the prescribed , speeds from . A hard-truncated component has — an edge offset no ergodic can carry (the Eddington pair represents ) — so the truncated halo’s sampled plateaus below 0.5. The exact-quadrature hybrid expectation predicts 0.4953; an 18-seed 16k campaign measured ( from the prediction — this is the headline figure the theory pages cite). The in-script PASS/FAIL table above runs a faster 3-seed 16k check ( for the halo, consistent with the 18-seed campaign within its larger SEM); both sit on the prediction, not on idealized 0.5. The gate is against the prediction, never a tuned offset.
Numerics bug found and fixed: the King staircase¶
jnp.gradient of the piecewise-linearly interpolated grid is a
staircase whose ringing the Eddington + Abel
weight focuses into : a single King component
read (the true King ergodic DF is strictly
positive). Fix: integrate King’s own Poisson identity
by cumulative trapezoid of the closed-form density — never differentiate
interpolated data in an Abel-type inversion. Re-measured at close-out:
.
Differentiability¶
The full Engine B build (build_engine_b_state) is differentiable: AD matches
central FD through the shared-potential pass + Eddington inversion in the halo
scale (), the mass fraction
(), and the per-component anisotropy radius
() — all far inside the 10-3 gate. One designed
exception: the King component’s internal subgraph (its 1-D profile solve and
the derive_r_t domain choice) is constant w.r.t. the differentiated
parameters — King outputs enter via the scale and the shared ; the
domain is a construction-time decision.
How to run¶
# physics tests (6 validation tests; the unit suite covers realizability + extraction pins)
pytest tests/validation/test_engine_b_physics.py -q
pytest tests/unit/cluster/test_multicomponent.py -q
# regenerate the 5-panel figure with the 11-row PASS/FAIL table
env -u VIRTUAL_ENV uv run --no-sync python scripts/validate_multicomponent_eddington.pyWhat this suite does not test¶
No N-body integration of the ICs — equilibrium is established by virial oracles, cross-engine agreement, and DF-moment checks on the initial conditions, not by evolving them and measuring stationarity.
The hard-truncation edge approximation is quantified, not eliminated — a hard-truncated prescribed density is only approximately stationary at the edge ( cannot be carried by any ergodic ); the sampled global- gate is 0.02 (not 0.002) for this reason, and the per-component sampled is gated on the hybrid prediction.
Speed-table acceleration (Phase 1.5-style) is deferred — Engine B’s quadrature sampling path is the oracle; tables get added only if profiling shows Engine B sampling matters at .
References¶
Eddington inversion and the Plummer DF: Binney & Tremaine (2008); the King model is King (1966), the EFF profile Elson et al. (1987). Engine A (the DF-defined family it cross-validates against) is documented at Multi-mass LIMEPY equilibrium (Engine A); the lowered-model-family roadmap at The differentiable lowered-model family (Engine A). This validation backs the Phase-2 Engine-B close-out.
- King, I. R. (1966). The structure of star clusters. III. Some simple dynamical models. The Astronomical Journal, 71, 64–75. 10.1086/109857
- Elson, R. A. W., Fall, S. M., & Freeman, K. C. (1987). The structure of young star clusters in the Large Magellanic Cloud. The Astrophysical Journal, 323, 54–78. 10.1086/165807