Friday, January 11, 2013

Cleaning House & May the Force be with You!

Just a quick update on NanoEngineer-1. I have installed Windows 7 SP1 just to test NanoEngineer-1 in XP compatibility mode. Sadly, this was a failure. As far as Windows 7 is concerned I still have ditch the service pack. If you have any additional information on this problem please let me know. I also tried modes for Windows 7 and 2000 with no luck.

I briefly mentioned potential energy of the molecules in my last post. NanoEngineer-1 has GROMACS molecular dynamics simulator integrated into it. This would be a great idea for LAMMPS too. You can draw a molecule and start up the simulator and then watch a movie of the molecule under dynamics. The cool part of this is bonds can be stretched to hugh lengths and the simulator does not break the bond during simulation. Instead the molecule experiences a hugh influx of energy and bounces around. How does one stop such behavior? One solution is to minimize the energy of the molecule(s) using the molecular mechanics energy minimizer provided by NE-1! The MMEM uses some algorithm such as steepest decent and calculates a local energy minimum for the system or for specific highlighted molecules. MMEM uses the NanoDynamics-1 force field. If memory serves me right it minimizes on bonds, angles and does not pay attention to dihedral angles. It appears to pay attention to molecules that are not bonded together and perhaps has something like Van der Waals forces. The down side of the MMEM is it takes a long time for large molecules and since you are only guaranteed a local minimum in energy you may be starting from a weak point on the potential energy surface. So waiting a long time and probably not getting what you want is no fun. It's time to go shopping for a better solution.

There are many chemistry applications on planet Earth and one is ChemSketch by ACD/Labs. I used it to draw molecules for school. I noticed that it had a "cleaner" feature. Not having the source code I can't look at how it does this cleaning of the structure so quickly. Knowing something about chemistry I can guess how the cleaner works. Let's face it atoms generally hate each other. A methane molecule has hydrogens spread out such that all five atoms are as far away from one another as possible. Molecules appear to want to maximize the space they occupy. So one idea is to allow atoms to assume ideal positions relative to one another based on hybrid orbitals. Sp1, Sp2 and Sp3 provide simple geometry to be used in placing atoms relative to one another. Of course not all atoms or groups of atoms are treated the same by a force field. Looking at COMPASS family of force fields one sees many equilibrium bond lengths between atoms based on their atom types. So the hybrid orbitals could be a good first step, but using the equilibrium bond lengths, bond angles, and dihedral angles from the desired force field would be even better! Besides a computer has nothing better to do than to recompute (x,y,z) positions for an atom relative to another atom based on the equilibrium values in the force field. Some of this data will be missing but the fall back would be to substitute generic values. 

The molecule template created by NanoEngineer-1 contains cartesian coordinates. There is nothing wrong with this data format, but the force field data is in a format that chemists recognize immediately! The Z-matrix is used to represent a molecule or a system of atoms/molecules by their natural coordinates - bond length, bond angle, dihedral angle and out-of-plane angle. If you have used The Gaussian software you know about the Z-matrix. So in the interest of creating bad puns: in order to clean house you need the force to be with you! 

My next piece of vaporware will be a cleaner software and hopefully be implemented in Python inside NanoEngineer-1. It will have a cleaner button on the GUI and will do the following behind the scenes: first a Z-matrix will be constructed from the cartesian coordinate data and some dummy atoms will  be added to support the Z-matrix. The Z-matrix data structure is devoid of cartesian coordinates. The bond lengths, bond angles, dihedral angles and out-of-plane angles could be calculated and stuffed into the Z-matrix, but why bother. These values will be replaced with the correct data from the desired force field. Every atom carries an atom type from the force field and this allows the look up of the correct values to fill in the Z-matrix. Once completed, the Z-matrix will be transformed into a molecular machine part (MMP) internal representation within NanoEngineer-1. A single pass through the atoms should create the Z-matrix and a second pass should create the MMP internal representation. The effort is linear 2N!
A final pass may be necessary to ensure that all atoms are as far away from their neighbors as possible. Since we are not calculating energy and doing a steepest decent minimization we may need to develop an objective function based on maximizing distance between atoms while maintaining equilibrium bond lengths, etc... The above is the easy part of the problem. The Van der Waals and Coulombic contributions in minimizing the overall system energy appear to be satisfied only by a full MMEM. Perhaps the structure cleaner will serve to provide a better starting point. One obvious use is to clean up manually cross-linked molecules drawn in NanoEngineer-1. I had manually cross-linked a few oligomers to attempt to get higher densities for the DGEBA/IPD system.  The simulations ran much longer due to structure "dirtiness" created by my really long bond lengths. Since the oligomers contain cycles the software must handle such cases and not step through the structure forever! 

Comments and suggestions are invited and encouraged here! 

1 comment:

  1. My first introduction to Nanoengineer-1 occurred many months ago, and after several years in the quantum chemistry and molecular dynamics game. But, something interesting has happened to me today and I feel as though it should be posted here.

    Upon discovering Nanoengineer, I first installed it on several computers running older versions of Windows, specifically Windows 7 w/ and w/o SP1, and XP SP2. Of course, the only working variants are those of XP and 7 w/o SP1, as you have surmised. That is, until today. From the desktop icon, I right-click and change the compatibility options to try and run it as if it were installed in Win 2000, same problem. It was not until some weeks later, this week in fact, that I changed this mode to “XP SP2”, and Nanoengineer started up, after a moment or two. You mentioned above, in this post (text in red), that you tried several modes, I'm curious as to your procedure.

    My goal, ultimately, to find exactly which update within SP1 breaks the Nanoengineer-1 functionality, by installing each one at a time. Many other people and a few groups online are trying to find workarounds and update everything for use on Ubuntu 12.04, something I haven’t looked into with great detail yet.