Closed mjburton11 closed 8 years ago
Here's one source for some of the versions: Range: http://web.mit.edu/16.unified/www/FALL/thermodynamics/notes/node98.html Endurance: http://web.mit.edu/16.unified/www/FALL/thermodynamics/notes/node99.html
I have a hunch that one way to start unifying is to have all Breguet models predict time, not range, and then range is just V*t. But there are still a number of different modeling assumptions that need to be supported -- BSFC constant, TSFC constant, etc.
Had some problems with the Breguet Range equation. I know I'm to supposed to post a lot of code but, I wasn't sure how to deal with this. These are the issues I'm having:
1) Don't no how to bound my initial and final weights.
2) I'm not sure how to put an upper bound on LoverD without going to into a lot of Drag calculations. But maybe that's what I want to do.
3) Not sure how to deal with TSFC at this point so I just bounded it with a number, which is probably not the best way to go about that.
# Constants
g = Variable('g', value=9.8, units='m/s^2')
a0 = Variable('a_0', value=340.29, units='m/s', label="speed of sound at sea level")
TSFC_min = Variable('TSFC_{min}', value=0.307, units='lb/lbf/hr',
label="Minimum TSFC value")
M_min = Variable('M_{min}', value=0.6, label="Minimum Mach number")
MTOW = Variable('MTOW', value=10000, units='lbf', label="Max Take off Weight")
t_min = Variable('t_{min}', value=3, units='hr', label='Minimum Flight Time')
# Free Variables
R = Variable('R', units='nautical_miles', label="range")
M = Variable('M', label="Mach number")
LoverD = Variable('L/D', label="lift to drag ratio")
TSFC = Variable('TSFC', units='lb/lbf/hr', label="thrust specific fuel consumption")
W_init = Variable('W_{init}', units='lbf', label="Initial Weight")
W_end = Variable('W_{end}', units='lbf', label="Final Weight")
W_fuel = Variable('W_fuel', units='lbf', label="Fuel Weight")
z_bre = Variable('z_{bre}', label="Breguet parameter")
t = Variable('t', units='s', label='Time')
t = R/M/a0
models = [W_init >= W_end + W_fuel,
W_init <= MTOW,
LoverD >= 1,
TSFC >= TSFC_min,
M >= M_min,
z_bre >= t*TSFC*g/LoverD,
t >= t_min,
W_init/W_end >= te_exp_minus1(z_bre, nterm=3),
]
return Model(1/R, models)
@mjburton11, did we resolve some of this in person today?
Yes we did. Thanks!
@whoburg, Hey I was trying to run this Breguet Range model. I have defined free variables, constraint and objective functions I just did not include them here.
def setup(self, TSFC_min=0.307, MTOW=10000, W_oew=7000, LoverD_max=15, M_max=0.78):
#store attributes for later external use
self.TSFC_min, self.MTOW, self.W_oew, self.LoverD_max, self.M_max = TSFC_min, MTOW, W_oew, LoverD_max, M_max
TSFC_min = Var('TSFC_{min}', TSFC_min, "lb/lbf/hr")
MTOW = Var('MTOW', MTOW, "lbf")
W_oew = Var('W_{oew}', W_oew, "lbf")
LoverD_max = Var('LoverD_{max}', LoverD_max)
M_max = Var('M_max', M_max)
...
if __name__ == "__main__":
m = Breguet_Range(0.307, 10000, 7000, 15, 0.78)
sol = m.solve()
And I got this error:
File "breguet_range.py", line 59, in <module>
m = Breguet_Range(0.307, 10000, 7000, 15, 0.78)
File "/Users/mjburton11/.local/lib/python2.7/site-packages/gpkit/model.py", line 93, in __init__
self.constraints = list(constraints)
TypeError: 'int' object is not iterable
Do you know why this is happening?
If you send me the whole code, I can figure it out.
from gpkit.shortcuts import *
class Breguet_Range(Model):
"""Breguet Range Model
Arguments
--------------------
TSFC_min
Minimum TSFC value, assumed constant
MTOW
Max Take Off Weight
W_oew
Operating empty weight
LoverD_max
Maximum Lift to Drag ratio
M_max
Maximum Mach number
"""
def setup(self, TSFC_min=0.307, MTOW=10000, W_oew=7000, LoverD_max=15, M_max=0.78):
#store attributes for later external use
self.TSFC_min, self.MTOW, self.W_oew, self.LoverD_max, self.M_max = TSFC_min, MTOW, W_oew, LoverD_max, M_max
TSFC_min = Var('TSFC_{min}', TSFC_min, "lb/lbf/hr")
MTOW = Var('MTOW', MTOW, "lbf")
W_oew = Var('W_{oew}', W_oew, "lbf")
LoverD_max = Var('LoverD_{max}', LoverD_max)
M_max = Var('M_max', M_max)
#Constants
g = Var('g', 9.81, "m/s^2","gravity")
a0 = Var('a0', 340.29, "m/s", "speed of sound at sea level")
#Free Variables
R = Var('R', "nautical_miles", "range")
M = Var('M', "Mach number")
LoverD = Var('LoverD', "life to drag ratio")
TSFC = Var('TSFC', "lb/lbf/hr", "thrust specific fuel consuption")
W_init = Var('W_init', "lbf", "initial weight")
W_fuel = Var('W_fuel', "lbf", "fuel weight")
z_bre = Var('z_{bre}', "Breguet parameter")
t = Var('t', "hr", "time")
#Set up Model Equations
objective = 1/t #Maximize time
constraints = [
W_init >= W_oew + W_fuel,
W_init <= MTOW,
LoverD <= LoverD_max,
TSFC >= TSFC_min,
M <= M_max,
t <= T/M/a0,
z_bre >= t*TSFC*g/LoverD,
W_fuel/W_end >= te_exp_minus1(z_bre, nterm=3)
]
return objective, constraints
if __name__ == "__main__":
m = Breguet_Range(0.307, 10000, 7000, 15, 0.78)
sol = m.solve()
(oh, shoot, sorry, missed that this was also a PR & branch with the code already)
This was resolved a while ago so I'm going to close it.
:+1:
Hey we should have a Breguet Range Model. Woody and I discussed that there are multiple versions of the Breguet Range such as when it applies to props and when it applies to jets. I'm going to make a very simple model that we can then build off of.