Physics 329: Monte Carlo Techniques
Please report all errors/typos. etc to
- General Reference
- Source code covered in class can be found on
the phy329 account on einstein in
~phy329/rand/ex1 and ~phy329/rand/ex2
- Handout (PS) and
- Lecture 1 (Dec 2)
Demonstration program showing use of srand() to set
seed for uniform random number generator rand().
of first 50 random numbers generated using tsrand
with seeds 0, 1, 2 and 3.
Note that there may be excess correlation between sequences generated
with seeds separated by some constant amount, so seeds themselves
should generally be chosen randomly. As pointed out in Numerical
Recipes, it is healthy to always view system-supplied random number
generators with a certain amount of suspicion, particularly
if you are going to generate a lot of random numbers.
However, I feel that the SGI supplied routine will suffice for our
- nurand.f: Fortran
routine for generating non-uniform deviates given user-supplied
probablility-distribution function (PDF). Sample PDFs,
for generating uniform and gaussian-distributed deviates.
Driver program for nurand.f.
showing normalized counts (1000 bins) for gaussian-distributed
deviates---blue: n = 100 000 random numbers, red: n = 10 000 000
random numbers, dashed black line: peak of analytic PDF.
Shell script which performs runs then
invokes sm with command file
to create plot.
- Lecture 2 (Dec 4)
- dla.f: Program
which performs Diffusion Limited Aggregation (DLA) simulation
in 2D with variable non-stochastic central force (as discussed
in class). This central "bias" speeds cluster formation but
alters the grown cluster's "fractal properties" (for example,
the cluster's radius grows more slowly with particle number
for any non-zero bias than for zero bias). Sample
usage on SGIs.
of final state in pure DLA simulation with 10 000 particles.
which produced the plot.
Detail of above simulation.
after an additional 50 000 particles have
been added. Here, the effect of launching all particles
from a fixed, finite radius is apparent.
Bias = 0.0625
simulation after 10 000 steps. Note how structure is
already slightly less "distributed" than the pure DLA
Bias = 0.1
Bias = 0.9
simulations, also after 10 000 steps. It is left as an
exercise to the reader to investigate and/or predict run
time as a function of bias.
- A nice DLA
from the Laboratory of Computer Science at MIT.
- An "embedded"
(UT grad student) collection of