-
Notifications
You must be signed in to change notification settings - Fork 11
/
gustloading.py
65 lines (52 loc) · 1.86 KB
/
gustloading.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
" spar loading for gust case "
import os
from numpy import pi, hstack, cos
import pandas as pd
from gpkit import parse_variables
from gpfit.fit_constraintset import FitCS
from .sparloading import SparLoading
#pylint: disable=invalid-name, no-member, arguments-differ, exec-used
#pylint: disable=attribute-defined-outside-init, undefined-variable
class GustL(SparLoading):
""" Gust Loading Model
Variables
---------
vgust 10 [m/s] gust velocity
Ww [lbf] wing weight
v [m/s] vehicle speed
cl [-] wing lift coefficient
Variables of length wing.N
--------------------------
agust [-] gust angle of attack
cosminus1 self.return_cosm1 [-] 1 minus cosine factor
Upper Unbounded
---------------
v, cl
Lower Unbounded
---------------
Ww
LaTex Strings
-------------
vgust V_{\\mathrm{gust}}
Ww W_{\\mathrm{w}}
cl c_l
agust \\alpha_{\\mathrm{gust}}
cosminus1 (cos(x)-1)
"""
new_qbarFun = None
new_SbarFun = None
return_cosm1 = lambda self, c: hstack(
[1e-10, 1-cos(c[self.wing.planform.eta][1:]*pi/2)])
def setup(self, wing):
exec parse_variables(GustL.__doc__)
self.load = SparLoading.setup(self, wing)
path = os.path.dirname(os.path.abspath(__file__))
df = pd.read_csv(path + os.sep + "arctan_fit.csv").to_dict(
orient="records")[0]
constraints = [
# fit for arctan from 0 to 1, RMS = 0.044
FitCS(df, agust, [cosminus1*vgust/v]),
self.beam["\\bar{q}"] >= self.wing.planform.cbar*(
1 + 2*pi*agust/cl*(1+Ww/self.W)),
]
return self.load, constraints