Skip to main content
Chemistry LibreTexts

Test page

  • Page ID
  • \( \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}}\)

      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
      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.


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


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

      $\displaystyle \frac{R T}{V_{m} - b} - \frac{a}{V_{m}^{2}}$
      pcr,Vcr,Tcr=[critpoint[i] for i in range(len(critpoint))]
      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?