B5. Extend TEAMFF
In this lesson, we learn how to make a force field and add the force field to TEAMFF by using a polymer as example.
In the Tutorial project, there is a tutorialB5_extTEAMFF directory. A polymer model, poly(perfluorotrimethylene oxide), named as PFMO.msd, is saved for this lesson, together with three QMD files.
Identify training set
The first step of developing force field is to make a training set for parameterization. The training set must represent all force field terms required by the target model, we start with creating a new empty force field for the target model.
-
Select
PFMO.msdfrom the Project Navigator, then click Forcefield/New Forcefield command. SelectAMBERas the "Force field type", leave "Atom typing rule" and "Atom type equivalence" as default. Click OK to make an empty force field. -
The new force field contains required atom types without any parameters. Click Build/Fragments command, three fragments will be obtained and saved in a subfolder "PFMO_Fragments".
-
Next, perform QM calculations for the fragments, which can be done by using QMD/Compute command as explained before, the computation must include energy minimization and normal mode analysis, and "relaxed" sampling of the torsional energy space by using constrained minimization. Conduct the computations for each of the three fragments to obtain their QMD files, and loaded to the Project.
* For convenience, the QMD files are provided in the tutorial.
Make an initial force field
Next, we make a force field using the fragment QMD files.
-
Select the three QMD files from the Project Browser, and click Forcefield/New Forcefield command to make a new force field for the fragments. The "atom typing rule" and "atom type equivalence" must be the same as that used for generating the fragments.
-
Select the fragment QMD files, name the new force field as
amber, and fit the parameters using the procedure explained earlier to derive a force field. Examine the fitting results and the force field parameter obtained. -
From the validation table, we see that the force field predicted angles are in larger error for one of the fragment (F3), open the data for comparison, it shows the errors mostly come from one angle energy term,
c_4, C_4 f_1, examine the PPF file it shows that the energy term, such as:AHARM: c_4, c_4, f_1 : 108.1849 , 2.4801This energy term is problematic, the small value of force constant
2.4801, reflects a large variation in observed C-C-F angles, which can be confirmed by checking the "COORDINATE ANALYSIS" second inamber2.dfo, as follows:f_1 c_4 c_4 3 110.2 206 108.9 105 105.9 9which means the f_1 c_4 c_4 angles distributed in a wide range from 105.9 to 110.2 degrees. While most angles are concentrated near 110.2, about a half are around 108.9, and few (9) are located at the lower end, 105.9.
This is a known problem for classic force field, essentially the function form is not flexible enough to describe a large variation in the angle energies. The least-squares technical results the best fit by lowering the force constant, which subsequential leads to poor prediction.
Refine the force field
The solution for such problems is usually to introduce new atom types or use more flexible functions, either way can be very complicated. A simple solution, which works well for common applications, is to abandon the "best fit" parameters and replace them with physically meaningful but numerically less accurate solution.
- In this case, we can fix the equilibrium angle using the most popular distribution as reference and use a reasonable large force constant to maintain the stability, such as
AHARM: c_4, c_4, f_1 : 109.0*, 50.0*
where the asterisk (*) means the parameter is frozen. Open the ppf table, find the line and make the above changes, and then save the changes.
- Then use the revised ppf as input to repeat the fit procedure. The frozen parameters are constraints in the new fit, the result result force field parameters are best least-squares fit with the constraints.
Examine the fit quality, overall better prediction results are obtained.
Test on the target
The parameters if newly created force field represent coverage of the fragments, as long as the atom types are the same, all required parameters of the target model are included. To confirm:
-
Make sure the target model,
PFMOhas the same atom types assigned for making its fragments. Then, mouse select the model from the Project Navigator, and right-click mouse to select Associate PPF command to browse and select the last force field file you have derived. -
With the force field assigned, test the force field by using Simulation/Molecular Dynamics command. It is usually good to start with NVT simulation to relax the system, and then use NPT simulation for more strict test. If the total energy and density (or pressure with NVT) are stabilized as the simulation progresses, it is a good indication the force field is working properly.
* *To fully validate the force field, using external simulation engine such as GROMACS or LAMMPS to run sufficient time, and then check the physical properties. The force field uses charges parameters derived from QM data and default (transferred) LJ parameters, it should yield reasonable results. If in doubt, check the reference (experimental) data, if the reference data is reliable, optimize the charge and LJ parameters can improve the agreement.
Extend TEAMFF
The validated force field should be saved for reuse and continue development. The best way to do it is to add a new force field table. We use the force field file we have obtained in above procedure, assume it is PFMO_AMBER.ppf. The TEAMFF database is saved in <dff>/database folder. If this folder is protected, the database file is not be writable. You must get the write permission before running this tutorial.
-
Created a new table in TEAMFF database. Click TEAMFF/Admin command and browse to open
<dff>/databaseTEAMFF.dffdbdatabase. Select "AMBER" as the force field type. If you have made a force field in other type, make sure it is consistent here. The dialog lists several force-field tables in selected force field type. Click Add button on the right panel to open a new dialog for adding a table. EnterMyAmberFFas the force field name and select the same force field type and typing rules, which must be the same as that used for the force field to be checked in. In the Description, enter a brief note for the force field. Clicking OK to close this dialog. A new force field table is listed in the TEAMFF Admin dialog. -
Before checking in parameters, DFF uses another test to make sure the parameters are ready for checking in. Only entries marked as “D” denoting developed or "V" as validated can be checked in. If the parameters are obtained by fitting, the entries will be marked as “D”. Also delete the entries of “E0”, which are not energy parameters but the values to set relative energies, then select all entries, right-click mouse button to select “Label as “D”” command. Repeat the operation for the “Equivalence Table”.
-
Now proceed to check in the force field. Select the force field PPF file from the Project Navigator and click TEAMFF/Check in command. Make sure the force field table,
MyFF, is selected. Enter "Description" for this task, and then click OK. A pop-up window will display the number of parameters to be checked in. Click OK to continue. -
The parameters should be added successfully. To verify it, open TEAMFF Admin page again. Make sure the force field type is correct, you may need to Refresh the list. Select the
MyFFtable, to test this table. -
Select "PMOF.msd” in the Project Navigator and use TEAMFF/Check out command to check out the parameters. Make sure the force field is selected correctly, click OK to execute. The parameters checked out are associated with the molecule, which can be tested by running simulations.
The new force field is independently developed, however it can be used together with existing force fields in the same force field type. By prioritizing your force field in front of all other force field tables in TEAMFF, you can use your force field first, and then complement the coverage with DFF provided force fields.
The customized force field table can be augmented by adding new atom types and parameters. As long as the new entries do not overlap with the existing ones significantly, the new parameters can be derived in the similar way because of minimum constraints in parameters. However, if the new entries overlap with existing ones significantly, few adjustable parameters can be optimized, making another force field table is more favorable approach.