Page 1 of 1

Collective Variable of Bond Disance in Metadynamics

Posted: Fri Aug 23, 2019 9:34 am
by kkihn001
Hi all,
I am trying to run a metadynamics simulation where the collective variable is bond length. I am trying to track a closed state of the protein which occurs when the distance between to atoms in within a given range. However when I run the attached script (abbreviated) I get the resulting plot where it appears nothing really happened. This plot looks the same when running over 100us. Thank you for the help!

Re: Collective Variable of Bond Disance in Metadynamics

Posted: Fri Aug 23, 2019 9:54 am
by peastman
The definitions of the custom forces are incorrect:

Code: Select all

cv1 = mm.CustomCompoundBondForce(2, '1*distance(3105, 3750)')
The arguments to distance() aren't global particle indices. They're the particles within a particular bond. Then you need to add bonds to the force.

Code: Select all

cv1 = mm.CustomCompoundBondForce(2, '1*distance(p1, p2)')
cv1.addBond([3105, 3750])
You also could do it more simply with a CustomBondForce:

Code: Select all

cv1 = mm.CustomBondForce('r')
cv1.addBond(3105, 3750)

Re: Collective Variable of Bond Disance in Metadynamics

Posted: Fri Aug 23, 2019 10:49 am
by kkihn001
Thank you!