progenax.stellar provides the Tout et al. (1996) zero-age main-sequence (ZAMS)
relations — mass to luminosity, radius, effective temperature, and surface gravity,
plus a differentiable inverse — as five pure, array-aware, autodiff-ready
functions. They are the metallicity-dependent photometric placeholder for the
eventual startrax stellar tracks: the bridge from a sampled IMF to a colour-magnitude
diagram or a mass–luminosity inference. Test files:
tests/validation/test_zams_physics.py (34 tests, validation tier) and
tests/unit/stellar/test_zams.py (unit tier); figures: scripts/validate_zams.py.
The relations¶
The luminosity and radius are rational functions of mass with metallicity-dependent coefficients (each coefficient, except the scalar , is a degree-4 polynomial in , ):
with . The effective temperature and surface gravity are not independent fits — they follow from and by physics:
The inverse is a fixed-iteration Newton solve in a jax.lax.scan (not a
while_loop), so it is differentiable: the analytic slope is obtained by
jax.grad of the forward relation, and the round-trip recovers the mass
to machine precision over the whole fitted range.
What is verified¶
Rows map to tests/validation/test_zams_physics.py; Measured values are regenerated
by scripts/validate_zams.py (which prints expected-vs-measured PASS/FAIL per figure and
exits non-zero on any failure). Each check uses an independent oracle — the
PDF-verified algebra, the Stefan-Boltzmann/Newton closure, monotonicity, or the forward
relation the inverse must undo — not the formula’s own restatement.
Property | Tolerance (as tested) | Measured | Anchor |
|---|---|---|---|
Solar | within (paper’s solar accuracy) | PDF-verified Table 1 algebra | |
Solar | within (paper’s solar accuracy) | PDF-verified Table 2 algebra | |
Solar | computed value to 10-6 | Stefan-Boltzmann of | |
Solar | computed value to 10-6 | (cgs) | |
vs hand Stefan-Boltzmann | max rel | 0 (machine-exact) | |
strictly monotone over | all | True | homology (invertibility) |
Inverse round-trip | rel | forward | |
Inverse (AD vs FD) | rel | central finite difference | |
Metal-poor is bluer/brighter at fixed | lower opacity (homology) |
Validity & accuracy envelope¶
The Tout et al. (1996) fits are valid for and
. Over that box the luminosity is accurate to
( at solar ) and the radius to ( at solar); the worst cases are
at and at .
Metallicity extrapolation is forbidden — the rational functions go negative outside the
fitted range — so stellar.py clips to as the paper’s explicit
guidance, not an arbitrary guard.
Figures¶
Generated by scripts/validate_zams.py (PASS/FAIL per panel; PNG raster for this site,
PDF vector for papers).

Figure 1:ZAMS luminosity over the full fitted range at three metallicities (solar , , ). The solar anchor (star) reproduces the PDF-verified value, and is strictly monotone — the homology property that makes the luminosity invertible. Metal-poor tracks sit above the solar one (lower opacity ⇒ brighter at fixed mass).

Figure 2:ZAMS radius over the fitted range at the same three metallicities. The solar anchor (star) matches the PDF-verified value; stays finite and positive across the whole range.

Figure 3:ZAMS effective temperature from Stefan-Boltzmann. The module curve (points) lies exactly on the hand-computed closure (line) to machine precision — an independent check that the physics, not just the coefficients, is wired correctly. The ZAMS Sun sits at (cooler and smaller than today’s Sun).

Figure 4:The ZAMS in the Hertzsprung-Russell plane ( vs , hot/blue to the left) at three metallicities — the Tout et al. (1996) Fig. 5 view. The solar track is marked with mass ticks (0.3–) and the ZAMS Sun. Lower-metallicity ZAMS loci are hotter at fixed mass (bluer), as expected from the reduced opacity.
![Left: the inverse solve M_{\rm rec}=L^{-1}(L(M)) lies on y=x across
[0.1,100]\,M_\odot. Right: the round-trip relative residual stays at the
floating-point floor (\sim 5\times10^{-16}, well under the 10^{-5} tolerance) — the
fixed-iteration Newton/scan invert reaches machine precision, and its gradient dM/dL
agrees with a central finite difference to 1.6\times10^{-11} (the inference-grade
differentiability the inverse exists for).](/progenax/build/zams_inverse_roundtr-183989abb5adc7dc40ad1fa8be57bb72.png)
Figure 5:Left: the inverse solve lies on across . Right: the round-trip relative residual stays at the floating-point floor (, well under the 10-5 tolerance) — the fixed-iteration Newton/scan invert reaches machine precision, and its gradient agrees with a central finite difference to (the inference-grade differentiability the inverse exists for).
Differentiability¶
All five relations flow finite gradients (the Fisher-information requirement for
mass-function and CMD inference). The forward ,
, ,
and the inverse (through the lax.scan Newton) are each registered
in the release gradient gate as measured AD-vs-FD cases; the
inverse case audits the gradient through the fixed-iteration solver, confirming the scan
(not a while_loop) keeps the invert differentiable.
- Tout, C. A., Pols, O. R., Eggleton, P. P., & Han, Z. (1996). Zero-age main-sequence radii and luminosities as analytic functions of mass and metallicity. Monthly Notices of the Royal Astronomical Society, 281, 257. 10.1093/mnras/281.1.257