astrodynx.kepler_equ_elps

astrodynx.kepler_equ_elps#

astrodynx.kepler_equ_elps(E, e, M=0)[source]#

Returns the Kepler’s equation for elliptical orbits in the form f(E) = 0.

Parameters:
  • E (ArrayLike) – Eccentric anomaly.

  • e (ArrayLike) – Eccentricity of the orbit, 0 <= e < 1.

  • M (ArrayLike) – (optional) Mean anomaly.

Returns:

E - e*sin(E) - M.

Return type:

Array

Notes

Kepler’s equation for elliptical orbits relates the eccentric anomaly E to the mean anomaly M:

\[ E - e \sin E = M \]
This function returns the equation in the form f(E) = 0, which is useful for root-finding algorithms.

References

Battin, 1999, pp.160.

Examples

A simple example:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> E = jnp.pi/4
>>> e = 0.1
>>> M = 0.7
>>> adx.kepler_equ_elps(E, e, M)
Array(0.01468..., dtype=float32, weak_type=True)

With broadcasting, you can calculate the Kepler’s equation for multiple eccentric anomalies, eccentricities, and mean anomalies:

>>> E = jnp.array([jnp.pi/4, jnp.pi/2])
>>> e = jnp.array([0.1, 0.2])
>>> M = jnp.array([0.7, 0.8])
>>> adx.kepler_equ_elps(E, e, M)
Array([0.01468..., 0.5707...], dtype=float32)