Nicholaos Tsoupas, Brookhaven National Laboratory, C-AD, Upton, NY, USA.
The CBETA project  is an electron accelerator to be commissioned in 2019 at Cornell University. This accelerator is unique, and the first of its type to combine two very important concepts, the Energy Recovery Linac ( ERL) concept  and the Fixed Field Alternating Gradient (FFA) .
The CBETA accelerator consist of:
a) a 1.3 GHz 80 MeV superconducting Energy Recovering Linac (ERL)  which will accelerate/decelerate the electron bunches by 36 MeV each time the bunches pass through the Linac,
b) a splitter/combiner consisting of four transport lines placed at the exit/entrance of the ERL, and
c) a single recirculating FFA beam line which transports and recirculates through the ERL the four electron bunches with energies 42, 78, 114, and 150 MeV.
This paper focuses on the electromagnetic design and beam optics of CBETA’s FFA cell which consist of a focusing magnet and a combined function magnet both based on the Halbach design  and made of permanent magnet material. Each Halbach type of magnet is surrounded by a window frame corrector magnet made of magnetic iron which is included in the electromagnetic calculations of the CBETA cell.
The CBETA project  is the first electron accelerator which combines both the ERL  and the FFA  concepts. The project is currently at its initial stage of commissioning, which is scheduled to start this year, 2019. Fig. 1 shows a layout of the CBETA accelerator.
The section labeled (IN) in Fig. 1 is the injector which injects a 6 MeV electron bunch into the ERL (LA) which increases the bunch energy by 36 MeV to 42 MeV. The “40 MeV” beam line of the splitter (SX) transports the bunch to the FFA arc which recirculates the bunch to the entrance of the ERL for the bunch to receive an additional 36 MeV of energy. The bunch attains its final energy of 150 MeV after two more re-circulations in the FFA. Subsequently the energy of the bunch is reduced by 36 MeV each time the bunch passes through the ERL to exit the ERL at 6 MeV after four re-circulations through the ERL. The 6 MeV beam bunch is dumped in the designated electron beam dump (BS) shown in Fig. 1. It is remarkable that the electron bunches with energy range 40 MeV to 150 MeV can be transported by a single FFA transport line which consists of the sections (FA), (TA), (ZA), (ZB), (TB), and (FB) shown in Fig. 1. The straight sections (ZA) and (ZB) of the FFAG transport line consist of 27 cells each comprised of two Halbach type permanent magnets one of a focusing quadrupole and the other defocusing. The arc sections of the FFA (FA), (TA), (TB), and (FB) consist of 80 cells, each cell comprised of a focusing quadrupole (QF) and a combined function magnet (BD) which is the superposition of a dipole and a defocusing quadrupole. Fig. 2 is a perspective view of three (out of 16) consecutive FFA arc-cells of the (FA) and (FB) sections of the CBETA accelerator. Each QF and DB magnets of the FFA cell has a window frame dipole corrector which generates a vertical dipole field for the QF magnet and an horizontal dipole field for the BD magnet.
The beam optics of each cell and of the whole CBETA accelerator  is calculated from 3D field maps which are generated by the OPERA computer code . The cells of the (FA) and (FB) sections are identical but the cells in the sections (TA) and (ZA) vary, and the cells in the straight sections (TB) and (ZB) are mirror images of those in the sections (TA) and (ZA). The subject of this paper is to report on the electromagnetic design of the magnetic elements QF and BD which comprise the cells of the FFA arcs. The study includes the interference between the magnets within each cell and the interference between the magnets of neighboring cells. The iron corrector magnets which surround every magnet of the cell are also included in the interference calculations. This study was initiated at BNL by the author and other researchers at BNL as part of the eRHIC project  and subsequently extended to the CBETA project. This paper presents the part of the work done by the CBETA team.
The initial beam optics  of each cell and of the whole accelerator is designed by considering each magnetic element of the accelerator as a lump element represented by a first order transfer matrix (-matrix). This initial study defines with good approximation the geometry of the magnetic elements (aperture, length) within the cell and the strength of the multipoles (dipole, quadrupole) of each magnet. Following the initial beam optics which define the aperture and strength of the magnetic elements the 2D and 3D electromagnetic design of the cell’s Halbach type magnetic elements is performed.
The cross section of the QF and BD magnets of the FFA cell is shown in Fig. 3. Each magnet is made of 16 wedges of permanent magnet material of NdFeB-NEH. The QF magnet has a window frame corrector magnet which generates vertical dipole field and the corrector of the BD magnet generates a horizontal dipole field.
The “BH” curve of the NdFeB-NEH material is shown in Fig. 4. The value of the remnant field of the NdFeB-NEH material is 1.204 T and the coercive-force =11.9 kOe at a temperature of 20 and the permeability of this material at this temerature is =1.012.
The size of the permanent magnet wedges of the QF wedges which provide the strength of the magnetic multipoles as calculated by the optics study can be calculated by the formula 
In Eq. (1) the symbols and are the gradient, inner aperture radius and outer radius of the QF quadrupole Halbach magnet taking into account the BH curve. is the number of wedges which in this case is 16. Although Eq. (1) defines the gradient and geometry of the QF Halbach magnet quite well, the 2D modeling of the magnet using OPERA provides more accurate values of the and that generate the required gradient of the magnet. The magnetization direction of each wedge which is required in the model for the OPERA calculation and most important for manufacturing the magnet is given by Eq. (2).
In Eq. (2) the symbol is the number of magnetic poles of the multipole generated by the Halbach magnet. In this case for a quadrupole and the symbols and , which are shown in Fig. 4, are the azimuthal angle of the wedge and the magnetization direction of the wedge with respect to the -axis. The BD magnet is a combined function magnet to provide a dipole and a quadrupole field. It is a modified type of Halbach magnet which has been made by an optimization process which varies the radial length and the magnetization of each of the wedges  to generate the required value of the dipole and quadrupole strength. It is understood that the optimization process satisfies the symmetry properties of the fields. In Fig. 3, the space between the inner region of the window frame magnet and the outer region of the permanent magnets is occupied by an aluminum block. The aluminum block has holes to allow the circulation of constant temperature water to keep the temperature of the permanent magnet stable.
An accurate knowledge of the magnetic field in the regions of the FFA cells, where all four bunches circulate, is needed to ascertain the correct beam optics to keep all four bunches under control. The 3D electromagnetic study of the CBETA magnets provides accurate fields especially in the fringe field regions where the 2D study cannot provide such fields at all. In addition the 3D study will provide the correct fields due to the interference of the QF and BD magnets within the cell as well as the magnets at the neighboring cells including the iron cores of the corrector magnets. In fact two methods were used to calculate the beam optics of the FFA cell. The first method is based on the beam optics which utilizes field maps that include the interference of all the magnets within the cell including the magnets of neighboring cells, and the other method assumes superposition of the field maps produced by the individual magnets QF and BD of the FFA beam line. It turns out that the beam optics generated by either method almost coincide, both methods providing stable circulating beam .
As mentioned earlier the initial beam optics calculations of the FFA cell assume that the magnets of the cell generate uniform dipole and quadrupole fields with no fringe fields. This approximation comes under the name Sharp Cut-Off Fringe Field (SCOFF). This initial beam optics study provides with some accuracy the geometry of the cell magnets, their length, aperture, relative position and the strength of the dipole and quadrupole of each magnet. Subsequently a 2D model of each cell magnet provides a more accurate geometry of each magnet by the use of the OPERA computer code. The fringe fields of the magnets are taken into account by the 3D calculations using the “Modeller” module of the OPERA computer code. In addition these 3D calculations take into account all possible interference effects between the magnets within the cell as well as the magnets of neighboring cells. From the results of the OPERA solver a 3D field map on a rectangular grid is generated and is used in the Zgoubi computer code  to calculate the beam optics of the FFA cell. A brief description of setting up the 3D model of the cell for magnetic field calculations using the OPERA computer model is given below.
a) The beam optics of the cell generated by the SCOFF approximation model provide the coordinates of the entrance and exit of the cell magnets at the median plane. These coordinates are shown by red dots in Fig. 5 which is a schematic diagram of the cross section at the median plane of three consecutive FFA cells. The highlighted yellow areas in Fig. 5 represent the aperture of the magnets. It is understood that the magnetization vector of the permanent magnet wedges is also rotated when each magnet is rotated about the -axis which is normal to the median plane. Some details on the 3D setup of the cell model appear in APPENDIX I.
c) Prior to the solution of the 3D-three-cell OPERA model each wedge of the QF and BD magnet is assigned
the correct magnetization direction and also assigned the “BH” curve aa shown in Fig. 4. Some specifications of the QF
and BD cell magnets, after the final optimization of the FFA cell, appear in Table 1.
d) Following the solution of the 3D-three-cell OPERA model by the TOSCA module of the OPERA code, a 3D field map is generated on a rectangular three dimensional grid. The field map contains the components of the field at the coordinates of each grid point. This field map of the cell is used by the ray-tracing computer codes Zgoubi  or BMAD  to calculate the reference trajectories and the beam parameters of the beam bunches circulating in the FFA cells with four different energies.
The final design of the FFA cell’s beam optics was obtained after a few iterations. In each iteration a new 3D-three-cell OPERA model was produced and a new field map was generated. In each iteration a change in the aperture, relative location and strength of magnets was introduced to optimize the beam trajectories and the beam parameters in the cell.
This subsection shows a 3D histogram plot of the component of the field at the median plane of one of the FFA arc-cells. Fig. 6 shows the placement of the rectangular patch over which the 3D histogram is plotted and Fig. 7 shows the 3D histogram itself by removing the magnets.
Following the mechanical assembly of each FFA Halbach magnet, the integrated multipoles of the magnet was measured by the rotating coil method . Fig. 8 is a picture of a modified Halbach quadrupole , which avoids the synchrotron radiation emitted by electron bunches, and a rotating coil device which measures the integrated multipoles of the magnet.
Any measured multipoles with values beyond the acceptable range for a stable circulating beam are corrected by the “wire technique” method which is described in reference  with a brief description given here. The left picture in Fig. 9 is a cross section of a modified Halbach quadrupole with holes (blue squares) which can accept wires of soft magnetic material like steel-1006 and of proper thickness. The placement of wires in the appropriate holes reduces the strength of undesired multipoles which are measured by the rotating coil method. The OPERA computer code without the optimizer module was used initially to calculate the proper placement and wire thickness to minimize a particular multipole at a time. The development of a faster code  considerably reduced the time taken for the process of reducing the undesired multipoles. The right-hand picture is the actual modified Halbach quadrupole whose cross section is shown in the picture on the left. The white material in the right picture is to hold the permanent magnet wedges for magnetic measurements only. The engineering of the actual magnet to be used in a beam line will be different.
Experimental measurements  showed that the excitation of the dipole corrector magnets did not affect significantly the multipoles of the the Halbach type permanent magnets to alter the trajectories of the bunches and the beam optics of the cell to drive out of control the bunches in the FFA line. This experimental observation suggests that the beam optics calculations that are based on the complete 3D OPERA field maps of a the FFA cell as described earlier in the paper, can be simplified by using the individual field maps of the QF and BD magnets including the window frame corrector magnet of each magnet. It is understood that the field maps of the individual magnets will be superimposed properly to represent the location and orientation of the magnets in a cell. Indeed using the Zgoubi computer code , it is proven that the beam optics, and the trajectories of the bunches in the FFA arc-cell generated by the field maps derived from the 3D-three-cell OPERA model, are almost identical to the beam optics and trajectories of the reference particles of the bunches when the field maps are generated by the superposition of the individual field maps of the QF and BD magnets.
This section shows an example of the trajectories and the beta functions generated from the use of the computer code Zgoubi which raytraces using the 3D field maps provided by the OPERA computer code. The left picture in Fig. 10 shows the trajectories of the reference particles for the four bunches with energies 42, 78, 114 and 150 MeV. The right picture are the and functions in the arc-cell for the energy of 150 MeV.
Work supported by the United States Department of Energy. The author would like to express his gratitude to all the CBETA collaborators who have brought the CBETA accelerator to the commissioning stage.
This section presents some details of the 3D setup of the 3D-three-cell OPERA model. Table 2 shows the coordinates at the entrance and exit of the QF and BD magnets as the magnets are placed to form three consecutive cells as shown in Figs. 2 and 5. These coordinates at the entrance and exit of the magnets in each cell are shown schematically by the red dots in Fig. 5.
In the FFA arc-cell it turns out that the BD magnet is rotated about the -axis by 5 with respect to the QF magnet. The QF and BD magnets which comprise the FFA arc-cell form a periodic structure and as such can be solved by the OPERA computer code by assigning periodic boundary conditions at the entrance and exit of the cell. The solution of such a model having periodic boundary conditions has been obtained; however for reasons that are explained below it was decided to obtain the 3D field map of the cell, not from the cell with the periodic boundary conditions but from the central cell of a three cell-consecutive model as shown in Figs. 2 or 5. In the three-cell model shown in Fig. 5, cell #3 is generated by translating the origin =(0.0 cm, 0.0 cm) of the upstream cell #2 by =(-7.63 cm, 88.31 cm) and rotating it about this new origin by about the -axis. The boundary conditions of the three-cell model were set as if the outer surfaces of the air surrounding the three-cell model are at infinity. The solution of the three-cell model is in agreement with the solution obtained from the periodic model when the fields compared are calculated using the “nodal” method but there is disagreement when the fields are calculated using the “integral” method. The “integral” method calculates the fields with better accuracy; therefore we used the 3D field map generated by the 3D-three-cell OPERA model. It is under investigation why the “integral” method of calculating the fields as derived from the solution of the periodic model does not provide the “correct” results.
 Energy Recovery Linacs - The CERN Accelerator School
 K. Halbach, “Application of permanent magnets in accelerators and electron storage rings”, J. Appl. Phys., 1985, 57, (8),pp. 3605–3608
 F. Méot et al., https://www.bnl.gov/isd/documents/79375.pdf
 Vector Fields Inc. http://www.vectorfields.com/.
 V. Ptitsyn, “The ERL Based Design of Electron-Hadron Collider eRHIC”, J. Appl. Phys., 1985, 57, (8),pp. 3605–3608
 W. Lou, et al. “THE BEAM OPTICS OF THE FFAG CELL OF THE CBETA ERL ACCELERATOR” IPAC2018, Vancouver, BC, Canada
 S.M. Lund and K. Halbach, “Iron free permanent magnet systems for charged particle beam optics”, UCRL-JC-121454 (1995)
 Private Communication. firstname.lastname@example.org
 F. Méot, “AN ALL-PURPOSE ACCELERATOR CODE, ZGOUBI” Proceedings of Cyclotrons2013, Vancouver, BC, Canada
 N. Tsoupas et al., “Main Magnets and Correctors for the CBETA and eRHIC Projects, and Hadron Facilities”, Physics Procedia, Volume 90, 2017, Pages 143-150
 Private Communication. email@example.com
 A. Jain, Private communication, BNL