From d68dd004dcf09652161c334ec6b74bdb7a98c6c8 Mon Sep 17 00:00:00 2001 From: leogrosa Date: Fri, 6 Dec 2024 03:14:54 -0300 Subject: [PATCH] DOC: added more details and explanations to the notebook --- docs/examples/vetor_ii_flight_sim.ipynb | 114 +++++++++++++++--------- 1 file changed, 74 insertions(+), 40 deletions(-) diff --git a/docs/examples/vetor_ii_flight_sim.ipynb b/docs/examples/vetor_ii_flight_sim.ipynb index 83e7eda95..62a5a1bc7 100644 --- a/docs/examples/vetor_ii_flight_sim.ipynb +++ b/docs/examples/vetor_ii_flight_sim.ipynb @@ -4,14 +4,24 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Project Vetor II - UEL - Hypothetical flight\n" + "# Project Vetor II - UEL - Hypothetical flight\n", + "The Vetor II Project began in 2022 at UEL and, although it hasn't conducted a real flight yet, it includes a motor, a functional test bench, and a complete vehicle structure." ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 51, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The autoreload extension is already loaded. To reload it, use:\n", + " %reload_ext autoreload\n" + ] + } + ], "source": [ "%load_ext autoreload\n", "%autoreload 2" @@ -19,21 +29,20 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "# Importing libraries\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", - "from scipy.signal import savgol_filter\n", "\n", "from rocketpy import Environment, Flight, Function, Rocket, SolidMotor" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -58,13 +67,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Defines the `Environment` object. \n", - "Location: Londrina, Brazil." + "Define the `Environment` object\n", + "\n", + "(Location: Londrina, Brazil)" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 54, "metadata": {}, "outputs": [], "source": [ @@ -90,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 55, "metadata": {}, "outputs": [ { @@ -169,12 +179,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Define the `SolidMotor` object\n" + "Define the `SolidMotor` object with real test bench data\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -199,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -219,7 +229,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -227,24 +237,24 @@ "output_type": "stream", "text": [ "Nozzle Details\n", - "Nozzle Radius: 0.04445 m\n", - "Nozzle Throat Radius: 0.0214376 m\n", + "Nozzle Radius: 0.01 m\n", + "Nozzle Throat Radius: 0.005 m\n", "\n", "Grain Details\n", "Number of Grains: 1\n", "Grain Spacing: 0 m\n", - "Grain Density: 782.4 kg/m3\n", - "Grain Outer Radius: 0.042799 m\n", - "Grain Inner Radius: 0.033146999999999996 m\n", - "Grain Height: 0.1524 m\n", + "Grain Density: 1730 kg/m3\n", + "Grain Outer Radius: 0.022 m\n", + "Grain Inner Radius: 0.003625 m\n", + "Grain Height: 0.125 m\n", "Grain Volume: 0.000 m3\n", - "Grain Mass: 0.275 kg\n", + "Grain Mass: 0.320 kg\n", "\n", "Motor Details\n", "Total Burning Time: 1.8 s\n", - "Total Propellant Mass: 0.275 kg\n", - "Structural Mass Ratio: 0.004\n", - "Average Propellant Exhaust Velocity: 1013.523 m/s\n", + "Total Propellant Mass: 0.320 kg\n", + "Structural Mass Ratio: 0.607\n", + "Average Propellant Exhaust Velocity: 870.006 m/s\n", "Average Thrust: 154.613 N\n", "Maximum Thrust: 272.733 N at 0.25 s after ignition.\n", "Total Impulse: 278.304 Ns\n", @@ -277,12 +287,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Create the `Rocket` object\n" + "Create the `Rocket` object with the real dimensions\n" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -310,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 60, "metadata": {}, "outputs": [ { @@ -341,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -365,9 +375,16 @@ ").draw()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The parachute was not added as further studies within the Vetor II Project are needed to correctly model it." + ] + }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 62, "metadata": {}, "outputs": [ { @@ -434,7 +451,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 63, "metadata": {}, "outputs": [ { @@ -468,7 +485,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 64, "metadata": {}, "outputs": [], "source": [ @@ -482,7 +499,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 65, "metadata": {}, "outputs": [ { @@ -614,23 +631,33 @@ "test_flight.plots.trajectory_3d()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Comparison with the real flight data\n" + "## Comparison with the original one-dimensional simulator from Vetor II\n", + "\n", + "The Vetor II Project featured its own one-dimensional simulator. While it does not provide spatial trajectory information or account for angle of attack, it allows for a comparison of absolute values of acceleration, velocity, and altitude over time.\n", + "\n", + "\n", + "**Note:** Several complexities of the Vetor II Project, such as the parachute and other parameters, were not considered, which could impact the differences between the results.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Load the available flight data: altitude above ground level (m), vertical velocity (m/s), time (s)\n" + "Load the one-dimensional simulator data\n" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ @@ -652,7 +679,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 67, "metadata": {}, "outputs": [], "source": [ @@ -690,7 +717,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -710,7 +737,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 69, "metadata": {}, "outputs": [ { @@ -738,7 +765,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -765,7 +792,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -790,6 +817,13 @@ "plt.grid()\n", "plt.show()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "While the one-dimensional simulator from the Vetor II Project is much simpler and lacks many advanced features, such as Monte Carlo simulations and detailed aerodynamic modeling, it helps to reinforce the accuracy of RocketPy in predicting key flight metrics, since it is an external and independent validation source." + ] } ], "metadata": {