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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file preflightpy-0.6.2.tar.gz.

File metadata

  • Download URL: preflightpy-0.6.2.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for preflightpy-0.6.2.tar.gz
Algorithm Hash digest
SHA256 0723aec34217114eb3e292f115377d06d39d9c7c7a0b7be96948c9350374bc99
MD5 ca7efc3dea25e936dbaee0a4540cf2a1
BLAKE2b-256 fcd12c3c858769f67e00583f9048720998297ae4177f001585d50853ed4818c8

See more details on using hashes here.

File details

Details for the file preflightpy-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: preflightpy-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for preflightpy-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8e5e6ee0e8aa36451374328ab5d0c58228589fb0409c0acc36bedd5e3ac998
MD5 8777fd569d84cd0985fba163b45dc33e
BLAKE2b-256 9dac1f893a33ad31315f675a0f8dc20e8c73c84f60165e95b47c4f19d0f8c93f

See more details on using hashes here.

Supported by

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