Skip to main content

A compact, extensible rocket flight simulation framework for researchers and rocket designers

Project description

Logo

MAPLEAF: Modular Aerospace Prediction Lab for Engines and Aero Forces

6-DOF Rocket Flight Simulation Framework

Tests Linting Docs Coverage Python3 MIT License

Install:

pip install MAPLEAF

Usage:

Running a Simulation

mapleaf path/to/SimDefinitionFile.mapleaf

Example config files are in the ./MAPLEAF/Examples/Simulations folder

Simulation Definition Files

More info, and descriptions 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 segment of a Sim Definition file:

SimControl{
  timeDiscretization    RK45Adaptive

  TimeStepAdaptation{
    controller          PID
    PID.coefficients    -0.01 -0.001 0
    targetError         0.0001
  }
}

Code folding is very helpful in maintaining an overview of these files:

Folded Sim Definition

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 rocket component(s) in each stage:

Rocket Definition

Default values from the defaultConfigValues dictionary in MAPLEAF/IO/SimDefinition.py will fill in when keys are undefined. Default values mostly match those in the SimDefinitionTemplate.mapleaf file.

Simulation Outputs

Depending on the options specified in the SimControl dictionary, MAPLEAF simulations can output:

  • Detailed tabulated simulation position, component force, aerodynamic coefficient and control logs (see SimControl.loggingLevel): Sample section of log file

  • Flight animations (see SimControl.plot)
    Flight Animation

  • Flight path visualizations (see SimControl.plot)
    Earth Orbit Flight Paths

  • Plots of any logged parameter (see SimControl.plot)
    Plotting from logs

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:

Monte Carlo Parameter

To execute a batch run of this now-probabilistic simulation, create the top-level 'Monte Carlo' dictionary (see SimDefinitionTemplate.mapleaf)

From that, you can obtain distributions of outputs like flight paths or landing locations:

Flight Paths Plot Landing Location Plot

Developers

To extend MAPLEAF, re-use its libraries or otherwise work with the code, have a look at README_Dev.md the code/api documentation website

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MAPLEAF-0.8.1.tar.gz (21.0 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page