From 0bc28626a1c023a60fafad78dd1f546dbb0b2e53 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Fri, 20 Nov 2026 14:26:58 -0300 Subject: [PATCH 1/3] 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 --- docs/user/rocket/rocket_usage.rst | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/docs/user/rocket/rocket_usage.rst b/docs/user/rocket/rocket_usage.rst index 1fcb44283..bb98f5051 100644 --- a/docs/user/rocket/rocket_usage.rst +++ b/docs/user/rocket/rocket_usage.rst @@ -102,15 +102,29 @@ positional arguments, in order: ``alpha`` and ``beta`` are the angle of attack and sideslip angle in radians. The angular rates are expressed in radians per second in the rocket body frame. -For example, a model based on angle of attack and Mach number can ignore the -other inputs: + +.. note:: + + - ``alpha`` and ``beta`` are two separate signed angles, and neither is + the total angle of attack. ``alpha`` is measured in the pitch plane (the + rocket axis and the body y axis) and ``beta`` in the yaw plane (the + rocket axis and the body x axis). Drag that depends on the total angle + of attack has to combine both, for example through + ``alpha**2 + beta**2``, which is the square of the total angle for the + small angles of a normal flight. + - ``reynolds`` uses the rocket **diameter** as the reference length. Many + tools use the rocket length instead, so check which one your drag data + was built with. + +For example, a model based on the total angle of attack and Mach number can +ignore the other inputs: .. code-block:: python def drag_coefficient( - alpha, _beta, mach, _reynolds, _pitch_rate, _yaw_rate, _roll_rate + alpha, beta, mach, _reynolds, _pitch_rate, _yaw_rate, _roll_rate ): - return 0.38 + 0.08 * mach**2 + 0.6 * alpha**2 + return 0.38 + 0.08 * mach**2 + 0.6 * (alpha**2 + beta**2) rocket = Rocket( radius=0.0635, @@ -135,6 +149,13 @@ defines drag as a function of angle of attack and Mach number: 0.1,0.5,0.32 0.1,1.0,0.48 +.. note:: + + Fill in every combination of the values in the table. If one combination + is missing, the file still loads and no warning is given, but RocketPy + then interpolates between scattered points instead of along the grid, and + the drag coefficient it returns between the points changes. + For backward compatibility, ``rocket.power_off_drag`` and ``rocket.power_on_drag`` expose the Mach-only slice of each model, with the other six inputs set to zero. Use ``rocket.power_off_drag_7d`` and From 150026f82446995e330d76af0dbdc30a6649356d Mon Sep 17 00:00:00 2001 From: MateusStano Date: Sat, 21 Nov 2026 21:43:12 -0300 Subject: [PATCH 2/3] DOC: clarify the angles, the Reynolds length and the grid of drag inputs Co-Authored-By: Claude Opus 5.5 --- docs/user/rocket/rocket_usage.rst | 38 ++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/user/rocket/rocket_usage.rst b/docs/user/rocket/rocket_usage.rst index bb98f5051..057946166 100644 --- a/docs/user/rocket/rocket_usage.rst +++ b/docs/user/rocket/rocket_usage.rst @@ -100,24 +100,32 @@ positional arguments, in order: ``alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate`` -``alpha`` and ``beta`` are the angle of attack and sideslip angle in radians. -The angular rates are expressed in radians per second in the rocket body frame. +``alpha`` and ``beta`` are the partial angle of attack and the sideslip angle in +radians, as defined in :ref:`genericsurfaces`. They match +:meth:`rocketpy.Flight.partial_angle_of_attack` and +:meth:`rocketpy.Flight.angle_of_sideslip`, which are in degrees. The total +angle is :meth:`rocketpy.Flight.angle_of_attack`. The angular rates are +expressed in radians per second in the rocket body frame. .. note:: - ``alpha`` and ``beta`` are two separate signed angles, and neither is the total angle of attack. ``alpha`` is measured in the pitch plane (the rocket axis and the body y axis) and ``beta`` in the yaw plane (the - rocket axis and the body x axis). Drag that depends on the total angle - of attack has to combine both, for example through + rocket axis and the body x axis). Each goes from -pi to pi, and reaches + pi when the rocket flies tail first. Drag that depends on the total + angle of attack has to combine both, for example through ``alpha**2 + beta**2``, which is the square of the total angle for the - small angles of a normal flight. - - ``reynolds`` uses the rocket **diameter** as the reference length. Many - tools use the rocket length instead, so check which one your drag data - was built with. + small angles of a normal flight. Both can be negative, and a table that + stops at zero returns its edge value for them, so tabulate the negative + angles too (a callable can use ``abs``). + - ``reynolds`` uses the rocket **diameter** (twice the ``radius`` given to + ``Rocket``) as the reference length. Some tools use the rocket length + instead, so check which one your drag data was built with. For example, a model based on the total angle of attack and Mach number can -ignore the other inputs: +ignore the other inputs. Its angle term is only meant for small angles: at +``alpha = pi`` it adds about 5.9 to the drag coefficient. .. code-block:: python @@ -144,6 +152,8 @@ defines drag as a function of angle of attack and Mach number: .. code-block:: text alpha,mach,cd + -0.1,0.5,0.32 + -0.1,1.0,0.48 0.0,0.5,0.30 0.0,1.0,0.45 0.1,0.5,0.32 @@ -151,10 +161,12 @@ defines drag as a function of angle of attack and Mach number: .. note:: - Fill in every combination of the values in the table. If one combination - is missing, the file still loads and no warning is given, but RocketPy - then interpolates between scattered points instead of along the grid, and - the drag coefficient it returns between the points changes. + Fill in every combination of the values in the table, and write each value + the same way in every row. If a combination is missing, a row is repeated + or a value differs in any digit (0.3 and 0.30000000000000004), the file + still loads and no warning is given, but RocketPy interpolates between + scattered points instead of along the grid, and the drag coefficient + changes both between and outside the points. For backward compatibility, ``rocket.power_off_drag`` and ``rocket.power_on_drag`` expose the Mach-only slice of each model, with the From e77aecc51939b70c6d512265cb427645926190de Mon Sep 17 00:00:00 2001 From: MateusStano Date: Mon, 23 Nov 2026 18:45:03 -0300 Subject: [PATCH 3/3] DOC: say the drag model takes the angles in radians, not in degrees Co-Authored-By: Claude Opus 5.5 --- docs/user/rocket/rocket_usage.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/user/rocket/rocket_usage.rst b/docs/user/rocket/rocket_usage.rst index 057946166..efaccfb96 100644 --- a/docs/user/rocket/rocket_usage.rst +++ b/docs/user/rocket/rocket_usage.rst @@ -101,11 +101,12 @@ positional arguments, in order: ``alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate`` ``alpha`` and ``beta`` are the partial angle of attack and the sideslip angle in -radians, as defined in :ref:`genericsurfaces`. They match +radians, as defined in :ref:`genericsurfaces`. They are the same angles as :meth:`rocketpy.Flight.partial_angle_of_attack` and -:meth:`rocketpy.Flight.angle_of_sideslip`, which are in degrees. The total -angle is :meth:`rocketpy.Flight.angle_of_attack`. The angular rates are -expressed in radians per second in the rocket body frame. +:meth:`rocketpy.Flight.angle_of_sideslip`, but the drag model receives them in +radians, while those Flight attributes are in degrees. The total angle is +:meth:`rocketpy.Flight.angle_of_attack`. The angular rates are expressed in +radians per second in the rocket body frame. .. note::