astrodynx.prop.to_final#
- astrodynx.prop.to_final(orbdyn, x0, t1, solver=Tsit5(), stepsize_controller=PIDController(rtol=1e-08, atol=1e-08))[source]#
Propagate orbital state using Cowell’s method to final time only.
This function solves the orbital dynamics differential equation and returns only the final state at time t1. It’s the most memory-efficient option when intermediate trajectory points are not needed, such as for state transition matrix calculations or endpoint optimization problems.
- Parameters:
orbdyn (
OrbDynx) – Orbital dynamics configuration containing the differential equation terms, static arguments, and optional events.x0 (
ArrayLike) – (6,)Initial state vector [x, y, z, vx, vy, vz] in canonical units. Position components are in distance units, velocity components are in distance/time units.t1 (
DTypeLike) – Final integration time in canonical time units. Must be positive for forward propagation.solver (
AbstractSolver) – Numerical integration method. Defaults to diffeq.Tsit5() (5th-order Runge-Kutta method).stepsize_controller (
AbstractStepSizeController) – Adaptive step size controller.
- Return type:
- Returns:
- Integration solution containing
ts: Single-element array containing only t1
ys: Single state vector at the final time t1
stats: Integration statistics from the adaptive stepping
result: Integration termination status
Notes
This function is optimized for memory efficiency by saving only the final state. It uses adaptive step size control internally but discards all intermediate results, making it ideal for:
State transition matrix computations
Optimization problems requiring only final states
Monte Carlo simulations with many trajectories
Sensitivity analysis using automatic differentiation
The maximum number of steps is limited to 4096 to prevent runaway computations while still allowing for complex orbital dynamics.
Examples
Simple state propagation to final time:
>>> import jax.numpy as jnp >>> from astrodynx import diffeq >>> import astrodynx as adx >>> def vector_field(t, x, args): ... acc = adx.gravity.point_mass_grav(t, x, args) ... return jnp.concatenate([x[3:], acc]) >>> orbdyn = adx.prop.OrbDynx( ... terms=diffeq.ODETerm(vector_field), ... args={"mu": 1.0} ... ) >>> x0 = jnp.array([1.0, 0.0, 0.0, 0.0, 1.0, 0.0]) >>> t1 = jnp.pi*2 # One orbital period >>> sol = adx.prop.to_final(orbdyn, x0, t1)