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 *
35 changes: 35 additions & 0 deletions rocketpy/utilities.py
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-

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


def compute_CdS_from_drop_test(
terminal_velocity, rocket_mass, air_density=1.225, gravity=9.80665
):
"""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
----------
terminal_velocity : float
Rocket's speed in m/s when landing.
rocket_mass : float
Rocket's mass in kg.
air_density : float, optional
Air density, in kg/m^3, right before the rocket lands. Default value is 1.225.
gravity : float, optional
Gravitational acceleration experienced by the rocket and parachute during
descent in m/s^2. Default value is the standard gravity, 9.80665.

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

"""

CdS = 2 * rocket_mass * gravity / ((terminal_velocity ** 2) * air_density)
return CdS
4 changes: 4 additions & 0 deletions tests/test_utilities.py
@@ -0,0 +1,4 @@
from rocketpy import utilities

def test_compute_CdS_from_drop_test():
assert utilities.compute_CdS_from_drop_test(31.064,18,1.0476) == 0.3492311157844522