h1

Notebook 1.5: Critical Point Coordinates from Equations of State

January 16, 2010

This notebook uses Euler’s symbolic math capabilities to derive the critical point pressure, volume, temperature, and compression factor for a van der Waals gas. It then asks students to repeat the calculations for a Dieterici gas.

To use the notebook:

  • Download and install the Euler Math Toolbox.
  • Cut and paste the code below into a plain text file.
  • Save the file with an .en file extension.
  • Double-click the file. It should open up in the Toolbox.

All of the notebooks in this series are specifically keyed to Atkins’ Physical Chemistry, 8th edition. Italics mark the items students had to fill in themselves.

------------------------------------snip here-----------------------
 Notebook 1.5: Calculating Critical Point Coordinates from Equations of State
% 
% In this notebook, we'll use Euler's symbolic math capabilities to
% derive the critical point pressure, volume,
% temperature, and compression factor for a van der Waals gas. You'll
% then repeat the calculations yourself for a Dieterici gas.
% 
% We saw in the last notebook that Euler calls a separate package 
% called Maxima to do symbolic math.
% When you want numerical answers, use Euler; but if you want to 
% solve or manipulate equations, send your commands to
% Maxima by typing a colon (':') after the prompt.
% 
% Here is the van der Waals equation, in Maxima:
 
>: P : R*T/(V-b)-a/V^2
 
                                    R T    a
                                   ----- - --
                                   V - b    2
                                           V
 
% 
% Notice that Maxima uses a colon rather than an equals sign to set
% variables. Notice also that the result is symbolic, rather than 
% numerical, so you don't have to assign numbers to R, T, a, etc. as 
% you must from a regular Euler prompt.
% 
% Maxima doesn't simplify expressions automatically. You have to be
% explicit about how you want an expression 'simplified'. For example,
% you can remove parent
 
% Maxima can differentiate expressions with the diff(expr,x) function, 
% where expr is the expression and x is the variable you want to 
% differentiate. Let's calculate the first derivative of P with respect
% to V, and call it dPdV:
% 
>: dPdV : diff(P,V)
 
                                 2 a     R T
                                 --- - --------
                                  3           2
                                 V     (V - b)
 
% 
% Call the second derivative d2PdV2:
% 
>: d2PdV2 : diff(dPdV,V)
 
                                  2 R T     6 a
                                 -------- - ---
                                        3    4
                                 (V - b)    V
 
% 
% We could have calculated the second derivative more simply as
% 
>: diff(P,V,2)
 
                                  2 R T     6 a
                                 -------- - ---
                                        3    4
                                 (V - b)    V
 
% 
% where the third argument to diff is the order of the derivative.
% 
% Now let's calculate the temperature and volume of a van der Waals
% gas at the critical point, using Maxima's solve function.
% The first argument of solve is an array of equations to solve.
% The second argument is an array of unknowns to solve for.
% 
% 
>: solve([dPdV=0,d2PdV2=0],[T,V])
 
                                            8 a
                     [[T = 0, V = b], [T = ------, V = 3 b]]
                                           27 b R
 
% 
% We could also have typed 
% 
>: solve([diff(P,V)=0, diff(P,V,2)=0], [T, V])
% 
% for the same result. We can't put P into the array of unknowns,
% because we've assigned an expression to P already.
% 
% Notice that there are two solutions- one at absolute zero, where all
% of the volume is taken up by the molecules- and the "real" critical 
% point. Let's call the second solution "criticalpoint":
>: criticalpoint : %[2]
 
                                    8 a
                              [T = ------, V = 3 b]
                                   27 b R
 
% 
% The % alone means "the last thing calculated in Maxima". The last
% thing was an array, and we are selecting the second element with the 
% bracketed 2.
% 
% We can now use Maxima's "at" function to calculate the coordinates
% of the critical point. The at function's first argument is the 
% variable we want to solve for; the second argument is an array of
% equations that hold at the point where the solution exists.
% 
>: Pc : at(P,criticalpoint)
 
                                        a
                                      -----
                                          2
                                      27 b
 
>: Tc : at(T,criticalpoint)
 
                                      8 a
                                     ------
                                     27 b R
 
>: Vc : at(V,criticalpoint)
 
                                       3 b
 
% 
% Finally, we calculate Zc, the compressibility factor at the critical
% point:
% 
>: Zc : Pc*Vc/(R*Tc)
 
                                        3
                                        -
                                        8
 
% 
% -----------------------------------------------------------------
% In the space below, derive expressions for Pc, Vc, Tc, and Zc for
% a Dieterici gas. You can check your results against Table 1.7 in
% Atkins. 
% 
% We'll clear all the variables above using 'reset':
>reset;
>: P : R*T*exp(-a/(R*T*V))/(V-b)
 
                                            a
                                        - -----
                                          R T V
                                  R T %e
                                  -------------
                                      V - b
 
>: dPdV : diff(P,V)
 
                                   a               a
                               - -----         - -----
                                 R T V           R T V
                           a %e          R T %e
                           ----------- - -------------
                            2                     2
                           V  (V - b)      (V - b)
 
>: d2PdV2 : diff(dPdV, V)
 
                    a               a                a                 a
                - -----         - -----          - -----           - -----
                  R T V     2     R T V            R T V             R T V
          2 a %e           a  %e           2 a %e          2 R T %e
        - ------------- + -------------- - ------------- + ---------------
            3                  4             2        2              3
           V  (V - b)     R T V  (V - b)    V  (V - b)        (V - b)
 
>: solve([dPdV=0,d2PdV2=0],[T,V])
 
                                             a
                     [[T = 0, V = b], [T = -----, V = 2 b]]
                                           4 b R
 
>: criticalpoint : %[2]
 
                                     a
                              [T = -----, V = 2 b]
                                   4 b R
 
>: Pc : at(P,criticalpoint)
 
                                       - 2
                                     %e    a
                                     -------
                                         2
                                      4 b
 
>: Tc : at(T,criticalpoint)
 
                                        a
                                      -----
                                      4 b R
 
>: Vc : at(V,criticalpoint)
 
                                       2 b
 
>: Zc : Pc*Vc/(R*Tc)
 
                                         - 2
                                     2 %e
 
% 
% Is Zc for the Dieterici equation different than Zc for the van der
% Waals eqution? Which is closer to the experimental values of Zc given
% in your text?
% 
>3/8
                   0.375 
>2*%e^-2
         0.2706705664732 
% ANSWER: The experimental values in Table 1.5 range from 0.27 to about 
% 0.31; The Dieterici equation clearly gives more realistic results than
% the van der Waals equation.
------------------------------------snip here----------------
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: