-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstraint_Plots.m
More file actions
149 lines (118 loc) · 5.58 KB
/
Constraint_Plots.m
File metadata and controls
149 lines (118 loc) · 5.58 KB
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
%% Constraint Plots
%
% clc;
% clear all;
% close all;
% Outputs of this script are wing area (S) and engine thrust (T).
% Five curves are generated based on aircraft stall speed, maximum speed,
% maximum rate of climb, take-off run, ceiling, and turn requirements.
% The intersection of the curves yields the design point and the
% corresponding wing loading (W/S) and thrust loading (T/W)
% allows running of script independently of main script
if ~exist('Wt', 'var')
clc;
clear;
load('aircraft_vars.mat');
close all;
end
constraints.wingLoading = 50:0.5:250; % wing loading parameter (lb/ft^2)
%% Stall Speed Curve (4.3.2 Sadraey)
constraints.Vstall = 125 * 1.688; % stall speed, knots -> ft/s
% constraints.rho_sl = 0.002378; % density (slug/ft^3)
constraints.CLMax = 2.0; % Roskam Part I, p.91; CLmax range = 1.2 - 1.8
% Generate stall speed curve
constraints.Vstall_Curve = 0.5*atm.rho_sl*(constraints.Vstall^2)*constraints.CLMax * ones(1, length(constraints.wingLoading)); % for plotting purposes
%% Maximum Speed Curve (4.3.3 Sadraey)
% Cruise and Max Speeds
constraints.Vmax = 1.1*Wt.fuel.V_max_cr; % max speed (ft/s); assume max speed is 10% greater than
% cruise speed (Sadraey Eqn 4.49)
% Induced drag term, K
e = 0.9; % Oswald efficiency factor
AR = 3; % aspect ratio
K = 1 / (pi*e*AR);
% Zero Lift Drag Coefficient
CD_0 = 0.0200; % from CD_0 Estimate.xlsx or see Table 4.12 in Sadraey
% Sadraey Eqn 4.47 (T/W)
% maxSpeedCurve = (rhoSeaLevel .* (Vmax.^2) .* CD_0 .* (1 ./ (2 .* wingLoading))) + (((2.*K) ./ (rhoSeaLevel .* sigma .* (Vmax.^2))) .* (wingLoading));
constraints.maxSpeedCurve = (atm.rho_sl.*(constraints.Vmax.^2).*CD_0)./(2.*constraints.wingLoading) + (2.*K.*constraints.wingLoading)./(atm.rho_sl.*atm.sig_rho.*(constraints.Vmax.^2));
%% Take-off Run (S_TO) Curve (Section 4.3.4 Sadraey)
% takeoffRun = 6900; % NASA takeoff field length of less than 7000 ft; based
% on FAR 25, aircraft must clear imaginary 35 ft obstacle
frictionCoeff = 0.04; % friction coefficient dry concrete / asphault (Sadraey Table 4.15)
g = 32.17; % gravity (ft/s^2)
% LG gear and Flaps drag coefficients (Equation 4.69b Sadraey)
Cd_landingGear = 0.08; % LG drag coefficient varies 0.06 - 0.012
Cd_flap = 0.005; % flap drag coefficient varies from 0.003 to 0.008
% Zero lift drag coefficient at takeoff (Eqn 4.69a)
Cd_0L_TO = CD_0 + Cd_landingGear + Cd_flap;
% Cruise lift coeff and flap coeff at take-off
CL_Cruise = 0.05; % typical value according to Sadraey
CL_flap_TO = 0.6; % varies from 0.3 to 0.8
% Take-off Lift Coefficient (Eqn 4.69c)
CL_TO = CL_Cruise + CL_flap_TO;
% Drag coefficient at take-off (Eqn 4.68)
Cd_TO = Cd_0L_TO + (K * (CL_TO^2));
% Aircraft Lift at take-off (Eqn 4.67b)
CLR = constraints.CLMax / 1.21;
% Eqn 4.67a
CDG = Cd_TO - (frictionCoeff * CL_TO);
rho_cr = atm.sig_rho * atm.rho_sl;
takeOffRunCurve = (frictionCoeff - (frictionCoeff + (CDG ./ CLR)) .*...
(exp(0.6 .* rho_cr .* g .* req.takeoffRun .* (1 ./ constraints.wingLoading)))) ...
./ (1 - (exp(0.6 .*rho_cr .*g .* req.takeoffRun .* (1 ./ constraints.wingLoading)))); % Missing CDg term
%% Rate of Climb (ROC) Curve (4.3.5 Sadraey)
LD_Max = 7; % max lift to drag ratio
ROC = 10000 / 60; % rate of climb (ft/min) -> ft/s
% Rate of Climb Curve
ROCCurve = (ROC ./ sqrt((2 ./ (rho_cr .* sqrt(CD_0 ./ K))) .* constraints.wingLoading))...
+ (1 ./ LD_Max);
%% Ceiling Curve(4.3.6 Sadraey)
%Keyur Edit - None.
% Curve based on cruise ceiling (Eq. 4.95, Sadraey)
% altService = 42; % kft
% [~,~,sigmaService,aSoundRatio] = AltTable(altService, 'h'); % height input of kft
rhoService = atm.sig_rho * atm.rho_sl;
ROC_cr = 300; % rate of climb at service ceiling (ft/min) (FAR numbers)
ROC_cr = ROC_cr / 60; % convert ROC to ft/s
ceilingCurve = (ROC_cr ./ (atm.sig_rho .* sqrt((2 ./ (rhoService .* sqrt(CD_0 ./ K)))...
.* constraints.wingLoading))) + (1 ./ (atm.sig_rho .* LD_Max));
%% Plot Curves
figure();
hold on;
title('Wing Area (S) and Engine Thrust (T) Constraint Plot')
xlabel('Wing Loading, W/S (lbf / ft^2)')
ylabel('Thrust-to-Weight Ratio, T/W (lbf/lbf)')
% Stall Speed Curve
stallVerticalAxis = linspace(0,2, length(constraints.wingLoading));
plot(constraints.Vstall_Curve, stallVerticalAxis, '--c')
% Max Speed Curve
plot(constraints.wingLoading, constraints.maxSpeedCurve, 'r')
% Take off Run Curve
plot(constraints.wingLoading, takeOffRunCurve, 'b')
% ROC Curve
plot(constraints.wingLoading, ROCCurve, 'm')
% Ceiling Curve
plot(constraints.wingLoading, ceilingCurve, 'g')
legend('V_{stall}','V_{max}', 'Take-off', 'Rate of Climb', 'Ceiling')
%% Wing Area and Engine Thrust
% WTO = 102000; % gross takeoff weight lbf
% [x,y] = ginput(1);
% Design point manually identified from contraint plot
% designPoint = [x, y]; % [Wing Loading (W/S), Thrust-to-Weight Ratio (T/W)]
test1 = [constraints.Vstall_Curve(1), spline(constraints.wingLoading, ceilingCurve, constraints.Vstall_Curve(1))];
% test2 -> where vstall and vmax curve intersect
test2 = [constraints.Vstall_Curve(1), spline(constraints.wingLoading, constraints.maxSpeedCurve, constraints.Vstall_Curve(1))];
% test3 -> intersection between Ceiling & Vmax curve
ceilCurve_avg = mean(ceilingCurve);
test3 = [spline(constraints.maxSpeedCurve, constraints.wingLoading, ceilCurve_avg), ceilCurve_avg];
if test3(1) <= test2(1)
designPoint = test3;
else
designPoint = test2;
end
fprintf('TW Ratio: %0.5f\n', designPoint(2));
fprintf('Wing Loading: %0.5f\n', designPoint(1));
fprintf('The wing area, S is: %0.2f ft^2 \n', Wt.WTO / designPoint(1))
fprintf('The thrust, T is: %0.2f lbf \n', ceilCurve_avg * Wt.WTO)
S_w = Wt.WTO/designPoint(1);
constraints.req_Thr = designPoint(2) * Wt.WTO;