Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Cross-engine agreement (B1)

San Diego State University

progenax builds multi-component equilibria two genuinely different ways, and the first demo checks that they describe the same physical cluster.

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 gg, the DF is a lowered (energy-shifted) Maxwellian (Gieles & Zocchi (2015), eq. 2),

f(E)    Eg ⁣(Es2),Eg(x)=exP(g,x)  (x>0),0 otherwise,f(E) \;\propto\; E_g\!\left(\frac{E}{s^2}\right), \qquad E_g(x) = e^{x}\,P(g, x)\ \ (x>0),\quad 0\ \text{otherwise},

with E=Ψ(r)12v2E = \Psi(r) - \tfrac12 v^2 the (positive, bound) relative energy, ss the velocity scale, and P(g,x)=γ(g,x)/Γ(g)P(g,x)=\gamma(g,x)/\Gamma(g) the regularized lower incomplete gamma. The index is gg itself (the density uses g+32g+\tfrac32). The single parameter gg slides continuously between classical models — g=0g=0 Woolley, g=1g=1 King, g=2g=2 Wilson — and at g=1g=1 the lowered exponential collapses to E1(x)=ex1E_1(x) = e^x - 1, the textbook King DF. The density ρ^(Ψ)=fd3v\hat\rho(\Psi)=\int f\,d^3v closes Poisson’s equation, solved as a coupled ODE in (Ψ,dΨ/dr)(\Psi, d\Psi/dr) — full derivation on the lowered-model-family page.

Engine B — Eddington inversion. Given the same King density as a prescribed shape, the shared potential Ψ(r)\Psi(r) follows from Poisson’s equation by quadrature, and the ergodic DF is recovered by the Eddington formula (Binney & Tremaine 2008, eq. 4.46b),

f(E)=18π2[0Ed2ρdΨ2dΨEΨ+1EdρdΨΨ=0].f(E) = \frac{1}{\sqrt8\,\pi^2} \left[\int_0^{E}\frac{d^2\rho}{d\Psi^2}\,\frac{d\Psi}{\sqrt{E-\Psi}} + \frac{1}{\sqrt E}\left.\frac{d\rho}{d\Psi}\right|_{\Psi=0}\right].

The two routes invert each other in principle — A maps DF\todensity, B maps density\toDF — 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)

W0W_0

King central dimensionless potential (concentration); the shared model both engines build (W0).

known / fixed (5.0)

gg

LIMEPY truncation order; g=1g=1 is the classic King DF (GG).

known / fixed (1.0)

rcr_c

King core radius — the length scale (R_C).

known / fixed (1.0 pc)

αj,wj,mj\alpha_j, w_j, m_j

Single mass component (weight, velocity-scale weight, mass label all =1=1), so the two engines compare like-for-like.

known / fixed (one component)

GG

Gravitational constant (STELLAR units); sets the physical velocity scale.

known / fixed

NN

Stars drawn from each engine to measure the sampled radial CDF and binned σ\sigma, at the same PRNG key so residuals isolate model (not shot) differences.

numerical choice (2×1042\times10^4, seed 0)

σ\sigma-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 <0.02<0.02, σB/σA1<0.02|\sigma_B/\sigma_A-1|<0.02, Qj=0.5±3×103Q_j=0.5\pm3\times10^{-3}).

numerical choices

What is measured (freshly run, ALL PASS)

Both engines are sampled at N=2×104N = 2\times10^4 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 rtr_t (A vs B)

10.8054 pc (both)

consistency

Theory virial Qj=Tj/WjQ_j = T_j/|W_j| — Engine A

0.50019

0.5±3×1030.5 \pm 3\times10^{-3}

Theory virial QjQ_j — Engine B

0.50000

0.5±3×1030.5 \pm 3\times10^{-3}

Radial Kolmogorov–Smirnov distance (sampled CDF)

1.5×1041.5\times10^{-4}

<0.02< 0.02

Max σB/σA1|\sigma_B/\sigma_A - 1| (interior bins)

3.5×1043.5\times10^{-4}

<0.02< 0.02

ρ(r)\rho(r) shape max fractional diff (diagnostic)

7.95×10137.95\times10^{-13}

f(E)f(E) peak-matched max diff (diagnostic)

5.05×1025.05\times10^{-2}

The two independent engines agree on the sampled radial CDF to a KS distance of 1.5×1041.5\times10^{-4} and on the dispersion profile to 3.5×1043.5\times10^{-4} — two orders of magnitude inside the 0.02 gate. The density shape agrees to 8×10138\times10^{-13} (essentially the floating-point floor, since both reduce the same King profile after re-normalizing to the central value).

Figure

Cross-engine King agreement (scripts/demo_cross_engine.py, ALL PASS).
(a) \rho(r)/\rho_0 for Engine A (DF-defined) and Engine B
(density-defined) with a residual strip — coincident to 8\times10^{-13} after
central re-normalization. (b) \sigma_{1\mathrm D}(r) from the two
independent oracles plus both sampled profiles (N=2\times10^4, same key);
\max|\sigma_B/\sigma_A-1| = 3.5\times10^{-4}. (c) f(E) overlay on the
dimensionless energy axis \hat E = (W_0/\Psi_0)E — the lowered-isothermal DF
shape (A) and the Eddington f-row (B), peak-matched.

Figure 1:Cross-engine King agreement (scripts/demo_cross_engine.py, ALL PASS). (a) ρ(r)/ρ0\rho(r)/\rho_0 for Engine A (DF-defined) and Engine B (density-defined) with a residual strip — coincident to 8×10138\times10^{-13} after central re-normalization. (b) σ1D(r)\sigma_{1\mathrm D}(r) from the two independent oracles plus both sampled profiles (N=2×104N=2\times10^4, same key); maxσB/σA1=3.5×104\max|\sigma_B/\sigma_A-1| = 3.5\times10^{-4}. (c) f(E)f(E) overlay on the dimensionless energy axis E^=(W0/Ψ0)E\hat E = (W_0/\Psi_0)E — the lowered-isothermal DF shape (A) and the Eddington ff-row (B), peak-matched.

Caveats

How to run

env -u VIRTUAL_ENV uv run --no-sync python scripts/demo_cross_engine.py

References

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.

References
  1. 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
  2. King, I. R. (1966). The structure of star clusters. III. Some simple dynamical models. The Astronomical Journal, 71, 64–75. 10.1086/109857