Beruflich Dokumente
Kultur Dokumente
A Basic Introduction
Lecture 10
Outline
Heuristics Background in Statistical Mechanics
Atom Configuration Problem Metropolis Algorithm
Learning Objectives
Review background in Statistical Mechanics: configuration, ensemble, entropy, heat capacity Understand the basic assumptions and steps in Simulated Annealing (SA) Be able to transform design problems into a combinatorial optimization problem suitable to SA Understand strengths and weaknesses of SA
Heuristics
What is a Heuristic?
A Heuristic is simply a rule of thumb that hopefully will find a good answer. Why use a Heuristic?
Heuristics are typically used to solve complex (large, nonlinear, nonconvex (i.e. contain local minima)) multivariate combinatorial optimization problems that are difficult to solve to optimality.
Unlike gradient-based methods in a convex design space, heuristics are NOT guaranteed to find the true global optimal solution in a single objective problem, but should find many good solutions (the mathematician's answer vs. the engineers answer) Heuristics are good at dealing with local optima without getting stuck in them while searching for the global optimum.
5
Types of Heuristics
Heuristics Often Incorporate Randomization Two Special Cases of Heuristics
Construction Methods
Must first find a feasible solution and then improve it.
Improvement Methods
Start with a feasible solution and just try to improve it.
-1
-2
Start Point
-3 -3 -2 -1 0 x 1 2 3
peaks convergence
Initially ~ nearly random search Later ~ gradient search
2 current configuration new best configuration 0 SA convergence history
-2
System Energy
-4
-6
-8
-10
50
100
200
250
300
Statistical Mechanics
10
The Analogy
Statistical Mechanics: The behavior of systems with many degrees of freedom in thermal equilibrium at a finite temperature.
Combinatorial Optimization: Finding the minimum of a given function depending on many variables. Analogy: If a liquid material cools and anneals too quickly, then the material will solidify into a sub-optimal configuration. If the liquid material cools slowly, the crystals within the material will solidify optimally into a state of minimum energy (i.e. ground state).
This ground state corresponds to the minimum of the cost function in an optimization problem.
11
Perturbed Configuration
Atom Configuration - Sample Problem
3
2 1 0 -1 -1
4
2 1
3
2 1 0 -1 -1
4
3 1 2
Configurations
Mathematically describe a configuration
Specify coordinates of each atom
ri with i=1,..,4 r1 1 , r2 1 3 , r3 2 4 , r4 4 5 3
13
Energy of a state
Each state (configuration) has an energy level associated with it
H q, q, t
i
qi pi
L q, q, t
Hamiltonian
T V
kinetic potential Energy
Etot
Ei
mgyi
potential energy j i
xi
xj
yi
yj
1 2 2
kinetic energy
E R
i 1
Ei ri
15
E1 1 10 1 E2 1 10 2 E3 1 10 4 E4 1 10 3
5 5 18 20
18 5 5 5
20 5 2 2
6 5 4 3 2 1 0 -1 -1
3 4 2 1
0 1 2 3 4 5 6 7
Boltzmann Probability
NR P! P N !
Number of configurations
P=# of slots=25 N=# of atoms =4 NR=6,375,600
What is the likelihood that a particular configuration will exist in a large ensemble of configurations?
P {r}
exp
E ({r}) k BT
17
T=10
T=10 - E avg=58.9245 14000
T=1
T=1 - E avg=38.1017 14000 12000
12000
12000
10000
10000
10000
Occurences
Occurences
8000
Occurences
8000
8000
6000
6000
6000
4000
4000
4000
2000
2000
2000
20
40
60
80
100 Energy
120
140
160
180
200
20
40
60
80
100 Energy
120
140
160
180
200
20
40
60
80
100 Energy
120
140
160
180
200
T high
T low
Boltzmann Distribution collapses to the lowest energy state(s) in the limit of low temperature Basis of search by Simulated Annealing
18
Partition Function Z
Ensemble of configurations can be described statistically Partition function, Z, generates the ensemble average
Ei Tr exp kBT
NR i
Ei exp kBT 1
Free Energy
NR
Eavg
E (T )
i 1
Ei T
F T
kBT ln Z
NR
E(T ) TS
Ei T k BT Z Ei T
exp Eavg E (T )
i 1
d ln Z d 1 k BT
E (T ) E T
i 1
k BT 2
E (T ) E T k BT 2
Entropy
T1
S (T )
S (T1 )
T
C (T ) dT T
dS (T ) dT
C (T ) T
# configs decreases
# of configurations, NT
10
10
10 Temperature
10
Ht. Capacity
10
0
10 Temperature
10
150 100
150
Free Energy, F
50 0 -50 -100
10
10 Temperature
10
10
10 Temperature
10
Uniqueness?
E*=60
E*=14.26
3 4
2 1
1 0 -1 -1
Simulated Annealing
24
Dilemma
Cannot compute energy of all configurations !
Design space often too large Computation time for a single function evaluation can be large
Use Metropolis Algorithm, at successively lower temperatures to find low energy states
Metropolis: Simulate behavior of a set of atoms in thermal equilibrium (1953) Probability of a configuration existing at T Boltzmann Probability P(r,T)=exp(-E(r)/T)
25
The SA Algorithm
Terminology:
X (or R or ) = Design Vector (i.e. Design, Architecture, Configuration) E = System Energy (i.e. Objective Function Value) T = System Temperature = Difference in System Energy Between Two Design Vectors
SA Block Diagram
Start To Define initial configuration Ro Evaluate energy E(Ro) Compute energy difference E = E(Ri+1)-E(Ri)
End Tmin
T<Tmin?
n
Reduce temperature Ti+1 =Tj - T
Reached equilbrium at Tj ?
E < 0?
y n
exp - E > v? T
Metropolis step
SA Block Diagram
Image by MIT OpenCourseWare.
27
evaluation function
file_eval.m
perturbation function
file_perturb.m
28
Exponential Cooling
Typically (T1/To)~0.7-0.9
Simulated Annealing Evolution 10 9 8 7 6 5 4 3 2 1 0 C-specific heat S-entropy T/10-temperature
Tk
T1 To
Tk
Can also do linear or step-wise cooling But exponential cooling often works best.
0 5 10 15 20 25 Temperature Step 30 35 40 45
29
2.
3.
4.
An annealing schedule of the temperatures and/or the length of times for which the system is to be evolved.
30
Sample Problems
31
l R
i 1 j 1
x j Ri
x j Ri
x j R1
j 1
x j RN
visit N cities
32
-0.8
-0.4
-0.2
0.2
0.4
0.6
0.8
-0.8
-0.4
0.4
0.6
0.8
Result with SA
33
Structural Optimization
Define:
Design Domain Boundary Conditions Loads Mass constraint
i 1,..., N f T u( i ) K 1f Vi
i
Subdivide domain
N x M design cells Cell density =1 or =0
s.t.
i 1
mmax
Applied Load
F=-2000
Final Toplogy
island
8 7 6 5 4 3 2 1 0 -1
10
Compliance C=236.68
Not optimal often need post-processing
Compliance C=593.0
36
12
T=19
25 20 15
4 10 2 5 0 200
T=6.7 T=10 T=11 T=13 T=6 T=21 T=9.2 T=8.2 T=16 T=29 T=68 T=93 T=24 T=1.8e+002 T=55 T=40 T=3e+002 T=17 T=1.9e+002 T=32 T=2.2e+002 T=2.7e+002 T=14 T=1.3e+002 T=1.6e+002 T=2.4e+002 T=61 T=45 T=1e+002 T=49 T=84 T=26 T=1.1e+002 T=75 T=1.4e+002
10
15 20 25 Temperature Step
30
35
40
400
600
800
1000
1600
1800
2000
2200
Boltzmann Distributions
37
Premature termination
SA convergence history 2200 2000 1800 1600
System Energy
500
1000
2500
3000
Indicator: Best Configuration found only shortly before Simulated Annealing terminated.
38
100
50
Initial Configuration
-100
-50
-200 -200
-100
100
200
-100 -100
-50
50
100
39
Optimized Solution
Cable Length = 1349.609 200 100 UV Density = 0.33333 100 50
-100
-50
-200 -200
-100
100
200
-100 -100
-50
50
100
40
Summary
41
Summary: Steps of SA
The Simulated Annealing Algorithm
1) Choose a random Xi, select the initial system temperature, and outline the cooling (ie. annealing) schedule 2) Evaluate E(Xi) using a simulation model 3) Perturb Xi to obtain a neighboring Design Vector (Xi+1) 4) Evaluate E(Xi+1) using a simulation model 5) If E(Xi+1)< E(Xi), Xi+1 is the new current solution 6) If E(Xi+1)> E(Xi), then accept Xi+1 as the new current solution with a probability e(- /T) where = E(Xi+1) - E(Xi). 7) Reduce the system temperature according to the cooling schedule. 8) Terminate the algorithm.
42
Recent Research in SA
Alternative Cooling Schedules and Termination criteria Adaptive Simulated Annealing (ASA) determines its own cooling schedule Hybridization with other Heuristic Search Methods (GA, Tabu Search ) Multiobjective Optimization with SA
43
References
Cerny, V., "Thermodynamical Approach to the Traveling Salesman Problem: An Efficient Simulation Algorithm", J. Opt. Theory Appl., 45, 1, 41-51, 1985 . de Weck O. System Optimization with Simulated Annealing (SA), Memorandum SA.pdf Cohanim B. E., Hewitt J. N., and de Weck O.L., The Design of Radio Telescope Array Configurations using Multiobjective Optimization: Imaging Performance versus Cable Length, The Astrophysical Journal, Supplement Series, 154, 705-719, October 2004 Jilla, C.D., and Miller, D.W., Assessing the Performance of a Heuristic Simulated Annealing Algorithm for the Design of Distributed Satellite Systems, Acta Astronautica, Vol. 48, No. 5-12, 2001, pp. 529-543. Kirkpatrick, S., Gelatt, C.D., and Vecchi, M.P., Optimization by Simulated Annealing, Science, Volume 220, Number 4598, 13 May 1983, pp. 671-680. Metropolis,N., A. Rosenbluth, M. Rosenbluth, A. Teller, E. Teller, "Equation of State Calculations by Fast Computing Machines", J. Chem. Phys.,21, 6, 1087-1092, 1953.
44
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.