124 views

Original Title: Python Verlet

Uploaded by Marco Santia

- Project Report Molecular Dynamics CMSC6920
- Billones Domain
- 2009 DFT a Practical Introduction KITAP
- Simple Harmonic Oscillator: Molecular Dynamics Simulation
- Introduction to Molecular Dynamics Simulations. Prabal Maiti
- Amber.toturial Introduction 1
- trp_drug_tutor
- Fluid Dynamics of a Lennard-Jones Fluid
- MD-lec1_35
- Shock Waves in High-Energy Materials- The Initial Chemical Events in Nitramine RDX
- Intro_MD_Simulations_LAMMPS_0.pdf
- 02_Simulating Techniques - AtomisticScale
- Lecture March18
- Assesment of common simulation protocols for simulation of nanopores.pdf
- Atom-centered symmetry functions for constructing high-dimensional neural network potentials
- Intro 54654
- Mul
- Natural Products
- Basic Molecular Dynamics
- MD 3

You are on page 1of 5

Introduction

The goal is to write a simple molecular dynamics program in Python. The program will read initial atomic

coordinates, and will print in a xyz file the coordinates of the atoms at every step of the dynamics. The

xyz file will be readable by molden for example.

We will have to program:

2. The potential and kinetic energy of a system of atoms

3. The acceleration of the particles by finite difference

4. The Verlet algorithm

The following parameters will be used for the Argon atom:

= 0.0661 j/mol

= 0.3345 nm

The atom coordinates will be expressed in nm.

Lennard-Jones potential

Write a function that computes the Lennard-Jones potential:

V(r) =4 (r )12 (r )6

The values of and will be given as global variables at the beginning of the script.

This is the output you should get:

0.3

V = 0.468192418088

Molecular geometry

Read the molecular data

Modify your program such that it reads from the standard input:

The atomic masses

The atomic coordinates (x,y,z on each line)

def main():

Natoms = read_Natoms()

mass = read_atom_mass(Natoms)

coord = read_atom_coord(Natoms)

print mass

print coord

Number of atoms?

3

For each atom: mass

40

10

20

For each atom: x, y, z

0 0 0

1 2 3

-1 0 2

mass = [40.0, 10.0, 20.0]

coord = [[0.0, 0.0, 0.0], [1.0, 2.0, 3.0], [-1.0, 0.0, 2.0]]

Add a function to your program to compute the distance matrix:

def main():

Natoms = read_Natoms()

coord = read_atom_coord(Natoms)

distances = get_distances(coord)

for d in distances:

print d

Number of atoms?

3

For each atom: x, y, z

0 0 0

1 2 3

-1 0 2

[0.0, 3.7416573867739413, 2.23606797749979]

[3.7416573867739413, 0.0, 3.0]

[2.23606797749979, 3.0, 0.0]

Change your Lennard-Jones function such that it computes the Lennard-Jones potential of the whole

system:

NatomsNatoms

XX

VLJ = V(rij)

i =1 j >i

def main():

Natoms = read_Natoms()

coord = read_atom_coord(Natoms)

print V_lj(coord)

Number of atoms?

3

For each atom: x, y, z

0 0 0

0 0 .3

.1 .2 -.3

0.396856906955

Total energy

Write a function that computes the total energy of the system:

Natoms

X

E =T +VLJ T = 12 mi vi2

i =1

def main():

Natoms = read_Natoms()

mass = read_atom_mass(Natoms)

coord = read_atom_coord(Natoms)

velocity = [ [0.1,0.2,0.3] for i in range(Natoms) ]

print E_tot(coord,mass,velocity)

Number of atoms?

3

For each atom: mass

10

20

15

For each atom: x, y, z

0 0 0

0 0 .3

.1 .2 -.3

3.54685690696

Acceleration

The acceleration vector is given by:

V

axi =m1i x

i

Write the function to compute the approximate derivative of the potential with respect to atomic

coordinates:

V V(xi +xi )V(xi xi )

xi

2xi

def main():

Natoms = read_Natoms()

mass = read_atom_mass(Natoms)

coord = read_atom_coord(Natoms)

velocity = [ [0.1,0.2,0.3] for i in range(Natoms) ]

print get_acceleration(coord,mass)

f atoms?

3

For each atom: mass

10

20

15

For each atom: x, y, z

0 0 0

0 0 .3

.1 .2 -.3

[[-0.0012143469700354181, -0.0024287378274090443, -2.8852483886704636],

[0.0003772257075318475, 0.0007544514316476514, 1.4421824477393457],

[0.00030659703662931176, 0.000613223309409161, 0.0005889954611815185]]

Verlet Algorithm

The Verlet algorithm is the following:

2

rn +1 =rn +vn t +an t2

vn +1 =vn + 12 (an +an +1 )t

where:

is the velocity vector

is the acceleration vector

is a time step

Write the verlet algorithm in a function. At each time step, print the atom coordinates (for the Argon atom)

in xyz format with the total energy in the title.

Here is the main fuction:

def main():

Natoms = read_Natoms()

mass = [ mass_Argon for i in range(Natoms) ]

coord = read_atom_coord(Natoms)

velocity = [ [0.,0.,0.] for i in range(Natoms) ]

coord,velocity = verlet(Nsteps=1000,Delta_t=.1,coord,mass,velocity)

Number of atoms?

3

For each atom: x, y, z

0 0 0

0 0 .3

.1 .2 -.3

3

Step 0 E = 0.396856906955

Ar 0.000000 0.000000 0.000000

Ar 0.000000 0.000000 0.300000

Ar 0.100000 0.200000 -0.300000

3

Step 1 E = 0.371644652669

Ar -0.000002 -0.000003 -0.003611

Ar 0.000001 0.000002 0.303610

Ar 0.100001 0.200001 -0.299999

[...]

3

Step 998 E = 0.377839040613

Ar -1.656240 -3.312489 -5.790241

Ar 0.000898 0.001795 10.642537

Ar 1.755342 3.510694 -4.852296

3

Step 999 E = 0.377839040613

Ar -1.657894 -3.315796 -5.796029

Ar 0.000898 0.001797 10.652901

Ar 1.756995 3.513999 -4.856872

- Project Report Molecular Dynamics CMSC6920Uploaded byNasir Danial
- Billones DomainUploaded byZabrina Tan Cua
- 2009 DFT a Practical Introduction KITAPUploaded bygozyonum
- Simple Harmonic Oscillator: Molecular Dynamics SimulationUploaded byt_sairam
- Introduction to Molecular Dynamics Simulations. Prabal MaitiUploaded byCornersouth
- Amber.toturial Introduction 1Uploaded byhamid592004m
- trp_drug_tutorUploaded byBacillus Permians
- Fluid Dynamics of a Lennard-Jones FluidUploaded byMário David Xavier
- MD-lec1_35Uploaded byPradeep Sijeriya
- Shock Waves in High-Energy Materials- The Initial Chemical Events in Nitramine RDXUploaded byrenefbg
- Intro_MD_Simulations_LAMMPS_0.pdfUploaded bykroidman
- 02_Simulating Techniques - AtomisticScaleUploaded byMiguel Angel
- Lecture March18Uploaded byAnubhav Vardhan
- Assesment of common simulation protocols for simulation of nanopores.pdfUploaded byMangesh Bhendale
- Atom-centered symmetry functions for constructing high-dimensional neural network potentialsUploaded byumarlucio
- Intro 54654Uploaded byEric Matamoros Morales
- MulUploaded bybasark
- Natural ProductsUploaded byiplaba
- Basic Molecular DynamicsUploaded byLuz Smith
- MD 3Uploaded byChandra Clark
- moldynUploaded byMuhammad Shahid Bilal
- MD-basicsUploaded byRajneesh Perhate
- kresse1993.pdfUploaded byMuhFachrul
- Ab Initio Molecular Dynamics SimulationsUploaded byXiaolong Tian
- 43C-25Uploaded by叶远虑
- sdarticle11Uploaded bygoel19x1
- Youyong Li, Shiang-Tai Lin, and William A. Goddard III- Efficiency of Various Lattices from Hard Ball to Soft Ball: Theoretical Study of Thermodynamic Properties of Dendrimer Liquid Crystal from Atomistic SimulationUploaded byDremHp
- Cu_nanowire_application_note_v1.2.pdfUploaded bysaikatistotoi
- GPU Algorithms for Molecular ModelingUploaded bycapranzolo
- 72e7e52094f6c97bd4.pdfUploaded byemin08091989

- Diphenyl Allylamine POUploaded byevsgoud_goud
- Columbus Castings Metal Grades.pdfUploaded byksangeeth2000
- Equipment_sizing (Update) - Pacf2-Rev. AUploaded byAnonymous AtAGVssJ
- Matthew A. B. Baker et al- Two methods of temperature control for single-molecule measurementsUploaded byGmso3
- Logging HistoryUploaded byAsahel Nuñez
- CH E 330-Mass TransferUploaded bynttxuan
- 1-s2.0-S1878535214002597-mainUploaded byLiz Dos
- Chapter 1 Organic ChemistryUploaded byyeeooo
- Tough Met Artificial Lift CouplingsUploaded byIvan Gutierrez
- stereoCh4 (1)Uploaded byAminahNatasha
- 2014 Forward Osmosis in India- Status and Comparison WithUploaded byDr-Manoj Garg
- Molecular DynamicsUploaded bySourav Saha
- Desgasificado al vacíoUploaded byTOMYCR
- FULLTEST-5-1-2012 (1)Uploaded byaashray
- StoichiometryUploaded byMomo
- FLAMANT-A New Heat Transfer Fluid for Concentrating Solar SystemsUploaded byShahabuddin Suzan
- QC of Packaging MaterialsUploaded byvsvsuresh2099
- Wolf 2007 Shear Thickening OfUploaded byNitishKumar
- vjdpUploaded byJuan Pérez
- Rhodium catalyzed hydroformylation - CoverUploaded bymaildesantiago
- [Asymmetric Catalysis] Trienamines Their Key Role in Extended Organocatalysisfor Diels-Alder ReactionsUploaded byRaulVenegas2011
- How to Read the Solar System - Paul AbelUploaded byAngelica
- AMPUploaded byRajyalakshmi Jammalamadaka
- IWEPAC-6Uploaded byMisgates
- Radial FlowUploaded bysunger67
- 09.Electromagntic and Faraday Law.inductionUploaded byAudrey Patrick Kalla
- Naphtha Reforming ImportanceUploaded byAnonymous QpbG5KF
- Petawatt Laser SandiaUploaded byapi-26195907
- LIFUploaded byDaMySeLa
- _Review_CH_1-5Uploaded byDimmu Borgir