Info

This question is closed. Reopen it to edit or answer.

NOT ENOUGH INPUT ARGUMENTS

1 view (last 30 days)
GAGANDEEP KAUR
GAGANDEEP KAUR on 28 Feb 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
function Gamma=NRTL(DATA,Optimized)
% DATA contained experimental x-data and temperature
% each x(i) corresponds to each component
% Optimized in the values of variables (Aij) from Optimization method,
% for first iteration of Optimization method, Optimzed is set randomly
NT=length(DATA.x); % determining number of experimental data
T=DATA.T; % determining temperature
R=1.98721; % Gas constant cal/mol K
id=1:NT; % index
A=Optimized; % Binary interaction parameters Aij (cal/mol)
% from Optimization script
A(id,id)=0; % Aii=0;
Tau=exp(-A./(R*T)); % Binary interaction parameters
alpha=rand(NT,NT); % Alpha interaction parameter
alpha(id,id)=0; % for Alpha ii=0
G=exp(-alpha.*Tau); % Binary interaction parameters, Gji
for i=id
% Activity coefficients
lnG(i)=sum(Tau(i,id).*G(id,i).*x(i))./sum(G(i,id).*x(i))+sum((G(i,id).*x(i)).*(Tau(i,id)-sum(Tau(i,id).*G(i,id).*x(i))./sum(G(i,id).*x(i)))./sum(G(i,id).*x(i)));
% Activity coefficients
Gam(i)=exp(lnG(i));
end
Gamma=Gam;
end
  1 Comment
Alex Mcaulley
Alex Mcaulley on 28 Feb 2020
How are you calling this function?

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!