function pv_sat=psv(temp)

% calculate saturation vapor pressure given temperature temp

K=[1.16705214528E+03,-7.24213167032E+05,-1.70738469401E+01,1.20208247025E+04, ...
    -3.23255503223E+06,1.49151086135E+01,-4.82326573616E+03,4.05113405421E+05, ...
    -2.38555575678E-01,6.50175348448E+02];
T=temp+273.15;
sig=T+K(9)/(T-K(10));
A=sig^2 + K(1)*sig+K(2);
B=K(3)*sig^2+K(4)*sig+K(5);
C=K(6)*sig^2+K(7)*sig+K(8);
X=-B+sqrt(B^2-4*A*C);
pv_sat=(1e6)*(2*C/X)^4;
end