Re: Restraining angle between bond vector and coordinate vector

From: Jérôme Hénin (
Date: Mon Mar 23 2015 - 15:45:02 CDT

It should be easy, using the Collective Variables Module, to define that
angle as a scripted function of a distanceVec coordinate. Then you can
define a standard restraint potential on that variable.

You can find an example (more complicated than what you need actually) here:

I should warn you that the support for that feature on vectors got
completed just about the time when NAMD 2.10 was released, so it might
happen that 2.10 doesn't handle your case and you need to use the
development version of colvars.


On 23 March 2015 at 21:26, Seth Axen <> wrote:

> I would like to add a harmonic restraint for an angle between a specific
> bond vector and a target vector in 3D space, defined by 3 coordinates. The
> resulting force should be updated at every step of the simulation. I'm
> having trouble figuring out the best way to go about this from the
> documentation and user-defined forces examples, and I'd appreciate any
> suggestions.
> Thanks!

This archive was generated by hypermail 2.1.6 : Tue Dec 27 2016 - 23:21:01 CST