function [t,x1]=dewpt2(p,y,erc)
% dewpt2        - Give the dewpoint for a BINARY mixture (See also dewpt)
% function [t,x1]=dewpt2(p,y,erc)
% Argument List:
% Argument    Gives
%    p       pressure in kPa
%    y       mol fraction of 1st component in the vapor.
%    erc     accuracy of final results
% Returns     Giving
%    t       Dew point temp. in Tdeg.
%    x1     liquid mol fraction of 1st component in equil.
%            with the vapor at the dew point.
% Ex: start301
%     setname  
%    (followed by giving the names: benzene, toluene)
%     [t,x1]=dewpt2(101,.3)
%     t will have the dew point and x1 the liquid mol frac.
if nargin<3
  erc=.0001;
end
ts=teql(p);
cs=[p,y,1-y];
t=fzero('dewpt2zero',ts,erc,[],cs);
ks=kval(t,p);
x1=y/ks(1);
