astrodynx.twobody.ufunc2#
- astrodynx.twobody.ufunc2(chi, alpha)[source]#
The universal function U2
- Parameters:
- Return type:
- Returns:
The value of the universal function U2.
Notes
The universal function U2 is defined as:
\[\begin{split} U_2(\chi, \alpha) = \begin{cases} \frac{1 - \cos(\sqrt{\alpha} \chi)}{\alpha} & \alpha > 0 \\ \frac{\cosh(\sqrt{-\alpha} \chi) - 1}{-\alpha} & \alpha < 0 \\ \frac{\chi^2}{2} & \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.ufunc2(chi, alpha) Array(0.4596..., dtype=float32, weak_type=True)
With broadcasting:
>>> chi = jnp.array([1.0, 2.0]) >>> alpha = 1.0 >>> adx.twobody.ufunc2(chi, alpha) Array([0.4596..., 1.4161...], dtype=float32)