astrodynx.orb_period

Contents

astrodynx.orb_period#

astrodynx.orb_period(a, mu=1)[source]#

Returns the orbital period of a two-body system.

Parameters:
  • a (ArrayLike) – Semimajor axis of the orbit.

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

Return type:

Array

Returns:

The orbital period of the object in the two-body system.

Notes

The orbital period is calculated using Kepler’s third law:

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

References

Battin, 1999, pp.119.

Examples

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

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> a = 1.0
>>> mu = 1.0
>>> adx.orb_period(a, mu)
Array(6.2831855, dtype=float32, weak_type=True)

With broadcasting, you can calculate the orbital period for multiple semimajor axes and gravitational parameters:

>>> a = jnp.array([1.0, 2.0])
>>> mu = jnp.array([1.0, 2.0])
>>> adx.orb_period(a, mu)
Array([ 6.2831855, 12.566371 ], dtype=float32)