Skip to main content
Chemistry LibreTexts

Test page

  • Page ID
    222340
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

      Here we can see how to determine the connection between the equation of state parameters and the critical point. We'll do the math with SymPy and see how it looks.

      First we will import some functions that will be useful, set up some variables for things like pressure, temperature, volume, etc. as well as constants like R, and define an equation of state.

      from sympy import diff, solve, Eq, symbols, init_printing
      init_printing()
      p,V,T,pc,Vc,Tc=symbols("p,V_m,T,p_c,V_c,T_c",positive=True, real=True) # Setup variables
      R,a,b=symbols("R, a, b", positive=True,real=True,constant=True) # Setup constants
      
      p_expr=R*T/(V-b)-a/V**2 # van der Waals gas

      Since the critical point is defined by an inflection point in the isotherm, let's take some derivatives in order to locate this point.

      dp=diff(p_expr,V)
      ddp=diff(p_expr,V,2)

      For the purposes of displaying the equations, here we set up the three equations in equation form. 

      p_eq=Eq(p,p_expr)
      dp_eq=Eq(0,dp)
      ddp_eq=Eq(0,ddp)

       So the equation of state and the two derivatives of it are:

      display(p_eq,dp_eq,ddp_eq)
      $\displaystyle \frac{R T}{V_{m} - b} - \frac{a}{V_{m}^{2}}$
      critpoint,=solve([p_eq,dp_eq,ddp_eq],[p,V,T])
      pcr,Vcr,Tcr=[critpoint[i] for i in range(len(critpoint))]
      display(Eq(pc,pcr),Eq(Vc,Vcr),Eq(Tc,Tcr))
      ---------------------------------------------------------------------------
      NameError                                 Traceback (most recent call last)
      <ipython-input-2-3049ffa2fc8a> in <module>
      ----> 1 critpoint,=solve([p_eq,dp_eq,ddp_eq],[p,V,T])
            2 pc,Vc,Tc=[critpoint[i] for i in range(len(critpoint))]
            3 display(pc,Vc,Tc)
      
      NameError: name 'p_eq' is not defined

       


      Test page is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

      • Was this article helpful?