\preprint{GM2-doc-28011}
\title{Dependence of Momentum Acceptance on Transverse Coordinates}
\author{D. Rubin}
%\input{tex/00_title_and_authors}

\date{\today}% It is always \today, today,
             %  but any date may be explicitly specified

%\input{abstract}

\maketitle % call abstract environment before \maketitle

%\tableofcontents

%% tex these

%\input{xp_vs_E}

\def\xinf{{x_{inf}}}
\def\xpinf{{x^\prime_{inf}}}
\def\rbeta{{\sqrt{\beta}}}
\def\bxpinf{{\overline{x^\prime}_{inf}}}
\def\bthetak{{\overline{\theta_k}}}

%\begin{center}
%{\bf Spin and transverse coordinate correlation in the pion decay channel.}
%\end{center}
\def\xinf{{x_{inf}}}
\def\xpinf{{x^\prime_{inf}}}
\section{Introduction}
Modeling the ring with the continuous quad approximation it can be shown\cite{rubin2747} that the accepted momentum range is given by 
\begin{eqnarray}
-\onehalf\left(A-(x_{inf}  - \bthetak\beta)-\frac{(\bxpinf\beta)^2} {A+ (x_{inf}-\bthetak\beta)}\right)&<& \eta\delta
<\onehalf\left(A+(x_{inf}  - \bthetak\beta)-\frac{(\bxpinf\beta)^2} {A- (x_{inf}-\bthetak\beta)}\right)\label{eq:momentumconstraint}
\end{eqnarray}
where $\bxpinf=\xpinf+\theta_k\cos\phi_k$ and $\bthetak = \theta_k\sin\phi_k$. $\theta_k$ is the change in the angle of the trajectory due to the pulsed kicker
and $\phi_k$ is the betatron phase advance from the injection point (inflector exit) to the effective point of the kick.
%The middle of the range is
%\begin{eqnarray}
%\vev{\eta\delta}&=& \onehalf (x_{inf}-\theta_k\beta)-\onehalf (x^\prime_{inf}\beta)^2\left(\frac{x_{inf}-\theta_k\beta}{A^2-(x_{inf}-\theta_k\beta)^2}\right)\\
%&=& \onehalf(x_{inf}-\theta_k\beta)\left(1 -\frac{(x^\prime_{inf}\beta)^2}{A^2-(x_{inf}-\theta_k\beta)^2}\right)\label{eq:averagecaptured}
%\end{eqnarray}
The dependence of the momentum acceptance on kick angle and transverse displacement are shown in Figure~\ref{fig:acceptance} for the case where the injection angle
$\xpinf=0$, and with the approximation that the width of the kick is less than the revolution period and so applied on a single turn.
\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsKick.pdf}
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsxinf.pdf}
\caption{(left)Momentum acceptance vs kick angle. Minimum and maximum accepted momenta are bounded by the dashed lines. 
The displacement $x_{inf}=77\ {\rm mm}$ (the midpoint of the inflector aperture).
(right)Momentum acceptance vs displacement for kick angle $\theta_k = 10.2\ {\rm mrad}$.
The {\it perfect} kick angle $\theta_k=10.2$ mrad steers the magic momentum particle onto its closed orbit.}
\label{fig:acceptance}
\end{figure}
Figure~\ref{fig:acceptance} (left) shows how the average momentum decreases with increasing kick and (right) that the average accepted momentum increases with
increasing offset.
The dependence of momentum acceptance on offset is reproduced in Figure~\ref{fig:acceptanceboundaries} but here with dashed lines
marking the range of acceptance where there is clearly no correlation with offset at the inflector. We therefore anticipate a weak correlation of momentum acceptance and
offset. 
\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/EnergyVsxinf_bounds.pdf}
\caption{Momentum acceptance vs displacement for kick angle $\theta_k = 10.2\ {\rm mrad}$.
For all momenta bounded by the dashed lines at $\delta=\pm 0.227\%$ there is no correlation with offset in the inflector}
\label{fig:acceptanceboundaries}
\end{figure}
Next imagine that at the inflector exit, the beam is gaussian distributed in transverse position,  with average position at the center of the inflector aperture, all particles
are traveling straight ahead with zero angle, and uniformly distributed in momentum. A uniform kick of 284 G (near ideal) is assumed. 
We use Equation~\ref{eq:momentumconstraint} to generate 
 the captured density
distribution $\rho(x,\delta)$ in terms of the displacement at injection, and the momentum, where we have substituted $x$ for $\xinf$ for clarity. See Figure~\ref{fig:caseI}(left). 
The average displacement as a function of momentum is given by
\begin{equation}
\vev{x(\delta)}=\int x(\delta)\rho(x,\delta)dx\label{eq:avgx}
\end{equation}
In order to extract the dependence of average displacement on momentum, fit a straight line by minimizing
\begin{eqnarray}
\chi^2 &=&\int (x(\delta)- (m_\delta\cdot\delta+b))^2\rho(x,\delta) dx d\delta\nonumber\\
&\rightarrow& \sum_{ij}(x_i-(m_\delta\cdot\delta_j +b))^2 W_{ij} \label{eq:fit}
\end{eqnarray}
Then the linear dependence of displacement on momentum is
\begin{equation}
\der{\vev{\xinf}}{\delta} = m_\delta \label{eq:slopetoder}
\end{equation}
The average displacement as a function of momentum offset is shown in ~\ref{fig:caseI}(right). 
Note that in the momentum range $-0.002<\delta<0.002$, which accounts for the vast majority of captured particles, there is no correlation of displacement with momentum.    
The first order correlation is characterized by $\der{\vev{\xinf}}{\delta} = 0.64\ {\rm m}$.
\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DA_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DA_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset assuming zero inflector exit angle. (Right) average offset as a function of captured momentum and fitted slope
using Equations~\ref{eq:fit} and ~\ref{eq:slopetoder}. The kick is a uniform 284G.}
\label{fig:caseI}
\end{figure}


\subsection{Dependence of momentum acceptance on angle}
The {\it design}
trajectory nominally exits the center of the inflector with zero angle.
But the trajectories comprising the beam at the inflector exit are a distribution of offsets and angles about the design trajectory.
The angle and offset are correlated. The beam is diverging (see Figure~\ref{fig:beta}) so that trajectories with large positive (negative) offset will have
large positive (negative) angle, and more generally, 
\begin{equation}
\der{\xpinf}{\xinf} = \frac{-\alpha_i}{\beta_i}, \label{eq:xoverxp}
\end{equation}
where $\alpha_i$ and $\beta_i$ are the twiss parameters at the inflector exit and we use the Courant-Snyder invariant to relate angle and offset. 
The aceptance defined in Equation~\ref{eq:momentumconstraint} depends on both offset and angle. For illustrative purposes we will 
assume that $\xpinf=-\frac{\alpha_i}{\beta_i}\xinf$
and so we can develop some intuition about dependence of $\xinf,\xpinf$ on stored momentum.
Then ~\ref{eq:momentumconstraint} becomes

\begin{eqnarray}
-\onehalf\left(A-(x_{inf}  - \bthetak\beta)-\frac{((\alpha_i/\beta_i)\xinf\beta)^2} {A+ (x_{inf}-\bthetak\beta)}\right)&<& \eta\delta
<\onehalf\left(A+(x_{inf}  - \bthetak\beta)-\frac{((\alpha_i/\beta_i)\xinf\beta)^2} {A- (x_{inf}-\bthetak\beta)}\right)\label{eq:momentumconstraintnoxp}
\end{eqnarray}

where $\alpha_i = -1.058$ and $\beta_i=3.172\ {\rm m}$ are the twiss parameters\cite{brynn26665-v1} of the injection channel at the inflector exit. 
($\beta=R_0/\sqrt(1-n)$ is the $\beta$-function of the closed ring.)


%\begin{eqnarray*}
%\der{\delta}{\xinf}&=&\frac{1}{2\eta}\left[1-(\bxpinf\beta)^2\left(\frac{1}{A^2-(\xinf-\bthetak\beta)^2}+\frac{2(\xinf-\bthetak\beta)^2}{(A^2-(\xinf-\bthetak\beta)^2)^2}\right)\right]
%\end{eqnarray*}

The captured distribution, determined by Equation~\ref{eq:momentumconstraintnoxp} where again the beam at the inflector exit is gaussian distributed in position, with
uniform momentum distribution and uniform kick is shown in Figure~\ref{fig:case2}(left) and the displacement-momentum correlation in the stored beam in ~\ref{fig:case2}(right)
with value$\der{\vev{\xinf}}{\delta}=0.55\ {\rm m}$. 

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DB_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DB_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset assuming perfect correlation of angle with displacement $\xpinf=-\frac{\alpha_i}{\beta_i}\xinf$. 
(Right) average offset as a function of captured momentum and fitted slope. A kicker field is uniform and set to 284G.}
\label{fig:case2}
\end{figure}


Note that the momentum acceptance depends quadratically on the angle at injection. 
Therefore the linear correlation between spin angle and $x^\prime$ that appears in the injected beam
(see Figure~\ref{fig:phasevsxxp}) cannot contribute to a linear correlation between spin angle and momentum in the stored beam, at least
not in this idealized model.

In Figure~\ref{fig:case3}, we distribute the injected beam temporally according to the measured T0 pulse. The kick is a uniform 284G.  


\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DC_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DC_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit. The standard deviation of the width of the injected beam
is 3mm. $\xinf$ and $\xpinf$ are perfectly correlated. The temporal distribution is based on T0 measurements.
The uniform kicker field is 284G (Right) average offset as a function of captured momentum and fitted slope. }
\label{fig:case3}
\end{figure}

Next consider the effect of a weak kick on the correlation. In Figure~\ref{fig:case6}, 
we distribute the injected beam temporally according to the measured T0 pulse but set the kick field to a uniform 204G.  

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DF_xvsdelta.pdf}
  \includegraphics[width=0.45\linewidth]{figures/2DF_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit. The standard deviation of the width of the injected beam
is 3mm. $\xinf$ and $\xpinf$ are perfectly correlated. The temporal distribution is based on T0 measurements.
The uniform kicker field is 204G (Right) average offset as a function of captured momentum and fitted slope. }
\label{fig:case6}
\end{figure}



We find that the correlation of displacement and momentum in the stored beam is on the order of $\der{\vev{\xinf}}{\delta}\sim 0.6 \ {\rm m}$ independent of details,
and that the correlation increases with kicker strength.

\subsection{Tracking Simulation}
Finally we can perform a tracking simulation to determine the correlation of displacement (and angle) at the inflector exit with momentum in the stored beam without
the simplifications required of the analytic model.
We track a distribution throught the injection channel and into the ring. Particles that circulate for at least 4 $\mu$s are 'captured'. For each particle that is captured we
note its momentum as well as its displacement and angle at the inflector exit generating density functions $\rho_x(x,\delta)$ and 
$\rho^\prime(x^\prime,\delta)$. The two-dimensional histogram of the density function 
is shown in Figure ~\ref{fig:case4x}(left). For this particular simulation the peak kicker field is set to 204G.
The temporal distribution of the
injected beam and the time dependence of the kicker pulse used to generate the density functions in Figure~\ref{fig:case4} are shown in the Appendix in Figure~\ref{fig:t0kickpulse}.
The weighted average of the displacement $<\xinf(\delta)>$, and the fitted slope is shown in Figure~\ref{fig:case4x}(right). 
The corresponding histograms and weighted average of angle $\vev{\xpinf(\delta)}$ versus momentum are shown in Figures~\ref{fig:case4xp}.
We find $\der{\vev{\xpinf}}{\delta} < 0.2\ {\rm rad}$. 


\begin{figure}[h]
\centering
\begin{subfigure}{0.9\textwidth}
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_xvsdelta.png}
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_fit.pdf}
 \caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit. $\vev{\xinf(\delta)}$ at right.
The fitted slope is determined using Equations~\ref{eq:fit} and ~\ref{eq:slopetoder}. }
\label{fig:case4x}
\end{subfigure}
\begin{subfigure}{0.9\textwidth}
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_xpvsdelta.png}
  \includegraphics[width=0.45\linewidth]{figures/2DD_sim_xp_fit.pdf}
  \caption{(left) Number of captured particles as a function of momentum and angle at the inflector exit. $\vev{\xpinf(\delta}$ and the fitted
slope determined using ~\ref{eq:fit} with $x^\prime$ substituted for $x$.}
\label{fig:case4xp}
\end{subfigure}
\caption{The captured distributions are generated assuming
peak kicker field  close to the Run I value of $\sim$204G, and 
temporal distribution of the
injected beam and the time dependence of the kicker pulse as shown in the Appendix in Figure~\ref{fig:t0kickpulse}.
}
\label{fig:case4x}
\end{figure}

To understand how the dependence of the density functions of the captured particles depends on peak kicker field, a simulation was performed
using a peak kicker field of 284G, close to the value reached in Run III. The density functions and fits are shown in Figure~\ref{fig:case5}. 
We find that the correlation of $\vev{\xinf(\delta)}$ and $\vev{\xpinf}$ with momentum increases with kicker field.



\begin{figure}[h]
\centering
\begin{subfigure}{0.9\textwidth}
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xvsdelta.png}
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_fit.pdf}
\caption{(left)Number of captured particles as a function of momentum and offset at the inflector exit. $\vev{\xinf(\delta)}$ at right.
The fitted slope is determined using Equations~\ref{eq:fit} and ~\ref{eq:slopetoder}. }
\label{fig:case5x}
\end{subfigure}
\begin{subfigure}{0.9\textwidth}
\centering
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xpvsdelta.png}
  \includegraphics[width=0.45\linewidth]{figures/2DE_sim_xp_fit.pdf}
\caption{(left) Number of captured particles as a function of momentum and angle at the inflector exit. $\vev{\xpinf(\delta)}$ and the fitted
slope determined using ~\ref{eq:fit} with $x^\prime$ substituted for $x$.}
\label{fig:case5xp}
\end{subfigure}
\caption{The captured distributions are generated assuming
peak kick field close to the Run III value of $\sim$284G and 
temporal distribution of the
injected beam and the time dependence of the kicker pulse as shown in the Appendix in Figure~\ref{fig:t0kickpulse}. }
\label{fig:case5}
\end{figure}






%\begin{eqnarray*}
%\epsilon&=& \gamma_i x^2 -2\alpha_i x\xp +\beta_i {\xp}^2\\
%\rightarrow\xp&=& \frac{2\alpha_i x\pm \sqrt{(2\alpha_i x)^2-4\beta_i(\gamma_i x^2-\epsilon)} }{2\beta_i}\\
%&=& \frac{\alpha_i x\pm\sqrt{(\alpha_i x)^2-\beta_i(\gamma_i x^2-\epsilon)} }{\beta_i}\\
%&=& \frac{\alpha_i x\pm \sqrt{\beta_i\epsilon- x^2 }}{\beta_i}
%\end{eqnarray*}
%where in that last step we use $\beta_i\gamma_i=\alpha_i^2+1$ and $\beta_i,\gamma_i,\alpha_i$ are the twiss parameters at the exit of the inflector
%so that $\xp\rightarrow\xpinf$ and $x\rightarrow\xinf-x_0$ and
%$x_0$ is the coordinate at the center of inflector $x_0=77$ mm. $\epsilon$ is an invariant emitance.
%Then
%\begin{eqnarray*}
%\der{\xpinf}{\xinf}&=& -\frac{\alpha_i}{\beta_i} \mp\frac{(\xinf-x_0)}{\beta_i\sqrt{\beta_i\epsilon-(\xinf-x_0)^2}}\\
%\end{eqnarray*}
%The 'invariant amplitude' is very roughly gaussian distributed.
%\begin{figure}
%\centering
%  \includegraphics[width=0.75\linewidth]{figures/phase_space_inf_exit.pdf}
%\caption{Horizontal phase space at inflector exit and superimposed ellipse}
%\label{fig:phasespace}
%\end{figure}
 
\begin{comment}
\subsection{Correlation of momentum acceptance and displacement $\xinf$}
Substituting for $\xpinf$ in terms of $\xinf$ as given by Equation~\ref{eq:xxpinf} into Equation~\ref{eq:averagecaptured}, 
gives the momentum acceptance in terms of the kick $\bthetak$ as well as 
the displacement ($\xinf$) as shown in Figure~\ref{fig:ddelta_dx}(left).
Substituting into Equation~\ref{eq:ddelta}, 
gives the differential of the momentum acceptance in terms of displacement $\xinf$  and kick. (see Figure~\ref{fig:ddelta_dx}(right)). 
\begin{eqnarray}
\der{\delta}{\xinf}&=&\frac{1}{2\eta}\left[1-(B(\xinf-x_0)\beta)^2\left(\frac{1}{A^2-(\xinf-\bthetak\beta)^2}+\frac{2(\xinf-\bthetak\beta)^2}{(A^2-(\xinf-\bthetak\beta)^2)^2}\right)
-2B^2\beta^2(\xinf-x_0)\frac{\xinf-\bthetak\beta}{A^2-(\xinf-\bthetak\beta)^2}\right]\nonumber\\
&=&\frac{1}{2\eta}\left[1-\frac{\beta^2 B^2(\xinf-x_0)}{A^2-(\xinf-\bthetak\beta)^2}\left((\xinf-x_0)\left(1+\frac{2(\xinf-\bthetak\beta)^2}{A^2-(\xinf-\bthetak\beta)^2}\right)
-2(\xinf-\bthetak\beta)\right)\right]
\end{eqnarray}


\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/delta_vs_x.pdf}
  \includegraphics[width=0.45\linewidth]{figures/ddelta_dx.pdf}
\caption{(left)Momentum acceptance vs displacement at the inflector exit for various kick angles. 
(right) $d\delta/dx_{inf}$ versus $\xinf$ for various kick angles $\theta_k$.
The {\it perfect} kick angle $\theta_k=10.2$ mrad steers the magic momentum particle onto its closed orbit.}
\label{fig:ddelta_dx}
\end{figure}
\end{comment}


\subsection{Early to Late}
Now we combine our results with Equation ~\ref{eq:derivchain}  
to estimate the shift in $\omega_a$ due to the spin- transverse coordinate correlation.
$\der{\vev{\phi_a}}{\xinf}\ \ {\rm and}\ \ \der{\vev{\phi_a}}{\xpinf}$ are given in Equations~\ref{eq:phiinf}.
The time dependence of the average beam energy
$$\der{\vev{\gamma}}{t}\sim\sim \frac{\sigma^2}{\mu^2\tau} \sim 5.6\times 10^{-7}\frac{1}{\mu s}$$
where $\mu$ and $\sigma$ are the width and mean of the stored momentum distribution and $\tau$ is the rest frame muon lifetime.
Using $\delta = \frac{p-p_0}{p_0}\sim \frac{\gamma-\gamma_0}{\gamma_0}$, then $\der{\delta}{\gamma}=\frac{1}{\gamma_0}$, Equation~\ref{eq:derivchain}
becomes 
\begin{eqnarray}
\vev{\Delta \omega_a}
&=&\left(\der{\vev{\phi_a}}{x}\der{\vev{x}}{\delta}+\der{\vev{\phi_a}}{x^\prime}\der{\vev{x^\prime}}{\delta}\right)\frac{1}{\gamma}\der{\vev{\gamma}}{t}\label{eq:derivchaindelta}\\
&=& \left(\der{\vev{x}}{\delta}(-0.98\ \frac{\rm rad}{\rm m}) +\der{\vev{x^\prime}}{\delta} 0.77 \right) \frac{1}{29.3} 5.6\times 10^{-7}\frac{1}{\mu s}
= \left(\der{\vev{x}}{\delta}(-0.98\ \frac{\rm rad}{\rm m}) +\der{\vev{x^\prime}}{\delta} 0.77 \right)1.9\times 10^{-8}\frac{1}{\mu s}\\
\frac{\Delta\omega_a}{\omega_a}&=&\left(\der{\vev{x}}{\delta}(-0.98\ \frac{\rm rad}{\rm m}) +\der{\vev{x^\prime}}{\delta} 0.77 \right)1.3\times 10^{-8}\\
\end{eqnarray}
where $\omega_a = \frac{\gamma}{\gamma^2-1}\omega_c = 1.44 {\rm rad}/\mu{\rm s}$.
As noted above we find that $0.021<|\der{\vev{\xinf}}{\delta}| < 0.7$ m, and $0.053 <|\der{\vev{\xpinf}}{\delta}|<0.2$. 
Because displacement and angle are correlated, we likely overestimate $\Delta\omega_a$ by simply summing the absolute values of their contributions.
Then 
\begin{eqnarray*}
\frac{\Delta\omega_a}{\omega_a}&<&\left(|\der{\vev{x}}{\delta}(-0.98)|\ \frac{\rm rad}{\rm m}) + |\der{\vev{x^\prime}}{\delta} 0.77| \right)1.3\times 10^{-8}\\
&<& (0.69 + 0.15)\times 1.3\times 10^{-8} = 10.9\ {\rm  ppb}
\end{eqnarray*}

\begin{comment}
The average shift in $\omega_a$ 
\begin{equation}
\vev{\Delta\omega_a}=\der{\vev{\phi_a}}{\gamma}\der{\vev{\gamma}}{t}=\der{\vev{\phi_a}}{\xinf}\der{\xinf}{\gamma}\der{\vev{\gamma}}{t}\label{eq:domega}
\end{equation}
and
\begin{eqnarray*}
\der{\vev{\phi_a}}{x_{inf}}&=&\left(\der{\vev{\phi_a}}{x_{M5}}\right)\left(\der{x_{M5}}{x_{inf}}\right)\\
&=&(-0.25\ {\rm mrad/mm})\times(\frac{1}{-0.1057}) = 2.37\ {\rm mrad/mm}
\end{eqnarray*}

~\ref{eq:domega} becomes
\begin{eqnarray*}
\vev{\Delta\omega_a}&=&\der{\vev{\phi_a}}{\xinf}\der{\xinf}{\delta}\der{\delta}{\gamma}\der{\vev{\gamma}}{t}\\
&=& \left(2.37\ {\rm mrad/mm}\right)\der{\xinf}{\delta}\frac{1}{\gamma}\der{\vev{\gamma}}{t}
\end{eqnarray*}
The rate of change of the average energy in the stored beam $\der{\vev{\gamma}}{t}$ depends on the initial distribution. Assuming that the 
energy distribution in E989 is the same as in 
E821, we use the result from Equation 15 in Crnkovic\cite{crnkovic:IPAC2016-TUPMR028}. Namely
$$\der{\vev{\gamma}}{t}\sim \frac{\sigma^2}{\mu^2\tau} \sim 5.6\times 10^{-7}\frac{1}{\mu s}$$
where $\mu$ and $\sigma$ are the width and mean of the stored momentum distribution and $\tau$ is the rest frame muon lifetime.
Then
\begin{eqnarray*}
\Delta \omega &=& \left(2.37\ {\rm mrad/mm}\right)\left(\der{\xinf}{\delta}[{\rm mm}]\right)\frac{5.6\times 10^{-7}}{29.3}\frac{1}{\mu s}\\
&=& 0.45\times 10^{-7}\frac{\rm mrad}{\mu s-{\rm mm}}\left(\der{\xinf}{\delta}[{\rm mm}]\right)
\end{eqnarray*}
The fractional shifts in $\omega_a$ as a function of $\xinf$ for minimum, optimum, and maximum kicks are shown in Figure~\ref{fig:delta_omega}.
\end{comment}

\begin{comment}
\begin{figure}[h]
\centering
  \includegraphics[width=0.55\linewidth]{figures/delta_omega.pdf}
\caption{Dependence of $\Delta \omega_a/\omega_a$ on $\xinf$ and kick angle $\theta_k$}
\label{fig:delta_omega}
\end{figure}

\begin{figure}[h]
\centering
  \includegraphics[width=0.45\linewidth]{figures/phasespaceM5.pdf}
  \includegraphics[width=0.45\linewidth]{figures/phasespaceINF.pdf}
\caption{$x$ -$\xp$ correlation at the end of M5 (left) and at the inflector exit (right).}
\label{fig:phasespaceM5}
\end{figure}
\end{comment}
\newpage
\section{Appendix}
\label{sec:appendix}
In the BMAD model, the injection channel extends from 3mm upstread of IBMS1\cite{brynn26665-v1} to the downstream end of the inflector. The BMAD model is based on field maps of the residual field in the hole through the backleg iron,
the, dipole fringe field and the superposed inflector field. The inflector is rotated clockwise about its downstream end by 2 mrad. The 2X2 transfer matrix is defined according to
\begin{equation}
\begin{pmatrix}x\cr x^\prime\end{pmatrix}_{End} = T\begin{pmatrix}x\cr x^\prime\end{pmatrix}_{Start}
\end{equation}
where $x$ and $x^\prime$ are offset and angle with respect to the 'design' trajetory. The pathlength of the design trajectory, from 3mm upstream of IBMS1 to the
inflector exit is 4.4 m.
The 2X2 transfer matrix, computed with BMAD, for the injection channel is 
\begin{equation}
 T=\begin{pmatrix}  2.4167 & 8.0280\ {\rm m}\cr  0.9970\ {\rm m^{-1}} &  3.7256\end{pmatrix}
\end{equation}
The derivatives $\der{\vev{\phi_a}}{x}$ and $\der{\vev{phi_a}}{x^\prime}$ are evaluated at the end point of the simulation, namely the inflector exit. 

The twiss parameters at the endpoint are used to compute the derivatives in Equation~\ref{eq:xoverxp}.
We assume the measured twiss parameters\cite{brynn26665-v1} 10cm upstream of IBMS1 and propagate to endpoints A or B as needed. 
For reference, the $\beta$-function from the last quad in the M5 line (Q025) through the injecton channel is
shown in Figure~\ref{fig:beta}. 
\begin{figure}[h]
\centering
\begin{minipage}{0.5\textwidth}
\centering
  \includegraphics[width=0.8\linewidth]{figures/injection_line_twiss.pdf}
\caption{$\beta$-function from the end of Q025 (last quad in M5 line) to inflector exit.}
\label{fig:beta}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=0.8\linewidth]{figures/InjectionKickerPulses.pdf}
\caption{Temporal distribution of injected distribution and time dependence of the kicker pulse used in the simulation}
\label{fig:t0kickpulse}
\end{minipage}
\end{figure}

