Skip to content

Commit 210b96c

Browse files
committed
updated tut_lithium_air_jet.py for tutorial
1 parent c488d0b commit 210b96c

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

tut_lithium_air_jet.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def main():
4646

4747
# mission analysis
4848
mission = analyses.missions
49-
results = mission.evaluate()
49+
results = evaluate_mission(configs,mission)
5050

5151
# plot the results
5252
plot_mission(results,configs)
@@ -198,10 +198,10 @@ def vehicle_setup():
198198
# ------------------------------------------------------------------
199199

200200
# mass properties
201-
vehicle.mass_properties.max_takeoff = 92110.
201+
vehicle.mass_properties.max_takeoff = 92110. #use landing mass as
202202
vehicle.mass_properties.operating_empty = 34551.
203203
vehicle.mass_properties.takeoff = 80721.
204-
vehicle.mass_properties.max_zero_fuel = 92110.
204+
vehicle.mass_properties.max_zero_fuel = 92110. #equivalent landing mass
205205
vehicle.mass_properties.cargo = 0.0
206206
vehicle.mass_properties.max_payload = 0.0
207207
vehicle.mass_properties.max_fuel = 0.0
@@ -716,7 +716,32 @@ def mission_setup(analyses):
716716

717717
#: def define_mission()
718718

719-
719+
# ----------------------------------------------------------------------
720+
# Evaluate the Mission
721+
# ----------------------------------------------------------------------
722+
def evaluate_mission(configs,mission):
723+
724+
# ------------------------------------------------------------------
725+
# Run Mission
726+
# ------------------------------------------------------------------
727+
728+
results = mission.evaluate()
729+
730+
#determine energy characteristiscs
731+
e_current_min=1E14
732+
Pmax=0.
733+
for i in range(len(results.segments)):
734+
if np.min(results.segments[i].conditions.propulsion.battery_energy[:,0])<e_current_min:
735+
e_current_min=np.min(results.segments[i].conditions.propulsion.battery_energy[:,0])
736+
if np.max(np.abs(results.segments[i].conditions.propulsion.battery_draw[:,0]))>Pmax:
737+
Pmax=np.max(np.abs(results.segments[i].conditions.propulsion.battery_draw[:,0]))
738+
results.e_total=results.segments[0].conditions.propulsion.battery_energy[0,0]-e_current_min
739+
results.Pmax=Pmax
740+
print 'e_current_min=',e_current_min
741+
print "e_total=", results.e_total
742+
print "Pmax=", Pmax
743+
print "e_current_min=", e_current_min
744+
return results
720745
# ----------------------------------------------------------------------
721746
# Plot Mission
722747
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)