forked from marioarbras/aircraft-design-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lift_slope.m
29 lines (24 loc) · 1.18 KB
/
lift_slope.m
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
% Aircraft design tool
%
% Mario Bras ([email protected]) and Ricardo Marques ([email protected]) 2019
%
% This file is subject to the license terms in the LICENSE file included in this distribution
function aircraft = lift_slope(aircraft, mission)
% Iterate over aircraft lifting surfaces
for i = 1 : length(mission.segments)
for j = 1 : length(aircraft.components)
aircraft.components{j}.cl_aa = zeros(length(mission.segments), 1);
if is_wing(aircraft.components{j})
m = mean(mission.segments{i}.velocity) / mean(mission.segments{i}.speed_sound);
bb = sqrt(1 - m^2);
aircraft.components{j}.cl_aa = aircraft.components{j}.airfoil.cl_aa * aircraft.components{j}.aspect_ratio /...
(2 + sqrt(4 + aircraft.components{j}.aspect_ratio^2 * bb^2 * (1 + tand(aircraft.components{j}.sweep_tc_max)^2 / bb^2)));
end
end
end
function f = form_factor(xc_max, tc_max, sweep_tc_max, m)
f = (1 + 0.6 / xc_max * tc_max + 100 * tc_max^4) * 1.34 * m^0.18 * cosd(sweep_tc_max)^0.28;
function test = is_fuselage(component)
test = strcmp(component.type, 'fuselage');
function test = is_wing(component)
test = strcmp(component.type, 'wing');