(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 30128, 729] NotebookOptionsPosition[ 29633, 708] NotebookOutlinePosition[ 29978, 723] CellTagsIndexPosition[ 29935, 720] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ StyleBox["RCM of a Nonideal Ternary Mixture using StreamPlot\n", "Subsubtitle", FontSize->18, FontVariations->{"CompatibilityType"->0}], StyleBox["Authors' Data", FontSize->14, FontWeight->"Bold"], StyleBox[": ", FontSize->14], StyleBox["Housam Binous\nDepartment of Chemical Engineering\nNational \ Institute of Applied Sciences and Technology\nTunis, TUNISIA\nEmail: \ binoushousam@yahoo.com ", FontSize->14, FontWeight->"Plain"] }], "Title", CellChangeTimes->{{3.4000354481602945`*^9, 3.400035458715472*^9}, 3.400035572909675*^9, {3.407590174329053*^9, 3.4075902150375886`*^9}, 3.485487307859375*^9, {3.485487442234375*^9, 3.485487479265625*^9}}, TextAlignment->Center, Background->RGBColor[0.605478, 0.996109, 0.605478]], Cell[TextData[{ StyleBox["Reference :", FontWeight->"Bold"], "\nM. F. Doherty and M. F. Malone, ", StyleBox["Conceptual Design of Distillation Systems", FontSlant->"Italic"], ", New York: McGraw-Hill, 2001." }], "Subsubtitle", CellChangeTimes->{ 3.400035572909675*^9, {3.4075902209060273`*^9, 3.407590247193827*^9}, 3.4854873143125*^9, {3.485487350234375*^9, 3.485487353171875*^9}}, Background->RGBColor[0.773449, 0.996109, 0.996109]], Cell["Computation may take several minutes to complete.", "Subsubtitle", CellChangeTimes->{{3.407590260533008*^9, 3.407590271999496*^9}, { 3.4075903045663247`*^9, 3.4075903749875855`*^9}, {3.485487378515625*^9, 3.48548739571875*^9}}, Background->RGBColor[1., 1., 0.6901960784313725]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "plt", ",", "y1", ",", "y2", ",", "y3", ",", "x1", ",", "x2", ",", "x3", ",", "Psat1", ",", "Psat2", ",", "Psat3", ",", "GAM1", ",", "GAM2", ",", "GAM3", ",", "T", ",", "Tbp"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"R", "=", "1.987"}], ";", "\[IndentingNewLine]", RowBox[{"Aa2", "=", "7.63132"}], ";", RowBox[{"Ba2", "=", "1566.69"}], ";", RowBox[{"Ca2", "=", "273.419"}], ";", RowBox[{"Aa1", "=", "6.95465"}], ";", RowBox[{"Ba1", "=", "1170.966"}], ";", RowBox[{"Ca1", "=", "226.232"}], ";", "\[IndentingNewLine]", RowBox[{"Aa3", "=", "8.08097"}], ";", RowBox[{"Ba3", "=", "1582.271"}], ";", RowBox[{"Ca3", "=", "239.726"}], ";", "\[IndentingNewLine]", RowBox[{"Psat1", "=", RowBox[{"10", "^", RowBox[{"(", RowBox[{"Aa1", "-", RowBox[{"Ba1", "/", RowBox[{"(", RowBox[{"T", "+", "Ca1"}], ")"}]}]}], ")"}]}]}], ";", RowBox[{"Psat2", "=", RowBox[{"10", "^", RowBox[{"(", RowBox[{"Aa2", "-", RowBox[{"Ba2", "/", RowBox[{"(", RowBox[{"T", "+", "Ca2"}], ")"}]}]}], ")"}]}]}], " ", ";", RowBox[{"Psat3", "=", RowBox[{"10", "^", RowBox[{"(", RowBox[{"Aa3", "-", RowBox[{"Ba3", "/", RowBox[{"(", RowBox[{"T", "+", "Ca3"}], ")"}]}]}], ")"}]}]}], " ", ";", "\[IndentingNewLine]", RowBox[{"l12", "=", RowBox[{"-", "506.85180"}]}], ";", RowBox[{"l21", "=", "116.11710"}], ";", RowBox[{"l13", "=", RowBox[{"-", "361.79440"}]}], ";", "\[IndentingNewLine]", RowBox[{"l31", "=", "1694.02400"}], ";", RowBox[{"l23", "=", RowBox[{"-", "124.93280"}]}], ";", RowBox[{"l32", "=", "551.45450"}], ";", "\[IndentingNewLine]", RowBox[{"V1", "=", "80.7"}], ";", RowBox[{"V2", "=", "74.0"}], ";", RowBox[{"V3", "=", "40.7"}], ";", RowBox[{"A12", "=", RowBox[{ RowBox[{"V2", "/", "V1"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l12"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"A13", "=", RowBox[{ RowBox[{"V3", "/", "V1"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l13"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"A32", "=", RowBox[{ RowBox[{"V2", "/", "V3"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l32"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"A21", "=", RowBox[{ RowBox[{"V1", "/", "V2"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l21"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"A31", "=", RowBox[{ RowBox[{"V1", "/", "V3"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l31"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"A23", "=", RowBox[{ RowBox[{"V3", "/", "V2"}], " ", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "l23"}], "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"(", RowBox[{"T", "+", "273.15"}], ")"}]}], ")"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"GAM1", "[", RowBox[{"x1_", ",", "x2_", ",", "x3_"}], "]"}], ":=", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"Log", "[", RowBox[{"x1", "+", RowBox[{"x2", "*", "A12"}], "+", RowBox[{"x3", "*", "A13"}]}], "]"}]}], "+", "1", "-", RowBox[{"(", RowBox[{ RowBox[{"x1", "/", RowBox[{"(", RowBox[{"x1", "+", RowBox[{"x2", "*", "A12"}], "+", RowBox[{"x3", "*", "A13"}]}], ")"}]}], "+", RowBox[{"x2", "*", RowBox[{"A21", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A21"}], "+", "x2", "+", RowBox[{"x3", "*", "A23"}]}], ")"}]}]}], "+", RowBox[{"x3", "*", RowBox[{"A31", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A31"}], "+", RowBox[{"x2", "*", "A32"}], "+", "x3"}], ")"}]}]}]}], ")"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"GAM2", "[", RowBox[{"x1_", ",", "x2_", ",", "x3_"}], "]"}], ":=", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"Log", "[", RowBox[{ RowBox[{"x1", "*", "A21"}], "+", "x2", "+", RowBox[{"x3", "*", "A23"}]}], "]"}]}], "+", "1", "-", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", RowBox[{"A12", "/", RowBox[{"(", RowBox[{"x1", "+", RowBox[{"x2", "*", "A12"}], "+", RowBox[{"x3", "*", "A13"}]}], ")"}]}]}], "+", RowBox[{"x2", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A21"}], "+", "x2", "+", RowBox[{"x3", "*", "A23"}]}], ")"}]}], "+", RowBox[{"x3", "*", RowBox[{"A32", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A31"}], "+", RowBox[{"x2", "*", "A32"}], "+", "x3"}], ")"}]}]}]}], ")"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"GAM3", "[", RowBox[{"x1_", ",", "x2_", ",", "x3_"}], "]"}], ":=", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"Log", "[", RowBox[{ RowBox[{"x1", "*", "A31"}], "+", RowBox[{"x2", "*", "A32"}], "+", "x3"}], "]"}]}], "+", "1", "-", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", RowBox[{"A13", "/", RowBox[{"(", RowBox[{"x1", "+", RowBox[{"x2", "*", "A12"}], "+", RowBox[{"x3", "*", "A13"}]}], ")"}]}]}], "+", RowBox[{"x2", "*", RowBox[{"A23", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A21"}], "+", "x2", "+", RowBox[{"x3", "*", "A23"}]}], ")"}]}]}], "+", RowBox[{"x3", "/", RowBox[{"(", RowBox[{ RowBox[{"x1", "*", "A31"}], "+", RowBox[{"x2", "*", "A32"}], "+", "x3"}], ")"}]}]}], ")"}]}], "]"}]}], ";", "\[IndentingNewLine]", " ", RowBox[{"y1", "=", FractionBox[ RowBox[{ RowBox[{"GAM1", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}], " ", "Psat1", " ", "x1"}], "P"]}], ";", "\n", " ", RowBox[{"y2", "=", FractionBox[ RowBox[{ RowBox[{"GAM2", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}], " ", "Psat2", " ", "x2"}], "P"]}], ";", RowBox[{"y3", "=", FractionBox[ RowBox[{ RowBox[{"GAM3", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}], " ", "Psat3", " ", "x3"}], "P"]}], ";", RowBox[{"x3", "=", RowBox[{"1", "-", "x1", "-", "x2"}]}], ";", RowBox[{ RowBox[{"Tbp", "[", RowBox[{ RowBox[{"x1_", "?", "NumericQ"}], ",", RowBox[{"x2_", "?", "NumericQ"}], ",", RowBox[{"x3_", "?", "NumericQ"}]}], "]"}], ":=", RowBox[{"(", RowBox[{"T", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x1", " ", "Psat1", " ", RowBox[{"GAM1", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}]}], "+", RowBox[{"x2", " ", "Psat2", " ", RowBox[{"GAM2", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}]}], "+", RowBox[{"x3", " ", "Psat3", " ", RowBox[{"GAM3", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}]}]}], "\[Equal]", " ", "P"}], ",", RowBox[{"{", RowBox[{"T", ",", "50", ",", "70"}], "}"}]}], "]"}]}], ")"}]}], ";", RowBox[{"plt", "=", RowBox[{"StreamPlot", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"x1", "-", "y1"}], ",", RowBox[{"x2", "-", "y2"}]}], "}"}], "/.", RowBox[{"T", "\[Rule]", " ", RowBox[{"Tbp", "[", RowBox[{"x1", ",", "x2", ",", "x3"}], "]"}]}]}], ")"}], ",", RowBox[{"{", RowBox[{"x1", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"x2", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"StreamPoints", "\[Rule]", " ", "100"}], ",", RowBox[{"StreamScale", "\[Rule]", " ", "Large"}], ",", RowBox[{"StreamStyle", "\[Rule]", " ", "Red"}], ",", RowBox[{"RegionFunction", "\[Rule]", " ", RowBox[{"Function", "[", RowBox[{ RowBox[{"{", RowBox[{"x1", ",", "x2"}], "}"}], ",", RowBox[{ RowBox[{ "0", "\[LessEqual]", " ", "x1", "\[LessEqual]", " ", "1"}], "&&", " ", RowBox[{ "0", "\[LessEqual]", " ", "x2", "\[LessEqual]", " ", "1"}], " ", "&&", " ", RowBox[{"0", "\[LessEqual]", " ", RowBox[{"1", "-", "x2", "-", "x1"}], "\[LessEqual]", " ", "1"}]}]}], "]"}]}]}], "]"}]}], ";", RowBox[{"Show", "[", RowBox[{"plt", ",", RowBox[{"AspectRatio", "\[Rule]", " ", "1"}], ",", RowBox[{"Epilog", " ", "\[Rule]", " ", RowBox[{"{", RowBox[{ RowBox[{"Thickness", "[", "0.005", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.1"}], ",", RowBox[{"-", "0.05"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", "Red", ",", "14"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"1.1", ",", RowBox[{"-", "0.05"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", "Red", ",", "14"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.05"}], ",", "1.1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", "Red", ",", "14"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"P", "\[Equal]", " ", "760"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\<\!\(\*SubscriptBox[\(A\), \(1\)]\)\>\"", ",", RowBox[{"{", RowBox[{"0.69", ",", RowBox[{"-", "0.05"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".49", ",", "0", ",", "0"}], "]"}], ",", "14"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\<\!\(\*SubscriptBox[\(A\), \(2\)]\)\>\"", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.1"}], ",", "0.83"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".49", ",", "0", ",", "0"}], "]"}], ",", "14"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\<\!\(\*SubscriptBox[\(A\), \(3\)]\)\>\"", ",", RowBox[{"{", RowBox[{"0.68", ",", "0.36"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".49", ",", "0", ",", "0"}], "]"}], ",", "14"}], "]"}], ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"\"\<\!\(\*SubscriptBox[\(A\), \(4\)]\)\>\"", ",", RowBox[{"{", RowBox[{"0.25", ",", "0.38"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".49", ",", "0", ",", "0"}], "]"}], ",", "14"}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".49", ",", "0", ",", "0"}], "]"}], ",", RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0.6552", ",", "0"}], "}"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0", ",", "0.7907"}], "}"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0.2290", ",", "0.3321"}], "}"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0.6613", ",", "0.3387"}], "}"}], "]"}]}], "}"}], ",", RowBox[{"PointSize", "[", "0.03", "]"}]}], "]"}]}], "}"}]}], ",", RowBox[{"ImageSize", "\[Rule]", " ", RowBox[{"{", RowBox[{"500", ",", "400"}], "}"}]}], ",", RowBox[{"ImagePadding", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"70", ",", "90"}], "}"}], ",", RowBox[{"{", RowBox[{"25", ",", "48"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotRangeClipping", "\[Rule]", "False"}]}], "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"P", ",", "760", ",", "\"\\""}], "}"}], ",", "100", ",", "800", ",", "20", ",", RowBox[{"Appearance", "\[Rule]", " ", "\"\\""}]}], "}"}], ",", RowBox[{"ControlPlacement", "\[Rule]", " ", "Top"}]}], "]"}]], "Input", CellChangeTimes->{ 3.35696210375764*^9, {3.45301410296875*^9, 3.45301418778125*^9}, { 3.45301428728125*^9, 3.4530145775*^9}, {3.45301460984375*^9, 3.45301464090625*^9}, {3.453014689109375*^9, 3.45301481775*^9}, { 3.4530149465*^9, 3.45301510140625*^9}, {3.453015650640625*^9, 3.453015661796875*^9}, {3.48542480603125*^9, 3.485424957265625*^9}, { 3.485425319203125*^9, 3.485425336203125*^9}, {3.4854253729375*^9, 3.485425385890625*^9}, {3.48542543440625*^9, 3.485425555859375*^9}, { 3.485425699734375*^9, 3.4854258006875*^9}, 3.485425838453125*^9, 3.48542596846875*^9, {3.485426045484375*^9, 3.485426108453125*^9}, { 3.485426183671875*^9, 3.485426196390625*^9}, {3.485426247625*^9, 3.485426283640625*^9}, {3.485426353265625*^9, 3.485426475984375*^9}, { 3.485426556359375*^9, 3.485426562*^9}, {3.485486977375*^9, 3.485486981703125*^9}, {3.485487179765625*^9, 3.485487212015625*^9}, { 3.485487592203125*^9, 3.485487606796875*^9}, {3.485488123875*^9, 3.48548812540625*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`P$$ = 760, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`P$$], 760, "total pressure"}, 100, 800, 20}}, Typeset`size$$ = {500., {198., 202.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`P$1449053$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`P$$ = 760}, "ControllerVariables" :> { Hold[$CellContext`P$$, $CellContext`P$1449053$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`plt$, $CellContext`y1$, $CellContext`y2$, \ $CellContext`y3$, $CellContext`x1$, $CellContext`x2$, $CellContext`x3$, \ $CellContext`Psat1$, $CellContext`Psat2$, $CellContext`Psat3$, \ $CellContext`GAM1$, $CellContext`GAM2$, $CellContext`GAM3$, $CellContext`T$, \ $CellContext`Tbp$}, $CellContext`R = 1.987; $CellContext`Aa2 = 7.63132; $CellContext`Ba2 = 1566.69; $CellContext`Ca2 = 273.419; $CellContext`Aa1 = 6.95465; $CellContext`Ba1 = 1170.966; $CellContext`Ca1 = 226.232; $CellContext`Aa3 = 8.08097; $CellContext`Ba3 = 1582.271; $CellContext`Ca3 = 239.726; $CellContext`Psat1$ = 10^($CellContext`Aa1 - $CellContext`Ba1/($CellContext`T$ + \ $CellContext`Ca1)); $CellContext`Psat2$ = 10^($CellContext`Aa2 - $CellContext`Ba2/($CellContext`T$ + \ $CellContext`Ca2)); $CellContext`Psat3$ = 10^($CellContext`Aa3 - $CellContext`Ba3/($CellContext`T$ + \ $CellContext`Ca3)); $CellContext`l12 = -506.8518; $CellContext`l21 = 116.1171; $CellContext`l13 = -361.7944; $CellContext`l31 = 1694.024; $CellContext`l23 = -124.9328; $CellContext`l32 = 551.4545; $CellContext`V1 = 80.7; $CellContext`V2 = 74.; $CellContext`V3 = 40.7; $CellContext`A12 = ($CellContext`V2/$CellContext`V1) Exp[(-$CellContext`l12)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`A13 = ($CellContext`V3/$CellContext`V1) Exp[(-$CellContext`l13)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`A32 = ($CellContext`V2/$CellContext`V3) Exp[(-$CellContext`l32)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`A21 = ($CellContext`V1/$CellContext`V2) Exp[(-$CellContext`l21)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`A31 = ($CellContext`V1/$CellContext`V3) Exp[(-$CellContext`l31)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`A23 = ($CellContext`V3/$CellContext`V2) Exp[(-$CellContext`l23)/($CellContext`R ($CellContext`T$ + 273.15))]; $CellContext`GAM1$[ Pattern[$CellContext`x1, Blank[]], Pattern[$CellContext`x2, Blank[]], Pattern[$CellContext`x3, Blank[]]] := Exp[-Log[$CellContext`x1 + $CellContext`x2 $CellContext`A12 + \ $CellContext`x3 $CellContext`A13] + 1 - ($CellContext`x1/($CellContext`x1 + $CellContext`x2 \ $CellContext`A12 + $CellContext`x3 $CellContext`A13) + $CellContext`x2 \ ($CellContext`A21/($CellContext`x1 $CellContext`A21 + $CellContext`x2 + \ $CellContext`x3 $CellContext`A23)) + $CellContext`x3 \ ($CellContext`A31/($CellContext`x1 $CellContext`A31 + $CellContext`x2 \ $CellContext`A32 + $CellContext`x3)))]; $CellContext`GAM2$[ Pattern[$CellContext`x1, Blank[]], Pattern[$CellContext`x2, Blank[]], Pattern[$CellContext`x3, Blank[]]] := Exp[-Log[$CellContext`x1 $CellContext`A21 + $CellContext`x2 + \ $CellContext`x3 $CellContext`A23] + 1 - ($CellContext`x1 ($CellContext`A12/($CellContext`x1 + \ $CellContext`x2 $CellContext`A12 + $CellContext`x3 $CellContext`A13)) + \ $CellContext`x2/($CellContext`x1 $CellContext`A21 + $CellContext`x2 + \ $CellContext`x3 $CellContext`A23) + $CellContext`x3 \ ($CellContext`A32/($CellContext`x1 $CellContext`A31 + $CellContext`x2 \ $CellContext`A32 + $CellContext`x3)))]; $CellContext`GAM3$[ Pattern[$CellContext`x1, Blank[]], Pattern[$CellContext`x2, Blank[]], Pattern[$CellContext`x3, Blank[]]] := Exp[-Log[$CellContext`x1 $CellContext`A31 + $CellContext`x2 \ $CellContext`A32 + $CellContext`x3] + 1 - ($CellContext`x1 ($CellContext`A13/($CellContext`x1 + \ $CellContext`x2 $CellContext`A12 + $CellContext`x3 $CellContext`A13)) + \ $CellContext`x2 ($CellContext`A23/($CellContext`x1 $CellContext`A21 + \ $CellContext`x2 + $CellContext`x3 $CellContext`A23)) + \ $CellContext`x3/($CellContext`x1 $CellContext`A31 + $CellContext`x2 \ $CellContext`A32 + $CellContext`x3))]; $CellContext`y1$ = \ $CellContext`GAM1$[$CellContext`x1$, $CellContext`x2$, $CellContext`x3$] \ $CellContext`Psat1$ $CellContext`x1$/$CellContext`P$$; $CellContext`y2$ = \ $CellContext`GAM2$[$CellContext`x1$, $CellContext`x2$, $CellContext`x3$] \ $CellContext`Psat2$ $CellContext`x2$/$CellContext`P$$; $CellContext`y3$ = \ $CellContext`GAM3$[$CellContext`x1$, $CellContext`x2$, $CellContext`x3$] \ $CellContext`Psat3$ $CellContext`x3$/$CellContext`P$$; $CellContext`x3$ = 1 - $CellContext`x1$ - $CellContext`x2$; $CellContext`Tbp$[ PatternTest[ Pattern[$CellContext`x1$, Blank[]], NumericQ], PatternTest[ Pattern[$CellContext`x2$, Blank[]], NumericQ], PatternTest[ Pattern[$CellContext`x3$, Blank[]], NumericQ]] := ReplaceAll[$CellContext`T$, FindRoot[$CellContext`x1$ $CellContext`Psat1$ \ $CellContext`GAM1$[$CellContext`x1$, $CellContext`x2$, $CellContext`x3$] + \ $CellContext`x2$ $CellContext`Psat2$ $CellContext`GAM2$[$CellContext`x1$, \ $CellContext`x2$, $CellContext`x3$] + $CellContext`x3$ $CellContext`Psat3$ \ $CellContext`GAM3$[$CellContext`x1$, $CellContext`x2$, $CellContext`x3$] == \ $CellContext`P$$, {$CellContext`T$, 50, 70}]]; $CellContext`plt$ = StreamPlot[ ReplaceAll[{$CellContext`x1$ - $CellContext`y1$, $CellContext`x2$ - \ $CellContext`y2$}, $CellContext`T$ -> $CellContext`Tbp$[$CellContext`x1$, \ $CellContext`x2$, $CellContext`x3$]], {$CellContext`x1$, 0, 1}, {$CellContext`x2$, 0, 1}, StreamPoints -> 100, StreamScale -> Large, StreamStyle -> Red, RegionFunction -> Function[{$CellContext`x1, $CellContext`x2}, And[ 0 <= $CellContext`x1 <= 1, 0 <= $CellContext`x2 <= 1, 0 <= 1 - $CellContext`x2 - $CellContext`x1 <= 1]]]; Show[$CellContext`plt$, AspectRatio -> 1, Epilog -> { Thickness[0.005], Line[{{0, 1}, {1, 0}}], Line[{{0, 0}, {1, 0}}], Line[{{0, 1}, {0, 0}}], Style[ Text["methanol", {-0.1, -0.05}, {-1, 0}], Red, 14], Style[ Text["chloroform", {1.1, -0.05}, {-1, 0}], Red, 14], Style[ Text["acetone", {-0.05, 1.1}, {-1, 0}], Red, 14], If[$CellContext`P$$ == 760, { Style[ Text[ "\!\(\*SubscriptBox[\(A\), \(1\)]\)", {0.69, -0.05}, {-1, 0}], RGBColor[0.49, 0, 0], 14], Style[ Text[ "\!\(\*SubscriptBox[\(A\), \(2\)]\)", {-0.1, 0.83}, {-1, 0}], RGBColor[0.49, 0, 0], 14], Style[ Text[ "\!\(\*SubscriptBox[\(A\), \(3\)]\)", {0.68, 0.36}, {-1, 0}], RGBColor[0.49, 0, 0], 14], Style[ Text[ "\!\(\*SubscriptBox[\(A\), \(4\)]\)", {0.25, 0.38}, {-1, 0}], RGBColor[0.49, 0, 0], 14], RGBColor[0.49, 0, 0], PointSize[0.03], Point[{0.6552, 0}], Point[{0, 0.7907}], Point[{0.229, 0.3321}], Point[{0.6613, 0.3387}]}, PointSize[0.03]]}, ImageSize -> {500, 400}, ImagePadding -> {{70, 90}, {25, 48}}, PlotRangeClipping -> False]], "Specifications" :> {{{$CellContext`P$$, 760, "total pressure"}, 100, 800, 20, Appearance -> "Labeled"}}, "Options" :> {ControlPlacement -> Top}, "DefaultOptions" :> {}], ImageSizeCache->{547., {243., 248.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.48548721909375*^9, 3.485487607796875*^9, 3.4854881306875*^9, 3.485492687484375*^9}] }, Open ]] }, Open ]] }, WindowSize->{717, 631}, WindowMargins->{{251, Automatic}, {8, Automatic}}, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (November 10, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 772, 20, 212, "Title"], Cell[1342, 44, 450, 11, 84, "Subsubtitle"], Cell[1795, 57, 290, 4, 44, "Subsubtitle"], Cell[CellGroupData[{ Cell[2110, 65, 18159, 458, 1091, "Input"], Cell[20272, 525, 9333, 179, 508, "Output"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)