Professional Documents
Culture Documents
Overview Functions
This is a simple code that calculates the activities of the different components present in a liquid mixture, using the Non-Random Two Liquid model,
extended to multiple components. The code has not been verified in any way, but may still be useful for others to use. Please feel free to use, modify
and distribute the files. If you think the files are useful a positive notification would be appreciated. If the code contains errors, please let me know.
Saeed Hi
19 Dec 2016
Thanks Nieck. This code is working very well.
I evaluated this code using the binary mixture of methanol and water using the eduacational version of Aspen plus v8.8. For the binary and ternary
systems (methanol+water+ethanol) compeletely similar results generated. There is only a small problem with the parameters, the cij=cji in NRTL.
While it was put at zero for cij. I update my "activity" file here for the comparison (for binary and ternary systems).
Binary
clc
clear all;
x=zeros(1,nc);
%methanol (1) water (2) Ethanol (3)
a=[0 -0.693 ; %methanol (1)
2.7322 0 ]; %water (2)
b=[0 172.987 ;
-617.269 0 ];
c=[0 0.3;
0.3 0];
T = 300 ;
https://www.mathworks.com/matlabcentral/fileexchange/48651-component-activities-in-liquid-mixture--using-nrtl?requestedDomain=true 1/3
1/17/2018 Component activities in liquid mixture, using NRTL - File Exchange - MATLAB Central
x(1)=x_range(t);x(2)=1-x(1);
% for plotting
X(t,:)=x;
Y(t,:)=x.*exp(lng);
G(t,:)=exp(lng);
end
figure(1)
plot(X(:,1),Y(:,1),X(:,1),Y(:,2));
figure(2)
plot(X(:,1),G(:,1),'x',X(:,2),G(:,2));
clc
clear all;
x=zeros(1,nc);
%methanol (1) water (2) Ethanol (3)
a=[0 -0.693 4.7119 ; %methanol (1)
2.7322 0 3.4578 ;%water (2)
-2.3127 -0.8009 0 ]; %Ethanol (3)
T = 300 ;
x(1)=0.05;
x(2)=0.05;
x(3)=0.9;
% for plotting
X=x;
Y=x.*exp(lng);
G=exp(lng);
SADEGH It seems the Transpose of matrices a, b and c should be used. 'cause methanol is (1) and water is (2), a_ij matrix follows:
24 Mar 2015 mw
m | 0 -0.6930 |
w | 2.7320 0 |
https://www.mathworks.com/matlabcentral/fileexchange/48651-component-activities-in-liquid-mixture--using-nrtl?requestedDomain=true 2/3
1/17/2018 Component activities in liquid mixture, using NRTL - File Exchange - MATLAB Central
Requires
MATLAB
MATLAB Release
MATLAB 8.4 (R2014b)
Tags
liquid mixture thermodynamics
Cancel Save
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.
» Watch video
mathworks.com
© 1994-2018 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See mathworks.com/trademarks for a list of additional trademarks. Other
product or brand names may be trademarks or registered trademarks of their respective holders.
https://www.mathworks.com/matlabcentral/fileexchange/48651-component-activities-in-liquid-mixture--using-nrtl?requestedDomain=true 3/3