function [sg]=sg(T) 
  %vapor specific entropy [kJ/kg*K] at T [celsius] 
 
 Tsat=[0:10:300,320,340,360,374.15];
  %saturation temperature in celsius

 svap=[9.1562,8.9008,8.6672,8.4533,8.2570,8.0763,7.9096,7.7553,7.6122,7.4791,7.3549,7.2387,7.1296,7.0269,6.9299,6.8379,6.7502,6.6663,6.5857,6.5079,6.4323,6.3585,6.2861,6.2146,6.1437,6.0730,6.0019,5.9301,5.8571,5.7821,5.7045,5.5362,5.3357,5.0526,4.4298];
  %saturated vapor specific entropy in kJ/kg*K

sg=interp1(Tsat,svap,T);

