I have issues calculating lift coefficient (CL), drag coefficient (CD), and thrust (T)
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!
Accepted Answer
More Answers (0)
Categories
Find more on Array Geometries and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




