Complete Guide from Installation to Running Molecular Dynamics Simulations
This tutorial will guide you through the installation and basic usage of NAMD. We will start with system requirements, proceed to installation, and finally run a simple protein simulation.
NAMD is often used together with VMD. It is recommended to install VMD for molecular visualization and structure preparation.
# For Ubuntu/Debian
sudo apt-get update
sudo apt-get install build-essential gfortran python3-dev
# For CentOS/RHEL
sudo yum groupinstall "Development Tools"
sudo yum install gcc-gfortran python3-devel
wget https://www.ks.uiuc.edu/Research/namd/2.14/download.html
# Download the appropriate binary for your system
# Extract the downloaded file
tar -xzf NAMD_2.14_Linux-x86_64-multicore.tar.gz
cd NAMD_2.14_Linux-x86_64-multicore
# Add NAMD to PATH
export PATH=$PATH:/path/to/NAMD_2.14_Linux-x86_64-multicore
Use VMD to prepare the protein structure and generate the required PSF and PDB files.
# Example: config.namd
structure protein.psf
coordinates protein.pdb
set temperature 300
set outputname md
# Force field parameters
parameters par_all36_prot.prm
# Simulation settings
numsteps 50000
outputEnergies 1000
outputPressure 1000
# Integrator
timestep 2.0
rigidBonds all
nonbondedFreq 1
fullElectFrequency 2
stepspercycle 10
# Output
outputName $outputname
binaryoutput yes
binaryrestart yes
namd2 +p4 config.namd > output.log
NAMD supports parallel computing using multiple CPU cores and GPUs. Use the +pN
option to specify the number of processes.
Use VMD or other analysis tools to analyze the simulation trajectory and extract useful information such as RMSD, secondary structure, and hydrogen bonds.
Molecular Dynamics
Molecular Dynamics
Molecular Visualization