A compact, extensible rocket flight simulation framework for researchers and rocket designers
Project description
MAPLEAF: Modular Aerospace Prediction Lab for Engines and Aero Forces
Install:
pip install MAPLEAF
Running a Simulation
$ mapleaf path/to/SimDefinitionFile.mapleaf
Sample simulation definitions: MAPLEAF/Examples/Simulations
Example cases be run with just the case name: $ mapleaf NASATwoStageOrbitalRocket
This is the same as running: $ mapleaf MAPLEAF/Examples/Simulations/NASATwoStageOrbitalRocket.mapleaf
from MAPLEAF's install location
Simulation Definition Files
Brief overview below. More info, and definitions of all possible options in: SimDefinitionTemplate.mapleaf
Format is a simple key-value syntax similar to JSON or YAML.
Dictionaries can be nested arbitrarily deeply and are brace-delimited.
Keys and values in a dictionary are separated by the first whitespace in their line
No multiline values
Example:
SimControl{
timeDiscretization RK45Adaptive
TimeStepAdaptation{
controller PID
PID.coefficients -0.01 -0.001 0
targetError 0.0001
}
}
Code folding is very helpful in maintaining a file overview:
The possible top level dictionaries are 'Monte Carlo', 'SimControl', 'Environment', and 'Rocket'.
Of these, only the 'Rocket' dictionary is strictly required to run a simulation, and defines the rocket's initial position/velocity and the inertial/aerodynamic/control models used to simulate it.
The rocket is defined by nested subdictionaries, where the first level of nesting defines the rocket's stage(s) and the second level defines the component(s) in each stage:
Default values from the defaultConfigValues dictionary in MAPLEAF/IO/SimDefinition.py will fill in for omitted keys. Most defaults match the values in SimDefinitionTemplate.mapleaf.
Simulation Outputs
Depending on the options specified in the SimControl
dictionary, MAPLEAF will output:
-
Detailed tabulated simulation position, component force, aerodynamic coefficient and control logs (see SimControl.loggingLevel):
-
Flight animations (see SimControl.plot)
-
Flight path visualizations (see SimControl.plot - Mayavi is required to render these ones showing the Earth)
-
Plots of any logged parameter (see SimControl.plot or --plotFromLog command line option)
Monte Carlo Simulations
Monte Carlo simulations propagate uncertainties in simulation inputs through to simulation outputs.
Any scalar or vector parameter in simulation definition files can be made probabilistic by adding a second parameter with _stdDev
appended to the name:
To execute a batch run of this now-probabilistic simulation, create the top-level 'Monte Carlo' dictionary (see SimDefinitionTemplate.mapleaf)
Then, MAPLEAF can produce distributions of outputs like landing locations:
Developers
Contributions are welcome. To learn about the code, have a look at README_Dev.md, and the code/api documentation website
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.