Question: How to select the right solution in a system

 

> restart;
> eq1:=p-(R*T*(V)^2-a*(V)+a*b)/((V)^3-b*(V)^2);#eq with 3 V solutions
                              2           
                        R T V - a V + a b
      eq1:= p - -----------------------
                              3      2    
                            V - b V     
> T:=293.15;p:=2000000;R:=8314.4;
                          T := 293.15
                          p := 2000000
                          R := 8314.4
> a:=392598;b:=0.0558559;
                          a := 392598
                         b := 0.0558559
> solutions:=fsolve({p-(R*T*(V)^2-a*(V)+a*b)/((V)^3-b*(V)^2)},{V});
                 solutions := {V = 1.106019903}
> solution1:=solve(p-(R*T*(V)^2-a*(V)+a*b)/((V)^3-b*(V)^2),V)[1];
          solution1 := 0.08425958871 - 0.05304486334I
> solution2:=solve(p-(R*T*(V)^2-a*(V)+a*b)/((V)^3-b*(V)^2),V)[2];
          solution2 := 0.08425958871 + 0.05304486334I
> solution3:=solve(p-(R*T*(x)^2-a*(x)+a*b)/((x)^3-b*(x)^2),x)[3];
                    solution3 := 1.106019903

As you can see I wrote an equation with 3 different solutions if I solve it with V.

Now  more difficult...I have a system that use this equation and other more:

 

 

 

J:=fsolve({eq1=0,eq2=0,eq3=0,eq4=0,eq5=0,eq6=0,eq7=0,eq8=0,eq9=0,eq10=0,eq11=0,eq12=0},{y1,y2,y3,y4,x1,x2,x3,x4,alpha,beta,Vv,Vl});

eq1 and eq2 are the same of the one up, but in the eq1 V=Vv and in the eq2 V=Vl.

 

When it solves the system i want the programme to take for eq1 the first solution and for the eq2 one the second solution.

Please Wait...