Skip to content

Commit 3958d28

Browse files
Merge pull request #714 from RocketPy-Team/doc/new-comparison-plot
DOC: new comparison plot
2 parents 2b63cd9 + 13e66f6 commit 3958d28

File tree

14 files changed

+86
-25
lines changed

14 files changed

+86
-25
lines changed

docs/conf.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@
123123
"github_url": "https://github.com/RocketPy-Team/RocketPy",
124124
"navbar_end": ["theme-switcher", "navbar-icon-links.html"],
125125
"icon_links": [
126-
{
127-
"name": "GitHub",
128-
"url": "https://github.com/RocketPy-Team/RocketPy/",
129-
"icon": "fa-brands fa-square-github",
130-
"type": "fontawesome",
131-
},
132126
{
133127
"name": "LinkedIn",
134128
"url": "https://www.linkedin.com/company/rocketpy/",

docs/examples/cavour_flight_sim.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
"cell_type": "markdown",
321321
"metadata": {},
322322
"source": [
323-
"# Flight Simulation DATA"
323+
"## Flight Simulation DATA"
324324
]
325325
},
326326
{
@@ -375,7 +375,7 @@
375375
"cell_type": "markdown",
376376
"metadata": {},
377377
"source": [
378-
"# Data analysis"
378+
"## Data analysis"
379379
]
380380
},
381381
{

docs/examples/halcyon_flight_sim.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
"cell_type": "markdown",
449449
"metadata": {},
450450
"source": [
451-
"# Flight Simulation Data"
451+
"## Flight Simulation Data"
452452
]
453453
},
454454
{
@@ -503,7 +503,7 @@
503503
"cell_type": "markdown",
504504
"metadata": {},
505505
"source": [
506-
"# Data analysis"
506+
"## Data analysis"
507507
]
508508
},
509509
{

docs/examples/index.rst

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,71 @@
11
Flights simulated with RocketPy
22
===============================
33

4-
Apart from the classical Calisto rocket, which is many times used as a
5-
reference in the getting started tutorial, RocketPy also includes some very
6-
interesting examples of real rockets.
4+
RocketPy has been used to simulate many flights, from small amateur rockets to
5+
large professional ones.
6+
This section contains some of the most interesting
7+
results obtained with RocketPy.
8+
The following plot shows the comparison between the simulated and measured
9+
apogee of some rockets.
710

8-
If you want to see your rocket here, please contact the maintainers!
11+
.. jupyter-execute::
12+
:hide-code:
13+
14+
import matplotlib.pyplot as plt
15+
16+
results = {
17+
# "Name (Year)": (simulated, measured) m
18+
# - use 2 decimal places
19+
# - sort by year and then by name
20+
"Valetudo (2019)": (825.39, 860),
21+
"Bella Lui (2020)": (460.50, 458.97),
22+
"NDRT (2020)": (1296.77, 1316.75),
23+
"Prometheus (2022)": (4190.05, 3898.37),
24+
"Cavour (2023)": (2818.90, 2789),
25+
"Juno III (2023)": (3026.05, 3213),
26+
"Halcyon (2023)": (3212.775, 3450),
27+
}
28+
29+
max_apogee = 4500
30+
31+
# Extract data
32+
simulated = [sim for sim, meas in results.values()]
33+
measured = [meas for sim, meas in results.values()]
34+
labels = list(results.keys())
35+
36+
# Create the plot
37+
fig, ax = plt.subplots(figsize=(9, 9))
38+
ax.scatter(simulated, measured)
39+
ax.grid(True, alpha=0.3)
40+
41+
# Add the x = y line
42+
ax.plot([0, max_apogee], [0, max_apogee], linestyle='--', color='black', alpha=0.6)
43+
44+
# Add text labels
45+
for i, label in enumerate(labels):
46+
ax.text(simulated[i], measured[i], label, ha='center', va='bottom', fontsize=8)
47+
48+
# Set titles and labels
49+
ax.set_title("Simulated x Measured Apogee")
50+
ax.set_xlabel("Simulated Apogee (m)")
51+
ax.set_ylabel("Measured Apogee (m)")
52+
53+
# Set aspect ratio to 1:1
54+
ax.set_aspect('equal', adjustable='box')
55+
ax.set_xlim(0, max_apogee)
56+
ax.set_ylim(0, max_apogee)
57+
58+
plt.show()
59+
60+
In the next sections you will find the simulations of the rockets listed above.
61+
62+
.. note::
63+
64+
If you want to see your rocket here, please contact the maintainers! \
65+
We would love to include your rocket in the examples.
966

1067
.. toctree::
11-
:maxdepth: 2
68+
:maxdepth: 1
1269
:caption: Contents:
1370

1471
bella_lui_flight_sim.ipynb
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Sensor Class
22
------------
33

4-
.. autoclass:: rocketpy.sensors.Barometer
4+
.. autoclass:: rocketpy.sensors.Sensor
55
:members:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Accelerometer Class
2-
---------------
2+
-------------------
33

44
.. autoclass:: rocketpy.sensors.Accelerometer
55
:members:

docs/reference/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This reference manual details functions, modules, methods and attributes include
1414
classes/Components
1515
classes/Rocket
1616
classes/Parachute
17+
classes/sensors/index.rst
1718
classes/Flight
1819
Utilities <classes/utils/index>
1920
classes/EnvironmentAnalysis

docs/user/rocket/generic_surface.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ rocket's configuration:
289289
rocket.add_surfaces(generic_surface, position=(0,0,0))
290290
291291
The position of the generic surface is defined in the User Defined coordinate
292-
System, see :ref:`rocketaxes` for more information.
292+
System, see :ref:`rocket_axes` for more information.
293293

294294
.. tip::
295295
If defining the coefficients of the entire rocket is desired, only a single

rocketpy/rocket/rocket.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ def add_cm_eccentricity(self, x, y):
17391739
17401740
See Also
17411741
--------
1742-
:ref:`rocketaxes`
1742+
:ref:`rocket_axes`
17431743
17441744
Notes
17451745
-----
@@ -1777,7 +1777,7 @@ def add_cp_eccentricity(self, x, y):
17771777
17781778
See Also
17791779
--------
1780-
:ref:`rocketaxes`
1780+
:ref:`rocket_axes`
17811781
"""
17821782
self.cp_eccentricity_x = x
17831783
self.cp_eccentricity_y = y
@@ -1807,7 +1807,7 @@ def add_thrust_eccentricity(self, x, y):
18071807
18081808
See Also
18091809
--------
1810-
:ref:`rocketaxes`
1810+
:ref:`rocket_axes`
18111811
"""
18121812
self.thrust_eccentricity_y = x
18131813
self.thrust_eccentricity_x = y

rocketpy/sensors/accelerometer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def __init__(
8888
Sample rate of the sensor in Hz.
8989
orientation : tuple, list, optional
9090
Orientation of the sensor in the rocket. The orientation can be
91-
given as:
91+
given as either:
92+
9293
- A list of length 3, where the elements are the Euler angles for
9394
the rotation yaw (ψ), pitch (θ) and roll (φ) in radians. The
9495
standard rotation sequence is z-y-x (3-2-1) is used, meaning the
@@ -99,6 +100,7 @@ def __init__(
99100
of reference is defined as to have z axis along the sensor's normal
100101
vector pointing upwards, x and y axes perpendicular to the z axis
101102
and each other.
103+
102104
The rocket frame of reference is defined as to have z axis
103105
along the rocket's axis of symmetry pointing upwards, x and y axes
104106
perpendicular to the z axis and each other. A rotation around the x
@@ -204,6 +206,7 @@ def measure(self, time, **kwargs):
204206
Current time in seconds.
205207
kwargs : dict
206208
Keyword arguments dictionary containing the following keys:
209+
207210
- u : np.array
208211
State vector of the rocket.
209212
- u_dot : np.array

rocketpy/sensors/barometer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def measure(self, time, **kwargs):
144144
Current time in seconds.
145145
kwargs : dict
146146
Keyword arguments dictionary containing the following keys:
147+
147148
- u : np.array
148149
State vector of the rocket.
149150
- u_dot : np.array

rocketpy/sensors/gnss_receiver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def measure(self, time, **kwargs):
7272
Current time in seconds.
7373
kwargs : dict
7474
Keyword arguments dictionary containing the following keys:
75+
7576
- u : np.array
7677
State vector of the rocket.
7778
- u_dot : np.array

rocketpy/sensors/gyroscope.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __init__(
8989
orientation : tuple, list, optional
9090
Orientation of the sensor in the rocket. The orientation can be
9191
given as:
92+
9293
- A list of length 3, where the elements are the Euler angles for
9394
the rotation yaw (ψ), pitch (θ) and roll (φ) in radians. The
9495
standard rotation sequence is z-y-x (3-2-1) is used, meaning the
@@ -99,6 +100,7 @@ def __init__(
99100
of reference is defined as to have z axis along the sensor's normal
100101
vector pointing upwards, x and y axes perpendicular to the z axis
101102
and each other.
103+
102104
The rocket frame of reference is defined as to have z axis
103105
along the rocket's axis of symmetry pointing upwards, x and y axes
104106
perpendicular to the z axis and each other. Default is (0, 0, 0),
@@ -206,6 +208,7 @@ def measure(self, time, **kwargs):
206208
Current time in seconds.
207209
kwargs : dict
208210
Keyword arguments dictionary containing the following keys:
211+
209212
- u : np.array
210213
State vector of the rocket.
211214
- u_dot : np.array

rocketpy/sensors/sensor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,13 @@ def __init__(
346346
Sample rate of the sensor
347347
orientation : tuple, list, optional
348348
Orientation of the sensor in relation to the rocket frame of
349-
reference (Body Axes Coordinate System). See :ref:'rocket_axes' for
349+
reference (Body Axes Coordinate System). See :ref:`rocket_axes` for
350350
more information.
351351
If orientation is not given, the sensor axes will be aligned with
352352
the rocket axis.
353-
The orientation can be given as:
354-
- A list or tuple of length 3, where the elements are the intrisic
353+
The orientation can be given as either:
354+
355+
- A list or tuple of length 3, where the elements are the intrinsic
355356
rotation angles in radians. The rotation sequence z-x-z (3-1-3) is
356357
used, meaning the sensor is first around the z axis (roll), then
357358
around the new x axis (pitch) and finally around the new z axis

0 commit comments

Comments
 (0)