From f048c565ae2e019116718aa6e981c62d2d3ed811 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 24 Apr 2025 19:06:12 -0300 Subject: [PATCH 01/17] Functions associated to the regression updated #801 only_radial_burn optional parameter added and used in the functions related to the grain regression as a conditon to change the applied equations. Still need to update the comment section, the CHANGELOG and maybe the dict related functions, but not sure about the last one yet. --- rocketpy/motors/solid_motor.py | 137 +++++++++++++++++++++++---------- 1 file changed, 96 insertions(+), 41 deletions(-) diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index 37d89130e..357bd7434 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -204,6 +204,7 @@ def __init__( reshape_thrust_curve=False, interpolation_method="linear", coordinate_system_orientation="nozzle_to_combustion_chamber", + only_radial_burn=False, ): """Initialize Motor class, process thrust curve and geometrical parameters and store results. @@ -315,6 +316,7 @@ class Function. Thrust units are Newtons. reshape_thrust_curve=reshape_thrust_curve, interpolation_method=interpolation_method, coordinate_system_orientation=coordinate_system_orientation, + only_radial_burn = only_radial_burn, ) # Nozzle parameters self.throat_radius = throat_radius @@ -339,6 +341,8 @@ class Function. Thrust units are Newtons. self.evaluate_geometry() + # Burn surface definition + self.only_radial_burn = only_radial_burn # Initialize plots and prints object self.prints = _SolidMotorPrints(self) self.plots = _SolidMotorPlots(self) @@ -479,15 +483,25 @@ def geometry_dot(t, y): # Compute state vector derivative grain_inner_radius, grain_height = y - burn_area = ( - 2 - * np.pi - * ( - grain_outer_radius**2 - - grain_inner_radius**2 - + grain_inner_radius * grain_height + if self.only_radial_burn: + burn_area = ( + 2 + * np.pi + * ( + grain_inner_radius * grain_height + ) ) - ) + else: + burn_area = ( + 2 + * np.pi + * ( + grain_outer_radius**2 + - grain_inner_radius**2 + + grain_inner_radius * grain_height + ) + ) + grain_inner_radius_derivative = -volume_diff / burn_area grain_height_derivative = -2 * grain_inner_radius_derivative @@ -500,33 +514,64 @@ def geometry_jacobian(t, y): # Compute jacobian grain_inner_radius, grain_height = y - factor = volume_diff / ( - 2 - * np.pi - * ( - grain_outer_radius**2 - - grain_inner_radius**2 - + grain_inner_radius * grain_height + if self.only_radial_burn: + factor = volume_diff / ( + 2 + * np.pi + * ( + grain_inner_radius * grain_height + ) + ** 2 ) - ** 2 - ) - inner_radius_derivative_wrt_inner_radius = factor * ( - grain_height - 2 * grain_inner_radius - ) - inner_radius_derivative_wrt_height = factor * grain_inner_radius - height_derivative_wrt_inner_radius = ( - -2 * inner_radius_derivative_wrt_inner_radius - ) - height_derivative_wrt_height = -2 * inner_radius_derivative_wrt_height - return [ - [ - inner_radius_derivative_wrt_inner_radius, - inner_radius_derivative_wrt_height, - ], - [height_derivative_wrt_inner_radius, height_derivative_wrt_height], - ] + inner_radius_derivative_wrt_inner_radius = factor * ( + grain_height - 2 * grain_inner_radius + ) + inner_radius_derivative_wrt_height = factor * grain_inner_radius + height_derivative_wrt_inner_radius = 0 + height_derivative_wrt_height = 0 + + return [ + [ + inner_radius_derivative_wrt_inner_radius, + inner_radius_derivative_wrt_height, + ], + [height_derivative_wrt_inner_radius, height_derivative_wrt_height], + + + ] + + else: + factor = volume_diff / ( + 2 + * np.pi + * ( + grain_outer_radius**2 + - grain_inner_radius**2 + + grain_inner_radius * grain_height + ) + ** 2 + ) + inner_radius_derivative_wrt_inner_radius = factor * ( + grain_height - 2 * grain_inner_radius + ) + inner_radius_derivative_wrt_height = factor * grain_inner_radius + height_derivative_wrt_inner_radius = ( + -2 * inner_radius_derivative_wrt_inner_radius + ) + height_derivative_wrt_height = -2 * inner_radius_derivative_wrt_height + + return [ + [ + inner_radius_derivative_wrt_inner_radius, + inner_radius_derivative_wrt_height, + ], + [height_derivative_wrt_inner_radius, height_derivative_wrt_height], + + + ] + def terminate_burn(t, y): # pylint: disable=unused-argument end_function = (self.grain_outer_radius - y[0]) * y[1] return end_function @@ -576,16 +621,26 @@ def burn_area(self): burn_area : Function Function representing the burn area progression with the time. """ - burn_area = ( - 2 - * np.pi - * ( - self.grain_outer_radius**2 - - self.grain_inner_radius**2 - + self.grain_inner_radius * self.grain_height + if self.only_radial_burn: + burn_area = ( + 2 + * np.pi + * ( + self.grain_inner_radius * self.grain_height + ) + * self.grain_number + ) + else: + burn_area = ( + 2 + * np.pi + * ( + self.grain_outer_radius**2 + - self.grain_inner_radius**2 + + self.grain_inner_radius * self.grain_height + ) + * self.grain_number ) - * self.grain_number - ) return burn_area @funcify_method("Time (s)", "burn rate (m/s)") From 4f32f88d2f5c747b0b85097a95e400903b7662c5 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Wed, 30 Apr 2025 19:42:03 -0300 Subject: [PATCH 02/17] super() corrected and dict functions updated #801 The new parameter of the SolidMotor class was removed from super, since it's not on the Motor class. The dict functions were updated to take this new parameter into acount. Also the comments about the SolidMotor class parameters were updated. Still need to do some tests running the code to be sure everything is ok, then I can open the PR. --- rocketpy/motors/solid_motor.py | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index 357bd7434..66f69938f 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -300,6 +300,11 @@ class Function. Thrust units are Newtons. positions specified. Options are "nozzle_to_combustion_chamber" and "combustion_chamber_to_nozzle". Default is "nozzle_to_combustion_chamber". + only_radial_burn : boolean, optional + If True, inhibits the grain from burning axially, only computing + radial burn. Otherwise, if False, allows the grain to also burn + axially. May be useful for axially inhibited grains or hybrid motors. + Default is False. Returns ------- @@ -316,7 +321,6 @@ class Function. Thrust units are Newtons. reshape_thrust_curve=reshape_thrust_curve, interpolation_method=interpolation_method, coordinate_system_orientation=coordinate_system_orientation, - only_radial_burn = only_radial_burn, ) # Nozzle parameters self.throat_radius = throat_radius @@ -484,13 +488,7 @@ def geometry_dot(t, y): # Compute state vector derivative grain_inner_radius, grain_height = y if self.only_radial_burn: - burn_area = ( - 2 - * np.pi - * ( - grain_inner_radius * grain_height - ) - ) + burn_area = 2 * np.pi * (grain_inner_radius * grain_height) else: burn_area = ( 2 @@ -516,12 +514,7 @@ def geometry_jacobian(t, y): grain_inner_radius, grain_height = y if self.only_radial_burn: factor = volume_diff / ( - 2 - * np.pi - * ( - grain_inner_radius * grain_height - ) - ** 2 + 2 * np.pi * (grain_inner_radius * grain_height) ** 2 ) inner_radius_derivative_wrt_inner_radius = factor * ( @@ -537,8 +530,6 @@ def geometry_jacobian(t, y): inner_radius_derivative_wrt_height, ], [height_derivative_wrt_inner_radius, height_derivative_wrt_height], - - ] else: @@ -568,10 +559,8 @@ def geometry_jacobian(t, y): inner_radius_derivative_wrt_height, ], [height_derivative_wrt_inner_radius, height_derivative_wrt_height], - - ] - + def terminate_burn(t, y): # pylint: disable=unused-argument end_function = (self.grain_outer_radius - y[0]) * y[1] return end_function @@ -625,9 +614,7 @@ def burn_area(self): burn_area = ( 2 * np.pi - * ( - self.grain_inner_radius * self.grain_height - ) + * (self.grain_inner_radius * self.grain_height) * self.grain_number ) else: @@ -812,6 +799,7 @@ def to_dict(self, include_outputs=False): "grain_initial_height": self.grain_initial_height, "grain_separation": self.grain_separation, "grains_center_of_mass_position": self.grains_center_of_mass_position, + "only_radial_burn": self.only_radial_burn, } ) @@ -855,4 +843,5 @@ def from_dict(cls, data): throat_radius=data["throat_radius"], interpolation_method=data["interpolate"], coordinate_system_orientation=data["coordinate_system_orientation"], + only_radial_burn=data.get("only_radial_burn", False), ) From 550e149fac7a3703f57b43810d9b6417b99e55d1 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Sat, 3 May 2025 08:48:49 -0300 Subject: [PATCH 03/17] Last update #801 Corrected some minor code erros, like calling evaluate geometry before defining self.only_radial_burn. Also had to change the grain_height_derivative to zero in the case of only radial burn, it was leading to some physical incoherences, because the grain was still burning axially. The last tests to evaluate the physical behaviour went pretty well, so I'll open the PR. --- rocketpy/motors/solid_motor.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index 66f69938f..dba121dda 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -302,7 +302,7 @@ class Function. Thrust units are Newtons. "nozzle_to_combustion_chamber". only_radial_burn : boolean, optional If True, inhibits the grain from burning axially, only computing - radial burn. Otherwise, if False, allows the grain to also burn + radial burn. Otherwise, if False, allows the grain to also burn axially. May be useful for axially inhibited grains or hybrid motors. Default is False. @@ -343,10 +343,11 @@ class Function. Thrust units are Newtons. ) self.grain_initial_mass = self.grain_density * self.grain_initial_volume - self.evaluate_geometry() - # Burn surface definition self.only_radial_burn = only_radial_burn + + self.evaluate_geometry() + # Initialize plots and prints object self.prints = _SolidMotorPrints(self) self.plots = _SolidMotorPlots(self) @@ -489,6 +490,10 @@ def geometry_dot(t, y): grain_inner_radius, grain_height = y if self.only_radial_burn: burn_area = 2 * np.pi * (grain_inner_radius * grain_height) + + grain_inner_radius_derivative = -volume_diff / burn_area + grain_height_derivative = 0 + else: burn_area = ( 2 @@ -500,8 +505,8 @@ def geometry_dot(t, y): ) ) - grain_inner_radius_derivative = -volume_diff / burn_area - grain_height_derivative = -2 * grain_inner_radius_derivative + grain_inner_radius_derivative = -volume_diff / burn_area + grain_height_derivative = -2 * grain_inner_radius_derivative return [grain_inner_radius_derivative, grain_height_derivative] @@ -520,7 +525,7 @@ def geometry_jacobian(t, y): inner_radius_derivative_wrt_inner_radius = factor * ( grain_height - 2 * grain_inner_radius ) - inner_radius_derivative_wrt_height = factor * grain_inner_radius + inner_radius_derivative_wrt_height = 0 height_derivative_wrt_inner_radius = 0 height_derivative_wrt_height = 0 From 7a4267ae85391f6a9e15f34aa48d54a72ca4c4a6 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 9 May 2025 20:46:46 -0300 Subject: [PATCH 04/17] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2503d23..31ae251b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Attention: The newest changes should be on top --> ### Added +- ENH: Enable only radial burning [#815](https://github.com/RocketPy-Team/RocketPy/pull/815) - ENH: Parallel mode for monte-carlo simulations 2 [#768](https://github.com/RocketPy-Team/RocketPy/pull/768) - DOC: ASTRA Flight Example [#770](https://github.com/RocketPy-Team/RocketPy/pull/770) - ENH: Add Eccentricity to Stochastic Simulations [#792](https://github.com/RocketPy-Team/RocketPy/pull/792) From 32871380e76a6dc1420865f3400db146cdc80e8f Mon Sep 17 00:00:00 2001 From: caioessouza Date: Tue, 20 May 2025 10:54:14 -0300 Subject: [PATCH 05/17] Only radial burning enabled on hybrid class #801 The "only_radial_burning" parameter was added and set as default on the hybrid class. Also, the description of the new parameter was updated and 2 coments about derivatives set to zero were added. --- rocketpy/motors/hybrid_motor.py | 2 ++ rocketpy/motors/solid_motor.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index ea01e686f..2ae50d073 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -203,6 +203,7 @@ def __init__( # pylint: disable=too-many-arguments reshape_thrust_curve=False, interpolation_method="linear", coordinate_system_orientation="nozzle_to_combustion_chamber", + only_radial_burn=True, ): """Initialize Motor class, process thrust curve and geometrical parameters and store results. @@ -346,6 +347,7 @@ class Function. Thrust units are Newtons. reshape_thrust_curve, interpolation_method, coordinate_system_orientation, + only_radial_burn, ) self.positioned_tanks = self.liquid.positioned_tanks diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index dba121dda..941b10019 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -302,7 +302,7 @@ class Function. Thrust units are Newtons. "nozzle_to_combustion_chamber". only_radial_burn : boolean, optional If True, inhibits the grain from burning axially, only computing - radial burn. Otherwise, if False, allows the grain to also burn + radial burn. If False, allows the grain to also burn axially. May be useful for axially inhibited grains or hybrid motors. Default is False. @@ -492,7 +492,7 @@ def geometry_dot(t, y): burn_area = 2 * np.pi * (grain_inner_radius * grain_height) grain_inner_radius_derivative = -volume_diff / burn_area - grain_height_derivative = 0 + grain_height_derivative = 0 # Set to zero to disable axial burning else: burn_area = ( @@ -528,6 +528,7 @@ def geometry_jacobian(t, y): inner_radius_derivative_wrt_height = 0 height_derivative_wrt_inner_radius = 0 height_derivative_wrt_height = 0 + # Height is a constant, so all the derivatives with respect to it are set to zero return [ [ From d97ba24726feee84fcd5a4dd7ecb7e870f225029 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 30 May 2025 17:14:36 -0300 Subject: [PATCH 06/17] only_radial_burn on hybrid corrected only_radial_burn argument order corrected --- rocketpy/motors/hybrid_motor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index 9a1eb6636..12b270645 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -215,8 +215,8 @@ def __init__( # pylint: disable=too-many-arguments reshape_thrust_curve=False, interpolation_method="linear", coordinate_system_orientation="nozzle_to_combustion_chamber", - only_radial_burn=True, reference_pressure=None, + only_radial_burn=True, ): """Initialize Motor class, process thrust curve and geometrical parameters and store results. @@ -364,8 +364,8 @@ class Function. Thrust units are Newtons. reshape_thrust_curve, interpolation_method, coordinate_system_orientation, - only_radial_burn, reference_pressure, + only_radial_burn, ) self.positioned_tanks = self.liquid.positioned_tanks From 0cb0eb539b4373bff8564724c156f15db5403287 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Tue, 12 Aug 2025 21:09:35 -0300 Subject: [PATCH 07/17] Tests created The solid motor integrations test was created and the solid and hybrid motors unit tests were modified to add checks to the new only_radial_burning class and parameters. Also a correction was made in the hybrid unit tests to fix the test time. --- flight.json | 0 tests/integration/test_solidmotor.py | 15 +++++++++++ tests/unit/test_hybridmotor.py | 40 ++++++++++++++++++++++++++-- tests/unit/test_solidmotor.py | 29 ++++++++++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 flight.json create mode 100644 tests/integration/test_solidmotor.py diff --git a/flight.json b/flight.json new file mode 100644 index 000000000..e69de29bb diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py new file mode 100644 index 000000000..8cc71adba --- /dev/null +++ b/tests/integration/test_solidmotor.py @@ -0,0 +1,15 @@ +from unittest.mock import patch + +@patch("matplotlib.pyplot.show") +def test_solid_motor_info(mock_show, cesaroni_m1670): + """Tests the SolidMotor.all_info() method. + + Parameters + ---------- + mock_show : mock + Mock of the matplotlib.pyplot.show function. + hybrid_motor : rocketpy.HybridMotor + The SolidMotor object to be used in the tests. + """ + assert cesaroni_m1670.info() is None + assert cesaroni_m1670.all_info() is None \ No newline at end of file diff --git a/tests/unit/test_hybridmotor.py b/tests/unit/test_hybridmotor.py index ef03a1998..a043c094e 100644 --- a/tests/unit/test_hybridmotor.py +++ b/tests/unit/test_hybridmotor.py @@ -121,7 +121,7 @@ def test_hybrid_motor_center_of_mass(hybrid_motor, spherical_oxidizer_tank): propellant_center_of_mass = propellant_balance / (grain_mass + oxidizer_mass) center_of_mass = balance / (grain_mass + oxidizer_mass + DRY_MASS) - for t in np.linspace(0, 100, 100): + for t in np.linspace(0, BURN_TIME, 100): assert pytest.approx( hybrid_motor.center_of_propellant_mass(t) ) == propellant_center_of_mass(t) @@ -170,9 +170,45 @@ def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank): + DRY_MASS * (-hybrid_motor.center_of_mass + CENTER_OF_DRY_MASS) ** 2 ) - for t in np.linspace(0, 100, 100): + for t in np.linspace(0, BURN_TIME, 100): assert pytest.approx(hybrid_motor.propellant_I_11(t)) == propellant_inertia(t) assert pytest.approx(hybrid_motor.I_11(t)) == inertia(t) # Assert cylindrical symmetry assert pytest.approx(hybrid_motor.propellant_I_22(t)) == propellant_inertia(t) + +def test_hybrid_motor_only_radial_burn_behavior(hybrid_motor): + """ + Test if only_radial_burn flag in HybridMotor propagates to its SolidMotor + and affects burn_area calculation. + """ + motor = hybrid_motor + + # Activates the radial burning + motor.solid.only_radial_burn = True + assert motor.solid.only_radial_burn is True + + # Calculates the expected initial area + burn_area_radial = ( + 2 + * np.pi + * (motor.solid.grain_inner_radius(0) * motor.solid.grain_height(0)) + * motor.solid.grain_number + ) + + assert np.isclose(motor.solid.burn_area(0), burn_area_radial, atol=1e-12) + + # Deactivates the radial burning and recalculate the geometry + motor.solid.only_radial_burn = False + motor.solid.evaluate_geometry() + assert motor.solid.only_radial_burn is False + + # In this case the burning area also considers tha bases of the grain + inner_radius = motor.solid.grain_inner_radius(0) + outer_radius = motor.solid.grain_outer_radius + burn_area_total = ( + burn_area_radial + + 2 * np.pi * (outer_radius**2 - inner_radius**2) * motor.solid.grain_number + ) + assert np.isclose(motor.solid.burn_area(0), burn_area_total, atol=1e-12) + assert motor.solid.burn_area(0) > burn_area_radial \ No newline at end of file diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index 3f829d222..5e8906b3a 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -279,3 +279,32 @@ def test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct( assert thrust_reshaped[1][1] == 100 * (tuple_parametric[1] / 7539.1875) assert thrust_reshaped[7][1] == 2034 * (tuple_parametric[1] / 7539.1875) + +def test_only_radial_burn_parameter_effect(cesaroni_m1670): + # Tests if the only_radial_burn flag is properly set + motor = cesaroni_m1670 + motor.only_radial_burn = True + assert motor.only_radial_burn is True + + # When only_radial_burn is active, burn_area should consider only radial area + burn_area_radial = 2 * np.pi * (motor.grain_inner_radius(0) * motor.grain_height(0)) * motor.grain_number + assert np.isclose(motor.burn_area(0), burn_area_radial, atol=1e-12) + +def test_evaluate_geometry_updates_properties(cesaroni_m1670): + # Checks if after instantiation, grain_inner_radius and grain_height are valid functions + motor = cesaroni_m1670 + + assert hasattr(motor, "grain_inner_radius") + assert hasattr(motor, "grain_height") + + # Checks if the domain of grain_inner_radius function is consistent + times = motor.grain_inner_radius.x_array + values = motor.grain_inner_radius.y_array + + assert times[0] == 0 # expected initial time + assert values[0] == motor.grain_initial_inner_radius # expected initial inner radius + assert values[-1] <= motor.grain_outer_radius # final inner radius should be less or equal than outer radius + + # Evaluates without error + val = motor.grain_inner_radius(0.5) # evaluate at intermediate time + assert isinstance(val, float) \ No newline at end of file From 8de2ab4517f672f752f22b8a93837c829633c0c8 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 14 Aug 2025 12:57:32 -0300 Subject: [PATCH 08/17] Corrections made based in the review Comments checked and resolved. @Gui-FernandesBR please check the CHANGELOG.md to see if it's correct now. --- CHANGELOG.md | 2 +- flight.json | 0 tests/integration/test_solidmotor.py | 2 +- tests/unit/test_hybridmotor.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 flight.json diff --git a/CHANGELOG.md b/CHANGELOG.md index bba3b081f..8801dca32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Attention: The newest changes should be on top --> ### Added +- ENH: Enable only radial burning [#815](https://github.com/RocketPy-Team/RocketPy/pull/815) - ENH: Support for ND arithmetic in Function class. [#810] (https://github.com/RocketPy-Team/RocketPy/pull/810) - ENH: allow users to provide custom samplers [#803](https://github.com/RocketPy-Team/RocketPy/pull/803) - ENH: Implement Multivariate Rejection Sampling (MRS) [#738] (https://github.com/RocketPy-Team/RocketPy/pull/738) @@ -53,7 +54,6 @@ Attention: The newest changes should be on top --> ### Added -- ENH: Enable only radial burning [#815](https://github.com/RocketPy-Team/RocketPy/pull/815) - ENH: Parallel mode for monte-carlo simulations 2 [#768](https://github.com/RocketPy-Team/RocketPy/pull/768) - DOC: ASTRA Flight Example [#770](https://github.com/RocketPy-Team/RocketPy/pull/770) - ENH: Add Eccentricity to Stochastic Simulations [#792](https://github.com/RocketPy-Team/RocketPy/pull/792) diff --git a/flight.json b/flight.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py index 8cc71adba..3cd58a345 100644 --- a/tests/integration/test_solidmotor.py +++ b/tests/integration/test_solidmotor.py @@ -8,7 +8,7 @@ def test_solid_motor_info(mock_show, cesaroni_m1670): ---------- mock_show : mock Mock of the matplotlib.pyplot.show function. - hybrid_motor : rocketpy.HybridMotor + cesaroni_m1670 : rocketpy.SolidMotor The SolidMotor object to be used in the tests. """ assert cesaroni_m1670.info() is None diff --git a/tests/unit/test_hybridmotor.py b/tests/unit/test_hybridmotor.py index a043c094e..0c79eaac5 100644 --- a/tests/unit/test_hybridmotor.py +++ b/tests/unit/test_hybridmotor.py @@ -203,7 +203,7 @@ def test_hybrid_motor_only_radial_burn_behavior(hybrid_motor): motor.solid.evaluate_geometry() assert motor.solid.only_radial_burn is False - # In this case the burning area also considers tha bases of the grain + # In this case the burning area also considers the bases of the grain inner_radius = motor.solid.grain_inner_radius(0) outer_radius = motor.solid.grain_outer_radius burn_area_total = ( From 4e4df54d6bfd5187e9d432f046f1ad98001b7794 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 2 Oct 2025 15:44:40 -0300 Subject: [PATCH 09/17] Tests approved All tests approved locally. The spherical_oxidizer_tank fixture was a problem, so I changed the hybrid tank to the oxidizer_tank fixture instead. It's important to fix the spherical_oxidizer_tank fixture. --- tests/fixtures/motor/hybrid_fixtures.py | 4 ++-- tests/integration/test_solidmotor.py | 3 ++- tests/unit/test_hybridmotor.py | 5 +++-- tests/unit/test_solidmotor.py | 19 +++++++++++++++---- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tests/fixtures/motor/hybrid_fixtures.py b/tests/fixtures/motor/hybrid_fixtures.py index 923a640b1..35812fbfb 100644 --- a/tests/fixtures/motor/hybrid_fixtures.py +++ b/tests/fixtures/motor/hybrid_fixtures.py @@ -4,7 +4,7 @@ @pytest.fixture -def hybrid_motor(spherical_oxidizer_tank): +def hybrid_motor(oxidizer_tank): """An example of a hybrid motor with spherical oxidizer tank and fuel grains. @@ -35,6 +35,6 @@ def hybrid_motor(spherical_oxidizer_tank): grains_center_of_mass_position=-0.1, ) - motor.add_tank(spherical_oxidizer_tank, position=0.3) + motor.add_tank(oxidizer_tank, position=0.3) return motor diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py index 3cd58a345..f10e2dc54 100644 --- a/tests/integration/test_solidmotor.py +++ b/tests/integration/test_solidmotor.py @@ -1,5 +1,6 @@ from unittest.mock import patch + @patch("matplotlib.pyplot.show") def test_solid_motor_info(mock_show, cesaroni_m1670): """Tests the SolidMotor.all_info() method. @@ -12,4 +13,4 @@ def test_solid_motor_info(mock_show, cesaroni_m1670): The SolidMotor object to be used in the tests. """ assert cesaroni_m1670.info() is None - assert cesaroni_m1670.all_info() is None \ No newline at end of file + assert cesaroni_m1670.all_info() is None diff --git a/tests/unit/test_hybridmotor.py b/tests/unit/test_hybridmotor.py index 0c79eaac5..a89e453a9 100644 --- a/tests/unit/test_hybridmotor.py +++ b/tests/unit/test_hybridmotor.py @@ -177,6 +177,7 @@ def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank): # Assert cylindrical symmetry assert pytest.approx(hybrid_motor.propellant_I_22(t)) == propellant_inertia(t) + def test_hybrid_motor_only_radial_burn_behavior(hybrid_motor): """ Test if only_radial_burn flag in HybridMotor propagates to its SolidMotor @@ -203,7 +204,7 @@ def test_hybrid_motor_only_radial_burn_behavior(hybrid_motor): motor.solid.evaluate_geometry() assert motor.solid.only_radial_burn is False - # In this case the burning area also considers the bases of the grain + # In this case the burning area also considers the bases of the grain inner_radius = motor.solid.grain_inner_radius(0) outer_radius = motor.solid.grain_outer_radius burn_area_total = ( @@ -211,4 +212,4 @@ def test_hybrid_motor_only_radial_burn_behavior(hybrid_motor): + 2 * np.pi * (outer_radius**2 - inner_radius**2) * motor.solid.grain_number ) assert np.isclose(motor.solid.burn_area(0), burn_area_total, atol=1e-12) - assert motor.solid.burn_area(0) > burn_area_radial \ No newline at end of file + assert motor.solid.burn_area(0) > burn_area_radial diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index 5e8906b3a..3db6e1fcf 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -280,6 +280,7 @@ def test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct( assert thrust_reshaped[1][1] == 100 * (tuple_parametric[1] / 7539.1875) assert thrust_reshaped[7][1] == 2034 * (tuple_parametric[1] / 7539.1875) + def test_only_radial_burn_parameter_effect(cesaroni_m1670): # Tests if the only_radial_burn flag is properly set motor = cesaroni_m1670 @@ -287,9 +288,15 @@ def test_only_radial_burn_parameter_effect(cesaroni_m1670): assert motor.only_radial_burn is True # When only_radial_burn is active, burn_area should consider only radial area - burn_area_radial = 2 * np.pi * (motor.grain_inner_radius(0) * motor.grain_height(0)) * motor.grain_number + burn_area_radial = ( + 2 + * np.pi + * (motor.grain_inner_radius(0) * motor.grain_height(0)) + * motor.grain_number + ) assert np.isclose(motor.burn_area(0), burn_area_radial, atol=1e-12) + def test_evaluate_geometry_updates_properties(cesaroni_m1670): # Checks if after instantiation, grain_inner_radius and grain_height are valid functions motor = cesaroni_m1670 @@ -302,9 +309,13 @@ def test_evaluate_geometry_updates_properties(cesaroni_m1670): values = motor.grain_inner_radius.y_array assert times[0] == 0 # expected initial time - assert values[0] == motor.grain_initial_inner_radius # expected initial inner radius - assert values[-1] <= motor.grain_outer_radius # final inner radius should be less or equal than outer radius + assert ( + values[0] == motor.grain_initial_inner_radius + ) # expected initial inner radius + assert ( + values[-1] <= motor.grain_outer_radius + ) # final inner radius should be less or equal than outer radius # Evaluates without error val = motor.grain_inner_radius(0.5) # evaluate at intermediate time - assert isinstance(val, float) \ No newline at end of file + assert isinstance(val, float) From 79e2a1c86c77add774ba879596d309308cf49172 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 2 Oct 2025 16:25:07 -0300 Subject: [PATCH 10/17] Unit tests Unit tests corrected. --- tests/integration/test_encoding.py | 1 - tests/unit/test_hybridmotor.py | 20 ++++++++++---------- tests/unit/test_solidmotor.py | 4 +--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/integration/test_encoding.py b/tests/integration/test_encoding.py index c2c0474cb..2fa85e682 100644 --- a/tests/integration/test_encoding.py +++ b/tests/integration/test_encoding.py @@ -5,7 +5,6 @@ import pytest from rocketpy._encoders import RocketPyDecoder, RocketPyEncoder - from rocketpy.tools import from_hex_decode diff --git a/tests/unit/test_hybridmotor.py b/tests/unit/test_hybridmotor.py index a89e453a9..e6b69d555 100644 --- a/tests/unit/test_hybridmotor.py +++ b/tests/unit/test_hybridmotor.py @@ -56,7 +56,7 @@ def test_hybrid_motor_basic_parameters(hybrid_motor): assert hybrid_motor.liquid.positioned_tanks[0]["position"] == 0.3 -def test_hybrid_motor_thrust_parameters(hybrid_motor, spherical_oxidizer_tank): +def test_hybrid_motor_thrust_parameters(hybrid_motor, oxidizer_tank): """Tests the HybridMotor class thrust parameters. Parameters @@ -77,13 +77,13 @@ def test_hybrid_motor_thrust_parameters(hybrid_motor, spherical_oxidizer_tank): * GRAIN_INITIAL_HEIGHT * GRAIN_NUMBER ) - initial_oxidizer_mass = spherical_oxidizer_tank.fluid_mass(0) + initial_oxidizer_mass = oxidizer_tank.fluid_mass(0) initial_mass = initial_grain_mass + initial_oxidizer_mass expected_exhaust_velocity = expected_total_impulse / initial_mass expected_mass_flow_rate = -expected_thrust / expected_exhaust_velocity expected_grain_mass_flow_rate = ( - expected_mass_flow_rate - spherical_oxidizer_tank.net_mass_flow_rate + expected_mass_flow_rate - oxidizer_tank.net_mass_flow_rate ) assert pytest.approx(hybrid_motor.thrust.y_array) == expected_thrust.y_array @@ -100,7 +100,7 @@ def test_hybrid_motor_thrust_parameters(hybrid_motor, spherical_oxidizer_tank): ) == expected_grain_mass_flow_rate(t) -def test_hybrid_motor_center_of_mass(hybrid_motor, spherical_oxidizer_tank): +def test_hybrid_motor_center_of_mass(hybrid_motor, oxidizer_tank): """Tests the HybridMotor class center of mass. Parameters @@ -110,11 +110,11 @@ def test_hybrid_motor_center_of_mass(hybrid_motor, spherical_oxidizer_tank): spherical_oxidizer_tank : rocketpy.SphericalTank The SphericalTank object to be used in the tests. """ - oxidizer_mass = spherical_oxidizer_tank.fluid_mass + oxidizer_mass = oxidizer_tank.fluid_mass grain_mass = hybrid_motor.solid.propellant_mass propellant_balance = grain_mass * GRAINS_CENTER_OF_MASS_POSITION + oxidizer_mass * ( - OXIDIZER_TANK_POSITION + spherical_oxidizer_tank.center_of_mass + OXIDIZER_TANK_POSITION + oxidizer_tank.center_of_mass ) balance = propellant_balance + DRY_MASS * CENTER_OF_DRY_MASS @@ -128,7 +128,7 @@ def test_hybrid_motor_center_of_mass(hybrid_motor, spherical_oxidizer_tank): assert pytest.approx(hybrid_motor.center_of_mass(t)) == center_of_mass(t) -def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank): +def test_hybrid_motor_inertia(hybrid_motor, oxidizer_tank): """Tests the HybridMotor class inertia. Parameters @@ -138,8 +138,8 @@ def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank): spherical_oxidizer_tank : rocketpy.SphericalTank The SphericalTank object to be used in the tests. """ - oxidizer_mass = spherical_oxidizer_tank.fluid_mass - oxidizer_inertia = spherical_oxidizer_tank.inertia + oxidizer_mass = oxidizer_tank.fluid_mass + oxidizer_inertia = oxidizer_tank.inertia grain_mass = hybrid_motor.solid.propellant_mass grain_inertia = hybrid_motor.solid.propellant_I_11 propellant_mass = oxidizer_mass + grain_mass @@ -153,7 +153,7 @@ def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank): oxidizer_mass * ( OXIDIZER_TANK_POSITION - + spherical_oxidizer_tank.center_of_mass + + oxidizer_tank.center_of_mass - hybrid_motor.center_of_propellant_mass ) ** 2 diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index 3db6e1fcf..cc5af9b43 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -20,13 +20,11 @@ @patch("matplotlib.pyplot.show") -def test_motor(mock_show, cesaroni_m1670): # pylint: disable=unused-argument +def test_motor(cesaroni_m1670): # pylint: disable=unused-argument """Tests the SolidMotor.all_info() method. Parameters ---------- - mock_show : mock - Mock of the matplotlib.pyplot.show function. cesaroni_m1670 : rocketpy.SolidMotor The SolidMotor object to be used in the tests. """ From 79c066cc8855aa47a42264a9434db657df88f7c6 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 2 Oct 2025 16:32:19 -0300 Subject: [PATCH 11/17] Integration mock_show correction mock_show removed from the integration test --- tests/integration/test_solidmotor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py index f10e2dc54..66e3c26f6 100644 --- a/tests/integration/test_solidmotor.py +++ b/tests/integration/test_solidmotor.py @@ -2,7 +2,7 @@ @patch("matplotlib.pyplot.show") -def test_solid_motor_info(mock_show, cesaroni_m1670): +def test_solid_motor_info(cesaroni_m1670): """Tests the SolidMotor.all_info() method. Parameters From f92cb645c98a2375a2686746ea96e6b2b44c3d81 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 2 Oct 2025 16:41:49 -0300 Subject: [PATCH 12/17] mock_show returned to unit tests mock_show returned to unit/test_solidmotor.py --- tests/unit/test_solidmotor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index cc5af9b43..3db6e1fcf 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -20,11 +20,13 @@ @patch("matplotlib.pyplot.show") -def test_motor(cesaroni_m1670): # pylint: disable=unused-argument +def test_motor(mock_show, cesaroni_m1670): # pylint: disable=unused-argument """Tests the SolidMotor.all_info() method. Parameters ---------- + mock_show : mock + Mock of the matplotlib.pyplot.show function. cesaroni_m1670 : rocketpy.SolidMotor The SolidMotor object to be used in the tests. """ From d9d99dd57b17b09692d0ac3e7c478a703ed6f2ff Mon Sep 17 00:00:00 2001 From: caioessouza Date: Thu, 2 Oct 2025 17:00:11 -0300 Subject: [PATCH 13/17] Integration problem solved # pylint: disable=unused-argument comment added to fix the tests --- tests/integration/test_solidmotor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py index 66e3c26f6..b22dccbea 100644 --- a/tests/integration/test_solidmotor.py +++ b/tests/integration/test_solidmotor.py @@ -2,7 +2,7 @@ @patch("matplotlib.pyplot.show") -def test_solid_motor_info(cesaroni_m1670): +def test_solid_motor_info(mock_show, cesaroni_m1670): # pylint: disable=unused-argument """Tests the SolidMotor.all_info() method. Parameters From cb3c3a2b8a95aca667d18889413239f44adff80a Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 3 Oct 2025 13:33:09 -0300 Subject: [PATCH 14/17] Ruff run again Runned ruff again to fit the python -m ruff format --check --- tests/integration/test_solidmotor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_solidmotor.py b/tests/integration/test_solidmotor.py index b22dccbea..a9aef6a8b 100644 --- a/tests/integration/test_solidmotor.py +++ b/tests/integration/test_solidmotor.py @@ -2,7 +2,7 @@ @patch("matplotlib.pyplot.show") -def test_solid_motor_info(mock_show, cesaroni_m1670): # pylint: disable=unused-argument +def test_solid_motor_info(mock_show, cesaroni_m1670): # pylint: disable=unused-argument """Tests the SolidMotor.all_info() method. Parameters From 8ebbc9007ea54cdd3be741fc4b0875522d593d0e Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 3 Oct 2025 14:11:16 -0300 Subject: [PATCH 15/17] Sugestions Update Sugestions made by @phmbressan implemented --- CHANGELOG.md | 4 +--- rocketpy/motors/hybrid_motor.py | 12 ++++++++++-- rocketpy/motors/solid_motor.py | 8 +++++++- tests/unit/test_solidmotor.py | 20 ++++++++++++++++++-- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd388d48c..507bf40b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,8 +32,6 @@ Attention: The newest changes should be on top --> ### Added - ENH: Enable only radial burning [#815](https://github.com/RocketPy-Team/RocketPy/pull/815) -- ENH: Controller (AirBrakes) and Sensors Encoding [#849] (https://github.com/RocketPy-Team/RocketPy/pull/849) -- EHN: Addition of ensemble variable to ECMWF dictionaries [#842] (https://github.com/RocketPy-Team/RocketPy/pull/842) - ENH: Tank Fluids with Variable Density from Temperature and Pressure [#852](https://github.com/RocketPy-Team/RocketPy/pull/852) - ENH: Controller (AirBrakes) and Sensors Encoding [#849](https://github.com/RocketPy-Team/RocketPy/pull/849) - EHN: Addition of ensemble variable to ECMWF dictionaries [#842](https://github.com/RocketPy-Team/RocketPy/pull/842) @@ -479,4 +477,4 @@ You can install this version by running `pip install rocketpy==1.0.1` ### Fixed - BUG: Remove NoseCone Warning [#428](https://github.com/RocketPy-Team/RocketPy/pull/428) -- BUG: motor coordinates [#423](https://github.com/RocketPy-Team/RocketPy/pull/423) +- BUG: motor coordinates [#423](https://github.com/RocketPy-Team/RocketPy/pull/423) \ No newline at end of file diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index b65bfb9b0..2e6652f06 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -193,8 +193,11 @@ class HybridMotor(Motor): HybridMotor.reference_pressure : int, float Atmospheric pressure in Pa at which the thrust data was recorded. It will allow to obtain the net thrust in the Flight class. - """ - + SolidMotor.only_radial_burn : bool + If True, grain regression is restricted to radial burn only (inner radius growth). + Grain length remains constant throughout the burn. Default is False. + """ + # pylint: disable=too-many-arguments def __init__( # pylint: disable=too-many-arguments self, thrust_source, @@ -314,6 +317,11 @@ class Function. Thrust units are Newtons. "nozzle_to_combustion_chamber". reference_pressure : int, float, optional Atmospheric pressure in Pa at which the thrust data was recorded. + only_radial_burn : boolean, optional + If True, inhibits the grain from burning axially, only computing + radial burn. If False, allows the grain to also burn + axially. May be useful for axially inhibited grains or hybrid motors. + Default is False. Returns ------- diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index ecfb23cb5..16fa4f84f 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -193,8 +193,10 @@ class SolidMotor(Motor): SolidMotor.reference_pressure : int, float Atmospheric pressure in Pa at which the thrust data was recorded. It will allow to obtain the net thrust in the Flight class. + SolidMotor.only_radial_burn : bool + If True, grain regression is restricted to radial burn only (inner radius growth). + Grain length remains constant throughout the burn. Default is False. """ - # pylint: disable=too-many-arguments def __init__( self, @@ -413,6 +415,10 @@ def exhaust_velocity(self): return Function( self.total_impulse / self.propellant_initial_mass ).set_discrete_based_on_model(self.thrust) + + @property + def only_radial_burn(self): + return self._only_radial_burn @property def propellant_initial_mass(self): diff --git a/tests/unit/test_solidmotor.py b/tests/unit/test_solidmotor.py index 3db6e1fcf..4f61a2dc2 100644 --- a/tests/unit/test_solidmotor.py +++ b/tests/unit/test_solidmotor.py @@ -282,7 +282,15 @@ def test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct( def test_only_radial_burn_parameter_effect(cesaroni_m1670): - # Tests if the only_radial_burn flag is properly set + """Tests the effect of the only_radial_burn parameter on burn area + calculation. When enabled, the burn area should only account for + the radial surface of the grains (no axial regression). + + Parameters + ---------- + cesaroni_m1670 : rocketpy.SolidMotor + The SolidMotor object used in the test. + """ motor = cesaroni_m1670 motor.only_radial_burn = True assert motor.only_radial_burn is True @@ -298,7 +306,15 @@ def test_only_radial_burn_parameter_effect(cesaroni_m1670): def test_evaluate_geometry_updates_properties(cesaroni_m1670): - # Checks if after instantiation, grain_inner_radius and grain_height are valid functions + """Tests if the grain geometry evaluation correctly updates SolidMotor + properties after instantiation. It ensures that grain geometry + functions are created and behave as expected. + + Parameters + ---------- + cesaroni_m1670 : rocketpy.SolidMotor + The SolidMotor object used in the test. + """ motor = cesaroni_m1670 assert hasattr(motor, "grain_inner_radius") From 292ab844063860f3a83dac77740a16e3d5f39ba9 Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 3 Oct 2025 14:13:54 -0300 Subject: [PATCH 16/17] Ruff format run Code formated using ruff --- rocketpy/motors/hybrid_motor.py | 5 +++-- rocketpy/motors/solid_motor.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rocketpy/motors/hybrid_motor.py b/rocketpy/motors/hybrid_motor.py index 2e6652f06..c72af6488 100644 --- a/rocketpy/motors/hybrid_motor.py +++ b/rocketpy/motors/hybrid_motor.py @@ -194,9 +194,10 @@ class HybridMotor(Motor): Atmospheric pressure in Pa at which the thrust data was recorded. It will allow to obtain the net thrust in the Flight class. SolidMotor.only_radial_burn : bool - If True, grain regression is restricted to radial burn only (inner radius growth). + If True, grain regression is restricted to radial burn only (inner radius growth). Grain length remains constant throughout the burn. Default is False. - """ + """ + # pylint: disable=too-many-arguments def __init__( # pylint: disable=too-many-arguments self, diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index 16fa4f84f..656bed0fd 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -194,9 +194,10 @@ class SolidMotor(Motor): Atmospheric pressure in Pa at which the thrust data was recorded. It will allow to obtain the net thrust in the Flight class. SolidMotor.only_radial_burn : bool - If True, grain regression is restricted to radial burn only (inner radius growth). + If True, grain regression is restricted to radial burn only (inner radius growth). Grain length remains constant throughout the burn. Default is False. """ + # pylint: disable=too-many-arguments def __init__( self, @@ -415,7 +416,7 @@ def exhaust_velocity(self): return Function( self.total_impulse / self.propellant_initial_mass ).set_discrete_based_on_model(self.thrust) - + @property def only_radial_burn(self): return self._only_radial_burn From b99afb153870076f081c2ea20bbc1c4241f43baa Mon Sep 17 00:00:00 2001 From: caioessouza Date: Fri, 3 Oct 2025 14:26:17 -0300 Subject: [PATCH 17/17] Removed @property # @property # def only_radial_burn(self): # return self._only_radial_burn removed for reasons of breaking tests --- rocketpy/motors/solid_motor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rocketpy/motors/solid_motor.py b/rocketpy/motors/solid_motor.py index 656bed0fd..ae5d95c76 100644 --- a/rocketpy/motors/solid_motor.py +++ b/rocketpy/motors/solid_motor.py @@ -417,9 +417,9 @@ def exhaust_velocity(self): self.total_impulse / self.propellant_initial_mass ).set_discrete_based_on_model(self.thrust) - @property - def only_radial_burn(self): - return self._only_radial_burn + # @property + # def only_radial_burn(self): + # return self._only_radial_burn @property def propellant_initial_mass(self):