\begin{flushright}
D. Rubin\\
February 22, 2018
\end{flushright}
\begin{center}
{\bf Injection Dependencies}
\end{center}
\section*{Energy vs kicker field}
In the interest of developing our intuition it may be useful to write an analytic expression for the CBO amplitude in terms of the injection parameters,
angle, offset, kick field, and momentum. 

The displacement of the particle trajectory from the magic radius at the inflector exit is $x_{inf} = 77$mm. The trajectory has a betatron component and a off momentum 
component and
\begin{eqnarray}
x_{inf} &=&  x_{\beta 0} + x_{\delta 0} \nonumber\\
 &=&  x_{\beta 0} + \eta \delta \label{eq:xinf}
\end{eqnarray}
where $\eta$ is the dispersion function.  $\delta$ is the fractional momentum offset.
For a given $\delta$, we know $x_{\beta 0} = x_{inf}-\eta(0)\delta$. $\eta(0)$ is the dispersion at the inflector exit $s=0$.
Then the particle propagates around the ring according to 
\begin{eqnarray*}
x(s) &=& x_{\beta 0}\sqrt{\frac{\beta(s)}{\beta(0)}}\cos(\phi(s)) + \eta(s)\delta 
\end{eqnarray*}
The particle executes betatron oscillations about the off momentum orbit.

Next model the 3 kickers as a single kick at $\phi(s) = \pi/2$ (see Figure ~\ref{f:trajectory}). The kick changes the trajectory according to
$$\Delta x(s) = k\sqrt{\beta_{kick}\beta(s)}\sin(\phi(s)-\pi/2),$$ where $k$ is the kick angle. 

\begin{figure}[tb]
\begin{center}
        \includegraphics*[width=0.7\textwidth,angle=0]{plot_traj.pdf}
\caption[Injection trajectory]
{The beam exiting the inflector at zero angle ($\theta_{inj}=0$ crosses the magic radius midway through the kickers. The tajectories
with negative and positive angle cross the magic radius early and late respectively }

\label{f:trajectory}
\end{center}
\end{figure}
Beyond the kicker the trajectory is
\begin{eqnarray*}
x(s)&=& x(s) + \Delta x(s) \\ 
x(s) &=& x_{\beta 0}\sqrt{\frac{\beta(s)}{\beta(0)}}\cos(\phi(s)) + \eta(s))\delta +k\sqrt{\beta_{kick}\beta(s)}\sin(\phi(s)-\pi/2)\\
&=& x_{\beta 0}\sqrt{\frac{\beta(s)}{\beta(0)}}\cos(\phi(s)) + \eta(s))\delta - k\sqrt{\beta_{kick}\beta(s)}\cos(\phi(s))
\end{eqnarray*}
Now let's assume that $\beta(s) = \beta_0$ and $\eta(s) = \eta_0$, a good approximation in the weakly focusing optics so that
\begin{eqnarray*}
x(s)
&=& x_{\beta 0}\cos(\phi(s)) + \eta_0\delta - k\beta_0\cos(\phi(s))
\end{eqnarray*}
Substituting equation \ref{eq:xinf} leads to
\begin{eqnarray*}
x(s)
&=& (x_{inf}-\delta\eta_0)\cos(\phi(s)) + \eta_0\delta - k\beta_0\cos(\phi(s))\\
&=& (x_{inf}-\delta\eta_0-k\beta_0)\cos(\phi(s)) + \eta_0\delta
\end{eqnarray*} 
If $\delta =0$ then the kick $k=x_{inf}/\beta_0$ is the ideal. If $x_{inf}-\delta\eta_0-k\beta_0 > 0$, that is if the kick angle $k$ is
insufficient to steer the particle onto the appropriate dispersive orbit,  then
the minimum(maximum) displacement occurs when $\mp\cos(\phi)=1$. Then 
\begin{eqnarray*}
x_{min} &=& x_{inf}-k\beta_0\\
x_{max} &=& -x_{inf}+k\beta_0 + 2\eta_0\delta
\end{eqnarray*}
Note that the minimum displacement is independent of the momentum. The maximum increases with momentum offset. 
\section*{Inflector angle}
What if the particle exits the inflector with some angle $x^\prime_{inf}$? Then before it reaches the kicker
$$x(s) = x_{\beta 0}\cos\phi(s) + x^\prime_{inf}\beta_0\sin\phi(s) + \eta_0\delta$$
and after the kicker
\begin{eqnarray*}
x(s)
&=& (x_{inf}-\delta\eta_0)\cos(\phi(s)) + \eta_0\delta - k\beta_0\cos(\phi(s)) + x^\prime_{inf}\beta_0\sin\phi(s)\\
&=& (x_{inf}-\delta\eta_0-k\beta_0)\cos(\phi(s)) + \eta_0\delta + x^\prime_{inf}\beta_0\sin\phi(s) \\
&=& (x_{inf}-\delta\eta_0-k\beta_0)\cos(\phi(s)) + \eta_0\delta + x^\prime_{inf}\beta_0\sin\phi(s) \\
&=&A\cos(\phi(s)+\phi_0)+\eta_0\delta
\end{eqnarray*}
where 
\begin{equation}
A = \pm\sqrt{(x_{inf}-\delta\eta_0-k\beta_0)^2+(x^\prime_{inf}\beta_0)^2}\label{eq:envelope}
\end{equation} and
\begin{equation}
\tan\phi_0 =\frac{x_{inf}-\delta\eta_0-k\beta_0}{x^\prime_{inf}\beta_0}\label{eq:phase}
\end{equation}
The extremes of displacement are $$x_{ext} = A+\eta_0\delta$$
\begin{comment}
We saw earlier that if $x^\prime_{inf}=0$ that the maximum displacement is independent of the momentum offset $delta$.
Another way to show the relationship is to plot capture energy vs kick.
But having introduced finite $x^\prime_{inf}$ we find the dependence shown in Figure %~\ref{fig:d_dep_with_angle}
\begin{eqnarray*}
A &=& x_{col}-\eta_0\delta\\
A^2&=& (x_{col}-\eta_0\delta)^2\\
(x_{inf}-\delta\eta_0-k\beta_0) &= &\left[(x_{col}-\eta_0\delta)^2-(x^\prime_{inf}\beta_0)^2\right]\\
(x_{inf}-k\beta_0)^2+(\delta\eta_0)^2 -2(x_{inf}-k\beta_0)(\eta_0\delta) &=& x_{col}^2-2x_{col}\eta_0\delta+(\eta_0\delta)^2 -(x^\prime_{inf}\beta_0)^2 \\
(x_{inf}-k\beta_0)^2 -2(x_{inf}-k\beta_0)(\eta_0\delta) &=& x_{col}^2-2x_{col}\eta_0\delta -x^\prime_{inf}\beta_0)^2 \\
(\eta_0\delta)(-2(x_{inf}-k\beta_0)+2x_{col})&=&x_{col}^2 -(x^\prime_{inf}\beta_0)^2-(x_{inf}-k\beta_0)^2 \\
\delta&=&\frac{x_{col}^2 -(x^\prime_{inf}\beta_0)^2-(x_{inf}-k\beta_0)^2}{2\eta_0(-(x_{inf}-k\beta_0)+x_{col})} \\
\end{eqnarray*}
If $x^\prime_{inf}=0$ then 
\begin{eqnarray*}
\delta&=&\frac{x_{col}^2 -(x_{inf}-k\beta_0)^2}{2\eta_0(-(x_{inf}-k\beta_0)+x_{col})} \\
\delta&=&\frac{x_{col} +(x_{inf}-k\beta_0)}{2\eta_0} \\
\end{eqnarray*}
\end{comment}

The envelope of the trajectory as a function of momentum offset, for various injection angles and kicker strenghs is shown in Figures \ref{f:EA12} and ~\ref{f:EA34}.
Note that the envelope boundaries are symmetric in the inflector exit angle $x^\prime_{inf}$ (see Equation ~\ref{eq:envelope}). It is evident that nonzero $x^\prime_{inf}$ increases CBO amplitude and asymmetrically decreases the 
momentum acceptance.

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=tru]{fig/EnergyAcceptance0.pdf}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance1.pdf}
%\includepdf[width=0.45\textwidth,trim= 0mm 0mm 0 0mm, clip=true, pages={2}]{EnergyAcceptance.pdf}
\caption{ The boundaries of the envelope of betatron oscillations is shown for $x^\prime_{inf}=0, 3$mrad, and 6mrad
as a function of fractional momentum error for a (a) 6mrad kick and (b) an 8mrad kick.
The boundaries (top and bottom) correspond to the edge of the collimators. With a 6mrad kick (a), and zero injection angle, trajectories with $-0.0006 < \Delta p/p < 0.0025$
remain within the aperture defined by the collimators. The energy acceptance decreases with increasing $x^\prime_{inf}$. If $x^\prime_{inf}>6$ mrad no particles are stored. With an 8mrad kick (b)
the momentum acceptance increases for $x^\prime_{inf}=0$ and $x^\prime_{inf}=3$ mrad, but the $x^\prime_{inf}=6$mrad remains outside the aperture. }
\label{f:EA12}
\end{center}
\end{figure}

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=tru]{fig/EnergyAcceptance2.pdf}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance3.pdf}
%\includepdf[width=0.45\textwidth,trim= 0mm 0mm 0 0mm, clip=true, pages={2}]{EnergyAcceptance.pdf}
\caption{ The boundaries of the envelope of betatron oscillations is shown for $x^\prime_{inf}=0, 3$mrad, and 6mrad
as a function of fractional momentum error for a (a) 10 mrad kick and (b) an 10.8 mrad kick.
The boundaries (top and bottom) correspond to the edge of the collimators. With a 10.8 mrad kick (b), the amplitude of oscillations for the on momentum trajectory is zero and the upper and lower boundaries intersect. The momentum acceptance is
symmetric about zero. However for nonzero injection angle, the envelope increases, and the energy aperture shrinks. For any nonzero angle, (or sub nominal kick) the momentum aperture is skewed positive.}
\label{f:EA34}
\end{center}
\end{figure}

We can determine the inflector exit angle $x^\prime_{inf}$ by measuring the average momentum of stored muons by fast rotation analysis as a function of inflector B-field. The minimum momentum
corresponds to $x^\prime_{inf}=0$.
\newpage
We can also learn something about the injection angle from the phase of the betatron oscillation (Equation ~\ref{eq:phase}) as shown in Figures ~\ref{f:EA56}-~\ref{f:EA78}.
\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=tru]{fig/EnergyAcceptance4.pdf}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance5.pdf}
%\includepdf[width=0.45\textwidth,trim= 0mm 0mm 0 0mm, clip=true, pages={2}]{EnergyAcceptance.pdf}
\caption{ The phase of the betatron oscillation bounded by the envelope in Fig. ~\ref{f:EA12}, with respect to the injection point for (a) 6 mrad kick and (b) an 8 mrad kick.
For small injection angles (0 mrad and 3 mrad) the phase is positive for all momenta. As the kick angle is increased the phase for the on momentum trajectories
approaches zero.}
\label{f:EA56}
\end{center}
\end{figure}

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=tru]{fig/EnergyAcceptance6.pdf}
\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance7.pdf}
%\includepdf[width=0.45\textwidth,trim= 0mm 0mm 0 0mm, clip=true, pages={2}]{EnergyAcceptance.pdf}
\caption{ The phase of the betatron oscillation bounded by the envelope in Fig. ~\ref{f:EA34}, with respect to the injection point for (a) 10 mrad kick and (b) an 10.8 mrad kick.
For (a) the 10 mrad kick, the phase crossover approaches zero momentum from above and for nominal kick (b), the crossover is at zero.
}

\label{f:EA78}
\end{center}
\end{figure}


For suboptimal kick, the phase is at a maximum for zero kick angle. The injection angle $x^\prime_{inf}=0$ at the inflector field that maximizes phase.
 
{\bf Simulation}\\
Dependence of muon capture, CBO amplitude and average momentum of stored beam on kicker field are shown below, Figures ~\ref{f:capture}-\ref{f:momentumacceptance}. Muon distribution at end of M5 line is from Diktys. Simulation assumes measured kicker pulse shape from A. Keshavarzi.  

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_capture.pdf}
\caption{ Number of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{f:capture}
\end{center}
\end{figure}


\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_CBO.pdf}
%\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance3.pdf}
\caption{ CBO amplitude of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{f:CBO}
\end{center}
\end{figure}

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_momentum.pdf}
%\includegraphics[width=0.45\textwidth, trim= 0mm 50mm 0mm 50mm, clip=true]{fig/EnergyAcceptance3.pdf}
\caption{Average momentum of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{f:momentumacceptance}
\end{center}
\end{figure}

Note that the above simulations assume the measured pulse shape that includes the reflections and secondary pulse. The simulations below
Figures ~\ref{fig:capideal} -\ref{fig:momacceptideal}
assume an {\it ideal} kicker pulse. The trends are very similar. XS 

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_IdealKickerPulse0.pdf}
\caption{ Number of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{fig:capideal}
\end{center}
\end{figure}


\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_IdealKickerPulse1.pdf}
\caption{ CBO amplitude of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{fig:CBO_ideal}
\end{center}
\end{figure}

\begin{figure}[htbp]  % Fig 5
\begin{center}
\includegraphics[width=0.8\textwidth, trim= 0mm 0mm 0mm 0mm, clip=true]{fig/Vparam_IdealKickerPulse2.pdf}
\caption{Average momentum of muons captured vs kicker field for inflector angles $\pm 3,0$mrad.  
}
\label{fig:momacceptideal}
\end{center}
\end{figure}
 
