astrodynx.gravity.j2_acc#
- astrodynx.gravity.j2_acc(t, x, args={'J2': 0.0, 'R_eq': 1.0, 'mu': 1.0})[source]#
Returns the acceleration due to J2 perturbation.
- Parameters:
- Return type:
- Returns:
The acceleration due to J2 perturbation.
Notes
The acceleration due to J2 perturbation is defined as:
\[\begin{split} \begin{align*} a_x &= -\frac{3}{2} \frac{\mu J_2 R_{eq}^2}{r^5} x \left( 1 - 5 \frac{z^2}{r^2} \right) \\ a_y &= -\frac{3}{2} \frac{\mu J_2 R_{eq}^2}{r^5} y \left( 1 - 5 \frac{z^2}{r^2} \right) \\ a_z &= -\frac{3}{2} \frac{\mu J_2 R_{eq}^2}{r^5} z \left( 3 - 5 \frac{z^2}{r^2} \right) \end{align*} \end{split}\]where \(\boldsymbol{a}\) is the acceleration, \(\mu\) is the gravitational parameter, \(J_2\) is the second zonal harmonic, \(R_{eq}\) is the equatorial radius, and \(\boldsymbol{r} = [x, y, z]\) is the position vector.References
Vallado, 2013, pp.594.
Examples
>>> import jax.numpy as jnp >>> import astrodynx as adx >>> t = 0.0 >>> x = jnp.array([1.0, -1.0, 1.0, 0.0, 0.0, 0.0]) >>> args = {"mu": 1.0, "J2": 1e-3, "R_eq": 1.0} >>> expected = jnp.array([ 6.4150023e-05, -6.4150023e-05, -1.2830009e-04]) >>> actual = adx.gravity.j2_acc(t, x, args) >>> jnp.allclose(expected, actual) Array(True, dtype=bool)