I have issues calculating lift coefficient (CL), drag coefficient (CD), and thrust (T)
7 views (last 30 days)
Show older comments
Hello everyone,
I am having some issues with my MATLAB code for calculating lift coefficient (CL), drag coefficient (CD), and thrust (T). The values I am getting are not close to the ones that my professor calculated by hand for CL (0.76 0.74 0.69 0.61 0.54 0.49 0.47 0.49 0.54 0.61 0.69 0.74 0.76), and I am not sure where the issue might be. Additionally, the graphs for CL, CD, and T do not look like they should. I have included my code below for reference. Can anyone help me figure out what might be causing the discrepancies?
clc;
clear;
close all;
syms CL CD T CDzero K gamma V R g m rho S
V = 202;
R = 1000;
g = 9.8;
rho = 1.058;
S = 24;
m = 7800;
gamma = [0 30 60 90 120 150 180 210 240 270 300 330 360];
%Initialize vectors for CL, CD, and T
CL_vector = zeros(size(gamma));
CD_vector = zeros(size(gamma));
T_vector = zeros(size(gamma));
%Calculate CL, CD, and T for each gamma value
for i = 1:length(gamma)
%Calculate CL
CL = (2*cosd(gamma(i)) + (V^2/(R*g))*m*g)/(rho*V^2*S);
CL_vector(i) = CL;
%Calculate CD
CDzero = 0.02;
K = 0.05;
CD = CDzero + K*CL^2;
CD_vector(i) = CD;
%Calculate T
T = m*g*sin(gamma(i)) + (rho*V^2*S*CD)/2;
T_vector(i) = T;
end
%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;
disp(CL_vector)
Thank you in advance!
0 Comments
Accepted Answer
VBBV
on 16 Feb 2023
clc;
clear;
close all;
% syms CL CD T CDzero K gamma V R g m rho S
V = 202;
R = 1000;
g = 9.8;
rho = 1.058;
S = 24;
m = 7800;
gamma = [0 30 60 90 120 150 180 210 240 270 300 330 360];
CDzero = 0.02;
K = 0.05;
%Initialize vectors for CL, CD, and T
CL_vector = zeros(size(gamma));
CD_vector = zeros(size(gamma));
T_vector = zeros(size(gamma));
%Calculate CL, CD, and T for each gamma value
for i = 1:length(gamma)
%Calculate CL
CL = 2*(m*g*cosd(gamma(i)) + (m*V^2/(R*g))*g)/(rho*V^2*S);
CL_vector(i) = CL;
%Calculate CD
CD = CDzero + K*CL^2;
CD_vector(i) = CD;
%Calculate T
T = m*g*sind(gamma(i)) + (rho*V^2*S*CD)/2;
T_vector(i) = T;
end
%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;
disp(CL_vector)
4 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




