I have issues calculating the pitching moment (delta_e) and a specific formula

5 views (last 30 days)
Hello everyone,
I am having some issues with my MATLAB code for calculating this formula Iy*V^2/2*R*diff(alpha)^2/diff(gamma)=rho/2*Sc*Cm. I am encountering an error, and I am not sure where the issue might be. Additionally, i do not think that the value for diff_alpha_gamma (-6.283) is correct. I have included my code below for reference.
I have tried adding for i = 1:length(gamma)-1, but the results for other variables like CL,CD,T change and the formula a bit (eqn = Iy * V^2 / (R) * (diff_alpha_gamma)^2 / (diff(gamma(i:i+1)) * pi / 180) == rho/2 * Sc * Cm;), but the results for the eqn is 0.
Also, at the end i added the calculation of the elevator deflection which also gives me a result which I think is incorrect: deltae=-18.470
My proffesor doesn't know Matlab, and I am also a newbie but I tried every possible way and still cannot get the hang of it.
Can anyone help me figure out what might be causing the discrepancies?
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 = 2*(m*g*cosd(gamma(i)) + (m*V^2/(R*g))*g)/(rho*V^2*S);
CL_vector(i) = CL;
%Calculating CD
CD = CDzero + K*CL^2;
CD_vector(i) = CD;
%Calculating T
T = m*g*sind(gamma(i)) + (rho*V^2*S*CD)/2;
T_vector(i) = T;
% 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 / diff(gamma) == rho/2* V^2 * Sc * Cm;
tol = 1e-6;
if abs(eqn) < tol
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
Error using /
Matrix dimensions must agree.
% 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 = 1/CL_deltae*(CL-CL_alpha_alpha-CL_zero);
fprintf("The elevator moment for gamma = %.1f and alpha = %d este %.4f m\n", gamma(i), alpha(j), deltae);

Answers (1)

VBBV
VBBV on 18 Feb 2023
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 = 2: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;
% 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)-gamma(i-1))*pi/180) - (0.5*rho * V^2 * Sc * Cm)
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
eqn = -1.3371e+05
For gamma = 10.0 and alpha = 0, the equation is satisfied
eqn = -1.3380e+05
For gamma = 10.0 and alpha = 5, the equation is satisfied
eqn = -1.3383e+05
For gamma = 10.0 and alpha = 10, the equation is satisfied
eqn = -1.3380e+05
For gamma = 10.0 and alpha = 15, the equation is satisfied
eqn = -1.3371e+05
For gamma = 10.0 and alpha = 20, the equation is satisfied
eqn = -1.3327e+05
For gamma = 30.0 and alpha = 0, the equation is satisfied
eqn = -1.3344e+05
For gamma = 30.0 and alpha = 5, the equation is satisfied
eqn = -1.3358e+05
For gamma = 30.0 and alpha = 10, the equation is satisfied
eqn = -1.3369e+05
For gamma = 30.0 and alpha = 15, the equation is satisfied
eqn = -1.3377e+05
For gamma = 30.0 and alpha = 20, the equation is satisfied
eqn = -1.3235e+05
For gamma = 60.0 and alpha = 0, the equation is satisfied
eqn = -1.3258e+05
For gamma = 60.0 and alpha = 5, the equation is satisfied
eqn = -1.3280e+05
For gamma = 60.0 and alpha = 10, the equation is satisfied
eqn = -1.3299e+05
For gamma = 60.0 and alpha = 15, the equation is satisfied
eqn = -1.3317e+05
For gamma = 60.0 and alpha = 20, the equation is satisfied
eqn = -1.3049e+05
For gamma = 90.0 and alpha = 0, the equation is satisfied
eqn = -1.3085e+05
For gamma = 90.0 and alpha = 5, the equation is satisfied
eqn = -1.3119e+05
For gamma = 90.0 and alpha = 10, the equation is satisfied
eqn = -1.3151e+05
For gamma = 90.0 and alpha = 15, the equation is satisfied
eqn = -1.3181e+05
For gamma = 90.0 and alpha = 20, the equation is satisfied
eqn = -1.2789e+05
For gamma = 120.0 and alpha = 0, the equation is satisfied
eqn = -1.2838e+05
For gamma = 120.0 and alpha = 5, the equation is satisfied
eqn = -1.2884e+05
For gamma = 120.0 and alpha = 10, the equation is satisfied
eqn = -1.2928e+05
For gamma = 120.0 and alpha = 15, the equation is satisfied
eqn = -1.2971e+05
For gamma = 120.0 and alpha = 20, the equation is satisfied
eqn = -1.2455e+05
For gamma = 150.0 and alpha = 0, the equation is satisfied
eqn = -1.2516e+05
For gamma = 150.0 and alpha = 5, the equation is satisfied
eqn = -1.2575e+05
For gamma = 150.0 and alpha = 10, the equation is satisfied
eqn = -1.2632e+05
For gamma = 150.0 and alpha = 15, the equation is satisfied
eqn = -1.2686e+05
For gamma = 150.0 and alpha = 20, the equation is satisfied
eqn = -1.2047e+05
For gamma = 180.0 and alpha = 0, the equation is satisfied
eqn = -1.2121e+05
For gamma = 180.0 and alpha = 5, the equation is satisfied
eqn = -1.2192e+05
For gamma = 180.0 and alpha = 10, the equation is satisfied
eqn = -1.2261e+05
For gamma = 180.0 and alpha = 15, the equation is satisfied
eqn = -1.2328e+05
For gamma = 180.0 and alpha = 20, the equation is satisfied
eqn = -1.1565e+05
For gamma = 210.0 and alpha = 0, the equation is satisfied
eqn = -1.1651e+05
For gamma = 210.0 and alpha = 5, the equation is satisfied
eqn = -1.1734e+05
For gamma = 210.0 and alpha = 10, the equation is satisfied
eqn = -1.1816e+05
For gamma = 210.0 and alpha = 15, the equation is satisfied
eqn = -1.1895e+05
For gamma = 210.0 and alpha = 20, the equation is satisfied
eqn = -1.1009e+05
For gamma = 240.0 and alpha = 0, the equation is satisfied
eqn = -1.1107e+05
For gamma = 240.0 and alpha = 5, the equation is satisfied
eqn = -1.1202e+05
For gamma = 240.0 and alpha = 10, the equation is satisfied
eqn = -1.1296e+05
For gamma = 240.0 and alpha = 15, the equation is satisfied
eqn = -1.1388e+05
For gamma = 240.0 and alpha = 20, the equation is satisfied
eqn = -1.0378e+05
For gamma = 270.0 and alpha = 0, the equation is satisfied
eqn = -1.0488e+05
For gamma = 270.0 and alpha = 5, the equation is satisfied
eqn = -1.0597e+05
For gamma = 270.0 and alpha = 10, the equation is satisfied
eqn = -1.0703e+05
For gamma = 270.0 and alpha = 15, the equation is satisfied
eqn = -1.0807e+05
For gamma = 270.0 and alpha = 20, the equation is satisfied
eqn = -9.6733e+04
For gamma = 300.0 and alpha = 0, the equation is satisfied
eqn = -9.7959e+04
For gamma = 300.0 and alpha = 5, the equation is satisfied
eqn = -9.9164e+04
For gamma = 300.0 and alpha = 10, the equation is satisfied
eqn = -1.0035e+05
For gamma = 300.0 and alpha = 15, the equation is satisfied
eqn = -1.0151e+05
For gamma = 300.0 and alpha = 20, the equation is satisfied
eqn = -8.8942e+04
For gamma = 330.0 and alpha = 0, the equation is satisfied
eqn = -9.0292e+04
For gamma = 330.0 and alpha = 5, the equation is satisfied
eqn = -9.1622e+04
For gamma = 330.0 and alpha = 10, the equation is satisfied
eqn = -9.2930e+04
For gamma = 330.0 and alpha = 15, the equation is satisfied
eqn = -9.4218e+04
For gamma = 330.0 and alpha = 20, the equation is satisfied
eqn = -8.0410e+04
For gamma = 360.0 and alpha = 0, the equation is satisfied
eqn = -8.1884e+04
For gamma = 360.0 and alpha = 5, the equation is satisfied
eqn = -8.3337e+04
For gamma = 360.0 and alpha = 10, the equation is satisfied
eqn = -8.4769e+04
For gamma = 360.0 and alpha = 15, the equation is satisfied
eqn = -8.6181e+04
For gamma = 360.0 and alpha = 20, the equation is satisfied
% 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 = 1/CL_deltae*(CL-CL_alpha_alpha-CL_zero)
deltae = 1×14
-20.9440 -18.4117 -18.4701 -18.6501 -18.8961 -19.1420 -19.3220 -19.3879 -19.3220 -19.1420 -18.8961 -18.6501 -18.4701 -18.4042
fprintf("The elevator moment for gamma = %.1f and alpha = %d este %.4f m\n", gamma, alpha, deltae);
The elevator moment for gamma = 0.0 and alpha = 10 este 30.0000 m The elevator moment for gamma = 60.0 and alpha = 90 este 120.0000 m The elevator moment for gamma = 150.0 and alpha = 180 este 210.0000 m The elevator moment for gamma = 240.0 and alpha = 270 este 300.0000 m The elevator moment for gamma = 330.0 and alpha = 360 este 0.0000 m The elevator moment for gamma = 5.0 and alpha = 10 este 15.0000 m The elevator moment for gamma = 20.0 and alpha = -2.094395e+01 este -18.4117 m The elevator moment for gamma = -18.5 and alpha = -1.865014e+01 este -18.8961 m The elevator moment for gamma = -19.1 and alpha = -1.932201e+01 este -19.3879 m The elevator moment for gamma = -19.3 and alpha = -1.914199e+01 este -18.8961 m The elevator moment for gamma = -18.7 and alpha = -1.847011e+01 este -18.4042 m
figure
plot(gamma,deltae)
Few points, regarding the equation & code structure
  • It seems to be written and also evaluated incorrectly , use a ' - ' to rearrange the equation and assigni values on RHS to variable eqn on LHS
eqn = ((Iy * (V^2/R) * (diff_alpha_gamma)^2) / (gamma(i)-gamma(i-1))*pi/180) - (0.5*rho * V^2 * Sc * Cm)
% take the difference use ' - '
  • use a relative tolerance for eqn < tol instead of abs tolerance, since the alpha can take wide range of values for which, the CL, CD, and CM vary significantly.
  • In the for loop, you can use for i = 2:lenght(gamma) as the equation involves a DELTA GAMMA term.
  • Finally, you need to multiply the ((gamma(i)-gamma(i-1)) *pi/180 term with pi/180 since all the angle variables need to be in same units. At one place you have in degrees and other place its in radians.
  8 Comments
Agache Mihai
Agache Mihai on 19 Feb 2023
Also, can you help me understand why alpha has those values in the elevator moment calculation? It is set under those angles [0 5 10 15 20]
VBBV
VBBV on 20 Feb 2023
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
0.7619
The elevator moment for gamma = 0.0 and alpha = 0 este -18.4042 m
Elevator deflection for gamma = 0.0 and alpha = 0 is -7.1516 m
For gamma = 0.0 and alpha = 0, the equation is satisfied
0.7619
The elevator moment for gamma = 0.0 and alpha = 5 este -18.4042 m
Elevator deflection for gamma = 0.0 and alpha = 5 is -7.1516 m
For gamma = 0.0 and alpha = 5, the equation is satisfied
0.7619
The elevator moment for gamma = 0.0 and alpha = 10 este -18.4042 m
Elevator deflection for gamma = 0.0 and alpha = 10 is -7.1516 m
The equation is not satisfied for gamma = 0.0 and alpha = 10
0.7619
The elevator moment for gamma = 0.0 and alpha = 15 este -18.4042 m
Elevator deflection for gamma = 0.0 and alpha = 15 is -7.1516 m
The equation is not satisfied for gamma = 0.0 and alpha = 15
0.7619
The elevator moment for gamma = 0.0 and alpha = 20 este -18.4042 m
Elevator deflection for gamma = 0.0 and alpha = 20 is -7.1516 m
The equation is not satisfied for gamma = 0.0 and alpha = 20
0.7619 0.7597
The elevator moment for gamma = 10.0 and alpha = 0 este -18.4117 m
Elevator deflection for gamma = 10.0 and alpha = 0 is -7.1544 m
For gamma = 10.0 and alpha = 0, the equation is satisfied
0.7619 0.7597
The elevator moment for gamma = 10.0 and alpha = 5 este -18.4117 m
Elevator deflection for gamma = 10.0 and alpha = 5 is -7.1544 m
For gamma = 10.0 and alpha = 5, the equation is satisfied
0.7619 0.7597
The elevator moment for gamma = 10.0 and alpha = 10 este -18.4117 m
Elevator deflection for gamma = 10.0 and alpha = 10 is -7.1544 m
The equation is not satisfied for gamma = 10.0 and alpha = 10
0.7619 0.7597
The elevator moment for gamma = 10.0 and alpha = 15 este -18.4117 m
Elevator deflection for gamma = 10.0 and alpha = 15 is -7.1544 m
The equation is not satisfied for gamma = 10.0 and alpha = 15
0.7619 0.7597
The elevator moment for gamma = 10.0 and alpha = 20 este -18.4117 m
Elevator deflection for gamma = 10.0 and alpha = 20 is -7.1544 m
The equation is not satisfied for gamma = 10.0 and alpha = 20
0.7619 0.7597 0.7422
The elevator moment for gamma = 30.0 and alpha = 0 este -18.4701 m
Elevator deflection for gamma = 30.0 and alpha = 0 is -7.1763 m
For gamma = 30.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422
The elevator moment for gamma = 30.0 and alpha = 5 este -18.4701 m
Elevator deflection for gamma = 30.0 and alpha = 5 is -7.1763 m
For gamma = 30.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422
The elevator moment for gamma = 30.0 and alpha = 10 este -18.4701 m
Elevator deflection for gamma = 30.0 and alpha = 10 is -7.1763 m
The equation is not satisfied for gamma = 30.0 and alpha = 10
0.7619 0.7597 0.7422
The elevator moment for gamma = 30.0 and alpha = 15 este -18.4701 m
Elevator deflection for gamma = 30.0 and alpha = 15 is -7.1763 m
The equation is not satisfied for gamma = 30.0 and alpha = 15
0.7619 0.7597 0.7422
The elevator moment for gamma = 30.0 and alpha = 20 este -18.4701 m
Elevator deflection for gamma = 30.0 and alpha = 20 is -7.1763 m
The equation is not satisfied for gamma = 30.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881
The elevator moment for gamma = 60.0 and alpha = 0 este -18.6501 m
Elevator deflection for gamma = 60.0 and alpha = 0 is -7.2438 m
For gamma = 60.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881
The elevator moment for gamma = 60.0 and alpha = 5 este -18.6501 m
Elevator deflection for gamma = 60.0 and alpha = 5 is -7.2438 m
For gamma = 60.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422 0.6881
The elevator moment for gamma = 60.0 and alpha = 10 este -18.6501 m
Elevator deflection for gamma = 60.0 and alpha = 10 is -7.2438 m
The equation is not satisfied for gamma = 60.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881
The elevator moment for gamma = 60.0 and alpha = 15 este -18.6501 m
Elevator deflection for gamma = 60.0 and alpha = 15 is -7.2438 m
The equation is not satisfied for gamma = 60.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881
The elevator moment for gamma = 60.0 and alpha = 20 este -18.6501 m
Elevator deflection for gamma = 60.0 and alpha = 20 is -7.2438 m
The equation is not satisfied for gamma = 60.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144
The elevator moment for gamma = 90.0 and alpha = 0 este -18.8961 m
Elevator deflection for gamma = 90.0 and alpha = 0 is -7.3360 m
For gamma = 90.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144
The elevator moment for gamma = 90.0 and alpha = 5 este -18.8961 m
Elevator deflection for gamma = 90.0 and alpha = 5 is -7.3360 m
For gamma = 90.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144
The elevator moment for gamma = 90.0 and alpha = 10 este -18.8961 m
Elevator deflection for gamma = 90.0 and alpha = 10 is -7.3360 m
The equation is not satisfied for gamma = 90.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144
The elevator moment for gamma = 90.0 and alpha = 15 este -18.8961 m
Elevator deflection for gamma = 90.0 and alpha = 15 is -7.3360 m
The equation is not satisfied for gamma = 90.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144
The elevator moment for gamma = 90.0 and alpha = 20 este -18.8961 m
Elevator deflection for gamma = 90.0 and alpha = 20 is -7.3360 m
The equation is not satisfied for gamma = 90.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406
The elevator moment for gamma = 120.0 and alpha = 0 este -19.1420 m
Elevator deflection for gamma = 120.0 and alpha = 0 is -7.4282 m
For gamma = 120.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406
The elevator moment for gamma = 120.0 and alpha = 5 este -19.1420 m
Elevator deflection for gamma = 120.0 and alpha = 5 is -7.4282 m
For gamma = 120.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406
The elevator moment for gamma = 120.0 and alpha = 10 este -19.1420 m
Elevator deflection for gamma = 120.0 and alpha = 10 is -7.4282 m
The equation is not satisfied for gamma = 120.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406
The elevator moment for gamma = 120.0 and alpha = 15 este -19.1420 m
Elevator deflection for gamma = 120.0 and alpha = 15 is -7.4282 m
The equation is not satisfied for gamma = 120.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406
The elevator moment for gamma = 120.0 and alpha = 20 este -19.1420 m
Elevator deflection for gamma = 120.0 and alpha = 20 is -7.4282 m
The equation is not satisfied for gamma = 120.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866
The elevator moment for gamma = 150.0 and alpha = 0 este -19.3220 m
Elevator deflection for gamma = 150.0 and alpha = 0 is -7.4958 m
For gamma = 150.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866
The elevator moment for gamma = 150.0 and alpha = 5 este -19.3220 m
Elevator deflection for gamma = 150.0 and alpha = 5 is -7.4958 m
For gamma = 150.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866
The elevator moment for gamma = 150.0 and alpha = 10 este -19.3220 m
Elevator deflection for gamma = 150.0 and alpha = 10 is -7.4958 m
The equation is not satisfied for gamma = 150.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866
The elevator moment for gamma = 150.0 and alpha = 15 este -19.3220 m
Elevator deflection for gamma = 150.0 and alpha = 15 is -7.4958 m
The equation is not satisfied for gamma = 150.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866
The elevator moment for gamma = 150.0 and alpha = 20 este -19.3220 m
Elevator deflection for gamma = 150.0 and alpha = 20 is -7.4958 m
The equation is not satisfied for gamma = 150.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668
The elevator moment for gamma = 180.0 and alpha = 0 este -19.3879 m
Elevator deflection for gamma = 180.0 and alpha = 0 is -7.5205 m
For gamma = 180.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668
The elevator moment for gamma = 180.0 and alpha = 5 este -19.3879 m
Elevator deflection for gamma = 180.0 and alpha = 5 is -7.5205 m
For gamma = 180.0 and alpha = 5, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668
The elevator moment for gamma = 180.0 and alpha = 10 este -19.3879 m
Elevator deflection for gamma = 180.0 and alpha = 10 is -7.5205 m
The equation is not satisfied for gamma = 180.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668
The elevator moment for gamma = 180.0 and alpha = 15 este -19.3879 m
Elevator deflection for gamma = 180.0 and alpha = 15 is -7.5205 m
The equation is not satisfied for gamma = 180.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668
The elevator moment for gamma = 180.0 and alpha = 20 este -19.3879 m
Elevator deflection for gamma = 180.0 and alpha = 20 is -7.5205 m
The equation is not satisfied for gamma = 180.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866
The elevator moment for gamma = 210.0 and alpha = 0 este -19.3220 m
Elevator deflection for gamma = 210.0 and alpha = 0 is -7.4958 m
For gamma = 210.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866
The elevator moment for gamma = 210.0 and alpha = 5 este -19.3220 m
Elevator deflection for gamma = 210.0 and alpha = 5 is -7.4958 m
The equation is not satisfied for gamma = 210.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866
The elevator moment for gamma = 210.0 and alpha = 10 este -19.3220 m
Elevator deflection for gamma = 210.0 and alpha = 10 is -7.4958 m
The equation is not satisfied for gamma = 210.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866
The elevator moment for gamma = 210.0 and alpha = 15 este -19.3220 m
Elevator deflection for gamma = 210.0 and alpha = 15 is -7.4958 m
The equation is not satisfied for gamma = 210.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866
The elevator moment for gamma = 210.0 and alpha = 20 este -19.3220 m
Elevator deflection for gamma = 210.0 and alpha = 20 is -7.4958 m
The equation is not satisfied for gamma = 210.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406
The elevator moment for gamma = 240.0 and alpha = 0 este -19.1420 m
Elevator deflection for gamma = 240.0 and alpha = 0 is -7.4282 m
For gamma = 240.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406
The elevator moment for gamma = 240.0 and alpha = 5 este -19.1420 m
Elevator deflection for gamma = 240.0 and alpha = 5 is -7.4282 m
The equation is not satisfied for gamma = 240.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406
The elevator moment for gamma = 240.0 and alpha = 10 este -19.1420 m
Elevator deflection for gamma = 240.0 and alpha = 10 is -7.4282 m
The equation is not satisfied for gamma = 240.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406
The elevator moment for gamma = 240.0 and alpha = 15 este -19.1420 m
Elevator deflection for gamma = 240.0 and alpha = 15 is -7.4282 m
The equation is not satisfied for gamma = 240.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406
The elevator moment for gamma = 240.0 and alpha = 20 este -19.1420 m
Elevator deflection for gamma = 240.0 and alpha = 20 is -7.4282 m
The equation is not satisfied for gamma = 240.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144
The elevator moment for gamma = 270.0 and alpha = 0 este -18.8961 m
Elevator deflection for gamma = 270.0 and alpha = 0 is -7.3360 m
For gamma = 270.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144
The elevator moment for gamma = 270.0 and alpha = 5 este -18.8961 m
Elevator deflection for gamma = 270.0 and alpha = 5 is -7.3360 m
The equation is not satisfied for gamma = 270.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144
The elevator moment for gamma = 270.0 and alpha = 10 este -18.8961 m
Elevator deflection for gamma = 270.0 and alpha = 10 is -7.3360 m
The equation is not satisfied for gamma = 270.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144
The elevator moment for gamma = 270.0 and alpha = 15 este -18.8961 m
Elevator deflection for gamma = 270.0 and alpha = 15 is -7.3360 m
The equation is not satisfied for gamma = 270.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144
The elevator moment for gamma = 270.0 and alpha = 20 este -18.8961 m
Elevator deflection for gamma = 270.0 and alpha = 20 is -7.3360 m
The equation is not satisfied for gamma = 270.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881
The elevator moment for gamma = 300.0 and alpha = 0 este -18.6501 m
Elevator deflection for gamma = 300.0 and alpha = 0 is -7.2438 m
For gamma = 300.0 and alpha = 0, the equation is satisfied
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881
The elevator moment for gamma = 300.0 and alpha = 5 este -18.6501 m
Elevator deflection for gamma = 300.0 and alpha = 5 is -7.2438 m
The equation is not satisfied for gamma = 300.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881
The elevator moment for gamma = 300.0 and alpha = 10 este -18.6501 m
Elevator deflection for gamma = 300.0 and alpha = 10 is -7.2438 m
The equation is not satisfied for gamma = 300.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881
The elevator moment for gamma = 300.0 and alpha = 15 este -18.6501 m
Elevator deflection for gamma = 300.0 and alpha = 15 is -7.2438 m
The equation is not satisfied for gamma = 300.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881
The elevator moment for gamma = 300.0 and alpha = 20 este -18.6501 m
Elevator deflection for gamma = 300.0 and alpha = 20 is -7.2438 m
The equation is not satisfied for gamma = 300.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422
The elevator moment for gamma = 330.0 and alpha = 0 este -18.4701 m
Elevator deflection for gamma = 330.0 and alpha = 0 is -7.1763 m
The equation is not satisfied for gamma = 330.0 and alpha = 0
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422
The elevator moment for gamma = 330.0 and alpha = 5 este -18.4701 m
Elevator deflection for gamma = 330.0 and alpha = 5 is -7.1763 m
The equation is not satisfied for gamma = 330.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422
The elevator moment for gamma = 330.0 and alpha = 10 este -18.4701 m
Elevator deflection for gamma = 330.0 and alpha = 10 is -7.1763 m
The equation is not satisfied for gamma = 330.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422
The elevator moment for gamma = 330.0 and alpha = 15 este -18.4701 m
Elevator deflection for gamma = 330.0 and alpha = 15 is -7.1763 m
The equation is not satisfied for gamma = 330.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422
The elevator moment for gamma = 330.0 and alpha = 20 este -18.4701 m
Elevator deflection for gamma = 330.0 and alpha = 20 is -7.1763 m
The equation is not satisfied for gamma = 330.0 and alpha = 20
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422 0.7619
The elevator moment for gamma = 360.0 and alpha = 0 este -18.4042 m
Elevator deflection for gamma = 360.0 and alpha = 0 is -7.1516 m
The equation is not satisfied for gamma = 360.0 and alpha = 0
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422 0.7619
The elevator moment for gamma = 360.0 and alpha = 5 este -18.4042 m
Elevator deflection for gamma = 360.0 and alpha = 5 is -7.1516 m
The equation is not satisfied for gamma = 360.0 and alpha = 5
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422 0.7619
The elevator moment for gamma = 360.0 and alpha = 10 este -18.4042 m
Elevator deflection for gamma = 360.0 and alpha = 10 is -7.1516 m
The equation is not satisfied for gamma = 360.0 and alpha = 10
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422 0.7619
The elevator moment for gamma = 360.0 and alpha = 15 este -18.4042 m
Elevator deflection for gamma = 360.0 and alpha = 15 is -7.1516 m
The equation is not satisfied for gamma = 360.0 and alpha = 15
0.7619 0.7597 0.7422 0.6881 0.6144 0.5406 0.4866 0.4668 0.4866 0.5406 0.6144 0.6881 0.7422 0.7619
The elevator moment for gamma = 360.0 and alpha = 20 este -18.4042 m
Elevator deflection for gamma = 360.0 and alpha = 20 is -7.1516 m
The equation is not satisfied for gamma = 360.0 and alpha = 20
%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;
In the below line
eqn = ((Iy * (V^2/R) * (diff_alpha_gamma)^2) ./ gradient(gamma)*pi/180) - (0.5*rho * V^2 * Sc * Cm(i,j));
you can use gradient function as shwon and change the for loop as
for i = 1:length(gamma)
Regarding the second point, you are probably using a different index for alpha , since alpha vector is accessed using loop index j
fprintf("The elevator moment for gamma = %.1f and alpha = %d este %.4f m\n", gamma(i), alpha(j), deltae(i));
% ^^ use i ^^ use j ^^ use i

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!