% cocurrent countercurrent plots
% cocurrent
clear all
% set parameters
 set(0,                           ...
   'defaultaxesfontsize', 20,   ...
   'defaultaxeslinewidth', 1.2, ...
   'defaultlinelinewidth', 2.0, ...
   'defaultpatchlinewidth', 0.7); 

cmykflg=0;
%if cmykflg=1, this code will make cmyk figure files
%cmykflg = 1;

rholist = [0.5,2.0];
for j = 1:2
    rho = rholist(j);
    
L = [0:0.01:5];
%cocurrent
EL = exp(-L*(1+1/rho));
c1L = (1+rho* EL)/(1+rho);

c2L = rho*(1-EL)/(1+rho);

% countercurrent
EcL = exp(-L*(1-1/rho));
c1cL = (1-rho)*EcL./(EcL-rho);
c2cL = rho*(EcL-1)./(EcL-rho);
figure(3)
plot( L,c2L,'--',L,c2cL,'linewidth',2)
xlabel('Residence length, d L/v_1','fontsize',20)
ylabel('Transfer Fraction','fontsize',20)
hold on
end
hold off
text(3,0.78,'\rho = 2.0','fontsize',20)
text(3,0.42,'\rho = 0.5','fontsize',20)

annotation('arrow',[.58 .53],[.45,.42])
   annotation('arrow',[.58 .53],[.73,.67])
   annotation('arrow',[.58 .53],[.75,.79])
   annotation('arrow',[.58 .53],[.47,.51])


if(cmykflg==1)
  print('../../figs_c/chapt_9/currentfg1','-deps','-cmyk')
 end 
