wiki:FittingPotentials

Version 3 (modified by FrederikHeber, 10 years ago) ( diff )

begun second part on fitting the potential

Fitting a water potential

In this example we will use a brief molecular dynamics simulation of a single water molecule to fit a (in MoleCuilder terminology) compound potential, consisting of constant, Morse, and angle potentials.

Molecular dynamics simulation of water

First of all, we need to perform a molecular dynamics simulation of water.

Below you found the necessary command to perform such an MD simulation:

./molecuilder \
        --load water.pdb \
        --input md.pdb \
        --select-all-atoms \
        --molecular-dynamics \
                --steps 100 \
                --keep-bondgraph 1 \
                --output-every-step 1 \
                --deltat 0.1 \
                --order 1 \
                --DoLongrange 0 \
                --fragment-resultfile BondFragmentResults.dat \
        --save-homologies homologies.dat

The command consists of loading the file water.pdb (see attached files), preparing to store all subsequent steps in the output file md.pdb, then selecting all atoms for the dynamics simulation and performing it. There, we use 100 steps, keep the bond graph (in case the initial configuration is not equilibrated and oscillations are too strong) and do not include long range forces. Furthermore, a bond order of 1 is sufficient and a small time steps (deltat) ensures proper time integration of the dynamics.

Note especially the last command that stores the so-called homologies in a separate file. Homologies are the set of all equivalent configurations and fragments, i.e. when performing a simulation with many water molecules, then each water molecule is homologous (having the same structure, the same chemical formula) to any other water molecule. Hence, each molecule is stored under the same formula, namely H2O, in an internal container of MoleCuilder, including the resulting ab-initio energy and all interatomic distances. At the end of the dynamics simulation, many different configurations of a single water molecules are gathered under this key H2O. And each of them will have a slightly different energy; for example because the hydrogen atoms are slightly further away from the oxygen. In essence, we have many snapshots (with energies) of the oscillating water molecule.

For the curious ones, the fragment configurations and their energies are stored at the end of the analyse-fragment-results Action. This Action is contained in molecular-dynamics which is simply a so-called MakroAction, combining various other Actions into a single one. This analysis action is responsible for placing results from the fragment calculations into various places: first everything goes into two result containers (short and long range ones), then forces (aka gradients) go to their respective atoms, energies finally go to the homology container.

This homology file homologies.dat serves then as the data set to the subsequent potential fitting.

Fitting a potential

While you can also fit a potential directly, for example as follows,

./molecuilder \
        --parse-homologies homologies.dat \
        --fit-potential \
                --fragment-charges 8 1 1 \
                --potential-charges 8 1 \
                --potential-type morse \
                --take-best-of 3 \
                --training-file training.dat

which would fit a Morse-type potential (potential-type) to the oxygen-hydrogen bond (set by the potential-charges "8 1") of the water molecule (specified by the fragment--charges "8 1 1"). The threshold for terminating the iterative fit procedure after three rounds and we write all input training data to a file training.dat.

However, it is usually better to fit a so-called compound potential. A compound potential consists of a combination of potentials -- for example a constant potential, a Morse potential, and an harmonic angle potential in our case -- and fits the whole lot together.

Fitting single potentials is sensible if you create snapshots that only oscillate in the degrees of freedom of this single potential, e.g. if only an elongation of the oxygen-hydrogen bond has been excited and the angle between the two O-H bonds does not change. However, as we have created a molecular dynamics simulation of an unknown initial configuration, we cannot ascertain that such a precondition holds. This is also the reason why take-best-of has been specified and not set-threshold as you will probably have noticed that the remaining L2 error is still quite large.

A compound potential is defined by a file of the following form (we use the .potentials format use by the tremolo package.

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.