کد متلب محاسبه ی ضرایب فعالیت با روش UNIFAC
کد متلب محاسبه ی ضرایب فعالیت با روش UNIFAC
نوع فایل: Matlab
% input:
% R,Q: vectors of volumes and surface areas for each functional group
% nu: number of functional groups contained in each component
% (row: functional groups k, column: components i)
% amn: matrix of group interaction parameters
% Nc: number of components
% x: vector of liquid-phase mole fraction
% T: temperature (K)
% output:
% gam: vector of activity coefficients for each component
Parameters of Subgroups
Functional Group j Rk Qk v j v j
CH3 1 0.9011 0.8480 2 2
CH2 2 0.6744 0.5400 1 5
CH2NH 3 1.2070 0.9360 1 0
Source: Poling, B.E. et al., The Properties of Gases and Liquids,
5th ed., McGraw-Hill, New York, NY, 2001, pp. 8.78–8.81.
Main Group 1 Main Group 15
j = 1 j = 2 j = 3
Main Group 1 j = 1 0 0 255.7
j = 2 0 0 255.7
Main Group 15 j = 3 65.33 65.33 0
Example:
% useunifgam.m
Nc = 2; k = 3; % numbers of components(Nc) and functional groups(k)
% vector of volumes for each functional group
R = [0.9011 0.6744 1.2070];
% vector of surface areas for each functional group
Q = [0.8480 0.5400 0.9360];
% number of functional groups contained in each component
% (row: functional groups k, column: components i)
nu = [2 2; 1 5; 1 0];
% matrix of group interaction parameters
amn = [0 0 255.7; 0 0 255.7; 65.33 65.33 0];
x = [0.4 0.6]; % mole fraction of each component
T = 308.15; % T(K)
gam = unifgam(k,R,Q,nu,amn,Nc,x,T)