Physics 329: Monte Carlo Techniques
Please report all errors/typos. etc to
matt@infeld.ph.utexas.edu
- 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
slides (PS).
- Lecture 1 (Dec 2)
- tsrand.f:
Demonstration program showing use of srand() to set
seed for uniform random number generator rand().
Plot
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
purposes.
- nurand.f: Fortran
routine for generating non-uniform deviates given user-supplied
probablility-distribution function (PDF). Sample PDFs,
pdfs.f
for generating uniform and gaussian-distributed deviates.
tnurand.f:
Driver program for nurand.f.
Plot
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.
Doit:
Shell script which performs runs then
invokes sm with command file
sm_nurand
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.
- Plot
of final state in pure DLA simulation with 10 000 particles.
Supermongo
input file
which produced the plot.
Detail of above simulation.
Same
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
case.
Bias = 0.1
and
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
specimen
from the Laboratory of Computer Science at MIT.
- An "embedded"
specimen
from
Eric Weeks'
(UT grad student) collection of
algorithmically-generated pictures.