Be the first to rate this file! 54 Downloads (last 30 days) File Size: 2.8 KB File ID: #33109
image thumbnail

Simulated Annealing Optimization

by Héctor Corte

 

03 Oct 2011

This program performs simulated annealing otimization on functions of R^n in R.

| Watch this File

File Information
Description

Simulated annealing is an optimization algorithm that skips local minimun. It uses a variation of Metropolis algorithm to perform the search of the minimun. It is recomendable to use it before another minimun search algorithm to track the global minimun instead of a local ones.

Usage: [x0,f0]sim_anl(f,x0,l,u,Mmax,TolFun)

INPUTS:
 f = a function handle
 x0 = a ninitial guess for the minimun
 l = a lower bound for minimun
 u = a upper bound for minimun
 Mmax = maximun number of temperatures
 TolFun = tolerancia de la función

OUTPUTS:
 x0 = candidate to global minimun founded
 f0 = value of function on x0

Example:

The six-hump camelback function:

camel= @(x)(4-2.1*x(1).^2+x(1).^4/3).*x(1).^2+x(1).*x(2)+4*(x(2).^2-1).*x(2).^2;

has a doble minimun at f(-0.0898,0.7126) = f(0.0898,-0.7126) = -1.0316

this code works with it as follows:

[x0,f0]=sim_anl(camel,[0,0],[-10,-10],[10,10],400)

and we get:
x0=[-0.0897 0.7126]

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
General simulated annealing algorithm

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
13 Jan 2012 Constantino Hevia

Thank you Hector for your submission.

Is there any difference between your algorithm and Joachim Vandekerckhove's besides the bounds in the variables?

15 Jan 2012 Héctor Corte

I've been checking it out again, and the answer is yes, they are basically the same algorithm. The algorithm is in my third reference: [3] Won Y. Yang, Wenwu Cao, Tae-Sang Chung, John Morris, "Applied Numerical Methods Using MATLAB", John Whiley & Sons, 2005.
One difference between my script and Vandekerckhove's one is that mine always test 500 points for each temperature while his can change temperature if a maximun number of succes points if found. I have a version of mine with that feature but I have the code inside a training algorithm for neural networks.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
finance Héctor Corte 03 Oct 2011 11:40:14
optimization Héctor Corte 03 Oct 2011 11:40:14
simulation Héctor Corte 03 Oct 2011 11:40:14
statistics Héctor Corte 03 Oct 2011 11:40:14
modeling Héctor Corte 03 Oct 2011 11:40:14
interpolation Héctor Corte 03 Oct 2011 11:40:14
physics Héctor Corte 03 Oct 2011 11:40:14
annealing Héctor Corte 03 Oct 2011 11:40:14
metropolis Héctor Corte 03 Oct 2011 11:40:14
minimun Héctor Corte 03 Oct 2011 11:40:14
local Héctor Corte 03 Oct 2011 11:40:14
global Héctor Corte 03 Oct 2011 11:40:14

Contact us at files@mathworks.com