##
Electromagnetic Wave MATLAB Library

###
Monte Carlo Simulation of Pair Distribution Function for Hard Spheres

Reference: Chapter 8 of *Scattering
of Electromagnetic Waves: Numerical Simulations*

Home |Download

#### Program

mcpdf.m
generate random realizations of positions for hard spheres using the Monte
Carlo method (also known as Metropolis shuffling). The pair distribution is
computed by counting number of occurrences of pair separations.

#### Input Parameters

**ntot**: total number of
spheres
**fv**: fractional volume of
spheres
**cnst**: maximum
displacement (<1)>
**npsr**: number of passes
for each realization
**nrlz**: number of
realizations
**seed**: seed for random
numbers

####
Example

The figure below is
generated with the following parameters (The PY results is generated using pypdf.m.)

ntot=200, fv=0.3, cnst=0.35, npsr=100, nrlz=30,
seed=54321

Home | Top