Preliminary Results for Molecular Dynamics Simulations

Sushant Mahat and Mohammed Abdelaziz

We created two functions to simulate the movement of dilute gas molecules in a container.

The first function initiates a grid of equally spaced points on which to initially place each particle. The function gives them random velocities and perturbs their initial position slightly from the equally spaced grid points.

The second function is a routine that updates the position of each particle at each time step. It determines the next position of each particle by determining the force acting on it due to all other particles in the box, based on the Lennard-Jones potential. The Lennard-Jones potential leads to a force that is large and repulsive at short distances, and attractive at larger distances. The repulsive force has been problematic, because two particles that encounter each other in the box get repelled at very large speeds, producing isolated points like those seen in our results below. If we can solve this issue, the results should be much more coherent.

Additionally, the simulation uses periodic boundary conditions, which we successfully implemented. A particle that “exits” one side of the box must return through the other side at the same velocity. The force calculations reflected this; two distances could be used to calculate the force: one that is between two points within the box, and another that takes into account the periodic boundary conditions. The shorter distance of the two was used to calculate each force.

We ran a calculation of 25 particles in a 10×10 box and obtained these results:




Once again, fixing the exponentially increasing forces is our top priority at this point; once we do so, we will be able to accurately calculate speed and velocity distributions of the particles in the box.

The two functions are attached as .pdf files.

Function 1: TheInitiator

Function 2: TheUpdater

A script was used to initialize variables, run the two functions, and plot the results.

EDIT (4/16/15)
The original *.m files have been uploaded and can be found here.


1 thought on “Preliminary Results for Molecular Dynamics Simulations

  1. Avatar photoJenny Magnes

    What is the significance of the dotted lines, solid lines and dots? A legend would be helpful. Good job on commenting on your code. What is your goal with this simulation? What physical principle does it demonstrate?

Comments are closed.