ADCS.mc.simulate_mc module

ADCS.mc.simulate_mc.simulate_mc(x, satellite, est_satellite=None, controller=None, estimator=None, orbit_estimator=None, goal=None, os0=None, dt=1.0, tf=500.0, mc_config=None, num_runs=100, max_workers=None, base_seed=0)[source]

Run a Monte Carlo ensemble of ADCS simulations using parallel workers.

This function generates num_runs independent simulation configurations by applying optional per-run sampling rules from MCConfig, then executes each run via MonteCarloRunner. Each run simulates spacecraft attitude dynamics, sensors, estimation, and control, while optionally sampling initial conditions and run parameters such as dt, tf, angular rate, quaternion, reaction wheel momentum, goals, and orbit overrides.

Orbit handling supports two modes:

Mode

Description

os0

Propagate an Orbital_State forward using Orbit.

seq

Use a precomputed orbital-state sequence (for example from an Orbit override or an explicit list).

For multiprocessing compatibility, all provided models (satellite, controller, estimators, goal objects) must be picklable.

Parameters:
  • x (numpy.ndarray) – Base initial true satellite state vector. The length must match satellite.state_len and is expected to follow the satellite state convention (angular velocity, quaternion, reaction wheel states, etc.). Per-run overrides may be applied by mc_config.

  • satellite (Satellite) – The true satellite model, including dynamics, sensors, and actuators. This object must be picklable for parallel execution.

  • est_satellite (EstimatedSatellite or None) – Estimated satellite model used by estimators and controllers. If None, it may be constructed internally on a per-run basis when required by the provided estimator or controller. If provided, it must be picklable.

  • controller (Controller or None) – Control law used to compute actuator commands. If the controller is a PlanAndTrackBase, an initial trajectory is computed at the start of each run based on the run-specific initial conditions and goals. If provided, it must be picklable.

  • estimator (Attitude_Estimator or None) – Attitude estimator used to estimate spacecraft state from sensor measurements. If provided, it must be picklable.

  • orbit_estimator (Orbit_Estimator or None) – Orbit estimator used to estimate orbital state from GPS measurements. If provided, it must be picklable.

  • goal (Goal, GoalList, or None) – Desired attitude or pointing objective. This may be None (no goal), a single Goal, or a GoalList defining time-varying goals. Per-run overrides may be applied by mc_config. If provided, it must be picklable.

  • os0 (Orbital_State) – Initial orbital state at the start of the Monte Carlo campaign. This must be provided and is used as the base orbit for propagation in runs that do not override the orbit.

  • dt (float) – Base simulation time step in seconds. Per-run overrides may be applied by mc_config.

  • tf (float) – Base simulation duration in seconds. Per-run overrides may be applied by mc_config.

  • mc_config (MCConfig or None) – Monte Carlo configuration describing run-to-run sampling rules for selected parameters, such as dt, tf, initial angular velocity, quaternion, reaction wheel momentum, goal selection, and orbit overrides.

  • num_runs (int) – Number of Monte Carlo runs to execute.

  • max_workers (int or None) – Maximum number of worker processes to use. If None, the runner chooses an implementation-defined default.

  • base_seed (int) – Base seed used to deterministically generate per-run seeds as base_seed + run_id.

Returns:

Aggregated results for all completed runs, including a list of per-run RunResults, optional per-run configuration summaries, and run identifiers.

Return type:

SimulationResults