RF Gap Transformation in PARMILA
The PARMILA (Phase And Radial Motion in Ion Linear Accelerators) code is used to design ion linacs and simulate the beam dynamics therein. The original code was developed in the 1960’s and later the Los Alamos Accelerator Code Group developed a PC version that has been used worldwide. Recently, in an effort to modernize the code and use it as the basis for a high-performance beam dynamics simulator with the LANSCE linac, the details of the code have come under additional scrutiny. PARMILA is a “z code” that uses various transformations to approximately represent the effect of the beam line element on the beam. In the case of the RF gap, it treats the particle dynamics inside the gap as a combination of drift + kick at the mid-plane + drift. Recently, we uncovered an undocumented keyword “off-exact” in PARMILA that enables the code to use the full modified-Bessel functions instead of low-order approximations in the RF gap transformation. This change improved the accuracy of the transformation for off-axis particles. However, a discrepancy between the analytical formula and the code was found for the transformation of the transverse coordinates. The purpose of this tech note is to document the derivation of the gap transformation and the related DTL cell length calculation used in the PARMILA code.