- type: setup command.
- function: define a constraint for optimization.
- sequence: must follow optimization_setup and precede beam definition (bunched_beam or
- N.B.: This command is disparaged. It is far better to put constraints into the optimization
equation (via the equation parameter of optimization_setup or via optimization_term).
The reason is that the hard constraints imposed by optimization_constraint may make it
more difficult for the optimizer to converge. See the discussion of the selt and segt macros
in the manual entry to optimization_setup.
- Command syntax, including use of equations and subcommands, is discussed in 7.2.
STRING quantity = NULL;
double lower = 0;
double upper = 0;
- quantity — The quantity to be constrained, given as the name of a quantity from among
the optimization variables, optimization covariables, and the “final” parameters (see the
entry for run_setup for the last of these). The optimization (co)variables are referred to as
<element-name>.<parameter-name>, in all capital letters. Other quantities, such as Twiss
parameters or anything else but what is listed just above, are not recognized. Expressions
involving multiple quantities are not supported.
- lower, upper — The lower and upper limits allowed for the expression.