Energy gradient in colvars.state file

From: Carlo Guardiani (
Date: Mon Feb 29 2016 - 13:09:31 CST

Dear NAMD experts,

I am running a well-tempered metadynamics simulations on
an ion channel. In particular I am biasing the z-component
of the distance vector between a specific sodium ion and
the center of mass of the C-alphas of four critical
glutamates. Here is the definition of my collective variable:

 colvar {
name distZ
distanceZ {
      ref {
            atomNumbers { 824 2419 4014 5609 } #CA Glu51,148,245,342
    main {
            atomNumbers { 39921 } #Na+ Res1441
    axis (0.0, 0.0, 1.0)

lowerBoundary -10.0
lowerWallConstant 100.0
upperBoundary 10.0
upperWallConstant 100.0
expandBoundaries on
width 0.5

After the first 10 millions steps I printed in the colvars.state
file the hills that are added using the commands:

useGrids on
keepHills on

In this way in my file meta_1.restart.colvars.state I have the
discretized biasing potential and its gradient at step 10 million
while in file meta_2.restart.colvars.state I have the biasing
potential and its gradient at step 20 millions and the parameters
of all the gaussians that have been added after step 10 millions.

Since I noted some problems after step 19 millions, I would like to
restart the simulation from this point. My question is the following:
is it possible to prepare an appropriate colvars.state using my
available data ? Clearly, computing the biasing potential at step 19
millions is trivial since I just have to add to the biasing potential
at step 10 millions all the gaussians deposited till step 19 millions.
However, I have some problem with the calculation of the energy gradient.
Just to make a test, I tried to numerically derive the biasing potential at
step 20 million and to compare it with the energy gradient provided in the
colvars.state file. As you can see from the attached file, the plots are
similar but not really identical. What did I do wrong ? I guess one possible
reason is that I should have multiplied the derivative of the biasing
for the derivative of the collective variable. In my case, however, my
collective variable is something like C(z)=(z - z0) where z is the
of a specific sodium ion and z0 is the coordinate of the centre of mass of
the C-alphas of four glutamates. If I derive this function with respect to
coordinates of the sodium ion the gradient vector is (1 0 0) which means that
the derivative of the biasing potential should be multiplied by 1. Is there
anything wrong in my reasoning ? Or is there some other mistake ?

Thank you very much for your help.

Best wishes,

Carlo Guardiani

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