forked from convexengineering/SPaircraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stand_alone_TASOPT_profile.py
679 lines (535 loc) · 23.1 KB
/
stand_alone_TASOPT_profile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
"""TASOPT aircraft flight profile and simple aircraft model"""
from numpy import pi
import numpy as np
from gpkit import Variable, Model, units, SignomialsEnabled, Vectorize
from gpkit.constraints.sigeq import SignomialEquality as SignomialEquality
from gpkit.tools import te_exp_minus1
from gpkit.constraints.tight import Tight as TCS
import matplotlib.pyplot as plt
"""
Models requird to minimze the aircraft total fuel weight. Rate of climb equation taken from John
Anderson's Aircraft Performance and Design (eqn 5.85).
Inputs
-----
- Number of passtengers
- Passegner weight [N]
- Fusealge area per passenger (recommended to use 1 m^2 based on research) [m^2]
- Engine weight [N]
- Number of engines
- Required mission range [nm]
- Oswald efficiency factor
- Max allowed wing span [m]
- Cruise altitude [ft]
"""
class Aircraft(Model):
"Aircraft class"
def setup(self, **kwargs):
#create submodels
self.fuse = Fuselage()
self.wing = Wing()
self.engine = Engine()
#variable definitions
numeng = Variable('numeng', '-', 'Number of Engines')
self.components = [self.fuse, self.wing, self.engine]
return self.components
def climb_dynamic(self, state):
"""
creates an aircraft climb performance model, given a state
"""
return ClimbP(self, state)
def cruise_dynamic(self, state):
"""
creates an aircraft cruise performance model, given a state
"""
return CruiseP(self, state)
class AircraftP(Model):
"""
aircraft performance models superclass, contains constraints true for
all flight segments
"""
def setup(self, aircraft, state, **kwargs):
#make submodels
self.aircraft = aircraft
self.wingP = aircraft.wing.dynamic(state)
self.fuseP = aircraft.fuse.dynamic(state)
self.engineP = aircraft.engine.dynamic(state)
self.Pmodels = [self.wingP, self.fuseP, self.engineP]
#variable definitions
Vstall = Variable('V_{stall}', 'knots', 'Aircraft Stall Speed')
D = Variable('D', 'N', 'Total Aircraft Drag')
W_avg = Variable('W_{avg}', 'N', 'Geometric Average of Segment Start and End Weight')
W_start = Variable('W_{start}', 'N', 'Segment Start Weight')
W_end = Variable('W_{end}', 'N', 'Segment End Weight')
W_burn = Variable('W_{burn}', 'N', 'Segment Fuel Burn Weight')
WLoadmax = Variable('W_{Load_{max}}', 'N/m^2', 'Max Wing Loading')
WLoad = Variable('W_{Load}', 'N/m^2', 'Wing Loading')
t = Variable('tmin', 'min', 'Segment Flight Time in Minutes')
thours = Variable('thr', 'hour', 'Segment Flight Time in Hours')
constraints = []
constraints.extend([
#speed must be greater than stall speed
state['V'] >= Vstall,
#Figure out how to delete
Vstall == 120*units('kts'),
WLoadmax == 6664 * units('N/m^2'),
#compute the drag
TCS([D >= self.wingP['D_{wing}'] + self.fuseP['D_{fuse}']]),
#constraint CL and compute the wing loading
W_avg == .5*self.wingP['C_{L}']*self.aircraft['S']*state.atm['\\rho']*state['V']**2,
WLoad == .5*self.wingP['C_{L}']*self.aircraft['S']*state.atm['\\rho']*state['V']**2/self.aircraft.wing['S'],
#set average weight equal to the geometric avg of start and end weight
W_avg == (W_start * W_end)**.5,
#constrain the max wing loading
WLoad <= WLoadmax,
#compute fuel burn from TSFC
W_burn == aircraft['numeng']*self.engineP['TSFC'] * thours * self.engineP['thrust'],
#time unit conversion
t == thours,
#make lift equal weight --> small angle approx in climb
self.wingP['L_{wing}'] == W_avg,
])
return constraints, self.wingP, self.engineP, self.fuseP
class ClimbP(Model):
"""
Climb constraints
"""
def setup(self, aircraft, state, **kwargs):
#submodels
self.aircraft = aircraft
self.aircraftP = AircraftP(aircraft, state)
self.wingP = self.aircraftP.wingP
self.fuseP = self.aircraftP.fuseP
self.engineP = self.aircraftP.engineP
#variable definitions
theta = Variable('\\theta', '-', 'Aircraft Climb Angle')
excessP = Variable('P_{excess}', 'W', 'Excess Power During Climb')
RC = Variable('RC', 'feet/min', 'Rate of Climb/Decent')
dhft = Variable('dhft', 'feet', 'Change in Altitude Per Climb Segment [feet]')
RngClimb = Variable('R_{climb}', 'nautical_miles', 'Down Range Distance Covered in Each Climb Segment')
TotRngClimb = Variable('TotRngClimb', 'nautical_miles', 'Down Range Distance Covered in Climb')
#constraints
constraints = []
constraints.extend([
#constraint on drag and thrust
self.aircraft['numeng']*self.engineP['thrust'] >= self.aircraftP['D'] + self.aircraftP['W_{avg}'] * theta,
#climb rate constraints
TCS([excessP + state['V'] * self.aircraftP['D'] <= state['V'] * aircraft['numeng'] * self.engineP['thrust']]),
RC == excessP/self.aircraftP['W_{avg}'],
RC >= 500*units('ft/min'),
#make the small angle approximation and compute theta
theta * state['V'] == RC,
dhft == self.aircraftP['tmin'] * RC,
#makes a small angle assumption during climb
## RngClimb == self.aircraftP['thr']*state['V'],
])
with SignomialsEnabled():
constraints.extend([
#time
TCS([self.aircraftP['thr'] * state['V'] >= RngClimb + (.5*theta**2)*self.aircraftP['thr'] * state['V']]),
])
return constraints, self.aircraftP
class CruiseP(Model):
"""
Cruise constraints
"""
def setup(self, aircraft, state, **kwargs):
self.aircraft = aircraft
self.aircraftP = AircraftP(aircraft, state)
self.wingP = self.aircraftP.wingP
self.fuseP = self.aircraftP.fuseP
self.engineP = self.aircraftP.engineP
#variable definitions
z_bre = Variable('z_{bre}', '-', 'Breguet Parameter')
Rng = Variable('Rng', 'nautical_miles', 'Cruise Segment Range')
TotRng = Variable('TotRng', 'nautical_miles', 'Total Cruise Range')
#new varibales for the TASOPT flight profile
gammaCruise = Variable('\\gamma_{cruise}', '-', 'Cruise Climb Angle')
RCCruise = Variable('RC_{cruise}', 'ft/min', 'Cruise Climb Rate')
excessP = Variable('P_{excess}', 'W', 'Excess Power During Cruise')
constraints = []
## constraints.extend([
#taylor series expansion to get the weight term
## TCS([self.aircraftP['W_{burn}']/self.aircraftP['W_{end}'] >=
## te_exp_minus1(z_bre, nterm=3)]),
##
## #breguet range eqn
## TCS([z_bre >= (self.engineP['TSFC'] * self.aircraftP['thr']*
## self.aircraftP['D']) / self.aircraftP['W_{avg}']]),
## #time
## self.aircraftP['thr'] * state['V'] == Rng,
## ])
#new constarints for the TASOPT flight profile
with SignomialsEnabled():
constraints.extend([
#compute the cruise climb angle
state['\\rho']*self.aircraftP['V']**2 == gammaCruise * state["P_{atm}"] * self.aircraftP['M']**2,
#compute the cruise climb rate
self.aircraftP['V'] * gammaCruise == RCCruise,
#constraint on drag and thrust
self.aircraft['numeng']*self.engineP['thrust'] >= self.aircraftP['D'] + self.aircraftP['W_{avg}'] * gammaCruise,
RCCruise == excessP/self.aircraftP['W_{avg}'],
#climb rate constraints
TCS([excessP + state['V'] * self.aircraftP['D'] <= state['V'] * aircraft['numeng'] * self.engineP['thrust']]),
#time
TCS([self.aircraftP['thr'] * state['V'] >= Rng + (.5*gammaCruise**2)*self.aircraftP['thr'] * state['V']]),
])
return constraints, self.aircraftP
class CruiseSegment(Model):
"""
Combines a flight state and aircrat to form a cruise flight segment
"""
def setup(self, aircraft, **kwargs):
self.state = FlightState()
self.cruiseP = aircraft.cruise_dynamic(self.state)
return self.state, self.cruiseP
class ClimbSegment(Model):
"""
Combines a flight state and aircrat to form a cruise flight segment
"""
def setup(self, aircraft, **kwargs):
self.state = FlightState()
self.climbP = aircraft.climb_dynamic(self.state)
return self.state, self.climbP
class FlightState(Model):
"""
creates atm model for each flight segment, has variables
such as veloicty and altitude
"""
def setup(self,**kwargs):
#make an atmosphere model
self.alt = Altitude()
self.atm = Atmosphere(self.alt)
#declare variables
V = Variable('V', 'kts', 'Aircraft Flight Speed')
a = Variable('a', 'm/s', 'Speed of Sound')
R = Variable('R', 287, 'J/kg/K', 'Air Specific Heat')
gamma = Variable('\\gamma', 1.4, '-', 'Air Specific Heat Ratio')
M = Variable('M', '-', 'Mach Number')
#make new constraints
constraints = []
constraints.extend([
V == V, #required so velocity variable enters the model
#compute the speed of sound with the state
a == (gamma * R * self.atm['T_{atm}'])**.5,
#compute the mach number
V == M * a,
])
#build the model
return constraints, self.alt, self.atm
class Altitude(Model):
"""
holds the altitdue variable
"""
def setup(self, **kwargs):
#define altitude variables
h = Variable('h', 'm', 'Segment Altitude [meters]')
hft = Variable('hft', 'feet', 'Segment Altitude [feet]')
constraints = []
constraints.extend([
h == hft, #convert the units on altitude
])
return constraints
class Atmosphere(Model):
def setup(self, alt, **kwargs):
g = Variable('g', 'm/s^2', 'Gravitational acceleration')
p_sl = Variable("p_{sl}", 101325, "Pa", "Pressure at sea level")
T_sl = Variable("T_{sl}", 288.15, "K", "Temperature at sea level")
L_atm = Variable("L_{atm}", .0065, "K/m", "Temperature lapse rate")
M_atm = Variable("M_{atm}", .0289644, "kg/mol",
"Molar mass of dry air")
p_atm = Variable("P_{atm}", "Pa", "air pressure")
R_atm = Variable("R_{atm}", 8.31447, "J/mol/K", "air specific heating value")
TH = 5.257386998354459 #(g*M_atm/R_atm/L_atm).value
rho = Variable('\\rho', 'kg/m^3', 'Density of air')
T_atm = Variable("T_{atm}", "K", "air temperature")
"""
Dynamic viscosity (mu) as a function of temperature
References:
http://www-mdp.eng.cam.ac.uk/web/library/enginfo/aerothermal_dvd_only/aero/
atmos/atmos.html
http://www.cfd-online.com/Wiki/Sutherland's_law
"""
mu = Variable('\\mu', 'kg/(m*s)', 'Dynamic viscosity')
T_s = Variable('T_s', 110.4, "K", "Sutherland Temperature")
C_1 = Variable('C_1', 1.458E-6, "kg/(m*s*K^0.5)",
'Sutherland coefficient')
with SignomialsEnabled():
constraints = [
# Pressure-altitude relation
(p_atm/p_sl)**(1/5.257) == T_atm/T_sl,
# Ideal gas law
rho == p_atm/(R_atm/M_atm*T_atm),
#temperature equation
SignomialEquality(T_sl, T_atm + L_atm*alt['h']),
#constraint on mu
SignomialEquality((T_atm + T_s) * mu, C_1 * T_atm**1.5),
## TCS([(T_atm + T_s) * mu >= C_1 * T_atm**1.5])
]
#like to use a local subs here in the future
subs = None
return constraints
class Engine(Model):
"""
place holder engine model
"""
def setup(self, **kwargs):
#new variables
W_engine = Variable('W_{engine}', 1000, 'N', 'Weight of a Single Turbofan Engine')
constraints = []
constraints.extend([
W_engine == W_engine
])
return constraints
def dynamic(self, state):
"""
returns an engine performance model
"""
return EnginePerformance(self, state)
class EnginePerformance(Model):
"""
place holder engine perofrmacne model
"""
def setup(self, engine, state, **kwargs):
#new variables
TSFC = Variable('TSFC', '1/hr', 'Thrust Specific Fuel Consumption')
thrust = Variable('thrust', 'N', 'Thrust')
#constraints
constraints = []
constraints.extend([
TSFC == TSFC,
thrust == thrust, #want thrust to enter the model
])
return constraints
class Wing(Model):
"""
place holder wing model
"""
def setup(self, ** kwargs):
#new variables
W_wing = Variable('W_{wing}', 'N', 'Wing Weight')
#aircraft geometry
S = Variable('S', 'm^2', 'Wing Planform Area')
AR = Variable('AR', '-', 'Aspect Ratio')
span = Variable('b', 'm', 'Wing Span')
span_max = Variable('b_{max}', 'm', 'Max Wing Span')
K = Variable('K', '-', 'K for Parametric Drag Model')
e = Variable('e', '-', 'Oswald Span Efficiency Factor')
dum1 = Variable('dum1', 124.58, 'm^2')
dum2 = Variable('dum2', 105384.1524, 'N')
constraints = []
constraints.extend([
#wing weight constraint
#based off of a raymer weight and 737 data from TASOPT output file
(S/(dum1))**.65 == W_wing/(dum2),
#compute wing span and aspect ratio, subject to a span constraint
AR == (span**2)/S,
#AR == 9,
span <= span_max,
#compute K for the aircraft
K == (pi * e * AR)**-1,
])
return constraints
def dynamic(self, state):
"""
creates an instance of the wing's performance model
"""
return WingPerformance(self, state)
class WingPerformance(Model):
"""
wing aero modeling
"""
def setup(self, wing, state, **kwargs):
#new variables
CL= Variable('C_{L}', '-', 'Lift Coefficient')
Cdw = Variable('C_{d_w}', '-', 'Cd for a NC130 Airfoil at Re=2e7')
Dwing = Variable('D_{wing}', 'N', 'Total Wing Drag')
Lwing = Variable('L_{wing}', 'N', 'Wing Lift')
#constraints
constraints = []
constraints.extend([
#airfoil drag constraint
Lwing == (.5*wing['S']*state.atm['\\rho']*state['V']**2)*CL,
TCS([Cdw**6.5 >= (1.02458748e10 * CL**15.587947404823325 * state['M']**156.86410659495155 +
2.85612227e-13 * CL**1.2774976672501526 * state['M']**6.2534328002723703 +
2.08095341e-14 * CL**0.8825277088649582 * state['M']**0.0273667615730107 +
1.94411925e+06 * CL**5.6547413360261691 * state['M']**146.51920742858428)]),
TCS([Dwing >= (.5*wing['S']*state.atm['\\rho']*state['V']**2)*(Cdw + wing['K']*CL**2)]),
])
return constraints
class Fuselage(Model):
"""
place holder fuselage model
"""
def setup(self, **kwargs):
#new variables
n_pax = Variable('n_{pass}', '-', 'Number of Passengers to Carry')
#weight variables
W_payload = Variable('W_{payload}', 'N', 'Aircraft Payload Weight')
W_e = Variable('W_{e}', 'N', 'Empty Weight of Aircraft')
W_pax = Variable('W_{pass}', 'N', 'Estimated Average Passenger Weight, Includes Baggage')
A_fuse = Variable('A_{fuse}', 'm^2', 'Estimated Fuselage Area')
pax_area = Variable('pax_{area}', 'm^2', 'Estimated Fuselage Area per Passenger')
constraints = []
constraints.extend([
#compute fuselage area for drag approximation
A_fuse == pax_area * n_pax,
#constraints on the various weights
W_payload == n_pax * W_pax,
#estimate based on TASOPT 737 model
W_e == .75*W_payload,
])
return constraints
def dynamic(self, state):
"""
returns a fuselage performance model
"""
return FuselagePerformance(self, state)
class FuselagePerformance(Model):
"""
Fuselage performance model
"""
def setup(self, fuse, state, **kwargs):
#new variables
Cdfuse = Variable('C_{D_{fuse}}', '-', 'Fuselage Drag Coefficient')
Dfuse = Variable('D_{fuse}', 'N', 'Total Fuselage Drag')
#constraints
constraints = []
constraints.extend([
Dfuse == Cdfuse * (.5 * fuse['A_{fuse}'] * state.atm['\\rho'] * state['V']**2),
Cdfuse == .005,
])
return constraints
class Mission(Model):
"""
mission class, links together all subclasses
"""
def setup(self, ac, substitutions = None, **kwargs):
#define the number of each flight segment
Nclimb = 2
Ncruise = 2
#Vectorize
with Vectorize(Nclimb):
climb = ClimbSegment(ac)
with Vectorize(Ncruise):
cruise = CruiseSegment(ac)
#declare new variables
W_ftotal = Variable('W_{f_{total}}', 'N', 'Total Fuel Weight')
W_fclimb = Variable('W_{f_{climb}}', 'N', 'Fuel Weight Burned in Climb')
W_fcruise = Variable('W_{f_{cruise}}', 'N', 'Fuel Weight Burned in Cruise')
W_total = Variable('W_{total}', 'N', 'Total Aircraft Weight')
CruiseAlt = Variable('CruiseAlt', 'ft', 'Cruise Altitude [feet]')
ReqRng = Variable('R_{req}', 'nautical_miles', 'Required Cruise Range')
h = climb['h']
hftClimb = climb['hft']
dhft = climb['dhft']
hftCruise = cruise['hft']
#make overall constraints
constraints = []
constraints.extend([
#weight constraints
TCS([ac['W_{e}'] + ac['W_{payload}'] + W_ftotal + ac['numeng'] * ac['W_{engine}'] + ac['W_{wing}'] <= W_total]),
climb['W_{start}'][0] == W_total,
climb['W_{end}'][-1] == cruise['W_{start}'][0],
# similar constraint 1
TCS([climb['W_{start}'] >= climb['W_{end}'] + climb['W_{burn}']]),
# similar constraint 2
TCS([cruise['W_{start}'] >= cruise['W_{end}'] + cruise['W_{burn}']]),
climb['W_{start}'][1:] == climb['W_{end}'][:-1],
cruise['W_{start}'][1:] == cruise['W_{end}'][:-1],
TCS([ac['W_{e}'] + ac['W_{payload}'] + ac['numeng'] * ac['W_{engine}'] + ac['W_{wing}'] <= cruise['W_{end}'][-1]]),
TCS([W_ftotal >= W_fclimb + W_fcruise]),
TCS([W_fclimb >= sum(climb['W_{burn}'])]),
TCS([W_fcruise >= sum(cruise['W_{burn}'])]),
#altitude constraints
hftCruise == CruiseAlt,
TCS([hftClimb[1:Ncruise] >= hftClimb[:Ncruise-1] + dhft]),
TCS([hftClimb[0] >= dhft[0]]),
hftClimb[-1] <= hftCruise,
#compute the dh
dhft == hftCruise/Nclimb,
#constrain the thrust
climb['thrust'] <= 2 * max(cruise['thrust']),
#set the TSFC
climb['TSFC'] == .7*units('1/hr'),
cruise['TSFC'] == .5*units('1/hr'),
])
with SignomialsEnabled():
constraints.extend([
#re-evaluate this term
climb['TotRngClimb'] <= sum(climb['R_{climb}']),
#set the range for each cruise segment, doesn't take credit for climb
#down range disatnce covered
climb['TotRngClimb'] + cruise['TotRng'] >= ReqRng,
#+ decent['TotRng']
#individual cruise segment range
cruise.cruiseP['Rng'] == cruise['TotRng']/(Ncruise),
])
#TASOPT flight profile cruise constraints
with SignomialsEnabled():
constraints.extend([
#enforce a constant mach number
cruise['M'][0] == cruise['M'][1],
])
# Model.setup(self, W_ftotal + s*units('N'), constraints + ac + climb + cruise, subs)
return constraints + ac + climb + cruise
if __name__ == '__main__':
#build required submodels
ac = Aircraft()
substitutions = {
## 'V_{stall}': 120,
'R_{req}': 500, #('sweep', np.linspace(500,2000,4)),
'CruiseAlt': 30000, #('sweep', np.linspace(20000,40000,4)),
'numeng': 1,
## 'W_{Load_{max}}': 6664,
'W_{pass}': 91 * 9.81,
'n_{pass}': 150,
'pax_{area}': 1,
## 'C_{D_{fuse}}': .005, #assumes flat plate turbulent flow, from wikipedia
'e': .9,
'b_{max}': 35,
}
mission = Mission(ac)
m = Model(mission['W_{f_{total}}'], mission, substitutions)
sol = m.localsolve(solver='mosek', verbosity = 4)
substitutions = {
## 'V_{stall}': 120,
'R_{req}': ('sweep', np.linspace(500,3000,8)),
'CruiseAlt': 30000, #('sweep', np.linspace(20000,40000,4)),
'numeng': 1,
## 'W_{Load_{max}}': 6664,
'W_{pass}': 91 * 9.81,
'n_{pass}': 150,
'pax_{area}': 1,
## 'C_{D_{fuse}}': .005, #assumes flat plate turbulent flow, from wikipedia
'e': .9,
'b_{max}': 35,
}
mission = Mission(ac)
m = Model(mission['W_{f_{total}}'], mission, substitutions)
## solRsweep = m.localsolve(solver='mosek', verbosity = 4)
## plt.plot(solRsweep('R_{req}'), solRsweep('W_{f_{total}}'), '-r')
## plt.xlabel('Mission Range [nm]')
## plt.ylabel('Total Fuel Burn [N]')
## plt.title('Fuel Burn vs Range')
## plt.show()
substitutions = {
## 'V_{stall}': 120,
'R_{req}': 2000,#('sweep', np.linspace(500,2000,4)),
'CruiseAlt': ('sweep', np.linspace(20000,40000,8)),
'numeng': 1,
## 'W_{Load_{max}}': 6664,
'W_{pass}': 91 * 9.81,
'n_{pass}': 150,
'pax_{area}': 1,
## 'C_{D_{fuse}}': .005, #assumes flat plate turbulent flow, from wikipedia
'e': .9,
'b_{max}': 35,
}
mmission = Mission(ac)
m = Model(mission['W_{f_{total}}'], mission, substitutions)
## solAltsweep = m.localsolve(solver='mosek', verbosity = 4)
## plt.plot(solAltsweep('CruiseAlt'), solAltsweep('W_{f_{total}}'), '-r')
## plt.xlabel('Cruise Alt [ft]')
## plt.ylabel('Total Fuel Burn [N]')
## plt.title('Fuel Burn vs Range')
## plt.show()