Re: Energy gradient in colvars.state file

From: Giacomo Fiorin (
Date: Mon Feb 29 2016 - 14:25:35 CST

Hello Carlo, I didn't completely understand the details of the numerical
derivation of the 20-million restart file. However, if you derived
numerically the discretized PMF, keep in mind that there is a
discretization error in the derivative. There should be no such errors in
the grid of free energy gradients in the restart file, because the free
energy has been derived analytically before being added to the grid.
Therefore, at least on the grid's cornerpoints, the free energy derivatives
are exact.

Also, the hills that you see explicitly added are those near the grid's
boundaries (see the Note at the following link), and not simply the most
recent ones.


On Mon, Feb 29, 2016 at 2:09 PM, Carlo Guardiani <> wrote:

> 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
> potential
> 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
> z-coordinate
> 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
> the
> 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

Giacomo Fiorin
Assistant Professor of Research
Institute for Computational Molecular Science (ICMS)
College of Science and Technology, Temple University
1925 North 12th Street (035-07), Room 704D
Philadelphia, PA 19122-1801
Phone: +1-215-204-4213
Lab page:

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