Any molecular dynamics simulation that runs in NAMD can be used for Interactive Molecular Dynamics (IMD). This tutorial describes exactly what you need to do to make make a normal simulation interactive. If you do not currently have a NAMD simulation, but you still want to try out IMD, we provide an example simulation for you to try below.

Step 1: Obtain the required software

Obtain and install current versions of VMD and NAMD.

Step 2: Set up your simulation

Prepare your simulation for use with NAMD. If you would like to use our example simulation instead of one of your own, download either or alanin.tgz. Unpack it and use the files according to the instructions below.

Step 3: Modify your NAMD configuration file IMD

Add the following lines to your NAMD configuration file (for example, alanin.conf):
  IMDon    yes
  IMDport  2030
  IMDfreq  1
  IMDwait  on
The NAMD manual contains more information on the meaning of these parameters. Once your configuration file is ready, run NAMD.
  namd alanin.conf
NAMD will initialize your system then display the message
indicating that it is waiting for VMD to connect.

Step 4: Load your system in VMD

Start VMD and load a PDB file (or, if you prefer, both the PDB and PSF files) for the same system that is currently running in NAMD.

Step 5: Connect to NAMD

Open the "IMD" or "Simulations->IMD Connect" plugin from the VMD "Extensions" menu (depends on which version you're running), and enter the hostname of the computer running NAMD (node 0 for a cluster) and the port you chose in the configuration file (2030). Click "Connect". After a few seconds, you should see your molecule start to move: you are watching your simulation in real-time!

Step 6: Interacting with your simulation

movie of IMD In the Mouse menu of the VMD Main window, select "Mouse -> Force -> Atom". You may alternately select "Residue", or "Fragment" to apply forces to whole residues or fragments. Your mouse can now be used to apply forces to your simulation. Click on an atom, residue, or fragment and drag to apply a force. Click quickly without moving the mouse to turn the force off. You can also use a variety of 3D position trackers to apply forces to your simulation. Trackers with force-feedback such as the Sensable PHANTOM allow you to feel the forces you are applying to your molecules, as if they were real objects. See the VMD User's Guide for information on configuring trackers.

The picture at right shows NAMD (in the left window) and VMD (in the right window) running our example IMD simulation. A 3D input device is being used to pull the molecule in the simulation around.

Step 7: Disconnecting from NAMD

When you are finished interacting with your simulation, open the "IMD Connection" plugin again in the VMD "Extensions" menu, and click "Detach Sim". Your NAMD simulation will wait for another VMD connection. If you would like to stop the simulation instead, select "Stop Sim".

Step 8: Further information

For more information about IMD, see the main IMD website or the VMD homepage. Please send questions about IMD to