Programmng Project 1: Molecular Geometry and Rotatonal Constants Center for Computatonal Chemstry Unversty of Georga Athens, Georga 30602 Summer 2012 1 Introducton Ths programmng project s desgned to provde a basc ntroducton to C or C++ scentfc programmng. You wll read n the molecular geometry from an nput fle, and compute the molecule s geometrc parameters and rotatonal constants. The geometrc parameters nclude bond lengths, bond angles, out-of-plane angles, and torsonal angles. Based on the molecule s rotatonal constants, you wll determne the molecular type (symmetrc top, asymmetrc top, or sphercal top). The sample nput fle contans the geometry for ethylene (D 2h ), but you should make your program general enough to work on any nput molecule. 1
2 Procedure 1. Read n the Cartesan coordnates of a molecule from fle11.dat. Ths can be done usng C s fscanf() or C++ s fstream objects. Note that the molecular geometry s provded n Bohr. You wll also need the atomc masses of the atoms, whch can be determned from the atomc number. 2. Compute all possble nteratomc dstances. R j = (X X j ) 2 + (Y Y j ) 2 + (Z Z j ) 2 (1) These should be stored n a matrx ndexed by and j. They wll be computed n Bohr, but should be prnted to the output n angstroms. 3. Compute all nteratomc unt vectors, e j. You wll need these vectors to compute the angles requred. The vector e j s the unt vector pontng from atom to atom j. where e j = (x j, y j, z j ) (2) x j = (X X j )/R j y j = (Y Y j )/R j z j = (Z Z j )/R j (3a) (3b) (3c) These should be stored n a three-dmensonal matrx ndexed by, j, and a thrd ndex ndcatng the x, y, or z component of the vector. 4. Compute all possble angles usng the drecton vectors. cos φ jk = e j e jk (4) The normalzaton factor normally present n the dot product defnton of an angle s unnecessary, snce the drecton vectors are unt vectors. For a graphcal defnton of the bond angle, see Fgure 1. These should be stored n a three-dmensonal matrx ndexed by, j, and k. We wll use the angles n later steps. The angles wll be computed and stored n radans, but should be prnted to the output n degrees. 2
j ɸjk k Fgure 1: Graphcal defnton of bond angle (φ jk ). 5. Compute all possble out-of-plane angles usng the drecton vectors and the bond angles. sn θ jkl = e lj e lk sn φ jlk e l (5) The out-of-plane angle s the angle between vector e l and the plane formed by j-k-l. For a graphcal defnton of the out-of-plan angle, see Fgures 2 and 3. Snce we do not use out-of-plane angles later, they do not need to be stored. Compute each angle and prnt t to the output n degrees. l j ɸjlk k Fgure 2: Graphcal defnton of out-of-plane angle θ jkl, top vew. 3
θjkl k l Fgure 3: Graphcal defnton of out-of-plane angle θ jkl, sde vew. 6. Compute all possble torsonal angles usng the drecton vectors and the bond angles. cos τ jkl = (e j e jk ) (e jk e kl ) sn φ jk sn φ jkl (6) The torsonal angle, τ jkl, s the angle between bonds -j and k-l, sghtng down the j-k bond. For a graphcal defnton of the torsonal angle, see Fgures 4 and 5. Agan, these can just be prnted to output, and do not need to be stored. ɸjk j k ɸjkl l Fgure 4: Graphcal defnton of torson angle τ jkl, sde vew. 4
τjkl j l Fgure 5: Graphcal defnton of torson angle τ jkl, sghtng down the j-k bond. 7. Fnd the center of mass of the molecule, and move the orgn to the center of mass. X cm = m X m Y cm = m Y m Z cm = m Z m (7) In order to compute a vald nerta tensor, the orgn of the coordnate system must be at the molecule s center of mass. In order to shft the coordnate system, subtract the center of mass coordnates from each set of atomc coordnates. x,new = x,old x C.O.M. (8) y,new = y,old y C.O.M. (9) z,new = z,old z C.O.M. (10) 8. Form the nerta tensor. The nerta tensor s a symmetrc 3 3 matrx: I xx I xy I xz I = I yx I yy I yz (11) I zx I zy I zz The dagonal elements are: I xx = m (y 2 + z 2 ) (12a) 5
I yy = m (x 2 + z 2 ) (12b) I zz = The off-dagonal elements are: m (x 2 + y 2 ) (12c) I xy = I yx = m x y (13a) I xz = I zx = m x z (13b) I yz = I zy = m y z (13c) 9. Dagonalze the nerta tensor to fnd the prncpal moments of nerta. By the spectral theorem, snce the moment of nerta tensor s real and symmetrc, t s possble to fnd a Cartesan coordnate system n whch t has the form: I a 0 0 I = 0 I b 0 (14) 0 0 I c I a, I b, and I c are the prncpal moments of nerta about three mutually orthogonal axes A, B, and C wth the orgn at the center of mass. Thus, dagonalzng the nerta tensor yelds the prncpal moments of nerta (egenvalues) and the the prncpal axes of rotaton (egenvectors). The moments of nerta should be reported n unts of amu Å 2 and g cm 2. 10. Determne the rotatonal constants. Conversons between moments of nerta and rotatonal constants are as follows: A = h B = h C = h (15) 8π 2 I a 8π 2 I b 8π 2 I c such that A B C The rotatonal constants should be reported n cm 1 and MHz. 6
11. Determne the molecular type. Molecules can be dvded nto several dfferent classes based on ther sze and rotatonal constants. a) sngle atom b) homonuclear datomc c) sphercal top: I a = I b = I c. d) lnear: 0 I a I b = I c. e) oblate symmetrc top (frsbee): I a = I b < I c f) prolate symmetrc top (football): I a < I b = I c g) asymmetrc top: All three prncpal moments of nerta are dfferent. 7
3 Text Fle Formats 3.1 Fle11.dat The frst lne of fle11.dat specfes the computatonal detals, ncludng the bass set. The next lne contans the number of atoms, N, and the computed energy. The next N lnes contan the atomc number and the Cartesan coordnates of each atom. All unts are Bohr. Z 1 x 1 y 1 z 1 Z 2 x 2 y 2 z 2.... Z n x n y n z n (16) The fnal N lnes contan the dervatves of the energy wth respect to each Cartesan coordnate, whch are rrelevant to ths project. 4 Sample Output A sample output s provded n sample.out. Please note that double-precson arthmetc may generate slght dscrepances n the answers. 8
5 References E.B. Wlson, Jr., J.C. Decus, and P.C. Cross, Molecular Vbratons, McGraw-Hll, 1955. Moment of nerta. Wkpeda, The Free Encyclopeda. 26 June 2009 <http://en.wkpeda.org/w/ndex.php?ttle=moment_of_nerta&oldd= 298733364>. Rotatonal spectroscopy. Wkpeda, The Free Encyclopeda. 29 Apr 2009 <http://en.wkpeda.org/w/ndex.php?ttle=rotatonal_spectroscopy&oldd= 286945517>. 9