-
Notifications
You must be signed in to change notification settings - Fork 11
/
empennage.py
58 lines (48 loc) · 1.82 KB
/
empennage.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
" empennage.py "
from gpkit import Model, parse_variables
from .horizontal_tail import HorizontalTail
from .vertical_tail import VerticalTail
from .tail_boom import TailBoom, TailBoomState
#pylint: disable=attribute-defined-outside-init, no-member, exec-used
#pylint: disable=too-many-instance-attributes, invalid-name, undefined-variable
class Empennage(Model):
"""empennage model, consisting of vertical, horizontal and tailboom
Variables
---------
mfac 1.0 [-] tail weight margin factor
W [lbf] empennage weight
Upper Unbounded
---------------
W, Vv, Vh
Lower Unbounded
---------------
lv, lh, Vv, Vh, bv, bh, mh
LaTex Strings
-------------
mfac m_{\\mathrm{fac}}
"""
def setup(self):
exec parse_variables(Empennage.__doc__)
self.htail = HorizontalTail()
self.htail.substitutions.update({self.htail.mfac: 1.1})
lh = self.lh = self.htail.lh
self.Vh = self.htail.Vh
self.bh = self.htail.b
self.mh = self.htail.mh
self.vtail = VerticalTail()
self.vtail.substitutions.update({self.vtail.mfac: 1.1})
lv = self.lv = self.vtail.lv
self.Vv = self.vtail.Vv
self.bv = self.vtail.b
self.tailboom = TailBoom()
self.components = [self.htail, self.vtail, self.tailboom]
l = self.l = self.tailboom.l
state = TailBoomState()
loading = [self.tailboom.hbending(self.tailboom, self.htail, state),
self.tailboom.vbending(self.tailboom, self.vtail, state),
self.tailboom.vtorsion(self.tailboom, self.vtail, state)]
constraints = [
W/mfac >= sum(c.W for c in self.components),
l >= lh, l >= lv,
]
return self.components, constraints, loading