﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?application progid="SMath Studio Desktop" version="1.0.8348.30405"?>
<worksheet xmlns="http://smath.info/schemas/worksheet/1.0">
  <settings ppi="96">
    <identity>
      <id>dc51bf9c-5d91-4483-895d-2b2e06c4b607</id>
      <revision>89</revision>
    </identity>
    <metadata lang="eng">
      <author>Alvaro Diaz Falconi</author>
    </metadata>
    <calculation>
      <precision>4</precision>
      <exponentialThreshold>5</exponentialThreshold>
      <trailingZeros>false</trailingZeros>
      <significantDigitsMode>false</significantDigitsMode>
      <roundingMode>0</roundingMode>
      <approximateEqualAccuracy>10</approximateEqualAccuracy>
      <fractions>decimal</fractions>
    </calculation>
    <pageModel active="true" viewMode="0" printGrid="false" printAreas="true" simpleEqualsOnly="false" printBackgroundImages="true">
      <paper id="1" orientation="Portrait" width="850" height="1100" />
      <margins left="39" right="39" top="39" bottom="39" />
      <footer alignment="Center" color="#a9a9a9">&amp;[PAGENUM] / &amp;[COUNT]</footer>
      <backgrounds />
    </pageModel>
    <dependencies>
      <assembly name="SMath Studio Desktop" version="1.0.8348.30405" guid="a37cba83-b69c-4c71-9992-55ff666763bd" />
      <assembly name="MathRegion" version="1.11.8348.30405" guid="02f1ab51-215b-466e-a74d-5d8b1cf85e8d" />
      <assembly name="Custom Functions" version="1.1.8051.30522" guid="18dadffd-79a3-4cf9-aee1-d66deb0ea720" />
      <assembly name="SpecialFunctions" version="1.12.8348.30405" guid="2814e667-4e12-48b1-8d51-194e480eabc5" />
      <assembly name="TextRegion" version="1.11.8348.30405" guid="485d28c5-349a-48b6-93be-12a35a1c1e39" />
      <assembly name="AreaRegion" version="1.11.8348.30405" guid="4974b228-4974-44cf-8274-bf2936b4a766" />
      <assembly name="Nonlinear Solvers" version="1.1.7097.23301" guid="618b7e96-330a-406a-b055-9e577672f0b8" />
      <assembly name="CoolProp Wrapper" version="6.4.8214.13502" guid="ca92ef03-c7da-4888-98ad-528482733e2f" />
    </dependencies>
  </settings>
  <regions type="content">
    <region top="0" color="#000000">
      <area collapsed="false" />
      <region left="18" top="18" width="365" height="26" color="#000000" bgColor="#ffff80" fontSize="10">
        <math>
          <input>
            <e type="operand">Fluids</e>
            <e type="operand" style="string">ETHANE</e>
            <e type="operand" style="string">METHANE</e>
            <e type="operand" style="string">PROPANE</e>
            <e type="function" args="3">stack</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="414" top="18" width="151" height="26" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">n</e>
            <e type="operand">Fluids</e>
            <e type="function" args="1">length</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="18" top="54" width="189" height="26" color="#000000" bgColor="#ffff80" fontSize="10">
        <math>
          <input>
            <e type="operand">x</e>
            <e type="operand">0.5</e>
            <e type="operand">0.3</e>
            <e type="operand">0.2</e>
            <e type="function" args="3">stack</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="243" top="54" width="75" height="37" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">x</e>
            <e type="function" args="1">sum</e>
          </input>
          <result action="numeric">
            <e type="operand">1</e>
          </result>
        </math>
      </region>
      <region left="378" top="54" width="70" height="24" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">Mix</e>
            <e type="operand" style="string"></e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="18" top="90" width="442" height="55" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">i</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="2">range</e>
            <e type="operand">Mix</e>
            <e type="operand">Mix</e>
            <e type="operand" style="string">&amp;</e>
            <e type="operand">Fluids</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="operand" style="string">[</e>
            <e type="operand">x</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="function" args="1">var2str</e>
            <e type="operand" style="string">]</e>
            <e type="function" args="6">concat</e>
            <e type="operator" args="2">:</e>
            <e type="function" args="3">for</e>
          </input>
        </math>
      </region>
      <region left="18" top="144" width="492" height="26" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">Mix</e>
            <e type="operand">Mix</e>
            <e type="operand">2</e>
            <e type="function" args="2">substr</e>
            <e type="operator" args="2">:</e>
          </input>
          <result action="numeric">
            <e type="operand" style="string">ETHANE[0.5]&amp;METHANE[0.3]&amp;PROPANE[0.2]</e>
          </result>
        </math>
      </region>
      <region left="18" top="180" width="82" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
        <math>
          <input>
            <e type="operand">To</e>
            <e type="operand">600</e>
            <e type="operand" style="unit">K</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="126" top="180" width="98" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
        <math>
          <input>
            <e type="operand">Po</e>
            <e type="operand">150</e>
            <e type="operand" style="unit">kPa</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="261" top="180" width="359" height="24" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>
              <span style="font-weight: bold;">Objective:</span> find Vo @ To, Po using Redlich-Kwong</p>
          </content>
        </text>
      </region>
      <region left="18" top="225" width="399" height="63" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">Tc</e>
            <e type="operand" style="string">TCRIT</e>
            <e type="operand">Fluids</e>
            <e type="function" args="2">CoolProp_Props1</e>
            <e type="function" args="1">vectorize</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">K</e>
          </contract>
          <result action="numeric">
            <e type="operand">305.322</e>
            <e type="operand">190.564</e>
            <e type="operand">369.89</e>
            <e type="operand">3</e>
            <e type="operand">1</e>
            <e type="function" args="5">mat</e>
          </result>
        </math>
      </region>
      <region left="486" top="225" width="153" height="24" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>Critical properties</p>
          </content>
        </text>
      </region>
      <region left="18" top="288" width="407" height="63" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">Pc</e>
            <e type="operand" style="string">PCRIT</e>
            <e type="operand">Fluids</e>
            <e type="function" args="2">CoolProp_Props1</e>
            <e type="function" args="1">vectorize</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">MPa</e>
          </contract>
          <result action="numeric">
            <e type="operand">4.8722</e>
            <e type="operand">4.5992</e>
            <e type="operand">4.2512</e>
            <e type="operand">3</e>
            <e type="operand">1</e>
            <e type="function" args="5">mat</e>
          </result>
        </math>
      </region>
      <region left="18" top="360" width="306" height="64" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">b</e>
            <e type="operand">2</e>
            <e type="operand">3</e>
            <e type="function" args="2">nthroot</e>
            <e type="operand">1</e>
            <e type="operator" args="2">-</e>
            <e type="operand">3</e>
            <e type="operator" args="2">/</e>
            <e type="operand" style="unit">mol</e>
            <e type="operand" style="unit">K</e>
            <e type="operator" args="2">*</e>
            <e type="operand" style="unit">J</e>
            <e type="operator" args="2">/</e>
            <e type="operator" args="2">*</e>
            <e type="operand" style="unit">R.m</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operator" args="2">*</e>
            <e type="operand">Tc</e>
            <e type="operand">Pc</e>
            <e type="operator" args="2">/</e>
            <e type="operator" args="2">*</e>
            <e type="function" args="1">vectorize</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">L</e>
            <e type="operand" style="unit">mol</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">0.3753</e>
            <e type="operand">0.2482</e>
            <e type="operand">0.5211</e>
            <e type="operand">3</e>
            <e type="operand">1</e>
            <e type="function" args="5">mat</e>
          </result>
        </math>
      </region>
      <region left="423" top="360" width="337" height="24" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>volume constant correction for each compound</p>
          </content>
        </text>
      </region>
      <region left="18" top="423" width="227" height="69" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">b'</e>
            <e type="operand">x</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="operand">b</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="operator" args="2">*</e>
            <e type="operand">i</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="4">sum</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">L</e>
            <e type="operand" style="unit">mol</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">0.3663</e>
          </result>
        </math>
      </region>
      <region left="423" top="423" width="337" height="40" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>volume constant correction for the mixture. Notice that it is lineal in x</p>
          </content>
        </text>
      </region>
      <region left="18" top="504" width="355" height="67" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">a</e>
            <e type="operand">1</e>
            <e type="operand">9</e>
            <e type="operand">2</e>
            <e type="operand">3</e>
            <e type="function" args="2">nthroot</e>
            <e type="operand">1</e>
            <e type="operator" args="2">-</e>
            <e type="bracket">(</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">/</e>
            <e type="operand" style="unit">R.m</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operator" args="2">*</e>
            <e type="operand">Tc</e>
            <e type="operand">2.5</e>
            <e type="operator" args="2">^</e>
            <e type="operand">Pc</e>
            <e type="operator" args="2">/</e>
            <e type="operator" args="2">*</e>
            <e type="function" args="1">vectorize</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">J</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">K</e>
            <e type="function" args="1">sqrt</e>
            <e type="operator" args="2">*</e>
            <e type="operand" style="unit">mol</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">Pa</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">9.88</e>
            <e type="operand">3.2211</e>
            <e type="operand">18.2918</e>
            <e type="operand">3</e>
            <e type="operand">1</e>
            <e type="function" args="5">mat</e>
          </result>
        </math>
      </region>
      <region left="423" top="504" width="351" height="40" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>attractive potential of molecules coefficient for each compound</p>
          </content>
        </text>
      </region>
      <region left="18" top="594" width="155" height="71" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">i</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="2">range</e>
            <e type="operand">j</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="2">range</e>
            <e type="operand">α</e>
            <e type="operand">i</e>
            <e type="operand">j</e>
            <e type="function" args="3">el</e>
            <e type="operand">a</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="operand">a</e>
            <e type="operand">j</e>
            <e type="function" args="2">el</e>
            <e type="operator" args="2">*</e>
            <e type="function" args="1">sqrt</e>
            <e type="operator" args="2">:</e>
            <e type="function" args="3">for</e>
            <e type="function" args="3">for</e>
          </input>
        </math>
      </region>
      <region left="207" top="594" width="285" height="63" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">α</e>
          </input>
          <contract>
            <e type="operand" style="unit">J</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">K</e>
            <e type="function" args="1">sqrt</e>
            <e type="operator" args="2">*</e>
            <e type="operand" style="unit">mol</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">Pa</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">9.88</e>
            <e type="operand">5.6413</e>
            <e type="operand">13.4433</e>
            <e type="operand">5.6413</e>
            <e type="operand">3.2211</e>
            <e type="operand">7.6759</e>
            <e type="operand">13.4433</e>
            <e type="operand">7.6759</e>
            <e type="operand">18.2918</e>
            <e type="operand">3</e>
            <e type="operand">3</e>
            <e type="function" args="11">mat</e>
          </result>
        </math>
      </region>
      <region left="513" top="594" width="227" height="72" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>The "a" coefficient for the mixture is not lineal in x, assuming that α(i,j) is the geometric mean of a(i) &amp; a(j)</p>
          </content>
        </text>
      </region>
      <region left="18" top="684" width="340" height="69" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">a'</e>
            <e type="operand">x</e>
            <e type="operand">i</e>
            <e type="function" args="2">el</e>
            <e type="operand">x</e>
            <e type="operand">j</e>
            <e type="function" args="2">el</e>
            <e type="operator" args="2">*</e>
            <e type="operand">α</e>
            <e type="operand">i</e>
            <e type="operand">j</e>
            <e type="function" args="3">el</e>
            <e type="operator" args="2">*</e>
            <e type="operand">j</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="4">sum</e>
            <e type="operand">i</e>
            <e type="operand">1</e>
            <e type="operand">n</e>
            <e type="function" args="4">sum</e>
            <e type="operator" args="2">:</e>
          </input>
          <contract>
            <e type="operand" style="unit">J</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">K</e>
            <e type="function" args="1">sqrt</e>
            <e type="operator" args="2">*</e>
            <e type="operand" style="unit">mol</e>
            <e type="operand">2</e>
            <e type="operator" args="2">^</e>
            <e type="operand" style="unit">Pa</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">8.7937</e>
          </result>
        </math>
      </region>
      <region left="423" top="684" width="351" height="40" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>attractive potential of molecules coefficient for the mixture</p>
          </content>
        </text>
      </region>
      <region left="18" top="765" width="549" height="24" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>Now we can solve the Redlich-Kwong for the mixture like it was a compound</p>
          </content>
        </text>
      </region>
      <region left="18" top="801" width="451" height="52" color="#000000" fontSize="10">
        <math optimize="2">
          <input>
            <e type="operand">Vo</e>
            <e type="operand">Po</e>
            <e type="operand" style="unit">R.m</e>
            <e type="operand">To</e>
            <e type="operator" args="2">*</e>
            <e type="operand">Vo</e>
            <e type="operand">b'</e>
            <e type="operator" args="2">-</e>
            <e type="operator" args="2">/</e>
            <e type="operand">a'</e>
            <e type="operand">To</e>
            <e type="function" args="1">sqrt</e>
            <e type="operand">Vo</e>
            <e type="operator" args="2">*</e>
            <e type="operand">Vo</e>
            <e type="operand">b'</e>
            <e type="operator" args="2">+</e>
            <e type="bracket">(</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">/</e>
            <e type="operator" args="2">-</e>
            <e type="operator" args="2">≡</e>
            <e type="operand">Vo</e>
            <e type="operand">1</e>
            <e type="operand" style="unit">L</e>
            <e type="operand" style="unit">mol</e>
            <e type="operator" args="2">/</e>
            <e type="operator" args="2">*</e>
            <e type="operator" args="2">≡</e>
            <e type="function" args="2">FindRoot</e>
            <e type="operator" args="2">:</e>
          </input>
        </math>
      </region>
      <region left="504" top="801" width="132" height="41" color="#000000" bgColor="#80ff80" fontSize="10">
        <math>
          <input>
            <e type="operand">Vo</e>
          </input>
          <contract>
            <e type="operand" style="unit">L</e>
            <e type="operand" style="unit">mol</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">33.5544</e>
          </result>
        </math>
      </region>
      <region left="18" top="864" width="131" height="24" color="#000000" fontSize="10" isBreakable="false">
        <text lang="eng" fontFamily="Consolas" fontSize="10">
          <content>
            <p>Coolprop result:</p>
          </content>
        </text>
      </region>
      <region left="234" top="864" width="439" height="45" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand" style="string">M</e>
            <e type="operand">Mix</e>
            <e type="function" args="2">CoolProp_Props1</e>
            <e type="operand" style="string">D</e>
            <e type="operand" style="string">T</e>
            <e type="operand">To</e>
            <e type="operand" style="string">P</e>
            <e type="operand">Po</e>
            <e type="operand">Mix</e>
            <e type="function" args="6">CoolProp_Props</e>
            <e type="operator" args="2">/</e>
          </input>
          <contract>
            <e type="operand" style="unit">L</e>
            <e type="operand" style="unit">mol</e>
            <e type="operator" args="2">/</e>
          </contract>
          <result action="numeric">
            <e type="operand">33.2394</e>
          </result>
        </math>
      </region>
      <region left="18" top="927" width="60" height="24" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">Alvaro</e>
          </input>
        </math>
      </region>
      <region left="216" top="927" width="257" height="26" color="#000000" fontSize="10">
        <math>
          <input>
            <e type="operand">4</e>
            <e type="function" args="1">appVersion</e>
          </input>
          <result action="numeric">
            <e type="operand" style="string">1.0.8348.30405</e>
          </result>
        </math>
      </region>
      <region top="963" color="#000000">
        <area terminator="true" />
      </region>
    </region>
  </regions>
</worksheet>