Reimplementing PeriodicTorsionForce with a custom version

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
lewis martin
Posts: 63
Joined: Tue Mar 06, 2018 8:56 pm

Reimplementing PeriodicTorsionForce with a custom version

Post by lewis martin » Wed May 27, 2020 3:27 am

Hi,
So this time I'm looking to remove the native PeriodicTorsionForce and replace it with a CustomTorsionForce (same reason - for tempering the force).

Implementing it seemed easy and I got accurate potential energy when I compared alanine dipeptide with and without the replacement force. But metadynamics shows a substantially different FES for the phi/psi angles.

Here's what I have for the CustomTorsionForce. Does this energy expression look correct? Should a different expression be used with AMBER? I've looked all through the github for the definition of the PeriodicTorsionForce but I'm not sure it's defined in the same way. Closest I found was: https://github.com/openmm/openmm/blob/e ... onForce.cc

Thanks for your time!

Code: Select all

energy_expression += "0.5*k*(1-cos(periodicity*theta-theta0))"
custom_torsion_force = CustomTorsionForce(energy_expression)
custom_torsion_force.addPerTorsionParameter("k");
custom_torsion_force.addPerTorsionParameter("periodicity")
custom_torsion_force.addPerTorsionParameter("theta0");

for torsion_index in range(torsionforce.getNumTorsions()):
  a0, a1, a2, a3, periodicity, phase, k = torsionforce.getTorsionParameters(torsion_index)
  custom_torsion_force.addTorsion(a0, a1, a2, a3, [k, periodicity,phase])
 

User avatar
Peter Eastman
Posts: 2544
Joined: Thu Aug 09, 2007 1:25 pm

Re: Reimplementing PeriodicTorsionForce with a custom version

Post by Peter Eastman » Wed May 27, 2020 7:55 am

The function for PeriodicTorsionForce is described at http://docs.openmm.org/latest/userguide ... rsionforce. Your expression is slightly different. The correct expression would be "k*(1+cos(periodicity*theta-theta0))".

User avatar
lewis martin
Posts: 63
Joined: Tue Mar 06, 2018 8:56 pm

Re: Reimplementing PeriodicTorsionForce with a custom version

Post by lewis martin » Wed May 27, 2020 3:25 pm

Thanks Peter - success. Ill check that page first in future :')

POST REPLY