-
Notifications
You must be signed in to change notification settings - Fork 11
/
prop_test.py
66 lines (54 loc) · 1.5 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
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
" propelle tests "
from propeller import Actuator_Propeller
from propeller import One_Element_Propeller, Multi_Element_Propeller
from gpkit import units
#from qprop import QProp
from gpkitmodels.GP.aircraft.wing.wing_test import FlightState
def eta_test():
fs = FlightState()
p = Actuator_Propeller()
pp = p.flight_model(p,fs)
pp.substitutions[pp.T] = 100
pp.cost = 1/pp.eta + pp.Q/(100.*units("N*m"))
sol = pp.solve()
print sol.table()
def OE_eta_test():
fs = FlightState()
p = One_Element_Propeller()
pp = p.flight_model(p,fs)
pp.substitutions[pp.T] = 1000
#pp.substitutions[pp.omega] = 500
pp.substitutions[pp.AR_b] = 12
pp.cost = 1/pp.eta + pp.Q/(10.*units("N*m"))
sol = pp.localsolve()
#sol = pp.debug()
print sol.table()
def ME_eta_test():
fs = FlightState()
p = Multi_Element_Propeller()
p.substitutions[p.T_m] = 100
p.substitutions[p.R] = 2
pp = p.flight_model(p,fs)
pp.substitutions[pp.T] = 100
#pp.substitutions[pp.omega] = 500
#pp.substitutions[pp.omega] = 1000
pp.cost = 1./pp.eta + pp.Q/(100.*units("N*m"))
sol = pp.localsolve(iteration_limit = 400)
#sol = pp.debug()
print sol.table()
#def qprop_test():
#
# fs = FlightState()
# p = QProp(fs)
# p.substitutions[p.T] = 100
# p.cost = 1/p.eta
# sol = p.solve()
# print sol.table()
def test():
"tests"
#eta_test()
#OE_eta_test()
ME_eta_test()
#qprop_test()
if __name__ == "__main__":
test()