astrodynx.twobody.ufunc4

Contents

astrodynx.twobody.ufunc4#

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

The universal function U4

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

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

Return type:

Array

Returns:

The value of the universal function U4.

Notes

The universal function U4 is defined as:

\[\begin{split} U_4(\chi, \alpha) = \begin{cases} \frac{\alpha \chi^2 - 2 + 2 \cos(\sqrt{\alpha} \chi)}{2 \alpha^2} & \alpha > 0 \\ \frac{\alpha \chi^2 - 2 + 2 \cosh(\sqrt{-\alpha} \chi)}{2 \alpha^2} & \alpha < 0 \\ \frac{\chi^4}{24} & \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.183.

Examples

A simple example:

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

With broadcasting:

>>> chi = jnp.array([1.0, 2.0])
>>> alpha = 1.0
>>> adx.twobody.ufunc4(chi, alpha)
Array([0.0403..., 0.5838...], dtype=float32)