astrodynx.mean_anomaly_elps#
- astrodynx.mean_anomaly_elps(a, deltat, mu=1)[source]#
Returns the mean anomaly for an elliptical orbit.
- Parameters:
- Return type:
- Returns:
The mean anomaly for an elliptical orbit.
Notes
The mean anomaly for an elliptical orbit is calculated using the formula:
\[ M = \sqrt{\frac{\mu}{a^3}} \Delta t \]where \(M\) 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.160.
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_elps(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_elps(a, deltat, mu) Array([1. , 0.5], dtype=float32)