How to deduct obtained fuel value from initial weight
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, the following code is the initial calculation, I have obtained the fuel consumed to climb at each altitude (53 x 1 results) (the final code), I want to deduct this fuel consumption from the weight at every altitude (the weight is denoted is W) because weight reduced as the aircraft fly.
May I know how do I code it? I heard can use for-loop with different iteration? (because I have used a for-loop for other calculation before getting onto the coding below)
Please help. Very much appreciate :)
%% Coefficient of Lift
CDO = 0.023; % Zero-lift drag coefficient
K = 0.044; % Lift-induced drag factor
MTOW = 79010; % Maximum take-off mass [kg]
W = MTOW*9.81; % Weight in N
A= Thrust_22K/W;
B = sqrt((A.^2)+(12*CDO*K));
Cl = (6*CDO)./(A+B);
%% Drag Produced
S = 125; % Wing area [m^2]
C = CDO + (K*(Cl.^2));
D = 0.5*Density_altitude.*(TAS.^2)*S.*C; % [N]
%% Power Available
P_available = TAS.*Thrust_22K;
%% Power Required
P_required = TAS.*D;
%% Excess Power
P_excess = P_available - P_required;
%% Rate of Climb (ROC)
ROC = (TAS.*(Thrust_22K - D))./W; % [m/s]
if any(ROC <=1.5)
disp('Service Ceiling.')
else
disp ('Absolute Ceiling.')
end
%% Climb Angle
X = (Thrust_22K - D)./W;
Climb_angle = asind( X ); % [Degree]
%% Time Taken to Climb
Time = Altitude./ROC; % [sec]
%% Mass Flow Rate
m_dot_f = TSFC_22K.*Thrust_22K; % [kg/s]
%% Fuel Consumed to Climb
Fuel = m_dot_f.*Time;
댓글 수: 5
William Rose
2023년 9월 21일
편집: William Rose
2023년 9월 21일
As @Dyuman Joshi pointed out, it is not clear what quantities are vectors and what quatities are scalars.
Dyuman Joshi
2023년 9월 21일
It will be better if you can attach your whole code including values for variables, as has been mentioned before.
채택된 답변
Torsten
2023년 9월 21일
편집: Torsten
2023년 9월 21일
Most probably something like this. I don't know where you use some of the defined variables - they seem to be superfluous.
%% Coefficient of Lift
CDO = 0.023; % Zero-lift drag coefficient
K = 0.044; % Lift-induced drag factor
W(1) = MTOW*9.81; % Weight in N;
Time(1) = 0.0;
Fuel(1) = 0.0;
for i = 1:numel(Altitude)-1
A = Thrust_22K/W(i);
B = sqrt((A.^2)+(12*CDO*K));
Cl = (6*CDO)./(A+B);
%% Drag Produced
S = 125; % Wing area [m^2]
C = CDO + (K*(Cl.^2));
D = 0.5*(Density_altitude(i)+Density_altitude(i+1))/2.*(TAS.^2)*S.*C; % [N]
%% Power Available
P_available = TAS.*Thrust_22K;
%% Power Required
P_required = TAS.*D;
%% Excess Power
P_excess = P_available - P_required;
%% Rate of Climb (ROC)
ROC = (TAS.*(Thrust_22K - D))./W(i); % [m/s]
if any(ROC <=1.5)
disp('Service Ceiling.')
else
disp ('Absolute Ceiling.')
end
%% Climb Angle
X = (Thrust_22K - D)./W(i);
Climb_angle = asind( X ); % [Degree]
%% Time Taken to Climb
Time(i+1) = (Altitude(i+1)-Altitude(i))./ROC; % [sec]
%% Mass Flow Rate
m_dot_f = TSFC_22K.*Thrust_22K; % [kg/s]
%% Fuel Consumed to Climb
Fuel(i+1) = m_dot_f.*Time(i+1);
W(i+1) = W(i) - Fuel(i+1);
end
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!