function y = sumy(Tk);

% This function returns the vector of differences (1-sumY) at given 
% values of temperature (Tk), pressure (P) and liquid composition (X).

% FZERO('sumy',value) returns the Tk that gives sumY=1, i.e. when the
% difference is zero

global X P NC R W A alpha 

Y=ycomp(Tk);
y=sum(Y)-1;