0% found this document useful (0 votes)
3 views1 page

Vapor Pressure and Mass Balance Calculation

The document contains MATLAB code to calculate vapor-liquid equilibrium for a three-component mixture using the Newton-Raphson method. It loads saturated vapor pressure data for the components, calculates vapor pressures. It then iterates to determine the vapor phase composition using Newton-Raphson. Finally, it calculates liquid and vapor phase compositions and flow rates using a material balance.

Uploaded by

giuliana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Vapor Pressure and Mass Balance Calculation

The document contains MATLAB code to calculate vapor-liquid equilibrium for a three-component mixture using the Newton-Raphson method. It loads saturated vapor pressure data for the components, calculates vapor pressures. It then iterates to determine the vapor phase composition using Newton-Raphson. Finally, it calculates liquid and vapor phase compositions and flow rates using a material balance.

Uploaded by

giuliana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

clc

clear
load ('[Link]')
load ('[Link]')
F=100
sub(1)= "C4H10"
sub (2)= "C5H12"
sub(3)= "C6H14"
P=900
T=40
Z(1)= 0.25
Z(2)= 0.35
Z(3)= 0.40
Dx= 0.001
X(1)= 0.5
//MODULO PARA CÁLCULO DE PRESSÃO DE VAPOR
for j=1:3
for i=1:275
if s(i)==sub (j)
A= c(i,1)/1000
B= c(i,2)/1000
C= c(i,3)/1000
end
end
Pv(i)=10^(A-B/(T+C))
Pv(j)=Pv(i)
end
disp (Pv(1))
disp (Pv(2))
disp (Pv(3))
// MODULO PARA CÁLCULO DE K(i)
for j=1:3
K(j)= (Pv(j)/P)
end
disp (K(1))
disp (K(2))
disp (K(3))
//MODULO PARA DEN (i)
for j=1:3
DEN(j)= (K(j)-1)
end
disp (DEN(1))
disp (DEN(2))
disp (DEN(3))
//MODULO PARA DEN(i)
for j=1:3
NUM(j)= Z(j)*(DEN(j))
end
disp (NUM(1))
disp (NUM(2))
disp (NUM(3))
// MODULO PARA NEWTON RAPHSON
for i=1:5
f=NUM(1)/(DEN(1)*x(i)+1)+NUM(2)/(DEN(2)*x(i)+1)+ NUM(3)/(DEN(3)*x(i)+1)
fd=NUM(1)/(DEN(1)*(x(i)+dx)+1) +NUM(2)/(DEN(2)*(x(i)+dx)+1)+NUM(3)/(DEN(3)*(x(i)+dx)+1)
fl=(fd-f)/dx
x(i+1)=x(i)-(f/fl)
end
xao=x(5)
disp(x(5))
//Modulo Balanco de massa
V=xao*F
L=F-V
for j=1:3
xl(j)=Z(j)/(x(5)*(K(j)-1)+1)
nl(j)=L*xl(j)
yv(j)=xl(j)*K(j)
nv(j)=V*yv(j)
end
disp (xl(1))
disp (xl(2))
disp (xl(3))
disp (nl(1))
disp (nl(2))
disp (nl(3))
disp (yv(1))
disp (yv(2))
disp (yv(3))
disp (nv(1))
disp (nv(2))
disp (nv(3))

You might also like