/
wing_skin.py
83 lines (65 loc) · 2 KB
/
wing_skin.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
" wing skin "
from gpkit import Model, parse_variables
from gpkitmodels.GP.materials import cfrpfabric
from gpkitmodels import g
class WingSkin(Model):
""" Wing Skin model
Variables
---------
W [lbf] wing skin weight
t [in] wing skin thickness
Jtbar 0.01114 [1/mm] torsional moment of inertia
Cmw 0.121 [-] negative wing moment coeff
rhosl 1.225 [kg/m^3] sea level air density
Vne 45 [m/s] never exceed vehicle speed
Upper Unbounded
---------------
W, croot
Lower Unbounded
---------------
S
LaTex Strings
-------------
W W_{\\mathrm{skin}}
t t_{\\mathrm{skin}}
Jtbar \\bar{J/t}
Cmw C_{m_w}
rhosl \\rho_{\\mathrm{SL}}
Vne V_{\\mathrm{NE}}
"""
material = cfrpfabric
def setup(self, surface):
exec parse_variables(WingSkin.__doc__)
Jtbar.key.descr['pr'] = 2
Cmw.key.descr['pr'] = 4
rhosl.key.descr['pr'] = 1
Vne.key.descr['pr'] = 4
croot = self.croot = surface.croot
S = self.S = surface.S
rho = self.material.rho
tau = self.material.tau
tmin = self.material.tmin
return [W >= rho*surface.S*2*t*g,
t >= tmin,
tau >= 1/Jtbar/croot**2/t*Cmw*S*rhosl*Vne**2]
class WingSecondStruct(Model):
""" Wing Skin model
Variables
---------
W [lbf] wing skin weight
rhoA 0.35 [kg/m^2] total aerial density
Upper Unbounded
---------------
W
Lower Unbounded
---------------
S
LaTex Strings
-------------
W W_{\\mathrm{skin}}
rhoA \\rho_{A}
"""
def setup(self, surface):
exec parse_variables(WingSecondStruct.__doc__)
S = self.S = surface.S
return [W >= rhoA*S*g]