\documentclass[a4paper,11pt]{article}
\parskip=1.5ex
\usepackage{verbatim,a4margins,amsmath,bm,hyperref}

\newcommand{\dd}[2]{\frac{\mathrm d #1}{\mathrm d #2}}
\newcommand{\dds}[2]{\frac{\mathrm d^2 #1}{{\mathrm d #2}^2}}
\newcommand{\pdd}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pdds}[2]{\frac{\partial^2 #1}{\partial{#2}^2}}
\newcommand{\pddd}[3]{\frac{\partial^2 #1}{\partial #2\partial #3}}

\newcommand{\rowfour}[4]{\left[\begin{array}{cccc}#1&#2&#3&#4\end{array}\right]}
\newcommand{\vectwo}[2]{\left[\begin{array}{c}#1\\#2\end{array}\right]}
\newcommand{\mxtwo}[4]{\left[\begin{array}{cc}#1&#2\\#3&#4\end{array}\right]}

\newcommand{\sq}[1]{\left(#1\right)^2}
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\abs}[1]{\left|#1\right|}

\newcommand{\rem}[1]{}

\newcommand{\A}{\mathbf A}
\newcommand{\E}{\mathbf E}
\newcommand{\B}{\mathbf B}
\newcommand{\J}{\mathbf J}

\newcommand{\x}{\mathbf x}
\newcommand{\y}{\mathbf y}
\newcommand{\z}{\mathbf z}

\newcommand{\s}{\mathbf s}
\newcommand{\rv}{\mathbf r}

\newcommand{\e}{\mathbf e}
\newcommand{\m}{\mathbf m}
\newcommand{\M}{\mathbf M}

\newcommand{\de}{\,\mathrm d}

\newcommand{\ii}{\mathrm i}

\begin{document}

\title{Paraxial, Thin-Lens Analysis of Fixed-Tune, Non-Scaling FFAs with Two Magnets per Cell}
\author{Stephen Brooks}
\maketitle

\section{Introduction}
Fixed-field accelerators (FFAs) have closed orbits that change as a function of beam momentum.  It is sometimes useful to avoid various resonances by keeping the tunes constant as these orbits change.  A well-known example is the \emph{scaling FFA} where the entire beam orbit and optics are geometrically scaled as a function of momentum.  However, this is stricter than necessary: cells with three or more lenses can have fixed tunes even when the focussing strengths in the lenses change \cite{ThreeLens}.

Recently, Dejan Trbojevic has found a pair of nonlinear magnets that produce fixed tunes \emph{and fixed beta functions} while not being a scaling FFA \cite{TrbojevicIPAC22}.  This improves on a more approximate solution in \cite{TrbojevicIPAC21}.  Notably a scaling FFA would require one magnet to be entirely reverse-bending, whereas the Trbojevic solution does not do this and instead resembles an intermediate point between the traditional scaling field profiles and the nonscaling profiles centred around a momentum with equal and positive fields.

This suggests there are at least three levels of stringency that one can apply to a fixed-tune FFA design:
\begin{enumerate}
\item Fixed cell tunes (in both planes) as a function of momentum;
\item Fixed optics (beta functions) as a function of momentum;
\item Similarity of all orbits via a scaling symmetry law $\Leftrightarrow$ traditional scaling FFA.
\end{enumerate}
This note studies the interesting case \#2 above (\#3 being fully characterised by the orbit at a single energy) in the simplest possible example: a cell of two thin lenses in the small angle (paraxial) approximation.

\section{Definitions of Variable Functions}
The cell consists of an F magnet, a drift of length $d_1$, a D magnet and a drift of length $d_2$.  The beam position and angle in these magnets and drifts, as a function of momentum $p$, are
\[ x_F(p), \quad x'_1(p), \quad x_D(p), \quad x'_2(p), \]
respectively.  The bending angle in each thin lens is $\theta_e(p)$ for $e=F,D$ and the normalised integrated field is $b_e(x)$, where these are related by
\[ \theta_e(p) = \frac{b_e(x_e(p))}{p}. \]
This is a total of eight functions, which need as many constraints.

\section{Constraints}
There are a total of eight functional constraints: 2+4+2 as given in the subsections below.

\subsection{Constant Normalised Gradient}
It appears in the two-magnet-per-cell case, the normalised gradient in each magnet and the beta functions remain constant.  Thus,
\[ b'_e(x_e(p))=k_e p, \]
for $e=F,D$ and two constants $k_F, k_D$, gives two constraints. 

\subsection{Paraxial Dynamics and Closure}
\newcommand{\thcell}{\theta_\mathrm{cell}}
Starting with angles, it is clear that
\[ x'_2(p)=x'_1(p)+\theta_D(p) \]
but going back to $x'_1$ involves wrapping to the next cell, so the overal constant cell angle $\thcell$ must be subtracted:
\[ x'_1(p)=x'_2(p)+\theta_F(p)-\thcell. \]

\newcommand{\dxcell}{\Delta x_\mathrm{cell}}
For the positions, paraxial tracking through the drifts gives
\[ x_D(p)=x_F(p)+d_1x'_1(p) \]
and wrapping to the start of the cell, 
\[ x_F(p)=x_D(p)+d_2x'_2(p)-\dxcell, \]
where a constant transverse displacement $\dxcell$ has also been allowed.

\subsection{Relation of Angles to Normalised Integrated Fields}
These two constraints are the ones from the previous section:
\[ \theta_e(p) = \frac{b_e(x_e(p))}{p}, \]
for $e=F,D$.

\section{Elimination}
With eight functions and eight functional constraints, all variable functions should be eliminated, leaving only some constants, some in the form of boundary conditions for the differential equation part.

\subsection{Linear Part}
Four of the equations are linear (in $x_e$, $\theta_e$, $x'_n$) with additive constants and allow some elimination.  Using the equations for $x'_1$ and $x'_2$,
\begin{eqnarray*}
  x'_1(p) &=& x'_2(p)+\theta_F(p)-\thcell \\ 
 &=& x'_1(p)+\theta_D(p)+\theta_F(p)-\thcell \\
 \Rightarrow \quad \theta_D(p)+\theta_F(p) &=& \thcell.
\end{eqnarray*}
This is common sense so far (the lens angles added together equal the cell angle) and can be used to eliminate $\theta_D$.

Using the equations for $x_F$ and $x_D$,
\begin{eqnarray*}
 x_F(p) &=& x_D(p)+d_2x'_2(p)-\dxcell, \\
 &=& x_F(p)+d_1x'_1(p)+d_2x'_2(p)-\dxcell, \\
 \Rightarrow \quad d_1x'_1(p)+d_2x'_2(p) &=& \dxcell.
\end{eqnarray*}
Again, this is a common sense evaluation of the transverse offset in the cell and can be used to eliminate $x'_2$.

Using the elimination for $x'_2$ in in the $x'_1$ equation gives:
\begin{eqnarray*}
x'_1(p) &=& x'_2(p)+\theta_F(p)-\thcell \\ 
&=& \frac{\dxcell - d_1x'_1(p)}{d_2}+\theta_F(p)-\thcell \\
\Rightarrow \quad \left(1+\frac{d_1}{d_2}\right)x'_1(p) &=& \frac{\dxcell}{d_2}+\theta_F(p)-\thcell,
\end{eqnarray*}
which can be used to eliminate $x'_1$.  This can immediately be used in the $x_D$ equation
\begin{eqnarray*}
x_D(p) &=& x_F(p)+d_1x'_1(p) \\
 &=& x_F(p)+\frac{d_1}{1+\frac{d_1}{d_2}}\left(\frac{\dxcell}{d_2}+\theta_F(p)-\thcell \right) \\
 &=& x_F(p)+\frac{d_1d_2}{d_1+d_2}\left(\theta_F(p)+\frac{\dxcell}{d_2}-\thcell \right),
\end{eqnarray*}
which eliminates $x_D$ by expressing it in terms of $x_F$ and $\theta_F$, which are the only remaining functional variables apart from the $b_e$ which weren't in the linear part.

\subsection{Geometrisation}
To eliminate the $b_e$ functions and work entirely in terms of angles, note that
\[ \theta_e(p) = \frac{b_e(x_e(p))}{p}
\quad \Rightarrow \quad 
p\theta_e(p) = b_e(x_e(p)) \]
and the term on the right now looks superficially similar to the $b'_e(x_e(p))$ appearing in the `constant normalised gradient' equation.  Taking the derivative of both sides with respect to $p$,
\begin{eqnarray*}
 \theta_e(p)+p\theta'_e(p) &=& b'_e(x_e(p))x'_e(p) \\ &=& k_e p x'_e(p).
\end{eqnarray*}
Taking care to note that $x'_e$ is a $p$ derivative of $x_e$, not an angle like $x'_n$, this has eliminated the $b_e$ variables.

Including the elimination of $\theta_D$ and $x_D$, the two equations in this part are now
\[ \theta_F(p)+p\theta'_F(p) = k_F p x'_F(p) \]
and
\begin{eqnarray*}
\thcell-\theta_F(p)-p\theta'_F(p) &=& k_D p x'_D(p) \\
 &=& k_D p \left( x'_F(p)+\frac{d_1d_2}{d_1+d_2}\theta'_F(p) \right).
\end{eqnarray*}

\subsection{Solution for $\theta_F(p)$}
$x_F$ and $\theta_F$ are the only functions left and the above are the only two constraints left.  The $x'_F$ terms can be cancelled by taking $k_D$ times the first equation minus $k_F$ times the second one:
\begin{eqnarray*}
 && k_D(\theta_F(p)+p\theta'_F(p)) - k_F(\thcell-\theta_F(p)-p\theta'_F(p)) \\
  &=& k_D k_F p x'_F(p) - k_F k_D p \left( x'_F(p)+\frac{d_1d_2}{d_1+d_2}\theta'_F(p) \right) \\
  &=& - k_F k_D p \frac{d_1d_2}{d_1+d_2}\theta'_F(p),
\end{eqnarray*}  
\begin{eqnarray*}
\Rightarrow \quad
(k_D+k_F)\theta_F(p) - k_F\thcell
  &=& \left(-k_D - k_F - k_F k_D \frac{d_1d_2}{d_1+d_2}\right) p\theta'_F(p), 
\end{eqnarray*}  
which is a first order differential equation for $\theta_F(p)$ and just needs an initial condition $\theta_F(p_0)=\theta_{F0}$.  It is of the form
\[ f'(x)=\frac{A}{x}f(x)+\frac{B}{x}, \]
which has general solution
\[ f(x)=Cx^A-\frac{B}{A}. \]
Here, we put
\begin{eqnarray*}
A &=& \frac{k_D+k_F}{-k_D - k_F - k_F k_D \frac{d_1d_2}{d_1+d_2}} \\
B &=& \frac{- k_F\thcell}{-k_D - k_F - k_F k_D \frac{d_1d_2}{d_1+d_2}}
\end{eqnarray*}  
and $C$ such that 
\[ \theta_F(p_0) = Cp_0^A-\frac{B}{A} = \theta_{F0} 
\quad \Rightarrow \quad 
C = \frac{\theta_{F0}+\frac{B}{A}}{p_0^A} \]
with solution
\[ \theta_F(p)=Cp^A-\frac{B}{A}. \]

\subsection{Solution for $x_F(p)$}
Substituting the formula for $\theta_F$ above into this equation
\[ \theta_F(p)+p\theta'_F(p) = k_F p x'_F(p) \]
gives:
\[ Cp^A-\frac{B}{A} + p(ACp^{A-1}) = (1+A)Cp^A-\frac{B}{A} = k_F p x'_F(p) \]
\[ \Rightarrow \quad x'_F(p) = \frac{(1+A)C}{k_F}p^{A-1}-\frac{B}{Ak_F}\frac1p. \]
With an initial condition $x_F(p_0)=x_{F0}$, this gives the orbit positions as
\[ x_F(p) = \frac{(1+A)C}{Ak_F}p^A-\frac{B}{Ak_F}\ln p 
+ \left( x_{F0} - \frac{(1+A)C}{Ak_F}p_0^A+\frac{B}{Ak_F}\ln p_0 \right). \]

\section{Magnetic Field}
The magnetic field in the F magnet can be found by substituting the explicit formulae for $x_F(p)$ and $\theta_F(p)$ in the previous section into 
\[ b_F(x_F(p)) = p\theta_F(p), \]
however it is doubtful that the function $x_F(p)$ can be inverted to give $b_F$ analytically as a function of $x$, so this `parametric' form should suffice.  A similar thing is possible for the D magnet with more substitutions.

An exceptional case is where $C=0$ and Scott Berg pointed out that $\theta_F$ is constant as in the original scaling FFA.  This gives a logarithmic $x_F(p)$ and an exponential $b_F(x)$: it is the `straight' small-angle limit of the scaling FFA, which is already known to have an exponential field dependence \cite{StraightScaling}.

\section{Note}
I had a previous attempt at deriving a solution for fixed-tune FFAs in \cite{FixedTuneOld} but the equations produced, while in theory solvable mechanically, were so complex I never substituted anything in to them to check.  The assumption of fixed \emph{optics} (via constant normalised gradient) rather than fixed tunes helped a lot here, so hopefully checking these equations will be easier. 

%\begin{thebibliography}{99}   % Use for  10-99  references
\begin{thebibliography}{9} % Use for 1-9 references

\bibitem{ThreeLens} \emph{Three-Lens Lattices for Extending the Energy Range of Non-scaling FFAGs}, S.J.~Brooks, Proc. IPAC 2011, available at \url{https://accelconf.web.cern.ch/IPAC2011/papers/weps086.pdf}

\bibitem{TrbojevicIPAC22} D.~Trbojevic, to be published in Proc. IPAC 2022.

\bibitem{TrbojevicIPAC21} \emph{Permanent Magnets Future Electron Ion Colliders at RHIC and LHeC}, D.~Trbojevic \emph{et al.}, Proc. IPAC 2021, available at \url{https://accelconf.web.cern.ch/ipac2021/papers/tupab028.pdf}

\bibitem{StraightScaling} \emph{Straight Section in Scaling FFAG Accelerator}, JB. Langrange and Y. Mori, Proc. PAC 2009, available at \url{https://accelconf.web.cern.ch/PAC2009/papers/fr5pfp002.pdf}

\bibitem{FixedTuneOld} \emph{Fixing the Tune of Nonscaling FFAGs in the Thin Lens Paraxial Approximation}, S.J.~Brooks (2010), available at \url{https://stephenbrooks.org/ap/report/2010-5/tunefix.pdf}

\end{thebibliography}
 
\end{document}