Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Attention: The newest changes should be on top -->

### Fixed

- BUG: Add explicit timeouts to ThrustCurve API requests [#935](https://github.com/RocketPy-Team/RocketPy/pull/935)
-

## [v1.12.0] - 2026-03-08

Expand Down Expand Up @@ -71,6 +71,8 @@ Attention: The newest changes should be on top -->

### Fixed

- BUG: Restore `Rocket.power_off_drag` and `Rocket.power_on_drag` as `Function` objects while preserving raw inputs in `power_off_drag_input` and `power_on_drag_input` [#941](https://github.com/RocketPy-Team/RocketPy/pull/941)
- BUG: Add explicit timeouts to ThrustCurve API requests [#935](https://github.com/RocketPy-Team/RocketPy/pull/935)
- BUG: Fix hard-coded radius value for parachute added mass calculation [#889](https://github.com/RocketPy-Team/RocketPy/pull/889)
- DOC: Fix documentation build [#908](https://github.com/RocketPy-Team/RocketPy/pull/908)
- BUG: energy_data plot not working for 3 dof sims [[#906](https://github.com/RocketPy-Team/RocketPy/issues/906)]
Expand Down
13 changes: 13 additions & 0 deletions rocketpy/rocket/point_mass_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ class PointMassRocket(Rocket):
center_of_mass_without_motor : float
Position, in meters, of the rocket's center of mass without motor
relative to the rocket's coordinate system.
power_off_drag : Function
Rocket's drag coefficient as a function of Mach number when the
motor is off. Alias for ``power_off_drag_by_mach``.
power_on_drag : Function
Rocket's drag coefficient as a function of Mach number when the
motor is on. Alias for ``power_on_drag_by_mach``.
power_off_drag_input : int, float, callable, array, string, Function
Original user input for the drag coefficient with motor off.
Preserved for reconstruction and Monte Carlo workflows.
power_on_drag_input : int, float, callable, array, string, Function
Original user input for the drag coefficient with motor on.
Preserved for reconstruction and Monte Carlo workflows.
power_off_drag_7d : Function
Drag coefficient function with seven inputs in the order:
alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate.
Expand All @@ -53,6 +65,7 @@ class PointMassRocket(Rocket):
Convenience wrapper for power-on drag as a Mach-only function.
"""


def __init__(
self,
radius: float,
Expand Down
23 changes: 16 additions & 7 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,18 @@ class Rocket:
Rocket.static_margin : float
Float value corresponding to rocket static margin when
loaded with propellant in units of rocket diameter or calibers.
Rocket.power_off_drag : int, float, callable, string, array, Function
Rocket.power_off_drag : Function
Rocket's drag coefficient as a function of Mach number when the
motor is off. Alias for ``power_off_drag_by_mach``.
Rocket.power_on_drag : Function
Rocket's drag coefficient as a function of Mach number when the
motor is on. Alias for ``power_on_drag_by_mach``.
Rocket.power_off_drag_input : int, float, callable, string, array, Function
Original user input for rocket's drag coefficient when the motor is
off. This is preserved for reconstruction and Monte Carlo workflows.
Rocket.power_on_drag : int, float, callable, string, array, Function
off. Preserved for reconstruction and Monte Carlo workflows.
Rocket.power_on_drag_input : int, float, callable, string, array, Function
Original user input for rocket's drag coefficient when the motor is
on. This is preserved for reconstruction and Monte Carlo workflows.
on. Preserved for reconstruction and Monte Carlo workflows.
Rocket.power_off_drag_7d : Function
Rocket's drag coefficient with motor off as a 7D function of
(alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate).
Expand Down Expand Up @@ -375,9 +381,12 @@ def __init__( # pylint: disable=too-many-statements
interpolation="linear",
extrapolation="constant",
)
# Saving user input for monte carlo
self.power_off_drag = power_off_drag
self.power_on_drag = power_on_drag
# Saving raw user input for reconstruction and Monte Carlo
self._power_off_drag_input = power_off_drag
self._power_on_drag_input = power_on_drag
# Public API attributes: keep as Function (Mach-only) for backward compatibility
self.power_off_drag = self.power_off_drag_by_mach
self.power_on_drag = self.power_on_drag_by_mach

# Create a, possibly, temporary empty motor
# self.motors = Components() # currently unused, only 1 motor is supported
Expand Down
Loading