Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
32fe618
ENH: first aero refactor draft
MateusStano Jun 23, 2026
b45178f
ENH: second draft
MateusStano Jun 27, 2026
e76c31c
TST: add tests
MateusStano Jul 2, 2026
b0c5233
MNT: polish event and flight-phase helper docstrings
MateusStano Jul 10, 2026
63cad27
ENH: rework aerodynamic coefficients onto a body-frame GenericSurface
MateusStano Jul 10, 2026
f6dd040
DOC: improve generic_surfaces rst
MateusStano Jul 10, 2026
a2c617c
TST: rebuild calisto_linear_generic from extracted Barrowman curves
MateusStano Jul 10, 2026
fb236c6
ENH: add force convention to LinearGenericSurface
MateusStano Jul 11, 2026
8fd3b16
ENH: apply review changes
MateusStano Jul 23, 2026
c926bdd
DOC: creat CP rst page and review reference docs
MateusStano Jul 24, 2026
3260573
TST: minor fixes
MateusStano Jul 25, 2026
84d3b6a
TST: minor fixes
MateusStano Jul 25, 2026
8dfb153
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Sep 19, 2026
bdd4a8c
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Sep 20, 2026
aac6a1b
ENH: stability, generic surface and disturbance response rework
MateusStano Oct 4, 2026
052babd
DOC: update stability and generic surface guides
MateusStano Oct 4, 2026
f315df7
ENH: rate derivatives on GenericSurface
MateusStano Oct 4, 2026
841ad04
DOC: remove a broken link from the stability guide
MateusStano Oct 4, 2026
f107bb7
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Oct 5, 2026
a6fb24f
ENH: switch aerodynamic surfaces on and off with event commands
MateusStano Oct 5, 2026
ee92cdc
MNT: give the generic surfaces one argument order, keyword-only after…
MateusStano Oct 5, 2026
b1b2eff
DOC: explain which drag a rocket with generic surfaces uses
MateusStano Oct 5, 2026
1fbf86b
STY: fix pylint warnings
MateusStano Oct 5, 2026
8ec2c8b
STY: ruff update
MateusStano Oct 5, 2026
b5d20ca
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Oct 5, 2026
17d32fe
STY: put the unused-argument disable where pylint 4.1 reads it
MateusStano Oct 5, 2026
7a45b2f
DOC: restore the soundings sections removed by accident
MateusStano Nov 15, 2026
1cad123
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Nov 20, 2026
b547e63
BUG: let a drag curve worked out from the rocket's own be assigned back
MateusStano Nov 21, 2026
798df34
BUG: read a loosely named variable in a two-column coefficient file
MateusStano Nov 21, 2026
2d01dec
BUG: return an array from a grid lookup given sequences of one value
MateusStano Nov 21, 2026
06baeeb
BUG: refuse an unknown plane and a time after the flight in disturban…
MateusStano Nov 21, 2026
31a6db6
BUG: save each plot of stability_and_control_data to its own file
MateusStano Nov 21, 2026
9366972
ENH: draw the rocket in the plane that is asked for
MateusStano Nov 21, 2026
84ec884
ENH: print N/A where the rocket does not oscillate
MateusStano Nov 21, 2026
b6044af
DOC: say what com_to_cdm_function measures
MateusStano Nov 21, 2026
abf398e
BUG: keep the surfaces a flight's events switched when it is loaded
MateusStano Nov 21, 2026
0e44122
BUG: count the surfaces active at each instant in the flight's stability
MateusStano Nov 21, 2026
a388799
DOC: define the cant angle and the direction it rolls the rocket
MateusStano Nov 21, 2026
5d83040
BUG: keep a linear surface given in the wind frame linear in that frame
MateusStano Nov 21, 2026
32ac87c
DOC: list the changes to cl and to the interpolation of grid tables
MateusStano Nov 21, 2026
26e2b67
Merge branch 'enh/events' into enh/aero-refactor
MateusStano Nov 30, 2026
e632e40
BUG: accept a coefficient function not defined with the air at rest
MateusStano Dec 6, 2026
91810e2
DOC: list the changes to flight results and to grid tables in the cha…
MateusStano Dec 6, 2026
f9c8d22
ENH: Controller Implementation Refactor (#1065)
MateusStano Dec 6, 2026
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
17 changes: 17 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,29 @@ good-names=FlightPhases,
R_uncanted,
R_body_to_fin,
Re, # Reynolds number
cL_alpha,
cQ_beta,
cN_alpha,
cY_beta,
cL,
cD,
cQ,
cN,
cY,
cA,
cNf,
cNd,
cYf,
cYd,
cAf,
cAd,

# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs= ^[a-z][0-9]?$, # Single lowercase characters, possibly followed by a single digit
^[A-Z][0-9]{0,2}$, # Single uppercase characters, possibly followed by one or two digits
^[A-Z]+_\d+(_dot)?$, # Uppercase characters followed by underscore and digits, optionally followed by _dot
^[A-Z][0-9]_[a-z]+$, # An equation symbol with a lowercase suffix, such as M1_cm
^(dry_|propellant_)[A-Z]+_\d+$, # Variables starting with 'dry_' or 'propellant_', followed by uppercase characters, underscore, and digits
^[a-z]+_ISA$, # Lowercase words ending with '_ISA'
^plot(1D|2D)$, # Variables starting with 'plot' followed by '1D' or '2D'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ Attention: The newest changes should be on top -->

### Changed

- ENH: `cl` of an aerodynamic surface (nose cones, fins, tails and generic surfaces) is now its roll moment coefficient. What `surface.cl(alpha, mach)` used to return is the normal force coefficient, now `surface.cN(alpha, 0, mach, 0, 0, 0, 0)`; `surface.cL` is the lift coefficient in the wind frame. The name was reused, so no warning can be given: update code that calls `cl` for the lift. [#1064](https://github.com/RocketPy-Team/RocketPy/pull/1064)
- ENH: a table of two or more inputs whose points form a complete grid is now interpolated linearly on that grid by default, where it used `shepard`. This holds for `Function` and for every coefficient given as such a table, and changes the values between the points and outside the grid, where the table now extends its edge cells in a straight line without bound. Pass `interpolation="shepard"` to get the previous values, or `extrapolation="constant"` to keep the values outside the grid within the data. Coefficients given to a `GenericSurface` already hold their edge values. [#1064](https://github.com/RocketPy-Team/RocketPy/pull/1064)

### Fixed

- BUG: Flight results change for any flight with propellant and a side load, such as a crosswind. In the default `standard` equations of motion, the aerodynamic moments are now taken about the center of mass of the rocket with its propellant, where they were taken about its center of dry mass. The drag given to `Rocket` now acts along the rocket axis only, so the drag force carries the cosine of the total angle of attack. [#1064](https://github.com/RocketPy-Team/RocketPy/pull/1064)

## [v1.14.0] - 2026-11-29

### Breaking changes
Expand Down
Empty file.
100 changes: 100 additions & 0 deletions data/monte_carlo/stability_dispersion.inputs.txt

Large diffs are not rendered by default.

100 changes: 100 additions & 0 deletions data/monte_carlo/stability_dispersion.outputs.txt

Large diffs are not rendered by default.

53 changes: 8 additions & 45 deletions docs/examples/camoes_flight_sim.ipynb

Large diffs are not rendered by default.

837 changes: 639 additions & 198 deletions docs/notebooks/getting_started.ipynb

Large diffs are not rendered by default.

39 changes: 16 additions & 23 deletions docs/notebooks/sensors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,10 @@
"outputs": [],
"source": [
"def controller_function(context):\n",
" time = context.time\n",
" sampling_rate = context.sampling_rate\n",
" state = context.state\n",
" previous_state = context.previous_state\n",
" air_brakes = context.controlled.air_brakes\n",
" sensors = context.sensors\n",
" air_brakes = context.controls.air_brakes\n",
" environment = context.environment\n",
"\n",
" altitude_ASL = state.z\n",
Expand All @@ -474,13 +472,17 @@
" free_stream_speed = ((wind_x - vx) ** 2 + (wind_y - vy) ** 2 + (vz) ** 2) ** 0.5\n",
" mach_number = free_stream_speed / environment.speed_of_sound(altitude_ASL)\n",
"\n",
" deployment_level = air_brakes.deployment_level\n",
"\n",
" # Get the state from the previous controller call\n",
" previous_vz = previous_state.vz if previous_state is not None else vz\n",
"\n",
" # Keep the Mach number with its time, to read after the flight\n",
" context.record(mach_number=mach_number)\n",
"\n",
" # Check if the rocket has reached burnout\n",
" accelerometer = sensors[0]\n",
" if accelerometer.measurement[2] > 0:\n",
" return None\n",
" if context.sensors.accelerometer_in_nosecone.az > 0:\n",
" return\n",
"\n",
" # If below 1500 meters above ground level, air_brakes are not deployed\n",
" if altitude_AGL < 1500:\n",
Expand All @@ -489,31 +491,22 @@
" # Else calculate the deployment level\n",
" else:\n",
" # Controller logic\n",
" new_deployment_level = (\n",
" air_brakes.deployment_level + 0.1 * vz + 0.01 * previous_vz**2\n",
" )\n",
" new_deployment_level = deployment_level + 0.1 * vz + 0.01 * previous_vz**2\n",
"\n",
" # Limiting the speed of the air_brakes to 0.2 per second\n",
" # Since this function is called every 1/sampling_rate seconds\n",
" # the max change in deployment level per call is 0.2/sampling_rate\n",
" max_change = 0.2 / sampling_rate\n",
" lower_bound = air_brakes.deployment_level - max_change\n",
" upper_bound = air_brakes.deployment_level + max_change\n",
" new_deployment_level = min(max(new_deployment_level, lower_bound), upper_bound)\n",
"\n",
" air_brakes.deployment_level = new_deployment_level\n",
"\n",
" # Return variables of interest to be saved in the observed_variables list\n",
" return (\n",
" time,\n",
" air_brakes.deployment_level,\n",
" air_brakes.drag_coefficient(air_brakes.deployment_level, mach_number),\n",
" )"
" lower_bound = deployment_level - max_change\n",
" upper_bound = deployment_level + max_change\n",
" air_brakes.deployment_level = min(\n",
" max(new_deployment_level, lower_bound), upper_bound\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -523,10 +516,10 @@
" sampling_rate=10,\n",
" reference_area=None,\n",
" clamp=True,\n",
" initial_observed_variables=[0, 0, 0],\n",
" override_rocket_drag=False,\n",
" name=\"AirBrakes\",\n",
" controller_name=\"AirBrakes Controller\",\n",
" position=-0.5, # where the air brakes are, in meters\n",
")"
]
},
Expand Down
9 changes: 9 additions & 0 deletions docs/reference/classes/Commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Commands Class
--------------

What an event's trigger or callback asks of the flight, reached as
``context.commands``. It is not part of RocketPy's top-level namespace. See
:ref:`eventusage` for examples of each command.

.. autoclass:: rocketpy.simulation.events.commands.Commands
:members:
8 changes: 1 addition & 7 deletions docs/reference/classes/EventContext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ EventContext Class
------------------

.. autoclass:: rocketpy.EventContext
:members: time, state, state_dot, previous_state, previous_time, height_agl, pressure, step_size, sampling_rate, event, flight, rocket, environment, phase, sensors, sensors_by_name, controller, controlled

Controlled Class
----------------

.. autoclass:: rocketpy.control.controlled.Controlled
:members:
:members: time, state, state_dot, previous_state, previous_time, height_agl, conditions, pressure, density, speed_of_sound, wind_velocity, stream_velocity, stream_speed, mach, dt, sampling_rate, event, memory, commands, rocket, environment, phase_name, sensors, controls, outputs, record
15 changes: 15 additions & 0 deletions docs/reference/classes/EventViews.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Event View Classes
------------------

What ``context.controls``, ``context.outputs`` and ``context.sensors`` return
inside an event or controller function. They are not part of RocketPy's
top-level namespace and are not built by the user.

.. autoclass:: rocketpy.simulation.events.views.ControlsView
:members:

.. autoclass:: rocketpy.simulation.events.views.OutputsView
:members:

.. autoclass:: rocketpy.simulation.events.views.SensorsView
:members:
7 changes: 7 additions & 0 deletions docs/reference/classes/FlightDataExporter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FlightDataExporter Class
------------------------

Writes a flight's results to files, reached as ``flight.exports``.

.. autoclass:: rocketpy.simulation.flight_data_exporter.FlightDataExporter
:members:
3 changes: 3 additions & 0 deletions docs/reference/classes/Function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ Function Classes
.. seealso:: :doc:`Function Class Usage </user/function>`

.. autoclass:: rocketpy.Function
:members:

.. autoclass:: rocketpy.PiecewiseFunction
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/PointMassRocket.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PointMassRocket Class
---------------------

.. autoclass:: rocketpy.PointMassRocket
:members:
66 changes: 39 additions & 27 deletions docs/reference/classes/Solution.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
Solution Classes
----------------

These classes hold the state history produced by a :class:`rocketpy.Flight`
simulation. They are not part of RocketPy's top-level namespace; a flight's
solution is reached through :attr:`Flight.solution <rocketpy.Flight.solution>`.
These classes hold everything a :class:`rocketpy.Flight` simulation produced
over time, as raw numbers. They are not part of RocketPy's top-level
namespace; a flight's solution is reached through
:attr:`Flight.solution <rocketpy.Flight.solution>`.

Every quantity the flight knows at each stored row is read by name, as an
attribute or as a key, and comes back as an ``(n, 2)`` array of time and
value:

.. code-block:: python
flight.solution.vz # an integrated state
flight.solution.az # a variable worked out from the states
flight.solution.controls.canards.fin_1 # a control input, by controllable
flight.solution["vz"], flight.solution["canards.fin_1"] # the same, by name
flight.solution.names # everything it holds
flight.solution.at(3.0) # all of it at the nearest stored time
The states are the 13 the flight integrates (position, velocity, attitude
and angular rates) plus any state a controllable adds. The variables worked
out from them are the ones a flight phase computes on its way to each state
derivative without integrating them: the accelerations, the aerodynamic
forces and moments, the net thrust. They are worked out again after the
flight the first time one is read, from the stored rows and their control
inputs, and kept; a flight read back from a file cannot report them, since
that needs the equations of motion.

The flight's own :attr:`Flight.az <rocketpy.Flight.az>` and its companions,
and ``flight.controls.canards.fin_1``, wrap these arrays as a
:class:`Function <rocketpy.Function>`, which can be plotted and evaluated at
any time. Reach for the solution when you want the values exactly as the
simulation stored them.

What the sensors read sits in the solution too, at the sensors' own sampling
times rather than the solver's rows: ``flight.solution.sensors.barometer.pressure``
is the ``(n, 2)`` array of readings, and ``flight.sensor_history`` the same as
Functions. What events recorded with ``context.record`` is the user's own
data, kept exactly as given in ``flight.records``, not in the solution.

The ``Solution`` holds every row of the flight in one list, in the order they
were flown. The flight phases sit alongside it, each saying where its own rows
Expand All @@ -27,35 +62,12 @@ For a rocket with a drogue and a main parachute it prints something like:
Main_parachute_descent 59
:meth:`Solution.phase_span` gives where a phase's rows begin and end, so
``flight.solution[start:stop]``, ``flight.solution["vz"][start:stop]`` and
``flight.solution[start:stop]``, ``flight.solution.vz[start:stop]`` and
``flight.solution.canonical_array[start:stop]`` read just that phase.

.. autoclass:: rocketpy.simulation.solution.Solution
:members:

Post-process variables
~~~~~~~~~~~~~~~~~~~~~~

On its way to each state derivative, a flight phase works out quantities it
never integrates: the accelerations, the aerodynamic forces and moments, and
the net thrust. Read them through ``flight.solution.post``:

.. code-block:: python
post = flight.solution.post
post.names # every variable this flight computes
post["az"] # its [t, value] history over the whole flight
post.at(3.0) # every variable at the nearest stored time
The same values back the flight's own :attr:`Flight.az <rocketpy.Flight.az>`
and its companions, which wrap them as a
:class:`Function <rocketpy.Function>` so they can be plotted and evaluated at
any time. Reach for ``post`` when you want the values exactly as the simulation
stored them, without interpolation.

.. autoclass:: rocketpy.simulation.solution.PostProcessSolution
:members:

The phase objects themselves are internal to RocketPy for now, so their shape
may change between releases. These are the values worth reading off one:

Expand Down
5 changes: 5 additions & 0 deletions docs/reference/classes/aero_surfaces/AeroCoefficient.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AeroCoefficient Class
---------------------

.. autoclass:: rocketpy.AeroCoefficient
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/aero_surfaces/ControlFins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ControlFins Class
-----------------

.. autoclass:: rocketpy.ControlFins
:members:
3 changes: 3 additions & 0 deletions docs/reference/classes/aero_surfaces/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ AeroSurface Classes
TrapezoidalFins
EllipticalFins
FreeFormFins
_BaseFin
TubeFins
Fin
TrapezoidalFin
EllipticalFin
FreeFormFin
ControlFins
RailButtons
AirBrakes
GenericSurface
LinearGenericSurface
AeroCoefficient
5 changes: 5 additions & 0 deletions docs/reference/classes/control/continuous_controller.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ContinuousController Class
--------------------------

.. autoclass:: rocketpy.ContinuousController
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/control/controller.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Controller Class
----------------

.. autoclass:: rocketpy.Controller
:members:
8 changes: 8 additions & 0 deletions docs/reference/classes/control/effectors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Effector Classes
----------------

.. autoclass:: rocketpy.ThrustEffector
:members:

.. autoclass:: rocketpy.ForceEffector
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/control/flight_conditions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FlightConditions Class
----------------------

.. autoclass:: rocketpy.control.FlightConditions
:members:
14 changes: 14 additions & 0 deletions docs/reference/classes/control/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Control Classes
===============

Controllers, the parts they move and what a part is told about the flight. See
:ref:`controllers` for how they are used.

.. toctree::
:maxdepth: 1
:caption: Contents:

Controller Class <controller>
ContinuousController Class <continuous_controller>
Effector Classes <effectors>
FlightConditions Class <flight_conditions>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ input parameters, enabling robust Monte Carlo simulations.
stochastic_elliptical_fins
stochastic_free_form_fins
stochastic_tail
stochastic_air_brakes
stochastic_rail_buttons
stochastic_rocket
stochastic_parachute
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Stochastic Air Brakes
---------------------

.. autoclass:: rocketpy.stochastic.StochasticAirBrakes
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/motors/EmptyMotor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
EmptyMotor Class
----------------

.. autoclass:: rocketpy.EmptyMotor
:members:
5 changes: 5 additions & 0 deletions docs/reference/classes/motors/PointMassMotor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PointMassMotor Class
--------------------

.. autoclass:: rocketpy.PointMassMotor
:members:
2 changes: 2 additions & 0 deletions docs/reference/classes/motors/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Motor Classes
LiquidMotor
GenericMotor
RingClusterMotor
PointMassMotor
EmptyMotor
Fluid
Tank Classes <tanks/index>
Tank Geometry Classes <geometries/index>
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ This reference manual details functions, modules, methods and attributes include
AeroSurface Classes <classes/aero_surfaces/index>
classes/Components
classes/Rocket
classes/PointMassRocket
classes/Parachute
classes/sensors/index.rst
classes/Flight
classes/Solution
classes/FlightDataExporter
classes/Event
classes/EventContext
classes/Commands
classes/EventViews
Control Classes <classes/control/index>
Utilities <classes/utils/index>
classes/EnvironmentAnalysis
Monte Carlo Analysis <classes/monte_carlo/index>
Expand Down
Loading
Loading