indices on the right incompatible
Show older comments
% am trying to run this my program with the function script and the input
% data given below. please have a look to know what am doing wrong
%%
function[PB,Ybub]=PB_VLE_NRTL(x,C,T,BIP)
% this is a function that calculates the bubble point using the wilson
% activity coeefficient model.
c=length(x);
for i=1:c
Psi=exp((C(i,1))+(C(i,2)/T)+(C(i,3)*log(T))+(C(i,4)*T^C(i,5)));
[gamma,~]=ACTIVITY_NRTL(BIP,alpha,T,x);
PB=sum(Psi.*x*gamma);
Ybub=Psi.*gamma/PB;
end
%% problem 2
% in order to determine the state of aggregation of the system
T=353.15;
P=101325;
i=1:2;
x=[0.5 0.5];
BIP=[196.250 386.133];
C(i)=[88.134 -8498.6 -9.0766 8.330e18 6];
C(i)=[153.23 -10055 -19.488 1.6426e5 2];
3 Comments
Alex Mcaulley
on 17 May 2019
Please, show the complete error text
Chinaemerem Valentine Nwobi
on 17 May 2019
madhan ravi
on 17 May 2019
Edited: madhan ravi
on 17 May 2019
Probably you’re not aware of how to call a function.
Google : How to a call a function? MATLAB
Answers (0)
Categories
Find more on Calendar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!