D. MM Methods

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.WithParameterSet ( "bookSmallExamples" )

nbModel = NBModelFull.WithDefaults ( )


# . Generate the molecule.

molecule = ImportSystem ( 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 = ImportCoordinates3 ( 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, align = Align.Left )

table.Entry ( "{:.1f}".format ( energy ) )

table.Entry ( "{:.3f}".format ( 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 then 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.

Exercises

    1. Compute MM energies for a selection of molecules using the OPLS-AA force-field parameter sets that are provided in the parameters/forceFields/opls subdirectory of pDynamo. 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. Details of how to add the appropriate extra definitions may be found in the wiki.