Re: Question about applying external force

From: Jérôme Hénin (
Date: Mon Mar 06 2017 - 14:23:24 CST

Hi Sebastian,

This sounds like a job for a scripted collective variable restraint.

Define a variable named d made of a distance component between the two
molecules, enable scriptedColvarForces, and then this Tcl procedure should
do the trick:

proc calc_colvar_forces { ts } {
  set omega 42.
  set A 42.
  cv colvar d addforce [expr {$A * cos($omega * $ts)}]


On 6 March 2017 at 20:56, The Cromicus Productions <> wrote:

> Hi everyone,
> I would like to consider the center of mass of two molecules and apply a
> force F=Acos(wt) in the direction between the CMs to separate and get them
> back. Is this possible in NAMD? Any suggestion about how to do it?
> Thank you very much,
> Sebastian

This archive was generated by hypermail 2.1.6 : Mon Dec 31 2018 - 23:20:09 CST