The "how to" of molecular modeling in education and research
Monday, June 15, 2009
The force is strong in this one
Here's a Jmol application I wrote to illustrate energy minimization/geometry optimization during a lecture in a molecular modeling course. Specifically, I wanted to illustrate how the atoms are displaced along the atomic force.
The arrows you see are the forces (or the gradient for the "start/gradient" button), which are the negative of the gradient (the derivative of the energy with respect to coordinates). The scale of the arrows relative to the scale of the molecule is arbitrarily adjusted to look nice. By clicking the buttons you are taken through the 8 steps it takes to reach a minimum. Select "wireframe" first to see the arrows more clearly.
Note that while the energy always goes down, the force vectors actually increase in the early steps. This is because if you simply displace the atoms along the arrows (i.e. perform the optimization in Cartesian coordinates) to decrease the angle, you also decrease the O-H bond length (which were fine to begin with). This increases the force on the atoms initially. However, as we get closer to the minimum the optimization fixes this.
The steps to create this Jmol application were as follows:
1. I performed the optimization with the GAMESS program at the PM3 level of theory (you can find the output file here).
2. I then wrote a python program (available here) to extract the geometries and gradients from the file and create the xyz+vib file that Jmol displays. The xyz+vib format is the normal xyz format (atom symbol, x, y, z coordinate) followed by the x, y and z component of the vector. You can access this file through Jmol as shown in a previous post.
3. I then created the html code, where I played around with scaling the vectors until everything looked nice. I finally decided on a scale factor of 10. You can access this html code as shown in a previous post.
PS: Very small arrows are not places correctly on the atoms. I think this is a bug in Jmol.