Skip to content

Commit bcfeb9a

Browse files
MateusStanoclaude
andauthored
DOC: add notes on the inputs of the drag coefficient models (#1232)
* DOC: add notes on the inputs of the drag coefficient models - alpha and beta are separate signed angles, to be combined for the total angle of attack. The example now uses both. - The Reynolds number uses the rocket diameter as reference length. - A drag CSV with a missing combination loads, but interpolates differently. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * DOC: clarify the angles, the Reynolds length and the grid of drag inputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DOC: say the drag model takes the angles in radians, not in degrees Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 447ed79 commit bcfeb9a

1 file changed

Lines changed: 40 additions & 6 deletions

File tree

‎docs/user/rocket/rocket_usage.rst‎

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,40 @@ positional arguments, in order:
100100

101101
``alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate``
102102

103-
``alpha`` and ``beta`` are the angle of attack and sideslip angle in radians.
104-
The angular rates are expressed in radians per second in the rocket body frame.
105-
For example, a model based on angle of attack and Mach number can ignore the
106-
other inputs:
103+
``alpha`` and ``beta`` are the partial angle of attack and the sideslip angle in
104+
radians, as defined in :ref:`genericsurfaces`. They are the same angles as
105+
:meth:`rocketpy.Flight.partial_angle_of_attack` and
106+
:meth:`rocketpy.Flight.angle_of_sideslip`, but the drag model receives them in
107+
radians, while those Flight attributes are in degrees. The total angle is
108+
:meth:`rocketpy.Flight.angle_of_attack`. The angular rates are expressed in
109+
radians per second in the rocket body frame.
110+
111+
.. note::
112+
113+
- ``alpha`` and ``beta`` are two separate signed angles, and neither is
114+
the total angle of attack. ``alpha`` is measured in the pitch plane (the
115+
rocket axis and the body y axis) and ``beta`` in the yaw plane (the
116+
rocket axis and the body x axis). Each goes from -pi to pi, and reaches
117+
pi when the rocket flies tail first. Drag that depends on the total
118+
angle of attack has to combine both, for example through
119+
``alpha**2 + beta**2``, which is the square of the total angle for the
120+
small angles of a normal flight. Both can be negative, and a table that
121+
stops at zero returns its edge value for them, so tabulate the negative
122+
angles too (a callable can use ``abs``).
123+
- ``reynolds`` uses the rocket **diameter** (twice the ``radius`` given to
124+
``Rocket``) as the reference length. Some tools use the rocket length
125+
instead, so check which one your drag data was built with.
126+
127+
For example, a model based on the total angle of attack and Mach number can
128+
ignore the other inputs. Its angle term is only meant for small angles: at
129+
``alpha = pi`` it adds about 5.9 to the drag coefficient.
107130

108131
.. code-block:: python
109132
110133
def drag_coefficient(
111-
alpha, _beta, mach, _reynolds, _pitch_rate, _yaw_rate, _roll_rate
134+
alpha, beta, mach, _reynolds, _pitch_rate, _yaw_rate, _roll_rate
112135
):
113-
return 0.38 + 0.08 * mach**2 + 0.6 * alpha**2
136+
return 0.38 + 0.08 * mach**2 + 0.6 * (alpha**2 + beta**2)
114137
115138
rocket = Rocket(
116139
radius=0.0635,
@@ -130,11 +153,22 @@ defines drag as a function of angle of attack and Mach number:
130153
.. code-block:: text
131154
132155
alpha,mach,cd
156+
-0.1,0.5,0.32
157+
-0.1,1.0,0.48
133158
0.0,0.5,0.30
134159
0.0,1.0,0.45
135160
0.1,0.5,0.32
136161
0.1,1.0,0.48
137162
163+
.. note::
164+
165+
Fill in every combination of the values in the table, and write each value
166+
the same way in every row. If a combination is missing, a row is repeated
167+
or a value differs in any digit (0.3 and 0.30000000000000004), the file
168+
still loads and no warning is given, but RocketPy interpolates between
169+
scattered points instead of along the grid, and the drag coefficient
170+
changes both between and outside the points.
171+
138172
For backward compatibility, ``rocket.power_off_drag`` and
139173
``rocket.power_on_drag`` expose the Mach-only slice of each model, with the
140174
other six inputs set to zero. Use ``rocket.power_off_drag_7d`` and

0 commit comments

Comments
 (0)