&optimization_setup STRING equation = NULL; STRING mode = "minimize"; STRING method = "simplex"; double tolerance = -0.01; double target = 0; long soft_failure = 1; long n_passes = 2; long n_evaluations = 500; STRING log_file = NULL; long output_sparsing_factor = 0; &end
equation
-- An rpn equation for the optimization
function, expressed in terms of any parameters of any optimization
variables and the ``final'' parameters of the beam (as recorded in the
final
output file available in the run_setup
namelist).
The optimization variables or covariables may appear in the equation
in the form <element-name>.<parameter-name>
, all in capital
letters. Data from MARK elements with FITPOINT=1 may be used via
symbols of the form
<element-name>#<occurrence-number>.<parameter-name>
, where
<parameter-name>
can be a Twiss parameter name (if the twiss
command was given), a floor coordinate name (if the floor command was
given, or a beam-size or centroid name. The parameter names are the
same as those used in the corresponding output files. Beam sizes
and centroids are from tracking the particle distribution.
If the twiss command was given, you may also refer to statistics of
Twiss parameters in the form <statistic>.<parameter-name>
,
where <statistic>
is either min
or max
. You may
also use the symbols nux
, dnux/dp
, (and corresponding
symbols for y), alphac
, and alphac2
. These are the
tune, chromaticity, and first- and second- order momentum compaction
factors. The final values of the Twiss parameters are referred to
simply as betax
, etax
, etc.
If the twiss command was given and radiation integral computation
was requested, you may use ex0
and Sdelta0
for
the equilibrium emittance and energy spread, plus J<plane>
and tau<plane>
for the damping partition and damping time,
where <plane>
is x
, y
, or delta
.
If the floor_coordinates
command was given, you may use
X
, Z
, and theta
to refer to the final values of
the floor coordinates.
If the sasefel
command was given, you may use variables of
the form SASE.<property>
, where <property>
is one
of gainLength
, saturationLength
,
saturationPower
, or lightWavelength
.
Finally, you may use any of the names from the ``final'' output file
(see run_setup
), e.g., Sx
(x beamsize) or eny
(y
normalized emittance). These refer to tracked properties of the beam.
The equation may be left blank, in which case the user must give one
or more optimization_term
commands. These use the same
symbols, of course.
mode
-- May be either ``minimize'' or ``maximize''.
method
-- May be one of ``simplex'', ``grid'', and ``sample''.
tolerance
-- The convergence criterion for the optimization, with a negative value indicating
a fractional criterion.
target
-- The value which, if reached, results in immediate termination of the optimization,
whether it has converged or not.
soft_failure
-- A flag indicating, if set, that failure of an optimization pass should not
result in termination of the optimization.
n_passes
-- The number of optimization passes made to achieve convergence (``simplex'' only).
n_evaluations
-- The number of allowed evaluations of the optimization function. If simplex
optimization is used, this is the number of allowed evaluations per pass.
log_file
-- A file to which progress reports will be written as optimization proceeds.
For SDDS data, use the final
output file from the run_setup
namelist.
output_sparsing_factor
-- If set to a value larger than 0, results in
sparsing of output to the ``final'' file (see run_setup
). This can make
a significant difference in the optimization speed.