astrodynx.mean_anomaly_hypb

astrodynx.mean_anomaly_hypb#

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

Returns the mean anomaly for a hyperbolic orbit.

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

  • deltat (ArrayLike) – Time since periapsis passage.

  • mu (ArrayLike) – (optional) Gravitational parameter of the central body.

Return type:

Array

Returns:

The mean anomaly for a hyperbolic orbit.

Notes

The mean anomaly for a hyperbolic orbit is calculated using the formula:

\[ N = \sqrt{\frac{\mu}{-a^3}} \Delta t \]
where \(N\) is the mean anomaly, \(a<0\) is the semimajor axis, \(\mu\) is the gravitational parameter, and \(\Delta t\) is the time since periapsis passage.

References

Battin, 1999, pp.166.

Examples

A simple example of calculating the mean anomaly for an orbit with semimajor axis -1.0, gravitational parameter 1.0, and time since periapsis passage 1.0:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> a = -1.0
>>> mu = 1.0
>>> deltat = 1.0
>>> adx.mean_anomaly_hypb(a, deltat, mu)
Array(1., dtype=float32, weak_type=True)

With broadcasting, you can calculate the mean anomaly for multiple semimajor axes, gravitational parameters, and times since periapsis passage:

>>> a = jnp.array([-1.0, -2.0])
>>> mu = jnp.array([1.0, 2.0])
>>> deltat = jnp.array([1.0, 1.0])
>>> adx.mean_anomaly_hypb(a, deltat, mu)
Array([1. , 0.5], dtype=float32)