![]() |
Faculty of Engineering and Information Technology (FEIT)
Department of Computer Science
|
COMP3320/COMP6464 Molecular Dyanmics Project
Worth 20%, due by 18:00 on Friday 18 April 2008In MD each atom is represented as a point in space. The atoms interact with each other via pairwise potentials, in a similar manner to gravity interacting between the planets, sun, moons and stars. In practice this is an approximation since for atoms quantum effects are often important - but we'll ignore this and confine our discussions to "classical" MD. Gravitational bodies interact via a potential that goes as m1m2/r12 where m1 and m2 are the masses of the bodies involved and r12 is the distance between their centres of mass. For the purpose of this work we will use a potential of the form To evaluate the interaction for many bodies we must simply perform a sum over all unique two body interactions. Thus for 3 particles we will have interactions 1-2, 1-3 and 2-3. Consider now a cubic box with a side length of R. Along each dimension of the box we arrange N atoms as indicated by the following figure (not all atoms are shown!), such that there are a total of N*N*N atoms.
For this configuration of atoms we could calculate the total interaction energy arising from the above potential - we term this the "potential" energy (PE) of the system. STEP 1: By Lab in Week 3
Develop this code using Visual Python (VPython). Your code should display a visual window showing all the atoms neatly arranged in a cube, and you should printout the total potential energy (in the text window). Note to run VPython in the lab type "vpython". This will give you an idle window. You type code in another window - to obtain this go to the file menu and use the "new window" option. If you select the "open" option it should take you to all the vpython demos that I showed in lectures. (They are in /usr/local/lib/python2.3/site-packages/visual/demos).I will ask you to demonstrate your code to me in your lab in week 3. STEP 2:
The total force on a given atom will be the sum of all the pairwise forces. Assuming that the forces on at least some of the atoms are non-zero then the atoms will want to move. MD is the process of moving the atoms according to the forces they are subjected to. Moving the atoms equates to integrating the equations of motion over time or solving a differential equation. There are a variety of ways in which we can do this, but a popular method is the so called "velocity verlet" algorithm (W.C Swope et al J. Chem. Physics 76 637 (1982)). This has the following form
where t is the current time, and tstep is the timestep (the integration step). And by assuming that all particles have unit mass we can replace the acceleration by the force (F = ma). When the particles begin to move they will gain kinetic energy (KE = 1/2 mv2) with the total KE just a simple sum of all the atomic KEs. If there is no source or sink of energy then the total energy (PE+KE) should remain constant, so the gain in KE is offset by a lose of PE. Extend your Python code to compute the force on each atom and allow the particles to move. Your code will need to read in a timestep and a total number of timesteps. Your code should also compute and printout the potential, kinetic and total energy at each timestep. You should have this working by lab in week 5 at the latest. HERE is some sample output for you to verify that your results are correct STEP 3:
In addition to the visual output, you should provide text output that details the input parameters, and provides the total energy, potential energy and kinetic energy periodically during the course of the simulation. Within the Python portion of your code use time.clock() routine to report the total time taken to perform the simulation. The start time is from the beginning of the first simulation step, while the end time is after the last iteration. This means you do not have to include setup time, but once the clock is started it should not be stopped again until everything is complete.
You are required to submit a tar file using the submit tool on one of
the student computers:
|
|
Please direct all enquiries to: Alistair.Rendell@anu.edu.au Page authorised by: Head of Department, DCS |
| The Australian National University — CRICOS Provider Number 00120C |