demo2

# demo2 - Demo#2 Molecular Dynamics for the LJ 6-12...

This preview shows pages 1–3. Sign up to view the full content.

Demo #2: Molecular Dynamics for the LJ 6-12 Potential (Author: G. H. Fredrickson (12/29/99). Force calculation adapted from Allen and Tildesley program F.17. MD algorithm is original Verlet with no potential truncation.) In this demo, we are going to explore the MD method applied to the Lenard-Jones 6-12 potential. We will use the standard reduced units of epsilon for energy and sigma for lengths. Our goal will be to estimate the properties of the fluid at temperatures and densities near T*=1.0, rho*=0.85. Lets begin by defining some parameters for the simulation: n 27;boxl 3.167; timestep 0.005; We now calculate the density and half box dimension: boxl2 boxl 2.;boxl3 boxl n^ 1. 3. ;rho n boxl^3 0.850001 The density is thus equal to our target rho*=0.85 by design. Now, lets initialize the particle positions in the simulation box. We will start with a simple cubic lattice to ensure that no particles are too close initially. Otherwise we might have problems integrating the stiff ODEs. tempcoord Table i,j,k , i, boxl3,boxl3,boxl3 , j, boxl3,boxl3,boxl3 , k, boxl3,boxl3,boxl3 ; This next command, restructures the coordinates into an nx3 list d P titi Fl tt t d 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
pltcoords : Show Graphics3D PointSize 0.10 ,Table Point coord i , i,1,n , PlotRange boxl2,boxl2 , boxl2,boxl2 , boxl2,boxl2 ; pltcoords Graphics3D Next, we need to choose initial velocities. We could select from a Maxwell-Boltzmann distribution, but it is simpler to just select from a uniform distribution and then let the fluid equilibrate. Since the variance of the distribution of velocities is T* in dimensionless units, lets start with something "hot" to make sure we melt the lattice: randomvel Table Random Real, 3.,3. , i,1,n , j,1,3 ; oldcoord coord timestep randomvel; Define a few other quantities that we will need: dtsq timestep^2; dt2 timestep 2.;niter 60;
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern