Structure of the Plot Functions

optimvalues —
Structure containing information about the current state of the solver.
The structure contains the following fields:

x — Current point

fval — Objective function
value at x

bestx — Best point found
so far

bestfval — Objective function
value at best point

temperature — Current temperature

iteration — Current iteration

funccount — Number of function
evaluations

t0 — Start time for algorithm

k — Annealing parameter

flag — Current state in
which the plot function is called. The possible values for flag are

'init' — Initialization
state

'iter' — Iteration state

'done' — Final state

The output argument stop provides a way to
stop the algorithm at the current iteration. stop can
have the following values:

false — The algorithm continues
to the next iteration.

true — The algorithm terminates
at the current iteration.

Temperature Options

Temperature options specify how the temperature will be lowered
at each iteration over the course of the algorithm.

InitialTemperature — Initial
temperature at the start of the algorithm. The default is 100.
The initial temperature can be a vector with the same length as x,
the vector of unknowns. simulannealbnd expands
a scalar initial temperature into a vector.

TemperatureFcn — Function
used to update the temperature schedule. Let k denote
the annealing parameter. (The annealing parameter is the same as the
iteration number until reannealing.) The options are:

@temperatureexp — The temperature
is equal to InitialTemperature * 0.95^k.
This is the default.

@temperaturefast — The temperature
is equal to InitialTemperature / k.

@temperatureboltz — The
temperature is equal to InitialTemperature / ln(k).

where optimValues is a structure described
in Structure of the Plot Functions. options is
either the structure created with saoptimset,
or the structure of default options, if you did not create an options
structure. Both the annealing parameter optimValues.k and
the temperature optimValues.temperature are vectors
with length equal to the number of elements of the current point x.
For example, the function temperaturefast is:

temperature = options.InitialTemperature./optimValues.k;

Algorithm Settings

Algorithm settings define algorithmic specific parameters used
in generating new points at each iteration.

For example, the current position is optimValues.x,
and the current objective function value is problem.objective(optimValues.x).

ReannealInterval — Number
of points accepted before reannealing. The default value is 100.

AcceptanceFcn — Function
used to determine whether a new point is accepted or not. The choices
are:

@acceptancesa — Simulated
annealing acceptance function, the default. If the new objective function
value is less than the old, the new point is always accepted. Otherwise,
the new point is accepted at random with a probability depending on
the difference in objective function values and on the current temperature.
The acceptance probability is

11+exp⁡(Δmax⁡(T)),

where Δ = new objective – old objective, and T is
the current temperature. Since both Δ and T are
positive, the probability of acceptance is between 0 and 1/2. Smaller
temperature leads to smaller acceptance probability. Also, larger
Δ leads to smaller acceptance probability.

@myfun —
A custom acceptance function, myfun. The syntax
is:

acceptpoint = myfun(optimValues,newx,newfval);

where optimValues is
a structure described in Structure of the Output Function, newx is
the point being evaluated for acceptance, and newfval is
the objective function at newx. acceptpoint is
a Boolean, with value true to accept newx,
and false to reject newx.

Hybrid Function Options

A hybrid function is another minimization function that runs
during or at the end of iterations of the solver. HybridInterval specifies
the interval (if not never or end)
at which the hybrid function is called. You can specify a hybrid function
using the HybridFcn option. The choices are:

Stopping Criteria Options

Stopping criteria determine what causes the algorithm to terminate.
You can specify the following options:

TolFun — The algorithm runs
until the average change in value of the objective function in StallIterLim iterations
is less than TolFun. The default value is 1e-6.

MaxIter — The algorithm
stops if the number of iterations exceeds this maximum number of iterations.
You can specify the maximum number of iterations as a positive integer
or Inf. Inf is the default.

MaxFunEval specifies the maximum
number of evaluations of the objective function. The algorithm stops
if the number of function evaluations exceeds the maximum number of
function evaluations. The allowed maximum is 3000*numberofvariables.

TimeLimit specifies the maximum
time in seconds the algorithm runs before stopping.

ObjectiveLimit — The algorithm
stops if the best objective function value is less than or equal to
the value of ObjectiveLimit.

Output Function Options

Output functions are functions that the algorithm calls at each
iteration. The default value is to have no output function, [].
You must first create an output function using the syntax described
in Structure of the Output Function.

Using the Optimization app:

Specify Output function as @myfun,
where myfun is the name of your function.