0% found this document useful (0 votes)
39 views3 pages

CLC

This MATLAB code defines variables related to aircraft flight parameters like velocity, wing area, etc. It then calculates lift coefficient (CL), drag coefficient (CD), and thrust (T) for different angles of attack (alpha) and wing deflection angles (gamma). Finally, it calculates and plots the pitching moment coefficient (Cm) to analyze aircraft stability at different alpha and gamma values.

Uploaded by

UTKARSH ALSET
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

CLC

This MATLAB code defines variables related to aircraft flight parameters like velocity, wing area, etc. It then calculates lift coefficient (CL), drag coefficient (CD), and thrust (T) for different angles of attack (alpha) and wing deflection angles (gamma). Finally, it calculates and plots the pitching moment coefficient (Cm) to analyze aircraft stability at different alpha and gamma values.

Uploaded by

UTKARSH ALSET
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

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);

% Calculating the pitching moment (elevator deflection)


CL_alpha_alpha = 2*pi; % Derivative of CL with respect to angle of incidence,
dimensionless
CL_zero = 0; % Lift coefficient at zero incidence, dimensionless
CL_deltae = 0.3; % Derivative of CL with respect to elevator deflection angle,
dimensionless
deltae(i) = 1/CL_deltae*(CL(i)-CL_alpha_alpha-CL_zero);
fprintf("The elevator moment for gamma = %.1f and alpha = %d este %.4f m\n",
gamma(i), alpha(j), deltae(i));

% 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));

% Conversion of angles from degrees to radians


% alpha = alpha * pi / 180;
% deltae = deltae * pi / 180;

% Calculation of moment coefficient


Cm(i,j) = Cm_zero + Cm_alpha * alpha(j)*pi/180 + Cm_deltae * deltaE(i)*pi/180;

% Calculating the final value of the equation


diff_alpha_gamma = (alpha(j) - gamma(i)) * pi / 180; % Converting the
difference between gamma and alpha to radians
% eqn = ((Iy * (V^2/R) * (diff_alpha_gamma)^2) /
(gamma(i+1)-gamma(i))*pi/180) - (0.5*rho * V^2 * Sc * Cm(i,j));
eqn = ((Iy * (V^2/R) * (diff_alpha_gamma)^2) ./ gradient(gamma)*pi/180) -
(0.5*rho * V^2 * Sc * Cm(i,j));
tol = 1e-6;
if (eqn) < tol % use relative tolerance
fprintf("For gamma = %.1f and alpha = %d, the equation is satisfied\n",
gamma(i), alpha(j));
else
fprintf('The equation is not satisfied for gamma = %.1f and alpha = %d\
n', gamma(i), alpha(j));
end
end
end

%plot pitching moment coefficient (Cm)


figure
plot(gamma,Cm)
legend(compose('\alpha = %d' , (alpha))); grid
xlabel('\gamma^{o}'); ylabel('Cm [-]')

% Uncomment this according to your convenience


%Plot graphs
figure;
plot(gamma,CL_vector);
xlabel('gamma');
ylabel('CL');
grid on;

figure;
plot(gamma,CD_vector);
xlabel('gamma');
ylabel('CD');
grid on

figure;
plot(gamma,T_vector);
xlabel('gamma');
ylabel('T');
grid on;

You might also like