Separation - University of South Alabama

advertisement
MA354 Worksheet: Monte Carlo Methods
Finding an Ideal Arrangement of Points
Introduction
Monte Carlo algorithms can be used to solve problems that are analytically intractable, or
at least very difficult to solve. For example, one problem that is very difficult to solve is
the “packing problem” – how should objects be arranged in a crate to maximize the
number that will fit?
The most efficient way of packing circles in a space greater than 1D is hexagonal
packing. This was proved for 2-dimensions by Carl Friedrich Gauss.
A related problem is finding the most regular arrangement of objects, in which objects
are positioned so that they maximize their distance from all other objects, given the
constraints of the container. Solutions usually lead to regular, hexagonal arrangements of
the objects.
Monte Carlo Model for Regular Point Arrangement
In this model, we will begin with a random arrangement of 16 points in a square. The
points are allowed to move in tiny incremental steps that increase their distance from
other points.
In a single Monte Carlo step, each point is considered in turn:



choose a point randomly
compute the separation S between the ith point and its closest neighbor
a random direction is chosen and the ith point moves in that direction only if this
move increases S
The algorithm loops over many MC steps. The algorithm ends after an arbitrary number
of MC steps and the final position of points is the simulation result.
Questions for Consideration




Does the algorithm result in an arrangement of regularly separated points?
Does the algorithm outcome depend on the initial position of points?
If you begin with the same set of initial point positions, how do multiple solutions
vary?
How can the algorithm be modified to model different cases?
There are many possible variations of this basic model (updating the position of points so
that, on average, the minimum distances between points increases). In each Monte Carlo
step, each point may be considered in a fixed order, randomly or simultaneously.
(Simultaneous updating is not always possible and can be difficult to implement. Random
updating is typically better than systematic updating.)
1. Investigate the Mathematica script.
Begin with the Mathematica script that you can download from our course webpage
MA354_05pt0_SeparatePoints.nb. Begin with NumPoints = 16 and investigate
what happens to the points as you run the “Do” loop several times. Make sure you
understand what each component of the script is for.
2. Investigate the role of noise.
Noise (stochasticity) is introduced in two different ways in the Mathematica script.
First, the initial conditions are random. Second, the directions the points move are
chosen randomly. We will try and gauge the effect of both kinds of noise together,
and then independently.
a. Set NumPoints = 2 and investigate what generally happens when you run
the code for different initial conditions many times.
b. Fix the initial conditions to a single pattern called FixedInitialConditions.
What happens when you run the program many times? Any differences in
the outcome are due to differences that occur from picking point directions
randomly.
c. Repeat (b) many times for different FixedInitialConditions to get an idea
of the role the initial conditions have on the variability of the outcome.
3. Modify the code.
a. So that points decrease their separation instead of increasing separation.
b. As in (a) but impose a minimum separation distance (hard body
exclusion.)
c. Modify the code in your own way. (Worth 2 points: send me your code, a
description and a graph.)
Download