demo3 - Demo #3: NVT Monte Carlo for the LJ 6-12 Potential...

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

View Full Document Right Arrow Icon
Demo #3: NVT Monte Carlo for the LJ 6-12 Potential (Author: G. H. Fredrickson (12/29/99). Program adapted from Allen and Tildesley program F.11. MC algorithm is standard Metropolis with no potential truncation.) In this demo, we are going to explore the Metropolis MC method for the NVT ensemble 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. Start with the number of particles, the box side length, and the temperature: n 27 ; boxl 3.167; tstar 1.0; We now calculate the half box dimension and density: boxl2 boxl s 2.; boxl3 boxl 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. 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 / coord Partition # Flatten # tempcoord ' ,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 , boxl2, boxl2 , boxl2, boxl2 ' ; pltcoords D Graphics3D D Define a few other quantities that we will need. DRMAX is the maximum displacement of a trial move, NITER is the
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.

Page1 / 10

demo3 - Demo #3: NVT Monte Carlo for the LJ 6-12 Potential...

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