function sr=s(T,P,vf)
% Compute gas entropy 
% T : Temperature [C]
% P : Pressure    [bar a]
% vf: Vapour fraction (1=vapour and 0=liquid)

R    = 8.314;                            % Gas constant          [kJ/(kmol*K)]
Tref = 273.15;                           % Reference temperature [K]
Pref = 1;                                % Reference pressure    [bar a]

HeatPropertyConstants;

%Components (Cmp): H G P N A where
% H: Hydrogen
% G: Equal mix of ethane, propane and butane
% P: Hepthane
% N: Cycloheptane
% A: Toluene

% Gas properties 
Tp    =[   T^5    T^4    T^3    T^2    T log(T)]';
Trefp =[Tref^5 Tref^4 Tref^3 Tref^2 Tref log(Tref)]';
Icons =[1/5 1/4 1/3 1/2 1 1];
I     =ones(size(Cpv(:,1)));

sv=I*Icons.*Cpv*(Tp-Trefp)-R*log(P/Pref);

svCmp=[sv(1) (sv(2)+sv(3)+sv(4))/3 sv(6) sv(7) sv(8)]';

%Values to be computed later??
sl   =0;
slv  =0;

sr=[(1-vf)*sl + vf*(slv+svCmp)];            % [kJ/kmol*K]
return
