astrodynx.solve_kepler_uni

astrodynx.solve_kepler_uni#

astrodynx.solve_kepler_uni(deltat, alpha, r0, sigma0, mu=1, tol=1e-06, max_iter=50)[source]#

Returns the generalized anomaly for a universal orbit equation.

Parameters:
  • deltat (DTypeLike) – The time since the initial time.

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

  • r0 (DTypeLike) – The radius at the initial time.

  • sigma0 (DTypeLike) – The sigma function at the initial time.

  • mu (DTypeLike) – (optional) The gravitational parameter.

  • tol (DTypeLike) – (optional) Tolerance for convergence.

  • max_iter (int) – (optional) Maximum number of iterations.

Return type:

Array

Returns:

The generalized anomaly for a universal orbit equation.

Notes

The generalized anomaly is calculated by solving the universal orbit equation:

\[ r_0 U_1(\chi, \alpha) + \sigma_0 U_2(\chi, \alpha) + U_3(\chi, \alpha) - \sqrt{\mu} \Delta t = 0 \]
where \(\chi\) is the generalized anomaly, \(\alpha = \frac{1}{a}\) is the reciprocal of semimajor axis, \(\sigma_0\) is the sigma function at the initial time, \(r_0\) is the norm of the position vector at the initial time, \(\mu\) is the gravitational parameter, \(U_1\) is the universal function U1, \(U_2\) is the universal function U2, \(U_3\) is the universal function U3, and \(\Delta t\) is the time since the initial time.

References

Battin, 1999, pp.178.

Examples

A simple example:

>>> import jax.numpy as jnp
>>> import astrodynx as adx
>>> r0_vec = jnp.array([1.0, 0.0, 0.0])
>>> v0_vec = jnp.array([0.0, 1.1, 0.0])
>>> mu = 1.0
>>> deltat = jnp.pi*0.5
>>> r0 = jnp.linalg.vector_norm(r0_vec)
>>> v0 = jnp.linalg.vector_norm(v0_vec)
>>> alpha = 1.0 / adx.semimajor_axis(r0, v0, mu)
>>> sigma0 = adx.twobody.sigma_fn(r0_vec, v0_vec, mu)
>>> chi = adx.solve_kepler_uni(deltat, alpha.item(), r0.item(), sigma0.item(), mu)
>>> assert adx.kepler_equ_uni(chi,alpha,r0, sigma0, deltat, mu) < 1e-6