-
Notifications
You must be signed in to change notification settings - Fork 11
/
boxspar.py
88 lines (76 loc) · 2.87 KB
/
boxspar.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
84
85
86
87
88
" box spar "
from gpkit import Model, parse_variables
from .sparloading import SparLoading
from .gustloading import GustL
from gpkitmodels.GP.materials import cfrpud, cfrpfabric, foamhd
from gpkitmodels import g
#pylint: disable=exec-used, undefined-variable, unused-argument, invalid-name
class BoxSpar(Model):
""" Box Spar Model
Scalar Variables
----------------
W [lbf] spar weight
wlim 0.15 [-] spar width to chord ratio
mfac 0.97 [-] curvature knockdown factor
tcoret 0.02 [-] core to thickness ratio
Variables of length N-1
-----------------------
hin [in] height between caps
I [m^4] spar x moment of inertia
J [m^4] spar x polar moment of inertia
Sy [m^3] section modulus
dm [kg] segment spar mass
w [in] spar width
d [in] cross sectional diameter
t [in] spar cap thickness
tshear [in] shear web thickness
tcore [in] core thickness
Upper Unbounded
---------------
W
Lower Unbounded
---------------
Sy, b, J, tmin, rho, g
LaTex Strings
-------------
wlim w_{\\mathrm{lim}}
mfac m_{\\mathrm{fac}}
hin h_{\\mathrm{in}_i}
I I_i
Sy S_{y_i}
dm \\Delta{m}
w w_i
t t_i
tshear t_{\\mathrm{shear}_i}
tcoret (t_{\\mathrm{core}}/t)
"""
loading = SparLoading
gustloading = GustL
material = cfrpud
shearMaterial = cfrpfabric
coreMaterial = foamhd
def setup(self, N, surface):
exec parse_variables(BoxSpar.__doc__)
b = self.b = surface.b
cave = surface.cave
tau = surface.tau
deta = surface.deta
rho = self.material.rho
rhoshear = self.shearMaterial.rho
rhocore = self.coreMaterial.rho
tshearmin = self.shearMaterial.tmin
tmin = self.material.tmin
self.weight = W >= 2*dm.sum()*g
return [I/mfac <= w*t*hin**2,
J*2*(hin + w) <= 2*(hin*w)**2*2*tshear,
dm >= (rho*4*w*t + 4*tshear*rhoshear*(hin + w)
+ 2*rhocore*tcore*(w + hin))*b/2*deta,
w <= wlim*cave,
cave*tau >= hin + 4*t + 2*tcore,
self.weight,
t >= tmin,
Sy*(hin/2 + 2*t + tcore) <= I,
tshear >= tshearmin,
tcore >= tcoret*cave*tau,
d == w,
]