Keplerian¶
Keplerian orbital mechanics functions for Earth-centric orbits.
This module provides functions for computing orbital parameters from Keplerian elements, including orbital period, mean motion, semi-major axis, velocities at apsides, distances, altitudes, anomaly conversions, and special orbits (sun-synchronous, geostationary).
All functions use JAX operations and are compatible with jax.jit,
jax.vmap, and jax.grad. Inputs are coerced to the configured
float dtype (see :func:astrojax.config.set_dtype).
The anomaly conversion functions include a Newton-Raphson Kepler equation
solver implemented with jax.lax.fori_loop for JAX traceability.
anomaly_eccentric_to_mean(anm_ecc, e, use_degrees=False)
¶
Convert eccentric anomaly to mean anomaly.
Applies Kepler's equation: M = E - e * sin(E).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc
|
ArrayLike
|
Eccentric anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Mean anomaly. Units: rad or deg |
References
O. Montenbruck, and E. Gill, Satellite Orbits: Models, Methods and Applications, 2012. Eq. 2.65.
Examples:
anomaly_eccentric_to_true(anm_ecc, e, use_degrees=False)
¶
Convert eccentric anomaly to true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc
|
ArrayLike
|
Eccentric anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
True anomaly. Units: rad or deg |
References
D. Vallado, Fundamentals of Astrodynamics and Applications (4th Ed.), pp. 47, eq. 2-9, 2010.
Examples:
anomaly_mean_to_eccentric(anm_mean, e, use_degrees=False)
¶
Convert mean anomaly to eccentric anomaly.
Solves Kepler's equation M = E - e * sin(E) for E using
Newton-Raphson iteration implemented with jax.lax.fori_loop
for JAX traceability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean
|
ArrayLike
|
Mean anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Eccentric anomaly. Units: rad or deg |
Examples:
anomaly_mean_to_true(anm_mean, e, use_degrees=False)
¶
Convert mean anomaly to true anomaly.
Composite conversion: mean -> eccentric -> true.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean
|
ArrayLike
|
Mean anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
True anomaly. Units: rad or deg |
Examples:
anomaly_true_to_eccentric(anm_true, e, use_degrees=False)
¶
Convert true anomaly to eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true
|
ArrayLike
|
True anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Eccentric anomaly. Units: rad or deg |
References
D. Vallado, Fundamentals of Astrodynamics and Applications (4th Ed.), pp. 47, eq. 2-9, 2010.
Examples:
anomaly_true_to_mean(anm_true, e, use_degrees=False)
¶
Convert true anomaly to mean anomaly.
Composite conversion: true -> eccentric -> mean.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true
|
ArrayLike
|
True anomaly. Units: rad or deg |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Mean anomaly. Units: rad or deg |
Examples:
apoapsis_distance(a, e)
¶
Compute the distance at apoapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Apoapsis distance. Units: m |
Examples:
apogee_altitude(a, e)
¶
Compute altitude above Earth's surface at apogee.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Apogee altitude. Units: m |
Examples:
apogee_velocity(a, e)
¶
Compute velocity at apogee for an Earth orbit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Apogee velocity magnitude. Units: m/s |
Examples:
geo_sma()
¶
mean_motion(a, use_degrees=False)
¶
Compute the mean motion of an object orbiting Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Mean motion. Units: rad/s or deg/s |
Examples:
orbital_period(a)
¶
Compute the orbital period of an object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Orbital period. Units: s |
Examples:
orbital_period_from_state(state_eci)
¶
Compute orbital period from an ECI state vector using the vis-viva equation.
Derives the semi-major axis from the state vector's position and velocity magnitudes, then computes the corresponding orbital period.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_eci
|
ArrayLike
|
ECI state vector |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Orbital period. Units: s |
Examples:
periapsis_distance(a, e)
¶
Compute the distance at periapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Periapsis distance. Units: m |
Examples:
perigee_altitude(a, e)
¶
Compute altitude above Earth's surface at perigee.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Perigee altitude. Units: m |
Examples:
perigee_velocity(a, e)
¶
Compute velocity at perigee for an Earth orbit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Perigee velocity magnitude. Units: m/s |
Examples:
semimajor_axis(n, use_degrees=False)
¶
Compute semi-major axis from mean motion around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
ArrayLike
|
Mean motion. Units: rad/s or deg/s |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Semi-major axis. Units: m |
Examples:
semimajor_axis_from_orbital_period(period)
¶
Compute semi-major axis from orbital period around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
ArrayLike
|
Orbital period. Units: s |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Semi-major axis. Units: m |
Examples:
sun_synchronous_inclination(a, e, use_degrees=False)
¶
Compute the inclination for a Sun-synchronous orbit around Earth.
Uses the J2 gravitational perturbation to compute the inclination required for the RAAN precession rate to match Earth's mean motion around the Sun (one revolution per year).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Semi-major axis. Units: m |
required |
e
|
ArrayLike
|
Eccentricity. Dimensionless. |
required |
use_degrees
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Sun-synchronous inclination. Units: rad or deg |
Examples: