Question: Problem "solve"

 

Hi to all, I've to do an exercise about Equllibrium L/V of  a not ideal binary solution.  Equilibrium equations:
p*y1=p1s(T)*x1*gamma1
p(1-y1)=p2s(T)*(1-x1)*gamma2
If I solve manually the sistem I obtain
p - p1s(T)*x1*gamma1 -p2s(T)*(1-x1)*gamma2=0 ( that I call f=0 )
For every  x1 from 0 to 1 I've to calculate T .  I wrote this:
> restart;
> A1:=7.74439:                                #Teacher gave me these data
> B1:=-1437.686:
> C1:=198.463:
> A2:=8.07126:
> B2:=-1730.63:
> C2:=233.426:
> p:=760:
> A12:=2.7549:
> A21:=0.925:
> p1s:=10^(A1+(B1/(T+C1)));
> p2s:=10^(A2+(B2/(T+C2)));
> gamma1:=exp((A12+2*(A21-A12)*(x1))*(1-x1)^2);
> gamma2:=exp((A21+2*(A12-A21)*(1-x1))*(x1)^2);          
> Tbp1:=((B1/(log[10](p)-A1))-C1):evalf(%); # T boiling point 1
> Tbp2:=((B2/(log[10](p)-A2))-C2):evalf(%); # T boiling point 2
> for i from 0 to 10 do x1:=0.1*i: f:= ((p1s*x1*gamma1)/p)+((p2s*(1-x1)*gamma2)/p)-1: T= solve(f=0,T); y1:=(p1s*x1*gamma1)/p;end do;
If I execute the programme I receive a Debug error: "Worksheet lost contact with kernel"
If x1:=0 It must be T:=Tbp2 cause there is only 2 in the solution. I did it manually and I obtained it. (same problem with x1=1 T=Tbp1)
(p2s*gamma2/p) - 1 = 0 with gamma2=exp(0)=1
log[10](p) = A1+ B2/(T+C2)
 T=B2/(log[10](p)-A2) - C2 =Tbp2
 Where is my fault?
If i use " for i from 1 to 9" it works but I have another  problem: I can't use T:= solve(f=0,T) cause, with i=0,02 ,  T will be constant; but in the same time i want to have a numerical result for y1. Last question: Is it possible to plot T(x1),T(y1) in the same plot for my 10+1 points?thanx to all 
Please Wait...