Gases

Mervin P. Hanson
Department of Chemistry
Humboldt State University
Arcata, California 95521

Bitnet : GFA001D@CCS.CSUSCC.CALSTATE.EDU
(707) 826 3265

Simple Substitution Problem

* Ch-1.  How many moles of an ideal gas occupy 415 L at 25.00 ¡C if the pressure is 3.00 atm?

ClearAll[V, T, p, R, tmp, n, L, atm]  
(* This clears all previous definitions of these variables.*)
V = 415 L
T = (273.15 + 25.00) K
p = 3.00 atm
R = 0.082054 L atm mol^-1 K^-1
tmp = Solve[p V == n R T, n]  (* Sect. 3.4.3 pg 398 *)
(*
This is a bit tricky as Solve produces a list for a
result and what we want is the value n takes on here.
Sect 1.7.2 pg 92
*)
Print["tmp = ",tmp]  (* Sect 2.6.11 pg 282 *)
n = n /. tmp[[1]]  (* Sect 2.2.14 pg 208 *)
Print[" "]
Print[" n = ", n]

Slightly More Sophisticated Problem

*Ch-2.  The van der Waal's constants for water are 5.464 L^2 atm mol^-2 and 0.03049 L/mol.  Use the van der Waal's equation to estimate the molar volume of water at its normal boiling point.

ClearAll[a,b,R,T,p,tmp,Vid,Vdw]  (*This is cheap insurance.*)
p = 1.00
R = 0.082054
T = 373.15
a = 5.464
b = 0.03049
Vid = R T/p
(* 
The procedure FindRoot requires a first guess so use the ideal
gas law.  Sect.3.4.2 pg 398   You could continue to work with 
units but it requires more trouble than I am willing to expend.
*)
tmp = FindRoot[ p == R T/(Vdw - b) - a/Vdw^2,
				{Vdw,Vid}]
Vdw = Vdw /. tmp[[1]]
Print["Vdw = ",N[Vdw,3], " L/mol"]   (* Sect. 1.1.4 pg 30 *)

Graphics

* Ch-3.  Plot the difference between the ideal gas law and van der Waals expressions for the pressure of water for molar volumes in the range 30.6 to 100 L/mol at 373.15 K.

ClearAll[a,b,R,T,V]
R = 0.082054
T = 373.15
a = 5.464
b = 0.03049
Plot[R T/(V - b) - a/V^2 - R T/V,{V,30.6,100}]
	(* Sect. 1.8.1 pg 107 *)

Real Algebra

Ch - 4.  There are two commonly used forms of the virial equation :
	
	pV/RT  =  1  +  Bp p  +  Cp p^2  +  Dp p^3  +  ...					(1)
	
	            =  1  +  Bv/V  +  Cv/V^2  +  Dv/V^3  +  ...    		(2)
	            
a)  Use the van der Waals equation to express pV/RT as a function of the van der Waals' constants, R, and T.  Expand the result to third order in 1/V and determine explicit expressions for the coefficients Bv, Cv, and Dv.
b)  Starting with the third order polynomial approximation

		pV/RT  =  1  +  Bp p  +  Cp p^2  +  Dp  p^3
		
substitute the van der Waals expression for p and expand the result to terms of order 1/V^3.  Find Bv, Cv, and Dv in terms of Bp, Cp, and Dp.
c)  Use the results of part "b" to find Bp, Cp, and Dp in terms of Bv, Cv, and Dv.

(*a*)
ClearAll[a, b, Bv, Cv, Dv, p, V, R, T, tmp, tmp1]
tmp = Series[V/(V-b) - a/(R T V^2),{V,Infinity,3}]
	(*Sect 3.6 pg 428 *)
Print["pV/RT = ",tmp]
tmp1 = Normal[tmp]  (* truncate the series.  Sect 3.6.5 pg 434*)
Bv = Coefficient[tmp1,1/V]  (*Sect 3.3.2 pg 383 *)
Print[]
Print["Bv = ",Bv]
Cv = Coefficient[tmp1,1/V^2]
Print[]
Print["Cv = ",Cv];
Dv = Coefficient[tmp1,1/V^3]
Print[]
Print["Dv = ",Dv]

(*b*)
ClearAll[a, b, Bv, Cv, Dv, Bp, Cp, Dp, p, V, R, T, tmp, tmp1, Z]
Z = 1 + Bp p + Cp p^2 + Dp p^3
p = R T/(V-b) - a/V^2
tmp = Series[Z,{V,Infinity,3}]
tmp1 = Normal[tmp]
Bv = Coefficient[tmp1,1/V]
Cv = Coefficient[tmp1,1/V^2]
Dv = Coefficient[tmp1,1/V^3]
Print["Bv = ",Bv]
Print[]
Print["Cv = ",Cv]
Print[]
Print["Dv = ",Dv]

(*c*)
ClearAll[Bv, Cv, Dv, tmp2]
tmp2 =
	Solve[{Bv ==  Coefficient[tmp1,1/V],
		   Cv ==  Coefficient[tmp1,1/V^2],
		   Dv ==  Coefficient[tmp1,1/V^3]},
		   {Bp,Cp,Dp}]
Bp = Bp /. tmp2 (* Read this as Bp under the rules tmp1. *)
Cp = Cp /. tmp2
Dp = Dp /. tmp2
Print["Bp = ",Bp]
Print[]
Print["Cp = ",Cp]
Print[]
Print["Dp = ",Dp]
Print[]

Least Squares Fits

**Ch-5.  Values of the expression B(V, T) = V(pV - RT) for Krypton are given by Beattie, Brierley, and Barriault, J. Chem. Phys., 20, 1615 (1952).
a)  Show that
			B(V, T)/RT = Bv(T) + Cv(T)/V + Dv(T)/V^2 + O(1/V^3).
b)  The file B(V,T)Kr contains three lines of text and then individual records containing the reciprocal molar volume (L/mol) followed by experimental values of B(V,T) (L^2 atm/mol^2) for a temperature of 0¡C.  Find Bv, Cv, and Dv at this temperature

(*a*)
ClearAll[p, V, R, T, Bv, Cv, Dv, BofVandT]
Solve[{BofVandT == V (p V - R T),
		p V/(R T)  == 1 + Bv/V + Cv/V^2 + Dv/V^3 + OrderofV4},
		BofVandT, p ]  (* Sect. 3.4.6 pg 404 *)

(*b*)
ClearAll[p,V,R,T,Bv,Cv,Dv,infile,data,tmp,oneoverV]
R = 0.082054
T = 273.15
infile = OpenRead["B(V,T)Kr"]  (* Sect. 3.6.20 pg 302 *)
Read[infile,String]
Read[infile,String]
Read[infile,String] (* just get over the intro text *)
data = ReadList[infile,{Number,Number}]
Close[infile]
tmp = Fit[data,{1/V^2,1/V,1},V] (*note assending order*)
(* Sect 3.8 pg 461 and then Sect 3.3.2 pg 383 *)
Print["B(V,T) = ",tmp]
Bv = Coefficient[V^2 tmp,V,2]/(R T) (*guess why*)
Cv = Coefficient[tmp,1/V]/(R T)
Dv = Coefficient[tmp,1/V^2]/(R T)
Print[]
Print[]
Print["Bv = ",Bv]
Print[]
Print["Cv = ",Cv]
Print[]
Print["Dv = ",Dv]