-
Notifications
You must be signed in to change notification settings - Fork 11
/
prop_test.py
38 lines (30 loc) · 1.04 KB
/
prop_test.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
" propeller tests "
from gpkitmodels.GP.aircraft.prop.propeller import Propeller, ActuatorProp
from gpkitmodels.GP.aircraft.prop.propeller import MultiElementProp
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState
from gpkit import units, Model
def simpleprop_test():
" test simple propeller model "
fs = FlightState()
Propeller.flight_model = ActuatorProp
p = Propeller()
pp = p.flight_model(p, fs)
m = Model(1/pp.eta + p.W/(100.*units("lbf"))+ pp.Q/(100.*units("N*m")),
[fs, p, pp])
m.substitutions.update({"rho": 1.225, "V": 50, "T": 100, "omega":1000})
sol = m.solve()
def ME_eta_test():
fs = FlightState()
Propeller.flight_model = MultiElementProp
p = Propeller()
pp = p.flight_model(p,fs)
pp.substitutions[pp.T] = 100
pp.cost = 1./pp.eta + pp.Q/(100.*units("N*m")) + p.T_m/(1000*units('N'))
sol = pp.localsolve(iteration_limit = 400)
print sol.table()
def test():
"tests"
simpleprop_test()
ME_eta_test()
if __name__ == "__main__":
test()