% This function computes the design and off design steady state performance
% of the Diffuser

function [Gas_out] = Core_Diffuser(T1, P1, Mach)

% Declare Global Variable Data
gam_cold = 1.4;     % Ratio of Specific Heats Estimated from (R. Sonntag et al, Fundamentals of Thermodynamics)     
R = 287;            % Ideal Gas Constant (J/kg/Kelvin) from (Anderson, Fundamentals of Aerodynamics)         

% Diffuser Equations
T2 = T1*(1+(gam_cold-1)/2*Mach^2);          % Exit temperature (Kelvin) (Anderson, Fundamentals of Aerodynamics)
P2 = P1*(T2/T1)^(gam_cold/(gam_cold-1));    % Exit Pressure (Pascal) (Anderson, Fundamentals of Aerodynamics)
G2 = 0;                                     % Mass Flow (kg/s) not used in this component

Gas_out = [T2 P2 G2];                       % Save Outputs to Output Vector
end

