A binary’s relative orbit is fully specified by seven orbital elements:
the semi-major axis , eccentricity , inclination , longitude
of the ascending node , argument of periastron , mean
anomaly at epoch, and the orbital period (or equivalently, the
time of periastron passage ). progenax stores these in the
KeplerElements PyTree and provides closed-form mappings between
elements and phase-space coordinates for
each component star.
This chapter derives the elements-to-phase-space conversion, lists
the conventions progenax uses, and documents the differentiability
properties that make KeplerElements HMC-compatible.
The seven elements¶
Element | Symbol | Physical meaning |
|---|---|---|
Semi-major axis | Half the long axis of the orbit ellipse; sets the orbit size | |
Eccentricity | Shape: circle, parabola, ellipse | |
Inclination | Tilt of orbit plane relative to a chosen reference plane (typically the cluster’s plane) | |
Longitude of ascending node | Where the orbit crosses the reference plane going “up” | |
Argument of periastron | Angle from ascending node to periastron, in the orbit plane | |
Mean anomaly at epoch | Phase along the orbit at ; uniform in time | |
Orbital period | Time to complete one orbit, |
The first six are positional (they specify where the orbit is in space); the seventh specifies the temporal phase. Together they fully determine for the relative orbit.
Kepler’s third law¶
The orbital period and semi-major axis are linked by the total mass:
progenax exposes both directions:
compute_period(a, m_total, *, G)— given , returns .period_to_semimajor_axis(P, m_total, *, G)— given , returns .
The choice of vs as the parameterised quantity matters in
practice: most observational period distributions
(Binary period distributions) parameterise directly, so progenax’s
default KeplerElements constructor accepts and computes
internally via (1).
From elements to phase-space coordinates¶
Converting orbital elements to relative position and velocity at time requires four steps:
Step 1 — solve Kepler’s equation for the eccentric anomaly :
This is a transcendental equation in . progenax uses a
fixed-iteration Newton solver built on jax.lax.scan (not a Python
loop), so the iteration count is static and the whole solve is one
JIT-/grad-compatible trace:
import jax
import jax.numpy as jnp
def solve_kepler(M, e, max_iter=50):
M_wrapped = jnp.mod(M, 2.0 * jnp.pi)
# Initial guess E0 = M + 0.85 sign(sin M) e (good for moderate e)
E0 = M_wrapped + 0.85 * jnp.sign(jnp.sin(M_wrapped)) * e
def newton_step(E, _):
f = E - e * jnp.sin(E) - M_wrapped
f_prime = 1.0 - e * jnp.cos(E)
E_new = E - f / jnp.maximum(jnp.abs(f_prime), 1e-12)
return E_new, None
E, _ = jax.lax.scan(newton_step, E0, None, length=max_iter)
return EThe Newton iteration converges quadratically — typically 3–4 steps for
. progenax’s default max_iter=50
(KeplerElements._solve_kepler_equation) is deliberately conservative
so the fixed-iteration scheme still reaches machine precision in the
slow-converging regime; the extra cheap iterations guarantee
accuracy across all .
Step 2 — eccentric anomaly to true anomaly :
Step 3 — orbit-plane coordinates. Position and velocity in the orbit plane (with periastron along the -axis):
Step 4 — rotate into the reference frame via three Euler-angle rotations (about by , then by , then by ):
The full pipeline is one JIT trace and fully vmap-able over a
population of binaries.
From relative to component coordinates¶
Given and component masses , the individual particle coordinates are
with the corresponding velocity decomposition for . These are then added to the binary’s centre-of-mass position and velocity (which come from the spatial profile and velocity DF — see Binary populations) to produce the absolute particle coordinates.
Sampling: isotropic angles + population distributions¶
For a Monte Carlo binary population, progenax samples the seven elements as follows:
from the population period distribution (Binary period distributions) — typically a log-normal or Sana et al. (2012) empirical fit.
from and via (1).
from the population eccentricity distribution (Eccentricity distributions) — thermal, uniform, or Moe & Di Stefano (2017) period-dependent.
— isotropic inclination.
— uniform.
— uniform.
— uniform orbital phase.
The mass ratio comes from Mass-ratio distributions; the binary fraction from Multiplicity statistics (Moe & Di Stefano 2017). The seven orbital elements plus specify the orbit completely.
Differentiability properties¶
KeplerElements is differentiable in all element values. Specifically:
The Newton iterations on Kepler’s equation (2) are a fixed-count
jax.lax.scan, gradient-compatible.
This matters when fitting binary orbits — e.g. inferring from radial-velocity or astrometric observations of a known binary. The full inference loop is one JAX gradient call.
Domain of validity¶
Bound orbits only (). Hyperbolic orbits () represent unbound encounters, not binaries; they are not handled by
KeplerElements.Two-body approximation. Higher-order multiples (triples, quadruples) are not represented by a single
KeplerElementsinstance. progenax models them as nested binaries (an outerKeplerElementswhose “secondary” is itself an inner binary).Newtonian gravity. Relativistic effects (periastron precession, orbital decay via gravitational waves) are not included. For binaries with AU and component masses , relativistic corrections become observable on Gyr timescales.
Implementation, validation & references¶
In code:
src/progenax/binaries/kepler.py(KeplerElements, the fixed-iteration Kepler-equation solver, and the elements→phase-space conversion), withcompute_period/period_to_semimajor_axisinsrc/progenax/binaries/kepler_period.py. See the binaries API.Validated in: binary-aware recovery — the binary regression suite that exercises the orbit machinery (Kepler’s third law to ).
Primary sources: Kepler-element machinery is standard textbook material; Murray & Dermott Solar System Dynamics §2 gives a clean derivation, and modern N-body codes (NBODY6, COSMIC) use the same conventions. progenax’s
KeplerElementsis JAX-native via Kidger & Garcia (2021)’s PyTree pattern; the Newton solver follows the standard fixed-iteration approach.
- Sana, H., de Mink, S. E., de Koter, A., Langer, N., Evans, C. J., Gieles, M., Gosset, E., Izzard, R. G., Le Bouquin, J.-B., & Schneider, F. R. N. (2012). Binary interaction dominates the evolution of massive stars. Science, 337, 444–446. 10.1126/science.1223344
- Moe, M., & Di Stefano, R. (2017). Mind your Ps and Qs: The interrelation between period (P) and mass-ratio (Q) distributions of binary stars. The Astrophysical Journal Supplement Series, 230, 15. 10.3847/1538-4365/aa6fb6
- Kidger, P., & Garcia, C. (2021). Equinox: Neural networks in JAX via callable PyTrees. 10.5281/zenodo.5648586