Liquid Liquid Equilibrium Curve and Tie Lines 
for ternary system: hexane - heptane - methanol at 32.85 °C
Author's Data: Housam BINOUS
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA
Email: binoushousam@yahoo.com

Off[General::"spell1"]

Activities using the NRTL model

GAMMA1 = 
      Exp[(t21/(R T) G21 x2 + t31/(R T) G31 x3)/(x1 + 
                G21 x2 + G31 x3) + 
          x1/(x1 + G21 x2 + 
                  G31 x3) (-(x2 t21/(R T) G21 + 
                      x3 t31/(R T) G31)/(x1 + G21 x2 + 
                    G31 x3)) + 
          x2 G12/(G12 x1 + x2 + 
                  G32 x3) (t12/(R T) - (x1 t12/(R T) G12 + x3 t32/(R T) G32)/(G12 x1 + x2 + 
                      G32 x3)) + 
x3 G13/(G13 x1 + 
                  G23 x2  + 
                  x3) (t13/(R T) - (x1 t13/(R T) G13 + 
                      x2 t23/(R T) G23)/(G13 x1 + G23 x2  + 
                      x3))]

GAMMA1p = 
      Exp[(t21/(R T) G21 xp2 + t31/(R T) G31 xp3)/(xp1 + 
                G21 xp2 + G31 xp3) + 
          xp1/(xp1 + G21 xp2 + 
                  G31 xp3) (-(xp2 t21/(R T) G21 + 
                      xp3 t31/(R T) G31)/(xp1 + G21 xp2 + 
                    G31 xp3)) + 
          xp2 G12/(G12 xp1 + xp2 + 
                  G32 xp3) (t12/(R T) - (xp1 t12/(R T) G12 + xp3 t32/(R T) G32)/(G12 xp1 + xp2 + 
                      G32 xp3)) + 
xp3 G13/(G13 xp1 + G23 xp2  + 
                  xp3) (t13/(R T) - (xp1 t13/(R T) G13 + 
                      xp2 t23/(R T) G23)/(G13 xp1 + G23 xp2  + 
                      xp3))]

GAMMA2 = 
      Exp[(t12/(R T) G12 x1 + 
                t32/(R T) G32 x3)/(G12 x1 + x2 + G32 x3) + 
          x1 G21/(x1 + G21 x2 + 
                  G31 x3) (t21/(R T) - (x2 t21/(R T) G21 + x3 t31/(R T) G31)/(x1 + G21 x2 + G31 x3)) + 
          x2/(G12 x1 + x2 + 
                  G32 x3) (-(x1 t12/(R T) G12 + 
                      x3 t32/(R T) G32)/(G12 x1 + x2 + 
                    G32 x3)) + 
          x3 G23/(G13 x1 + G23 x2  + 
                  x3) (t23/(R T) - (x1 t13/(R T) G13 + 
                      x2 t23/(R T) G23)/(G13 x1 + G23 x2  + 
                      x3))]

GAMMA2p = 
      Exp[(t12/(R T) G12 xp1 + 
                t32/(R T) G32 xp3)/(G12 xp1 + xp2 + G32 xp3) + 
          xp1 G21/(xp1 + G21 xp2 + 
                  G31 xp3) (t21/(R T) - (xp2 t21/(R T) G21 + xp3 t31/(R T) G31)/(xp1 + G21 xp2 + G31 xp3)) + 
          xp2/(G12 xp1 + xp2 + 
                  G32 xp3) (-(xp1 t12/(R T) G12 + 
                      xp3 t32/(R T) G32)/(G12 xp1 + xp2 + 
                    G32 xp3)) + 
          xp3 G23/(G13 xp1 + G23 xp2  + 
                  xp3) (t23/(R T) - (xp1 t13/(R T) G13 + 
                      xp2 t23/(R T) G23)/(G13 xp1 + G23 xp2  + 
                      xp3))]

GAMMA3 = 
      Exp[(t13/(R T) G13 x1 + 
                t23/(R T) G23 x2)/(G13 x1 + G23 x2 + x3) + 
          x1 G31/(x1 + G21 x2 + 
                  G31 x3) (t31/(R T) - (x2 t21/(R T) G21 + x3 t31/(R T) G31)/(x1 + G21 x2 + G31 x3)) + 
          x2 G32/(G12 x1 + x2 + 
                  G32 x3) (t32/(R T) - (x1 t12/(R T) G12 + x3 t32/(R T) G32)/(G12 x1 + x2 + G32 x3)) + 
          x3/(G13 x1 + G23 x2  + 
                  x3) (-(x1 t13/(R T) G13 + 
                      x2 t23/(R T) G23)/(G13 x1 + G23 x2  + 
                    x3))]

GAMMA3p = 
      Exp[(t13/(R T) G13 xp1 + 
                t23/(R T) G23 xp2)/(G13 xp1 + G23 xp2 + xp3) + 
          xp1 G31/(xp1 + G21 xp2 + 
                  G31 xp3) (t31/(R T) - (xp2 t21/(R T) G21 + xp3 t31/(R T) G31)/(xp1 + G21 xp2 + G31 xp3)) + 
          xp2 G32/(G12 xp1 + xp2 + 
                  G32 xp3) (t32/(R T) - (xp1 t12/(R T) G12 + xp3 t32/(R T) G32)/(G12 xp1 + xp2 + G32 xp3)) + 
          xp3/(G13 xp1 + G23 xp2  + 
                  xp3) (-(xp1 t13/(R T) G13 + 
                      xp2 t23/(R T) G23)/(G13 xp1 + 
                    G23 xp2  + xp3))]

G12 = Exp[-a12 t12/(R T)]; 
    G21 = Exp[-a12 t21/(R T)]; G13 = Exp[-a13 t13/(R T)]; 
    G31 = Exp[-a13 t31/(R T)]; G32 = Exp[-a32 t32/(R T)]; 
    G23 = Exp[-a32 t23/(R T)];

Gas constant, temperature and binary interaction parameters for the NRTL model

R = 1.987;
a13 = 0.42399900; a12 = 0.301800;
a32 = 0.440800;
t31 = 1287.78000; t13 = 1915.07700;
t23 = 1598.3120000; t32 = 1566.43700;
t12 = -285.9411;
t21 = 252.997600;

T = 273.15 + 32.85

Computing Tie lines and LLE curve 
hexane = component 1
heptane = component 2
methanol = component 3

X1 = 0.5; X2 = 0.1;

\(sol[1] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {xp1, 0.85}, {xp2, 
          0.1}, {x1, 0.3}, {x2, 0.04}, {L, 0.05}, {Lp, 0.04}, {xp3, 
          0.01}, {x3, 0.4}, 
	MaxIterations -> 10000]\)

X1 = 0.5; X2 = 0.2;

\(sol[2] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {xp1, 0.85}, {xp2, 
          0.1}, {x1, 0.3}, {x2, 0.04}, {L, 0.05}, {Lp, 0.04}, {xp3, 
          0.01}, {x3, 0.4}, 
	MaxIterations -> 10000]\)

X1 = 0.5; X2 = 0.3;

sol[3] = 
      FindRoot[{(GAMMA1 x1 ==  
              GAMMA1p xp1), (GAMMA2 x2 ==  
              GAMMA2p xp2), 
(GAMMA3 x3 ==  
              GAMMA3p xp3), 
(x1 L + 
                xp1 Lp ==  X1), (x2 L + xp2 Lp ==  
              X2), (1 ==  xp1 + xp2 + xp3), (1 ==  
              x1 + x2 + x3), (L + Lp == 1)}, {xp1, 0.85}, {xp2, 
          0.1}, {x1, 0.3}, {x2, 0.04}, {L, 0.05}, {Lp, 0.04}, {xp3, 
          0.01}, {x3, 0.4}, MaxIterations -> 10000]

X1 = 0.2; X2 = 0.5;

sol[4] = 
      FindRoot[{(GAMMA1 x1 ==  
              GAMMA1p xp1), (GAMMA2 x2 ==  
              GAMMA2p xp2), 
(GAMMA3 x3 ==  
              GAMMA3p xp3), 
(x1 L + 
                xp1 Lp ==  X1), (x2 L + xp2 Lp ==  
              X2), (1 ==  xp1 + xp2 + xp3), (1 ==  
              x1 + x2 + x3), (L + Lp == 1)}, {x1, 0.25}, {x2, 
          0.15}, {xp1, 0.5}, {xp2, 0.4}, {L, 0.5}, {Lp, 0.04}, {x3, 
          0.25}, {xp3, 0.1}, MaxIterations -> 100000]

X1 = 0.2; X2 = 0.6;

\(sol[5] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.15}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.7}, {L, 0.5}, {Lp, 0.04}, {x3, 
          0.4}, {xp3, 0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.1; X2 = 0.6;

\(sol[6] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.1}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.1}, {L, 0.1}, {Lp, 0.4}, {x3, 0.4}, {xp3, 
          0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.1; X2 = 0.65;

\(sol[7] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.1}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.1}, {L, 0.1}, {Lp, 0.4}, {x3, 0.4}, {xp3, 
          0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.1; X2 = 0.7;

\(sol[8] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.1}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.1}, {L, 0.1}, {Lp, 0.4}, {x3, 0.4}, {xp3, 
          0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.1; X2 = 0.8;

\(sol[9] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.1}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.1}, {L, 0.1}, {Lp, 0.4}, {x3, 0.4}, {xp3, 
          0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.01; X2 = 0.75;

\(sol[10] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {x1, 0.1}, {x2, 
          0.4}, {xp1, 0.1}, {xp2, 0.1}, {L, 0.1}, {Lp, 0.4}, {x3, 0.4}, {xp3, 
          0.01}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

X1 = 0.6; X2 = 0.01;

\(sol[11] = 
      FindRoot[{\((GAMMA1\ x1 == \ 
              GAMMA1p\ xp1)\), \((GAMMA2\ x2 == \ 
              GAMMA2p\ xp2)\), 
\((GAMMA3\ x3 == \ 
              GAMMA3p\ xp3)\), 
\((x1\ L + 
                xp1\ Lp == \ X1)\), \((x2\ L + xp2\ Lp == \ 
              X2)\), \((1 == \ xp1 + xp2 + xp3)\), \((1 == \ 
              x1 + x2 + x3)\), \((L + Lp == 1)\)}, {xp1, 0.85}, {xp2, 
          0.1}, {x1, 0.3}, {x2, 0.04}, {L, 0.05}, {Lp, 0.04}, {xp3, 
          0.01}, {x3, 0.4}, AccuracyGoal -> 10, 
	
        MaxIterations -> 10000]\)

Plots of Liquid-Liquid Equilibrium Curve and Tie Lines for Hexane-Heptane-Methanol Ternary System at 32.85°C.

tbl1 = Table[{x1 /. sol[i], x2 /. sol[i]}, {i, 1, 11}]

tbl2 = Table[{xp1 /. sol[i], xp2 /. sol[i]}, {i, 1, 11}]

tbl1final = Sort[tbl1]

tbl2final = Sort[tbl2]

plt1 = 
      ListPlot[tbl1final, AspectRatio -> 1, PlotJoined -> True, 
        DisplayFunction -> Identity]

plt2 = 
      ListPlot[tbl2final, AspectRatio -> 1, PlotJoined -> True, 
        DisplayFunction -> Identity]

Show[plt1, plt2, 
      Graphics[{RGBColor[0, 0, 1], Text[methanol, {0, -0.1}], 
          Text[hexane, {1.0, -0.1}], Text[heptane, {0, 1.1}], 
          RGBColor[0, 0, 1]}], 
      PlotRange -> {{-0.2, 1.2}, {-0.2, 1.2}}, 
      Epilog -> {{RGBColor[0, 0, 
              1], 
Line[{{x1 /. sol[1], 
                  x2 /. sol[1]}, {xp1 /. sol[1], 
                  xp2 /. sol[1]}}], 
Line[{{x1 /. sol[2], 
                  x2 /. sol[2]}, {xp1 /. sol[2], xp2 /. sol[2]}}], 
            Line[{{x1 /. sol[3], x2 /. sol[3]}, {xp1 /. sol[3], 
                  xp2 /. sol[3]}}], 
            Line[{{x1 /. sol[4], x2 /. sol[4]}, {xp1 /. sol[4], 
                  xp2 /. sol[4]}}], 
            Line[{{x1 /. sol[5], x2 /. sol[5]}, {xp1 /. sol[5], 
                  xp2 /. sol[5]}}], 
            Line[{{x1 /. sol[6], x2 /. sol[6]}, {xp1 /. sol[6], 
                  xp2 /. sol[6]}}], 
            Line[{{x1 /. sol[7], x2 /. sol[7]}, {xp1 /. sol[7], 
                  xp2 /. sol[7]}}], 
            Line[{{x1 /. sol[8], x2 /. sol[8]}, {xp1 /. sol[8], 
                  xp2 /. sol[8]}}], 
            Line[{{x1 /. sol[9], x2 /. sol[9]}, {xp1 /. sol[9], 
                  xp2 /. sol[9]}}], 
            Line[{{x1 /. sol[10], x2 /. sol[10]}, {xp1 /. sol[10], 
                  xp2 /. sol[10]}}], 
            Line[{{x1 /. sol[11], x2 /. sol[11]}, {xp1 /. sol[11], 
                  xp2 /. sol[11]}}], {RGBColor[0, 1, 0], 
              Line[{{1, 0}, {0, 1}}]}}}, 
      DisplayFunction -> $DisplayFunction]