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 100 meter at element 'name1':
CONSTRAINT,SEQUENCE=sequence-name,RANGE='marker1'/'marker2',BETX<200.0; CONSTRAINT,SEQUENCE=sequence-name,RANGE='name1',BETX=100.0;When the two constraint statements are interchanged, and supposing that name1 is an element in the range marker1/marker2, 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.
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';
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.
| 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 | 10.0 | PT | 100.0 |
| DX | 10.0 | DPX | 100.0 | DY | 10.0 | DPY | 100.0 | - | |||
| WX | 1.0 | PHIX | 1.0 | DMUX | 1.0 | WY | 1.0 | PHIY | 1.0 | DMUY | 1.0 |
| DDX | 1.0 | DDPX | 1.0 | DDY | 1.0 | DDPY | 1.0 | - | |||
| MVAR1 | 10.0 | MVAR2 | 10.0 | MVAR3 | 10.0 | MVAR4 | 10.0 | - | |||
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: