File tree Expand file tree Collapse file tree 5 files changed +21
-9
lines changed
Regional_Jet_Optimization Expand file tree Collapse file tree 5 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ def setup(configs):
2020 # build a base analysis for each config
2121 for tag ,config in configs .items ():
2222 analysis = base (config )
23+ if tag == 'cruise_spoilers' :
24+ analysis .aerodynamics .settings .spoiler_drag_increment = 0.005
2325 analyses [tag ] = analysis
2426
2527 return analyses
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ def base(analyses):
210210 segment .tag = "descent_2"
211211
212212 # connect vehicle configuration
213- segment .analyses .extend ( analyses .cruise )
213+ segment .analyses .extend ( analyses .cruise_spoilers )
214214
215215 # segment attributes
216216 segment .atmosphere = atmosphere
Original file line number Diff line number Diff line change 2323# ----------------------------------------------------------------------
2424def main ():
2525 problem = setup ()
26- output = problem .objective ()
26+ # output = problem.objective()
2727 #uncomment these lines when you want to start an optimization problem from a different initial guess
28- '''
2928 inputs = [1.28 , 1.38 ]
3029 scaling = problem .optimization_problem .inputs [:,3 ] #have to rescale inputs to start problem from here
3130 scaled_inputs = np .multiply (inputs ,scaling )
3231 problem .optimization_problem .inputs [:,1 ] = scaled_inputs
33- '''
3432
3533 #optimize
36- # output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
37- # print output
34+ output = scipy_setup .SciPy_Solve (problem ,solver = 'SLSQP' )
35+ print output
3836
3937
4038 #variable_sweep(problem) #uncomment this to view some contours of the problem
4139 print 'fuel burn = ' , problem .summary .base_mission_fuelburn
4240 print 'fuel margin = ' , problem .all_constraints ()
4341
44- # Plot_Mission.plot_mission(problem)
42+ Plot_Mission .plot_mission (problem )
4543
4644 return
4745
Original file line number Diff line number Diff line change 1717# ----------------------------------------------------------------------
1818
1919def plot_mission (nexus ,line_style = 'bo-' ):
20- results = nexus .results
20+ results = nexus .results . base
2121 axis_font = {'fontname' :'Arial' , 'size' :'14' }
2222
2323
@@ -54,7 +54,7 @@ def plot_mission(nexus,line_style='bo-'):
5454 # ------------------------------------------------------------------
5555 fig = plt .figure ("Drag Components" ,figsize = (8 ,10 ))
5656 axes = plt .gca ()
57- for i , segment in enumerate (results .base . segments .values ()):
57+ for i , segment in enumerate (results .segments .values ()):
5858
5959 time = segment .conditions .frames .inertial .time [:,0 ] / Units .min
6060 drag_breakdown = segment .conditions .aerodynamics .drag_breakdown
Original file line number Diff line number Diff line change @@ -367,6 +367,18 @@ def configs_setup(vehicle):
367367 configs .append (config )
368368
369369 config .maximum_lift_coefficient = 1.2
370+
371+
372+ # ------------------------------------------------------------------
373+ # Cruise with Spoilers Configuration
374+ # ------------------------------------------------------------------
375+
376+ config = SUAVE .Components .Configs .Config (base_config )
377+ config .tag = 'cruise_spoilers'
378+
379+ configs .append (config )
380+
381+ config .maximum_lift_coefficient = 1.2
370382
371383
372384 # ------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments