syms x1 x2 A gamma1 gamma2 y1 y2 P P1sat P2sat T
eqn1= P1sat==exp(16.59158 -(3643.31/(T -33.424)));
eqn2= P2sat==exp(14.25326 -(2665.54/(T -53.424)));
eqn3= x1*gamma1*P1sat==y1*P;
eqn4= x2*gamma2*P2sat==y2*P;
eqn5= y1-0.6==0;
eqn6= y1+y2-1==0;
eqn7= x1+x2==1;
eqn8= T==318.15;
eqn9= A==2.771-(0.00523*T);
eqn10= log(gamma1)==A*(x2.^2);
eqn11= log(gamma2)==A*(x1.^2);
solution=solve(eqn1,eqn2,eqn3,eqn4,eqn5,eqn6,eqn7,eqn8,eqn9,eqn10,eqn11);
p1sat=vpa(solution.P1sat)
p2sat=vpa(solution.P2sat)
p=vpa(solution.P)
Gamma1=vpa(solution.gamma1)
Gamma2=vpa(solution.gamma2)
Y1=vpa(solution.y1)
Y2=vpa(solution.y2)
X1=vpa(solution.x1)
X2=vpa(solution.x2)
1 Comment
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/707078-solution-giving-me-imaginary-answers-help-me-with-this#comment_1240333
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/707078-solution-giving-me-imaginary-answers-help-me-with-this#comment_1240333
Sign in to comment.