progenax builds multi-component equilibria two genuinely different ways, and the first demo checks that they describe the same physical cluster.
Engine A (
MultiComponentCluster.from_components) starts from a distribution function: the lowered-isothermal / LIMEPY family Gieles & Zocchi, 2015. The density is whatever that DF produces in its own self-consistent potential, found by integrating the coupled Poisson ODE.Engine B (
MultiComponentCluster.from_density_profiles) starts from a prescribed density (here aKingProfile), builds the shared potential by one cumulative-trapezoid Poisson pass, and recovers the DF by Eddington inversion.
If both engines are correct, the King model (W₀=5, g=1, r_c=1 pc) built either
way must sample the same radial profile, the same dispersion profile, and the
same energy distribution. Nothing forces this but the physics — the two code
paths share no quadrature, no ODE, and no DF evaluation.
The two constructions¶
Engine A — the lowered-isothermal DF. For a single mass component with truncation order , the DF is a lowered (energy-shifted) Maxwellian (Gieles & Zocchi (2015), eq. 2),
with the (positive, bound) relative energy, the
velocity scale, and the regularized lower
incomplete gamma. The index is itself (the density uses ).
The single parameter slides continuously between classical models —
Woolley, King, Wilson — and at the lowered
exponential collapses to , the textbook King DF. The density
closes Poisson’s equation, solved as a coupled ODE
in — full derivation on the
lowered
Engine B — Eddington inversion. Given the same King density as a prescribed shape, the shared potential follows from Poisson’s equation by quadrature, and the ergodic DF is recovered by the Eddington formula (Binney & Tremaine 2008, eq. 4.46b),
The two routes invert each other in principle — A maps DFdensity, B maps densityDF — so agreement is a true round-trip cross-validation.
Inputs and assumptions¶
This demo fits nothing — there are no recovered parameters. It builds one King model two ways and compares them, so every quantity is either a known/fixed model input or a numerical choice.
Table 1:Model inputs
Input | Meaning and role | Status (fiducial) |
|---|---|---|
King central dimensionless potential (concentration); the shared model both engines build ( | known / fixed (5.0) | |
LIMEPY truncation order; is the classic King DF ( | known / fixed (1.0) | |
King core radius — the length scale ( | known / fixed (1.0 pc) | |
Single mass component (weight, velocity-scale weight, mass label all ), so the two engines compare like-for-like. | known / fixed (one component) | |
Gravitational constant (STELLAR units); sets the physical velocity scale. | known / fixed | |
Stars drawn from each engine to measure the sampled radial CDF and binned , at the same PRNG key so residuals isolate model (not shot) differences. | numerical choice (, seed 0) | |
-bins, oracle grids, quadrature, gates | 6 bins over the 5%–90% radial quantiles; 300–400-pt analytic-oracle grids; 400-pt speed-moment quadrature; gate thresholds (KS , , ). | numerical choices |
What is measured (freshly run, ALL PASS)¶
Both engines are sampled at with the same PRNG key, so the
draws are strongly correlated and the residuals isolate genuine model
differences rather than shot noise. Measured 2026-06-11 (key=0):
Check | Measured | Gate |
|---|---|---|
Tidal radius (A vs B) | 10.8054 pc (both) | consistency |
Theory virial — Engine A | 0.50019 | |
Theory virial — Engine B | 0.50000 | |
Radial Kolmogorov–Smirnov distance (sampled CDF) | ||
Max (interior bins) | ||
shape max fractional diff (diagnostic) | — | |
peak-matched max diff (diagnostic) | — |
The two independent engines agree on the sampled radial CDF to a KS distance of and on the dispersion profile to — two orders of magnitude inside the 0.02 gate. The density shape agrees to (essentially the floating-point floor, since both reduce the same King profile after re-normalizing to the central value).
Figure¶

Figure 1:Cross-engine King agreement (scripts/demo_cross_engine.py, ALL PASS).
(a) for Engine A (DF-defined) and Engine B
(density-defined) with a residual strip — coincident to after
central re-normalization. (b) from the two
independent oracles plus both sampled profiles (, same key);
. (c) overlay on the
dimensionless energy axis — the lowered-isothermal DF
shape (A) and the Eddington -row (B), peak-matched.
Caveats¶
How to run¶
env -u VIRTUAL_ENV uv run --no-sync python scripts/demo_cross_engine.pyReferences¶
The lowered-isothermal / LIMEPY family is Gieles & Zocchi (2015); the King model King (1966); Eddington inversion and the ergodic DF follow Binney & Tremaine (2008). Engine internals: the multi-component theory pages and the Engine B validation suite.
- Gieles, M., & Zocchi, A. (2015). A family of lowered isothermal models. Monthly Notices of the Royal Astronomical Society, 454, 576–592. 10.1093/mnras/stv1848
- King, I. R. (1966). The structure of star clusters. III. Some simple dynamical models. The Astronomical Journal, 71, 64–75. 10.1086/109857