Quick viewing(Text Mode)

The Van Der Waals Equation As a Cubic Carl W

The Van Der Waals Equation As a Cubic Carl W

University of Connecticut OpenCommons@UConn

Chemistry Education Materials Department of

2015 The van der Waals as a cubic Carl W. David University of Connecticut, [email protected]

Follow this and additional works at: https://opencommons.uconn.edu/chem_educ Part of the Commons

Recommended Citation David, Carl W., "The av n der Waals Equation as a cubic" (2015). Chemistry Education Materials. 88. https://opencommons.uconn.edu/chem_educ/88 The van der Waals Equation as a Cubic

Carl W. David∗ Emeritus, Department of Chemistry University of Connecticut Storrs, Connecticut 06269-3060 (Dated: April 4, 2016) The van der Waals (from his thesis of 1873) equation is a cubic in the molar . Since this is the first studied in chemistry and physics more complicated than the ideal equation, it is noteworthy that the solution of this cubic is rarely if ever addressed. When (lowering the ) the two imaginary roots coalesce with the real root of the van der Waals equation we have the critical point. At below Tc. the equation has three real roots; we explore obtaining those roots to aid in the Maxwell construction required to obtain the vapor .

I. INTRODUCTION The reduced van der Waals pr(vr,Tr) in the T p reduced scheme, i.e., Tr = , pr = and Tc pc v vr = , where the subscript c refers to the critical tem- It is well known that the van der Waals equation is vc a cubic equation in v whose solution is rarely addressed perature, pressure and/or and r, similarly, [1, 10, 11]. There no longer exists a reason for this lack of refers to the appropriate reduced variables, is familiarity, as computer assisted calculus programs have made it simpler than ever to manipulate the complicated 8Tr 3 pr(vr,Tr) = − 2 (1) expressions that constitute the traditional cubic polyno- 3vr − 1 vr mial solutions (vide supra). Rather than trusting a com- puter calculus program, however, this paper introduces We will derive the solution to the cubic, and then use the complete solution to the cubic using elementary al- that solution in the Maxwell construction searching for gebra. the vapor pressure. In an age in which inclusion [4] in high school curricula is being questioned, it seems reasonable to ar- gue that the two years of calculus learning prior to study- III. THE GENERAL CUBIC EQUATION [7] ing physical chemistry is worth the effort. Therefore, avoiding the phrase ”integration by parts” in Winn’s pa- The general cubic equation is per [11] and avoiding the cubic solution which employs 3 2 only algebra (not counting DeMoivre’s theorem) seems x + a1x + a2x + a3 = 0 (2) bad pedagogy. Instead, we should emphasize the useful- ness of what we’ve forced students to learn, validating which Cardan transformed using the prerequisite structure that differentiates STEM edu- a cation from other fields. x = y − 1 Since this solution is rather long-winded, this paper has 3 been written in sufficient detail that it should be able to i.e., be read without resorting to paper and pencil. 3 2  a1   a1   a1  y − + a1 a1y − + a2 y − + a3 = 0 II. PRELIMINARIES 3 3 3 which expands to Consider that the Maxwell construction [6] (vide infra) requires that one has the three roots (if T < T ) of the  a2  2 a a c y3 + a − 1 y = − a3 + 1 2 − a (3) cubic van der Waals equation so that one can integrate 2 3 27 1 3 3 (pvdW − ptrial) dv from the first (smallest) to the second, and from the second to the third (largest) root (or vice which we write in the form: versa). Setting the sum of these two integrals equal to zero gives an equation whose only remaining variable is z3 + ηz + q = 0 (4) the pressure (ptrial); that solution pressure is the pre- dicted vapor pressure. This (Equation 4) is called a “reduced” cubic form (the mathematicians and chemists use the term “reduced” dif- ferently). We will solve the “reduced” equation for z → y and then take the solutions and convert them back to x ∗ [email protected] at the end of the computation. 2

IV. THE VAN DER WAALS EQUATION AS A which suggests writing CUBIC 4η 2 = −3 The van der Waals gas equation can be expanded to u

  2 so that 8Tr v 9vr 1 v3 − + 1 r + − = 0 r r p 3 3p p 4η r r r u = −3 which is of the form becomes the choice we have to make. Then, 3 2 vr + a1vr + a2vr + a3 = 0 (5) 3 4η 4q 4cos ϑ + 2 cosϑ − 3 = 0 In terms of the original cubic equation (Equation 2), we u q 4η have −3

8Tr + 1 which is a mimic of the equation we are trying to solve. a = − pr (6) 1 3 3 3q 4cos ϑ − 3cosϑ + q = 0 η 4η 3 −3 a2 = (7) pr so, we obtain and finally 3q cos3ϑ = − q 4η 1 η −3 a3 = − (8) pr or In terms of the reduced cubic Equation 4, we have 3q 3q r−3 cos3ϑ = − = − 2 q η a1 2η η η = a − (9) 2η −3 2 3 and which leads us to values of ϑ for which this equation will be true.  2 a a  We have q = − + a3 − 1 2 + a (10) 27 1 3 3 1  3q r−3 ϑ = cos−1 − Consider the known equation 3 2η η

4cos3ϑ − 3cosϑ − cos3ϑ = 0 (11) which means, back-substituting r 4η 1  3q r−3 (DeMoivre's theorem gave us Equation 11) and the afore- ucosϑ = cos cos−1 − mentioned prototype “reduced” cubic: −3 3 2η η

z3 + ηz = q (12) or, in terms of the reduced cubic equation we have r r where η and q are constants (see Equation 4) . Their 4η 1  3q −3 z = y = cos cos−1 − ≡ z commonality suggests a procedure, e.g., defining −3 3 2η η 1

z = ucosϑ Dividing this z −z1 into the original reduced cubic would yield a quadratic which then itself would be soluble, i.e., where u is the be chosen to the two forms into conformance. To carry out this agenda, we our z3 + ηz − q z3 + ηz − q = expression for z and substitute the result into our reduced q h  q i (z − z1) z − 4η cos 1 cos−1 − 3q −3 cubic, i.e., −3 3 2η η

u3cos3ϑ + ηucosϑ − q = 0 Synthetic division yields 2 and divide both sides by u3. Multiplying by 4, we obtain 2 2 ( η + z1 z1 − q z + z1z + (η + z1 ) − z − z1 4η 4q 4cos3ϑ + cosϑ − = 0 u2 u3 where the numerator of the residual is zero! 3

The other two roots of V. THE MAXWELL CONSTRUCTION [6]

2 2 z + z1z + (η + z1 ) = 0 To achieve the Maxwell construction (see Figure 1) one are needs to integrate prdvr from the lowest root to the cen- tral root, and from the central root to the largest root, p 2 2 −z1 + z − 4(η + z ) and set these two integrals equal to each other (except z = 1 1 2 2 for the sign, i. e., using the absolute magnitude of the integrals) thereby obtaining an equation for ptrial (to be and vp called pr after solution) which we declare to be the va- p 2 2 por pressure for this particular isotherm. Alternatively, −z1 − z1 − 4(η + z1 ) R z3 = one could write (pvdW −ptrial)dv = 0 with the rule that 2 vp ptrial → p when the equation is true. which lead to the second and third roots of the “reduced” The integral itself is trivial, i.e., cubic.

Z v` Z v`   8Tr 3 prdvr = − 2 dvr 1. back substituting v v 3vr − 1 vr g8T (3v g − 1) 3 3 r `n r` + − (13) We thus have for the original cubic we started this 3 (3vrg − 1 vr` vrg 3 2 discussion with: x + a1x + a2x + a3 = 0, Equation 2, (with v rather than x): r This must be set equal to the equivalent path integral from ”g” to ”`” using the trial vapor pressure, i.e., r 4η 1  3q r−3 a v = cos cos−1 − 1 r` −3 3 4η η 3 Z ` p dv = pvp (v − v ) (14) (corresponding to the z1 root of the “reduced” cubic) trial r ` g where we have employed Equation 5 and its similar form g Equation 2 to return from the reduced form to the ulti- mately desired v form of the cubic van der Waals equation so the equation whose solution yields the vapor pressure we are trying to solve. is 2 a1 2 3 We had η = a2 − 3 (Equation 9) and q = − 27 a1 + a1a2 −a3 (Equation 10). It is clear that substituting these 8T (3v − 1) 3 3 3 r `n r` + − = pvp v − v  (15) into our equation for v would lead to a fearful mess. And 3 (3v − 1 v v r r` rg then the substitutions which was Equation 6, Equation rg r` rg 7 and finally Equation 8 make evaluation possible. Un- fortunately, the equation is enormous. This equation depends on a trial pressure which itself is vp A similar discussion for each of the other two roots adjusted until the equality holds (ptrial = pr ). However, leads to explicit solutions for all three roots. as noted by Lekner[5] [8], this can be written as

8T (3v − 1) 3 3  8T 3  r `n r` + − = p v − v  = r − v − v  (16) 3 (3v − 1 v v trial r` rg 3v − 1 v2 r` rg rg r` rg r` r` or ! 8T (3v − 1) 3 3 8T 3 r `n r` + − = r − v − v  (17) 3 (3v − 1 v v 3v − 1 v2 r` rg rg r` rg rg rg since the trial pressure is the same at “`” and “g”, or ! 8T (3v − 1) 3 3  8T 3  8T 3 r `n r` + − = r − v − r + v (18) 3 (3v − 1 v v 3v − 1 v2 r` 3v − 1 v2 rg rg r` rg r` r` rg rg or “vice versa”. This last equation becomes

8T 3v − 1) 3 3  8T v 3   8T v 3  r `n r` + − = r r` − − r rg + (19) 3 3vrg − 1 vr` vrg 3vr` − 1 vr` 3vrg − 1 vrg 4 which becomes, segregating variables,     8Tr 8Trvr` 6 8Tr 8Trvrg 6 `n(3vr` − 1) − − = `n(3vrg − 1) − + (20) 3 3vr` − 1 vr` 3 3vrg − 1 vrg which is `ala Sage, var (’Tr , vr , vg , vl , pvp , pvp ’) assume (vg >0) assume (vl > vg ) assume ((3* vl -1) >0) assume ((3* vg -1) >0) p ( vr , Tr ) = 8* Tr /(3* vr -1) -3/ vr ^2 EQN1 ( Tr ,g , l ) = integrate ( p ( vr , Tr ) ,vr ,vg , vl ) print (" EQN1 = ", EQN1 ) eqn2 (g ,l , Tr ) = EQN1 ( Tr ,vg , vl ) - ( p (vl , Tr ) *l - p (vg , Tr ) * vg ) print (" eqn2 = ", eqn2 ," and the latex :") eqn3(vp,vl,Tr) = eqn2 (vg ,vl , Tr ) . expand () print(eqn3(vp,vl,Tr)) latex ( eqn3 )

8 8 8 Trvg 8 Trvl 6 6 (vp, vl, Tr) 7→ − Tr log (3 vg − 1) + Tr log (3 vl − 1) + − − + 3 3 3 vg − 1 3 vl − 1 vg vl We are looking for the best form for “solving” this equation, so we re-write it as

8T 3v − 1) 8T v 6 8T v 6 r `n r` − r r` + + r rg + = 0 (21) 3 3vrg − 1 3vr` − 1 vr` 3vrg − 1 vrg or     8Tr 3vr` − 1) vr` vrg 6 6 `n − 8Tr + + + = 0 (22) 3 3vrg − 1 3vr` − 1 3vrg − 1 vr` vrg

vp This is a transcendental equation [9]. Datum Tr pr 1 1 1 2 0.9 0.67517 3 0.8 0.49533 VI. SOLVING THE MAXWELL 4 0.7 0.34429 CONSTRUCTION GENERATED EQUATION 5 0.6 0.21505

To proceed one fixes Tr, chooses a trial pressure, ob- TABLE I. The relation between the vapor pressure and the tains the two relevant reduced , one for , temperature of the van der Waals fluid as obtained using a one for gas, evaluates the left hand side of Equation 22, spreadsheet to obtain the data presented here. compares it to zero; adjusting the trial pressure until the equation yields zero results in the final trial pressure be- ing declared the vapor pressure at that temperature. Having proved insoluble using the tools (Maxima, the isotherm itself at two points.. The locus of these Sage) available to the author, the computations were volumes represent a ruled surface in the 3-D pr − vr − Tr carried out using a spreadsheet (https://docs.google. space; this surface can be projected onto the pr−vr plane, com/spreadsheets/d/1fmfaj1sYURADmGwO5hma8_ giving rise to Figure 3, which is the familiar coexistence ujFtzE5bgDZMZ2iH5XAH8/pubhtml). Some more details locus (absent tie-lines). concerning goal seeking for the solution can be found It would have been nice had we obtained an analytic at [2] A few of the values obtained numerically for the solution of the vapor pressure as a function of tempera- vp vp vapor (pr in reduced terms) are displayed in ture, i.e., pr (Tr) which would have allowed us to take the Table 1. Figure 2 is a plot of this vapor pressure data. of this function with respect to temperature, On any given isotherm, the pressure (if Tr < 1) at and, knowing the ∆vr for a given temperature (from two vp which gas and liquid exist in equilibrium (pr ) intersects of the roots of the cubic, i.e., not the central root), ob- 5 tained the heat of vaporization. Sadly, this did not come least doesn’t help me in understanding the produced solu- about. tion). It is not known what Mathematica and Maple (or others) do with this equation. Further, for several values The use of computer assisted calculus programs al- of the pressure and temperature, the aforementioned pro- luded to above for manipulation of the equations consid- grams reported imaginary values of the reduced volumes, ered in this paper reveals some inherent problems which at temperatures below the critical temperature. The re- the reader is forewarned about. Specifically, the solution ported vapor pressures reported here had to be obtained of Equation 13 fails using Maxima and SageMath (or at by explicit computation using a spreadsheet. 6

VII. FIGURES

FIG. 1. The Maxwell construction needed to determine the vapor pressure. Here, we choose a working (trial) pressure, integrate (pvdW − ptrial)dv from the smallest to the intermediate intersection ( 2), and from the intermediate to the largest intersection (Area 1), and compare the two . Adjusting the pressure until the areas are equal but opposite in sign fixes R that resultant trial pressure as the vapor pressure. Technically, this is (pvdW − ptrial) dv → 0 not to be confused with the H circular integral prdvr which would be a net work. This happens to be zero for a different reason in this case, when one uses the van der Waals path going and the constant pressure path when returning, but work is not a state property and this integral generally is not zero.

VIII. REFERENCES

[1] Patrick J. Barrie. Javascript programs to calculate ther- the manuscript so that it had its current form which you modynamic properties using cubic equations of state. J. are now reading. Some 400 people have downloaded the Chem. Ed., 82:958, 2005. original (incorrect) paper, and I apologize copiously to [2] Carl David. Plotting the van der waals fluid in 3d and the them for my error. Since this paper was also submitted maxwell construction. 2015. http://digitalcommons. to both J. Chem. Ed. and Am. J. Phys., and rejected uconn.edu/chem_educ/89. without refereeing, I believe that had it been allowed [3] Carl David. The van der waals equation as a cubic. 2015. proper refereeing the error would have been discovered. http://digitalcommons.uconn.edu/chem_educ/88. [9] At this point, I need to confess that this equation is not [4] Andrew Hacker. The math myth. 2015. http:// the one I used in the original paper on this topic. In themathmyth.net/. reading Lekner’s [5] paper, I started to doubt what I had [5] John Lekner. Parametric solution of the van der waals written, and in going back, discovered a calculus error liquid-vapor coexistence curve. Am. J. Phys., 50:161, (mea culpa), and rushed to re-write the paper without 1982. the error. In the process, I found myself unable to re- [6] J. C. Maxwell. On the dynamical evidence of the molec- produce Lekner’s result, specifically eliminating Tr from ular constitution of bodies. Nature, 11:357, 1875. √ the equivalent equation. If, indeed, I’ve made a different [7] Paul J. Nahin. An Imaginary Tale The Story of −1. mistake this time, I would appreciate it if you would tell Princeton University Press, Princeton, NJ, 1998. me! [8] When this manuscript was originally written (with an [10] G. Soave. Direct calculation of pure-compound vapour error in it[3]) I had not stumbled upon Lekner’s paper. In pressures through cubic equations of state. reading his paper I discovered my own error, and revised Equilibria, 31:203, 1986. 7

FIG. 2. A plot of the data in Table 1 showing the typical vapor pressure versus temperature behavior. Of course, the van der Waals gas knows nothing about .

FIG. 3. The locus of gas and vapor molar volumes when the two coexist projected onto the pr − vr plane. The tie lines are not shown, but two data points at the same vapor pressure are “connected” i.e., they represent the volumes, pressure (and temperature) of the coexisting liquid and gaseous phases.

[11] John S. Winn. The of a van der waals gas. J.Chem. Ed., 65:772, 1988.