ScenarioSetup#
- class ScenarioSetup(mission_sequence: MissionSequence, map_STM_to_t0: bool = False)#
Bases:
objectExecutes a
MissionSequenceleg by leg and assembles the full propagated trajectory.ScenarioSetupdrives the numerical propagation of aMissionSequence: it iterates over every leg and node in order, propagates each leg with its ownPropagator(which may carry a different force model, reference frame, or origin than adjacent legs), applies any impulsive burn at node boundaries, and concatenates the per-leg outputs into a unified state and STM history.For a sequence of \(L\) legs each leg \(\ell\) produces a local STM \(\boldsymbol{\Phi}_\ell(t_\ell^f, t_\ell^0)\). When
map_STM_to_t0=Truethe STM is accumulated across nodes:\[\boldsymbol{\Phi}(t_L, t_0) = \boldsymbol{\Phi}_L \cdots \boldsymbol{\Phi}_2 \boldsymbol{\Phi}_1\]so that it always represents sensitivity with respect to the global initial state \(\mathbf{x}(t_0)\). When
map_STM_to_t0=False(default) the STM is reset to the identity at each node.- Parameters:
mission_sequence (
MissionSequence) – The mission sequence containing legs, burns, and associated state vectors.map_STM_to_t0 (
bool, optional) – Whether to map the STM (State Transition Matrix) to the initial state. Defaults toFalse.
See also
scarabaeus.Propagatorthe propagator that ScenarioSetup interacts with.
Notes
The
ScenarioSetupclass is designed to be compatible with thePropagatorclass. Any updates to propagation functionality should be reflected here.Enforces mission constraints such as maximum numbers of legs and impulsive burns.
- Attributes:
STMThe total concatenated STM history.
atolThe absolute tolerance for numerical integration.
delta_vThe last computed impulsive delta-v, if applicable.
full_state_vectorFull scenario state vector, spanning the union of all legs.
len_sequenceThe total number of elements (legs + burns) in the mission sequence.
map_STM_to_t0Indicates whether the STM should be mapped to the initial time.
mission_sequenceThe mission sequence associated with this scenario.
originThe origin body for the scenario.
primary_bodyThe primary body for the scenario.
propagated_state_arrayState array covering the full propagated mission (all legs combined).
propagatorInternal propagator for the current segment.
rtolThe relative tolerance for numerical integration.
segment_STMsMaps segment names to STM arrays.
segment_epochsTDBMaps segment names to epoch arrays.
segment_parametersMaps segment names to parameter arrays.
segment_positionsMaps segment names to position arrays.
segment_velocitiesMaps segment names to velocity arrays.
total_componentsGet the total components dictionary.
total_epochsTDBEpoch array covering the full propagated mission in TDB seconds.
total_parametersThe total set of propagated parameters.
total_positionPosition history of the primary body over the full mission (all legs combined).
total_velocityVelocity history of the primary body over the full mission (all legs combined).
Methods
propagate([verbose])Executes the propagation of the mission sequence through all defined legs and impulsive burns.
- propagate(verbose: bool = True) None#
Executes the propagation of the mission sequence through all defined legs and impulsive burns.
This version uses a SCENARIO-GLOBAL state vector (union of all components across all legs) as the single source of truth for initial conditions and continuity across segments.
Key behaviors: - For each Leg/Finite Burn:
build leg->global mapping
extract leg IC from global vector
apply any pending impulsive burn to BOTH (global and leg IC) consistently
propagate
update global vector from terminal propagated state
- For each Impulsive Burn:
snapshot segment outputs
store pending dv to be applied at next leg
(global velocity is updated at the next leg, using that leg’s velocity key)
- Parameters:
verbose (
bool, optional) – WhenTrue(default), print segment progress and initial-condition summaries to stdout during propagation. Set toFalseto silence all output.
- property delta_v: ArrayWUnits | None#
The last computed impulsive delta-v, if applicable.
- property full_state_vector: StateArray#
Full scenario state vector, spanning the union of all legs.
- property map_STM_to_t0: bool#
Indicates whether the STM should be mapped to the initial time.
Trueif the STM is mapped to the initial state, otherwiseFalse.
- property mission_sequence: MissionSequence#
The mission sequence associated with this scenario.
- property propagated_state_array: StateArray#
State array covering the full propagated mission (all legs combined).
After calling
propagate(), this returns aStateArraywhose epoch spans from the start of the first leg to the end of the last leg, with the full time-history of position, velocity, and any other dynamic state components accumulated across all legs.If
propagate()has not been called yet, falls back to the last-leg only result with a warning.
- property propagator: Propagator#
Internal propagator for the current segment. Not intended for external use — its value changes at each segment during
propagate().
- property total_epochsTDB: EpochArray | None#
Epoch array covering the full propagated mission in TDB seconds.
- property total_parameters: list[ArrayWUnits]#
The total set of propagated parameters.
- property total_position: ArrayWFrame | None#
Position history of the primary body over the full mission (all legs combined).
- property total_velocity: ArrayWFrame | None#
Velocity history of the primary body over the full mission (all legs combined).