Skip to content

Commit

Permalink
MNT: black formatted the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurJWH committed Dec 1, 2024
2 parents 6065e63 + 1fbc15c commit 25aaafa
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions docs/examples/defiance_flight_sim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@
],
"source": [
"flight_date = datetime.date(2024, 8, 24)\n",
"env = Environment(latitude = 47.966527, longitude = -81.87413, elevation = 1383.4)\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(type = \"custom_atmosphere\", wind_v = 1.0, wind_u = -2.9,)\n",
"env.set_atmospheric_model(\n",
" type=\"custom_atmosphere\",\n",
" wind_v=1.0,\n",
" wind_u=-2.9,\n",
")\n",
"\n",
"env.info()"
]
Expand All @@ -127,45 +131,45 @@
"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",
"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 @@ -193,33 +197,29 @@
],
"source": [
"defiance = Rocket(\n",
" radius = 0.07,\n",
" mass = 37.211,\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",
" radius=0.07,\n",
" mass=37.211,\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(length = 0.563, kind = \"vonKarman\", position = 4.947)\n",
"defiance.add_nose(length=0.563, kind=\"vonKarman\", position=4.947)\n",
"\n",
"defiance.add_trapezoidal_fins(\n",
" n = 3, span = 0.115, root_chord = 0.4, tip_chord = 0.2, 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, bottom_radius = 0.064, length = 0.0597, 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', cd_s = 2.2, trigger = 305, sampling_rate = 100, 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', cd_s = 1.55, trigger = 'apogee', sampling_rate = 100, lag = 0\n",
" name='drogue', cd_s=1.55, trigger='apogee', sampling_rate=100, lag=0\n",
")"
]
},
Expand Down Expand Up @@ -264,7 +264,7 @@
],
"source": [
"test_flight = Flight(\n",
" rocket = defiance, environment = env, inclination = 85, heading = 90, 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

0 comments on commit 25aaafa

Please sign in to comment.