1. MissionSequence#

class MissionSequence(name: str)#

Bases: object

Represents 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

dts

List of time step lengths used for integration in each segment.

epochs_vec

List of EpochArray objects defining the timestamps associated with each mission phase.

last_idx

Indices marking the last step of each segment within the overall timeline.

models

List of state models, representing either propagation states or impulsive maneuvers.

name

The name of the mission sequence.

names

List of names corresponding to each sequence segment.

num_steps

Number of integration steps per leg, or None for impulsive burns.

origins

List of origins for each leg in the sequence.

periods

List of time durations for each leg in the sequence, or None for impulsive burns.

primary_body

Primary propagated object for the whole sequence (must be consistent).

props

List of propagator models for each leg in the sequence.

states_n

List of the number of states in each leg, or None for impulsive burns.

types

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.

check_sequence_consistency()

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:

None

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 if epochs is not provided. Defaults to None.

  • epochs (EpochArray, optional) – Predefined epochs for the propagation instead of computing them using period and dt. If provided, dt must be None. Defaults to None.

Return type:

None

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:

None

Raises:
  • Exception – If neither dt nor epochs is provided.

  • Exception – If both dt and epochs are provided.

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:

None

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 name: str#

The name of the mission sequence.

property names: list[str]#

List of names corresponding to each sequence segment.

property num_steps: list[int] | None#

Number of integration steps per leg, or None for impulsive burns.

property origins: list[int] | None#

List of origins for each leg in the sequence.

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.

property states_n: list[int] | None#

List of the number of states in each leg, or None for impulsive burns.

property types: list[str]#

List of segment types, such as "Leg" (propagation phase) or "Impulsive Burn".