Skip to content

Commit c9ee706

Browse files
committed
DOC: Add Defiance launch to flight examples graph.
1 parent 1f5ac1c commit c9ee706

File tree

2 files changed

+55
-85
lines changed

2 files changed

+55
-85
lines changed

docs/examples/defiance_flight_sim.ipynb

Lines changed: 51 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Defiance Mk. IV\n",
7+
"# Defiance Mk. IV - University of Toronto Aerospace - 2024\n",
88
"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",
99
"\n",
1010
"Defiance Mk. IV set a new Canadian amateur rocketry record with a recorded apogee altitude of $9308.318 m$.\n",
@@ -106,18 +106,10 @@
106106
],
107107
"source": [
108108
"flight_date = datetime.date(2024, 8, 24)\n",
109-
"env = Environment(\n",
110-
" latitude = 47.966527,\n",
111-
" longitude = -81.87413,\n",
112-
" elevation = 1383.4\n",
113-
")\n",
109+
"env = Environment(latitude=47.966527, longitude=-81.87413, elevation=1383.4)\n",
114110
"\n",
115111
"env.set_date((flight_date.year, flight_date.month, flight_date.day, 0))\n",
116-
"env.set_atmospheric_model(\n",
117-
" type = \"custom_atmosphere\",\n",
118-
" wind_v = 1.0,\n",
119-
" wind_u = -2.9\n",
120-
")\n",
112+
"env.set_atmospheric_model(type=\"custom_atmosphere\", wind_v=1.0, wind_u=-2.9)\n",
121113
"\n",
122114
"env.info()"
123115
]
@@ -135,49 +127,52 @@
135127
"metadata": {},
136128
"outputs": [],
137129
"source": [
138-
"oxidizer_liq = Fluid(name = 'N2O_l', density = 960)\n",
139-
"oxidizer_gas = Fluid(name = 'N2O_g', density = 1.9277)\n",
130+
"oxidizer_liq = Fluid(name='N2O_l', density=960)\n",
131+
"oxidizer_gas = Fluid(name='N2O_g', density=1.9277)\n",
140132
"\n",
141133
"tank_shape = CylindricalTank(0.0665, 1.79)\n",
142134
"\n",
143135
"oxidizer_tank = MassFlowRateBasedTank(\n",
144-
" name = 'oxidizer_tank',\n",
145-
" geometry = tank_shape,\n",
146-
" flux_time = (6.5),\n",
147-
" liquid = oxidizer_liq,\n",
148-
" gas = oxidizer_gas,\n",
149-
" initial_liquid_mass = 17,\n",
150-
" initial_gas_mass = 0,\n",
151-
" liquid_mass_flow_rate_in = 0,\n",
152-
" liquid_mass_flow_rate_out = 17/6.5,\n",
153-
" gas_mass_flow_rate_in = 0,\n",
154-
" gas_mass_flow_rate_out = 0\n",
136+
" name='oxidizer_tank',\n",
137+
" geometry=tank_shape,\n",
138+
" flux_time=(6.5),\n",
139+
" liquid=oxidizer_liq,\n",
140+
" gas=oxidizer_gas,\n",
141+
" initial_liquid_mass=17,\n",
142+
" initial_gas_mass=0,\n",
143+
" liquid_mass_flow_rate_in=0,\n",
144+
" liquid_mass_flow_rate_out=17 / 6.5,\n",
145+
" gas_mass_flow_rate_in=0,\n",
146+
" gas_mass_flow_rate_out=0,\n",
155147
")\n",
156148
"\n",
157149
"''' Defining the thrust curve'''\n",
150+
"\n",
151+
"\n",
158152
"def thrust_fuction(t):\n",
159-
" return 5750 * 2**(-t / 200)\n",
153+
" return 5750 * 2 ** (-t / 200)\n",
154+
"\n",
160155
"\n",
161156
"hybrid_motor = HybridMotor(\n",
162-
" thrust_source = '../../data/rockets/defiance/Thrust_curve.csv',\n",
163-
" dry_mass = 13.832,\n",
164-
" dry_inertia = (1.801, 1.801, 0.0305),\n",
165-
" center_of_dry_mass_position = 780/1000,\n",
166-
" reshape_thrust_curve = False,\n",
167-
" grain_number = 1,\n",
168-
" grain_separation = 0,\n",
169-
" grain_outer_radius = 0.0665,\n",
170-
" grain_initial_inner_radius = 0.061,\n",
171-
" grain_initial_height = 1.25,\n",
172-
" grain_density = 920,\n",
173-
" nozzle_radius = 0.0447,\n",
174-
" throat_radius = 0.0234,\n",
175-
" interpolation_method = 'linear',\n",
176-
" grains_center_of_mass_position = 0.377,\n",
177-
" coordinate_system_orientation = 'nozzle_to_combustion_chamber',\n",
157+
" thrust_source='../../data/rockets/defiance/Thrust_curve.csv',\n",
158+
" dry_mass=13.832,\n",
159+
" dry_inertia=(1.801, 1.801, 0.0305),\n",
160+
" center_of_dry_mass_position=780 / 1000,\n",
161+
" reshape_thrust_curve=False,\n",
162+
" grain_number=1,\n",
163+
" grain_separation=0,\n",
164+
" grain_outer_radius=0.0665,\n",
165+
" grain_initial_inner_radius=0.061,\n",
166+
" grain_initial_height=1.25,\n",
167+
" grain_density=920,\n",
168+
" nozzle_radius=0.0447,\n",
169+
" throat_radius=0.0234,\n",
170+
" interpolation_method='linear',\n",
171+
" grains_center_of_mass_position=0.377,\n",
172+
" coordinate_system_orientation='nozzle_to_combustion_chamber',\n",
178173
")\n",
179174
"\n",
180-
"hybrid_motor.add_tank(tank = oxidizer_tank, position = 2.2)"
175+
"hybrid_motor.add_tank(tank=oxidizer_tank, position=2.2)"
181176
]
182177
},
183178
{
@@ -205,53 +200,30 @@
205200
],
206201
"source": [
207202
"defiance = Rocket(\n",
208-
" radius = 0.07,\n",
209-
" mass = 37.211,\n",
203+
" radius=0.07,\n",
204+
" mass=37.211,\n",
210205
" # inertia = (180.142, 180.142, 0.262),\n",
211-
" inertia = (94.14, 94.14, 0.09),\n",
212-
" center_of_mass_without_motor = 3.29,\n",
213-
" power_off_drag = '../../data/rockets/defiance/DragCurve.csv',\n",
214-
" power_on_drag = '../../data/rockets/defiance/DragCurve.csv',\n",
215-
" coordinate_system_orientation = 'tail_to_nose'\n",
206+
" inertia=(94.14, 94.14, 0.09),\n",
207+
" center_of_mass_without_motor=3.29,\n",
208+
" power_off_drag='../../data/rockets/defiance/DragCurve.csv',\n",
209+
" power_on_drag='../../data/rockets/defiance/DragCurve.csv',\n",
210+
" coordinate_system_orientation='tail_to_nose',\n",
216211
")\n",
217212
"\n",
218-
"defiance.add_motor(hybrid_motor, position = 0.2)\n",
213+
"defiance.add_motor(hybrid_motor, position=0.2)\n",
219214
"\n",
220-
"defiance.add_nose(\n",
221-
" length = 0.563,\n",
222-
" kind = \"vonKarman\",\n",
223-
" position = 4.947\n",
224-
")\n",
215+
"defiance.add_nose(length=0.563, kind=\"vonKarman\", position=4.947)\n",
225216
"\n",
226217
"defiance.add_trapezoidal_fins(\n",
227-
" n = 3,\n",
228-
" span = 0.115,\n",
229-
" root_chord = 0.4,\n",
230-
" tip_chord = 0.2,\n",
231-
" position = 0.175\n",
218+
" n=3, span=0.115, root_chord=0.4, tip_chord=0.2, position=0.175\n",
232219
")\n",
233220
"\n",
234-
"defiance.add_tail(\n",
235-
" top_radius = 0.07,\n",
236-
" bottom_radius = 0.064,\n",
237-
" length = 0.0597,\n",
238-
" position = 0.1\n",
239-
")\n",
221+
"defiance.add_tail(top_radius=0.07, bottom_radius=0.064, length=0.0597, position=0.1)\n",
240222
"\n",
241-
"defiance.add_parachute(\n",
242-
" name = 'main',\n",
243-
" cd_s = 2.2,\n",
244-
" trigger = 305,\n",
245-
" sampling_rate = 100,\n",
246-
" lag = 0\n",
247-
")\n",
223+
"defiance.add_parachute(name='main', cd_s=2.2, trigger=305, sampling_rate=100, lag=0)\n",
248224
"\n",
249225
"defiance.add_parachute(\n",
250-
" name ='drogue',\n",
251-
" cd_s = 1.55,\n",
252-
" trigger = 'apogee',\n",
253-
" sampling_rate = 100,\n",
254-
" lag = 0\n",
226+
" name='drogue', cd_s=1.55, trigger='apogee', sampling_rate=100, lag=0\n",
255227
")"
256228
]
257229
},
@@ -296,11 +268,7 @@
296268
],
297269
"source": [
298270
"test_flight = Flight(\n",
299-
" rocket = defiance,\n",
300-
" environment = env,\n",
301-
" inclination = 85,\n",
302-
" heading = 90,\n",
303-
" rail_length = 10\n",
271+
" rocket=defiance, environment=env, inclination=85, heading=90, rail_length=10\n",
304272
")\n",
305273
"\n",
306274
"test_flight.prints.apogee_conditions()\n",

docs/examples/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ apogee of some rockets.
2525
"Genesis (2023)": (3076.45, 2916),
2626
"Camoes (2023)": (3003.28, 3015),
2727
"Juno III (2023)": (3026.05, 3213),
28-
"Halcyon (2023)": (3212.775, 3450),
28+
"Halcyon (2023)": (3212.78, 3450),
29+
"Defiance Mk.IV (2024)": (9238.01, 9308.32),
2930
}
3031

31-
max_apogee = 4500
32+
max_apogee = 10000
3233

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

0 commit comments

Comments
 (0)