Skip to content

Commit a917259

Browse files
committed
first clean up of regional jet
1 parent b63684c commit a917259

6 files changed

Lines changed: 111 additions & 319 deletions

File tree

Regional_Jet_Optimization/Analyses.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Analyses.py
22
#
3-
# Created: Mar. 2016, M. Vegh
4-
# Modified:
3+
# Created: Mar 2016, M. Vegh
4+
# Modified: Aug 2017, E. Botero
55

66
# ----------------------------------------------------------------------
77
# Imports
@@ -22,14 +22,6 @@ def setup(configs):
2222
analysis = base(config)
2323
analyses[tag] = analysis
2424

25-
# adjust analyses for configs
26-
27-
# takeoff_analysis
28-
analyses.takeoff.aerodynamics.settings.drag_coefficient_increment = 0.0000
29-
30-
# landing analysis
31-
aerodynamics = analyses.landing.aerodynamics
32-
3325
return analyses
3426

3527
# ----------------------------------------------------------------------
@@ -59,8 +51,6 @@ def base(vehicle):
5951
# Aerodynamics Analysis
6052
aerodynamics = SUAVE.Analyses.Aerodynamics.Fidelity_Zero()
6153
aerodynamics.geometry = vehicle
62-
63-
aerodynamics.settings.drag_coefficient_increment = 0.0000
6454
analyses.append(aerodynamics)
6555

6656
# ------------------------------------------------------------------
@@ -72,7 +62,7 @@ def base(vehicle):
7262
# ------------------------------------------------------------------
7363
# Energy
7464
energy= SUAVE.Analyses.Energy.Energy()
75-
energy.network = vehicle.propulsors #what is called throughout the mission (at every time step))
65+
energy.network = vehicle.propulsors
7666
analyses.append(energy)
7767

7868
# ------------------------------------------------------------------
@@ -86,5 +76,4 @@ def base(vehicle):
8676
atmosphere.features.planet = planet.features
8777
analyses.append(atmosphere)
8878

89-
# done!
9079
return analyses

Regional_Jet_Optimization/Missions.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Missions.py
22
#
33
# Created: Mar 2016, M. Vegh
4-
# Modified:
5-
4+
# Modified: Aug 2017, E. Botero
65

76
# ----------------------------------------------------------------------
87
# Imports
@@ -28,13 +27,7 @@ def setup(analyses):
2827
base_mission = base(analyses)
2928
missions.base = base_mission
3029

31-
32-
33-
34-
35-
3630
return missions
37-
3831

3932
def base(analyses):
4033

@@ -169,7 +162,7 @@ def base(analyses):
169162

170163

171164
# ------------------------------------------------------------------
172-
# Cruise Segment: constant speed, constant altitude
165+
# Cruise Segment: Constant Speed, Constant Altitude
173166
# ------------------------------------------------------------------
174167

175168
segment = Segments.Cruise.Constant_Speed_Constant_Altitude()
@@ -189,7 +182,7 @@ def base(analyses):
189182
mission.append_segment(segment)
190183

191184
# ------------------------------------------------------------------
192-
# First Descent Segment: consant speed, constant segment rate
185+
# First Descent Segment: Constant Speed, Constant Rate
193186
# ------------------------------------------------------------------
194187

195188
segment = Segments.Descent.Constant_Speed_Constant_Rate()
@@ -209,9 +202,8 @@ def base(analyses):
209202
# add to mission
210203
mission.append_segment(segment)
211204

212-
213205
# ------------------------------------------------------------------
214-
# Second Descent Segment: consant speed, constant segment rate
206+
# Second Descent Segment: Constant Speed, Constant Rate
215207
# ------------------------------------------------------------------
216208

217209
segment = Segments.Descent.Constant_Speed_Constant_Rate()
@@ -231,9 +223,8 @@ def base(analyses):
231223
# append to mission
232224
mission.append_segment(segment)
233225

234-
235226
# ------------------------------------------------------------------
236-
# Third Descent Segment: consant speed, constant segment rate
227+
# Third Descent Segment: Constant Speed, Constant Rate
237228
# ------------------------------------------------------------------
238229

239230
segment = Segments.Descent.Constant_Speed_Constant_Rate()
@@ -263,10 +254,6 @@ def base(analyses):
263254
### Reserve mission
264255
#------------------------------------------------------------------
265256

266-
# ------------------------------------------------------------------
267-
# First Climb Segment: constant Mach, constant segment angle
268-
# ------------------------------------------------------------------
269-
270257
# ------------------------------------------------------------------
271258
# First Climb Segment: Constant Speed, Constant Throttle
272259
# ------------------------------------------------------------------
@@ -288,8 +275,6 @@ def base(analyses):
288275

289276
# add to misison
290277
mission.append_segment(segment)
291-
292-
293278

294279
# ------------------------------------------------------------------
295280
# Cruise Segment: constant speed, constant altitude
@@ -318,7 +303,6 @@ def base(analyses):
318303

319304
mission.append_segment(segment)
320305

321-
322306
# ------------------------------------------------------------------
323307
# Final Descent Segment: consant speed, constant segment rate
324308
# ------------------------------------------------------------------
@@ -327,13 +311,9 @@ def base(analyses):
327311
segment.tag = "reserve_descent_1"
328312

329313
segment.analyses.extend( analyses.landing )
330-
analyses.landing.aerodynamics.settings.spoiler_drag_increment = 0.00
331-
332314

333315
segment.altitude_end = 0.0 * Units.km
334316
segment.descent_rate = 3.0 * Units['m/s']
335-
336-
337317
segment.mach_end = 0.24
338318
segment.mach_start = 0.3
339319

@@ -344,13 +324,8 @@ def base(analyses):
344324
### Reserve mission completed
345325
#------------------------------------------------------------------
346326

347-
348327
return mission
349328

350-
351-
352-
353-
354329
# ----------------------------------------------------------------------
355330
# Call Main
356331
# ----------------------------------------------------------------------

Regional_Jet_Optimization/Optimize.py

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Optimize.py
22
# Created: Feb 2016, M. Vegh
3-
# Modified:
3+
# Modified: Aug 2017, E. Botero
44

55
# ----------------------------------------------------------------------
66
# Imports
@@ -17,8 +17,7 @@
1717
import matplotlib.pyplot as plt
1818
from SUAVE.Optimization import Nexus, carpet_plot
1919
import SUAVE.Optimization.Package_Setups.scipy_setup as scipy_setup
20-
#import VyPy
21-
#import pyOpt
20+
2221
# ----------------------------------------------------------------------
2322
# Run the whole thing
2423
# ----------------------------------------------------------------------
@@ -39,15 +38,13 @@ def main():
3938

4039

4140
#variable_sweep(problem) #uncomment this to view some contours of the problem
42-
print 'fuel burn=', problem.summary.base_mission_fuelburn
43-
print 'fuel margin=', problem.all_constraints()
41+
print 'fuel burn = ', problem.summary.base_mission_fuelburn
42+
print 'fuel margin = ', problem.all_constraints()
4443

4544
#Plot_Mission.plot_mission(problem)
4645

4746
return
4847

49-
50-
5148
# ----------------------------------------------------------------------
5249
# Inputs, Objective, & Constraints
5350
# ----------------------------------------------------------------------
@@ -67,9 +64,7 @@ def setup():
6764
[ 'wing_area' , 95 , ( 90. , 130. ) , 100. , Units.meter**2],
6865
[ 'cruise_altitude' , 11 , ( 9 , 14. ) , 10. , Units.km],
6966
])
70-
71-
72-
67+
7368
# -------------------------------------------------------------------
7469
# Objective
7570
# -------------------------------------------------------------------
@@ -80,7 +75,6 @@ def setup():
8075
[ 'fuel_burn', 10000, Units.kg ]
8176
])
8277

83-
8478
# -------------------------------------------------------------------
8579
# Constraints
8680
# -------------------------------------------------------------------
@@ -103,39 +97,22 @@ def setup():
10397
[ 'fuel_burn' , 'summary.base_mission_fuelburn' ],
10498
[ 'design_range_fuel_margin' , 'summary.max_zero_fuel_margin' ],
10599
]
106-
'''
107-
#TASOPT imports
108-
from mission_B737_TASOPT import full_setup, mission_setup
109-
110-
configs, analyses = full_setup()
111-
nexus.vehicle_configurations = configs
112-
nexus.analyses = analyses
113-
nexus.mission = analyses.mission
114-
#nexus.mission = mission_setup(nexus.analyses)
115-
'''
116-
117100

118101
# -------------------------------------------------------------------
119102
# Vehicles
120103
# -------------------------------------------------------------------
121-
122-
#import Vehicle_TASOPT
123-
#nexus.vehicle_configurations = Vehicle_TASOPT.setup()
124104
nexus.vehicle_configurations = Vehicles.setup()
125105

126-
127106
# -------------------------------------------------------------------
128107
# Analyses
129108
# -------------------------------------------------------------------
130109
nexus.analyses = Analyses.setup(nexus.vehicle_configurations)
131110

132-
133111
# -------------------------------------------------------------------
134112
# Missions
135113
# -------------------------------------------------------------------
136114
nexus.missions = Missions.setup(nexus.analyses)
137115

138-
139116
# -------------------------------------------------------------------
140117
# Procedure
141118
# -------------------------------------------------------------------
@@ -164,27 +141,10 @@ def variable_sweep(problem):
164141
cbar = plt.colorbar(CS_const)
165142
cbar.ax.set_ylabel('fuel margin')
166143

167-
168-
169144
plt.xlabel('wing area (m^2)')
170145
plt.ylabel('cruise_altitude (km)')
171146

172-
173-
wing_1 = np.array([ 0.95, 0.9500000149011611, 0.95, 0.95, 0.9500000149011611, 0.95, 0.95, 0.9500000149011611, 0.95, 1.0830895945429801, 1.0830896094441413, 1.0830895945429801, 1.0830895945429801, 1.0830896094441413, 1.0830895945429801, 1.0830895945429801, 1.0830896094441413, 1.0830895945429801, 1.021757391325076, 1.0217574062262371, 1.021757391325076, 1.021757391325076, 1.0217574062262371, 1.021757391325076, 1.021757391325076, 1.0217574062262371, 1.021757391325076, 0.923430766276824, 0.9234307811779852, 0.923430766276824, 0.923430766276824, 0.9234307811779852, 0.923430766276824, 0.923430766276824, 0.9234307811779852, 0.923430766276824, 0.9458241453484385, 0.9458241602495997, 0.9458241453484385, 0.9458241453484385, 0.9458241602495997, 0.9458241453484385, 0.9458241453484385, 0.9458241602495997, 0.9458241453484385, 0.943053052966747, 0.9430530678679082, 0.943053052966747, 0.943053052966747, 0.9430530678679082, 0.943053052966747, 0.943053052966747, 0.9430530678679082, 0.943053052966747, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 1.0, 1.0, 1.0, 1.0, 1.0, 1.1000000000000001, 1.1000000000000001, 1.1000000000000001, 1.1000000000000001, 1.1000000000000001, 1.2, 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3, 1.3, 0.94305305 ])*100.
174-
alt_1 = [11. , 11. , 11.00000015, 11. , 11. , 11.00000015, 11. , 11. , 11.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 9. , 9.00000015, 9. , 10.25 , 11.5 , 12.75 , 14. , 9. , 10.25 , 11.5 , 12.75 , 14. , 9. , 10.25 , 11.5 , 12.75 , 14. , 9. , 10.25 , 11.5 , 12.75 , 14. , 9. , 10.25 , 11.5 , 12.75 , 14. , 9. ]
175-
176-
wing_2 = np.array([1.28, 1.2800000149011612, 1.28, 1.28, 1.2800000149011612, 1.28, 1.28, 1.2800000149011612, 1.28, 1.3, 1.3000000149011612, 1.3, 1.3, 1.3000000149011612, 1.3, 1.3, 1.3000000149011612, 1.3, 1.2512983213829585, 1.2512983362841197, 1.2512983213829585, 1.2512983213829585, 1.2512983362841197, 1.2512983213829585, 1.2512983213829585, 1.2512983362841197, 1.2512983213829585, 1.2027018036450188, 1.20270181854618, 1.2027018036450188, 1.2027018036450188, 1.20270181854618, 1.2027018036450188, 1.2027018036450188, 1.20270181854618, 1.2027018036450188, 0.9696195074510734, 0.9696195223522346, 0.9696195074510734, 0.9696195074510734, 0.9696195223522346, 0.9696195074510734, 0.9696195074510734, 0.9696195223522346, 0.9696195074510734, 0.9356100057984995, 0.9356100206996607, 0.9356100057984995, 0.9356100057984995, 0.9356100206996607, 0.9356100057984995, 0.9356100057984995, 0.9356100206996607, 0.9356100057984995, 0.9442290521247874, 0.9442290670259486, 0.9442290521247874, 0.9442290521247874, 0.9442290670259486, 0.9442290521247874, 0.9442290521247874, 0.9442290670259486, 0.9442290521247874, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 1.0, 1.0, 1.0, 1.0, 1.0, 1.1000000000000001, 1.1000000000000001, 0.94422905 ])* 100.
177-
178-
alt_2 = [ 13.8 , 13.8 , 13.80000015 , 13.8 , 13.8 , 13.80000015 , 13.8 , 13.8, 13.80000015 , 10.86578142 , 10.86578142, 10.86578157 , 10.86578142 , 10.86578142 , 10.86578157 , 10.86578142, 10.86578142 , 10.86578157 , 9. , 9. , 9.00000015 , 9., 9., 9.00000015 , 9. , 9. , 9.00000015 , 9.26299784 , 9.26299784 , 9.26299799 , 9.26299784 , 9.26299784 , 9.26299799 , 9.26299784 , 9.26299784 , 9.26299799 , 9.21358943 , 9.21358943 , 9.21358957 , 9.21358943 , 9.21358943 , 9.21358957 , 9.21358943 , 9.21358943 , 9.21358957 , 9. , 9., 9.00000015 , 9., 9. , 9.00000015 , 9., 9. , 9.00000015 , 9. , 9., 9.00000015 , 9. , 9. , 9.00000015 , 9. , 9., 9.00000015 , 9. , 10.25 , 11.5 , 12.75, 14., 9.,10.25 , 11.5 , 12.75 , 14. , 9. , 10.25 , 9. ]
179-
180-
181-
182147
#now plot optimization path (note that these data points were post-processed into a plottable format)
183-
#wing_1 = [95 , 95.00000149 , 95 , 95 , 95.00000149 , 95 , 95 , 95.00000149 , 95 , 106.674165 , 106.6741665 , 106.674165 , 106.674165 , 106.6741665 , 106.674165 , 106.674165 , 106.6741665 , 106.674165 , 105.6274294 , 105.6274309 , 105.6274294 , 105.6274294 , 105.6274309 , 105.6274294 , 105.6274294 , 105.6274309 , 105.6274294 , 106.9084316 , 106.9084331 , 106.9084316 , 106.9084316 , 106.9084331 , 106.9084316 , 106.9084316 , 106.9084331 , 106.9084316 , 110.520489 , 110.5204905 , 110.520489 , 110.520489 , 110.5204905 , 110.520489 , 110.520489 , 110.5204905 , 110.520489 , 113.2166831 , 113.2166845 , 113.2166831 , 113.2166831 , 113.2166845 , 113.2166831 , 113.2166831 , 113.2166845 , 113.2166831 , 114.1649262 , 114.1649277 , 114.1649262 , 114.1649262 , 114.1649277 , 114.1649262 , 114.1649262 , 114.1649277 , 114.1649262 , 114.2149828]
184-
#alt_1 = [11.0 , 11.0 , 11.000000149011612, 11.0 , 11.0 , 11.000000149011612, 11.0 , 11.0 , 11.000000149011612, 9.540665954351425 , 9.540665954351425 , 9.540666103363037 , 9.540665954351425 , 9.540665954351425 , 9.540666103363037 , 9.540665954351425 , 9.540665954351425 , 9.540666103363037 , 10.023015652305284, 10.023015652305284, 10.023015801316896, 10.023015652305284, 10.023015652305284, 10.023015801316896, 10.023015652305284, 10.023015652305284, 10.023015801316896, 10.190994033521863, 10.190994033521863, 10.190994182533474, 10.190994033521863, 10.190994033521863, 10.190994182533474, 10.190994033521863, 10.190994033521863, 10.190994182533474, 10.440582829327589, 10.440582829327589, 10.4405829783392 , 10.440582829327589, 10.440582829327589, 10.4405829783392 , 10.440582829327589, 10.440582829327589, 10.4405829783392 , 10.536514606250261, 10.536514606250261, 10.536514755261873, 10.536514606250261, 10.536514606250261, 10.536514755261873, 10.536514606250261, 10.536514606250261, 10.536514755261873, 10.535957839878783, 10.535957839878783, 10.535957988890395, 10.535957839878783, 10.535957839878783, 10.535957988890395, 10.535957839878783, 10.535957839878783, 10.535957988890395, 10.52829047]
185-
#wing_2 = [128 , 128.0000015, 128 , 128 , 128.0000015, 128 , 128 , 128.0000015, 128 , 130 , 130.0000015, 130 , 130 , 130.0000015, 130 , 130 , 130.0000015, 130 , 122.9564124, 122.9564139, 122.9564124, 122.9564124, 122.9564139, 122.9564124, 122.9564124, 122.9564139, 122.9564124, 116.5744347, 116.5744362, 116.5744347, 116.5744347, 116.5744362, 116.5744347, 116.5744347, 116.5744362, 116.5744347, 116.3530891, 116.3530906, 116.3530891, 116.3530891, 116.3530906, 116.3530891, 116.3530891, 116.3530906, 116.3530891]
186-
#alt_2 = [13.8, 13.799999999999999, 13.80000014901161, 13.799999999999999, 13.799999999999999, 13.80000014901161, 13.799999999999999, 13.799999999999999, 13.80000014901161, 11.302562430674953, 11.302562430674953, 11.302562579686565, 11.302562430674953, 11.302562430674953, 11.302562579686565, 11.302562430674953, 11.302562430674953, 11.302562579686565, 11.158808932491421, 11.158808932491421, 11.158809081503033, 11.158808932491421, 11.158808932491421, 11.158809081503033, 11.158808932491421, 11.158808932491421, 11.158809081503033, 11.412913394878741, 11.412913394878741, 11.412913543890353, 11.412913394878741, 11.412913394878741, 11.412913543890353, 11.412913394878741, 11.412913394878741, 11.412913543890353, 11.402627869388722, 11.402627869388722, 11.402628018400334, 11.402627869388722, 11.402627869388722, 11.402628018400334, 11.402627869388722, 11.402627869388722, 11.402628018400334]
187-
188148
'''
189149
opt_1 = plt.plot(wing_1, alt_1, label='optimization path 1')
190150
init_1 = plt.plot(wing_1[0], alt_1[0], 'ko')
@@ -197,12 +157,7 @@ def variable_sweep(problem):
197157
plt.legend(loc='upper left')
198158
plt.show(block=True)
199159

200-
201-
202160
return
203-
204-
161+
205162
if __name__ == '__main__':
206-
main()
207-
208-
163+
main()

0 commit comments

Comments
 (0)