Skip to content

Commit 7bd6b7d

Browse files
avoid breaking change with drag_coefficient
1 parent 2a7d335 commit 7bd6b7d

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

rocketpy/rocket/parachute.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def __init__(
125125
lag=0,
126126
noise=(0, 0, 0),
127127
radius=None,
128-
drag_coefficient=1.4,
129128
height=None,
130129
porosity=0.0432,
130+
drag_coefficient=1.4,
131131
):
132132
"""Initializes Parachute class.
133133
@@ -186,17 +186,6 @@ def __init__(
186186
``cd_s`` and ``drag_coefficient`` using:
187187
``radius = sqrt(cd_s / (drag_coefficient * pi))``.
188188
Units are in meters.
189-
drag_coefficient : float, optional
190-
Drag coefficient of the inflated canopy shape, used only when
191-
``radius`` is not provided. It relates the aerodynamic ``cd_s``
192-
to the physical canopy area via
193-
``cd_s = drag_coefficient * pi * radius**2``. Typical values:
194-
195-
- **1.4** — hemispherical canopy (default, NASA SP-8066)
196-
- **0.75** — flat circular canopy
197-
- **1.5** — extended-skirt canopy
198-
199-
Has no effect when ``radius`` is explicitly provided.
200189
height : float, optional
201190
Length of the unique semi-axis (height) of the inflated hemispheroid
202191
parachute. Default value is the radius of the parachute.
@@ -208,6 +197,17 @@ def __init__(
208197
value of 0.0432 is chosen so that the resulting
209198
``added_mass_coefficient`` equals approximately 1.0 ("neutral"
210199
added-mass behavior).
200+
drag_coefficient : float, optional
201+
Drag coefficient of the inflated canopy shape, used only when
202+
``radius`` is not provided. It relates the aerodynamic ``cd_s``
203+
to the physical canopy area via
204+
``cd_s = drag_coefficient * pi * radius**2``. Typical values:
205+
206+
- **1.4** — hemispherical canopy (default, NASA SP-8066)
207+
- **0.75** — flat circular canopy
208+
- **1.5** — extended-skirt canopy
209+
210+
Has no effect when ``radius`` is explicitly provided.
211211
"""
212212
self.name = name
213213
self.cd_s = cd_s

rocketpy/rocket/rocket.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,9 +1503,9 @@ def add_parachute(
15031503
lag=0,
15041504
noise=(0, 0, 0),
15051505
radius=None,
1506-
drag_coefficient=1.4,
15071506
height=None,
15081507
porosity=0.0432,
1508+
drag_coefficient=1.4,
15091509
):
15101510
"""Creates a new parachute, storing its parameters such as
15111511
opening delay, drag coefficients and trigger function.
@@ -1570,11 +1570,6 @@ def add_parachute(
15701570
`cd_s` and `drag_coefficient` using:
15711571
`radius = sqrt(cd_s / (drag_coefficient * pi))`.
15721572
Units are in meters.
1573-
drag_coefficient : float, optional
1574-
Drag coefficient of the inflated canopy shape, used only when
1575-
`radius` is not provided. Typical values: 1.4 for hemispherical
1576-
canopies (default), 0.75 for flat circular canopies, 1.5 for
1577-
extended-skirt canopies. Has no effect when `radius` is given.
15781573
height : float, optional
15791574
Length of the unique semi-axis (height) of the inflated hemispheroid
15801575
parachute. Default value is the radius of the parachute.
@@ -1585,6 +1580,11 @@ def add_parachute(
15851580
during descent; it does not change `cd_s` (drag). The default
15861581
value of 0.0432 yields an `added_mass_coefficient` of
15871582
approximately 1.0 ("neutral" added-mass behavior).
1583+
drag_coefficient : float, optional
1584+
Drag coefficient of the inflated canopy shape, used only when
1585+
`radius` is not provided. Typical values: 1.4 for hemispherical
1586+
canopies (default), 0.75 for flat circular canopies, 1.5 for
1587+
extended-skirt canopies. Has no effect when `radius` is given.
15881588
15891589
Returns
15901590
-------

0 commit comments

Comments
 (0)