We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 31fb869 + 0829a77 commit 31b7a67Copy full SHA for 31b7a67
CHANGELOG.md
@@ -38,6 +38,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
38
39
### Fixed
40
41
+## [v1.2.2] - 2024-03-dd
42
+
43
+You can install this version by running `pip install rocketpy==1.2.2`
44
45
+- BUG: wrong rocket mass in parachute u dot method [#569](https://github.com/RocketPy-Team/RocketPy/pull/569)
46
47
## [v1.2.1] - 2024-02-22
48
rocketpy/rocket/rocket.py
@@ -61,6 +61,9 @@ class Rocket:
61
pointing from the rocket's nose cone to the rocket's tail.
62
Rocket.mass : float
63
Rocket's mass without motor and propellant, measured in kg.
64
+ Rocket.dry_mass : float
65
+ Rocket's mass without propellant, measured in kg. It does include the
66
+ motor mass.
67
Rocket.center_of_mass : Function
68
Position of the rocket's center of mass, including propellant, relative
69
to the user defined rocket reference system.
@@ -394,22 +397,18 @@ def evaluate_total_mass(self):
394
397
def evaluate_dry_mass(self):
395
398
"""Calculates and returns the rocket's dry mass. The dry
396
399
mass is defined as the sum of the motor's dry mass and the
- rocket mass without motor. The function returns an object
- of the Function class and is defined as a function of time.
400
+ rocket mass without motor.
401
402
Returns
403
-------
- self.total_mass : Function
- Function of time expressing the total mass of the rocket,
404
- defined as the sum of the propellant mass and the rocket
405
- mass without propellant.
+ self.dry_mass : float
+ Rocket's dry mass (Rocket + Motor) (kg)
406
"""
407
# Make sure there is a motor associated with the rocket
408
if self.motor is None:
409
print("Please associate this rocket with a motor!")
410
return False
411
412
- # Calculate total dry mass: motor (without propellant) + rocket mass
413
self.dry_mass = self.mass + self.motor.dry_mass
414
415
return self.dry_mass
rocketpy/simulation/flight.py
@@ -1911,7 +1911,7 @@ def u_dot_parachute(self, t, u, post_processing=False):
1911
rho = self.env.density.get_value_opt(u[2])
1912
to = 1.2
1913
ma = ka * rho * (4 / 3) * np.pi * R**3
1914
- mp = self.rocket.mass
+ mp = self.rocket.dry_mass
1915
eta = 1
1916
Rdot = (6 * R * (1 - eta) / (1.2**6)) * (
1917
(1 - eta) * t**5 + eta * (to**3) * (t**2)
tests/acceptance/test_bella_lui_rocket.py
@@ -242,3 +242,10 @@ def drogue_trigger(p, h, y):
242
assert (
243
abs(apogee_time_measured - apogee_time_simulated) / apogee_time_simulated < 0.02
244
)
245
+ # Guarantee the impact velocity is within 30% of the real data.
246
+ # Use the last 5 real points to avoid outliers
247
+ assert (
248
+ abs(test_flight.impact_velocity - np.mean(vert_vel_kalt[-5:]))
249
+ / abs(test_flight.impact_velocity)
250
+ < 0.30
251
+ )
tests/test_flight.py
@@ -691,7 +691,7 @@ def test_accelerations(flight_calisto_custom_wind, flight_time, expected_values)
691
("t_initial", (0, 0, 0)),
692
("out_of_rail_time", (0, 2.248727, 25.703072)),
693
("apogee_time", (-13.209436, 16.05115, -0.000257)),
694
- ("t_final", (5, 2, -5.334289)),
+ ("t_final", (5, 2, -5.65998)),
695
],
696
697
def test_velocities(flight_calisto_custom_wind, flight_time, expected_values):
@@ -729,7 +729,7 @@ def test_velocities(flight_calisto_custom_wind, flight_time, expected_values):
729
("t_initial", (1.6542528, 0.65918, -0.067107)),
730
("out_of_rail_time", (5.05334, 2.01364, -1.7541)),
731
("apogee_time", (2.35291, -1.8275, -0.87851)),
732
- ("t_final", (0, 0, 141.42421)),
+ ("t_final", (0, 0, 159.2212)),
733
734
735
def test_aerodynamic_forces(flight_calisto_custom_wind, flight_time, expected_values):
tests/unit/test_utilities.py
@@ -153,7 +153,7 @@ def test_fin_flutter_analysis(flight_calisto_custom_wind):
153
assert np.isclose(flutter_mach(np.inf), 1.0048188594647927, atol=5e-3)
154
assert np.isclose(safety_factor(0), 64.78797, atol=5e-3)
155
assert np.isclose(safety_factor(10), 2.1948620401502072, atol=5e-3)
156
- assert np.isclose(safety_factor(np.inf), 65.40588722032527, atol=5e-3)
+ assert np.isclose(safety_factor(np.inf), 61.64222220469224, atol=5e-3)
157
158
159
def test_flutter_prints(flight_calisto_custom_wind):
0 commit comments