-
Notifications
You must be signed in to change notification settings - Fork 1
/
func_b2_constraint_analysis.py
264 lines (221 loc) · 7.42 KB
/
func_b2_constraint_analysis.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 17:55:43 2021
@author: matko
"""
def tw_constant_level_velocity_turn(q,C_Dmin,ws,k,n):
"""
The following expression is used to determine the
T/W ratio required to maintain a specific banking load
factor (n) at a specific airspeed and altitude, without
losing altitude.
It corresponds to specific energy density P_S = 0.
Source: Snorri pg58, eq(3-1)
Parameters
----------
q : float
Dynamic pressure at selected airspeed and altitude
C_Dmin : float
AKA CD0 - zero-lift drag, parasitic drag.
ws : float
Wing loading.
k : float
Lift-induced drag constant
n : float
Load factor (positive) n = 1/cos(phi).
Returns
-------
T/W for constant level velocity turn.
"""
tw = q * ( (C_Dmin)/(ws) + (ws)*k*(n/q)**2 )
return tw
def tw_desired_specific_energy_level(q,C_Dmin,ws,k,n,P_S,V):
"""
Sometimes it is of importance to evaluate the T/W for
a specific energy level other than P_S = 0, as was done
above. The following expression is used for this purpose.
For instance, consider a project where the design
is required to possess a specific energy level amounting
to 20 ft/s at a given load factor, airspeed, and altitude.
Such an evaluation could be used for the design of an
aerobatic airplane, for which the capability of a rival
aircraft might be known and used as a baseline.
Source: Snorri pg58, eq(3-2)
Parameters
----------
q : float
Dynamic pressure
C_Dmin : float
AKA CD0 - zero-lift drag, parasitic drag.
ws : float
Wing loading.
k : float
Lift-induced drag constant.
n : float
Load factor (positive).
P_S : float
DESCRIPTION.
V : float
DESCRIPTION.
Returns
-------
T/W for constant level velocity turn.
"""
tw = q * ( (C_Dmin)/(ws) + (ws)*k*(n/q)**2 ) + P_S/V
return tw
def tw_desired_rate_of_climb(q,C_Dmin,ws,k,V_v,rho,V_y=47,crit=0.01):
"""
The following expression is used to determine the
T/W required to achieve a given rate of climb. An
example of its use would be the extraction of T/W for a
design required to climb at 2000 fpm at S-L or 1000 fpm
at 10,000 ft.
Note that ideally the airspeed, V, should be an estimate
of the best rate-of-climb airspeed (V_Y - see Section
18.3, General climb analysis methods). Since this requires
far more information than typically available when
this tool is used, resort to historical data by using VY
for comparable aircraft. However, it may still be possible
to estimate a reasonable V_Y for propeller aircraft using
Equation (18-27).
Source: Snorri pg59, eq(3-3)
Parameters
----------
q : float
Dynamic pressure
C_Dmin : float
AKA CD0 - zero-lift drag, parasitic drag (Typ Table 3-1)
ws : float
Wing loading.
k : float
Lift-induced drag constant.
V_y : float
Airspeed, but not main cruise airspeed
Ideally V_Y - best rate-of-climb airspeed (Typ Table 18-1)
95 KCAS (~47m/s) is a solid initial guess
V_v : float
Desired rate of climb (vertical velocity).
Returns
-------
T/W for desired rate of climb.
"""
tw = V_v/V_y + q/(ws)*C_Dmin + (k/q)*(ws)
return tw
# tw_old = 0
# diff = 1
# LDmax = 1/( ( 4*C_Dmin*k )**0.5 )
# while diff > crit:
# tw = V_v/V + q/(ws)*C_Dmin + (k/q)*(ws)
# V_y = ( ( ( tw*ws )/( 3*rho*C_Dmin ) )*( 1+(1+3/( LDmax**2 * tw**2 ))**0.5 ) )**0.5
# diff = tw-tw_old
# tw_old = tw
# V = V_y
# return tw,V_y,LDmax
def tw_desired_TO_distance(q,C_DTO,C_LTO,ws,S_G,mu,V_LOF,g=9.81):
"""
The following expression is used to determine the
T/W required to achieve a given ground run distance
during T-O. An example of its use would be the extraction
of T/W for a design required to have a ground run
no longer than 1000 ft.
Source: Snorri pg59, eq(3-4), see also Table 3-1 for
typical C_DTO and C_LTO
Parameters
----------
q : float
Dynamic pressure at V_LOF/sqrt(2) and selected altitude CHECK
C_DTO : float
drag coefficient during T-O run.
C_LTO : float
lift coefficient during T-O run
ws : float
Wing loading.
S_G : float
Ground run distance
V_LOF : float
Liftoff speed.
mu : float
ground friction constant.
g : float
acceleration due to gravity
Returns
-------
T/W for desired Take-off distance.
"""
tw = ( (V_LOF**2)/(2*g*S_G) ) + ( (q*C_DTO)/(ws) ) + mu*(1-(q*C_LTO)/(ws))
return tw
def tw_desired_cruise_airspeed(q,C_Dmin,ws,k):
"""
The following expression is used to determine the
T/W required to achieve a given cruising speed at a
desired altitude. An example of its use would be the
extraction of T/W for a design required to cruise at
250 KTAS at 8000 ft.
Source: Snorri pg59, eq(3-5)
Parameters
----------
q : float
Dynamic pressure at selected airspeed and altitude.
C_Dmin : float
AKA CD0 - zero-lift drag, parasitic drag (Typ Table 3-1).
ws : float
Wing loading.
k : float
Lift-induced drag constant.
Returns
-------
T/W for desired cruise airspeed.
"""
tw = (q*C_Dmin)/ws + (k/q)*ws
return tw
def tw_service_ceiling(C_Dmin,ws,k,rho,V_v=0.508):
"""
The following expression is used to determine the
T/W required to achieve a given service ceiling,
assuming it is where the best rate-of-climb of the
airplane has dropped to 100 fpm (0.508 m/s). An
example of its use would be the extraction of T/W
for a design required to have a service ceiling
of 25,000 ft.
Note that service ceiling implies V_Y (the best rateof-
climb airspeed), as this yields the highest possible
value. This is particularly important to keep in mind
when converting the T/W to thrust and then to power
for propeller aircraft (and as is demonstrated later).
For this reason, V_Y should be estimated, for instance
using Equation (18-27) or other suitable techniques.
Parameters
----------
C_Dmin : float
AKA CD0 - zero-lift drag, parasitic drag (Typ Table 3-1).
ws : float
Wing loading.
k : float
Lift-induced drag constant.
rho : float
Air density at the desired altitude.
V_v : float, optional
Rate-of-climb. The default is 0.508.
Returns
-------
T/W for service ceiling defined as altitude where
max 0.508 m/s RoC is possible.
"""
tw = ( V_v/( ( (2/rho)*(ws)*( k/(3*C_Dmin) )**0.5 )**0.5 ) ) + 4*( (k*C_Dmin)/3 )**0.5
return tw
def clmax_ws_func(ws,rho_TO,V_stall):
"""
Parameters
----------
ws : float
Wing loading.
rho : float
Air density at the desired altitude.
V_stall : float
Stalling velocity.
Returns
-------
C_Lmax for a given wing lading (ws).
"""
C_Lmax_ws = ( 2/(rho_TO*V_stall**2) )*(ws)
return C_Lmax_ws