Skip to main content
Chemistry LibreTexts

Test page

  • Page ID
    222340
    • 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

       

      • Was this article helpful?