CLC
CLC
clear;
close all;
% Defining variables
V = 202; % Velocity (m/s)
R = 1000; % Radius of curvature (m)
g = 9.8; % Gravitational acceleration (m/s^2)
rho = 1.058; % Air density (kg/m^3)
S = 24; % Wing area (m^2)
m = 7800; % Aircraft weight (kg)
CDzero = 0.02; % Drag coefficient (dimensionless)
K = 0.05; % Drag adjustment factor (dimensionless)
Iy = 57000; % Moment of inertia (kg*m^2)
Cm = 0.1; % Moment coefficient (dimensionless)
Sc = 62;
alpha = [0 5 10 15 20]; % Angles of incidence (degrees)
gamma = [0 10 30 60 90 120 150 180 210 240 270 300 330 360]; % Wing deflection
angles (degrees)
% Calculating values of CL, CD, T for each value of gamma and alpha
for i = 1:length(gamma) %
for j = 1:length(alpha)
%Calculating CL
CL(i) = 2*(m*g*cosd(gamma(i)) + (m*V^2/(R*g))*g)/(rho*V^2*S);
CL_vector(i) = CL(i);
%Calculating CD
CD = CDzero + K*CL(i)^2;
CD_vector(i) = CD;
%Calculating T
T = m*g*sind(gamma(i)) + (rho*V^2*S*CD)/2;
T_vector(i) = T;
disp(CL_vector);
% Complete calculation of Cm
% Coefficient definition
Cm_zero = -0.05; % moment coefficient at zero angle of attack
Cm_alpha = -0.9; % moment coefficient gradient with angle of attack
Cm_deltae = -1.2; % moment coefficient gradient with elevator deflection
% Calculation of elevator deflection
CL_alpha_alpha = 2*pi; % Derivative of lift coefficient with respect to angle of
attack, dimensionless
CL_zero = 0.2; % Lift coefficient at zero angle of attack, dimensionless
CL_deltae = 0.8; % Derivative of lift coefficient with respect to elevator
deflection, dimensionless
deltaE(i) = 1/CL_deltae*(CL(i)-CL_alpha_alpha-CL_zero);
fprintf("Elevator deflection for gamma = %.1f and alpha = %d is %.4f m\n",
gamma(i), alpha(j), deltaE(i));
figure;
plot(gamma,CD_vector);
xlabel('gamma');
ylabel('CD');
grid on
figure;
plot(gamma,T_vector);
xlabel('gamma');
ylabel('T');
grid on;