+
Microcanonical Ensemble - Generating Velocity and Energy Distributions Through Newtonian Dynamics

Developed by Shafat Mubin - Published July 13, 2017

DOI: 10.1119/PICUP.Exercise.microcanonical

In a microcanonical ensemble, a fixed amount of energy is distributed among different energy levels of a system and the number of possible configurations are counted. The occupation probability of each energy level is determined from the total number of different configurations, and subsequently used to generate the energy and velocity distributions of the system. While the above is a statistical ensemble that applies to the time-averaged quantities of a large number of particles, the same energy and velocity distributions can be obtained through brute-force Newtonian mechanics (i.e. iterative update of force, acceleration, velocity, position) applied to a system of interacting particles that is allowed to evolve over a sufficiently long time interval. If the trajectories of these particles are calculated using only Newton's laws, and the energies and velocities of every particle are recorded at fixed intervals, the same energy and velocity distributions are obtained from the recorded data. In this exercise, the energy and velocity distributions of a microcanonical ensemble generated from Newtonian mechanics are compared with those calculated by statistical mechanics to demonstrate consistency of results. This way, students are reinforced with the understanding that in the limit of large number of particles, Newtonian mechanics involving dynamics of particles and statistical mechanics involving energy distributions provide identical results. Students will learn to simulate dynamics of single and multi-particle systems, applying concepts of molecular dynamics (MD), and generate distributions from collected data. In addition, students will have the option of exploring the impact of various parameters (e.g. mass, spring constant, potential energy function, initial conditions) on the overall outputs.
Subject Area Thermal & Statistical Physics
Levels Beyond the First Year and Advanced
Available Implementation Python
Learning Objectives
Students will be able to: - code Newtonian mechanics of point particles interacting with an external static potential or with other non-static particles, as commonly done in molecular dynamics simulations (Exercises 1-3) - simulate the trajectory of a single particle using Newton’s laws in a 1D symmetric potential and thus become acquainted with elements involved in coding single particle dynamics (Exercise 1) - plot histograms of velocity, kinetic energy and potential energy of the above particle obtained from the simulated trajectory over a long time interval to infer statistical distributions of these quantities over time, and to deduce the impact of the potential energy function on the plotted histograms (Exercise 1) - simulate trajectories of multiple interacting particles using Newton's laws and gain an understanding of the additional steps involved in coding multiple particle dynamics compared to single particle simulation (Exercises 2-3) - plot the velocity and energy distributions of large systems evolved at the end of a long time interval, and compare with theoretical (i.e. statistical mechanics predicted) results, and deduce the impact of the potential energy functions on the distributions (Exercises 2-3)
Time to Complete 180 min

These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).

$\bf{Exercise \ 1: Single \ Particle \ Harmonic \ Oscillator}$ Numerically calculate the trajectory of a single particle of mass $m$ located in a harmonic potential well $(U(x) = \frac{1}{2} k x^2)$. Assign the following parameters in arbitrary units: $\quad \quad \quad$ Mass of particle: m = 1.0 $\quad \quad \quad$ Timestep: $\Delta t$ = 0.01 $\quad \quad \quad$ Spring constant: k = 1.0 Also, assign an arbitrary initial position and velocity. Run simulation for at least 10,000 iterations. Collect data into arrays (or write to disk if necessary) for velocity, kinetic and potential energies of particle at every fixed interval, and generate histograms of velocity, potential energy and kinetic energy using all collected data at the end of simulation. If desired, plot the position-time and the velocity-time functions to observe the trajectories generated. a) At which location(s) is the speed (and kinetic energy) largest or zero? b) At which location(s) is the potential energy largest or zero? c) Note the maximum speed of the particle. Does it depend on the initial velocity and initial position? d) Are the potential and kinetic energy histograms similar in shape? Explain why. e) Do the velocity, potential and kinetic energy histograms have the shapes expected from microcanonical ensemble? Why not? f) The velocity histogram may be slightly asymmetric about the origin. If so, explain why. Do the initial position and velocity affect this asymmetry? --- $\bf{Exercise \ 2: System \ of \ Multiple \ Interacting \ Particles}$ Repeat above analysis for a 1D chain of particles, in which each particle only interacts with its connected neighbours (i.e. #1 interacts with #2, #2 with #1 and #3, #3 with #2 and #4, etc.) via a Lennard-Jones (LJ) pair potential energy function: $\quad \quad U_{LJ} (r) = 4\varepsilon \left [ \left(\frac{\sigma}{r} \right)^{12} - \left(\frac{\sigma}{r} \right)^6 \right] $ where $r$ is the separation between the pair of particles, $\varepsilon$ is the minimum value of the interaction energy between the pair and $\sigma$ is the distance at which energy is zero (note: force is not zero though). Use the following parameters (in arbitrary units): $\quad \quad \quad$ m = 5.0 $\quad \quad \quad$ $\Delta t$ = 0.001 $\quad \quad \quad$ $\varepsilon$ = 4.8 $\quad \quad \quad$ $\sigma$ = 8.9 Assign an initial velocity and position to each particle (hint: use random number generator to expedite). Trial run the simulation and observe the stability of the chain. Note: If initial velocities are too large or if initial separations between particles are too small, system may disintegrate owing to enormous forces. Analyse the shape of the Lennard-Jones potential to understand the directions and relative magnitudes of forces at different separations. Create a system of two particles to validate your setup. Once your code is functioning satisfactorily, run simulations with more particles. For your final results, run simulation for at least 100,000 iterations with at least 100 particles in the chain, and generate histograms of velocity, potential energy and kinetic energy of the entire system at the end of the simulation as before. a) Do the velocity, potential and kinetic energy histograms have the shapes expected from microcanonical ensemble? Why? b) What are the most probable potential energy and kinetic energy values? c) Do the initial positions and velocities affect the shapes of the histogram? d) Does the mass of the particles affect the shapes of the histograms? e) Does the potential well depth ($\varepsilon$) affect the shape of the histograms? --- $\bf{Exercise \ 3: Analysis}$ Repeat Exercise 2 with a different potential function (e.g. harmonic, double well) and compare the velocity and energy histograms with those of Exercise 2. a) Is there a common pattern in the histograms obtained in Exercises 2 and 3? b) Does the potential energy function affect the energy and velocity distributions of a large ensemble? c) How do the histograms compare with theoretical statistical mechanics predictions of the microcanonical ensemble? d) How would the histograms change if the simulations were performed: (i) in 2D or 3D? (ii) with an even larger number of particles?

Download Options

Share a Variation

Did you have to edit this material to fit your needs? Share your changes by Creating a Variation

Credits and Licensing

Shafat Mubin, "Microcanonical Ensemble - Generating Velocity and Energy Distributions Through Newtonian Dynamics," Published in the PICUP Collection, July 2017, https://doi.org/10.1119/PICUP.Exercise.microcanonical.

DOI: 10.1119/PICUP.Exercise.microcanonical

The instructor materials are ©2017 Shafat Mubin.

The exercises are released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license