Skip to content

Latest commit

 

History

History
170 lines (127 loc) · 7.96 KB

README.md

File metadata and controls

170 lines (127 loc) · 7.96 KB

Molecular-Geometry-Analysis

The purpose of this project is to introduce you to fundamental C-language (or C++) programming techniques in the context of a scientific problem, viz. the calculation of the internal coordinates (bond lengths, bond angles, dihedral angles), moments of inertia, and rotational constants of a polyatomic molecule. A concise set of instructions for this project may be found here.

We thank Dr. Yukio Yamaguchi of the University of Georgia for the original version of this project.

Step 1: Read the Coordinate Data from Input

The input to the program is the set of Cartesian coordinates of the atoms (in bohr) and their associated atomic numbers. A sample molecule (acetaldehyde) to use as input to the program is:

7
6  0.000000000000     0.000000000000     0.000000000000
6  0.000000000000     0.000000000000     2.845112131228
8  1.899115961744     0.000000000000     4.139062527233
1 -1.894048308506     0.000000000000     3.747688672216
1  1.942500819960     0.000000000000    -0.701145981971
1 -1.007295466862    -1.669971842687    -0.705916966833
1 -1.007295466862     1.669971842687    -0.705916966833

The first line above is the number of atoms (an integer), while the remaining lines contain the z-values and x-, y-, and z-coordinates of each atom (one integer followed by three double-precision floating-point numbers). This input file ("acetaldehyde.dat") along with a few other test cases can be found in this repository in the input directory.

After downloading the file to your computer (to a file called “geom.dat”, for example), you must open the file, read the data from each line into appropriate variables, and finally close the file.

Step 2: Bond Lengths

Calculate the interatomic distances using the expression:

where x, y, and z are Cartesian coordinates and i and j denote atomic indices.

Step 3: Bond Angles

Calculate all possible bond angles. For example, the angle, φijk, between atoms i-j-k, where j is the central atom is given by:

where the eij are unit vectors between the atoms, e.g.,

  • Hint 1: Memory allocation for the unit vectors
  • Hint 2: Avoiding a divide-by-zero
  • Hint 3: Memory allocation for the bond angles
  • Hint 4: Smart printing
  • Hint 5: Trigonometric functions
  • Solution

Step 4: Out-of-Plane Angles

Calculate all possible out-of-plane angles. For example, the angle θijkl for atom i out of the plane containing atoms j-k-l (with k as the central atom, connected to i) is given by:

Step 5: Torsion/Dihedral Angles

Calculate all possible torsional angles. For example, the torsional angle τijkl for the atom connectivity i-j-k-l is given by:

Can you also determine the sign of the torsional angle?

Step 6: Center-of-Mass Translation

Find the center of mass of the molecule:

where mi is the mass of atom i and the summation runs over all atoms in the molecule.

Translate the input coordinates of the molecule to the center-of-mass.

Step 7: Principal Moments of Inertia

Calculate elements of the moment of inertia tensor.

Diagonal:

Off-diagonal (add a negative sign):

Diagonalize the inertia tensor to obtain the principal moments of inertia:

Report the moments of inertia in amu bohr2, amu Å2, and g cm2.

Based on the relative values of the principal moments, determine the molecular rotor type: linear, oblate, prolate, asymmetric.

Step 8: Rotational Constants

Compute the rotational constants in cm-1 and MHz:

Test Cases

References

E.B. Wilson, J.C. Decius, and P.C. Cross, Molecular Vibrations, McGraw-Hill, 1955.