The PTC_TWISS module of MAD-X [a] is based on the PTC code. It is a supplementary to the TWISS module. The Twiss parameters are calculated in Ripken's style (invented by G. Ripken in 1970 [31] and most accessible in Ref. [b]). These parameters were available in MAD8 using the TWISS3 command. This module is a typical example of the advantages of using PTC and its Normal Form technique (and of course the object-oriented Fortran90 coding): once the rather modest programming has been performed the Twiss calculation will always be automatically correct for all machine conditions like closed orbit, coupling or after a new element has been introduced into the code. In a traditional coding like in MAD8 this depends on reprogramming and modifying the code at various places, which is inherently error-prone.
The PTC_TWISS tracks a special representation of the beam in three degrees of
freedom. It works on the coupled lattice functions defined in
Ref.[b],
which are essentially the projections of the lattice functions for the
eigen-modes on the three planes. The PTC_TWISS lists the projections of the
ellipses of motion onto the three planes (x, px), (y,
py), (t, pt) expressed them via the
Ripken's parameters bk,j,
ak,j,
gk,j along with the
phase advances mj
in selected positions, where index k=1...3 refers
to the plane (x, y,...), and
the index j=1...3 denotes the eigen-mode.
The PTC_TWISS also calculates the
dispersion values D1,...,D4.
In the MAD-X commands and tables, these parameters are denoted as beta11,...,beta33,
alfa11,...,alfa33, gama11,...,gama33, mu1,...,mu3, disp1,...,disp4
,
respectively.
The ring parameters like gamma transition, compaction factor and phase slip factor are calculated
when closed solution is requested, or otherwise if RING_PARAMETERS is set to true.
They are available in the summary table and in the header of twiss table.
The Ripken parameterization can be transformed into the Edwards-Teng
parameterization (used in twiss proper) using the formulae of
Ref. [d].
The parameters are noted as
betx, bety, alfx, alfy
and the coupling matrix: R11, R12,
R21 and R22. In absence of coupling it holds:
betx=beta11
, bety=beta22
,
alfx=alfa11
and alfy=alfa22
.
PTC_TWISS can also compute the deltap/p-dependency of the Twiss
parameters. The column names beta11p,...,beta33p,
alfa11p...,alfa33p, gama11p,...,gama33p
denote the derivatives
of the optics parameters w.r.t. deltap/p. If one
is interested in evaluating deltap/p-dependency of the Twiss
parameters, one must ensure that the order (no) of the map is set to 2
at least. The derivatives of the dispersion w.r.t. deltap/p
have column names: disp1p,...,disp4p
. Second and third
order derivatives have respective column names:
disp1p2,...,disp4p2
for the second order, and
disp1p3,...,disp4p3
for the third order.
Any component of the transfer map at any location can be accessed (e.g. in matching) using PTC_SELECT command. If MAPTABLE parameter is set than the complete transfer map at the end of the sequence is saved in table called map_table.
For clarification: in the 4-D case, there is the
following correspondence between MAD-X and Ripken's notations:
beta11
®
bxI,
beta12
®
bxII,
beta21
®
byI,
beta22
®
byII,
while in the uncoupled 4-D case beta11
is the same as
the classical bx (betx
)
and beta22
is by
(bety
), while beta12
and beta21
are zero.
When there is coupling all betaNN
are non-zero and
beta11
, beta22
are distinctively different from
bx ,
by, respectively.
PTC_TWISS also tracks the eigenvectors and prints them to Twiss table according to the SELECT command (flag=ptc_twiss). Either all 36 components or particular components of the eigenvectors can be selected with eign or eignij, respectively (j = number of eigenvector, i = number of coordinate {x, px, y, py, t,pt}).
For ring lattices, PTC_TWISS computes momentum compaction, transition energy, as well as other one-turn characteristics such as the tunes (Q1,Q2 and if icase=6 with cavity Qs) and chromaticities (for no>=2).
PTC_CREATE_UNIVERSE;
PTC_CREATE_LAYOUT, model=integer,method=integer,
nst=integer, [exact];
...
SELECT, flag=ptc_twiss, clear;
SELECT, flag=ptc_twiss, column=name, s,
beta11,...,beta33,alfa11,..., alfa33,gama11,...,gama33,
beta11p,...,beta33p,alfa11p,...,alfa33p,gama11p,...,gama33p,
mu1,...,mu3,
disp1,...,disp4,
disp1p,...,disp4p,
disp1p2,...,disp4p2,
disp1p3,...,disp4p3,
[eign], eign11, ...,eign16,...,eign61,...,eign66;
...
PTC_TWISS;
...
PTC_END;
Option | Meaning | Default Value | Value Type | |
---|---|---|---|---|
ICASE | the user-defined dimensionality of the phase-space (4, 5 or 6). Note that the value is internally set to 56 when attempting to set icase=6 with no cavity. | 4 | integer | |
NO | the order of the map, which is often supplied as 1 but must be at least set to 2 to retrieve chromaticities for instance. For evaluating the Twiss parameters derivatives w.r.t. deltap/p, one must pass order 2 at least. | 1 | integer | |
DELTAP |
relative momentum offset for reference closed orbit. |
0.0 | double | |
CLOSED_ORBIT | the switch to turn on the closed orbit calculation (periodic solution ONLY). | .FALSE. | logical | |
DELTAP_DEPENDENCY | the switch to turn on computation of the Twiss and dispersion derivatives w.r.t. deltap/p. Derivation formula assume that icase=5, so that deltap/p is supplied as a parameter. | .FALSE. | logical | |
SLICE_MAGNETS | Turns on the evaluation of Twiss parameters at each integration step inside magnets, in addition to the end face.
The number of slices is determined by the number of steps (nst) that can be separately defined for each element,
or otherwise set by nst parameter when creating the PTC layout. Note that the orbit rms calculated in this mode counts as valid data points both the end of the previous element and the entrance of the current element. Since the first integration node is always at the entrance of the magnet (after position offset and fringe effects are calculated), which corresponds to the same s position (and usually optical functions) as the end of the previous element, the points at the interface between magnets are included twice in the rms calculation. |
.FALSE. | logical | |
CENTER_MAGNETS | the switch to turn on the evaluation of Twiss parameters at the middle of each magnet. This relies on internal slicing and 'integration nodes' as determined by the number of steps (nst) selected when creating the PTC layout. This number is assumed to be even otherwise the program issues a warning. | .FALSE. | logical | |
FILE | omitted | no output written to a file | ||
present | the name of the file for printing the PTC_TWISS output. | ptc_twiss | string | |
TABLE | omitted | no output written to a internal table | ||
present | the name of the internal PTC_TWISS table | ptc_twiss | string | |
SUMMARY_FILE | omitted | no output written to a file | ||
present | the name of the file for printing the PTC_TWISS_SUMMARY table output. | ptc_twiss_summary | string | |
SUMMARY_TABLE | omitted | no output written to a internal table | ||
present | the name of the internal PTC_TWISS_SUMMARY table | ptc_twiss_summary | string | |
RANGE | specifies a segment of beam-line for the PTC_TWISS calculation |
#s/#e | string | |
INITIAL_MATRIX_TABLE | Reading the transfer map from table called map_table created by preceding PTC_TWISS or PTC_NORMAL command. The table can be also read before hand from files using READTABLE command. | .FALSE. | logical | |
INITIAL_MATRIX_MANUAL | Using the input variables RE11,...,RE66 (see next entry) as the transfer matrix. | .FALSE. | logical | |
INITIAL_MAP_MANUAL | Using the input map stored beforehand in file fort.18 (e.g. by some initial run of PTC_NORMAL). | .FALSE. | logical | |
IGNORE_MAP_ORBIT | Ignore the orbit in the map and use instead closed orbit, if requested, or otherwise specified with x,px,y,p,t,dt parameters. | .FALSE. | logical | |
RE11,..., RE66 | Values of the 6x6 transfer matrix. | unit matrix | double | |
BETA0 | The name of the BETA0-block, which contains the Twiss parameters for the input. When icase=6, this information must be complemented by supplying a value for 'betz' on the ptc_twiss command line. | beta0 | string | |
MAP_TABLE | If true, save the one-turn-map to table "map_table". This one-turn-map can then be used as starting condition for a subsequent ptc_twiss, see INITIAL_MATRIX_TABLE parameter of this command. | .FALSE. | logical | |
betx, alfx, mux, bety, alfy, muy, dx, dpx, dy, dpy | Twiss and dispersion parameters bx,y, ax,y, gx,y, Dx, Dpx, Dy, Dpy (Edwards and Teng). | 0 | double | |
RING_PARAMETERS | Forces computation of ring parameters (gamma_tr, alpha_c, etc.). | .FALSE. | logical | |
x, px, y, py, t, pt | The canonical coordinates of the initial orbit. | 0 | double |