Professional Documents
Culture Documents
M L Aiello-Nicosia 1985 Eur. J. Phys. 6 148
M L Aiello-Nicosia 1985 Eur. J. Phys. 6 148
M L Aiello-Nicosia 1985 Eur. J. Phys. 6 148
gas: a simple molecular dynamics method for - Non-linear energy conservation theorem in
the framework of special relativity
Ginés R Pérez Teruel
teaching purposes
- Problem-based labs and group projects in
an introductory university physics course
To cite this article: M L Aiello-Nicosia and R M Sperandeo-Mineo 1985 Eur. J. Phys. 6 148 Antje Kohnle, C Tom A Brown, Cameron F
Rae et al.
148
1. Introduction
The understanding of microscopic disordered mo- different probability distributions for collisions be-
tion in gases is usually a difficult problem for most tween pairs of molecules and ‘scattering generators’
science students following typical introductory (Novak and Bortz 1970,Egerand Kress 1982,
physics courses. The Maxwell-Boltzmann distribu- FtkEnik et al 1983, Bonomo and Riggi 1984).
tion function is usually presented as merely an Well structured teaching courses should cover all
empirical formula. In fact the analytical approach possible links betweendifferent fields of physics,
connecting the results of the kinetic theory of gases yetthe associations between dynamics andther-
and the dynamic behaviour of simple systems (e.g. modynamics and between dynamics and statistical
hard spheres colliding elastically) is not straightfor- physics are topics which are usually insufficiently
ward. related in introductory physics books. Sauer (1981)
Mechanical apparatus is often used to illustrate provided evidence for the pedagogical value of a
the behaviour of molecules in gases, but the need computer simulation demonstrating disordered
to continuously supplyenergy to the system can motion of gases in the framework of newtonian
introduce misconceptions about the meaining of an mechanics. He also used a Monte-Carlo procedure
isolated system (Iona and Hastings 1970, Eaton et for the simulation of statistical ensembles and com-
al 1979). The use of computer simulations in the pared the results of the two methods. He proposed
microphysical area is, however, more interesting, a one-dimensionalmodelin which neighbouring
since thesesimulations can supply ‘experimental’ particles had different masses in order to allow for
support for physical theories. Many interesting thermalisation.
computer simulations of ideal gases have been pub- Many studies in moleculardynamics have already
lished forteachingpurposes.Most of these use used computer simulations to study equilibrium and
totally or partially stochastic approaches, assuming nonequilibrium properties of models of molecular
0143-0807/85/030148+06%2.25 01985 The Institute of Physics & the European Physical Society
Computer simulation of an ideal gas 149
systems (Alder and Wainwright 1959, 1963, Molecular dynamic methods (Erpenbeck and
Erpenbeck andWood 1977). These studies solve Wood 1977) usually apply periodic boundary con-
numerically the equations of motion for a many- ditions in such away that for each particle i at r,, in
bodied system and follow the trajectories of a few the primary (one- two- or three-dimensional) cell
hundred particles. To study systems containing as of edge L, 'image' particles are located at positions
many as several hundred interacting particles, high r, +vL for all the vectors v having integer compo-
speed computers with a large memory capacity are nents --a?<v,<-a?. We used a simplified version of
required. these periodic boundary conditions because of the
The characteristics and the versatility of personal limitations imposed by the memory capacity and
computers have been evaluated as satisfactory and speed of the computer.
effective for educational purposes. The implemen-
tation of amolecular dynamics calculation on a
personal computer requires not only a reduction of 2.1. Method
the number of particles that can be handled but (i)The initial configuration is set up. The
also a simplification of the numerical analysis, as machinecancalculate exactly, tothe number of
well as an evaluation of the appropriate boundary significant figures carried, the particle trajectories.
conditions in order to have small systems repres- All the trajectories are straight until two particles
enting macroscopic systems as closely as possible. collide or one particle crosses a wall.
In this paper we discuss amodelsimulatinga (ii) For each pair of particles i and j a collision
two-dimensional gas. Hard-core interaction is time rii is calculated ignoring the presence of other
assumed and a molecular dynamics method is used. particles. Introducing (Erpenbeck and Wood 1977)
By startingfrom different initial conditionsa relative coordinates and velocities
computer simulation of the development of speed rI1. = I " - Ir
distribution as it approaches a Maxwell-Boltzmann I
distribution is shown for systems containing a low particles i and j are approachingeach other if
number of particles. The changes in the experimen- rii uii < O . Otherwise the collision time is defined as
tally determined values of Boltzmann's constant H infinite
are also shown in order to study the approach to
hi = m for ril. uii 0.
equilibrium. The programhas been written in
BASIC and will be described in detail. The hardware For each pair of particles that are approaching,
used consists of the Apple I1 Europlus (64 K). A n the collision time is given by the time required to
example of a possible way to use this software in an reach a separation of D (where D is the diameter
introductory physics course will be also shown. of the particles). But someapproaching particles
can never reach a separation of D. From simple
kinematic considerations it can be shown that this
2. Model and computer simulation occurs when
The system studied consists of N identical
bi>D2
two-dimensional hard-sphere particles (hard discs)
contained in atwo-dimensional 'volume' V. We where
assume hard-core interaction: u ( r )= 0 for r > U and
b t = r;-[(rti U ~ ~ ) / U , ~ ] ~ .
u(r) = m for r <a,where r is the separation of the
centres of a pair of particles and U is the collision If this is the case we define hi =m.
diameter (in this case the diameter D of the discs). Finally the collision time is computed
Given the initial positions and velocities of
the particles and having statedthe boundary
conditions, thefuture behaviour of the system is
determined.
In order to represent a macroscopic system as Moreover, each particle i has a time t: at which,
closely as possible with a small number of particles inabsence of other particles, it would cross a
containedina volume V we imposeperiodic boundary of the primary cell. This boundary cros-
boundary conditions, i.e. we imagine space to be sing time can be calculated from simple kinematic
flled by indefinite replications of the volume V and considerations.
its constituent particles. The primary volume V is a (iii) Among all the N(N - 1)/2 collision times and
box with penetrable walls andthe particles are the N crossing times calculated the minimum value
constrained in such a way that their number in the r, is selected and the phase is advanced to t+t,
box remains constant. A particle which leaves the using the straight-line trajectory
box throughone wall is caused tore-enter with
unchanged velocity through the
opposite wall.
r,(t+~,)=r,(t)+t,oi(r) for i = 1 , 2 , ..., N
Consequently particles interact only with other (iv) If r, is given by t: the appropriate coordinate
particles. of the particle i is translated by L. If t, is given by
150 M L Aiello-Nicosia and R M Sperandeo-Mineo
til the post-collision velocities of the particles i and the ring (in the u,--u, plane) lying between the
j are computed onthe basis of momentum and circles of radius u k and Uk +AV. The approach of
energy conservations. Consequently the experimental value of H to that calculated if
the speeds of the N particles were those expected
from the Maxwell-Boltzmann distribution gives a
measure of the approach to equilibrium.
0 1 2 0 1 2
I I A I
-1.8
.l .4
F i v e 2 Evolution of the average speed distribution of
16 particles. Initially all particles had equal velocity a
magnitude U,, = 1 and random directions. The cut-off
speed is 2.5 and AV is 0.125. N ( u ) / N is the fraction of
the total particles for each speed interval. ,,U is the
root mean square of velocity. A is the average number
of collisions per particle. Broken curves represent the
theoretical Maxwell-Boltzmann distribution. ( a ) , 6 = 10;
( b ) , A = 40; (c), ri = 100; ( d ) , A = 200.
two direction cosines on the plane; the density was tribution more closely as ii increases. In the first
equalto 0.05 with respect to close packing; the two plots an anomaly is evident at v = 1, this being
initial position was randomly selected on a square a remainder of the initial distribution. The ratios
box. The different plots refer to averages of differ- n(u)/nM(u)havebeen calculated for two of the
enttotalnumbers of collisions (respectively 80, simulated distributions reported in figure 2.
320, 800 and 1600) and consequently of different Figure 3 is a plot of the distributions of this ratio.
numbers of collisions per particle ii. The histograms It also gives the average values M and the standard
arethe simulateddistributions, andthe dashed deviations. It can easily be seen that the spreading
curves represent the Maxwell-Boltzmann distribu- of these ratios is much greater for 80 collisions (10
tion. It is clearly shown that the simulated histog- collisions per particle) than for 1600 collisions (200
ram approximates the Maxwell-Boltzmann dis- collisions per particle).
152 M L Aiello-Nicosia and R M Sperundeo-Mineo
Figure 4 Average distributions of particle speeds among speed intervals for ( a ) , N = 9, ti = 500; ( b ) , N = 25; ti = 100.
Different initial conditions, corresponding to the fact, good fits depend on the equilibrium conditions
same total energy of the system, have led to the as well as onthe totalnumber of particles used
same final result. These observations justify that to average the speed distributions.
the macrostatereached after alargenumber of Oncethe velocity distributionhasbeen deter-
collisions can be called equilibrium state. mined it is easy to evaluate H. Figure 5 shows the
Different numbers of particles have been handled decrease in H as the number of collisions increases,
by the program. Figure 4 shows two speed distribu- for the same experimentas shown in figure 2. It
tions for N = 9 and N = 25 particle systems. The also shows that H approximates the equilibrium
initial conditions were the same as the experiment value in 10-15 mean collisions per particle. Ifwe
described in figure 2. Good fits were obtained start at this time to average the speed distributions
with different numbers of collisions per particle of the particles we can obtain a distribution where
(A = 500 for N = 9, and fi = 100 for N = 25). In the remainder of the initial distribution is reduced.
Figure 6 ( a ) shows the speeddistribution ob-
tained by averaging fromthe 81st tothe 320th
collision for the sameexperiment as shown in figure
Figure 5 Ratio between the Ebltzmann H and the H 2. Deviations from the theoretical values are nearly
equilibrium values HMplotted against the number of randomly distributed but the fit is not yet very good
collisions per particle. because of the low number of ‘snapshots’ of particle
velocities. In orderto reducethese deviations
the results of 10 different simulations (concerning
equal systems of N particles with thesametotal
energy but different directions of the initial
velocities) have been summed and the average dis-
tribution has been calculated. The result is shown
in figure 6 ( b ) andthe fit can be considered quite
good.
Good fittings can be obtained by averaging the
results of different groups of students using approp-
riate initial conditions.
4. Conclusions
The educational interest of our computer simula-
tion lies in the possibility of obtaining the Maxwell-
**. . S .
Boltzmanndistribution using only the framework
l of newtonian mechanics. The Maxwell-Boltzmann
distribution is regarded as a good fit to observation
Collisions per partlcle and the computersimulation gives ‘experimental’
support to the theoretical distribution.
0 10 20 30 40 The trial version of the software has been used
Computer simulation of an ideal gas 153
0.1
-
I
-2
3
VIVrms v / vrms
0 1 2 0 1 2
Figure 6 Average distribution of particle speeds among speed intervals for 16 particles. ( a ) ,The distribution
obtained by averaging from the 81st to the 320th collision for the same experiment as shown in figure 2. ( b ) , The
distribution obtained by averaging 10 simulations like that of ( a ) .The 10 systems were identical unless the
directions of the initial velocities were different.