The TOUSCHEK module computes the Touschek lifetime and the scattering rates around a lepton or hadron storage ring, based on the formalism of Piwinski [A. Piwinski, "The Touschek Effect in Strong Focusing Storage Rings," DESY-98-179; see also Piwinski's article on Touschek lifetime in the Handbook of Accelerator Physics and Engineering (A. Chao, M. Tigner, eds.), World Scientific, 1999] .
The syntax of the TOUSCHEK command is:
TOUSCHEK, TOLERANCE=real, FILE=filename;
[Warning: Calling EMIT between the TWISS and TOUSCHEK commands leads to TOUSCHEK using wrong beam parameters, even if the BEAM command is reiterated.]
The momentum acceptance is taken from the bucket size taking into account the energy loss per turn U0 from synchrotron radiation. The value of U0 is computed from the second synchrotron radiation integral synch_2 in the TWISS summ table (synch_2 is calculated only when the TWISS option 'chrom' is invoked), using Eq. (3.61) in Matt Sands' report SLAC-121, which was generalized to the case of several harmonic rf systems. If synch_2 is zero, not defined or not calculated, zero energy loss is assumed.
In the case of several rf systems with nonzero voltages, it is assumed
that the lowest frequency system defines the phase of the outer point on the
separatrix when calculating the momentum acceptance, and that all
higher-harmonic systems are either in phase or in anti-phase to the lowest
frequency system.
(Note: if a storage rings really uses a different rf scheme,
one would need to change the acceptance function in the routine cavtousch
for that ring.)
The arguments have the following meaning:
Example:
BEAM, PARTICLE=PROTON, ENERGY=450, NPART=1.15e11, EX=7.82E-9, EY=7.82E-9, ET=5.302e-5; ... USE,PERIOD=LHCb1; ... VRF=400; ... SELECT, FLAG=TWISS, CLEAR; TWISS, CHROM, TABLE; TOUSCHEK, FILE, TOLERANCE=1.e-8; ...
The results are stored in the TOUSCHEK table, and can be written to a file (with the default name 'touschek' in the example above), or values can be extracted from the table using the value command as follows
value, table(touschek,name), table(touschek,s), table(touschek,tli), table(touschek,tliw), table(touschek,tlitot);
where 'name' denotes the name of a beamline element, s the position of the center of the element, tli the instanteneous Touschek loss rate within the element, and tliw the instantaneous rate weighted by the length of the element divided by the circumference (its contribution to the total loss rate), and tlitot the accumulated loss rate adding the rates over all beamline elements through the present position. The value of tlitot at the end of the beamline is the inverse of the Touschek lifetime in units of 1/s.
Also, all results can be printed to a file using the command
write, table=touschek, file;
The MADX Touschek module was originally developed by
Catia Milardi and
Frank Zimmermann.
The MAD-X Touschek module was partially rewritten in November 2013 by Ghislain Roy after the discovery of a few bugs in the original code:
The first bug concerned a numerical instability in the computation of the B2 parameter as listed in Eq. 34 in the paper of Piwinski referred above. The initial alogorithm implemented the calculation of square root of the difference between two expressions. It turned out that the numerical values of both expressions could sometimes be very large and nearly equal. Because of limited precision in floating point calculations, the difference could sometimes lead to negative values and the square root returned an undefined value (NaN). The integrator then failed to compute the integral and returned a value of zero, with the printing of a faintly related message that too high accuracy was required for integrator DGAUSS. The algorithm didn't stop there and the end result was that the summation over all elements in the range was wrong and the end results were also wrong.
TLIW[i] = 0.5 * (TLI[i] + TLI[i-1]) * L[i] / CIRC
TLIW[i] = TLI[i] * L[i] / CIRC