Propagator#
- class Propagator(primary_body: Spacecraft, state_vector: StateArray, tspan: EpochArray | Tuple[EpochArray, EpochArray], force_models: ForceModel | Sequence[ForceModel], base_frame: Frame | None = None, atol: float = 2.220446049250313e-14, rtol: float = 2.220446049250313e-14, integrator: Literal['DOP853', 'IAS15'] = 'DOP853', propagate_STM: bool = True, STM0=None, look_event: str | None = None, convert_to_original_frame: bool = False, mass_is_variable: bool = False, display_progress: bool = True, copy_force_models: bool = True, backward: bool = False)#
Bases:
objectScarabaeus interface to numerical propagation.
This class integrates the equations of motion for a given state \(\mathbf{x}\) over a specified timespan:
\[\begin{split}\dot{\mathbf{x}} = \mathbf{f}(\mathbf{x}, t), \qquad \mathbf{x} = \begin{bmatrix} \mathbf{r} \\ \dot{\mathbf{r}} \\ \mathbf{p} \end{bmatrix}\end{split}\]where \(\mathbf{r}\) is position, \(\dot{\mathbf{r}}\) is velocity, and \(\mathbf{p}\) are dynamic/static parameters. When
propagate_STM=Truethe State Transition Matrix \(\boldsymbol{\Phi}\) is propagated alongside the state via the variational equation:\[\dot{\boldsymbol{\Phi}}(t, t_0) = \mathbf{A}(t)\,\boldsymbol{\Phi}(t, t_0), \qquad \boldsymbol{\Phi}(t_0, t_0) = \mathbf{I}\]where \(\mathbf{A}(t) = \partial\mathbf{f}/\partial\mathbf{x}\) is the Jacobian of the dynamics.
- Parameters:
primary_body (
Spacecraft) – Nominal “primary” object associated with the propagated state. Used for convenience and compatibility; individual force models may internally act on different objects or subsets of the state.state_vector (
StateArray) – Initial state (position/velocity + parameters) atepoch = state_vector.epoch.tspan (
EpochArrayortupleoftwo EpochArrays) – Times at which the solution is requested. If given an EpochArray, solution will be computed at each time step. If given a tuple of two EpochArrays, solution will computed at time steps determined by the selected integrator.force_models (
ForceModelorlist[ForceModel]) – One or more pre-configured force model instances. Each will be initialized with the givenstate_vectorandbase_frame. This argument is required in the current interface.base_frame (
Frame, optional) – Frame in which dynamics are evaluated. Defaults to J2000 ifNone.atol (
float, optional) – Absolute/relative tolerances for the numerical integrator.rtol (
float, optional) – Absolute/relative tolerances for the numerical integrator.integrator (
str, optional) – Integration scheme identifier (e.g."DOP853").propagate_STM (
bool, optional) – If True, propagate the state transition matrix.STM0 (
np.ndarray, optional) – Initial STM. If None, identity is used.look_event (
str, optional) – Placeholder for event handling (WIP).convert_to_original_frame (
bool, optional) – If True, map results back to the original state frame after propagation.mass_is_variable (
bool, optional) – If True, treat mass as a dynamic state (used with thrust models).display_progress (
bool, optional) – If True, displays integration progress bar in the terminal. Defaults toTrue.copy_force_models (
bool, optional) – If True, creates deep copies of the provided force models to avoid side effects.
Notes
Typical usage sequence:
Construct a
StateArray(viaStateDefinition).Construct one or more
ForceModelinstances (e.g.ForceModelTranslation) configured for the relevant objects.Pass the model(s) to
Propagator, which will bind them to the provided state and frame viainitialize_force_models.
force_modelsmay be a single instance or a list, enabling multi-object or multi-model configurations.- Each provided force model must implement:
initialize_force_models(state_vector, base_frame, t0)dynamics_mode_list(property)the appropriate acceleration/partial APIs used by the propagator.
See also
scarabaeus.StateArrayState vector consumed and produced by the propagator.
scarabaeus.ForceModelTranslationTranslational force model aggregator.
scarabaeus.ScenarioSetupMulti-leg propagation driver that wraps Propagator.
scarabaeus.MissionSequenceOrdered container of legs passed to ScenarioSetup.
- Attributes:
AsDynamic Matrices of the propagated state.
STMState Transition Matrix array corresponding to the propagated solution.
STM0The initial State Transition Matrix (STM).
STM_frameThe frame ratios of the State Transition Matrix (STM).
STM_unitsThe units of the State Transition Matrix (STM).
atolAbsolute tolerance for numerical integration.
backwardWhether the propagation runs backward in time.
base_frameThe base reference frame for propagation.
dynamics_mode_listList of active dynamics modes during propagation.
force_modelsForce model used for propagation.
full_state_vectorThe state vector associated with the propagation.
full_state_vector_original_framesThe state vector not associated with the propagation, but with the original frames.
integrationEtsEpoch array (TDB seconds) corresponding to each integrator output step.
integrationYsRaw numerical integration output (states + flattened STM rows).
integratorThe numerical integrator used for propagation.
look_eventThe event type for the propagator.
mass_profileMass profile of the spacecraft.
primary_bodyThe primary celestial body for the propagator.
prop_originThe origin body in the reference frame.
propagate_STMIndicates whether the State Transition Matrix (STM) is propagated.
propagated_state_arrayState array corresponding to the propagated solution.
propagated_state_array_original_frameThe state vector not associated propagated, but with the original frames.
rtolRelative tolerance for numerical integration.
stateState array corresponding to the propagated solution.
state_framesThe frames of the State.
state_unitsThe units of the State .
t0The initial epoch for propagation.
timesTime array corresponding to the propagated solution.
tspanThe time span over which propagation occurs.
tspan_original_frameThe time span over which propagation occurs in the original frame.
ysNumerical solution of the propagated state.
Methods
from_dict(data)Reconstruct a Propagator instance from a dictionary produced by
to_dict.ode(epoch, Y)Compute the time derivative of the state and STM for numerical integration.
propagate([display_progress])Propagates the state of the system using numerical integration.
reinitialize([primary_body, state_vector, ...])Reconfigure the propagator with updated inputs and rebuild its internal state.
to_dict()Serialize the Propagator configuration to a dictionary.
- classmethod from_dict(data: dict) Propagator#
Reconstruct a Propagator instance from a dictionary produced by
to_dict.This expects that each serialized force model entry provides enough information (via “class” and “config”) to reconstruct the corresponding
ForceModelsubclass.- Parameters:
data (
dict) – Serialized propagator configuration.- Returns:
A new Propagator instance with reconstructed state, time span, and force models.
- Return type:
- ode(epoch: float, Y: ndarray) ndarray#
Compute the time derivative of the state and STM for numerical integration.
Y layout: [y_reduced, vec(Phi_full)]. All static loop structure is precomputed in _precompute_ode_cache().
- propagate(display_progress: bool | None = None) None#
Propagates the state of the system using numerical integration.
This method integrates the ordinary differential equations (ODEs) that describe the system’s dynamics using the specified integration method. The integration is performed over the time span defined by the initial and final times of the system’s time vector.
- Return type:
- reinitialize(primary_body: Body | None = None, state_vector: StateArray | None = None, tspan: EpochArray | None = None, atol: float | None = None, rtol: float | None = None, integrator: str | None = None, propagate_STM: bool | None = None, STM0: ndarray | None = None, look_event: str | None = None, base_frame: Frame | None = None, convert_to_original_frame: bool | None = None, maneuver: Maneuver = None, force_models: ForceModel | Sequence[ForceModel] | None = None, backward: bool | None = None) Propagator#
Reconfigure the propagator with updated inputs and rebuild its internal state.
Any argument left as
Noneis left unchanged.- Parameters:
primary_body (
Body, optional) – Updated primary propagated object.state_vector (
StateArray, optional) – Updated initial state. If provided, internal copies and t0 are updated.tspan (
EpochArray, optional) – Updated propagation timespan. Converted to TDB internally if needed.atol (
float, optional) – Updated absolute / relative tolerances.rtol (
float, optional) – Updated absolute / relative tolerances.integrator (
str, optional) – Updated integrator identifier.propagate_STM (
bool, optional) – Whether to propagate the STM.STM0 (
np.ndarray, optional) – Updated initial STM (flattened or matrix); reshaped internally.look_event (
str, optional) – Updated event specification (WIP hook).base_frame (
Frame, optional) – Updated base frame for propagation.convert_to_original_frame (
bool, optional) – Updated flag to map results back to original frame after propagation.maneuver (
Maneuver, optional) – Updated maneuver model; propagated into compatible force models.force_model (
ForceModelorsequenceofForceModel, optional) – Replace the current force model set with the provided one(s). Each will be re-initialized against the (possibly updated) state.
- Returns:
The updated propagator instance (for chaining).
- Return type:
- to_dict() dict#
Serialize the Propagator configuration to a dictionary.
Notes
The state and tspan are stored in their original frames as provided at construction time.
All attached force models are serialized via their own
to_dictmethod if available; otherwise only their class name is stored.
- property STM: ArrayWFrame | None#
State Transition Matrix array corresponding to the propagated solution.
- Base:
Propagator
- Type:
np.ndarray
- property STM0: ndarray#
The initial State Transition Matrix (STM).
- Base:
Propagator
- Type:
np.ndarray
- property STM_frame: ndarray | None#
The frame ratios of the State Transition Matrix (STM).
- Base:
Propagator
- Type:
np.ndarray
- property STM_units: ndarray | None#
The units of the State Transition Matrix (STM).
- Base:
Propagator
- Type:
np.ndarray
- property force_models: list[ForceModel]#
Force model used for propagation.
- Base:
Propagator
- Type:
scb.ForceModel
- property full_state_vector: StateArray#
The state vector associated with the propagation.
- Base:
Propagator
- Type:
scb.StateArray
- property full_state_vector_original_frames: StateArray#
The state vector not associated with the propagation, but with the original frames.
- Base:
Propagator
- Type:
scb.StateArray
- property integrationEts: ndarray | None#
Epoch array (TDB seconds) corresponding to each integrator output step.
- property integrationYs: ndarray | None#
Raw numerical integration output (states + flattened STM rows).
- property primary_body: Spacecraft#
The primary celestial body for the propagator.
- Base:
Propagator
- Type:
scb.Body
- property propagate_STM: bool#
Indicates whether the State Transition Matrix (STM) is propagated.
- Base:
Propagator
- Type:
- property propagated_state_array: StateArray#
State array corresponding to the propagated solution.
- Base:
Propagator
- Type:
np.ndarray
- property propagated_state_array_original_frame: StateArray | list#
The state vector not associated propagated, but with the original frames.
- Base:
Propagator
- Type:
scb.StateArray
- property state: ndarray | None#
State array corresponding to the propagated solution.
- Base:
Propagator
- Type:
np.ndarray
- property t0: EpochArray#
The initial epoch for propagation.
- Base:
Propagator
- Type:
scb.EpochArray
- property times: ndarray#
Time array corresponding to the propagated solution.
- Base:
Propagator
- Type:
np.ndarray
- property tspan: EpochArray | tuple#
The time span over which propagation occurs.
- Base:
Propagator
- Type:
EpochArray | Tuple[EpochArray, EpochArray]
- property tspan_original_frame: EpochArray#
The time span over which propagation occurs in the original frame.
- Base:
Propagator
- Type:
scb.EpochArray