Molecular Mechanical Methods
pDynamo implements a number of MM techniques as alternatives or complements to its QC potentials. The following program,
Example7.py, employs the OPLS-AA force field to calculate the potential energy and dipole moment of various conformations of the bALA molecule:
# . Define the list of structures.
xyzFiles = [ "bala_alpha.xyz", "bala_c5.xyz", "bala_c7ax.xyz", "bala_c7eq.xyz" ]
# . Define the MM and NB models.
mmModel = MMModelOPLS ( "bookSmallExamples" )
nbModel = NBModelFull ( )
# . Generate the molecule.
molecule = MOLFile_ToSystem ( os.path.join ( molPath, "bala_c7eq.mol" ) )
molecule.DefineMMModel ( mmModel )
molecule.DefineNBModel ( nbModel )
molecule.Summary ( )
# . Loop over the structures in the xyz files.
results = 
for xyzFile in xyzFiles:
molecule.coordinates3 = XYZFile_ToCoordinates3 ( os.path.join ( xyzPath, xyzFile ) )
energy = molecule.Energy ( )
dipole = molecule.DipoleMoment ( )
results.append ( ( xyzFile[5:-4], energy, dipole.Norm2 ( ) ) )
# . Output the results.
table = logFile.GetTable ( columns = [ 20, 20, 20 ] )
table.Start ( )
table.Title ( "Energy Model Results for bALA" )
table.Heading ( "Conformation" )
table.Heading ( "Energy" )
table.Heading ( "Dipole" )
for ( label, energy, dipole ) in results:
table.Entry ( label )
table.Entry ( "%.1f" % ( energy, ) )
table.Entry ( "%.3f" % ( dipole, ) )
table.Stop ( )
Initially the program defines the list of structures, contained in XYZ files, whose energies are to be determined. This is followed by a series of statements that define the MM and non-bonding (NB) models to use in the calculation and set up the bALA molecule given a MOL file representation. It is to be noted that the system's MM model is defined before its NB model. The energy and dipole moment of each structure are then determined and the program terminates by outputting the computed results to a table.
- Compute MM energies for a selection of molecules using the OPLS-AA force-field parameter sets that are provided in the
parameters/oplssubdirectory of the
pMoleculepackage. In addition to energies, try and determine interaction energy curves for some intermolecular complexes. It is more than likely that the calculations will fail for certain of the molecules that are tried due to missing force-field terms. It is possible to add the appropriate definitions (or generate new parameter sets) but this is quite a complicated procedure which is beyond the scope of the current tutorial.