1. MissionSequence#
- class MissionSequence(name: str)#
Bases:
objectRepresents a sequence of mission segments, including propagation legs and impulsive burns.
Manages the trajectory propagation structure, ensuring logical consistency between consecutive mission segments. Defines the order of events, maintains state vectors, handles epoch continuity, and enables dynamic modeling through an associated propagator.
- Parameters:
name (
str) – The name of the mission sequence.
Notes
The first leg must define the complete initial state.
Estimated impulsive burns must be followed by a “dv_man” parameter in the next leg.
The mission sequence structure ensures strict consistency in epochs and state transitions.
Examples
# initial setup import scarabaeus as scb # Initialize mission sequence mission = scb.MissionSequence(name="EMA123") # Define initial leg state_vec = scb.StateArray(...) # Initial state vector mission.addLeg(name="Outbound Leg", period=ArrayWUnits(86400, "s"), state_vector=state_vec, dt=ArrayWUnits(60, "s")) # Define and add impulsive burn dV = scb.ImpulsiveBurn(...) mission.addBurn(name="Midcourse Correction", dV=dV) # Define and add another leg next_leg = scb.StateArray(...) # State vector for second leg mission.addLeg(name="Final Approach", period=ArrayWUnits(43200, "s"), state_vector=next_leg, dt=ArrayWUnits(60, "s"))
Attributes
List of time step lengths used for integration in each segment.
List of EpochArray objects defining the timestamps associated with each mission phase.
Indices marking the last step of each segment within the overall timeline.
List of state models, representing either propagation states or impulsive maneuvers.
The name of the mission sequence.
List of names corresponding to each sequence segment.
Number of integration steps per leg, or None for impulsive burns.
List of origins for each leg in the sequence.
List of time durations for each leg in the sequence, or None for impulsive burns.
Primary propagated object for the whole sequence (must be consistent).
List of propagator models for each leg in the sequence.
List of the number of states in each leg, or None for impulsive burns.
List of segment types, such as
"Leg"(propagation phase) or"Impulsive Burn".Methods
addBurn(name, dV, prop)Adds an impulsive burn to the mission sequence.
addLeg(name, period, state_vector, prop[, ...])Adds a propagation leg to the mission sequence.
add_finite_burn(name, period, state_vector, prop)Add a finite burn maneuver to the mission sequence.
Checks mission sequence consistency (NaN-free version).
validate_impulsive_burn(name, dV, prop)Validates the parameters of an impulsive burn before adding it.
validate_leg(name, period, dt, state_vector, ...)Validate a propagation leg before adding it to the mission sequence.
- addBurn(name: str, dV: ImpulsiveBurn, prop: Propagator) None#
Adds an impulsive burn to the mission sequence.
Inserts an impulsive burn event, modifying the spacecraft’s velocity instantaneously. The burn is added between two propagation legs, and a corresponding velocity update (
dv_man) is introduced in the next leg.- Parameters:
name (
str) – The name of the impulsive burn.dV (
ImpulsiveBurn) – The impulsive burn model defining the velocity change.prop (
Propagator) – The propagator responsible for simulating the spacecraft dynamics.
- Return type:
- addLeg(name, period: ArrayWUnits, state_vector, prop: Propagator, dt: ArrayWUnits = None, epochs=None) None#
Adds a propagation leg to the mission sequence.
Defines a new segment (leg) in the mission sequence, where the spacecraft propagates under the specified dynamical model. The user must specify either a time step (dt) or a predefined list of epochs (epochs). The number of integration steps is computed accordingly.
- Parameters:
name (
str) – The name of the leg.period (
ArrayWUnits) – The total duration of the leg in seconds.state_vector (
StateArray) – The initial state of the spacecraft for the leg.prop (
Propagator) – The propagator responsible for simulating the spacecraft dynamics.dt (
ArrayWUnits, optional) – The time step used to discretize the propagation period. Required ifepochsis not provided. Defaults toNone.epochs (
EpochArray, optional) – Predefined epochs for the propagation instead of computing them usingperiodanddt. If provided,dtmust beNone. Defaults toNone.
- Return type:
- add_finite_burn(name, period, state_vector, prop: Propagator, dt=None, epochs=None) None#
Add a finite burn maneuver to the mission sequence.
- Parameters:
name (
str) – The name identifier for this finite burn maneuver.period (
Quantity) – The duration of the finite burn maneuver.state_vector (
object) – The state vector model defining the burn characteristics.prop (
Propagator) – The propagator to use for this maneuver. Must have the same primary body as other maneuvers in the sequence.dt (
Quantity, optional) – The time step for propagation. Either dt or epochs must be provided, but not both. Default is None.epochs (
EpochArray, optional) – Pre-computed epoch array for the maneuver. Either dt or epochs must be provided, but not both. Default is None.
- Return type:
- Raises:
Notes
This method appends the finite burn maneuver to the mission sequence and automatically computes the epoch vector if not provided. The method also performs sequence consistency checks if there are multiple maneuvers in the sequence.
- check_sequence_consistency() None#
Checks mission sequence consistency (NaN-free version).
Enforces: - epoch continuity between consecutive epochs_vec entries - relative ordering constraint: you can add/remove components but not reorder shared ones - dv_man exclusivity constraints
- validate_impulsive_burn(name: str, dV: ImpulsiveBurn, prop: Propagator) None#
Validates the parameters of an impulsive burn before adding it.
Ensures that the burn name is unique, follows a valid mission sequence structure, and conforms to expected data types.
- Parameters:
name (
str) – The name of the impulsive burn.dV (
ImpulsiveBurn) – The impulsive burn model.prop (
Propagator) – The propagator responsible for simulating the spacecraft dynamics.
- Return type:
- validate_leg(name: str, period: ArrayWUnits, dt: ArrayWUnits, state_vector: StateArray, prop: Propagator, epochs_vec: EpochArray = None) None#
Validate a propagation leg before adding it to the mission sequence.
NaN-free semantics: - For the first leg: epoch + full initial state must be defined. - For subsequent legs: epoch/pos/vel values are allowed but will be ignored by ScenarioSetup, which inherits values structurally from the previous leg (name/body/size match).
- property dts: list[ArrayWUnits] | None#
List of time step lengths used for integration in each segment.
- property epochs_vec: list[EpochArray]#
List of EpochArray objects defining the timestamps associated with each mission phase.
- property last_idx: list[int]#
Indices marking the last step of each segment within the overall timeline.
- property models: list[StateArray] | list[ImpulsiveBurn]#
List of state models, representing either propagation states or impulsive maneuvers.
- property num_steps: list[int] | None#
Number of integration steps per leg, or None for impulsive burns.
- property periods: list[ArrayWUnits] | list[None]#
List of time durations for each leg in the sequence, or None for impulsive burns.
- property primary_body#
Primary propagated object for the whole sequence (must be consistent).
- property props: list[Propagator] | None#
List of propagator models for each leg in the sequence.