From: Joshua Adelman (
Date: Tue Mar 12 2013 - 11:53:01 CDT

I was wondering if anyone had any insight into a strange result I'm getting when using the namdenergy plugin. I'm using VMD 1.9.1 and version 1.4 of the namdenergy package. I'm calculating the electrostatic energy for a series of snapshots, and realized that the results differ depending on whether all of the frames were loaded in at once or if a separate call to namdenergy was done for each frame.

So for example, if my script looks something like (read in 10 frames from a dcd file):

proc get_energy {sys_psf dcd_file out_name tmp_file xsc_file ff1 ff2 ff3} {
    package require namdenergy
    mol new $sys_psf
    animate read dcd $dcd_file beg 0 end 10 waitfor all
    set all [atomselect top "all"]
    namdenergy -switch 8.0 -cutoff 10.0 -elec -sel $all -extsys $xsc_file -pme -par $ff1 -par $ff2 -par $ff3 -ofile $out_name -tempname $tmp_file -debug

My results look like:

Frame Time Elec Total
0 0 -94731.9 -94731.9
1 1 -94733.5 -94733.5
2 2 -94574.4 -94574.4
3 3 -94674.7 -94674.7
4 4 -94597.5 -94597.5
5 5 -94239.8 -94239.8
6 6 -94677.2 -94677.2
7 7 -94478.9 -94478.9
8 8 -94750.7 -94750.7
9 9 -94442.5 -94442.5
10 10 -94824.9 -94824.9
However, if I keep everything else the same (force field files, xsc, etc, but I change the animate read statement to:

animate read dcd $dcd_file beg 0 end 0 waitfor all

the energy returned for that first frame is:
Frame Time Elec Total
0 0 -87170.6 -87170.6

The same energy is obtained if I make a pdb from the first frame and load it as:
mol addfile fr0.pdb

I've checked that the same PME grid size is being used in all cases, and that the {a b c alpha beta gamma} values are the same for the pdb frame and dcd frames. I have also noticed that if I use a different xsc file for the single frame calculations that I different energy, but it doesn't effect the results if I'm processing a dcd file. I thought that the xsc file was just there for setup, but the actual box size was determined from the unit cell info stored in the dcd file or in the CRYST line in the pdb file.

Any insight into what might be going on here would be most appreciated.