Currently, there are two ways to steer simulations with NAMD. One
is called ``moving constraints'' and is based on the harmonic
constraints feature. The other is a stand-alone feature called
``SMD''. In both cases the user specifies a reference position
, force constant
, velocity of the reference position
movement
and the number of the constrained atom
. Then
during the simulation a potential
and a corresponding force
are added for the specified atom.
The potential is computed according to
![]() |
(1) |
Moving constraints feature works in conjunction with the Harmonic
Constraints (see an appropriate section of the User's guide).
The reference positions of all constraints
will move according to Eq. 3.
A velocity vector (movingConsVel) needs to be specified.
The way the moving constraints work is that the moving reference
position is calculated every integration time step using
Eq. 3, where is in Å/timestep, and
is the
current timestep (i.e., firstTimestep plus however many
timesteps have passed since the beginning of NAMD run). Therefore,
one should be careful when restarting simulations to appropriately
update the firstTimestep parameter in the NAMD configuration
file or the reference position specified in the reference PDB file.
NOTE: NAMD actually calculates the constraints
potential with
and the force with
,
where
is the exponent consexp. The result is that if one
specifies some value for the force constant
in the PDB file,
effectively, the force constant is
in calculations. This caveat
was removed in SMD feature.
The following parameters describe the parameters for the moving harmonic constraint feature of NAMD. This feature allows the restraint reference positions for all restrained atoms to be moved. Moving the restraint reference positions for a single atom is provided by the SMD feature.
The constraints parameters are specified in the same manner as for usual (static) harmonic constraints. The reference positions of all constrained atoms are then rotated with a given angular velocity about a given axis. If the force constant of the constraints is sufficiently large, the constrained atoms will follow their reference positions.
A rotation matrix about the axis unit vector
is calculated every
timestep
for the angle of rotation corresponding to the current timestep.
angle =
,
where
is the angular velocity of rotation.
From now on, all quantities are 3D vectors, except the matrix and the
force constant
.
The current reference position is calculated from the initial
reference
position
(at
),
,
where
is the pivot point.
Coordinates of point N can be found as
.
Normal from the atom pos to the axis is, similarly,
normal
The force is, as usual,
;
This is the force applied to the atom in NAMD (see below).
NAMD does not know anything about the torque
applied. However, the torque applied to the atom can be calculated
as a vector product
torque
Finally, the torque applied to the atom with respect to the axis
is the projection of the torque on the axis, i.e.,
If there are atoms that have to be constrained, but not moved, this implementation is not suitable, because it will move all reference positions.
Only one of the moving and rotating constraints can be used at a time.
Using very soft springs for rotating constraints leads to the system lagging behind the reference positions, and then the force is applied along a direction different from the "ideal" direction along the circular path.
Pulling on N atoms at the same time with a spring of stiffness K amounts to pulling on the whole system by a spring of stiffness NK, so the overall behavior of the system is as if you are pulling with a very stiff spring if N is large.
In both moving and rotating constraints the force constant that you
specify in the constraints pdb file is multiplied by 2 for the force
calculation, i.e., if you specified
in the pdb
file,
the force actually calculated is
.
SMD feature of namd2 does the calculation without multiplication of
the
force constant specified in the config file by 2.
The SMD feature is independent from the harmonic constraints, although it
follows the same ideas. One has to specify the force constant
(SMDk), the number (1-based indexing) of the atom (SMDAtom), which is restrained to the moving reference position, the
initial reference position
(SMDRefPos), the absolute value of the velocity of movement
(SMDVel), and
the direction of movement
(SMDDir). The velocity
is then given by
. Vector
is
normalized by NAMD before being used. Optionally, the frequency of
SMD data output can be specified.
The time used in the reference position calculation starts at time
which can be specified through SMDTStamp parameter,
defaulting to firstTimestep. The reference position is
calculated then by
![]() |
(4) |
One may want to change the direction of the reference position
movement, e.g., if the restrained atom is moving too slow in the given
direction. To check for such slow movement, the minimum allowed
average velocity (SMDVmin) and the averaging time
(SMDVminTave) have to be specified. Then every
timesteps NAMD will compute the average velocity in the
current direction over the past
timesteps, and compare it
to
. The average velocity is computed simply by
Every time the direction is changed, the reference point is also
changed to
![]() |
(7) |
After the angles and
are calculated, the new
direction is found by constructing a right orthonormal system of
coordinates with
, the initial direction specified by SMDDir in the configuration file, being the
direction. The
other two vectors
and
, orthogonal to
and
to each other are found by first producing
, or
in the case when
is collinear to
, normalizing
, and, finally, producing
. Then the new direction is
given by
![]() |
(8) |
Sometimes, especially when a small enough is employed, the
movement of the restrained atom proceeds in steps, resulting in a fast
movement of the atom over a short period of time. When this happens,
it may be desirable to reset (reduce) the applied force. Resetting of
the force to a specified value
(SMDFmin) should happen
when the average velocity of atom movement
over a given period of time
(SMDVmaxTave) exceeds
the specified maximum allowed velocity
(SMDVmax) in
the direction of reference position movement
. The average
velocity is calculated similarly to Eq. 5, and in the
case when
is larger than
, the
reference position is reset according to Eq. 6. The
time stamp
is set to current time.
NAMD provides output of the current SMD data. The frequency of output is specified by the SMDOutputFreq parameter in the configuration file. Every SMDOutputFreq timesteps NAMD will print the current timestep, current position of the restrained atom, the current force applied to the restrained atom (in piconewtons, pN), the reference position at the time of the last change of direction or force resetting (initially, the reference position specified in the configuration file), current direction of the reference position movement, and the time stamp, indicating the timestep when the direction was changed or force reset (initially, SMDTStep specified in the configuration file, or its default value). The output line starts with word SMD
The energy of the SMD restraint is printed out along with other energies in the column titled SMD. The frequency of this output is defined by outputEnergies parameter in the configuration file.
When the direction of the reference position movement changes or the force is reset, this change is indicated by an output line starting with SMDChange and showing the current timestep, the current atom position, the new reference position after the change, and the new direction of the reference position movement. The current timestep becomes the time stamp for the following simulation until the next change occurs.
The following parameters describe the parameters for the SMD feature of NAMD. This feature allows a harmonic restraining force to be applied to any ONE atom in the simulation and the restraining reference position to be moved. It also allows to randomly change the direction of the reference position movement if the restrained atom progress is too slow, and to reset the applied force to a given value if the progress of the restrained atom is too fast.
NAMD now works directly with VMD to allow you to view and interactively steer your simulation. NAMD will wait for VMD to connect on startup.
NAMD provides a limited Tcl scripting interface designed for applying forces and performing on-the-fly analysis. This interface is efficient if only a few coordinates, either of individual atoms or centers of mass of groups of atoms, are needed. In addition, information must be requested one timestep in advance. The following configuration parameters are used to enable the Tcl interface:
At this point only low-level commands are defined. In the future this list will be expanded. Current commands are:
SPMamp
print Hello World&''.
addforce $groupid { 1. 0. 2. }
''.
Several vector routines from the VMD Tcl interface are also defined.