astrodynx.a_from_pe

Contents

astrodynx.a_from_pe#

astrodynx.a_from_pe(p, e)[source]#

Returns the semimajor axis of the orbit from the semiparameter and eccentricity.

Parameters:
  • p (ArrayLike) – Semiparameter of the orbit.

  • e (ArrayLike) – Eccentricity of the orbit; shape broadcast-compatible with p.

Return type:

ArrayLike

Returns:

The semimajor axis of the orbit.

Notes

The semimajor axis is calculated using equation:

\[ a = \frac{p}{1 - e^2} \]
where \(a\) is the semimajor axis, \(p\) is the semiparameter, and \(e\) is the eccentricity.

References

Battin, 1999, pp.117.

Examples

A simple example of calculating the semimajor axis with a semiparameter of 1.0 and eccentricity of 0.0:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> p = 1.0
>>> e = 0.0
>>> adx.a_from_pe(p, e)
1.0

With broadcasting, you can calculate the semimajor axis for multiple semiparameters and eccentricities:

>>> p = jnp.array([1.0, 2.0])
>>> e = jnp.array([0.0, 0.0])
>>> adx.a_from_pe(p, e)
Array([1., 2.], dtype=float32)