function [B,D,V,L,Vp,Lp]=bidist(R,q,xf,xd,xb)
% bidist - binary ideal distillation
%
% function [B,D,V,L,Vp,Lp]=bidist(R,q,xf,xd,xb)
% R is the relux ratio: L/D
% q is the fraction vapor in the feed
% xf, xd, xb are the mol fractions of the 1st compound
%     in the feed, distillate & bottoms.
% B is the ratio of the bottoms to the feed rate
% D is the ratio of the distillate to the feed rate
% V is the ratio of the top vapor to the feed rate
% L is the ratio of the top liquid to the feed rate
% Vp is the ratio of the bottom vapor to the feed rate
% Lp is the ratio of the bottom liquid to the feed rate
det=xb-xd;
D=(xb-xf)/det;
B=1-D;
L=R*D;
V=L+D;
Vp=V-q;
Lp=L+1-q;
