astrodynx.a_from_period

Contents

astrodynx.a_from_period#

astrodynx.a_from_period(orbperiod, mu=1)[source]#

Returns the semimajor axis of a two-body system from its orbital period.

Parameters:
  • orbperiod (ArrayLike) – Orbital period of the object in the two-body system.

  • mu (ArrayLike) – Gravitational parameter of the central body; shape broadcast-compatible with orbperiod.

Return type:

Array

Returns:

The semimajor axis of the object in the two-body system.

Notes

The semimajor axis is calculated using Kepler’s third law:

\[ a = \sqrt{\frac{P^2 \mu}{4 \pi^2}} \]
where \(a\) is the semimajor axis, \(P\) is the orbital period, and \(\mu\) is the gravitational parameter.

Examples

A simple example of calculating the semimajor axis for a circular orbit with an orbital period of 1.0 and a gravitational parameter of 1.0:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> orbperiod = 2.0 * jnp.pi
>>> mu = 1.0
>>> adx.a_from_period(orbperiod, mu)
Array(1., dtype=float32, weak_type=True)

With broadcasting, you can calculate the semimajor axis for multiple orbital periods and gravitational parameters:

>>> orbperiod = jnp.array([1.0, 2.0])*2*jnp.pi
>>> mu = jnp.array([1.0, 2.0])
>>> assert jnp.allclose(adx.a_from_period(orbperiod, mu), jnp.array([1.0, 2.0]))