Skip to content

Commit

Permalink
DOC: Add Defiance launch to flight examples graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
phmbressan committed Dec 7, 2024
1 parent 1f5ac1c commit c9ee706
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 85 deletions.
134 changes: 51 additions & 83 deletions docs/examples/defiance_flight_sim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Defiance Mk. IV\n",
"# Defiance Mk. IV - University of Toronto Aerospace - 2024\n",
"Launched in Launch Canada 2024. Defiance Mk. IV is the fourth rocket in the defiance series of hybrid rocket from University of Toronto Aerospace Team.\n",
"\n",
"Defiance Mk. IV set a new Canadian amateur rocketry record with a recorded apogee altitude of $9308.318 m$.\n",
Expand Down Expand Up @@ -106,18 +106,10 @@
],
"source": [
"flight_date = datetime.date(2024, 8, 24)\n",
"env = Environment(\n",
" latitude = 47.966527,\n",
" longitude = -81.87413,\n",
" elevation = 1383.4\n",
")\n",
"env = Environment(latitude=47.966527, longitude=-81.87413, elevation=1383.4)\n",
"\n",
"env.set_date((flight_date.year, flight_date.month, flight_date.day, 0))\n",
"env.set_atmospheric_model(\n",
" type = \"custom_atmosphere\",\n",
" wind_v = 1.0,\n",
" wind_u = -2.9\n",
")\n",
"env.set_atmospheric_model(type=\"custom_atmosphere\", wind_v=1.0, wind_u=-2.9)\n",
"\n",
"env.info()"
]
Expand All @@ -135,49 +127,52 @@
"metadata": {},
"outputs": [],
"source": [
"oxidizer_liq = Fluid(name = 'N2O_l', density = 960)\n",
"oxidizer_gas = Fluid(name = 'N2O_g', density = 1.9277)\n",
"oxidizer_liq = Fluid(name='N2O_l', density=960)\n",
"oxidizer_gas = Fluid(name='N2O_g', density=1.9277)\n",
"\n",
"tank_shape = CylindricalTank(0.0665, 1.79)\n",
"\n",
"oxidizer_tank = MassFlowRateBasedTank(\n",
" name = 'oxidizer_tank',\n",
" geometry = tank_shape,\n",
" flux_time = (6.5),\n",
" liquid = oxidizer_liq,\n",
" gas = oxidizer_gas,\n",
" initial_liquid_mass = 17,\n",
" initial_gas_mass = 0,\n",
" liquid_mass_flow_rate_in = 0,\n",
" liquid_mass_flow_rate_out = 17/6.5,\n",
" gas_mass_flow_rate_in = 0,\n",
" gas_mass_flow_rate_out = 0\n",
" name='oxidizer_tank',\n",
" geometry=tank_shape,\n",
" flux_time=(6.5),\n",
" liquid=oxidizer_liq,\n",
" gas=oxidizer_gas,\n",
" initial_liquid_mass=17,\n",
" initial_gas_mass=0,\n",
" liquid_mass_flow_rate_in=0,\n",
" liquid_mass_flow_rate_out=17 / 6.5,\n",
" gas_mass_flow_rate_in=0,\n",
" gas_mass_flow_rate_out=0,\n",
")\n",
"\n",
"''' Defining the thrust curve'''\n",
"\n",
"\n",
"def thrust_fuction(t):\n",
" return 5750 * 2**(-t / 200)\n",
" return 5750 * 2 ** (-t / 200)\n",
"\n",
"\n",
"hybrid_motor = HybridMotor(\n",
" thrust_source = '../../data/rockets/defiance/Thrust_curve.csv',\n",
" dry_mass = 13.832,\n",
" dry_inertia = (1.801, 1.801, 0.0305),\n",
" center_of_dry_mass_position = 780/1000,\n",
" reshape_thrust_curve = False,\n",
" grain_number = 1,\n",
" grain_separation = 0,\n",
" grain_outer_radius = 0.0665,\n",
" grain_initial_inner_radius = 0.061,\n",
" grain_initial_height = 1.25,\n",
" grain_density = 920,\n",
" nozzle_radius = 0.0447,\n",
" throat_radius = 0.0234,\n",
" interpolation_method = 'linear',\n",
" grains_center_of_mass_position = 0.377,\n",
" coordinate_system_orientation = 'nozzle_to_combustion_chamber',\n",
" thrust_source='../../data/rockets/defiance/Thrust_curve.csv',\n",
" dry_mass=13.832,\n",
" dry_inertia=(1.801, 1.801, 0.0305),\n",
" center_of_dry_mass_position=780 / 1000,\n",
" reshape_thrust_curve=False,\n",
" grain_number=1,\n",
" grain_separation=0,\n",
" grain_outer_radius=0.0665,\n",
" grain_initial_inner_radius=0.061,\n",
" grain_initial_height=1.25,\n",
" grain_density=920,\n",
" nozzle_radius=0.0447,\n",
" throat_radius=0.0234,\n",
" interpolation_method='linear',\n",
" grains_center_of_mass_position=0.377,\n",
" coordinate_system_orientation='nozzle_to_combustion_chamber',\n",
")\n",
"\n",
"hybrid_motor.add_tank(tank = oxidizer_tank, position = 2.2)"
"hybrid_motor.add_tank(tank=oxidizer_tank, position=2.2)"
]
},
{
Expand Down Expand Up @@ -205,53 +200,30 @@
],
"source": [
"defiance = Rocket(\n",
" radius = 0.07,\n",
" mass = 37.211,\n",
" radius=0.07,\n",
" mass=37.211,\n",
" # inertia = (180.142, 180.142, 0.262),\n",
" inertia = (94.14, 94.14, 0.09),\n",
" center_of_mass_without_motor = 3.29,\n",
" power_off_drag = '../../data/rockets/defiance/DragCurve.csv',\n",
" power_on_drag = '../../data/rockets/defiance/DragCurve.csv',\n",
" coordinate_system_orientation = 'tail_to_nose'\n",
" inertia=(94.14, 94.14, 0.09),\n",
" center_of_mass_without_motor=3.29,\n",
" power_off_drag='../../data/rockets/defiance/DragCurve.csv',\n",
" power_on_drag='../../data/rockets/defiance/DragCurve.csv',\n",
" coordinate_system_orientation='tail_to_nose',\n",
")\n",
"\n",
"defiance.add_motor(hybrid_motor, position = 0.2)\n",
"defiance.add_motor(hybrid_motor, position=0.2)\n",
"\n",
"defiance.add_nose(\n",
" length = 0.563,\n",
" kind = \"vonKarman\",\n",
" position = 4.947\n",
")\n",
"defiance.add_nose(length=0.563, kind=\"vonKarman\", position=4.947)\n",
"\n",
"defiance.add_trapezoidal_fins(\n",
" n = 3,\n",
" span = 0.115,\n",
" root_chord = 0.4,\n",
" tip_chord = 0.2,\n",
" position = 0.175\n",
" n=3, span=0.115, root_chord=0.4, tip_chord=0.2, position=0.175\n",
")\n",
"\n",
"defiance.add_tail(\n",
" top_radius = 0.07,\n",
" bottom_radius = 0.064,\n",
" length = 0.0597,\n",
" position = 0.1\n",
")\n",
"defiance.add_tail(top_radius=0.07, bottom_radius=0.064, length=0.0597, position=0.1)\n",
"\n",
"defiance.add_parachute(\n",
" name = 'main',\n",
" cd_s = 2.2,\n",
" trigger = 305,\n",
" sampling_rate = 100,\n",
" lag = 0\n",
")\n",
"defiance.add_parachute(name='main', cd_s=2.2, trigger=305, sampling_rate=100, lag=0)\n",
"\n",
"defiance.add_parachute(\n",
" name ='drogue',\n",
" cd_s = 1.55,\n",
" trigger = 'apogee',\n",
" sampling_rate = 100,\n",
" lag = 0\n",
" name='drogue', cd_s=1.55, trigger='apogee', sampling_rate=100, lag=0\n",
")"
]
},
Expand Down Expand Up @@ -296,11 +268,7 @@
],
"source": [
"test_flight = Flight(\n",
" rocket = defiance,\n",
" environment = env,\n",
" inclination = 85,\n",
" heading = 90,\n",
" rail_length = 10\n",
" rocket=defiance, environment=env, inclination=85, heading=90, rail_length=10\n",
")\n",
"\n",
"test_flight.prints.apogee_conditions()\n",
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ apogee of some rockets.
"Genesis (2023)": (3076.45, 2916),
"Camoes (2023)": (3003.28, 3015),
"Juno III (2023)": (3026.05, 3213),
"Halcyon (2023)": (3212.775, 3450),
"Halcyon (2023)": (3212.78, 3450),
"Defiance Mk.IV (2024)": (9238.01, 9308.32),
}

max_apogee = 4500
max_apogee = 10000

# Extract data
simulated = [sim for sim, meas in results.values()]
Expand Down Expand Up @@ -80,4 +81,5 @@ In the next sections you will find the simulations of the rockets listed above.
cavour_flight_sim.ipynb
genesis_flight_sim.ipynb
camoes_flight_sim.ipynb
defiance_flight_sim.ipynb

0 comments on commit c9ee706

Please sign in to comment.