FUNCTION REFERENCE

simulannealbnd

Find a global minimum by simulated annealing with bounds.

Find a global minimum by simulated annealing with bounds.

Syntax

[x, fval, exitflag, output] = simulannealbnd(fun, x0, lb, ub, options)

Arguments after x0 can be omitted or given as []. x keeps x0's shape. A

stochastic method: rng(seed) before the call makes a run repeatable (it draws

from the rand/randn stream).

Algorithm: simulated annealing (Kirkpatrick, Gelatt & Vecchi 1983). A trial

point is a step of length T in a uniformly random direction; a coordinate that

leaves the bounds is redrawn uniformly between x and that bound. Boltzmann

acceptance: worse points are accepted with probability exp(-delta/T). Cooling

T = T0*0.95^k with InitialTemperature T0 (100, scalar or per variable).

Every ReannealInterval (100) accepted points reannealing (after Ingber 1989)

resets the annealing parameters to k_i = log((T0_i/T_i)*max(s)/s_i), with s

the finite-difference sensitivities at x, which raises the temperatures. The best point

seen is returned. Stops with exitflag 1 when the average change of f over

MaxStallIterations (500*n) iterations is below FunctionTolerance (1e-6);

exitflag 0 after MaxIterations (Inf) or MaxFunctionEvaluations (3000*n).

output has iterations, funccount, message and temperature. Differences from

MATLAB: iterates and results differ for the same seed (different internals);

no custom annealing or acceptance functions.

Example

rng(1); [x,f]=simulannealbnd(@(x)(x-2)^2,0,-5,5)

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.