equation — An rpn equation for the optimization function, expressed in terms of any
parameters of any optimization variables, the “final” parameters of the beam (as recorded
in the final output file available in the run_setup namelist), and selected quantities from
Twiss parameter, tune shift with amplitude, closed orbit, beam moments, driving terms, and
other computations. The optimization variables or covariables may appear in the equation in
the form <element-name>.<parameter-name>, all in capital letters. In addition, initial values
of variables and covariables are available in the form <element-name>.<parameter-name>0.
Data from MARK elements
with FITPOINT=1 and from beam position monitors with CO_FITPOINT=1 may be used via
symbols of the form elementName#occurenceNum.parameterName. See the documentation
for the MARK, MONI, HMON, and VMON elements for detailed discussion and listing.
If response matrix calculation is requested, response matrix values are available in variables
with names PlaneR_bpmName#occurence_corrName#occurence.corrParam, where Plane is H
(horizontal) or V (vertical) and corrParam is the parameter of the corrector used for changing
the orbit (e.g., HKICK or VKICK for a KICKER element).
If cross-plane response matrix calculation is requested, response matrix values are available
in variables with
names BpmPlaneCorrPlaneR_bpmName#occurence_corrName#occurence.corrParam, where
BpmPlane and CorrPlane are H (horizontal) or V (vertical) and corrParam is the parameter
of the corrector used for changing the orbit (e.g., HKICK or VKICK for a KICKER element).
Many quantities are made available for optimization if twiss_output command is given with
- Final Twiss parameters, e.g., betax, alphax, etax. The names are the same as the
column names in the twiss output file.
- Linear acceptances Ax and Ay for the horizontal and vertical planes, respectively.
- Statistics of Twiss parameters in the form <statistic>.<parameter-name>, where
<statistic> is min, max, ave, p99, p98, or p96. p99 is the 99th pencentile value, a
similarly for p98 and p96.
- Tunes and chromaticities via symbols nux, dnux/dp, (and corresponding symbols for y).
- Chromatic derivatives of beta and alpha functions, via symbols dbetax/dp, dbetay/dp,
dalphax/dp, and dalphay/dp.
- First- and second-order momentum compaction factors via symbols alphac and alphac2.
- If radiation integral computation is requested, one may use ex0 and Sdelta0 for the
equilibrium emittance and momentum spread, plus J<plane> and tau<plane> for the
damping partition and damping time, where <plane> is x, y, or delta. One may also
use I1 through I5 for the individual radiation integrals.
- If compute_driving_terms=1, then the quantities h11001, h00111, h20001, h00201,
h10002, h21000, h30000, h10110, h10020, h10200, h22000, h11110, h00220, h31000,
h40000, h20110, h11200, h20020, h20200, h00310, h00400, dnux/dJx, dnux/dJy, and
dnuy/dJy may be used. Table 2 explains the meaning of the terms.
- The coupling integral and emittance ratio due to x-y coupling may be accessed using
the symbols couplingIntegral and emittanceRatio. See section 220.127.116.11 of .
- If higher-order chromaticity is requested, then one may use the symbols dnux/dp2,
dnux/dp3, dnuy/dp2, dnuy/dp3, etax2 , etax3, etay2 , etay3, nuxChromLower,
nuxChromUpper, nuyChromLower, and nuyChromUpper.
- If the tune_shift_with_amplitude command was also given and one may use
the symbols dnux/dAx, dnux/dAy, dnuy/dAx, dnuy/dAy, dnux/dAx2, dnux/dAy2,
dnux/dAxAy, dnuy/dAx2, dnuy/dAy2, dnuy/dAxAy, nuxTswaLower, nuxTswaUpper,
nuyTswaLower, and nuyTswaUpper.
If the floor_coordinates command was given, one may use X, Z, and theta to refer to the final
values of the floor coordinates.
If the sasefel command was given, one may use variables of the form SASE.<property>,
where <property> is one of gainLength, saturationLength, saturationPower, or
Finally, one 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
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.
There are several rpn functions that are useful in constructing a good optimization equation. These
are “soft-edge” greater-than, less-than, and not-equal functions, which have the names segt, selt,
and sene, respectively. The usage is as follows:
- V1 V2 T segt. Returns a nonzero value if and only if value V1 is greater than V2.
The returned value is ((V 1 - V 2)∕T)2. Typically used to constraint a quantity from
above. E.g., to limit the maximum horizontal beta function to 10m with a tolerance of
T = 0.1m, one would use max.betax 10 .1 segt.
- V1 V2 T selt. Returns a nonzero value if and only if value V1 is less than value V2.
The returned value is ((V 1 - V 2)∕T)2. Typically used to constrain a value from below.
E.g., to limit a beta function to greater than 3 m with a tolerance of 0.1 m, one would
use betax 3 .1 selt.
- V1 V2 T sene. Returns a nonzero value if and only if V1 and V2 differ by more than tol.
If V 1 > V 2, returns ((V 1 - (V 2 + T))∕T)2. If V 2 > V 1, returns ((V 2 - (V 1 + T))∕T)2.