T1 = 303 # [K]
P = 1 # [bar]
D = 0.6
W = 0.4
zf = 0.5
# Parameters for componenr 'A'
Tc_a = 540.3 # [K]
Pc_a = 27.4 # [bar]
A_a = -7.675
B_a = 1.371
C_a =-3.536
D_a = -3.202
# Parameters for component 'B'
Tc_b = 568.8 # [K]
Pc_b = 24.9 # [bar]
A_b = -7.912
B_b = 1.380
C_b = -3.804
D_b = -4.501
import math
from numpy import *
from scipy.optimize import fsolve
# Using equation 6.5
# x_a = 1-(T/Tc_a)
# P_a = Pc_a*math.exp((A_a*x_a+B_a*x_a**1.5+C_a*x_a**3+D_a*x_a**6)/(1-x_a)) # [bar]
# x_b = 1-(T/Tc_b)
# P_b = Pc_b*math.exp((A_b*x_b+B_b*x_b**1.5+C_b*x_b**3+D_b*x_b**6)/(1-x_b)) # [bar]
# m_a = P_a/P
# m_b = P_b/P
# Solution of simultaneous equation
def F(e):
f1 = e[1] - (e[2]*Pc_a*math.exp(((A_a*(1-(e[0]/Tc_a))+B_a*(1-(e[0]/Tc_a))**1.5+C_a*(1-(e[0]/Tc_a))**3+D_a*(1-(e[0]/Tc_a))**6))/(1-(1-(e[0]/Tc_a)))))/P
f2 = 1-e[1] - ((1-e[2])*Pc_b*math.exp((A_b*(1-(e[0]/Tc_b))+B_b*(1-(e[0]/Tc_b))**1.5+C_b*(1-(e[0]/Tc_b))**3+D_b*(1-(e[0]/Tc_b))**6)/(1-(1-(e[0]/Tc_b)))))/P
f3 = (-W/D) - ((e[1]-zf)/(e[2]-zf))
return(f1,f2,f3)
# Initial guess
e = [400,0.6,0.4]
y = fsolve(F,e)
T = y[0] # [K]
Yd = y[1]
Xw = y[2]
print"The composition of the vapor and liquid and the temperature in the separator if it behaves as an ideal stage are",round(Yd,3),round(Xw,3),"and",round(T,1),"K respectively\n\n"
# For the capculation of the amount of heat to be added per mole of feed
T0 = 298 # [K]
lambdaA = 36.5 # [Latent heats of vaporization at To = 298 K ,kJ/mole]
lambdaB = 41.4 # [Latent heats of vaporization at To = 298 K ,kJ/mole]
CpA = 0.187 # [kJ/mole.K]
CpB = 0.247 # [kJ/mole.K]
CLA1 = 0.218 # [ 298-303 K, kJ/mole.K]
CLB1 = 0.253 # [ 298-303 K, kJ/mole.K]
CLA2 = 0.241 # [ 298-386 K, kJ/mole.K]
CLB2 = 0.268 # [ 298-386 K, kJ/mole.K]
# Bubble point calculated when 'D' approaches 0 and Dew point calculated when 'D' approaches 1
Tbp = 382.2 # [Bubble point of the mixture, K]
Tdp = 387.9 # [Dew point of mixture, K]
HF = (T1-T0)*(Xw*CLA1+CLB1*(1-Xw)) # [kJ/mole]
HW = (Tbp-T0)*(Xw*CLA2+CLB2*(1-Xw)) # [kJ/mole]
HG = (Tdp-T0)*(Yd*CpA+(1-Yd)*CpB) + Yd*lambdaA +(1-Yd)*lambdaB # [kJ/mole]
f =1 # [feed]
# Using equation 6.4
def f14(Q):
return(W/D + (HG-(HF+Q/f))/(HW -(HF+Q/f)))
Q = fsolve(f14,40)
print"The amount of heat to be added per mole of feed is",round(Q[0],2),"kJ/mole"
# a-benzene b-toluene c-orthoxylene
T = 373 # [K]
P = 101.3 # [kPa]
Pa = 182.7 # [kPa]
Pb = 73.3 # [kPa]
Pc= 26.7 # [kPa]
Zfa = 0.5
Zfb = 0.25
Zfc = 0.25
import math
from numpy import *
from scipy.optimize import fsolve
# Therefore
ma = Pa/P
mb = Pb/P
mc = Pc/P
# Let Feed is 1 kmole
# Therefore D+W = 1
# Solution of simultaneous equation
def F(e):
f1 = e[0]+e[1]-1
f2 = e[1]/e[0] + (e[2]-Zfa)/(e[3]-Zfa)
f3 = e[2]-ma*e[3]
f4 = e[4]-mb*e[5]
f5 = 1-e[2]-e[4] -mc*(1-e[3]-e[5])
f6 = e[1]/e[0] + (e[4]-Zfb)/(e[5]-Zfb)
return(f1,f2,f3,f4,f5,f6)
# Initial guess
e = [0.326,0.674,0.719,0.408,0.198,0.272]
y = fsolve(F,e)
D = y[0]
W = y[1]
Yad = y[2]
Xaw = y[3]
Ybd = y[4]
Xbw = y[5]
Ycd = 1-Yad-Ybd
Xcw = 1-Xaw-Xbw
print"The amounts of liquid and vapor products are D=",round(D,3),"and W=",round(W,3),"respectively"
print"The vapor compositions of components A(Yad), B(Ybd) and C(Ycd) are",round(Yad,3),round(Ybd,3),round(Ycd,3),"respectively"
print"The liquid composition of components A(Xaw), B(Xbw) and C(Xcw) are",round(Xaw,3),round(Xbw,3),round(Xcw,3),"respectively\n\n"
#Variable declaration
# n-heptane - a n-octane - b
P = 1 # [bar]
# Basis:
F = 100 # [mole]
# Therefore
D = 60 # [mole]
W = 40 # [mole]
xf = 0.5
#Calculation
import math
from numpy import *
from pylab import *
y_star = [0.5,0.55,0.60,0.65,0.686,0.70,0.75]
x = [0.317,0.361,0.409,0.460,0.5,0.516,0.577]
#for i in range(1,7):
# f(i-1) = 1/(y_star(i-1)-x(i-1))
area = matrix([[0.317,5.464],[0.361,5.291],[0.409,5.236],[0.460,5.263],[0.5,5.376],[0.516,5.435],[0.577,7.78]])
# LHS of equation 6.11
a = math.log(F/W)
a1=plot(area[:,0],area[:,1],label='$area under curve$')
legend(loc='upper left')
xlabel("x")
ylabel("1/(y_satr-x)")
# When the area becomes equal to 0.916, integration is stopped this occurs at
xw = 0.33 # [mole fraction of heptane in residue]
yd =( F*xf-W*xw)/D # [mole fraction of heptane]
#Result
print"The composition of the composited distillate and the residue are ",round(yd,3),"and",round(xw,3),"respectively\n\n"
show(a1)
T = 298 # [K]
Fa = 200 # [feed, kmole/hr]
zf = 0.6
yd = 0.95
xd = yd
xw = 0.05
q = 0.5 # [Lf/F]
print"Illustration 6.4(a)"
# Solution (a)
import math
from scipy.optimize import fsolve
from numpy import *
# Solution of simultaneous equation
def F(e):
f1 = Fa - e[0]-e[1]
f2 = zf*Fa - yd*e[0] - xw*e[1]
return(f1,f2)
# Initial guess
e = [120,70]
y = fsolve(F,e)
D = y[0]
W = y[1]
print"Quantity of liquid and vapor products are ",round(D,1),"kmole/h and",round(W,1),"kmole/h respectively"
print"Illustration 6.4(b)"
# Solution(b)
# VLE data is generated in the same manner as generated in Example 6.1 by applying Raoult's law
# VLE_data = [T,x,y]
VLE_data = matrix([[379.4,0.1,0.21],[375.5,0.2,0.37],[371.7,0.3,0.51],[368.4,0.4,0.64],[365.1,0.5,0.71],[362.6,0.6,0.79],[359.8,0.7,0.86],[357.7,0.8,0.91],[355.3,0.9,0.96]])
# From figure 6.14
# The minimum number of equilibrium stages is stepped off between the equilibrium curve and the 45 degree Iine, starting from the top, giving
Nmin = 6.7
#Result
print"The minimum number of theoretical stages is",Nmin
print"Illustration 6.4(c)"
# Solution(c)
# Slope of q-line = Lf/F/(1-(Lf/F))
s = q/(1-q)
# For minimum reflux ratio
# From figure 6.12 y-intercept is
i = 0.457
# Therefore Rmin is
Rmin = xd/i -1
#result
print"The minimum reflux ratio is",round(Rmin,3),"mole reflux/mole distillate"
print"Illustration 6.4(d)"
# Solution(d)
R = 1.3*Rmin
# The y-intercept of the rectifying-section operating line is
ia = xd/(R+1)
# The operating line for the stripping section is drawn to pass through the point x = y = xw =0.05 on the 45" line and the point of intersection of the q-line # and the rectifying-section operating line.
# Therefore from figure 6.15
Nact = 13
# But it include boiler
Nact1 = Nact-1
print"The number of equilibrium stages for the reflux ratio specified is",Nact1
# For the optimal feed-stage location, the transition from one operating line to the other occurs at the first opportunity
# after passing the operating-line intersection
# Therefore from figure 6.15 shows that
print"The optimal location of the feed stage for the reflux ratio specified is sixth from the top"
print"Illustration 6.4(e)"
# Solution(e)
L = R*D # [kmole/h]
V = L+D # [kmole/h]
# From equation 6.27
Lst = L+q*Fa # [kmole/h]
# From equation 6.28
Vst = V+(q-1)*Fa # [kmole/h]
# For 50% vaporization of the feed ( zf = 0.60), from calculations similar to those illustrated in Example 6.1, the separator temperature and the equilibrium # compositions are
Tf = 365.5 # [K]
yf = 0.707
xf = 0.493
# Latent heat vaporisation data at temperature T = 298 K
lambdaA = 33.9 # [kJ/mole]
lambdaB = 38 # [kJ/mole]
# Heat capacities of liquids (298-366 K)
Cla = 0.147 # [kJ/mole.K]
Clb = 0.174 # [kJ/mole.K]
# Heat capacities of gases, average in the range 298 to 366 K
Cpa = 0.094 # [kJ/mole.K]
Cpb = 0.118 # [kJ/mole.K]
# Substituting in equation 6.6 gives
Hf = 0
Hlf = (Tf-T)*(xf*Cla+(1-xf)*Clb) # [kJ/mole of liquid feed]
# From equation 6.7
Hvf = (Tf-T)*(yf*Cpa+(1-yf)*Cpb) + yf*lambdaA + (1-yf)*lambdaB # [kJ/mole of vapor feed]
Lf = Fa*q # [kmole/h]
Vf = Fa*(1-q) # [kmole/h]
# From equation 6.3
Qf = (Hvf*Vf +Hlf*Lf-Fa*Hf)*1000.0/3600.0 # [kW]
Tlo = 354.3 # [Bubble point temperature, K]
T1 = 355.8 # [Dew point temperature, K]
y1 = 0.95 # [composition of saturated vapor at dew point]
x0 = 0.95 # [composition of saturated liquid at bubble point]
Hv1 = (T1-T)*(y1*Cpa+(1-y1)*Cpb) + y1*lambdaA + (1-y1)*lambdaB # [kJ/mole of vapor feed]
Hlo = (Tlo-T)*(x0*Cla+(1-x0)*Clb) # [kJ/mole of liquid feed]
# An energy balance around condenser
Qc = V*(Hv1-Hlo)*1000/3600 # [kW]
# A flash-vaporization calculation is done in which the fraction vaporized is known (53.8/75.4 = 0.714) and the concentration
# of the liquid residue is fixed at xw = 0.05
# The calculations yield
Tr = 381.6 # [K]
x12 = 0.093
y13 = 0.111
T12 = 379.7 # [Bubble point of the liquid entering in the reboiler, K]
Hl12 = (T12-T)*(x12*Cla+(1-x12)*Clb) # [kJ/mole of liquid feed]
Hv13 = (Tr-T)*(y13*Cpa+(1-y13)*Cpb) + y13*lambdaA + (1-y13)*lambdaB # [kJ/mole of vapor feed]
Hlw = (Tr-T)*(xw*Cla+(1-xw)*Clb) # [kJ/mole of liquid feed]
# An energy balance around the reboiler
Qr = (Vst*Hv13+W*Hlw-Lst*Hl12)*1000.0/3600.0 # [kW]
#Result
print"The thermal load of the condenser, reboiler, and feed preheater are",round(Qc),"kW",round(Qr),"kW","and", round(Qf),"kW respectively"
#Variable declaration
# a-benzene b-toluene
xa = 0.46
xb = 0.54
Tb = 395 # [bottom temp., K]
Tt = 360 # [top temp., K]
alphab = 2.26
alphat = 2.52
D = 1.53 # [diameter of column, m]
f = 0.81 # [flooding]
deltaP = 700 # [average gas-pressure drop, Pa/tray]
import math
Tavg = (Tb+Tt)/2 # [K]
alpha_avg = (alphab+alphat)/2
print "Solution6.7(a)"
# Solution(a)
# Constants for components 'a' and 'b'
Aa = 4.612
Ba = 148.9
Ca = -0.0254
Da = 2.222*10**-5
ua =math.exp(Aa+Ba/Tavg+Ca*Tavg+Da*Tavg**2) # [cP]
Ab = -5.878
Bb = 1287
Cb = 0.00458
Db = -0.450*10**-5
#Calculation
ub = math.exp(Ab+Bb/Tavg+Cb*Tavg+Db*Tavg**2) # [cP]
# At the average column temperature
ul = ua**xa*ub**xb # [cP]
K = alpha_avg*ul
# From the O’Connell correlation
Eo = 0.52782-0.27511*math.log10(K) + 0.044923*(math.log10(K))**2
#Result
print"The overall tray efficiency using the O’Connell correlation is ",round(Eo,1)
print "Example 6.7(b)"
# Solution(b)
#Calculation
Nideal = 20 # [number of ideal stages]
Nreal = Nideal/(Eo) # [nnumber of real stages]
print Nreal
# Since real stages cannot be fractional, therefore
Nreal = 34
# From Table 4.3 tray spacing
t = 0.6 # [m]
# Adding 1 m over the top tray as an entrainment separator and 3 m beneath # the bottom tray for bottoms surge capacity, the total column height is
Z = 4+Nreal*t # [m]
#Result
print"The number of real trays and the total tower height are",Nreal,"and",Z," m respectively"
print "Solution 6.7(c)"
# Solution(c)
# Total gas pressure drop
deltaPc = deltaP*Nreal/1000 # [kPa]
#Result
print"The total gas-pressure drop through the column is",deltaPc,"kPa"
import math
from numpy import *
#Variable declaration
# A-toluene B-1,2,3-trimethyl benzene C-benzene
# Solution of above three are ideal
# Feed
za = 0.40
zb = 0.30
zc = 0.30
# Bottom
FRAd = 0.95 # [recovery of toluene in distillate]
FRBw = 0.95 # [recovery of 1,2,3-trimethyl benzene in the bottom]
P = 1 # [atm]
# First estimate of distillate composition
xc = 40/70
xa = 30/70
xb = 0
# The bubble point temperature for this solution is
Tb = 390 # [K]
# The corresponding parameters for benzene, toluene and 1,2,3-trimethyl benzene
# For toluene
Tc_a = 568.8 # [K]
Pc_a = 24.9 # [bar]
A_a = -7.912
B_a = 1.380
C_a =-3.804
D_a = -4.501
# For 1,2,3-trimethyl benzene
Tc_b = 664.5 # [K]
Pc_b = 34.5 # [bar]
A_b = -8.442
B_b = 2.922
C_b =-5.667
D_b = -2.281
# For benzene
Tc_c = 540.3 # [K]
Pc_c = 27.4 # [bar]
A_c = -7.675
B_c = 1.371
C_c =-3.536
D_c = -3.202
# At the estimated reboiler temperature of 449.3 K
Tr = 449.3 # [K]
# P = [Toluene 1,2,3-trimethyl benzene Benzene]
# P = [Tc Pc A B C D]
P1=zeros((3,6))
P1= matrix([[568.8,24.9,-7.912,1.380,-3.804,-4.501],[664.5,34.5,-8.442,2.922,-5.667,2.281],[540.3,27.4,-7.675,1.371,-3.536,-3.202]])
for i in range(0,3):
P1[i]= P1[i,1]*math.exp((P1[i,2]*(1-Tr/P1[i,0])+P1[i,3]*(1-Tr/P1[i,0])**1.5+P1[i,4]*(1-Tr/P1[i,0])**3+P1[i,5]*(1-Tr/P1[i,0])**6)/(1-(1-Tr/P1[i,0])))
PA1 = P1.item(0) # [bar]
PB1 = P1.item(6) # [bar]
PC1 = P1.item(12) # [bar]
alphaAB1 = PA1/PB1
alphaCB1 = PC1/PB1
# At the estimated distillate temperature of 390 K
Td = 390 # [K]
# P = [Toluene 1,2,3-trimethyl benzene Benzene]
# P = [Tc,Pc,A,B,C,D]
P2 = zeros((3,6))
P2= matrix([[568.8,24.9,-7.912,1.380,-3.804,-4.501],[664.5,34.5,-8.442,2.922,-5.667,2.281],[540.3,27.4,-7.675,1.371,-3.536,-3.202]])
for i in range(0,3):
P2[i] = P2[i,1]*math.exp((P2[i,2]*(1-Td/P2[i,0])+P2[i,3]*(1-Td/P2[i,0])**1.5+P2[i,4]*(1-Td/P2[i,0])**3+P2[i,5]*(1-Td/P2[i,0])**6)/(1-(1-Td/P2[i,0])))
PA2 = P2.item(0) # [bar]
PB2 = P2.item(6) # [bar]
PC2 = P2.item(12) # [bar]
alphaAB2 = PA2/PB2
alphaCB2 = PC2/PB2
# The geometric-average relative volatilities are
alphaAB_avg = math.sqrt(alphaAB1*alphaAB2)
alphaCB_avg = math.sqrt(alphaCB1*alphaCB2)
# From equation 6.66
Nmin = math.log(FRAd*FRBw/((1-FRAd)*(1-FRBw)))/log(alphaAB_avg)
# From equation 6.67
FRCd = alphaCB_avg**Nmin/((FRBw/(1-FRBw))+alphaCB_avg**Nmin) # [fractional recovery of benzene in the distillate]
#Results
print"The number of equilibrium stages required at total reflux is",round(Nmin,2)
print"The recovery fraction of benzene in the distillate is ",round(FRCd,3)
print"\n\nThus, the assumption that virtually all of the LNK will be recovered in the distillate is justified"
#Variable declaration
# 1-toluene 2-1,2,3--trimethylbenzene 3-benzene
# Basis: 100 kmol/h of feed
F = 100 # [kmole/h]
# Since feed is saturated, therefore
q = 0
# From example 6.10
x1d = 0.3
x2d = 0.3
x3d = 0.4
a12 = 3.91
a32 = 7.77
a22 = 1
#Calculation
import math
from scipy.optimize import fsolve
# Equ 6.78 gives
def f14(Q):
return(1- a12*x1d/(a12-Q)-a22*x2d/(a22-Q)-a32*x3d/(a32-Q))
Q = fsolve(f14,2)
# From the problem statement
# d1 = D*x1d d2 = D*x2d
d1 = F*x1d*0.95 # [kmol/h]
d2 = F*x2d*0.05 # [kmol/h]
d3 = F*x3d*0.997 # [kmol/h]
# Summing the three distillate, d1,d2 and d3
D = d1+d2+d3 # [kmole/h]
Vmin = a12*d1/(a12-Q)+a22*d2/(a22-Q)+a32*d3/(a32-Q)
# From the mass balance
Lmin = Vmin-D # [kmol/h]
# Minimum reflux ratio
Rmin = Lmin/D
#Results
print"The minimum reflux ratio is ",round(Rmin[0],3)
# x-mole fraction a-relative volatility
xA = 0.25
aA = 4.08
xB = 0.11
aB = 1.00
xC = 0.26
aC = 39.47
xD = 0.09
aD = 10.00
xE = 0.17
aE = 2.11
xF = 0.12
aF = 0.50
FRlkd = 0.98
FRhkd = 0.01
import math
from scipy.optimize import fsolve
from numpy import *
# For methane
D_CR = (aC-1)/(aA-1)*FRlkd + (aA-aC)/(aA-1)*FRhkd
# For ethane
D_DR = (aD-1)/(aA-1)*FRlkd + (aA-aD)/(aA-1)*FRhkd
# For butane
D_ER = (aE-1)/(aA-1)*FRlkd + (aA-aE)/(aA-1)*FRhkd
# For hexane
D_FR = (aF-1)/(aA-1)*FRlkd + (aA-aF)/(aA-1)*FRhkd
# Since the feed is 66% vaporized
q = 1-0.66
# Now equation 6.82 is solved for two values of Q
def f14(Q1):
return(0.66 - aA*xA/(aA-Q1)-aB*xB/(aB-Q1)-aC*xC/(aC-Q1)-aD*xD/(aD-Q1)-aE*xE/(aE-Q1)-aF*xF/(aF-Q1))
Q1 = fsolve(f14,1.2)
def f15(Q2):
return(0.66 - aA*xA/(aA-Q2)-aB*xB/(aB-Q2)-aC*xC/(aC-Q2)-aD*xD/(aD-Q2)-aE*xE/(aE-Q2)-aF*xF/(aF-Q2))
Q2 = fsolve(f15,2.5)
# Basis: 100 mole of feed
F = 100 # [mole]
# Let d1 = Dxad, d2 = Dxbd, d3 = Dxcd, and so on
d1 = F*xA*FRlkd # [moles of propane]
d2 = F*xB*FRhkd # [moles of pentane]
d3 = F*xC # [moles of methane]
d4 = F*xD # [moles of ethane]
d6 = F*xF*0 # [moles of hexane]
# And d5 is unknown
# Applying equation 6,78 for each value of Q
# Solution of simultaneous equation
#Vmin=aA*d1/(aA-Q1)+aB*d2/(aB-Q1)+aC*d3/(aC-Q1)+aD*d4/(aD-Q1)+aE*d5/(aE-Q1)+aF*d6/(aF-Q1)
#Vmin=aA*d1/(aA-Q2)+aB*d2/(aB-Q2)+aC*d3/(aC-Q2)+aD*d4/(aD-Q2)+aE*d5/(aE-Q2)+aF*d6/(aF-Q2)
# we get
d5=-(72.243-121.614)/(2.494+2.863)
Vmin=72.243 + 2.494*D5
# From equ 6.84
D = d1+d2+d3+d4+d5+d6 # [mole]
# From mass balance
Lmin = Vmin-D # [mole]
# For minimum reflux ratio
Rmin = Lmin/D
print"The minimum reflux ratio is",round(Rmin,3)
import math
from scipy.optimize import fsolve
from numpy import *
#Variable declaration
# A-benzene B-toluene C-1,2,3-trimethylbenzene
# From example 6.10
Nmin = 4.32 # [stages]
# From example 6.11
Rmin = 0.717 # [minimum reflux ratio]
# For R = 1
R = 1
X = (R-Rmin)/(R+1)
# From equ 6.88
Y = 1-math.exp((1+54.4*X)/(11+117.2*X)*(X-1)/math.sqrt(X))
# Fro equ 6.86
N = (Y+Nmin)/(1-Y)
# From example 6.10 99.7% of the LNK (benzene) is recovered in the distillate# , 95% of the light key is in the distillate, and 95% of the heavy key is in# the bottoms
# For a basis of 100 mol of feed, the material balances for three components # are
# For distillate
nAd = 39.88 # [LNK, moles of benzene]
nBd = 28.5 # [LK, moles of toluene]
nCd = 1.50 # [HK, moles of 1,2,3-trimethylbenzene]
nTd = nAd+nBd+nCd # [total number of moles]
xAd = nAd/nTd
xBd = nBd/(nTd)
xCd = nCd/(nTd)
# For bottoms
nAb = 0.12
nBb = 1.50
nCb = 28.50
nTb = nAb+nBb+nCb
xAb = nAb/nTb
xBb = nBb/nTb
xCb = nCb/nTb
D = nTd
W = nTb
# From problem statement
Zlk = 0.3
Zhk = Zlk
# Substituting in equation 6.89
# T = Nr/Ns
T = (Zhk/Zlk*W/D*(xBb/xCd)**2)**0.206
# Solution of simultaneous equation
def H(e):
f1 = e[0]-e[1]*T
f2 = e[0]+e[1]-N
return(f1,f2)
# Initial guess
e = [5,4]
y = fsolve(H,e)
Nr = y[0] # [number of stages in rectifying section]
Ns = y[1] # [number of stages in stripping section]
#Result
print "Nr=",round(Nr,2),"Ns=",round(Ns,2),"\n"
print"Rounding the estimated equilibrium stage requirement leads to 1 stage as a partial reboiler, 4 stages below the feed, and 5 stages above the feed"
#Variable declaration
# a-acetone b-methanol c-water
yna = 0.2971
yn1a = 0.17
ynIa = 0.3521
mnIa = 2.759
xna = 0.1459
ynb = 0.4631
yn1b = 0.429
ynIb = 0.4677
mnIb = 1.225
xnb = 0.3865
ync = 0.2398
yn1c = 0.4010
ynIc = 0.1802
mnIc = 0.3673
xnc = 0.4676
Fabv = 4.927 # [mol/square m.s]
Facv = 6.066 # [mol/square m.s]
Fbcv = 7.048 # [mol/square m.s]
aI = 50 # [square m]
Vn1 = 188 # [mol/s]
Vn = 194.8 # [mol/s]
print "Solution6.14(a)"
from numpy import *
import math
# Solution(a)
ya = (yna+ynIa)/2
yb = (ynb+ynIb)/2
yc = (ync+ynIc)/2
Rav = ya/Facv+yb/Fabv+yc/Facv
Rbv = yb/Fbcv+ya/Fabv+yc/Fbcv
Rabv = -ya*(1/Fabv-1/Facv)
Rbav = -yb*(1/Fabv-1/Fbcv)
# Thus in matrix form
Rv =matrix([[Rav,Rabv],[Rbav,Rbv]])
kv = Rv.I # [inverse of Rv]
# From equ 6.99
b =matrix([[yna-ynIa],[ynb-ynIb]])
J = kv*b
# From equ 6.98
Jc = -sum(J) # [mol/square m.s]
print"The molar diffusional rates of acetone, methanol and water are",round(J[0][0],4),"mol/square m.s",round(J[1][0],4),"mol/square m.s and",round(Jc,3) ,"mol/square m.s respectively"
print "Solution 6.14(b)\n"
# Solution(b)
Ntv = Vn1-Vn # [mol/s]
# From equation 6.94
Nta = aI*J[0][0]+ya*Ntv
Ntb = aI*J[1][0]+yb*Ntv
Ntc = aI*Jc+yc*Ntv
print"The mass transfer rates of acetone, methanol and water are",round(Nta,1),"mol/s" ,round(Ntb,1)," mol/s and", round(Ntc)," mol/s respectively"
print "Example6.14(c)\n"
# Solution(c)
# Approximate values of Murphree vapor tray efficiency are obtained from # equation 6.105
EMG_a = (yna-yn1a)/(mnIa*xna-yn1a)
EMG_b = (ynb-yn1b)/(mnIb*xnb-yn1b)
EMG_c = (ync-yn1c)/(mnIc*xnc-yn1c)
print"The Murphree vapor tray efficiencies for acetone, methanol and water are",round(EMG_a,3), round(EMG_b,3),"and",round(EMG_c,3), "respectively"