EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

Constraints

CONSTRAINT: Simple Constraint

Simple constraints are imposed by the CONSTRAINT command. The CONSTRAINT command has three attributes: The optic functions can be constraint in four different ways: In case one element is affected my more than one constraint command the last CONSTRAINT will be chosen. For example, one can specify the maximum acceptable beta function over a range of the sequence and specify the target beta function for one element that lies inside this range. In this case one must first specify the constraint that affects the whole range and then the constraint for the single element. This way the constraint of the target value overrides the previous constraint on the upper limit for the selected element. For example, the following constraint statements limit the maximum horizontal beta function between 'marker1' and 'marker2' to 200 meter and require a horizontal beta function of 180 meter at element 'name1':
CONSTRAINT,SEQUENCE=sequence-name,RANGE='marker1'/'marker2',BETX<200.0;
CONSTRAINT,SEQUENCE=sequence-name,RANGE='name1'/'marker2',BETX=100.0;
When the two constraint statements are interchanged the horizontal beta function at element 'name1' will only be limited to less than 200 meter and NOT constrained to 100 meter!

The CONSTRAINTS can either be specified with explicit values for the constraints of the optic functions or via a pre-calculated SAVEBETA module. The first options has the form:

CONSTRAINT,SEQUENCE=sequence-name,RANGE=position,BETX=real,ALFX=real,MUX=real,
                                                 BETY=real,ALFY=real,MUY=real,
                                                 X=real,PX=real,Y=real,PY=real,
                                                 DX=real,DY=real,DPX=real,DPY=real;

Here all linear lattice functions (BETX, BETY, ALFX, ALFY, MUX, MUY, DX, DY, DPX, DPY) or chromatic lattice functions (WX, XY, PHIX, PHIY, DMUX, DUMY, DDX, DDY, DDPX, DDPY) are constrained at the selected range to the corresponding values.

The second form of the CONSTRAINT command has the form

CONSTRAINT,SEQUENCE=sequence-name,RANGE=position,BETA0=beta0-name,MUX=real,MUY=real
Here all of (BETX, BETY, ALFX, ALFY, MUX, MUY, DX, DY, DPX, DPY) are constrained in the selected points to the corresponding values of a pre-calculated SAVEBETA module. In the above example the phases (MUX, MUY) are overridden by the numerical values specified via 'MUX=real' and 'MUY=real'. Normally ``RANGE'' refers to a single position.

User Defined Matching Constraints

In addition to the nominal TWISS variables the user can define a limited set of 'user-defined' variables in the constrint statement. This allows, for example, the matching of the nromalized dispersion or the mechanical aperture. The MATCH module allows four user defined variables called: mvar1, mvar2, mvar3 and mvar4. The variables can be defined according to the general variable declaration rules of deferred exressions. For example, in order to match the normalized dispersion at a certain location in the sequence one would first define a variable:
mvar1 := table(twiss,dx)/sqrt(table(twiss,betx));
After that the user has to select the variable for output in the TWISS statement (see TWISS module and SELECT for more details on the TWISS module and SELECTION statements):
select, flag=twiss, clear;
select, flag=twiss, column=keyword,, name, s, betx, dx, mvar1;
twiss, sequence='sequence-name',file=twiss.file;
The variable can now be referenced like any other TWISS variable in the constraint command:
constraint, sequence='sequence-name',range='location',mvar1='target-value';

Matching Weights

The matching procedures try to fulfil the constraints in a least square sense. A penalty function is constructed which is the sum of the squares of all errors, each multiplied by the specified weight. The larger the weight, the more important a constraint becomes. The weights are taken from a table of current values. These are initially set to weight default values, and may be reset at any time to different values. Values set in this way remain valid until changed again. The command
WEIGHT, BETX=real,ALFX=real,MUX=real, 
        BETY=real,ALFY=real,MUY=real, 
        X=real,PX=real,Y=real,PY=real, 
        DX=real,DPX=real,DY=real,DPY=real;
changes the weights for subsequent constraints. The weights are entered with the same name as the linear lattice functions orbit coordinate to which the weight applies. Frequently the matching weights serve to select a restricted set of functions to be matched.

Default Matching Weights

name weight name weight name weight name weight name weight name weight
BETX 1.0 ALFX 10.0 MUX 10.0 BETY 1.0 ALFY 10.0 MUY 10.0
X 10.0 PX 100.0 Y 10.0 PY 100.0 T 0.0 PT 0.0
DX 10.0 DPX 100.0 DY 10.0 DPY 100.0 -
WX 10.0 PHIX 10.0 DMUX 100.0 WY 10.0 PHIY 10.0 DMUY 100.0
DDX 10.0 DDPX 100.0 DDY 10.0 DDPY 100.0 -
MVAR1 10.0 MVAR2 10.0 MVAR3 10.0 MVAR4 10.0 -

GLOBAL: Global Matching Constraints

In addition to conventional matching constraints that specify the optics functions at a certain position in the sequence the user can also constrain global optics parameters such as, for example, the overall machine tune and the machine chromaticity. Such global optics parameters can be constraint via the GLOBAL command, having the following syntax:
GLOBAL,SEQUENCE=sequence-name,Q1=real,Q2=real,dQ1=real,dQ2=real,&
                              ddQ1=real,ddQ2=real;
Global matching weights can be (re)set by the new GWEIGHT command, having attributes identical to those of GLOBAL. All the attributes are optional and have the following meaning:
Q1, Q2, dQ1, dQ2
enable a correction of tunes and chromaticities in presence of magnetic imperfections or misalignments,
ddQ1, ddQ2
enable a correction of nonlinear chromaticities
Oliver Brüning, June, 2002