Skip to content

Commit

Permalink
DOC: adds new apogee comparison plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Oct 19, 2024
1 parent 2b63cd9 commit 45c758b
Showing 1 changed file with 62 additions and 5 deletions.
67 changes: 62 additions & 5 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,71 @@
Flights simulated with RocketPy
===============================

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

If you want to see your rocket here, please contact the maintainers!
.. jupyter-execute::
:hide-code:

import matplotlib.pyplot as plt

results = {
# "Name (Year)": (simulated, measured) m
# - use 2 decimal places
# - sort by year and then by name
"Valetudo (2019)": (825.39, 860),
"Bella Lui (2020)": (460.50, 458.97),
"NDRT (2020)": (1296.77, 1316.75),
"Prometheus (2022)": (4190.05, 3898.37),
"Cavour (2023)": (2818.90, 2789),
"Juno III (2023)": (3026.05, 3213),
"Halcyon (2023)": (3212.775, 3450),
}

max_apogee = 4500

# Extract data
simulated = [sim for sim, meas in results.values()]
measured = [meas for sim, meas in results.values()]
labels = list(results.keys())

# Create the plot
fig, ax = plt.subplots(figsize=(9, 9))
ax.scatter(simulated, measured)
ax.grid(True, alpha=0.3)

# Add the x = y line
ax.plot([0, max_apogee], [0, max_apogee], linestyle='--', color='black', alpha=0.6)

# Add text labels
for i, label in enumerate(labels):
ax.text(simulated[i], measured[i], label, ha='center', va='bottom', fontsize=8)

# Set titles and labels
ax.set_title("Simulated x Measured Apogee")
ax.set_xlabel("Simulated Apogee (m)")
ax.set_ylabel("Measured Apogee (m)")

# Set aspect ratio to 1:1
ax.set_aspect('equal', adjustable='box')
ax.set_xlim(0, max_apogee)
ax.set_ylim(0, max_apogee)

plt.show()

In the next sections you will find the simulations of the rockets listed above.

.. note::

If you want to see your rocket here, please contact the maintainers! \
We would love to include your rocket in the examples.

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

bella_lui_flight_sim.ipynb
Expand Down

0 comments on commit 45c758b

Please sign in to comment.