From 94e2958a69f6f0316b6dc4dc3cff287da076e272 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Tue, 24 Sep 2024 21:27:33 +0200 Subject: [PATCH] MNT: small doc changes --- .../rocket/aero_surface/fins/elliptical_fins.py | 2 +- rocketpy/rocket/aero_surface/fins/fins.py | 2 +- .../rocket/aero_surface/fins/free_form_fins.py | 2 +- .../aero_surface/fins/trapezoidal_fins.py | 2 +- rocketpy/rocket/rocket.py | 17 +++++++++-------- rocketpy/simulation/flight.py | 10 ---------- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/rocketpy/rocket/aero_surface/fins/elliptical_fins.py b/rocketpy/rocket/aero_surface/fins/elliptical_fins.py index d30cf9aa1..f0d5f926f 100644 --- a/rocketpy/rocket/aero_surface/fins/elliptical_fins.py +++ b/rocketpy/rocket/aero_surface/fins/elliptical_fins.py @@ -106,7 +106,7 @@ def __init__( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be larger than 2. root_chord : int, float Fin root chord in meters. span : int, float diff --git a/rocketpy/rocket/aero_surface/fins/fins.py b/rocketpy/rocket/aero_surface/fins/fins.py index e6cfb84ea..29f4e8cff 100644 --- a/rocketpy/rocket/aero_surface/fins/fins.py +++ b/rocketpy/rocket/aero_surface/fins/fins.py @@ -106,7 +106,7 @@ def __init__( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be larger than 2. root_chord : int, float Fin root chord in meters. span : int, float diff --git a/rocketpy/rocket/aero_surface/fins/free_form_fins.py b/rocketpy/rocket/aero_surface/fins/free_form_fins.py index 1db2ef18d..3abdb84ad 100644 --- a/rocketpy/rocket/aero_surface/fins/free_form_fins.py +++ b/rocketpy/rocket/aero_surface/fins/free_form_fins.py @@ -101,7 +101,7 @@ def __init__( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be larger than 2. shape_points : list List of tuples (x, y) containing the coordinates of the fin's geometry defining points. The point (0, 0) is the root leading edge. diff --git a/rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py b/rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py index 3040e21c9..7a915f3b1 100644 --- a/rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py +++ b/rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py @@ -111,7 +111,7 @@ def __init__( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be larger than 2. root_chord : int, float Fin root chord in meters. tip_chord : int, float diff --git a/rocketpy/rocket/rocket.py b/rocketpy/rocket/rocket.py index d6d2a87b9..fe0c803b5 100644 --- a/rocketpy/rocket/rocket.py +++ b/rocketpy/rocket/rocket.py @@ -563,10 +563,10 @@ def evaluate_surfaces_cp_to_cdm(self): surface center of pressure to the rocket's center of mass. """ for surface, position in self.aerodynamic_surfaces: - self.evaluate_single_surface_cp_to_cdm(surface, position) + self.__evaluate_single_surface_cp_to_cdm(surface, position) return self.surfaces_cp_to_cdm - def evaluate_single_surface_cp_to_cdm(self, surface, position): + def __evaluate_single_surface_cp_to_cdm(self, surface, position): """Calculates the relative position of each aerodynamic surface center of pressure to the rocket's center of dry mass in Body Axes Coordinate System.""" @@ -996,6 +996,7 @@ def add_surfaces(self, surfaces, positions): ------- None """ + # TODO: separate this method into smaller methods: https://github.com/RocketPy-Team/RocketPy/pull/696#discussion_r1771978422 try: for surface, position in zip(surfaces, positions): if not isinstance(position, (Vector, tuple, list)): @@ -1003,14 +1004,14 @@ def add_surfaces(self, surfaces, positions): else: position = Vector(position) self.aerodynamic_surfaces.add(surface, position) - self.evaluate_single_surface_cp_to_cdm(surface, position) + self.__evaluate_single_surface_cp_to_cdm(surface, position) except TypeError: if not isinstance(positions, (Vector, tuple, list)): positions = Vector([0, 0, positions]) else: positions = Vector(positions) self.aerodynamic_surfaces.add(surfaces, positions) - self.evaluate_single_surface_cp_to_cdm(surfaces, positions) + self.__evaluate_single_surface_cp_to_cdm(surfaces, positions) self.evaluate_center_of_pressure() self.evaluate_stability_margin() @@ -1175,7 +1176,7 @@ def add_trapezoidal_fins( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be greater than 2. span : int, float Fin span in meters. root_chord : int, float @@ -1273,7 +1274,7 @@ def add_elliptical_fins( Parameters ---------- n : int - Number of fins, from 2 to infinity. + Number of fins, must be greater than 2. root_chord : int, float Fin root chord in meters. span : int, float @@ -1341,8 +1342,8 @@ def add_free_form_fins( Parameters ---------- n : int - Number of fins, from 2 to infinity. - shape_points : list[tuple[float, float]] + Number of fins, must be greater than 2. + shape_points : list List of tuples (x, y) containing the coordinates of the fin's geometry defining points. The point (0, 0) is the root leading edge. Positive x is rearwards, positive y is upwards (span direction). diff --git a/rocketpy/simulation/flight.py b/rocketpy/simulation/flight.py index 70ddff6c1..706bcf534 100644 --- a/rocketpy/simulation/flight.py +++ b/rocketpy/simulation/flight.py @@ -2704,16 +2704,6 @@ def angle_of_sideslip(self): ) # x-z plane return np.column_stack([self.time, np.rad2deg(beta)]) - @funcify_method("Time (s)", "Angle of Attack (°)", "spline", "constant") - def angle_of_attack2(self): - alpha = np.arctan( - np.sqrt( - np.tan(np.deg2rad(self.partial_angle_of_attack.y_array)) ** 2 - + np.tan(np.deg2rad(self.angle_of_sideslip.y_array)) ** 2 - ) - ) - return np.column_stack([self.time, np.rad2deg(alpha)]) - # Frequency response and stability variables @funcify_method("Frequency (Hz)", "ω1 Fourier Amplitude", "spline", "zero") def omega1_frequency_response(self):