Turbojet Matlab problem.pdf

26
Turbojet MATLAB Homework Problem AE 4451 - A Michael Steinfeld

Transcript of Turbojet Matlab problem.pdf

  • Turbojet MATLAB Homework Problem

    AE 4451 - A

    Michael Steinfeld

  • 2

    1. Code Validation To check I have the correct turbojet cycle analysis, I implemented the equations from class notes

    and the textbook [1]. To determine how the specific thrust and thrust-specific fuel consumption

    (TSFC) vary with compressor pressure ratio (Pr,c) it was necessary to perform a complete cycle

    analysis of the turbojet. The flow of the cycle analysis follows the sequence of station numbers

    shown in the turbojet schematic in Figure 1 below:

    Throughout this analysis, the flow is assumed to act as a calorically-perfect gas, and is uniform,

    steady, and irreversible as appropriate. Equations are generally derived from mass and energy

    conservation equations, as shown in the textbook and class notes.

    Given the flight Mach number, ambient pressure, ambient temperature, component adiabatic

    efficiencies, and specific heat ratios, the analysis begins with the diffuser (stations 1 2):

    The flow then passes into the compressor, where it is assumed that both the stagnation

    temperature and pressure ride as a result of compression. The compression ratio of the compressor

    is given as Pr,c and is plotted as the dependent variable on all graphs:

    Figure 1: Turbojet Schematic Diagram [2]

  • 3

    The next step in the cycle is the burner, where the compressed air is mixed with fuel and then

    ignited. It is assumed that the stagnation pressure does not change at this stage; heat addition is

    the only work process that occurs in this stage:

    Where ,

    It is noted that the turbine inlet temperature, T04 is a material-limited property. In this problem,

    we are given T04 between 1500 K and 2000 K; the MATLAB program plots lines for each turbine inlet

    temperature to show how this property affects engine performance. An explanation of this is found

    below. Within the turbine, the stagnation temperature and pressure are found as:

    The burner pressure ratio (Pr,b) is assumed to be 1 in this analysis. This is an ideal assumption

    since it suggests that there is no stagnation pressure loss throughout the burn, and heat addition is

    the only work done. In practice, there is always some degree of pressure loss here, but for simplicity

    (and considering that no ratio was given in the problem statement) the ideal case is assumed. The

    user has the ability to change this value if needed.

    Combining the equations for P04 and T05, an expression for P05, or turbine exit stagnation

    pressure, is found:

    In this section, there is assumed to be no afterburner present. It therefore follows that T06 = T05

    and P06 = P05. At this stage, the flow has left the turbine and entered the nozzle, where the exit

    conditions are found:

  • 4

    Where the flight speed U is defined as,

    Using specific thrust, the thrust-specific fuel consumption is found as:

    The turbojet cycle analysis is now complete for flight conditions where the afterburner is not

    selected/ engaged. Using three for loops embedded within each other, MATLAB is directed to

    create a 3-D matrix for each of the exit velocity (Ue), specific thrust, and TSFC. The purpose of a 3-D

    matrix is to gather all values to be plotted into a single variable. There are three dimensions

    required, as explained below and shown in Figure 2:

    X = compressor pressure ratio; dependent variable to be plotted along the horizontal axis

    Y = turbine inlet temperature; each given its own plot line on the graph

    Z = one layer for each of the four flight conditions, hence one per graph

    The four plots of specific thrust vs. compressor pressure ratio and TSFC vs. compressor pressure

    ratio used to validate my program are shown below as Figures 3-6. When comparing the plots with

    those in the textbook (pp. 174-175), it can be seen that the plots are a close match. The flight

    conditions used are the same as those in the textbook: (1) static conditions at sea level, (2) Mach

    0.85 and 40,000 ft altitude, (3) Mach 2.0 and 60,000ft, and (4) Mach 3.0 and 80,000 ft.

    The graphs show that specific thrust increases with turbine inlet temperature. Since this

    temperature limits the burn that occurs in the combustor, it also tends to limit the efficiency of the

    engine; a hotter burn produces more energy which can be translated into thrust, so as the turbine

    inlet temperature increases (it is assumed that the burn temperature increases by the same

    Figure 2: Structure of 3-D Matrix for Plotted Variables

  • 5

    amount), thrust also increases. TSFC follows the same trend but does not increase as quickly as

    specific thrust, thus proving that the engine becomes more efficient (lower fuel burn for a greater

    increase in thrust) as T04 increases.

    It is also seen that at higher Mach numbers (supersonic regime), a low compressor pressure

    ratio minimizes fuel burn. Conversely, at low Mach numbers (subsonic regime), it is more efficient

    to have a higher compressor pressure ratio. This is due to the Ram Effect which describes how the

    turbojet essentially becomes a ramjet in supersonic flight; the captured air is compressed and

    heated as it passes through the diffuser, which means that the compressor cannot generate as much

    of a pressure increase, and the burn doesnt provide as much of a heat increase. By definition, the

    efficiency of the engine decreases as the thrust output thus diminishes.

    Figure 3: Thrust and Fuel Consumption at Sea Level, Static Conditions

  • 6

    Figure 4: Thrust and Fuel Consumption at 40,000ft and M=0.85

    Figure 5: Thrust and Fuel Consumption at 60,000ft and M=2.0

  • 7

    2. Afterburner Analysis To analyze the afterburners effect on a turbojets performance, it is necessary to modify the

    cycle analysis performed previously. All steps through the turbine section (calculation of P05) remain

    the same as before, since they are not affected by the afterburner. Within the afterburner section

    however, there is an additional injection of fuel and a subsequent burn of the exhaust air. This

    produces additional thrust through heat addition. The afterburner properties (fuel-to-air ratio, T06,

    P06, and modified exit conditions) are calculated as follows:

    Where Pr,ab is the afterburner pressure ratio. For simplicity, the afterburner pressure ratio is

    assumed to be equivalent to the burner pressure ratio, which is taken as 1 (see previous

    explanation). With these modifications to the stagnation pressure and temperature leaving the

    Figure 6: Thrust and Fuel Consumption at 80,000ft and M=3.0

  • 8

    afterburner, the exit conditions can be re-written to incorporate the fuel flow in the afterburner as

    follows:

    Note the definitions for exit velocity (Ue) and flight velocity (U) are unchanged. The thrust-

    specific fuel consumption is therefore expressed as:

    Essentially, these expressions are the same as before; the only change is to add in the fuel-to-air

    ratio in the afterburner (fab). The same method to condense the resultant values into 3-D matrices is

    again employed, and the results plotted for four different flight regimes, with each set of regimes

    differentiating between an equivalence ratio of 0.3, 0.5, and 0.7:

    Figure 7: Thrust and Fuel Consumption at Sea Level, Static Conditions, and = 0.3

  • 9

    Figure 8: Thrust and Fuel Consumption at FL400, M = 0.85, and = 0.3

    Figure 9: Thrust and Fuel Consumption at FL600, M = 2.0, and = 0.3

  • 10

    Figure 10: Thrust and Fuel Consumption at FL800, M = 3.0, and = 0.3

    Figure 11: Thrust and Fuel Consumption at Sea Level, Static Conditions, and = 0.5

  • 11

    Figure 12: Thrust and Fuel Consumption at FL400, M = 0.85, and = 0.5

    Figure 13: Thrust and Fuel Consumption at FL600, M = 2.0, and = 0.5

  • 12

    Figure 14: Thrust and Fuel Consumption at FL800, M = 3.0, and = 0.5

    Figure 15: Thrust and Fuel Consumption at Sea Level, Static Conditions, and = 0.7

  • 13

    Figure 16: Thrust and Fuel Consumption at FL400, M = 0.85, and = 0.7

    Figure 17: Thrust and Fuel Consumption at FL600, M = 2.0, and = 0.7

  • 14

    Figure 18: Thrust and Fuel Consumption at FL800, M = 3.0, and = 0.7

    The purpose of an afterburner is to increase the thrust output of the engine. Unfortunately, an

    afterburner is not an efficient use of fuel; for cost reasons, it is not advisable to operate the aircraft

    with the afterburners engaged unless the extra thrust is required (e.g. short-field performance,

    evasive maneuvers, etc.).

    Upon analyzing the graphs, it is clear that the equivalence ratio has a direct effect on the thrust

    output and fuel consumption of the engine. In short, as the equivalence ratio increases, so does the

    thrust and the amount of fuel consumed. TSFC increases more rapidly than specific thrust, however,

    so it is evident that an afterburner requires a greater increase in fuel flow per marginal increase in

    thrust output. For example, at 80,000 ft, Mach 3.0, and T04 = 1700 K, the afterburner-engaged

    engine produces the following specific thrusts and TSFCs:

    Table 1: Equivalence Ratio, Specific Thrust, and TSFC

    Equivalence Ratio (ab)

    Peak Specific Thrust (kN*sec/kg)

    Corresponding TSFC (kg/kN*sec)

    NO A/B USED

    Pk Spec Thrust Corresp TSFC

    0.3 0.6131 0.0702

    0.5992 0.0406 0.5 0.6223 0.0893

    0.7 0.6314 0.1078

  • 15

    As shown in the table, the specific thrusts and TSFCs are all higher when the afterburner is used

    than when it is not. TSFCs have a much greater gain than specific thrust when the afterburner is

    engaged, indicating the inefficiency of using an afterburner.

    When compared to no afterburner used graphs, the thrust has noticeably increased in all

    flight regimes (and across all compressor ratios) rather uniformly. TSFC has also increased, but at a

    much faster rate than specific thrust. In fact, the variation between flight regimes is greater than

    the variation between equivalence ratios, but this is expected considering the wide range of flight

    regimes considered in this program. Nevertheless, it should be concluded that it is not financially

    viable to increase the equivalence ratio much farther beyond 0.7. Doing so would result in a much

    higher fuel burn without a significant return on thrust output.

    3. Ideal Adiabatic Efficiencies When the adiabatic efficiency of each component is made ideal, the engines TSFC decreases

    and the specific thrust increases at each flight regime. This is considered the ideal case, since the

    engine cannot become more efficient. The following table details the changes in peak specific thrust

    and corresponding TSFC at each of the four flight regimes:

    Table 2: Real vs. Ideal Static Thrust (kN*sec/kg) and TSFC (kg/kN*sec)

    Prc = 2 T04=1700

    Sea Level Static Condition

    FL 400 M = 0.85

    FL 600 M = 2.0

    FL 800 M = 3.0

    Specific Thrust

    TSFC Specific Thrust

    TSFC Specific Thrust

    TSFC Specific Thrust

    TSFC

    Real 0.6811 0.05059 0.6799 0.05272 0.7250 0.04125 0.5992 0.04055

    Ideal 0.7184 0.04834 0.7113 0.05077 0.7654 0.04035 0.6444 0.03859

    % change

    5.47 (4.45) 4.62 (3.70) 5.57 (2.18) 7.54 (4.83)

    Prc = 100 T04=1700

    Sea Level Static Condition

    FL 400 M = 0.85

    FL 600 M = 2.0

    FL 800 M = 3.0

    Specific Thrust

    TSFC Specific Thrust

    TSFC Specific Thrust

    TSFC Specific Thrust

    TSFC

    Real 0.7678 0.01922 0.7720 0.02434 0.00780 0.6270 NaN NaN

    Ideal 1.0250 0.01754 0.9442 0.02284 0.02327 0.3829 NaN NaN

    % change

    33.50 (8.74) 22.31 (6.16) 198.33 (38.93) -- --

    There is definitely an improvement in the ideal turbojet versus the real case. The table above

    shows some remarkable differences in specific thrust and TSFC, especially at the higher compressor

    pressure ratios where the turbojet tends to operate (and is the most efficient in the subsonic

    region). In the aviation industry, a couple percentage points can make the difference between a

    profit and a loss, and often a 2-3% efficiency gain can add up to a large long-term savings.

  • 16

    It would certainly be worth investing in improvements to the adiabatic efficiencies of the

    turbojet. Currently, the compressor has the lowest real adiabatic efficiency (c = 0.85), followed by

    the turbine (t = 0.90). It is typical for a compressor to have a low efficiency since it operates with

    an adverse pressure gradient, but from the table it looks like there is still room for improvement.

    Possible ways to increase the efficiency of the compressor include adding additional stages to

    reduce the pressure rise across each stage, and working on lighter vane materials to reduce the

    weight of the compressor overall when stages are added.

    The following plots detail how specific thrust and TSFC are affected by changing the adiabatic

    efficiencies of each component to 1, or the ideal case. When compared to the results from

    question (1), it is clear that the engine has become far more efficient; the specific thrust has

    increased, and the TSFC has decreased, at every point. This means that the engine is able to output

    more thrust with less fuel at each stage:

    Figure 19: Ideal Turbojet Performance at Sea Level, Static Conditions

  • 17

    Figure 20: Ideal Turbojet Performance at FL400, Mach 0.85

    Figure 21: Ideal Turbojet Performance at FL600, Mach 2.0

  • 18

    Figure 22: Ideal Turbojet Performance at FL800, Mach 3.0

    4. Increased Turbine Inlet Temperature The following graphs support the notion that an increased turbine inlet temperature will lead to

    a more efficient engine. The combustor exit temperature, and hence the burn temperature, is

    generally limited by the material properties of the turbine. A hotter burn is more efficient since it

    produces more thrust as it releases larger amounts of energy, but it is often times required to limit

    the performance of the engine such that the turbine doesnt sustain damage. For example, many

    airliners perform reduced-thrust takeoffs when they do not need the extra performance of 100%

    N1. This allows for reduced engine wear (lower maintenance costs and longer between-service

    intervals), but it also results in a higher fuel burn.

    By increasing the turbine inlet temperature, the engine can produce more thrust and burn less

    fuel. As shown on the graphs below, as T04 increases, specific thrust increases and TSFC decreases,

    indicating a more-efficient engine:

  • 19

    Figure 23: Increased Turbine Inlet Temperature, Sea Level, Static Conditions

    Figure 24: Increased Turbine Inlet Temperature, FL400, Mach 0.85

  • 20

    Figure 25: Increased Turbine Inlet Temperature, FL600, Mach 2.0

    Figure 26: Increased Turbine Inlet Temperature, FL800, Mach 3.0

  • 21

    References [1] Hill, Phillip and Peterson, Carl, Mechanics and Thermodynamics of Propulsion, 2nd Edition, pp. 171

    173

    [2] Hill, Phillip and Peterson, Carl, Mechanics and Thermodynamics of Propulsion, 2nd Edition, pp. 164

    Appendix MATLAB Code %USER SELECTS PROGRAM CONFIGURATON

    %#1: CODE VALIDATION, NO AFTERBURNER %#2: AFTERBURNER ANALYSIS %#3: IDEAL CASE, NO AFTERBURNER %#4: INCREASE TURBINE INLET TEMP question = 1; %set 1, 2, 3, or 4 %-------------------------------------------------------------------------- %GIVEN VALUES

    %engine data Tknot4 = [1500 1600 1700]; %K phi_ab = [0.3 0.5 0.7]; %afterburner equivalence ratio f_stoich = 1/16; %stoichiometric fuel:air ratio eta_d = 0.97; gamma_d = 1.40; eta_c = 0.85; gamma_c = 1.37; eta_b = 1.00; gamma_b = 1.35; %assume eta_ab is same as eta_b eta_t = 0.90; gamma_t = 1.33; eta_n = 0.98; gamma_n = 1.36;

    HV = 45000000; %J/kg, heating value R = 287.04; %J/kg*k, for air Cp_b = R*(gamma_b/(gamma_b-1)); %J, specific heat (burner) Q_R = HV/Cp_b;

    %flight conditions h = [0 12200 18300 24400]; %altitude, m Mcr = [0 0.85 2 3]; %cruise mach Pamb = [101.3 18.750 7.170 2.097]; %ambient pres, kPa Tamb = [288.2 216.7 216.7 216.7]; %ambient temp, K

    %pressure ratios Pr_c = [2 3 4 6 8 10 20 30 40 60 80 100]; %Pr,c - "X" points on graph Prc = linspace(2,100,100); %compressor pressure ratio Prb = 1; %burner pressure ratio (ideal) Prab = 1; %afterburner pressure ratio %-------------------------------------------------------------------------- if question ~= 2 %QUESTIONS 1, 3, AND 4 CONTAINED HERE; QUESTION 2 BELOW

    %HANDLE QUESTIONS 3 AND 4 if question == 3 %QUESTION 3: IDEAL ADIABATIC EFFICIENCIES ANALYSIS eta_d = 1; %diffuser adiabatic efficiency, ideal eta_c = 1; %compressor adiabatic efficiency, ideal eta_b = 1; %burner efficiency, ideal

  • 22

    eta_t = 1; %turbine adiabatic efficiency, ideal eta_n = 1; %nozzle adiabatic efficiency, ideal

    elseif question == 4 %QUESTION 4: TURB. STAG. TEMP. = 1800 K, 2000 K Tknot4 = [1500 1600 1700 1800 2000]; end

    %BEGIN COMMON CODE FOR QUESTIONS 1, 3, AND 4 for c=1:length(h) %one graph per flight condition %define flight variables M = Mcr(c); %Mach number Pa = Pamb(c)*1000; %ambient pressure, Pa Ta = Tamb(c); %ambient temperature U = M*sqrt(gamma_d*R*Ta); %convert Mach to velocity

    % 1 - 2, Diffuser To2 = Ta*(1 + (gamma_d - 1)/2*M^2); Po2 = Pa*((1 + eta_d*((To2/Ta) - 1))^(gamma_d/(gamma_d - 1)));

    for t=1:length(Tknot4) %one plotline per turbine inlet temperature To4 = Tknot4(t);

    for i=1:length(Prc) %one point per compressor pressure ratio % 2 - 3, Compressor Po3 = Po2*Prc(i); To3 = To2*(1 + (1/eta_c)*(Prc(i)^((gamma_c-1)/gamma_c) - 1));

    % 3 - 4, Burner f = (To4/To3 - 1)/(eta_b*Q_R/To3 - To4/To3); Po4 = Po3*Prb;

    % 4 - 5, Turbine To5 = To4 - (To3 - To2); Po5 = Po4*(1 - (1/eta_t)*(1 - To5/To4))^(gamma_t/(gamma_t-

    1));

    % 5 - 6, Afterburner - none present To6 = To5; Po6 = Po5;

    % 6 - 7, Nozzle (EXIT CONDITIONS) Uexit(t,i,c) = sqrt(2*eta_n*gamma_n/(gamma_n-1)*R*To6*(1-

    ((Pa/Po6)^((gamma_n-1)/gamma_n)))); tau_spec(t,i,c) = ((1 + f)*Uexit(t,i,c) - U)/1000; %divide

    by 1000 to get kN*s/kg %handle non-real answers if (~isreal(tau_spec(t,i,c))) || (tau_spec(t,i,c) < 0) tau_spec(t,i,c) = NaN; TSFC(t,i,c) = NaN; else %calculate TSFC TSFC(t,i,c) = f/tau_spec(t,i,c); end %handle non-real TSFC if TSFC(t,i,c) < 0 TSFC(t,i,c) = NaN;

  • 23

    end end end end

    %PRINTING GRAPHS for p=1:length(h) figure %generate new figure if p == 1 %Flight condition 1 (FL 000, M = 0.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,1),

    Prc,TSFC(:,:,1),'semilogx'); title('Static Thrust and Fuel Consumption at MSL') yMax1 = 2.2; yMax2 = 0.04; end if p == 2 %Flight condition 2 (FL 400, M = 0.85) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,2),

    Prc,TSFC(:,:,2),'semilogx'); title('Cruise Thrust and Fuel Consumption at FL400, M=0.85') yMax1 = 1.4; yMax2 = 0.06; end if p == 3 %Flight condition 3 (FL 600, M = 2.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,3),

    Prc,TSFC(:,:,3),'semilogx'); title('Cruise Thrust and Fuel Consumption at FL600, M=2.0') yMax1 = 1.0; yMax2 = 0.1; end if p == 4 %Flight condition 4 (FL 800, M = 3.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,4),

    Prc,TSFC(:,:,4),'semilogx'); title('Cruise Thrust and Fuel Consumption at FL800, M=3.0') yMax1 = 1.0; yMax2 = 0.1; end

    %set axes and format graph set(get(AX(1),'Ylabel'),'string','Specific Thrust, kN*s/kg') set(get(AX(2),'Ylabel'),'string','TSFC, kg/(kN*s)') xlabel('Compressor Pressure Ratio') set(AX(1),'Ylim',[0 yMax1]) set(AX(2),'YLim',[0 yMax2]) set(AX(1),'YTick',[0:0.2:yMax1]) set(AX(2),'YTick',[0:0.02:yMax2]) set(AX(1),'XLim',[2 100]) set(AX(2),'XLim',[2 100]) set(AX(1),'XTick',Pr_c) set(AX(2),'XTick',Pr_c) set(AX(1),'XTickLabel',Pr_c) set(AX(2),'XTickLabel',Pr_c)

    %include legend if question ~= 4

  • 24

    lg1 = legend(H1, 'Specific Thrust, T_0_4 = 1500 K', 'Specific

    Thrust, T_0_4 = 1600 K', 'Specific Thrust, T_0_4 = 1700 K', 'Location',

    'Best'); lg2 = legend(H2, 'TSFC, T_0_4 = 1500 K', 'TSFC, T_0_4 = 1600 K',

    'TSFC, T_0_4 = 1700 K', 'Location', 'Best'); set(lg1,'color','w') set(lg2,'color','w') set(H1(3),'color','red') set(H1(2),'color','green') set(H1(1),'color','blue') set(H2(3),'LineStyle','--','color','red') set(H2(2),'LineStyle','--','color','green') set(H2(1),'LineStyle','--','color','blue') else lg1 = legend(H1, 'Specific Thrust, T_0_4 = 1500 K', 'Specific

    Thrust, T_0_4 = 1600 K', 'Specific Thrust, T_0_4 = 1700 K', 'Specific Thrust,

    T_0_4 = 1800 K', 'Specific Thrust, T_0_4 = 2000 K', 'Location', 'Best'); lg2 = legend(H2, 'TSFC, T_0_4 = 1500 K', 'TSFC, T_0_4 = 1600 K',

    'TSFC, T_0_4 = 1700 K', 'TSFC, T_0_4 = 1800 K', 'TSFC, T_0_4 = 2000 K',

    'Location', 'Best'); set(lg1,'color','w') set(lg2,'color','w') set(H1(5),'color','magenta') set(H1(4),'color','black') set(H1(3),'color','red') set(H1(2),'color','green') set(H1(1),'color','blue') set(H2(5),'LineStyle','--','color','magenta') set(H2(4),'LineStyle','--','color','black') set(H2(3),'LineStyle','--','color','red') set(H2(2),'LineStyle','--','color','green') set(H2(1),'LineStyle','--','color','blue') end end %-------------------------------------------------------------------------- elseif question == 2 %QUESTION 2: AFTERBURNER ANALYSIS for a = 1:length(phi_ab) %one set of graphs per equivalence ratio phi = phi_ab(a);

    for c=1:length(h) %one graph per flight condition %define flight variables M = Mcr(c); %Mach number Pa = Pamb(c)*1000; %ambient pressure, Pa Ta = Tamb(c); %ambient temperature U = M*sqrt(gamma_d*R*Ta); %convert Mach to velocity

    % 1 - 2, Diffuser To2 = Ta*(1 + (gamma_d - 1)/2*M^2); Po2 = Pa*((1 + eta_d*((To2/Ta) - 1))^(gamma_d/(gamma_d - 1)));

    for t=1:length(Tknot4) %one plotline per turbine inlet

    temperature To4 = Tknot4(t);

    for i=1:length(Prc) %one point per compressor pressure ratio % 2 - 3, Compressor

  • 25

    Po3 = Po2*Prc(i); To3 = To2*(1 + (1/eta_c)*(Prc(i)^((gamma_c-1)/gamma_c) -

    1));

    % 3 - 4, Burner f = (To4/To3 - 1)/(eta_b*Q_R/To3 - To4/To3); Po4 = Po3*Prb;

    % 4 - 5, Turbine To5 = To4 - (To3 - To2); Po5 = Po4*(1 - (1/eta_t)*(1 -

    To5/To4))^(gamma_t/(gamma_t-1));

    % 5 - 6, Afterburner - present f_ab = phi*f_stoich; To6 = ((1 + f)*To5 + (eta_b*f_ab*Q_R / Cp_b))*(1/(1 + f +

    f_ab)); Po6 = Po5*Prab;

    % 6 - 7, Nozzle (EXIT CONDITIONS) Uexit(t,i,c) = sqrt(2*eta_n*gamma_n/(gamma_n-1)*R*To6*(1-

    ((Pa/Po6)^((gamma_n-1)/gamma_n)))); tau_spec(t,i,c) = ((1 + f + f_ab)*Uexit(t,i,c) - U)/1000;

    %divide by 1000 to get kN*s/kg %handle non-real answers if (~isreal(tau_spec(t,i,c))) || (tau_spec(t,i,c) < 0) tau_spec(t,i,c) = NaN; TSFC(t,i,c) = NaN; else %calculate TSFC TSFC(t,i,c) = (f + f_ab)/tau_spec(t,i,c); end %handle non-real TSFC if TSFC(t,i,c) < 0 TSFC(t,i,c) = NaN; end end end end

    %PRINTING GRAPHS for p=1:length(h) figure %generate new figure if p == 1 %Flight condition 1 (FL 000, M = 0.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,1),

    Prc,TSFC(:,:,1),'semilogx'); title(['Static Thrust and Fuel Consumption w/ A/B at MSL,

    Equiv Ratio = ' num2str(phi_ab(a)) ]) yMax1 = 2.2; yMax2 = 0.3; end if p == 2 %Flight condition 2 (FL 400, M = 0.85) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,2),

    Prc,TSFC(:,:,2),'semilogx'); title(['Thrust and Fuel Consumption w/ A/B at FL400, M =

    0.85, Equiv Ratio = ' num2str(phi_ab(a)) ]) yMax1 = 1.4;

  • 26

    yMax2 = 0.3; end if p == 3 %Flight condition 3 (FL 600, M = 2.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,3),

    Prc,TSFC(:,:,3),'semilogx'); title(['Thrust and Fuel Consumption w/ A/B at FL600, M = 2.0,

    Equiv Ratio = ' num2str(phi_ab(a)) ]) yMax1 = 1.0; yMax2 = 0.3; end if p == 4 %Flight condition 4 (FL 800, M = 3.00) [AX, H1, H2] = plotyy(Prc,tau_spec(:,:,4),

    Prc,TSFC(:,:,4),'semilogx'); title(['Thrust and Fuel Consumption w/ A/B at FL800, M = 3.0,

    Equiv Ratio = ' num2str(phi_ab(a)) ]) yMax1 = 1.0; yMax2 = 0.3; end

    %set axes and format graph set(get(AX(1),'Ylabel'),'string','Specific Thrust, kN*s/kg') set(get(AX(2),'Ylabel'),'string','TSFC, kg/(kN*s)') xlabel('Compressor Pressure Ratio') set(AX(1),'Ylim',[0 yMax1]) set(AX(2),'YLim',[0 yMax2]) set(AX(1),'YTick',[0:0.2:yMax1]) set(AX(2),'YTick',[0:0.02:yMax2]) set(AX(1),'XLim',[2 100]) set(AX(2),'XLim',[2 100]) set(AX(1),'XTick',Pr_c) set(AX(2),'XTick',Pr_c) set(AX(1),'XTickLabel',Pr_c) set(AX(2),'XTickLabel',Pr_c)

    %include legend lg1 = legend(H1, 'Specific Thrust, T_0_4 = 1500 K', 'Specific

    Thrust, T_0_4 = 1600 K', 'Specific Thrust, T_0_4 = 1700 K', 'Location',

    'Best'); lg2 = legend(H2, 'TSFC, T_0_4 = 1500 K', 'TSFC, T_0_4 = 1600 K',

    'TSFC, T_0_4 = 1700 K', 'Location', 'Best'); set(lg1,'color','w') set(lg2,'color','w') set(H1(3),'color','red') set(H1(2),'color','green') set(H1(1),'color','blue') set(H2(3),'LineStyle','--','color','red') set(H2(2),'LineStyle','--','color','green') set(H2(1),'LineStyle','--','color','blue') end end %-------------------------------------------------------------------------- else %INVALID QUESTION - THROW ERROR TO RE-SELECT error('Select a valid question: 1-4') end