% !TeX spellcheck = en_GB
% !TeX program = lualatex
%
% v 2.3  Feb 2019   Volker RW Schaa
%		# changes in the collaboration therefore updated file "jacow-collaboration.tex"
%		# all References with DOIs have their period/full stop before the DOI (after pp. or year)
%		# in the author/affiliation block all ZIP codes in square brackets removed as it was not %         understood as optional parameter and ZIP codes had bin put in brackets
%       # References to the current IPAC are changed to "IPAC'19, Melbourne, Australia"
%       # font for ‘url’ style changed to ‘newtxtt’ as it is easier to distinguish "O" and "0"
%
\documentclass[a4paper,
               %boxit,        % check whether paper is inside correct margins
               %titlepage,    % separate title page
               %refpage       % separate references
               %biblatex,     % biblatex is used
               keeplastbox,   % flushend option: not to un-indent last line in References
               %nospread,     % flushend option: do not fill with whitespace to balance columns
               %hyphens,      % allow \url to hyphenate at "-" (hyphens)
               %xetex,        % use XeLaTeX to process the file
               %luatex,       % use LuaLaTeX to process the file
               ]{jacow}
%
% ONLY FOR \footnote in table/tabular
%
\usepackage{pdfpages,multirow,ragged2e} %
%
% CHANGE SEQUENCE OF GRAPHICS EXTENSION TO BE EMBEDDED
% ----------------------------------------------------
% test for XeTeX where the sequence is by default eps-> pdf, jpg, png, pdf, ...
%    and the JACoW template provides JACpic2v3.eps and JACpic2v3.jpg which
%    might generates errors, therefore PNG and JPG first
%
\makeatletter%
	\ifboolexpr{bool{xetex}}
	 {\renewcommand{\Gin@extensions}{.pdf,%
	                    .png,.jpg,.bmp,.pict,.tif,.psd,.mac,.sga,.tga,.gif,%
	                    .eps,.ps,%
	                    }}{}
\makeatother

% CHECK FOR XeTeX/LuaTeX BEFORE DEFINING AN INPUT ENCODING
% --------------------------------------------------------
%   utf8  is default for XeTeX/LuaTeX
%   utf8  in LaTeX only realises a small portion of codes
%
\ifboolexpr{bool{xetex} or bool{luatex}} % test for XeTeX/LuaTeX
 {}                                      % input encoding is utf8 by default
 {\usepackage[utf8]{inputenc}}           % switch to utf8

\usepackage[USenglish]{babel}

%
% if BibLaTeX is used
%
\ifboolexpr{bool{jacowbiblatex}}%
 {%
  \addbibresource{jacow-test.bib}
  \addbibresource{biblatex-examples.bib}
 }{}
\listfiles

%%
%%   Lengths for the spaces in the title
%%   \setlength\titleblockstartskip{..}  %before title, default 3pt
%%   \setlength\titleblockmiddleskip{..} %between title + author, default 1em
%%   \setlength\titleblockendskip{..}    %afterauthor, default 1em

\begin{document}

\title{Permanent Magnets for the CEBAF 24GeV Upgrade\thanks{Work supported by Brookhaven Science Associates, LLC under Contract No. DE-SC0012704 with the U.S. Department of Energy.}}

\author{S.J. Brooks\thanks{sbrooks@bnl.gov}, Brookhaven National Laboratory, Upton, NY, USA \\
	S.A. Bogacz, Thomas Jefferson National Accelerator Facility, Newport News, VA, USA}

\maketitle

%
\begin{abstract}
 An upgrade of the CEBAF facility to double its present energy of 12\,GeV has been proposed \cite{IPAC21,CEBAFthis}.  To provide double the number of linac passes using the existing five stacked arc beamlines, some beamlines are replaced by fixed-field accelerator (FFA) arcs, allowing multiple energies to pass through the same magnets.  A solution is presented in which two of the existing electromagnetic beamlines are replaced with permanent magnet non-scaling FFA arcs, as demonstrated at CBETA \cite{CBETA-DR,CBETA-PRL,CBETAmagnets}.  The two-stage design reduces peak magnetic field and synchrotron radiation loss compared to using a single stage.  FFAs do not pulse their magnets, making permanent magnets a promising and power-efficient technology option.  However, the magnetic field requirements are still at the high end of accelerator permanent magnets produced thus far (1.6\,T peak on beam), while the magnets must also be combined-function, having a gradient with a dipole offset.  Designs using a novel oval aperture and open midplane within an adapted Halbach magnet are presented.
\end{abstract}

\section{Energy Ranges and Stages}
The 1090\,MeV energy gain of the present CEBAF linacs is not increased in this study, although the injector energy is assumed to be upgraded from 123\,MeV to 650\,MeV.  This is because the same set of linac quadrupoles focusses all transmitted beam energies, so the ratio of maximum-to-minimum beam energy in the first linac should not get too large.  The easiest way to do this is to raise the injector energy; it may be done by running the present injector at 110\,MeV and adding a two-pass conventional loop through three 90\,MeV RF modules, giving $110+2\times(3\times90)=650$\,MeV.  This is a simplification of the option explored previously in \cite{IPAC21}.

CEBAF at present has five stacked 180$^\circ$ electromagnetic arcs on either side of the oval-shaped facility and this paper explores replacing either one or two of the highest energy lines by FFA arcs.  Limited vertical space in the CEBAF tunnel makes it difficult to add a sixth line of any sort, so each multi-pass FFA removes an electromagnetic line.  To double the energy, the total arc passes on each side of the machine is increased from 5 to 11, remembering the final linac pass after all the arcs boosts the energy by an additional `half turn' ($\sim$1\,GeV) and the synchrotron radiation loss at higher energy removes about the same.  The resulting numbers of arc passes and energy ranges are given in Table~\ref{tab:energyranges}.
% (slightly self-referential because of SR loss)

\begin{table}[!hbt]
   \centering
   \caption{Energy Ranges of Electromagnetic and FFA Lines}
   \begin{tabular}{lccc}
       \toprule
\textbf{Number of} & \textbf{E/M} & \textbf{FFA1} & \textbf{FFA2} \\
\textbf{FFA Stages} & \textbf{passes} & \textbf{passes} & \textbf{passes} \\
       \midrule
None (current) & 5 & --- & --- \\
One & 4 & 7 & --- \\
Two (4+4) & 3 & 4 & 4 \\
Two (5+3) & 3 & 5 & 3 \\
       \midrule
\multicolumn{4}{c}{\textbf{Energy ranges (GeV)}} \\
       \midrule
None (current) & 1.2--11 & --- & --- \\
One & 1.5--9.4 & 8.9--23 & --- \\
Two (4+4) & 1.5--7.2 & 7.1--16 & 14--23 \\
Two (5+3) & 1.5--7.2 & 7.1--18 & 16--23 \\
       \bottomrule
   \end{tabular}
   \label{tab:energyranges}
\end{table}

There is significant overlap between the FFA1 and FFA2 energy ranges because CEBAF physics requires a continuously-tunable energy range.  In the electromagnetic lines this is accomplished by scaling the magnet currents with the linac energy gain.  The FFAs are made of permanent magnets, so must accommodate any energy from any linac setting.  Letting the linac energy range from 925--1090\,MeV provides enough adjustment that the lowest possible energy of one FFA turn always coincides or overlaps with the highest energy of the previous turn, but this lowers the lowest energy of the FFA2 arc to below the FFA1 maximum.

\section{Arc Cell Constraints}
An optimisation was performed to try and find arc cells with minimal maximum field on any energy's closed orbit centroid.  The constraints are given in Table~\ref{tab:constraints}.

\begin{table}[!hbt]
   \centering
   \caption{Constraints on FFA Arc Cell Optimisation}
   \begin{tabular}{lcc}
       \toprule
       \textbf{Parameter} & \textbf{Value} & \textbf{Unit} \\
       \midrule
Cell angle & 2 & $^\circ$ clockwise \\
Radius of curvature & 80.6 & m \\
$\Rightarrow$ Cell length & 2.81347 & m \\
Both drift lengths & 0.1 & m \\
$\Rightarrow$ Packing factor & 0.929 & \\
Maximum tune & 0.425 & cycles/cell \\
Minimum tune & 0.025 & in either plane \\
       \bottomrule
   \end{tabular}
   \label{tab:constraints}
\end{table}

The cell lattice is BF-O-BD-O using combined function magnets in all cases.  The allowable cell tune range is generous to allow the full energy range from linac adjustment.

\section{Arc Cell Lattices}

The parameters of the resulting optimised lattices, for all three options (and both FFAs for the options that have two FFAs), are shown in Table~\ref{tab:lattices}.  The `reference energy' implies a beam rigidity ($B\rho$) that can be used to derive the central dipole field given each magnet's bend angle and length.

\begin{table*}[!hbt]
   \centering
   \caption{Optimised Arc Cell Lattices for Different Options}
   \begin{tabular}{lcccccc}
       \toprule
\textbf{Parameter} & \textbf{One FFA} & \textbf{4+4 FFA1} & \textbf{4+4 FFA2} & \textbf{5+3 FFA1} & \textbf{5+3 FFA2} & \textbf{Unit} \\
       \midrule
Reference energy &	15.95 &	11.55 &	18.5 &	12.55 &	19.5 &	GeV \\
BF length &	1.36109 &	2.09794 &	1.68482 &	1.57127 &	1.49155 &	m \\
BF angle &	-0.05722 &	-1.73802 &	-1.14623 &	-0.65227 &	-0.98835 &	$^\circ$ \\
BF gradient &	-48.649 &	-29.73 &	-65.616 &	-35.135 &	-80.781 &	T/m \\
BD length &	1.25238 &	0.51553 &	0.92865 &	1.0422 &	1.12192 &	m \\
BD angle &	-1.94278 &	-0.26198 &	-0.85377 &	-1.34773 &	-1.01165 &	$^\circ$ \\
BD gradient &	43.393 &	93.393 &	86.787 &	42.943 &	76.276 &	T/m \\
       \bottomrule
   \end{tabular}
   \label{tab:lattices}
\end{table*}

\section{Arc Cell Performance}

The lowest maximum fields achieved for each option are shown in Table~\ref{tab:comparison}, along with the total synchrotron radiation (SR) loss in all arc passes.  The resulting final energies are just $650+11\times2\times1090=24630$\,MeV minus the SR loss.  

\begin{table}[!hbt]
   \centering
   \caption{FFA Cells Performance Comparison}
   \begin{tabular}{lccc}
       \toprule
\textbf{Number of} & \textbf{Max Field} & \textbf{SR Loss} & \textbf{Final Energy} \\
\textbf{FFA Stages} & \textbf{(T)} & \textbf{(MeV)} & \textbf{(MeV)} \\
       \midrule
One & 2.007 & 1211.48 & 23418.52 \\
Two (4+4) & 1.495 & 964.44 & 23665.56 \\
Two (5+3) & 1.489 & 935.30 & 23694.70 \\
       \bottomrule
   \end{tabular}
   \label{tab:comparison}
\end{table}

The dependence of maximum field on beam energy is shown in Fig.~\ref{fig:maxfield}.  In all FFAs considered, the maximum field for low energy orbits occurs at the ends of the BD magnet and for high energy orbits near the centre of the BF magnet, with a V-shaped minimum where the switch occurs.

\begin{figure}[!htb]
   \centering
   \includegraphics*[width=\columnwidth]{THPOTK011_f1}
   \caption{Maximum field on beam centroid, as a function of energy in the various FFA options.}
   \label{fig:maxfield}
\end{figure}

The optimiser tries to balance the maximum field at the high and low ends of the energy range, a task that is made easier by having a smaller energy range, as in the two-FFA options.  For the 4+4 turn arrangement, FFA2 has the higher field, which motivated investigation of the 5+3 turn alternative, where the smaller energy range in FFA2 means FFA1 has a slightly higher field.

The SR loss shown in Fig.~\ref{fig:srloss} tells a similar story of the FFAs being better optimised when the energy range is split into two smaller parts.  The area under the one-FFA curve is larger and wasteful at low energies.  The curve shapes come from the `$\gamma^4$ law' modulated by the orbits being straighter in the middle of the FFA energy range, forming a dip.

\begin{figure}[!htb]
   \centering
   \includegraphics*[width=0.96\columnwidth]{THPOTK011_f2}
   \caption{Energy lost to synchrotron radiation in different FFA options.}
   \label{fig:srloss}
\end{figure}

Finally, a feature of FFA lattices is that different energies go on different orbits, which may have different lengths.  This is the case here, as Fig.~\ref{fig:pathlength} shows there can be a 3--12\,cm path length difference through a given 180$^\circ$ FFA arc.

\begin{figure}[!htb]
   \centering
   \includegraphics*[width=0.96\columnwidth]{THPOTK011_f3}
   \caption{Path length through 180$^\circ$ of arc, as a function of energy in each FFA option.}
   \label{fig:pathlength}
\end{figure}

\section{Permanent Magnets}
Permanent magnets were designed for the two-FFA, 5+3~turn option with the highest performance.  The requirements in Table~\ref{tab:magparams} differ in dipole from Table~\ref{tab:lattices} because each magnet's local $x$ has been defined relative to the centre of the orbit excursion in that magnet. 

% Magnet parameter table (fields, gradients, apertures)
% Explain these are aperture-recentered and 50pc gradient scaled for FFA2
\begin{table}[!hbt]
   \centering
   \caption{Magnet Parameters for the Two-FFA (5+3) Option}
   \begin{tabular}{lccc}
       \toprule
\textbf{Magnet} & \textbf{Dipole} & \textbf{Gradient} & \textbf{$x$ Aperture} \\
			& \textbf{(T) @ $x=0$} & \textbf{(T/m)} & \textbf{Range (mm)} \\
       \midrule
FFA1 BF & -0.52616 & -35.135 & $\pm$27.39 \\
FFA1 BD & -0.73168 & 42.943 & $\pm$19.53 \\
FFA2 BF & -0.80051 & -40.390 & $\pm$14.95 \\
FFA2 BD & -1.06879 & 38.138 & $\pm$10.66 \\
       \bottomrule
   \end{tabular}
   \label{tab:magparams}
\end{table}

The gradients for FFA2 have also been halved to make practically-sized apertures possible in all magnets.  These small-angle FFA cells can be scaled to half gradients, doubled beam excursions and $\sqrt{2}\times$ cell lengths and angles without affecting the tunes.

The magnet designs include open midplanes to allow synchrotron radiation to escape and use an oval-shaped modified Halbach design for greater efficiency with a horizontal orbit span, following \cite{ModifiedHalbach}.  There are also minimum aperture requirements, all given in Table~\ref{tab:magrules}.

% Maybe another table for permanent magnet design criteria (Br, wedges, open midplane, aperture radius etc.)
\begin{table}[!hbt]
   \centering
   \caption{Permanent Magnet Design Rules}
   \begin{tabular}{lcc}
       \toprule
\textbf{Parameter} & \textbf{Value} & \textbf{Unit} \\
       \midrule
Material & NdFeB & \\
Grade & N42EH & \\
Remnant field $B_r$ & 1.30 & T \\
Central aperture gap & 20 & mm \\
Midplane slot gap & 8 & mm \\
Number of wedges & 24 (12 per side)& \\
Wedge angles (FFA1,2) & 30/7.5/30, 20/10/20 & $^\circ$ \\ 
       \bottomrule
   \end{tabular}
   \label{tab:magrules}
\end{table}

The cross-sections of the resulting magnet designs are given in Fig.~\ref{fig:magnets}.  The magnets have cross-sectional areas from 72.8--107.1\,cm$^2$ and harmonic errors from 18.6--30.8~units on any of the small circles shown in the figure.  This is within the range correctable by the tuning methods in \cite{CBETAmagnets}.
% Pictures of 1, 2 or 4(?) magnet designs on similar conditions
\begin{figure}[!htb]
   \centering
   \includegraphics*[width=\columnwidth]{THPOTK011_f4}
   \caption{Magnet cross-sections for BF (left) and BD (right) in FFA1 (top) and FFA2 (bottom).  Grid has 1\,cm spacing and blue arrows denote magnetisation direction.}
   \label{fig:magnets}
\end{figure}

Figure \ref{fig:demag} shows the areas in the magnet most sensitive to demagnetisation from elevated temperature or radiation.  The FFA1 BD magnet was chosen as an example because it has the highest nominal field of 1.571\,T in the aperture, although the beam never quite sees this as the orbit exits through the fringe field.  Material, magnetic environment and radiation resistance are quantitatively linked in \cite{TemnykhDemag}.  The `EH' grade of material was selected to further reduce sensitivity by increasing the reverse $H_{cj}$ field required for irreversible magnetisation loss.
% Colourful plot of demag
\begin{figure}[!htb]
   \centering
   \includegraphics*[width=\columnwidth]{THPOTK011_f5}
   \caption{Sensitivity to demagnetisation in the FFA1 BD magnet, given by field antiparallel to the magnetisation direction, $-\mu_0 \mathbf H \cdot \mathbf M /|\mathbf M|$.  Black is 0--0.5\,T, green $\le$1\,T, yellow $\le$1.5\,T and red >1.5\,T.  Magneta indicates parallel field.}
   \label{fig:demag}
\end{figure}

% Maybe the 12deg design alternative

\section{Future Work}
% Designed and ordered a magnet, haven't got it yet, have built a measurement system
A Laboratory-Directed R\&D (LDRD) study is underway at BNL that intends to build short segments of magnets with these parameters, measure their field maps and correct the integrated fields by adapting the method in \cite{CBETAmagnets}.  Currently, permanent magnet wedges have been ordered but the manufacturing plant in Shanghai is closed due to lockdowns.  A Hall probe with $\pm$0.005\% accuracy has been purchased and used successfully with a 2D field mapping stage, measuring integrated fields to 1 unit resolution on a test magnet, so this project is in a good position when the magnet pieces arrive.

The design ordered for the LDRD also introduced a 12$^\circ$ incline on the open midplanes to allow a more rigid vacuum chamber that is thicker in most places.

%
% only for "biblatex"
%
\ifboolexpr{bool{jacowbiblatex}}%
	{\printbibliography}%
	{%
	% "biblatex" is not used, go the "manual" way
	
	%\begin{thebibliography}{99}   % Use for  10-99  references
	\begin{thebibliography}{9} % Use for 1-9 references
	
\bibitem{IPAC21} S. A. Bogacz \emph{et al.},
\textquotedblleft{20-24 GeV FFA CEBAF Energy Upgrade}\textquotedblright,
presented at the 12th Int. Particle Accelerator Conf.~(IPAC’21), Campinas, Brazil, May 2021, paper MOPAB216, pp. 715--718.

\bibitem{CEBAFthis} 
R. M. Bodenstein \emph{et al.},
\textquotedblleft{Current Statuse of the FFA@CEBAF Energy Upgrade Study}\textquotedblright,
presented at the 13th Int. Particle Accelerator Conf.~(IPAC’22), Bangkok, Thailand, June 2022, this conference.

\bibitem{CBETA-DR} G. H.~Hoffstaetter \textit{et al.}, ``{CBETA} Design Report, {C}ornell-{BNL} {ERL} Test Accelerator'', 2017. \url{arXiv:1706.04245}

\bibitem{CBETA-PRL} A.~Bartnik \emph{et al.}, ``{CBETA}: First Multipass Superconducting Linear Accelerator with Energy Recovery'', \textit{Phys. Rev. Lett.}, vol. 125, p. 044803, 2020. 
\url{doi:10.1103/PhysRevLett.125.044803}

\bibitem{CBETAmagnets} S.~Brooks, G.~Mahler, J.~Cintorino, J.~Tuozzolo, and R.~Michnoff, ``Permanent magnets for the return loop of the Cornell-Brookhaven energy recovery linac test accelerator'', \textit{Phys. Rev. Accel. Beams}, vol. 23, p. 112401, Nov 2020. \\ \url{doi:10.1103/PhysRevAccelBeams.23.112401}

\bibitem{ModifiedHalbach} S. J. Brooks,
\textquotedblleft{Modified Halbach Magnets for Emerging Accelerator Applications}\textquotedblright,
presented at the 12th Int. Particle Accelerator Conf.~(IPAC’21), Campinas, Brazil, May 2021, paper TUXC07, pp. 1315--1318.

\bibitem{TemnykhDemag} A.B. Temnykh,
\textquotedblleft{Measurement of {NdFeB} permanent magnets demagnetization induced by high energy electron radiation}\textquotedblright,
NIM A \textbf{587}, pp. 13--19, 2008.

	\end{thebibliography}
} % end \ifboolexpr
%
% for use as JACoW template the inclusion of the ANNEX parts have been commented out
% to generate the complete documentation please remove the "%" of the next two commands
% 
%%%\newpage

%%%\include{annexes-A4}

\end{document}
