Skip to content

Mean Elements

Mean-osculating Keplerian element conversions.

First-order J2 perturbation mapping based on Brouwer-Lyddane theory. Implements the algorithm from Schaub and Junkins, Analytical Mechanics of Space Systems, Appendix F: "First-Order Mapping Between Mean and Osculating Orbit Elements".

The transformation uses a sign convention on the perturbation parameter gamma_2 to handle both directions (mean-to-osculating and osculating-to-mean) with a single code path, keeping the implementation fully JAX-traceable with no Python control flow.

All functions use JAX operations and are compatible with jax.jit, jax.vmap, and jax.grad.

state_koe_mean_to_osc(oe, use_degrees=False)

Convert mean Keplerian elements to osculating Keplerian elements.

Applies the first-order Brouwer-Lyddane transformation to convert mean (orbit-averaged) orbital elements to osculating (instantaneous) elements. The transformation accounts for short-period and long-period J2 perturbations.

Parameters:

Name Type Description Default
oe ArrayLike

Mean Keplerian elements [a, e, i, Omega, omega, M]. Semi-major axis in metres, eccentricity dimensionless, angles in radians or degrees.

required
use_degrees bool

If True, angular elements are in degrees.

False

Returns:

Type Description
Array

Osculating Keplerian elements in the same format as input.

Examples:

import jax.numpy as jnp
from astrojax.constants import R_EARTH
from astrojax.orbits import state_koe_mean_to_osc

mean = jnp.array([R_EARTH + 500e3, 0.001, 45.0, 0.0, 0.0, 0.0])
osc = state_koe_mean_to_osc(mean, use_degrees=True)

state_koe_osc_to_mean(oe, use_degrees=False)

Convert osculating Keplerian elements to mean Keplerian elements.

Applies the first-order Brouwer-Lyddane transformation to convert osculating (instantaneous) orbital elements to mean (orbit-averaged) elements. The transformation accounts for short-period and long-period J2 perturbations.

Parameters:

Name Type Description Default
oe ArrayLike

Osculating Keplerian elements [a, e, i, Omega, omega, M]. Semi-major axis in metres, eccentricity dimensionless, angles in radians or degrees.

required
use_degrees bool

If True, angular elements are in degrees.

False

Returns:

Type Description
Array

Mean Keplerian elements in the same format as input.

Examples:

import jax.numpy as jnp
from astrojax.constants import R_EARTH
from astrojax.orbits import state_koe_osc_to_mean

osc = jnp.array([R_EARTH + 500e3, 0.001, 45.0, 0.0, 0.0, 0.0])
mean = state_koe_osc_to_mean(osc, use_degrees=True)