Skip to content

Commit

Permalink
Merge branch 'develop' into enh/generic-surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusStano committed Sep 5, 2024
2 parents f93cf4b + 6d65fa9 commit 1f2358a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ good-names=FlightPhases,
motor_I_11_derivative_at_t,
M3_forcing,
M3_damping,
CM_to_CDM,
CM_to_CPM,
CDM_to_CPM,
center_of_mass_without_motor_to_CDM,
motor_center_of_dry_mass_to_CDM,
generic_motor_cesaroni_M1520,
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Attention: The newest changes should be on top -->

### Fixed

- BUG: Rotational EOMs Not Relative To CDM [#674](https://github.com/RocketPy-Team/RocketPy/pull/674)
- BUG: Pressure ISA Extrapolation as "linear" [#675](https://github.com/RocketPy-Team/RocketPy/pull/675)
- BUG: fix the Frequency Response plot of Flight class [#653](https://github.com/RocketPy-Team/RocketPy/pull/653)

## [v1.4.2] - 2024-08-03
Expand Down
10 changes: 6 additions & 4 deletions docs/user/rocket/rocket_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ and radius:
Pay special attention to the following:

- ``mass`` is the rocket's mass, **without the motor**, in kg.
- All ``inertia`` values are given in relation to the rocket's center of
mass without motor.
- ``inertia`` is defined as a tuple of the form ``(I11, I22, I33)``.
Where ``I11`` and ``I22`` are the inertia of the mass around the
perpendicular axes to the rocket, and ``I33`` is the inertia around the
Expand Down Expand Up @@ -432,10 +434,10 @@ The lets check all the information available about the rocket:
7. Inertia Tensors
------------------

The inertia tensor of the rocket at a given time can be obtained using the
``get_inertia_tensor_at_time`` method. This method evaluates each component of
the inertia tensor at the specified time and returns a
:class:`rocketpy.mathutils.Matrix` object.
The inertia tensor relative to the center of dry mass of the rocket at a
given time can be obtained using the ``get_inertia_tensor_at_time`` method.
This method evaluates each component of the inertia tensor at the specified
time and returns a :class:`rocketpy.mathutils.Matrix` object.

The inertia tensor is a matrix that looks like this:

Expand Down
2 changes: 1 addition & 1 deletion rocketpy/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ def load_international_standard_atmosphere(self): # pragma: no cover
DeprecationWarning,
)

@funcify_method("Height Above Sea Level (m)", "Pressure (Pa)", "spline", "linear")
@funcify_method("Height Above Sea Level (m)", "Pressure (Pa)", "spline", "natural")
def pressure_ISA(self):
"""Pressure, in Pa, as a function of height above sea level as defined
by the `International Standard Atmosphere ISO 2533`."""
Expand Down
6 changes: 6 additions & 0 deletions rocketpy/motors/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,12 @@ def __init__(self):
self.dry_I_12 = 0
self.dry_I_13 = 0
self.dry_I_23 = 0
self.propellant_I_11 = Function(0, "Time (s)", "Propellant I_11 (kg m²)")
self.propellant_I_22 = Function(0, "Time (s)", "Propellant I_22 (kg m²)")
self.propellant_I_33 = Function(0, "Time (s)", "Propellant I_33 (kg m²)")
self.propellant_I_12 = Function(0, "Time (s)", "Propellant I_12 (kg m²)")
self.propellant_I_13 = Function(0, "Time (s)", "Propellant I_13 (kg m²)")
self.propellant_I_23 = Function(0, "Time (s)", "Propellant I_23 (kg m²)")
self.I_11 = Function(0)
self.I_22 = Function(0)
self.I_33 = Function(0)
Expand Down
21 changes: 12 additions & 9 deletions tests/unit/test_flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def test_out_of_rail_stability_margin(flight_calisto_custom_wind):
@pytest.mark.parametrize(
"flight_time, expected_values",
[
("t_initial", (0.17179073815516033, -0.431117, 0)),
("out_of_rail_time", (0.543760, -1.364593, 0)),
("apogee_time", (-0.5874848151271623, -0.7563596, 0)),
("t_initial", (0.258818, -0.649515, 0)),
("out_of_rail_time", (0.788918, -1.979828, 0)),
("apogee_time", (-0.522394, -0.744154, 0)),
("t_final", (0, 0, 0)),
],
)
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_aerodynamic_moments(flight_calisto_custom_wind, flight_time, expected_v
[
("t_initial", (1.6542528, 0.65918, -0.067107)),
("out_of_rail_time", (5.05334, 2.01364, -1.7541)),
("apogee_time", (2.366258, -1.830744, -0.875342)),
("apogee_time", (2.354663, -1.652953, -0.936126)),
("t_final", (0, 0, 159.2212)),
],
)
Expand Down Expand Up @@ -247,7 +247,10 @@ def test_aerodynamic_forces(flight_calisto_custom_wind, flight_time, expected_va
[
("t_initial", (0, 0, 0)),
("out_of_rail_time", (0, 2.248727, 25.703072)),
("apogee_time", (-13.204789, 15.990903, -0.000138)),
(
"apogee_time",
(-14.485655, 15.580647, -0.000240),
),
("t_final", (5, 2, -5.65998)),
],
)
Expand Down Expand Up @@ -334,10 +337,10 @@ def test_rail_buttons_forces(flight_calisto_custom_wind):
"""
test = flight_calisto_custom_wind
atol = 5e-3
assert pytest.approx(3.876749, abs=atol) == test.max_rail_button1_normal_force
assert pytest.approx(1.544799, abs=atol) == test.max_rail_button1_shear_force
assert pytest.approx(1.178420, abs=atol) == test.max_rail_button2_normal_force
assert pytest.approx(0.469574, abs=atol) == test.max_rail_button2_shear_force
assert pytest.approx(1.825283, abs=atol) == test.max_rail_button1_normal_force
assert pytest.approx(0.727335, abs=atol) == test.max_rail_button1_shear_force
assert pytest.approx(3.229578, abs=atol) == test.max_rail_button2_normal_force
assert pytest.approx(1.286915, abs=atol) == test.max_rail_button2_shear_force


def test_max_values(flight_calisto_robust):
Expand Down

0 comments on commit 1f2358a

Please sign in to comment.