176 Beam-based Correction and Optimization for Accelerators
be taken for averaging to reduce the noise level, especially if the noise is a
big issue and the measurement of the performance is fast relative to the time
needed to change the machine conditions. The performance measure is then
returned as the value of the objective function.
Inside the objective function, the code may need to monitor the machine
conditions for any anomaly that could arise. It should also be able to pause
the experiment and alert the user if an action needs to be taken by the user
before the experiment can continue. For example, in an injection efficiency
optimization experiment, the code needs to stop when the beam has reached
the maximum current, at which point the beam needs to be dumped.
Interface to optimization algorithms: The interface between an optimization algorithm and the specific application is the function call to the
optimizer. The required information is passed as arguments to the optimizer
function, which may be defined as
Function [xm,ym,dout]=optimizer(func,x0,MaxEval,OtherInput)
#Input parameters:
# func, function handle to the objective function
# x0,
the initial normalized parameter vector
# MaxEval, maximum number of evaluations
#Output parameters:
# xm, parameter vector for the optimal solution
# ym, the corresponding objective function value
where ‘OtherInput’ represents additional input arguments and ‘dout’ is a
structure that holds additional outputs that are specific to the optimizer.
The optimizer searches the n-dimensional unit cube for a solution that
gives the minimum value of the objective function, starting from the initial
solution ‘x0’. The algorithm will keep track of the number of evaluations of
the objective function and check it against the ‘MaxEval’ value frequently
(e.g., at the end of each iteration). It will exit the optimizer if the number
of evaluations exceeds ‘MaxEval’. Other termination conditions can also be
implemented.
Depending on the nature of the optimizer, additional input parameters
may be needed. Some examples include the noise sigma of the objective function, the initial step size, the initial conjugate direction set, etc.
Data management: During the course of an online optimization run,
many data points will be evaluated and at each data point, many machine
condition and performance parameters will be recorded. It is desirable to save
these data for post processing. Since online optimization often exits prematurely, before a pre-determined termination condition is met, it is essential to
store the data frequently so that no loss of data occurs.
A good place to manage the optimization data is in the objective function
as this is where data are taken. At each function evaluation, all relevant data
can be put in a structure and appended to a data file. A simple way of data
keeping is to save data to a global variable. The global variable may be a list
Précédent

- 189/253

Suivant