Giter VIP home page Giter VIP logo

cuspaceflight / campyros Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 5.0 38.42 MB

CamPyRoS (Cambridge Python Rocketry Simulator) is a Python package which provides fully featured rocket trajectory simulation

Home Page: https://campyros.readthedocs.io/

License: GNU General Public License v3.0

Python 10.04% Jupyter Notebook 89.96%
rockets wind trajectory trajectory-prediction stochastic-analysis aerodynamics heating

campyros's Introduction

CamPyRoS - A 6DOF Rocket Trajectory Simulator

DOI Code style: blackTesting

CamPyRoS (Cambridge Python Rocketry Simulator) is a Python package which provides fully featured rocket trajectory simulation including features like:

  • 6 degrees of freedom (3 translational, 3 rotational)
  • Monte Carlo stochastic analysis
  • Aerodynamic heating model
  • Use of live wind data
  • Variable mass and moments of inertia models

Getting started

Currently not all dependancies are supported by the same install methods so the easiest install doesn't contain the full functionality. To install the core library:

pip install git+https://github.com/cuspaceflight/CamPyRoS.git

Statistics has a dependancy not fully supported by windows, to install it:

pip install ray on most platforms, for Windows problems see here.

If you don't install this the statistics module will run but only single threaded which will be extremely slow.

Usage

The repository contains some examples you can run:

  • example.ipynb or example.py : Launch of a simple rocket (the Martlet 4).
  • Stats Model Example.ipynb : Example of how to use the statistics model and stochastic analysis.
  • Aerodynamic Heating Example.ipynb : Example of how to run an aerodynamic heating simulation.

Helping out

If you would like to contribute please have a look at the guidelines

In progress

  • GUI: An incomplete (and outdated) GUI has been made using Tkinter, and is in gui.py.
  • Slosh modelling: Some slosh modelling functions have been put together in slosh.py, based on the following source - The Dynamic Behavior of Liquids in Moving Containers, with Applications to Space Vehicle Technology.
  • Wind variability: Statistical analysis of historic wind forecasts and obervations are analysed to create a Guassian difference profile to vary the wind in the statistical models (see wind-stats branch for a very poorly documented insight to current progress)

Potential for expansion

Cite as

Daniel Gibbons, & Jago Strong-Wright. (2021, February 11). cuspaceflight/CamPyRoS: First release! (Version V1.0). Zenodo. http://doi.org/10.5281/zenodo.4535672

Main References

[1] - Stochastic Six-Degree-of-Freedom Flight Simulator for Passively Controlled High-Power Rockets

[2] - Tangent ogive nose aerodynamic heating program: NQLD019

Additional References

[3] - NASA Basic Considerations for Rocket Trajectory Simulation

[4] - SIX DEGREE OF FREEDOM DIGITAL SIMULATION MODEL FOR UNGUIDED FIN-STABILIZED ROCKETS

[5] - Trajectory Prediction for a Typical Fin Stabilized Artillery Rocket

[6] - Central Limit Theorem and Sample Size

[7] - Monte Carlo Simulations: Number of Iterations and Accuracy

[8] - Method for Calculating Aerodynamic Heating on Sounding Rocket Tangent Ogive Noses

[9] - Six degree-of-freedom (6-DOF) Flight Simulation Check-cases

campyros's People

Contributors

dug20 avatar jagoosw avatar richard-l-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

campyros's Issues

Trouble installing requirements.txt

I ran pip install -r requirements.txt, and got the following error when it tried to install scitools_iris==2.4.0

The same problem appears when I run pip install scitools-iris.

Collecting cartopy
  Using cached Cartopy-0.18.0.tar.gz (14.4 MB)
    ERROR: Command errored out with exit status 1:
     command: 'D:\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Daniel\\AppData\\Local\\Temp\\pip-install-02lbfyqf\\cartopy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Daniel\\AppData\\Local\\Temp\\pip-install-02lbfyqf\\cartopy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Daniel\AppData\Local\Temp\pip-pip-egg-info-fkoiu6vb'
         cwd: C:\Users\Daniel\AppData\Local\Temp\pip-install-02lbfyqf\cartopy\
    Complete output (3 lines):
    C:\Users\Daniel\AppData\Local\Temp\pip-install-02lbfyqf\cartopy\setup.py:104: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
      warnings.warn(
    Proj 4.9.0 must be installed.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Overflow error

Describe the bug
When running a stats model every few (approx 1/10) models gives an error like:
/home/jago/CamPyRoS/campyros/main.py:457: RuntimeWarning:overflow encountered in multiply

This line calculates the parachute force:

F_parachute_i = -0.5 * q * ref_area * CD * v_relative_wind_i / air_speed

I have also seen 'invalid division' errors from this line too so suspect that the issue is occurring when air_speed is close to zero.

To Reproduce
So far I do not know what particular combination of rail angles, wind etc. result in this situation occurring but it should not be hard to investigate. Logging parachute forces and initial conditions would hopefully show a pattern.

Expected behavior
We should never have a situation where we have near 'infinite' parachute force. I suspect that the error is occurring in intermediate time steps which will be thrown away by the integrator (the integrator attempts to minimise the timesteps and in doing so calculates intermediaries which it then checks are not too different from the previous step, otherwise it throws them away). If this is the case then we don't really have a problem, otherwise we have a major one.

Setup
Stock install

3D plot

Currently the 3D plot looks like this:
Screenshot from 2021-04-30 01-33-46
Which isn't very instructive.

There are 2 things this could do with:

  • Plotting in the launch frame
  • May underneath

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.