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.

Kepler orbital elements

San Diego State University

A binary’s relative orbit is fully specified by seven orbital elements: the semi-major axis aa, eccentricity ee, inclination ii, longitude of the ascending node Ω\Omega, argument of periastron ω\omega, mean anomaly MM at epoch, and the orbital period PP (or equivalently, the time of periastron passage tpt_p). progenax stores these in the KeplerElements PyTree and provides closed-form mappings between elements and phase-space coordinates (r,v)(\mathbf{r}, \mathbf{v}) 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

aa

Half the long axis of the orbit ellipse; sets the orbit size

Eccentricity

ee

Shape: e=0e = 0 circle, e=1e = 1 parabola, 0<e<10 < e < 1 ellipse

Inclination

ii

Tilt of orbit plane relative to a chosen reference plane (typically the cluster’s xyxy plane)

Longitude of ascending node

Ω\Omega

Where the orbit crosses the reference plane going “up”

Argument of periastron

ω\omega

Angle from ascending node to periastron, in the orbit plane

Mean anomaly at epoch

MM

Phase along the orbit at t=0t = 0; uniform in time

Orbital period

PP

Time to complete one orbit, P=2πa3/[G(m1+m2)]P = 2\pi\sqrt{a^3 / [G(m_1+m_2)]}

The first six are positional (they specify where the orbit is in space); the seventh specifies the temporal phase. Together they fully determine (rrel(t),vrel(t))(\mathbf{r}_{\mathrm{rel}}(t), \mathbf{v}_{\mathrm{rel}}(t)) for the relative orbit.

Kepler’s third law

The orbital period and semi-major axis are linked by the total mass:

P2  =  4π2a3G(m1+m2)a  =  [G(m1+m2)P24π2]1/3.P^2 \;=\; \frac{4\pi^2\,a^3}{G\,(m_1 + m_2)} \quad\Longleftrightarrow\quad a \;=\; \biggl[\frac{G\,(m_1+m_2)\,P^2}{4\pi^2}\biggr]^{1/3}.

↗ model card

progenax exposes both directions:

The choice of aa vs PP as the parameterised quantity matters in practice: most observational period distributions (Binary period distributions) parameterise PP directly, so progenax’s default KeplerElements constructor accepts PP and computes aa internally via (1).

From elements to phase-space coordinates

Converting orbital elements to relative position r\mathbf{r} and velocity v\mathbf{v} at time tt requires four steps:

Step 1 — solve Kepler’s equation for the eccentric anomaly EE:

EesinE  =  M(t),M(t)=M0+nt,n=2π/P.E - e\,\sin E \;=\; M(t), \qquad M(t) = M_0 + n\,t,\quad n = 2\pi/P.

↗ model card

This is a transcendental equation in EE. 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 E

The Newton iteration converges quadratically — typically 3–4 steps for e0.8e \lesssim 0.8. 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 e1e \to 1 regime; the extra cheap iterations guarantee accuracy across all e<1e < 1.

Step 2 — eccentric anomaly to true anomaly ν\nu:

tan(ν/2)  =  1+e1etan(E/2).\tan(\nu/2) \;=\; \sqrt{\frac{1+e}{1-e}}\,\tan(E/2).

Step 3 — orbit-plane coordinates. Position and velocity in the orbit plane (with periastron along the xx-axis):

r=a(1ecosE)rop=r(cosν,sinν,0)vop=na2r(sinE,1e2cosE,0)\begin{aligned} r &= a\,(1 - e\,\cos E) \\ \mathbf{r}_{\mathrm{op}} &= r\,(\cos\nu,\,\sin\nu,\,0) \\ \mathbf{v}_{\mathrm{op}} &= \frac{n\,a^2}{r}\,(-\sin E,\,\sqrt{1-e^2}\cos E,\,0) \end{aligned}

Step 4 — rotate into the reference frame via three Euler-angle rotations (about zz by Ω\Omega, then xx by ii, then zz by ω\omega):

rrel  =  Rz(Ω)Rx(i)Rz(ω)rop,vrel  =  Rz(Ω)Rx(i)Rz(ω)vop.\mathbf{r}_{\mathrm{rel}} \;=\; R_z(\Omega)\,R_x(i)\,R_z(\omega)\,\mathbf{r}_{\mathrm{op}}, \qquad \mathbf{v}_{\mathrm{rel}} \;=\; R_z(\Omega)\,R_x(i)\,R_z(\omega)\,\mathbf{v}_{\mathrm{op}}.

The full pipeline is one JIT trace and fully vmap-able over a population of binaries.

From relative to component coordinates

Given rrel=r2r1\mathbf{r}_{\mathrm{rel}} = \mathbf{r}_2 - \mathbf{r}_1 and component masses m1,m2m_1, m_2, the individual particle coordinates are

r1=m2m1+m2rrelr2=+m1m1+m2rrel\begin{aligned} \mathbf{r}_1 &= -\frac{m_2}{m_1 + m_2}\,\mathbf{r}_{\mathrm{rel}} \\ \mathbf{r}_2 &= +\frac{m_1}{m_1 + m_2}\,\mathbf{r}_{\mathrm{rel}} \end{aligned}

↗ model card

with the corresponding velocity decomposition for v1,v2\mathbf{v}_1, \mathbf{v}_2. 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:

  1. PP from the population period distribution (Binary period distributions) — typically a log-normal or Sana et al. (2012) empirical fit.

  2. aa from PP and mtotm_{\mathrm{tot}} via (1).

  3. ee from the population eccentricity distribution (Eccentricity distributions) — thermal, uniform, or Moe & Di Stefano (2017) period-dependent.

  4. cosiU(1,1)\cos i \sim \mathcal{U}(-1, 1) — isotropic inclination.

  5. ΩU(0,2π)\Omega \sim \mathcal{U}(0, 2\pi) — uniform.

  6. ωU(0,2π)\omega \sim \mathcal{U}(0, 2\pi) — uniform.

  7. M0U(0,2π)M_0 \sim \mathcal{U}(0, 2\pi) — uniform orbital phase.

The mass ratio qq comes from Mass-ratio distributions; the binary fraction from Multiplicity statistics (Moe & Di Stefano 2017). The seven orbital elements plus qq specify the orbit completely.

Differentiability properties

KeplerElements is differentiable in all element values. Specifically:

This matters when fitting binary orbits — e.g. inferring (a,e,i,Ω,ω,M0)(a, e, i, \Omega, \omega, M_0) from radial-velocity or astrometric observations of a known binary. The full inference loop is one JAX gradient call.

Domain of validity

  1. Bound orbits only (e<1e < 1). Hyperbolic orbits (e1e \ge 1) represent unbound encounters, not binaries; they are not handled by KeplerElements.

  2. Two-body approximation. Higher-order multiples (triples, quadruples) are not represented by a single KeplerElements instance. progenax models them as nested binaries (an outer KeplerElements whose “secondary” is itself an inner binary).

  3. Newtonian gravity. Relativistic effects (periastron precession, orbital decay via gravitational waves) are not included. For binaries with a1a \ll 1 AU and component masses 10M\gtrsim 10\,\Msun, relativistic corrections become observable on Gyr timescales.

Implementation, validation & references

References
  1. 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
  2. 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
  3. Kidger, P., & Garcia, C. (2021). Equinox: Neural networks in JAX via callable PyTrees. 10.5281/zenodo.5648586