[Go to previous section: 5.4][Go to next section: 5.6]

[ Go to CENG301 Homepage][ CENG301 Notes Table of Contents]


5.5 The Distillation Function: fraco

Here is a listing of fraco:

  function frac=fraco(lk,xdhk,xblk,in)
  % fraco         - Mass balance function simulating a distillation 
column
  % frac=fraco(lk,xdhk,xblk,in)
  % Auxiliary function that gives the fraction of compounds sent to the
  %       distillate in fractions 
  %   Argument    Gives
  %   lk       index of light key
  %   xdhk     mol fraction of heavy key in distillate
  %   xblk     mol fraction of light key in bottom
  %   in       index of the feed stream in ns
  % Heavy key must be next to the light key
  % For addtional help and picture, see PICFRACO
  % Example:  >> ti=fraco(2,0.03,0.05,3);
  %           >> sep(ti,3,[2 4])
  % OKB, TYLC
  
  global ns
  a=[xdhk,(1-xblk);(1-xdhk),xblk]';
  nf=ns(in,:);
  zs=nf/(sum(nf));
  zt=zs(1:lk);
  zl=sum(zt);
  em=a\[(xdhk*zl);(xblk*(1-zl))];
  ti=zeros(size(zs));
  ti(1,1:length(zt))=zt;
  tem=em';
  ti(1,lk:(lk+1))=[(ti(1,lk:(lk+1)))-(tem.*[1 -1])];
  zzs=zs>0;
  frac=zzs.*(ti./zs);
  test=isnan(frac);
  if sum(test)~=0
     frac(find(test))=0;
  end

Also see 1.5.1 The Distillation Function: fraco. Back to Chapter 5.


[Go to previous section: 5.4][Go to next section: 5.6]

[ Go to CENG301 Homepage][ CENG301 Notes Table of Contents]