astrodynx.prop.fixed_steps#
- astrodynx.prop.fixed_steps(orbdyn, x0, t1, dt, max_steps=4096, solver=Tsit5())[source]#
Propagate orbital state using Cowell’s method with fixed step sizes.
This function solves the orbital dynamics differential equation using a constant step size integrator. It’s suitable for scenarios where uniform time sampling is required or when computational efficiency is prioritized over adaptive error control.
- 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.dt (
DTypeLike) – Fixed time step size for integration in canonical time units. Smaller values increase accuracy but require more computational time.max_steps (
int) – Maximum number of integration steps before terminating unconditionally. Prevents infinite loops in case of integration issues. Defaults to 4096.solver (
AbstractSolver) – Numerical integration method. Defaults to diffeq.Tsit5() (5th-order Runge-Kutta method).
- Return type:
- Returns:
- Integration solution containing
ts: Array of time points where solution was saved
ys: Array of state vectors at each time point
stats: Integration statistics and diagnostics
result: Integration termination status
Notes
This function uses a constant step size controller, which means the integrator will take exactly dt-sized steps regardless of local error. This can be more efficient than adaptive methods but may sacrifice accuracy in regions where the dynamics change rapidly.
The solution is saved at the initial time (t0=True) and at every integration step (steps=True), providing a complete trajectory.
Examples
Basic orbital propagation with fixed steps:
>>> 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 >>> dt = 0.01 # Fixed step size >>> sol = adx.prop.fixed_steps(orbdyn, x0, t1, dt)