0% found this document useful (0 votes)
283 views

Simulation of McCabe

The document describes the McCabe Thiele method for separation of binary mixtures using distillation. It discusses the assumptions of the method and provides a MATLAB code to simulate the McCabe Thiele diagram. The code takes input variables like feed flow rate, compositions, reflux ratio, relative volatility and provides output like number of stages, distillate and residue flow rates. It plots the equilibrium curve, operating lines and stages on a mole fraction diagram. A separate code finds the minimum number of trays required.

Uploaded by

john
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
283 views

Simulation of McCabe

The document describes the McCabe Thiele method for separation of binary mixtures using distillation. It discusses the assumptions of the method and provides a MATLAB code to simulate the McCabe Thiele diagram. The code takes input variables like feed flow rate, compositions, reflux ratio, relative volatility and provides output like number of stages, distillate and residue flow rates. It plots the equilibrium curve, operating lines and stages on a mole fraction diagram. A separate code finds the minimum number of trays required.

Uploaded by

john
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

THE GRAPHICAL REPRESENTATION

OF MCCABE THIELE METHOD


(MATLAB CODE)

THE METHOD OF MCCABE THIELE

Introduction

The McCabe Thiele method is used for the separation of a binary mixture of
components having different volatilities. The McCabe-Thiele method is considered
to be the simplest and perhaps most instructive method for the analysis of binary
distillation. It uses the fact that the composition at each theoretical
tray (equilibrium stage) is completely determined by the mole fraction of one of
the two components and is based on the assumption of constant molar overflow
which requires that:
the molar heats of vapor of the feed components are equal
for every mole of liquid vaporized, a mole of vapour is condensed

heat effects such as heats of solution are negligible


The Matlab code method uses the same assumptions as the Mccabe Thiele method
of distillation which are as follows
1. The two components have equal and constant molar enthalpies of
vaporization (latent heats).
2. Component sensible-enthalpy changes (CpT) and similarly, heat of mixing
are negligible compared to latent heat changes.
3. The column is well insulated so that heat loss is negligible.
4. The pressure is uniform throughout the column (no pressure drop).
The constant molar overflow refers to a molar liquid flow rate that remains
constant as the liquid overflows each weir from one stage to the next.
Below is a general graph of McCabe Thiele method used for the separation of a
binary mixture of compounds showing various components of the graph.

Figure showing the theoretical diagram of


distillation column

THE MATLAB
CODE
WORKING
The Matlab program asks user to input some
variables which should be carefully fed by the
user and provides some variables as output and a
graph of y vs. x for the more volatile component.
The graph shows the equilibrium curve and the
stages represented between the equilibrium curve and the operating lines of the
enriching and stripping section.
INPUT VARIABLES
The following were taken as input for the Matlab program :Feed flow rate f
Fraction of more volatile component in the feed xf
Liquid fraction in feed liq
Fraction of the more volatile component in the distillate xd
Fraction of the more volatile component in the residue - xw
Reflux ratio R
Relative volatility
OUTPUT VARIABLES
The following were the variables given as output by the Matlab program :Distillate flow rate D

Residue flow rate R


Q-value q
Number of stages required i
Number of trays required i-1
Minimum number of trays required g
The program shows a graph of y vs. x for the distillation process as per input
variables and shows q-line, operating lines of both enriching and stripping section,
y=x line and the stages required for the distillation process. The minimum number
of trays are also shown on a separate graph and also tells us the minimum number
of trays required for the process.
COMMANDS USED IN THE CODE
The program uses the following commands for the various operations required to
be performed for reaching to the solutions of the output variables :1.

2.

3.
4.
5.
6.

Command - Function
Disp( ) - The disp( ) command displays the text inserted between the single
inverted commas. It also displays the value of the function inserted in the
brackets of disp command.
Input( ) - The input( ) command asks the user to input the value of the
variable. It displays the string entered in the inverted commas, waits for the
input, evaluates any expressions in the input and returns the result.
If loop if evaluates an expression, and executes a group of statements only
when the expression is true.
While loop while loop repeatedly executes statements as long as an
expression remains true.
Linspace the linspace function specifies the upper and lower limits of the
variable
Plot plots y vs. x for the current program. It is used in the program for
plotting stages.

7. Hold on the hold function clears the current graph when we make subsequent
calls to plot a function. Hold on retains the current graph and adds another
graph to it.
8. Solve solves the set of equations specified.
9. Subs substitutes the value of the variable in the specified equation.
CODE

disp('The program is a simulation ofsingle feed ideal Mccabe-Thiele ');


disp('Please input the values as asked in the following lines and press ENTER');
f=input('The feed flow rate is ');
xf=input('The feed composition is');
liq=input('The fraction of liquid in the feed');
xd=input('The distillate composition is ');
xw=input('The residue composition is ');
R=input('The reflux ratio is ');
a=input('The relative volatility is ');
D=f*(xf-xw)/(xd-xw);
W=f-D;
disp('Distillate is removed at the rate of')
disp(D)
disp('Residue is removed at the rate of')
disp(W)
L=D*R;
Lbar=L+f*liq;
q=(Lbar-L)/f;
disp('The quality of feed is ')
disp(q)
if q~=1;
intx=(xd/(R+1)+xf/(q-1))/(q/(q-1)-R/(R+1));
inty=intx*R/(R+1)+xd/(R+1);
hold on;
ezplot('y=x',[0,1]);
x=linspace(0,1);
y=a*x./(1+x*(a-1));
plot(x,y);
k=linspace(intx,xd);%enriching operating line
o=k.*R/(R+1)+xd/(R+1);

plot(k,o);
if intx>xf;
e=linspace(xf,intx);
r=e.*q/(q-1)-xf/(q-1);
disp('a');
plot(e,r);
end
if intx<xf;
e=linspace(intx,xf);
r=e.*q/(q-1)-xf/(q-1);
plot(e,r);
end
b=linspace(xw,intx);
j=b.*(inty-xw)/(intx-xw)-xw*(inty-xw)/(intx-xw)+xw;
plot(b,j);
grid on;
t=xd;t1=xd;p=xd;
i=0;
syms x y
while t>xw;
h=solve(y == a*x/(1+x*(a-1)), y == t1+0*x);
plot([h.x,t],[p,p],'m')
t=h.x;
if t>intx;
p=subs(R*x/(R+1)+xd/(R+1),h.x);
plot([h.x,h.x],[p,h.y],'m')
t1=p;
i=i+1;
end
if t<intx;
p=subs(x.*(inty-xw)/(intx-xw)-xw*(inty-xw)/(intx-xw)+xw,h.x);
plot([h.x,h.x],[p,h.y],'m')
t1=p;
i=i+1;
end
end
disp('The no. of stages required is ');
disp(i);
disp('The no. of trays required is ');
disp(i-1);

end
if q==1;
intx=xf;
inty=xf*R/(R+1)+xd/(R+1);
hold on;
ezplot('y=x',[0,1]);
x=linspace(0,1);
y=a*x./(1+x*(a-1));
plot(x,y);
k=linspace(intx,xd);
o=k.*R/(R+1)+xd/(R+1);
plot(k,o);
q1=linspace(xf,inty);
q2=xf;
plot(q2,q1,'k');
b=linspace(xw,intx);
j=b.*(inty-xw)/(intx-xw)-xw*(inty-xw)/(intx-xw)+xw;
plot(b,j);
grid on;
t=xd;t1=xd;p=xd;
i=0;
syms x y
while t>xw;
h=solve(y == a*x/(1+x*(a-1)), y == t1+0*x);
plot([h.x,t],[p,p],'m')
t=h.x;
if t>intx;
p=subs(R*x/(R+1)+xd/(R+1),h.x);
plot([h.x,h.x],[p,h.y],'m')
t1=p;
i=i+1;
end
if t<intx;
p=subs(x.*(inty-xw)/(intx-xw)-xw*(inty-xw)/(intx-xw)+xw,h.x);
plot([h.x,h.x],[p,h.y],'m')
t1=p;
i=i+1;
end
end
disp('The no. of stages required is ');

disp(i);
disp('The no. of trays required is ');
disp(i-1);
end
CODE FOR MINIMUM NUMBER OF TRAYS
hold on;
ezplot('y=x',[0,1]);
x=linspace(0,1);
y=a*x./(1+x.*(a-1));
plot(x,y);
g=0
while xd>xw;
x1=linspace(xd./(a-xd.*(a-1)),xd);
y1=xd;
plot(x1,y1,'m');
y2=linspace(xd./(a-xd.*(a-1)),xd);
x2=xd./(a-xd.*(a-1));
plot(x2,y2,'m')
xd=xd./(a-xd.*(a-1));
g=g+1;
end
disp('The minimum number of stages required is ');
disp(g);
hold off;

RESULT
Graph for minimum number of trays

Figure shows the graph for a given set of values f=100, xd=.9, liq=.8, xf=.6,
xw=.2, a=2.45, R=2
Graph for finding the number of trays

Figure shows the graph for a particular set of values with number of stages 10.

You might also like