Skip to content
Spacecraft atmospheric entry simulations using Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Python Reentry Simulations

This is the python codes I use to simulate spacecraft reentries. Requires Python 3 & Matplotlib.


The script is very basic at the moment. Run data are defined in a .json file. At the moment, only Earth and Mars are valid planets, but more could be added fairly easily in the script.

    "craft": {
        "name": "MSL",
        "ballistic_coef": 146,
        "lift_drag": 0.24
    "planet": "Mars",
    "sim": {
        "max_it": 1000000,
        "delta_t": 0.1,
        "entry_interface": 135e3,
        "fpa": -15.5,
        "velocity": 5.6e3,
        "stop_alt": 0

Once you have a run file, just call the script on it and it'll generate your plots

$ ./ msl.json
$ ls



The program solves the newtonian equations of motion and computes the trajectory of the reentering spacecraft using the forces applied to it (gravity, aerodynamic drag & lift) using a very basic Euler integrator. You can read more about that on the blog post.

The atmospheres are modelled using the scale height method. It's simplistic and could benefit from better models (NASA Standard Atmosphere, maybe even Mars GRAM and co.) but the gains are likely to be dwarfed by errors induced by the simple assumptions made everywhere (constant lift-drag ratio, constant drag coefficient…)

You can’t perform that action at this time.