Boltzmann's H theorem applied to simulations of polymer interchange

of Polymer Interchange Reactions. John Pojmanl. University of Texas at Austin, Austin, TX 78712. The statistical internretation of e n t r o ~ ~ is on...
1 downloads 4 Views 2MB Size
Boltzmann's H Theorem Applied to Simulations of Polymer Interchange Reactions John Pojmanl University of Texas at Austin, Austin, TX 78712 The statistical internretation of e n t r.. o ~is ~one of the crowning achievements of 19th century statistical mechanics. However, Boltzmann's definition of the H function and the concept of irreversibility is rarely disits relation cussed in undergraduate physical chemistry courses even though these topics are extremely important in our understanding of nonequilibrium phenomena. The mathematical comp~ektyof theBoltzmann theory seems to preclude undergraduate consideration. However, in this paper we will consider a system of condensation polymers whose interactions are analogous to those of a hard-sphere gas. This analogy will allow a simulation technique readily accessihle to a microcomputer user. Background Boltzmann ( I ) introduced the H quantity in 1872, defined as H =J

dvfb). log f f u )

(1)

in which f(u) is the probability of a particular state existing which is characterized by the variable u. In a gas, f(u) is the fraction of molecules with velocity u. The H quantity is related to the entropy by Boltzmann's constant: S = -kH

Polymer Analogy ~ ~ ~et ald( 4 ) have ~ recently ~ ~ developed d i an analogy between condensation polymers undergoing interchange re-

Traditionally. s~ polymers are labelled by the number (x) of units in their length. For mathematical convenience,we will designate species according to the number of bonds they contain. The number of bonds in a polymer molecule, n, is equal to one less than its length. Thus, a monomer ( x = I ) has one unit of length, but no bonds so n = 0, while a tetramer has four units ( x = 4) but three bonds (n = 3). 200

Journal of Chemical Education

II

0

II

0

II

HOC-R-OC-R-OC-R-OH (trimer)

+

R

-

HOC-R-OH (monomer)

0

II

0

II

HOC-R-OC-R-OH (dimer)

II

II

HOC-R-OC-R-OH

Figure 1. A transesterilication reaction between a trlmer and a monomer Is shown. Wimacid or bass catalysis,the hydroxyl group of the monomer attacks an ester bond of the trimer resulting in two dimers. While there has been a redistribution 01 units, the total numberof ester bonds remains attwo. Although the trimer has two different sltes at which the monomer can react, the result is the same. For species longer than trlmers, the product distribution depends upon which bond the hydroxyl attacks.

(2)

Most importantly, Boltzmann proved that H will always decrease until a system rearranges itself to the equilibrium distribution. For a hard-sphere gas, this is the famed Maxwell-Boltzmann distribution (21,about which more will be discussed later. Although the mathematics of this so-called H theorem is imposing, the physical phenomenon is quite easy to understand. If an initial distribution of agas consists of molecules with a uniform velocity distrihution, collisions will increase the range of accessible~velocitieswithout altering the total energy, until the most highly randomized diitrihution is reached. This distrihution will correspond to rhermodynamic equilibrium. The H theorem had not been directlv tested until the advent of digital computers, which allowdd simulations of a two-dimensional eas (3).Simulatine the comolete Newtonian dynamics of a gas is mathematic~llyand c&nputationally intensive while calculating the H auantitv itself is simple. What is needed is a simpie dyna&ical system that can he readily simulated on a microcomputer.

' Present address: Brandeis University, Waltham, MA 02254.

0

Figure 2. The analogy between coiisions in a gas ol hard spheres and interchange reactions in polymers is shown. Conservation of energy in the gas. V,? + VZ2= V'lZ+ V'22,leads tothe Maxwell-Boitlmann distribution f(v) = m12rkTexp -m\'/2kT. In an interchange reaction between an (N, + I t mer and an (N2 + lwer that results In an ( N i + lkmer and an (N2'+ lkmer. we have the conservation of tdai number of bonds: N, + N2 = N i + N2'. This in which n isthe number of bonds In leads to adlstrlbution f(n) = (1 - d)do, me molecule.

actions a t a constant degree of polymerization and binary collisions in a hard-sphere gas a t constant temperature. Two polyester molecules can exchange units of the chain via transesterification (interchanae) reactions. Such reactions occur when the hydroxyl end i f one polymer molecule attacks an ester bond of another molecule. Figure 1presents the transesterification of a trimer and a monomer to yield two dimem2 A similar reaction can occur among polyamides, inc ~ u ~ ~ n g p o ~ y p e ~h~~~ p t ~ ~ reactions es, can be very important polymerizations' Their effect the in was investigated F1Or~(5). length The most important aspect of such reactions is that they have no effect upon the average number of bonds ((n))in

Figure 3. me svoluion of the Hquantity for a system w th an Mia1 d rhiout on o l all pmanmn (n = 4). The simulation was performed with species of length 1-75 with 25.000 molecules and ellowsa to proceed tor 10.000 Iterations.On a MacintoshSE usingthe compiled program. 25 mln of real time was required.

Figure 4. The distribution of polymer ienglhs Is shown at the completion o l Me simulation in Figure 2, T k line indicates the theoretically predicted disblbution tor ( n ) = 4.

PROGRAM ELTHEOREM 1.0 by J. Pojman 9/88 'Thir program caicuiatcs Boilrmwdx H-quantity during the airnulalion of a 'rya!cm of condeosation polymers undergoing interchange reactions. DffINC C,I.J.K.L.M.N.P.R.S.T DrnNG E H DIM P(IfQ), SumC7S). Moloc(2). FOS) INPUT "Toul number of molcculer?*.ToUI 1NPUT"Whst is the IcngIh of Ule inilid p i u 7 " b INPUT "How many itrrationrl'.lter INPLK"Rint remlu cvcry Kth isration?", MI1 INPUT "Do you want vrluu pinled to -9 (Y/N)?".+ INPUT "wht i~ the of the output file?'.ouIS 'initidim timer T i d = '0" on ena gao 5 W O OPEN '0'.U6.oud PRINT #6,Tad number of molu;ulcs-";Told PRINT U6. "Lcngh of initial rpccicl;S PRINT 16,"Number of im~tions=';lm LET Nrpccim = 75 Thir is the m.rimum p i e s ' Imgth. LET ms) =Tad Tbe P mnuinr Ulc number of mmolrsulu of u s h length

-

I Vphu U.molcsuk s m L P(Molcs(Z))=P(Moloc(2)) I nag = I number k l w m Iand Molcs(I)+MoMZ) 'Num is the ImgIh of one p d c t molcsulr WUE Rag = I

LIT P(Mols(l))=P(Moloc(l))

L!X

-

'w

next index

print U6, molcdl).molcs(2),1~1dom end

~~

300 'NOWr l o c t U.0.1 interacting 1001oc~lu. FOR k t.TO 2 , . . .. . ... Gorub 7500 'Use svhutinC for relocling random number. 400 ' M ~ k c f ni s ra equal w 0. 'Cmpuc Sum(K) and Fandm LEl' MolHl).O FOR M=t TO N p i u I IF (Sum(hW =R.ndm) AND( < = Sum(M+I)) THEN MolecfO=M+I: GOT0 MY)

-

-

900 T m a = Mokdl) For l"tach.nge

-

+ Mdac(2)

print times

T I =";times $000 print Y6.num.rsndom.molcc(I),moIoc(2) aOSE n5 SRlP ZSW 'Subovtins lo gma.lc random number k l w c m I n d ld humba of n n.g-1 WaE F1.g n I RnmmlNT(RNDTwl) I F ~ . O ) THEN

prim n6. "E1.p.d

-

2 'Sum of the number of bonds. 1 w Trmr

Figure 5. Them& forthe simulations is reproducedhere. Wrinen In Micmxrfl BASIC 3.0 for the Macintosh. it can be compiledm used with an interpreter. The user is prompted for Me tDtal number of molecules in Me simulation as well as the length of the initlal species.

the polymer distribution. This is necessarily the case because the total number of units (and bonds) in the two oolvmen is unchanged by transesteriiication in the same banner as the total kinetic energy of two colliding gas molecules is conserved. This analow is shown in Figure 2.

,

The equilibrium velocity distribution for a gas of molecumass at temperature is called the Maxwell-Boltz,anndistribution (6): f(u)

m

-mu'

2rkT

2kT

= -exp -

Volume 67

Number 3

March 1990

201

For the equilibrium distribution of polymer lengths, we place n. the number of bonds that is the conserved quantity, in the exponent and write" f(n) = (I

- e-9)e-6";e-B

=

-

0extent of polymerization (n) + 1

(4)

where ( n ) is the average number of bonds in the polymer distribution. This distribution was originally derived by Flory from kinetic and statistical considerations (7). We can calculate the H quantity for a polymer distribution by replacing the integral in eq 1with a sum over polymer species: H = xf(n) lag f(n)

(5)

If the initial distrihution consists only of a single species, then the value of H is zero. As interchange reactions occur and the number of species present increases, the Hquantity decreases monotonically until reaching a minimum value, corresponding t o the state of maximum entropy and the equilihrium distribution in eq 5. Slmulatlons The complexity of the system precludes writing the required set of coupled differential equations. However, the conservation law and the assumption of equal reactivity of bonds allows for the use of a simple simulation method. Because chemical reactions are stochastic processes, they may be simulated using a statistical or Monte Carlo approach on a computer (8). The evolution of H is shown in Figure 3 for 25,000 polymer molecules with a n average number of bonds equal to four ( ( n ) = 4). The H quantity does indeed decrease monotoniThe quantity f(n) is the fraction of the total number of molecules wing n bonds.

cally until reaching a minimum. The distribution at this minimum should he the equilihrium distrihution given in eq 4. and Figure 4 demonstrates that indeed it is. The program may be run with an interpreter hut the run time increases hy about a factor of 10. The BASIC program running on a Macintosh SE, reproduced in Figure 5, uses the following algorithm: Two molecules of lengths Molec(1) and Molec(2) are randomly chosen with the nrohabilitv of selection ~ r o ~ o r t i o nto a lthe number of moleckes of e a c i of the speci&. T'he lengths of the resulting product molecules are determined by choosing a random integer, Num, between 0 and the sum of the lengths of the reacting species. The length of one of the product molecules is this random number. ~ u mwhile , the length of the other is (Molec(1) r Molec(2) - Num). This process is repeated - 21. times. which is ,the total number (.Molecllj ~ ~ ~ ~ , ~-- - - ~ ~,. + Molecl2) of bonds of the two reacting species, accounting for the fact that eachmolecule hasMolecf1) - 1sites with which the end of the other molecule may react. The Dromam mav be modified to studv other phenomena i n d u d k g the relaxation rates of perturbations the equilibrium distrihution (see ref 4 for further discussion) and fluctuations around the equilihrium values. The great benefit of the algorithm is that i t enables a student to observe directly the reaction process and the effect on the H quantity. Acknowledgment The author would like to thank the reviewer for many helpful suggestions. LHerature Cited 1. Bolhmann, L. Wien.Bar. 1872.66.275. 2. f i r r o w , G. Physicol Chem'8hy;MeGraw-Hill New York, 1979;pp 35-40. 3. Bellemans,A.:Orbsn, J. J.Phys.Lett. 1967,24A,620. 4 . Kondepdi, D.: Pojmen, J.:Mslek-Mansew. M. J . Phys. Chem. 1383.93.5931. 5. Flow. P.J . Am. Chem. S o c 1342.64.2205. 6. Huang, K. Siatialicnl Mechanics; Wiley: New York. 1987:p 72. 7. Flory. P. Principles o / P o l y m ~ Srienrr: r Cocnell: Ifhaea. NY, 1953;pp 8691. 8 M a t w n . J.; Mark, H.: MacDonald, H.. Edn.Computers in Polymer Scienca: Dekke.: New Yark. 1977.

Chemistry in Action! "The Periodic Table Videodisc: Reactions of the Elements" "The Periodic Videodisc: Reactions of the Elements" is a 30-min videodisc containing action sequences and still shots , nitn base. of each element: in its most common form,reacting with nir, reacting with wnrer, reacting with n r ~ d rreacting and in some common uses and applicatronr.The videodisc hna heen publishwl ns Special Iscue I 01Jvurna1 C('hrrnico1 Eduroiion S o f l u a r r , and mav be ordpred for $50 ($55foreianr. Purchasers will recclw a sinale.srded, CAV-rvvevideodisr andavideo~mage~iredory;whiehis an indexed list of codes from which to select frames,erther for use withahand-operated, remote-control device or for writing one's own computer control programs. Those who purchased Volume 1B2 of JCE: Software: "KC? Discoverer" also received a program that allows them to control the videodisc through their MS-DOS compatible computers. Further details about the videodisc may be found on page 19 of the January 1989 issue of this Journal. To order: fill out the form below; make a check or money order payable to JCE: Software, Department of Chemistry, University of Wiseonsin-Madison, 1101 University Avenue, Madison, WI 53706. Payment must be in US. funds drawn on a U.S. bank or by international money order or magnetically encoded check.

Order Form Please send methe following: -& Peridic Table Videodisc: Reactions of the Elements; $50 ($55 foreign).Includes videodisc and index of coae numbers to frames on the disc

-Informstion about other issues of JCE: Software

202

Journal of Chemical Education