Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh/parachute #108

Merged
merged 14 commits into from Nov 21, 2021
1 change: 1 addition & 0 deletions rocketpy/__init__.py
Expand Up @@ -41,3 +41,4 @@
from .SolidMotor import SolidMotor
from .Rocket import Rocket
from .Flight import Flight
from .utilities import *
50 changes: 50 additions & 0 deletions rocketpy/utilities.py
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-

__author__ = "Franz Masatoshi Yuri"
__copyright__ = "Copyright 20XX, Projeto Jupiter"
__license__ = "MIT"

import re
import math
import bisect
import warnings
import time
from datetime import datetime, timedelta
from inspect import signature, getsourcelines
from collections import namedtuple

import numpy as np
from scipy import integrate
from scipy import linalg
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm

from rocketpy import Environment, Rocket, SolidMotor, Flight
FranzYuri marked this conversation as resolved.
Show resolved Hide resolved


def compute_cds_from_drop_test(final_speed, final_air_density, rocket_mass, gravity):
FranzYuri marked this conversation as resolved.
Show resolved Hide resolved
"""Returns the parachute's Cds calculated through its final speed, air
density in the landing point, the rocket's mass and the force of gravity
in the landing point.

Parameters
----------
final_speed : float
Rocket's speed in m/s^2 when landing.
final_air_density : float
Air density, in kg/m^3, right before the rocket lands.
FranzYuri marked this conversation as resolved.
Show resolved Hide resolved
rocket_mass : float
Rocket's mass in kg.
gravity : float
force of gravity in the landing point in newtons.
FranzYuri marked this conversation as resolved.
Show resolved Hide resolved

Returns
-------
cds : float
Number equal to drag coefficient times reference area for parachute.

"""

cds = 2 * rocket_mass * gravity / ((final_speed ** 2) * final_air_density)
return cds