@@ -198,7 +198,7 @@ def vehicle_setup():
198198 vehicle .mass_properties .takeoff = 79015.8 # kg
199199 vehicle .mass_properties .max_zero_fuel = 0.9 * vehicle .mass_properties .max_takeoff
200200 vehicle .mass_properties .cargo = 10000. * Units .kilogram
201-
201+
202202 # envelope properties
203203 vehicle .envelope .ultimate_load = 2.5
204204 vehicle .envelope .limit_load = 1.5
@@ -628,41 +628,41 @@ def configs_setup(vehicle):
628628# ----------------------------------------------------------------------
629629
630630def plot_mission (results ,line_style = 'bo-' ):
631-
631+
632632 axis_font = {'fontname' :'Arial' , 'size' :'14' }
633-
633+
634634 # ------------------------------------------------------------------
635635 # Aerodynamics
636636 # ------------------------------------------------------------------
637-
638-
637+
638+
639639 fig = plt .figure ("Aerodynamic Forces" ,figsize = (8 ,6 ))
640640 for segment in results .segments .values ():
641641
642642 time = segment .conditions .frames .inertial .time [:,0 ] / Units .min
643643 Lift = - segment .conditions .frames .wind .lift_force_vector [:,2 ]
644644 Drag = - segment .conditions .frames .wind .drag_force_vector [:,0 ] / Units .lbf
645645 Thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ] / Units .lbf
646- eta = segment .conditions .propulsion .throttle [:,0 ]
647- mdot = segment .conditions .weights .vehicle_mass_rate [:,0 ]
648- thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
649- sfc = 3600. * mdot / 0.1019715 / thrust
646+ eta = segment .conditions .propulsion .throttle [:,0 ]
647+ mdot = segment .conditions .weights .vehicle_mass_rate [:,0 ]
648+ thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
649+ sfc = 3600. * mdot / 0.1019715 / thrust
650650
651651
652652 axes = fig .add_subplot (2 ,1 ,1 )
653653 axes .plot ( time , Thrust , line_style )
654654 axes .set_ylabel ('Thrust (lbf)' ,axis_font )
655655 axes .grid (True )
656-
656+
657657 axes = fig .add_subplot (2 ,1 ,2 )
658658 axes .plot ( time , sfc , line_style )
659659 axes .set_xlabel ('Time (min)' ,axis_font )
660660 axes .set_ylabel ('sfc (lb/lbf-hr)' ,axis_font )
661661 axes .grid (True )
662-
663- plt .savefig ("B737_engine.pdf" )
664- plt .savefig ("B737_engine.png" )
665-
662+
663+ plt .savefig ("B737_engine.pdf" )
664+ plt .savefig ("B737_engine.png" )
665+
666666
667667 # ------------------------------------------------------------------
668668 # Aerodynamics 2
@@ -675,9 +675,9 @@ def plot_mission(results,line_style='bo-'):
675675 CDrag = segment .conditions .aerodynamics .drag_coefficient [:,0 ]
676676 Drag = - segment .conditions .frames .wind .drag_force_vector [:,0 ]
677677 Thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
678- aoa = segment .conditions .aerodynamics .angle_of_attack [:,0 ] / Units .deg
679- l_d = CLift / CDrag
680-
678+ aoa = segment .conditions .aerodynamics .angle_of_attack [:,0 ] / Units .deg
679+ l_d = CLift / CDrag
680+
681681
682682 axes = fig .add_subplot (3 ,1 ,1 )
683683 axes .plot ( time , CLift , line_style )
@@ -689,14 +689,14 @@ def plot_mission(results,line_style='bo-'):
689689 axes .set_ylabel ('L/D' ,axis_font )
690690 axes .grid (True )
691691
692- axes = fig .add_subplot (3 ,1 ,3 )
693- axes .plot ( time , aoa , 'ro-' )
694- axes .set_xlabel ('Time (min)' ,axis_font )
695- axes .set_ylabel ('AOA (deg)' ,axis_font )
696- axes .grid (True )
692+ axes = fig .add_subplot (3 ,1 ,3 )
693+ axes .plot ( time , aoa , 'ro-' )
694+ axes .set_xlabel ('Time (min)' ,axis_font )
695+ axes .set_ylabel ('AOA (deg)' ,axis_font )
696+ axes .grid (True )
697697
698- plt .savefig ("B737_aero.pdf" )
699- plt .savefig ("B737_aero.png" )
698+ plt .savefig ("B737_aero.pdf" )
699+ plt .savefig ("B737_aero.png" )
700700
701701 # ------------------------------------------------------------------
702702 # Aerodynamics 2
@@ -733,11 +733,11 @@ def plot_mission(results,line_style='bo-'):
733733 axes .grid (True )
734734 plt .savefig ("B737_drag.pdf" )
735735 plt .savefig ("B737_drag.png" )
736-
736+
737737 # ------------------------------------------------------------------
738738 # Altitude, sfc, vehicle weight
739739 # ------------------------------------------------------------------
740-
740+
741741 fig = plt .figure ("Altitude_sfc_weight" ,figsize = (8 ,10 ))
742742 for segment in results .segments .values ():
743743
@@ -746,14 +746,14 @@ def plot_mission(results,line_style='bo-'):
746746 CDrag = segment .conditions .aerodynamics .drag_coefficient [:,0 ]
747747 Drag = - segment .conditions .frames .wind .drag_force_vector [:,0 ]
748748 Thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
749- aoa = segment .conditions .aerodynamics .angle_of_attack [:,0 ] / Units .deg
750- l_d = CLift / CDrag
751- mass = segment .conditions .weights .total_mass [:,0 ] / Units .lb
752- altitude = segment .conditions .freestream .altitude [:,0 ] / Units .ft
753- mdot = segment .conditions .weights .vehicle_mass_rate [:,0 ]
754- thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
755- sfc = 3600. * mdot / 0.1019715 / thrust
756-
749+ aoa = segment .conditions .aerodynamics .angle_of_attack [:,0 ] / Units .deg
750+ l_d = CLift / CDrag
751+ mass = segment .conditions .weights .total_mass [:,0 ] / Units .lb
752+ altitude = segment .conditions .freestream .altitude [:,0 ] / Units .ft
753+ mdot = segment .conditions .weights .vehicle_mass_rate [:,0 ]
754+ thrust = segment .conditions .frames .body .thrust_force_vector [:,0 ]
755+ sfc = 3600. * mdot / 0.1019715 / thrust
756+
757757 axes = fig .add_subplot (3 ,1 ,1 )
758758 axes .plot ( time , altitude , line_style )
759759 axes .set_ylabel ('Altitude (ft)' ,axis_font )
@@ -765,13 +765,13 @@ def plot_mission(results,line_style='bo-'):
765765 axes .set_ylabel ('sfc (lb/lbf-hr)' ,axis_font )
766766 axes .grid (True )
767767
768- axes = fig .add_subplot (3 ,1 ,2 )
769- axes .plot ( time , mass , 'ro-' )
770- axes .set_ylabel ('Weight (lb)' ,axis_font )
771- axes .grid (True )
772-
773- plt .savefig ("B737_mission.pdf" )
774- plt .savefig ("B737_mission.png" )
768+ axes = fig .add_subplot (3 ,1 ,2 )
769+ axes .plot ( time , mass , 'ro-' )
770+ axes .set_ylabel ('Weight (lb)' ,axis_font )
771+ axes .grid (True )
772+
773+ plt .savefig ("B737_mission.pdf" )
774+ plt .savefig ("B737_mission.png" )
775775
776776 return
777777
@@ -914,92 +914,92 @@ def mission_setup(analyses):
914914
915915 segment = Segments .Descent .Constant_Speed_Constant_Rate (base_segment )
916916 segment .tag = "descent_1"
917-
917+
918918 segment .analyses .extend ( analyses .cruise )
919-
919+
920920 segment .altitude_end = 8.0 * Units .km
921921 segment .air_speed = 220.0 * Units ['m/s' ]
922922 segment .descent_rate = 4.5 * Units ['m/s' ]
923-
923+
924924 # add to mission
925925 mission .append_segment (segment )
926-
927-
926+
927+
928928 # ------------------------------------------------------------------
929929 # Second Descent Segment: consant speed, constant segment rate
930930 # ------------------------------------------------------------------
931-
931+
932932 segment = Segments .Descent .Constant_Speed_Constant_Rate (base_segment )
933933 segment .tag = "descent_2"
934-
934+
935935 segment .analyses .extend ( analyses .landing )
936-
936+
937937 analyses .landing .aerodynamics .settings .spoiler_drag_increment = 0.00
938-
938+
939939 segment .altitude_end = 6.0 * Units .km
940940 segment .air_speed = 195.0 * Units ['m/s' ]
941941 segment .descent_rate = 5.0 * Units ['m/s' ]
942-
942+
943943 # add to mission
944944 mission .append_segment (segment )
945-
946-
945+
946+
947947 # ------------------------------------------------------------------
948948 # Third Descent Segment: consant speed, constant segment rate
949949 # ------------------------------------------------------------------
950-
950+
951951 segment = Segments .Descent .Constant_Speed_Constant_Rate (base_segment )
952952 segment .tag = "descent_3"
953-
953+
954954 segment .analyses .extend ( analyses .landing )
955-
955+
956956 analyses .landing .aerodynamics .settings .spoiler_drag_increment = 0.00
957-
957+
958958 segment .altitude_end = 4.0 * Units .km
959959 segment .air_speed = 170.0 * Units ['m/s' ]
960960 segment .descent_rate = 5.0 * Units ['m/s' ]
961-
961+
962962 # add to mission
963963 mission .append_segment (segment )
964-
965-
964+
965+
966966 # ------------------------------------------------------------------
967967 # Fourth Descent Segment: consant speed, constant segment rate
968968 # ------------------------------------------------------------------
969-
969+
970970 segment = Segments .Descent .Constant_Speed_Constant_Rate (base_segment )
971971 segment .tag = "descent_4"
972-
972+
973973 segment .analyses .extend ( analyses .landing )
974-
974+
975975 analyses .landing .aerodynamics .settings .spoiler_drag_increment = 0.00
976-
976+
977977 segment .altitude_end = 2.0 * Units .km
978978 segment .air_speed = 150.0 * Units ['m/s' ]
979979 segment .descent_rate = 5.0 * Units ['m/s' ]
980980
981-
981+
982982 # add to mission
983983 mission .append_segment (segment )
984-
985984
986-
985+
986+
987987 # ------------------------------------------------------------------
988988 # Fifth Descent Segment: consant speed, constant segment rate
989989 # ------------------------------------------------------------------
990-
990+
991991 segment = Segments .Descent .Constant_Speed_Constant_Rate (base_segment )
992992 segment .tag = "descent_5"
993-
993+
994994 segment .analyses .extend ( analyses .landing )
995995 analyses .landing .aerodynamics .settings .spoiler_drag_increment = 0.00
996-
997-
996+
997+
998998 segment .altitude_end = 0.0 * Units .km
999999 segment .air_speed = 145.0 * Units ['m/s' ]
10001000 segment .descent_rate = 3.0 * Units ['m/s' ]
10011001
1002-
1002+
10031003 # append to mission
10041004 mission .append_segment (segment )
10051005
0 commit comments