diff options
Diffstat (limited to '611/CH11')
-rwxr-xr-x | 611/CH11/EX11.1/Chap11_Ex1.sce | 98 | ||||
-rwxr-xr-x | 611/CH11/EX11.1/Pxy_plot.jpg | bin | 0 -> 55619 bytes | |||
-rwxr-xr-x | 611/CH11/EX11.1/Txy_plot.jpg | bin | 0 -> 57970 bytes | |||
-rwxr-xr-x | 611/CH11/EX11.10/Chap11_Ex10.sce | 60 | ||||
-rwxr-xr-x | 611/CH11/EX11.11/Chap11_Ex11.sce | 91 | ||||
-rwxr-xr-x | 611/CH11/EX11.2/Chap11_Ex2.sce | 25 | ||||
-rwxr-xr-x | 611/CH11/EX11.3/Chap11_Ex3_R1.sce | 34 | ||||
-rwxr-xr-x | 611/CH11/EX11.4/Chap11_Ex4_R1.sce | 34 | ||||
-rwxr-xr-x | 611/CH11/EX11.5/Chap11_Ex5.sce | 54 | ||||
-rwxr-xr-x | 611/CH11/EX11.7/Chap11_Ex7.sce | 26 | ||||
-rwxr-xr-x | 611/CH11/EX11.8/Chap11_Ex8.sce | 38 | ||||
-rwxr-xr-x | 611/CH11/EX11.9/Chap11_Ex9.sce | 29 |
12 files changed, 489 insertions, 0 deletions
diff --git a/611/CH11/EX11.1/Chap11_Ex1.sce b/611/CH11/EX11.1/Chap11_Ex1.sce new file mode 100755 index 000000000..642fa7d41 --- /dev/null +++ b/611/CH11/EX11.1/Chap11_Ex1.sce @@ -0,0 +1,98 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 1,Page 378
+//Title:P-x-y and T-x-y diagram for a Benzene Toluene system
+//================================================================================================================
+clear
+clc
+
+//INPUT
+antoine_const_benzene=[6.87987;1196.760;219.161];//Antoine's constants for Benzene from Table A.7
+antoine_const_toluene=[6.95087;1342.310;219.187];//Antoine's constants for Toluene from Table A.7
+t=95;//temperature at which the P-x-y diagram has to be prepared in degree celsius
+P=101.325;//pressure at which the T-x-y diagram has to be prepared in kPa
+
+//CALCULATION
+//P-x-y diagram:
+//For convenience Benzene is denoted as 1 and Toluene as 2
+//The form of the Antoine's equation used is logP=A-(B/(t+C)), where P is in Torr and t is in degree celsius
+
+P1_s=10^(antoine_const_benzene(1,:)-(antoine_const_benzene(2,:)/(t+antoine_const_benzene(3,:))));//calculation of saturation pressure of benzene at t in Torr
+P2_s=10^(antoine_const_toluene(1,:)-(antoine_const_toluene(2,:)/(t+antoine_const_toluene(3,:))));//calculation of saturation pressure of toluene at t in Torr
+x1=0:0.1:1;//mole fraction of benzene in the liquid phase (no unit)
+i=1;//iteration parameter
+n=length(x1);//iteration parameter
+while i<n |i==n
+ P_tot(i)=P2_s+((P1_s-P2_s)*x1(:,i));//calculation of the total pressure using Eq.B, Page 379 in Torr
+ y1(i)=(x1(:,i)*P1_s)/(P_tot(i));//calculation of the mole fraction of Benzene in the vapour phase (no unit)
+ i=i+1;
+end
+
+//T-x-y diagram:
+P=760;//converting pressure from kPa to Torr. 760 Torr=101.325 kPa
+//calculation of the saturation temperature of benzene at P in degree celsius
+t1_s=((antoine_const_benzene(2,:))/(antoine_const_benzene(1,:)-log10(P)))-antoine_const_benzene(3,:);
+//calculation of the saturation temperature of toluene at P in degree celsius
+t2_s=((antoine_const_toluene(2,:))/(antoine_const_toluene(1,:)-log10(P)))-antoine_const_toluene(3,:);
+//calculation of the saturation vapour pressures of Benzene (P1s) and Toluene (P2s)
+//At T=t1_s, P=P1s=760.0 Torr, and at T=t2_s, P=P2s=760.0 Torr.
+//X1 is given by X1=(P-P2s)/(P1s-P2s). Therefore at T=t1_s, X1=1.0 and at T=t2_s, X1=0.0
+//As Y1=X1*P1s/P, Y1=1.0, when X1=1.0 and Y1=0.0,when X1=0.0.Therefore x1_initial=y1_initial=0.0(corresponding to t=t2_s) and x1_final=y1_final=1.0(corresponding to t=t1_s) where X1,x1_initial,x1_final are the mole fractions of benzene in the liquid phase (no unit) and Y1,y1_initial,y1_final are the mole fractions of benzene in the vapour phase (no unit).
+x1_initial=0.0;
+y1_initial=0.0;
+x1_final=1.0;
+y1_final=1.0;
+// An intermediate temperature is chosen such that t1_s<T<t2_s, and at different temperatures upto t2_s, the values of P1s, P2s, X1 and X1 are found out
+T=85:5:105;//temepertaures at which P1s, P2s, X1 and Y1 are to be determined in degree celsius. The initial T is taken as 85 degree celsius, such that t1_s<T<t2_s
+k=1;
+l=length(T);
+while k<l|k==l
+P1s(k)=10^((antoine_const_benzene(1,:))-((antoine_const_benzene(2,:))/(T(:,k)+antoine_const_benzene(3,:))));//calculation of saturation pressure of benzene in Torr
+P2s(k)=10^((antoine_const_toluene(1,:))-((antoine_const_toluene(2,:))/(T(:,k)+antoine_const_toluene(3,:))));//caclculation of saturation pressure of toluene in Torr
+ X1(k)=(P-P2s(k))/(P1s(k)-P2s(k));//calculation of mole fraction of Benzene in liquid phase (no unit)
+ Y1(k)=(X1(k)*P1s(k))/P;//calculation of mole fraction of Benzene in vapour phase (no unit)
+ k=k+1;
+end
+//Generating the T-x-y data
+ j=1;
+ while j<l+2|j==l+2
+ if j==1 then
+ temp(j)=t1_s;
+ x1_benzene(j)=x1_final;
+ y1_benzene(j)=y1_final;
+ else if j==l+2 then
+ temp(j)=t2_s;
+ x1_benzene(j)=x1_initial;
+ y1_benzene(j)=y1_initial;
+ else
+ temp(j)=T(j-1);
+ x1_benzene(j)=X1(j-1);
+ y1_benzene(j)=Y1(j-1);
+ end
+ end
+ j=j+1;
+ end
+
+//OUTPUT
+mprintf('P-x-y results \n');
+i=1;
+for i = 1 : n
+ mprintf('x1=%f \t y1=%f\t P=%f Torr \n\n',x1(i),y1(i),P_tot(i));
+ end
+ mprintf('T-x-y results \n t=%f degree celsius\t P1_s=760.0 Torr \t P2_s=(-) Torr \t\t x1=1.0 \t y1=1.0 \n\n',t1_s);
+ k=1;
+ for k= 1:l
+ mprintf('t=%f degree celsius\t P1_s=%f Torr \t P2_s=%f Torr \t x1=%f \t y1=%f \n\n',T(k),P1s(k),P2s(k),X1(k),Y1(k));
+ end
+ mprintf('t=%f degree celsius\t P1_s=(-)Torr \t\t P2_s=760.0 Torr \t x1=0.0 \t y1=0.0 \n',t2_s);
+ f1=scf(1);
+ scf(f1);
+plot(x1,P_tot,y1,P_tot);//generating the P-x-y plot
+ xtitle('P-x-y diagram for benzene-toluene system at 95 degree celsius','x1,y1','P(Torr)');
+ f2=scf(2);
+ scf(f2);
+ plot(x1_benzene,temp,y1_benzene,temp);//generating the T-x-y plot
+ xtitle('T-x-y diagram for benzene-toluene sytem at 760 Torr','x1,y1','t (degree celsius)');
+
+//===============================================END OF PROGRAM===================================================
+
diff --git a/611/CH11/EX11.1/Pxy_plot.jpg b/611/CH11/EX11.1/Pxy_plot.jpg Binary files differnew file mode 100755 index 000000000..6396983fe --- /dev/null +++ b/611/CH11/EX11.1/Pxy_plot.jpg diff --git a/611/CH11/EX11.1/Txy_plot.jpg b/611/CH11/EX11.1/Txy_plot.jpg Binary files differnew file mode 100755 index 000000000..6c1274e94 --- /dev/null +++ b/611/CH11/EX11.1/Txy_plot.jpg diff --git a/611/CH11/EX11.10/Chap11_Ex10.sce b/611/CH11/EX11.10/Chap11_Ex10.sce new file mode 100755 index 000000000..55e580184 --- /dev/null +++ b/611/CH11/EX11.10/Chap11_Ex10.sce @@ -0,0 +1,60 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 10,Page 401
+//Title: Activity coefficients using the UNIQUAC equation
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, ethanol is taken as 1 and benzene as 2
+T=345;//temperature of the mixture in K
+x1=0.8;//mole fraction of ethanol in the liquid phase (no unit)
+
+//Ethanol (CH3CH2OH) has 1 CH3 group, 1 CH2 group and 1 OH group, while Benzene has 6 ACH groups. The group identification and the parameters R_k and Q_k are given below:
+//Molecule: Ethanol : Group identification: Name: CH3, Main No. 1, Sec.No.1, Name: CH2, Main No. 1,Sec.No.2, Name: OH, Main No.5 ,Sec.No.14
+//Molecule: Benzene : Group identification: Name: ACH, Main No. 3, Sec.No. 9
+nu_ki=[1;1;1;6];//number of groups of type: CH3, CH2, OH and ACH respectively (no unit)
+R_k=[0.9011;0.6744;1.0000;0.5313];//Group volume parameter for CH3, CH2, OH and ACH respectively (no unit)
+Q_k=[0.848;0.540;1.200;0.400];//Area parameter for CH3, CH2, OH and ACH respectively (no unit)
+R=8.314;//universal gas constant in J/molK
+u12_u22=-241.2287;//UNIQUAC parameter for the system in J/molK
+u21_u11=2799.5827;//UNIQUAC parameter for the system in J/molK
+z=10;//co-ordination number usually taken as 10 (no unit)
+
+//CALCULATION
+x2=1-x1;//calculation of mole fraction of benzene in liquid phase (no unit)
+r1=(nu_ki(1,:)*R_k(1,:))+(nu_ki(2,:)*R_k(2,:))+(nu_ki(3,:)*R_k(3,:));//calculation of volume parameter using Eq.(11.108) (no unit)
+r2=(nu_ki(4,:)*R_k(4,:));//calculation of volume parameter using Eq.(11.108) (no unit)
+phi1=(x1*r1)/((x1*r1)+(x2*r2));//calculation of volume fraction of component using Eq.(11.101) (no unit)
+phi2=(x2*r2)/((x2*r2)+(x1*r1));//calculation of volume fraction of component using Eq.(11.101) (no unit)
+q1=(nu_ki(1,:)*Q_k(1,:))+(nu_ki(2,:)*Q_k(2,:))+(nu_ki(3,:)*Q_k(3,:))//calculation of surface area parameter using Eq.(11.109) (no unit)
+q2=(nu_ki(4,:)*Q_k(4,:))//calculation of surface area parameter using Eq.(11.109) (no unit)
+theta1=(x1*q1)/((x1*q1)+(x2*q2));//calculation of area fraction of component using Eq.(11.102) (no unit)
+theta2=(x2*q2)/((x1*q1)+(x2*q2));//calculation of area fraction of component using Eq.(11.102) (no unit)
+l1=((z/2)*(r1-q1))-(r1-1);//calculation of l_i using Eq.(11.107) (no unit)
+l2=((z/2)*(r2-q2))-(r2-1);//calculation of l_i using Eq.(11.107) (no unit)
+tau_12=exp(-(u12_u22)/(R*T));//calculation of the adjustable parameter using Eq.(11.103) (no unit)
+tau_21=exp(-(u21_u11)/(R*T));//calculation of the adjustable parameter using Eq.(11.103) (no unit)
+tau_11=1.0;//by convention taken as 1.0
+tau_22=1.0;//by convention taken as 1.0
+//calculation of the combinatorial part of the activity coefficient using Eq.(11.105) (no unit)
+ln_gaamma1_c=log(phi1/x1)+((z/2)*q1*log(theta1/phi1))+l1-((phi1/x1)*((x1*l1)+(x2*l2)));
+//calculation of the combinatorial part of the activity coefficient using Eq.(11.105) (no unit)
+ln_gaamma2_c=log(phi2/x2)+((z/2)*q2*log(theta2/phi2))+l2-((phi2/x2)*((x1*l1)+(x2*l2)));
+//calculation of the residual part of the activity coefficient using Eq.(11.106) (no unit)
+ln_gaamma1_r=q1*(1-log((theta1*tau_11)+(theta2*tau_21))-(((theta1*tau_11)/((theta1*tau_11)+(theta2*tau_21)))+((theta2*tau_12)/((theta1*tau_12)+(theta2*tau_22)))));
+//calculation of the residual part of the activity coefficient using Eq.(11.106) (no unit)
+ln_gaamma2_r=q2*(1-log((theta1*tau_12)+(theta2*tau_22))-(((theta1*tau_21)/((theta1*tau_11)+(theta2*tau_21)))+((theta2*tau_22)/((theta1*tau_12)+(theta2*tau_22)))));
+ln_gaamma1=ln_gaamma1_c+ln_gaamma1_r;//calculation of the ln(activity coefficient) using Eq.(11.104) (no unit)
+ln_gaamma2=ln_gaamma2_c+ln_gaamma2_r;//calculation of the ln(activity coefficient) using Eq.(11.104) (no unit)
+gaamma1=exp(ln_gaamma1);//calculation of the activity coefficient (no unit)
+gaamma2=exp(ln_gaamma2);//calculation of the activity coefficient (no unit)
+
+//OUTPUT
+
+mprintf('The activity coefficients for the system using the UNIQUAC equation are : gamma1=%f \t gamma2=%f \t\n ', gaamma1,gaamma2);
+
+//===============================================END OF PROGRAM===================================================
+
+
diff --git a/611/CH11/EX11.11/Chap11_Ex11.sce b/611/CH11/EX11.11/Chap11_Ex11.sce new file mode 100755 index 000000000..8a8b2f22f --- /dev/null +++ b/611/CH11/EX11.11/Chap11_Ex11.sce @@ -0,0 +1,91 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 11,Page 405
+//Title: Activity coefficients using the UNIFAC method
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, acetone is taken as 1 and n-pentane as 2
+T=307;//temperature of the mixture in K
+x1=0.3;//mole fraction of acetone in the liquid phase (no unit)
+
+//Acetone (CH3COCH3) has 1 CH3 group and 1 CH3CO group, while n-Pentane (C5H12) has 2 CH3 groups and 3 CH2 groups.
+//The group identification and the parameters R_k and Q_k are given below:
+//Componenet: Acetone : Group identification: Name: CH3, Main No. 1, Sec.No. 1, Name: CH3CO, Main No. 9, Sec.No. 18
+//Component: n-Pentane : Group identification: Name: CH3, Main No. 1, Sec.No. 1, Name: CH2, Main No. 1, Sec.No. 2
+nu_ki=[1;1;2;3];//no.of groups of type : CH3, CH3CO, CH3, CH2 respectively in the two components making up the systen (no unit)
+R_k=[0.9011;1.6724;0.6744];//Group volume parameter for CH3, CH3CO and CH2 respectively (no unit)
+Q_k=[0.848;1.488;0.540];//Area parameter for CH3, CH3CO and CH2 respectively (no unit)
+a_19=476.40;//group interaction parameter for the system in K
+a_91=26.760;//group interaction parameter for the system in K
+z=10;//co-ordination number usually taken as 10 (no unit)
+
+//CALCULATION
+x2=1-x1;//calculation of mole fraction of benzene in liquid phase (no unit)
+r1=(nu_ki(1,:)*R_k(1,:))+(nu_ki(2,:)*R_k(2,:));//calculation of volume parameter using Eq.(11.108) (no unit)
+r2=(nu_ki(3,:)*R_k(1,:))+(nu_ki(4,:)*R_k(3,:));//calculation of volume parameter using Eq.(11.108) (no unit)
+phi1=(x1*r1)/((x1*r1)+(x2*r2));//calculation of volume fraction of component using Eq.(11.101) (no unit)
+phi2=(x2*r2)/((x2*r2)+(x1*r1));//calculation of volume fraction of component using Eq.(11.101) (no unit)
+q1=(nu_ki(1,:)*Q_k(1,:))+(nu_ki(2,:)*Q_k(2,:))//calculation of surface area parameter using Eq.(11.109) (no unit)
+q2=(nu_ki(3,:)*Q_k(1,:))+(nu_ki(4,:)*Q_k(3,:))//calculation of surface area parameter using Eq.(11.109) (no unit)
+theta1=(x1*q1)/((x1*q1)+(x2*q2));//calculation of area fraction of component using Eq.(11.102) (no unit)
+theta2=(x2*q2)/((x1*q1)+(x2*q2));//calculation of area fraction of component using Eq.(11.102) (no unit)
+l1=((z/2)*(r1-q1))-(r1-1);//calculation of l_i using Eq.(11.107) (no unit)
+l2=((z/2)*(r2-q2))-(r2-1);//calculation of l_i using Eq.(11.107) (no unit)
+//calculation of the combinatorial part of the activity coefficient using Eq.(11.105) (no unit)
+ln_gaamma1_c=log(phi1/x1)+((z/2)*q1*log(theta1/phi1))+l1-((phi1/x1)*((x1*l1)+(x2*l2)));
+//calculation of the combinatorial part of the activity coefficient using Eq.(11.105) (no unit)
+ln_gaamma2_c=log(phi2/x2)+((z/2)*q2*log(theta2/phi2))+l2-((phi2/x2)*((x1*l1)+(x2*l2)));
+a_11=0;//by convention taken as 0.0,in K
+a_99=0;//by convention taken as 0.0,in K
+psi_19=exp(-(a_19)/(T));//calculation of psi_mn using Eq.(11.119) (no unit)
+psi_91=exp(-(a_91)/(T));//calculation of psi_mn using Eq.(11.119) (no unit)
+psi_11=1;//as a_11=0, psi_11=1 (no unit)
+psi_99=1;//as a_99=0, psi_99=1 (no unit)
+//calculation of the residual activity coefficient(tau_k) of group k, in a reference solution containing molecules of type i
+x1_1=nu_ki(1,:)/(nu_ki(1,:)+nu_ki(2,:));//calculation of mole fraction of CH3 group (pure acetone(1)) (no unit)
+x1_18=nu_ki(2,:)/(nu_ki(1,:)+nu_ki(2,:));//calculation of mole fraction of CH3CO group (pure acetone(1)) (no unit)
+theta1_1=(Q_k(1,:)*x1_1)/((Q_k(1,:)*x1_1)+(Q_k(2,:)*x1_18));//calculation of surface area fraction of CH3 group (pure acetone) using Eq.(11.118) (no unit)
+theta1_18=(Q_k(2,:)*x1_18)/((Q_k(2,:)*x1_18)+(Q_k(1,:)*x1_1));//calculation of surface area fraction of CH3CO group (pure acetone) using Eq.(11.118) (no unit)
+//calculation of the residual activity coefficient(tau_k(i))of CH3 group,in a reference solution of (pure acetone) using Eq.(11.117)(no unit)
+ln_tau1_1=Q_k(1,:)*(1-log((theta1_1*psi_11)+(theta1_18*psi_91))-(((theta1_1*psi_11)/((theta1_1*psi_11)+(theta1_18*psi_91)))+((theta1_18*psi_19)/((theta1_1*psi_19)+(theta1_18*psi_11)))));
+//calculation of the residual activity coefficient(tau_k(i))of CH3CO group,in a reference solution of (pure acetone) using (Eq.11.117)(no unit)
+ln_tau1_18=Q_k(2,:)*(1-log((theta1_1*psi_19)+(theta1_18*psi_99))-(((theta1_1*psi_91)/((theta1_1*psi_99)+(theta1_18*psi_91)))+((theta1_18*psi_99)/((theta1_1*psi_19)+(theta1_18*psi_99)))));
+x2_1=nu_ki(3,:)/(nu_ki(3,:)+nu_ki(4,:));//calculation of mole fraction of CH3 group (pure n-pentane(2)) (no unit)
+x2_2=nu_ki(4,:)/(nu_ki(3,:)+nu_ki(4,:));//calculation of mole fraction of CH2 group (pure n-pentane(2)) (no unit)
+//As n-pentane contains only one main group (1)
+ln_tau2_1=0;
+ln_tau2_2=0;
+//calculation of group residual activity coefficients for the given mole fraction of acetone in liquid phase (x1)(no unit)
+//calculation of group mole fraction for CH3 group in Acetone and n-pentane using Eq.(11.115)(no unit)
+x_1=((x1*nu_ki(1,:))+(x2*nu_ki(3,:)))/((((x1*nu_ki(1,:))+(x1*nu_ki(2,:))))+((x2*nu_ki(3,:))+(x2*nu_ki(4,:))));
+//calculation of group mole fraction for CH2 group in n-Pentane using Eq.(11.115)(no unit)
+x_2=((x2*nu_ki(4,:)))/((((x1*nu_ki(1,:))+(x1*nu_ki(2,:))))+((x2*nu_ki(3,:))+(x2*nu_ki(4,:))));
+//calculation of group mole fraction for CH3CO group in Acetone using Eq.(11.115)(no unit)
+x_18=((x1*nu_ki(2,:)))/((((x1*nu_ki(1,:))+(x1*nu_ki(2,:))))+((x2*nu_ki(3,:))+(x2*nu_ki(4,:))));
+theta_1=(Q_k(1,:)*x_1)/((Q_k(1,:)*x_1)+(Q_k(2,:)*x_18)+(Q_k(3,:)*x_2));//calculation of surface area fraction of CH3 group (using Eq.11.118)(no unit)
+theta_2=(Q_k(3,:)*x_2)/((Q_k(1,:)*x_1)+(Q_k(2,:)*x_18)+(Q_k(3,:)*x_2));//calculation of surface area fraction of CH2 group (using Eq.11.118)(no unit)
+theta_18=(Q_k(2,:)*x_18)/((Q_k(1,:)*x_1)+(Q_k(2,:)*x_18)+(Q_k(3,:)*x_2));//calculation of surface area fraction of CH3CO group (using Eq.11.118)(no unit)
+//calculation of group residual activity coefficient of CH3 using Eq.(11.117)(no unit)
+ln_tau_1=Q_k(1,:)*(1-log((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91))-((((theta_1*psi_11)+(theta_2*psi_11))/((((theta_1*psi_11)+(theta_2*psi_11))+(theta_18*psi_91)))+((theta_18*psi_19)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));
+//calculation of group residual activity coefficient of CH2 using Eq.(11.117)(no unit)
+ln_tau_2=Q_k(3,:)*(1-log((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91))-((((theta_1*psi_11)+(theta_2*psi_11))/((((theta_1*psi_11)+(theta_2*psi_11))+(theta_18*psi_91)))+((theta_18*psi_19)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));
+//calculation of group residual activity coefficient of CH3CO using Eq.(11.117)(no unit)
+ln_tau_18=Q_k(2,:)*(1-log((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_99))-(((((theta_1+theta_2)*psi_91)/((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91)))+((theta_18*psi_99)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));
+//calculation of the residual contributions to the activity coefficients using Eq.(11.116)(no unit)
+ln_gaamma1_r=(nu_ki(1,:)*(ln_tau_1-ln_tau1_1))+(nu_ki(2,:)*(ln_tau_18-ln_tau1_18));
+ln_gaamma2_r=(nu_ki(3,:)*(ln_tau_1-ln_tau2_1))+(nu_ki(4,:)*(ln_tau_2-ln_tau2_2));
+ln_gaamma1=ln_gaamma1_c+ln_gaamma1_r;//calculation of the ln(activity coefficient) using Eq.(11.104) (no unit)
+ln_gaamma2=ln_gaamma2_c+ln_gaamma2_r;//calculation of the ln(activity coefficient) using Eq.(11.104) (no unit)
+gaamma1=exp(ln_gaamma1);//calculation of the activity coefficient (no unit)
+gaamma2=exp(ln_gaamma2);//calculation of the activity coefficient (no unit)
+
+//OUTPUT
+
+mprintf('The activity coefficients for the system using the UNIFAC method are : gamma1=%f \t gamma2=%f \t\n ', gaamma1,gaamma2);
+
+//===============================================END OF PROGRAM===================================================
+
+
diff --git a/611/CH11/EX11.2/Chap11_Ex2.sce b/611/CH11/EX11.2/Chap11_Ex2.sce new file mode 100755 index 000000000..2327a19d5 --- /dev/null +++ b/611/CH11/EX11.2/Chap11_Ex2.sce @@ -0,0 +1,25 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 2,Page 384
+//Title:Composition of liquid
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, benzene is taken as 1 and toluene as 2
+T=95;//temperature of the equimolar vapour mixture of benzene and toluene in degree celsius
+y1=0.5;//mole fraction of benzene in vapour phase (no unit)
+y2=0.5;//mole fraction of toluene in vapour phase (no unit)
+P1_s=1176.21;//saturation pressure of benzene at T, taken from Example 11.1 in Torr
+P2_s=477.03;//saturation pressure of toluene at T, taken from Example 11.1 in Torr
+
+//CALCULATION
+P=1/((y1/P1_s)+(y2/P2_s));//calculation of the total pressure using Eq.(11.21) in Torr
+x1=(y1*P)/P1_s;//calculation of mole fraction of benzene in liquid phase using Eq.(11.15)(no unit)
+x2=1-x1;//calculation of mole fraction of toluene in liquid phase using Eq.(11.15)(no unit)
+
+//OUTPUT
+mprintf('The composition of the liquid which is in equilibrium with the equimolar vapour mixture of benzene and toluene at 95 degree celsius is \n mole fraction of benzene in liquid phase (x1)=%f \n mole fraction of toluene in liquid phase (x2)=%f \n',x1,x2);
+
+//===============================================END OF PROGRAM===================================================
diff --git a/611/CH11/EX11.3/Chap11_Ex3_R1.sce b/611/CH11/EX11.3/Chap11_Ex3_R1.sce new file mode 100755 index 000000000..86a7faeab --- /dev/null +++ b/611/CH11/EX11.3/Chap11_Ex3_R1.sce @@ -0,0 +1,34 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 3,Page 384
+//Title:Bubble temperature
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, benzene is taken as 1 and toluene as 2
+P=760;//pressure of the binary liquid mixture of benzene and toluene in Torr
+x1=0.4047;//mole fraction of benzene in liquid phase (no unit)
+antoine_const_benzene=[6.87987;1196.760;219.161];//Antoine's constants for Benzene from Table A.7
+antoine_const_toluene=[6.95087;1342.310;219.187];//Antoine's constants for Toluene from Table A.7
+
+//CALCULATION
+
+//The form of the Antoine's equation used is logP=A-(B/(t+C)), where P is in Torr and t is in degree celsius
+//Based on the procedure given in the texbook, the criterion of summation of (y_i)=1.0 will be checked, where y_i=(x_i*Pi_s)/P, where Pi_s is the saturation pressure obtained from the Antoine's equation.
+
+x2=1-x1;//mole fraction of toluene in liquid phase (no unit)
+tol=1e-6;//tolerance limit for convergence of the system using fsolve
+tguess=100;//taking a guess value for the bubble temperature to be used in the fsolve function in degree celsius
+function[fn]=solver_func(ti)
+ fn=(((x1/P)*(10^(antoine_const_benzene(1,:)-(antoine_const_benzene(2,:)/(ti+antoine_const_benzene(3,:))))))+((x2/P)*(10^(antoine_const_toluene(1,:)-(antoine_const_toluene(2,:)/(ti+antoine_const_toluene(3,:)))))))-1.0;//Function defined for solving the system
+endfunction
+[t]=fsolve(tguess,solver_func,tol)//using inbuilt function fsolve for solving the system of equations
+
+//OUTPUT
+mprintf('The bubble temperature of a binary liquid mixture of benzene and toluene at 760 Torr=%d degree celsius \n',t);
+
+//===============================================END OF PROGRAM===================================================
+
+
diff --git a/611/CH11/EX11.4/Chap11_Ex4_R1.sce b/611/CH11/EX11.4/Chap11_Ex4_R1.sce new file mode 100755 index 000000000..0519bb95c --- /dev/null +++ b/611/CH11/EX11.4/Chap11_Ex4_R1.sce @@ -0,0 +1,34 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 4,Page 385
+//Title:Dew temperature
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, benzene is taken as 1 and toluene as 2
+P=760;//pressure of the binary liquid mixture of benzene and toluene in Torr
+y1=0.6263;//mole fraction of benzene in vapour phase (no unit)
+antoine_const_benzene=[6.87987;1196.760;219.161];//Antoine's constants for Benzene from Table A.7
+antoine_const_toluene=[6.95087;1342.310;219.187];//Antoine's constants for Toluene from Table A.7
+
+//CALCULATION
+
+//The form of the Antoine's equation used is logP=A-(B/(t+C)), where P is in Torr and t is in degree celsius
+//Based on the procedure given in the texbook, the criterion of summation of (x_i)=1.0 will be checked, where x_i=(y_i*P)/(Pi_s), Pi_s is the saturation pressure obtained from the Antoine's Equation.
+
+y2=1-y1;//mole fraction of toluene in vapour phase (no unit)
+tol=1e-6;//tolerance limit for convergence of the system using fsolve
+tguess=100;//taking a guess value for the dew temperature to be used in the fsolve function in degree celsius
+function[fn]=solver_func(ti)
+ fn=(((y1*P)/(10^(antoine_const_benzene(1,:)-(antoine_const_benzene(2,:)/(ti+antoine_const_benzene(3,:))))))+((y2*P)/(10^(antoine_const_toluene(1,:)-(antoine_const_toluene(2,:)/(ti+antoine_const_toluene(3,:)))))))-1.0;//Function defined for solving the system
+endfunction
+[t]=fsolve(tguess,solver_func,tol)//using inbuilt function fsolve for solving the system of equations
+
+//OUTPUT
+mprintf('The dew temperature of a binary vapour mixture of benzene and toluene at 760 Torr=%d degree celsius \n',t);
+
+//===============================================END OF PROGRAM===================================================
+
+
diff --git a/611/CH11/EX11.5/Chap11_Ex5.sce b/611/CH11/EX11.5/Chap11_Ex5.sce new file mode 100755 index 000000000..86a1e1858 --- /dev/null +++ b/611/CH11/EX11.5/Chap11_Ex5.sce @@ -0,0 +1,54 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 5,Page 386
+//Title:Composition of the liquid and vapor streams leaving the flash unit
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, n-pentane is taken as 1 , n-hexane as 2, and n-heptane as 3
+P=200;//pressure at which the flash vaporizer is maintained in kPa
+T=90;//temperature at which the flash vaporizer is maintained in degree celsius
+zf1=0.3//mole fraction of n-pentane in feed stream (no unit)
+zf2=0.3//mole fraction of n-hexane in feed stream (no unit)
+zf3=0.4//mole fraction of n-heptane in feed stream (no unit)
+antoine_const_pentane=[6.87632;1075.780;233.205];//Antoine's constants for n-pentane from Table A.7
+antoine_const_hexane=[6.91058;1189.640;226.280];//Antoine's constants for n-hexane from Table A.7
+antoine_const_heptane=[6.89386;1264.370;216.640];//Antoine's constants for n-heptane from Table A.7
+
+//CALCULATION
+
+//The form of the Antoine's equation used is logP=A-(B/(t+C)), where P is in Torr and t is in degree celsius
+P1_s=10^(antoine_const_pentane(1,:)-(antoine_const_pentane(2,:)/(T+antoine_const_pentane(3,:))));//calculation of saturation pressure of n-pentane at T in Torr
+P1_s=P1_s*133.322*10^-3;//conversion from Torr to kPa
+P2_s=10^(antoine_const_hexane(1,:)-(antoine_const_hexane(2,:)/(T+antoine_const_hexane(3,:))));//calculation of saturation pressure of n-hexane at T in Torr
+P2_s=P2_s*133.322*10^-3;//conversion from Torr to kPa
+P3_s=10^(antoine_const_heptane(1,:)-(antoine_const_heptane(2,:)/(T+antoine_const_heptane(3,:))));//calculation of saturation pressure of n-heptane at T in Torr
+P3_s=P3_s*133.322*10^-3;//conversion from Torr to kPa
+K1=P1_s/P;//calculation of K factor using Eq.(11.22) (no unit)
+K2=P2_s/P;//calculation of K factor using Eq.(11.22) (no unit)
+K3=P3_s/P;//calculation of K factor using Eq.(11.22) (no unit)
+tol=1e-6;//tolerance limit for convergence of the system using fsolve
+L_F_guess=0.1;//taking a guess value for the L/F ratio, where L is the mole number of liquid stream leaving the unit at T and P, and F is the mole number of feed stream
+function[fn]=solver_func(L_F)
+ fn=((zf1/((L_F)+((1-L_F)*K1)))+(zf2/((L_F)+((1-L_F)*K2)))+(zf3/((L_F)+((1-L_F)*K3))))-1.0;//Function defined for solving the system
+endfunction
+[L_F]=fsolve(L_F_guess,solver_func,tol)//using inbuilt function fsolve for solving the system of equations
+x1=(zf1/((L_F)+((1-L_F)*K1)));//calculation of mole fraction of n-pentane in liquid stream leaving the unit at T and P (no unit)
+x2=(zf2/((L_F)+((1-L_F)*K2)));//calculation of mole fraction of n-hexane in liquid stream leaving the unit at T and P (no unit)
+x3=(zf3/((L_F)+((1-L_F)*K3)));//calculation of mole fraction of n-heptane in liquid stream leaving the unit at T and P (no unit)
+y1=K1*x1;//calculation of mole fraction of n-pentane in the vapour stream leaving the unit at T and P (no unit)
+y2=K2*x2;//calculation of mole fraction of n-hexane in the vapour stream leaving the unit at T and P (no unit)
+y3=K3*x3;//calculation of mole fraction of n-heptane in the vapour stream leaving the unit at T and P (no unit)
+V_F=1-(L_F);//calculation of the fraction that has vaporized
+
+//OUTPUT
+mprintf('The composition of the liquid leaving the flash unit is : x1=%f \t\t x2=%f \t\t x3=%f\n',x1,x2,x3);
+mprintf('The composition of the vapour leaving the flash unit is : y1=%f \t\t y2=%f \t\t y3=%f\n',y1,y2,y3);
+mprintf('The fraction of feed that has vaporized in the unit=%f \n ',V_F);
+
+//===============================================END OF PROGRAM===================================================
+
+
+
diff --git a/611/CH11/EX11.7/Chap11_Ex7.sce b/611/CH11/EX11.7/Chap11_Ex7.sce new file mode 100755 index 000000000..bff86ddf1 --- /dev/null +++ b/611/CH11/EX11.7/Chap11_Ex7.sce @@ -0,0 +1,26 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 7,Page 397
+//Title:Activity coefficients
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, nitromethane is taken as 1 and carbon tetrachloride as 2
+T=45;//temperature of the mixture in degree celsius
+A=2.230;//van laar constant for the system at T (no unit)
+B=1.959;//van laar constant for the system at T (no unit)
+n1=30;//mole percentage of nitromethane in the mixture ( in percentage)
+
+//CALCULATION
+n2=100-n1;//calculation of mole percentage of carbon tetrachloride in the mixture (in percentage)
+x1=n1/100;//calculation of mole fraction of nitromethane in the mixture (no unit)
+x2=1-x1;//calculation of mole fraction of carbon tetrachloride in the mixture(no unit)
+gaamma1=exp (A/(1+((A/B)*(x1/x2)))^2);//calculation of activity coefficient using Eq.(11.82) (no unit)
+gaamma2=exp (B/(1+((B/A)*(x2/x1)))^2);//calculation of activity coefficient using Eq.(11.83) (no unit)
+
+//OUTPUT
+mprintf('The activity coefficients for the system using van laar equation is : gamma1=%f \t gamma2=%f \t\n ', gaamma1,gaamma2);
+
+//===============================================END OF PROGRAM===================================================
diff --git a/611/CH11/EX11.8/Chap11_Ex8.sce b/611/CH11/EX11.8/Chap11_Ex8.sce new file mode 100755 index 000000000..65c08e3e0 --- /dev/null +++ b/611/CH11/EX11.8/Chap11_Ex8.sce @@ -0,0 +1,38 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 8,Page 397
+//Title:van Laar constants and Activity coefficients
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, ethanol is taken as 1 and benzene as 2
+n_azeo=44.8;//azeotropic composition given as mole percentage
+Tb=68.24;//boiling point of mixture in degree celsius
+P=760;//pressure in Torr
+P1_s=506;//saturation pressure of ethanol at Tb in Torr
+P2_s=517;//saturation pressure of benzene at Tb in Torr
+n1=10;//mole percentage of ethanol in the mixture (in percentage)
+
+//CALCULATION
+//At azeotropic composition, y_i=x_i, therefore gaamma_i=P/Pi_s
+x1=n_azeo/100;//calculation of the mole fraction of ethanol (azeotropic composition) (no unit)
+x2=1-x1;//calculation of the mole fraction of benzene (azeotropic composition) (no unit)
+gaamma1=P/P1_s;//calculation of the activity coefficient at the azeotropic composition (no unit)
+gaamma2=P/P2_s;//calculation of the activity coefficient at the azeotropic composition (no unit)
+A=log(gaamma1)*(1+((x2*log(gaamma2))/(x1*log(gaamma1))))^2;//calculation of the van Laar constant using Eq.(11.84) (no unit)
+B=log(gaamma2)*(1+((x1*log(gaamma1))/(x2*log(gaamma2))))^2;//calculation of the van Laar constant using Eq.(11.85) (no unit)
+x1=n1/100;//calculation of the mole fraction of ethanol (no unit)
+x2=1-x1;//calculation of the mole fraction of benzene (no unit)
+gaamma1=exp (A/(1+((A/B)*(x1/x2)))^2);//calculation of activity coefficient at the given composition using Eq.(11.82) (no unit)
+gaamma2=exp (B/(1+((B/A)*(x2/x1)))^2);//calculation of activity coefficient at the given composition using Eq.(11.83) (no unit)
+
+
+//OUTPUT
+mprintf('The van Laar constants for the system are : A=%f \t B=%f \n',A,B)
+mprintf('The activity coefficients for the system using van laar equation are : gamma1=%f \t gamma2=%f \t\n ', gaamma1,gaamma2);
+
+//===============================================END OF PROGRAM===================================================
+
+
diff --git a/611/CH11/EX11.9/Chap11_Ex9.sce b/611/CH11/EX11.9/Chap11_Ex9.sce new file mode 100755 index 000000000..065752c19 --- /dev/null +++ b/611/CH11/EX11.9/Chap11_Ex9.sce @@ -0,0 +1,29 @@ +// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
+
+//Chapter-11,Example 9,Page 399
+//Title: Activity coefficients using the Wilson's parameters
+//================================================================================================================
+clear
+clc
+
+//INPUT
+//For convenience, nitromethane is taken as 1 and carbon tetrachloride as 2
+T=45;//temperature of the system in degree celsius
+A_12=0.1156;//Wilson's parameter for the system at T (no unit)
+A_21=0.2879;//Wilson's parameter for the system at T (no unit)
+x1=0.3;//mole fraction of nitromethane in the liquid mixture (no unit)
+
+//CALCULATION
+x2=1-x1;//calculation of the mole fraction of carbon tetrachloride in the liquid mixture (no unit)
+ln_gaamma1=-log(x1+(A_12*x2))+(x2*((A_12/(x1+(A_12*x2)))-(A_21/((A_21*x1)+x2))));//calculation of ln(activity coefficient) using Eq.(11.89) (no unit)
+gaamma1=exp(ln_gaamma1);//calculation of activity coefficient (no unit)
+ln_gaamma2=-log(x2+(A_21*x1))-(x1*((A_12/(x1+(A_12*x2)))-(A_21/((A_21*x1)+x2))));//calculation of ln(activity coefficient) using Eq.(11.90) (no unit)
+gaamma2=exp(ln_gaamma2);//calculation of activity coefficient (no unit)
+
+//OUTPUT
+
+mprintf('The activity coefficients for the system using Wilsons parameters are : gamma1=%f \t gamma2=%f \t\n ', gaamma1,gaamma2);
+
+//===============================================END OF PROGRAM===================================================
+
+
|