Skip to content

Commit

Permalink
Merge pull request #267 from RocketPy-Team/enh/dispersion_class/review
Browse files Browse the repository at this point in the history
Enh/dispersion class/review
  • Loading branch information
Gui-FernandesBR authored Jan 16, 2023
2 parents 14411da + eba0060 commit 50b3f23
Show file tree
Hide file tree
Showing 14 changed files with 2,588 additions and 2,592 deletions.
649 changes: 649 additions & 0 deletions docs/notebooks/dispersion_analysis/dispersion_class_usage.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Welcome to RocketPy's user documentation!
../notebooks/environment_analysis_class_usage.ipynb
../notebooks/environment_analysis_EuroC_example.ipynb
../notebooks/dispersion_analysis/dispersion_analysis.ipynb
../notebooks/dispersion_analysis/dispersion_class_usage.ipynb
../notebooks/utilities_usage.ipynb
../matlab/matlab.rst

672 changes: 0 additions & 672 deletions getting_started Dispersion.ipynb

This file was deleted.

19 changes: 19 additions & 0 deletions rocketpy/AeroSurfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class Fins(ABC):
Geometrical relation used to simplify lift and roll calculations
Fins.liftInterferenceFactor : float
Factor of Fin-Body interference in the lift coefficient
"""

def __init__(
Expand All @@ -230,14 +231,17 @@ def __init__(
):
"""Initialize Fins class.
Parameters
----------
n : int
Number of fins, from 2 to infinity.
rootChord : int, float
Fin root chord in meters.
span : int, float
Fin span in meters.
distanceToCM : int, float
Fin set position relative to rocket unloaded center of
mass, considering positive direction from center of mass to
Expand All @@ -248,6 +252,7 @@ def __init__(
cantAngle : int, float, optional
Fins cant angle with respect to the rocket centerline. Must
be given in degrees.
airfoil : tuple, optional
Default is null, in which case fins will be treated as flat plates.
Otherwise, if tuple, fins will be considered as airfoils. The
Expand Down Expand Up @@ -277,10 +282,12 @@ def __init__(
# Store values
self.n = n
self.rocketRadius = rocketRadius

self.airfoil = airfoil
self.distanceToCM = distanceToCM
self.cantAngle = cantAngle
self.rootChord = rootChord

self.span = span
self.name = name
self.d = d
Expand Down Expand Up @@ -328,6 +335,7 @@ def evaluateLiftCoefficient(self):
if not self.airfoil:
# Defines clalpha2D as 2*pi for planar fins
clalpha2D = Function(lambda mach: 2 * np.pi / self.__beta(mach))

else:
# Defines clalpha2D as the derivative of the
# lift coefficient curve for a specific airfoil
Expand Down Expand Up @@ -792,6 +800,7 @@ def __init__(
+ 4 * (rootChord + 2 * tipChord) * rocketRadius * span**2
+ 6 * (rootChord + tipChord) * span * rocketRadius**2
) / 12

rollDampingInterferenceFactor = 1 + (
((tau - λ) / (tau)) - ((1 - λ) / (tau - 1)) * np.log(tau)
) / (
Expand Down Expand Up @@ -855,10 +864,12 @@ def evaluateCenterOfPressure(self):
- self.rootChord * self.tipChord / (self.rootChord + self.tipChord)
)
)

self.cpx = 0
self.cpy = 0
self.cpz = cpz
self.cp = (self.cpx, self.cpy, self.cpz)

return self.cp

def draw(self):
Expand Down Expand Up @@ -1024,6 +1035,7 @@ class EllipticalFins(Fins):
Geometrical relation used to simplify lift and roll calculations
Fins.liftInterferenceFactor : float
Factor of Fin-Body interference in the lift coefficient
"""

def __init__(
Expand All @@ -1039,9 +1051,11 @@ def __init__(
):
"""Initialize EllipticalFins class.
Parameters
----------
n : int
Number of fins, from 2 to infinity.
rootChord : int, float
Fin root chord in meters.
Expand Down Expand Up @@ -1090,9 +1104,11 @@ def __init__(
name : str
Name of fin set.
Returns
-------
None
"""

super().__init__(
Expand Down Expand Up @@ -1152,6 +1168,7 @@ def __init__(
* (span / 3 + np.pi * rocketRadius / 4)
* (span**2 - rocketRadius**2)
)

rollForcingInterferenceFactor = (1 / np.pi**2) * (
(np.pi**2 / 4) * ((tau + 1) ** 2 / tau**2)
+ ((np.pi * (tau**2 + 1) ** 2) / (tau**2 * (tau - 1) ** 2))
Expand Down Expand Up @@ -1278,6 +1295,7 @@ def draw(self):


class Tail:

"""Class that defines a tail for the rocket. Currently only accepts
conical tails.
Expand Down Expand Up @@ -1321,6 +1339,7 @@ class Tail:
Tail.surfaceArea : float
Surface area of the tail. Has the unit of meters squared.
"""

def __init__(
Expand Down
Loading

0 comments on commit 50b3f23

Please sign in to comment.