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_runsindependent simulation configurations by applying optional per-run sampling rules fromMCConfig, then executes each run viaMonteCarloRunner. Each run simulates spacecraft attitude dynamics, sensors, estimation, and control, while optionally sampling initial conditions and run parameters such asdt,tf, angular rate, quaternion, reaction wheel momentum, goals, and orbit overrides.Orbit handling supports two modes:
Mode
Description
os0
Propagate an
Orbital_Stateforward usingOrbit.seq
Use a precomputed orbital-state sequence (for example from an
Orbitoverride 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_lenand is expected to follow the satellite state convention (angular velocity, quaternion, reaction wheel states, etc.). Per-run overrides may be applied bymc_config.satellite (
Satellite) – The true satellite model, including dynamics, sensors, and actuators. This object must be picklable for parallel execution.est_satellite (
EstimatedSatelliteor None) – Estimated satellite model used by estimators and controllers. IfNone, 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 (
Controlleror None) – Control law used to compute actuator commands. If the controller is aPlanAndTrackBase, 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_Estimatoror None) – Attitude estimator used to estimate spacecraft state from sensor measurements. If provided, it must be picklable.orbit_estimator (
Orbit_Estimatoror 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 beNone(no goal), a singleGoal, or aGoalListdefining time-varying goals. Per-run overrides may be applied bymc_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 (
MCConfigor None) – Monte Carlo configuration describing run-to-run sampling rules for selected parameters, such asdt,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: