How to deduct obtained fuel value from initial weight
Show older comments
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 Comments
Dyuman Joshi
on 21 Sep 2023
Is the variable Altitude 53x1?
Do you want to iteratively calculate the weight as the plane ascends? Say, may be every x meters or for values in Altitude.
Ke Yeun Yong
on 21 Sep 2023
Edited: Ke Yeun Yong
on 21 Sep 2023
William Rose
on 21 Sep 2023
Edited: William Rose
on 21 Sep 2023
[edit: added TSFC_22K to list]
Please run your code in the window before you post it, to identify and fix simple errors. For example, @Dyuman Joshi noted that Altitude is not defined in your script. Other undefined variables are Thrust_22K, TAS, Density_altitude, TSFC_22K. When you add them, please include the units in the comments.
William Rose
on 21 Sep 2023
Edited: William Rose
on 21 Sep 2023
As @Dyuman Joshi pointed out, it is not clear what quantities are vectors and what quatities are scalars.
Dyuman Joshi
on 21 Sep 2023
It will be better if you can attach your whole code including values for variables, as has been mentioned before.
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics and Optimization 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!