astrodynx.twobody.ufunc0

Contents

astrodynx.twobody.ufunc0#

astrodynx.twobody.ufunc0(chi, alpha)[source]#

The universal function U0

Parameters:
  • chi (ArrayLike) – The generalized anomaly.

  • alpha (DTypeLike) – The reciprocal of the semimajor axis.

Return type:

Array

Returns:

The value of the universal function U0.

Notes

The universal function U0 is defined as:

\[\begin{split} U_0(\chi, \alpha) = \begin{cases} 1 & \alpha = 0 \\ \cos(\sqrt{\alpha} \chi) & \alpha > 0 \\ \cosh(\sqrt{-\alpha} \chi) & \alpha < 0 \end{cases} \end{split}\]
where \(\chi\) is the generalized anomaly and \(\alpha = \frac{1}{a}\) is the reciprocal of semimajor axis.

References

Battin, 1999, pp.180.

Examples

A simple example:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> chi = 1.0
>>> alpha = 1.0
>>> adx.twobody.ufunc0(chi, alpha)
Array(0.5403..., dtype=float32, weak_type=True)

With broadcasting:

>>> chi = jnp.array([1.0, 2.0])
>>> alpha = 1.0
>>> adx.twobody.ufunc0(chi, alpha)
Array([ 0.5403..., -0.4161...], dtype=float32)