NAMD Tutorial

Complete Guide from Installation to Running Molecular Dynamics Simulations

Introduction

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.

Installation Steps

1. Install Dependencies

# 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

2. Download and Extract NAMD

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

3. Set Environment Variables

# Add NAMD to PATH
export PATH=$PATH:/path/to/NAMD_2.14_Linux-x86_64-multicore

Basic Usage

1. Prepare Input Files

Use VMD to prepare the protein structure and generate the required PSF and PDB files.

2. Create NAMD Configuration File

# 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

3. Run Simulation

namd2 +p4 config.namd > output.log

Advanced Topics

Parallel Computing

NAMD supports parallel computing using multiple CPU cores and GPUs. Use the +pN option to specify the number of processes.

Trajectory Analysis

Use VMD or other analysis tools to analyze the simulation trajectory and extract useful information such as RMSD, secondary structure, and hydrogen bonds.

Related Tutorials