7.50 optimization_variable
- type: setup command.
- function: defines a parameter of an element to be used in optimization.
- sequence: must follow optimization_setup and precede beam definition (bunched_beam or
sdds_beam).
- N.B.: It is not possible to optimize an element if the element name starts with one of the
following characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ., +, or -. The reason is that elegant will
attempt to make an SDDS parameter name containing the element name, and these characters
are disallowed at the beginning of such a name.
- Command syntax, including use of equations and subcommands, is discussed in 7.2.
&optimization_variable
STRING name = NULL;
STRING item = NULL;
double lower_limit = 0;
double upper_limit = 0;
long differential_limits = 0;
double step_size = 1;
double fractional_step_size = -1;
long disable = 0;
long force_inside = 0;
long no_element = 0;
double initial_value = 0;
&end
- name — The name of the element.
- item — The parameter of the element to be varied.
- lower_limit, upper_limit — The lower and upper limits allowed for the parameter. If these
are equal, the range of the parameter is unlimited.
- differential_limits — If nonzero, then the lower and upper limits are being given relative
to the initial value, rather than in absolute terms.
- step_size, fractional_step_size — Specifies the initial step size (“simplex”
optimization ) or the grid size in this dimension (“grid” or “sample” optimization). If
fractional_step_size is positive, it is used in place of step_size; in that case, the step
size is determined by using the indicated fraction of the difference between upper_limit and
lower_limit.
- disable — If nonzero, the variable is ignored.
- force_inside — If nonzero, the initial value is forced inside the allowed range defined by
the lower_limit and upper_limit parameters.
- no_element, initial_value — Allows defining a variable that is not connected to a beamline
element, and giving the initial value for the variable. The variable can them be used in other
optimization-related commands, e.g., optimization_covariable.