Member-only story

Monte Carlo

Patrick Chirdon
4 min readOct 15, 2020

--

Put N particles in a box in a random way in which each particle has a minimum distance with other particles so they do not have collisions with each other.

Calculate forces and pressure.

Monte Carlo methods were central to the simulations required for the Manhattan Project, though severely limited by the computational tools at the time. In the 1950s they were used at Los Alamos for early work relating to the development of the hydrogen bomb, and became popularized in the fields of physics, physical chemistry, and operations research. The Rand Corporation and the U.S. Air Force were two of the major organizations responsible for funding and disseminating information on Monte Carlo methods during this time, and they began to find a wide application in many different fields.

import numpy as np

from matplotlib import pyplot as plt

def initial(box_length, minimum_distance):

#constants
lengthX = box_length
lengthY = box_length
lengthZ = box_length
#minimum_distance = 0.8
min_dist = box_length
density=.5

particle_count = int(density * lengthX * lengthY * lengthZ)

--

--

No responses yet