MDEnergy is a program to calculate energies from DCD or PDB-files. It is originally derived from Mindy, a simplified version of the NAMD engine, written by Justin Gullingsrud. It can calculate the different bonded and nonbonded energies for each atom based on the information from the PSF-file and the coordinate file that you have to specify. The total energy values are identical to the NAMD output, except for roundoff errors in case you specify the same cutoff and switch distance as in the NAMD input file. You can also compute the energy for a selection of atoms or determine the interaction energy between two sets of atoms. MDEnergy is very memory efficient because is processes DCD files frame by frame. The output format is similar to NAMD's output and you can plot it with 'namdplot' (comes with NAMD).


If you have questions please send email to the author Jan Saam, at or



Same terms as NAMD license


The TCL-script visual_mdenergy.tcl contains a procedure with the same name that
visualizes the atom based energy values. You must use the mdenergy 
option -a  to dump the atom energies to a file that can be read by

You must specify on the command line or in the wrapper srcipt:
You always need a PDB or DCD file as coordinate input:
-pdb file   and/or  
-dcd file   : You can specify as many files as you want, they will
              process in order of occurance. They must have the same 
              number of atoms and MDEnergy assumes that they all belong
              to the same structure.

And you need parameters and structure information:
-par file   : The parameter file in charmm style.
-xplor file : The parameter file in xplor style.

-psf file   : The PSF file (charmm/xplor).

or alternatively
-amber      : AMBER partop file (parm7)
              (contains parameters and structure)

You must specify one or more of the following options to tell mdforce 
which energies it has to calculate:
-smooth n : No energies are computed but a trajectory with smoothed
            coordinates is emitted. See -avg for info how smoothing 
-all      : All energies are computed
-bond     : Bond energy
-angl     : Angle energy
-dihe     : Dihedral energy
-impr     : Improper energy
-vdw      : Van der Waals energy
-elec     : Electrostatic energy
-nonb     : Nonbonded energies (elec, vdw)
-conf     : Conformational energy (bond, angl, dihe, impr)
-kin      : Kinetic energy (need velocity dcd file: -vel file)
-hbon     : Computes h-bond energies (angle and distance dependent)
            which can be very nicely visualized in VMD with the script
            visual_hbonds (in 'hbonds.tcl'). See documentation therein.

            You need to have:
            A psf file with populated NBON and NACC fields to tell 
            MDEnergy about the donors and acceptors in your system.
            You can generate it using the 'hbondpsf' tool which is 
            contained in this distribution. With the help of the
            DONOR/ACCEPTOR information in the topology file and an 
            existing psf file it generates a new psf including the
            required donor/acceptor info.
            -hpar file : h-bond parameter file
                         A sample file that should be sufficient for 
                         most cases is provided in hbonds/hpar

            -pat file  : If there are patches in the molecule, then 
                         specify them in a file in th same format as
                         you would do for 'psfgen'.


ther options/parameters: 
-xplor    : By default MDEnergy assumes a CHARMM format parameter file. 
            Use this option to tell MDEnergy that you are using xplor

-beg n    : the first frame to process. Default=0
-end n    : the last frame to process. you can say 'last' instead of a 
            number, if you just mean the last frame of the dcd file.

-switch   : switch distance for VDW interaction. Default=10
-cutoff   : cutoff distance for nonbonded calculation. Default=12
            (switch is the distance at which the switching function for VDW 
            interaction begins, cutoff is where it ends and where the VDW 
            interaction is zero.
            -switch 20 -cutoff 25 starts the switching function at 20A and 
            at 25A it has reached zero.
            For the electrostatic interaction switch has no meaning, while
            cutoff marks the point where the interaction is zero. The 
            potential function is shifted to obtain this.)

-scale14fac n : VDW 1-4 scaling factor in CHARMM style
-sncb n       : VDW 1-4 scaling factor in AMBER style.
                This would be 1/scale14fac. See NAMD manual for details.

-noamberexcl  : Don't read exclusions from parm file but autogenerate

-sel file : File with indices for an atom selection.
            The energy for the selected atoms is computed.
            For the nonbonded energies the interaction of the selection 
            with the environment is included.
            If this option is used twice the nonbonded interaction energy 
            between the two selections is computed.

-self     : If you have specified a selection with -sel then the 
            nonbonded energies are computed only within the selection.
            Otherwise the interaction with the environment (but not the
            self energy of the environment) is included. 

-diel n   : Dielectric constant. This only makes sense if you want to 
            calculate the interaction between two sets of atoms. You can 
            use it for simple docking experiments between two molecules. 
            If you don't have water between them you could for example 
            specify -diel 80. Note that this is a rather rough method. 
            It assumes the dielectric constant for the entire space 
            between the atoms of the two selections, even if there are 
            other parts of the protein or the selection itself between 

-a file   : Dumps energies for all individual selected atoms into a file 
            which can be read by the script 'viz_energy.tcl' to visualize
            the energy contributions per atom in VMD.
            Use one energy type option only!

            File format (entries line by line):
            # header
            1) energy type 
            2) number of atoms
            3) selection text
            4) atom index list of the selection
            # body (for each frame)
            1) frame number
            2) indexes of min and max values for current frame 
            3) min and max energy values for current frame  
            4) A long line containing the energy values for each atom  

-log      : The energy output will be on logarithmic scale. This can be 
            useful for visualization.

-avg n    : You can get running averages of all output by specifying this
            option. The width of the symmetric sliding average window is 
            2n+1. This effects the total energy output on the screen as well
            as well as the values for the individual atom dumped into a file
            by '-a file'.
            By default your output size is reduced by 2n frames, n frames
            missing at the beginning and the end. This is because the average
            has to be build up. Use options -pad or -ramp to preserve the
            number of frames.

-pad      : To be used with -avg. The missing frames at the beginning and 
            the end are padded with the first averaged frame.

-ramp     : To be used with -avg. The missing frames at the beginning and
            the end are replaced by ramping the average up and down. That 
            means the averaging window is not symmetric and has not the 
            same size at the ends but the average is computed from as all
            available frames. This gives smoother looking results at both 

The VMD scripts energy.tcl and interact.tcl contain procedures
'energy' and 'interact' which are calling a shell script 'runvmdenergy'
that determines which binary of MDEnergy to run. Binaries exist for 
Linux, Solaris and Irix.
MDEnergy runs as a background process so you can continue with your 
work in VMD. The output is similar to NAMD's output and you can plot 
it with 'namdplot' (a tool which is part of the NAMD distribution).

This script is an interface to compute energies conviniently in VMD.

mdenergy -bond|-angle|-dihed|-impr|-vdw|-elec|-nonb|-all -sel $sel [$sel2] [opti