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

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

View Full Document Right Arrow Icon
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 s 2.; boxl3 s n^ + 1. s 3. / ; rho n s 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, , k, ' ; + This next command, restructures the coordinates into an nx3 list / d P titi # Fl tt # td ' 3 '
Background image of page 1

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

View Full DocumentRight Arrow Icon
pltcoords : Show # Graphics3D # PointSize # 0.10 ' , Table # Point # coord ## i ''' , i, 1, n ' ' , PlotRange ! boxl2, boxl2 , , ' ; pltcoords D Graphics3D D 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. ' , , j, 1, 3 ' ; oldcoord timestep randomvel; Define a few other quantities that we will need: dtsq timestep^2; dt2 2.; niter 60;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course CHE 210b taught by Professor Ghf during the Fall '10 term at UCSB.

Page1 / 13

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online