Skip to main content

Python package for rocket flight simulation.

Project description

PreflightPy

PyPI GitHub

Coverage Status Build Status

Gitmoji Documentation Status

Python module for Simulation and Optimization of Rocket Trajectories, SORT for short.

  • Altitude prediction
  • State prediction
  • Flight trajectory optimization
  • Flight plan optimization

Quick Start :vertical_traffic_light:

Before we get started, please note that PreflightPy was built with Python 3.x in mind and might not be compatible with older versions.

Installation

Getting yourself your very own copy of this module is super simple! You can get Preflight from pip using your terminal via the following command:

pip install preflight

That's it you're set!

Usage

Here's an example of typical usage of this package:

# Importing the module
import preflightpy as pre

# The 'Parameters' class collects info about the rocket and environmental conditions etc. from the input file.
params = pre.Parameters("path/to/input/file.json")  

#  The 'Environment' takes care of computing conditions (e.g. atmosphere, gravity) at various altitudes.
env = pre.Environment(p.env_variables)

# Specify the burn time of your engine in seconds.
burn_time = 10

# The 'System', the core of this module, it takes care of the main simulation and output.
s = pre.System(params, env, 10)  

s.launch()  # Blast off! Launches the simulation.

# The results are outputted in .csv and .log formats and are located in the output folder specified by input file

The following is the format you'll have to use in your .json input files:

{
  "Engine" : {
    "Specific Impulse (s)" : 318,  
    "Thrust (N)" : 500  
  },
  "Fuel" : {
    "Oxidizer/Fuel Mixture Ratio" : 15,  
    "Fuel Reserve (%)" : 5  
  },
  "Mass" : {
    "Dry Mass (kg)" : 10  
  },
  "Aerodynamics" : {
    "Drag Coefficient" : 0.0556,  
    "Cross-section (m2)" : 0.0255364  
  },
  "Environment" : {
    "Elevation (m)" : 113,
    "Simulation step (s)" : 0.01,
    "Standard gravity (m/s2)" : 9.80665,
    "Air molar mass (kg/mol)" : 0.02896968,
    "Gas constant (J/(K.mol))" : 8.314462618,
    "Air heat capacity ratio" : 1.4,
    "Standard Atmospheric pressure @SL (Pa)" : 101325
  },
  "Output" : {
    "Log File Path" : "Flight.log",  
    "CSV File Path" : "Flight.csv"  
  }
}

Documentation :pencil:

Visit our documentation to learn how to use PreflightPy in depth.

Contribuitng :earth_americas:

If you want to contribute to this project, this set of instructions will get a copy up and running on your local machine for development and testing purposes! Once you're done, check out our contribution guidelines before you get started.

Installation

To get a copy of the repository you'll have to clone it. Through the command line, get to the directory you wish to clone the repository into then run the following command.

git clone https://github.com/Oxyde2/Preflight.git

Prerequisites

We're almost done, next step is to fetch our dependencies. To install the required python modules just run the following command in the command line at the root of the repository folder.

pip install -r requirements.txt

Conclusion

Congratulations, you have successfully obtained your local copy and the dependencies! Now open the project folder in your desired IDE or text editor and get crackin'!

Built With :construction_worker:

Versioning :bookmark:

The versioning is formatted to Semantic Versioning 2.0.0 standards. SemVer. The changelog format is based on Keep a Changelog For available versions, see the releases of this project.

Authors :floppy_disk:

  • Maxime Djomby - Initial work - Oxyde2

License :page_with_curl:

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details

Acknowledgments :trumpet:

Early development of Preflight was supported by Mix_42. The website Rocket & Space Technology, written by Robert A. Braeunig, was used for pressure, density and temperature formulas for the atmospheric model.

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

preflightpy-0.6.2.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

preflightpy-0.6.2-py3-none-any.whl (23.1 kB view hashes)

Uploaded Python 3

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