Liquefying of Nitrogen & Oxygen Gaseous to Liquid Phase. Thermodynamics. How to plot solution? Solved [closed]

Process of Liquefying of air composed of 79% Nitrogen & 21% Oxygen from Gaseous to Liquid Phases as Follows:

1) When Temperature is higher than T>83 k they both are gas.

2) at T=83 k and less slightly the phase transformation take place to right O2 and to Left N2. as expected N2 Liquefy faster than O2, Where mixture are presents of both substances.

3)Finally at T=73 k both Substances are liquid with slight percentage of O2 gas.

Solved! How do i plot last part of the code my solution on same plot.

Here's the question to calcify things

Here is my full code!

t1[x_] := 77.4 + 25.27*x - 33.66*x^2 + 51.52*x^3 - 42.65*x^4 + 12.32*x^5;

t2[x_] := 77.4 + 8.372*x - 6.162*x^2 + 14.62*x^3 + 2.201*x^4 - 6.235*x^5;

p1 = Plot[{t1[x], t2[x]}, {x, 0, 1}, Frame -> True, PlotRange -> {{0, 1}, {76, 92}},
PlotLegends -> "Expressions", ImageSize -> Large]

no = 40*0.21;
nn = 40*0.79;

x1 = FindRoot[t1[x] == 78, {x, 1}]
x2 = FindRoot[t2[x] == 83, {x, 1}]
xg = x /. x1
xl = x /. x2

sol = Flatten[Thread[Solve[{xg == ngo/(ngn + ngo), xl == nlo/(nln + nlo),
no == ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}, Reals]]] /. Rule -> Equal


Plot must be similar to Figure

• You have not yet received a solution to the problem. Use xg = x /. FindRoot[t1[x] == 78, {x, 1}]; xl = x /. FindRoot[t2[x] == 83, {x, 1}]; sol = NSolve[{xg == ngo/(ngn + ngo), xl == nlo/(nln + nlo), no == ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}, Reals] Commented Mar 19, 2019 at 12:24
• i did it please check right now. Thanks for passing brother :) Commented Mar 19, 2019 at 12:28
• {ngo, nlo, ngn, nln} - is it the number of moles of oxygen and nitrogen in the gas and liquid phase? Commented Mar 19, 2019 at 12:34
• yes sir exactly Commented Mar 19, 2019 at 12:35
• it's ok if you eliminate after solution two point of nitrogen {ngn, nln} Commented Mar 19, 2019 at 12:43

t1[x_] := 77.4 + 25.27*x - 33.66*x^2 + 51.52*x^3 - 42.65*x^4 + 12.32*x^5;
t2[x_] := 77.4 + 8.372*x - 6.162*x^2 + 14.62*x^3 + 2.201*x^4 - 6.235*x^5;

pp1 = Plot[{t1[x], t2[x]}, {x, 0, 1}, Frame -> True, PlotRange -> {{0, 1}, {76, 92}},
PlotLegends -> "Expressions", ImageSize -> Large];

"Number of moles 21% nOxygen 79% nNitrogen"
no = 40*0.21;
nn = 40*0.79;

"Part Liquefying of Oxygen"

####PURE*GAS####
xg1 = x /. FindRoot[t1[x] == 83, {x, 1}]

sol1 = Flatten[Thread[Solve[{xg1 == ngo/(ngn + ngo), xl1 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g1 = Graphics[{Arrow[{{xg1, 90}, {xg1, 83}}]}];

p1 = Graphics[{Blue, PointSize[0.01], Point[{xg1, 83}]}];

####MIX####

xm1 = x /. FindRoot[t2[x] == 83, {x, 0.2, 0.6}]

sol2 = Flatten[Thread[Solve[{xg1 == ngo/(ngn + ngo), xl1 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g2 = Graphics[{Arrow[{{xg1, 83}, {xm1, 83}}]}];

p2 = Graphics[{Green, PointSize[0.01], Point[{xm1, 83}]}];

####PURE*LIQUID####

xl1 = x /. FindRoot[t2[x] == 78, {x, 0.6, 0}]

sol3 = Flatten[Thread[Solve[{xg1 == ngo/(ngn + ngo), xl1 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g3 = Graphics[{Arrow[{{xm1, 83}, {xl1, 78}}]}];

p3 = Graphics[{Red, PointSize[0.01], Point[{xl1, 78}]}];

"Part Liquefying of Nitrogen"

####PURE*GAS####
xg2 = x /. FindRoot[t1[x] == 83, {x, 1}]

sol4 = Flatten[Thread[Solve[{xg2 == ngo/(ngn + ngo), xl2 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g4 = Graphics[{Arrow[{{xg2, 90}, {xg2, 83}}]}];

p4 = Graphics[{Blue, PointSize[0.01], Point[{xg2, 83}]}];

####MIX####

xm2 = x /. FindRoot[t1[x] == 78, {x, 0.2, 0.6}]

sol5 = Flatten[Thread[Solve[{xg2 == ngo/(ngn + ngo), xl2 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g5 = Graphics[{Arrow[{{xg2, 83}, {xm2, 78}}]}];

p5 = Graphics[{Green, PointSize[0.01], Point[{xm2, 78}]}];

####PURE*LIQUID####
xl2 = x /. FindRoot[t2[x] == 78, {x, 0.6, 0}]
sol6 = Flatten[Thread[Solve[{xg2 == ngo/(ngn + ngo), xl2 == (nlo/(nln + nlo))*no ==
ngo + nlo, nn == ngn + nln}, {ngo, nlo, ngn, nln}]]] /. Rule -> Equal

g6 = Graphics[{Arrow[{{xm2, 78}, {xl2, 78}}]}];

p6 = Graphics[{Red, PointSize[0.01], Point[{xl2, 78}]}];

"Graph"
Show[{pp1, g1, g2, g3, p1, p2, p3, g4, g5, g6, p4, p5, p6},
{FrameLabel -> {"X", "T(k)"}}]