astrodynx.prop.kepler#
- astrodynx.prop.kepler(ts, r0_vec, v0_vec, mu=1.0)[source]#
Kepler propagator for all conic orbits, based on generalized anomaly.
The propagator supports broadcasting for the time steps but not for the initial state vectors. It is possible to propagate a single orbit to multiple time steps, but it is not possible to propagate multiple orbits.
- Parameters:
- Return type:
- Returns:
The propagated state vector.
Notes
The Kepler propagator solves the universal Kepler’s equation
kepler_equ_uni()for each time step and then uses the Lagrange coefficients to propagate the state vector.References
Battin, 1999, pp.179.
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.0, 0.0]) >>> mu = 1.0 >>> ts = jnp.pi >>> r_vec,v_vec = adx.prop.kepler(ts, r0_vec, v0_vec, mu) >>> assert jnp.allclose(r_vec, jnp.array([-1.0, 0.0, 0.0]), atol=1e-6) >>> assert jnp.allclose(v_vec, jnp.array([0.0, -1.0, 0.0]), atol=1e-6)
With broadcasting:
>>> r0_vec = jnp.array([1.0, 0.0, 0.0]) >>> v0_vec = jnp.array([0.0, 1.0, 0.0]) >>> mu = 1.0 >>> ts = jnp.linspace(0, 2*jnp.pi, 12) >>> r_vec,v_vec = adx.prop.kepler(ts, r0_vec, v0_vec, mu) >>> assert r_vec.shape == (12, 3) >>> assert v_vec.shape == (12, 3)