PHYCS 6730 Lab Exercise: Nonlinear Optimization: Simulated Annealing
These exercises experiment with simulated annealing using the
Metropolis et al algorithm. The files you need are in
~p6730/exercises/nonlinear_optimization.
Exercise 1 Sample cost function
We will use the sample cost function
f(x) = (4 - x2)2 + x;
Plot this function with your favorite plotting utility. Where are the
minima? Which is the global minimum? What is the barrier height
between them?
Please put your answers in the answer file for this exercise.
Exercise 2. Metropolis et al algorithm
The code ~p6730/exercises/nonlinear_optimization/metropolis
does a Metropolis et al search for the minimum, based on these
parameters:
- Random number seed. Needed to initialize the pseudorandom number sequence.
- Starting coordinate x.
- Number of trial steps to take.
- Temperature. For simulated annealing, discussed later.
- Step scale in x. Controls the step size.
Run the program metropolis with the values in in2,
arranged in the order of the prompts. The x values generated
on standard output should give a histogram that resembles the
distribution exp(-f(x)/5), suitably normalized. Check this.
See
hist documentation for a histogramming tool.
In your answer file compare the observed ratio of counts in the
histogram at x = 0 and x = 2 with what you should get from the
expected probability distribution. A rough estimate is sufficient.
Exercise 3. Simulated annealing
Let's start from the false minimum around x = 2 and see if we
end up at the true minimum as we cool the system down slowly. A
example of the cooling process is given in in3, but the
temperature is not cool enough and the number of trials is too small.
Experiment with the cooling process to see if the system ends up in
the true global minimum after cooling to a temperature of 0.1. You
should adjust the step scale so the acceptance rate is kept around
50%.
In your answer file give your chosen cooling schedule and describe the
result.