\section{\label{sec:optics} Storage Ring Optics}
\textcolor{orange}{Martin}
\medskip

\textcolor{red}{\textit{We need to define the basic beam dynamics quantities of interest! This section seems like a reasonable place to do it. It would also be nice to have some clear definition and or derivation of the field index ($n$).}}
In the linear model of small betatron oscillations (simple harmonic motion) with dipole and quadrupole fields, one has
\begin{equation}
	\delta\left(s\right)\equiv\frac{p-\pmagic}{\pmagic}
	\label{eq:delta_def}.
\end{equation}
\begin{equation}
	\eta_{x}\left(s\right)\equiv\frac{dx}{d\delta}\approx\frac{\rmagic}{1-n}
	\label{eq:delta_def}.
\end{equation}
\begin{equation}
	x_{e}\left(s\right)=\eta_{x}\left(s\right)\delta\left(s\right)
	\label{eq:x_equil}.
\end{equation}
\begin{align}
	&x\left(s\right)=x_{e}\left(s\right)+\sqrt{\epsilon_{x}\beta_{x}\left(s\right)}\cos\left[\nu_{x}\phi\left(s\right)+\phi_{x}^{0}\left(s\right)\right],\nonumber\\
	&x'\left(s\right)\equiv\frac{dx}{ds}.
	\label{eq:x_and_xp_def} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
\begin{align}
	&y\left(s\right)=\sqrt{\epsilon_{y}\beta_{y}\left(s\right)}\cos\left[\nu_{y}\phi\left(s\right)+\phi_{y}^{0}\left(s\right)\right],\nonumber\\
	&y'\left(s\right)\equiv\frac{dy}{ds}.
	\label{eq:y_and_yp_def} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}

Figure~\ref{fig:tuneplane} shows horizontal and vertical tunes along the voltage contour. The $\beta$ and $\eta$ functions for quad voltage of \SI{20.4}{\kilo\volt} are shown in Fig.~\ref{fig:twissplot}. \textcolor{red}{\textit{Someone should say something about the dependence of Twiss parameters on $V_{\textnormal{quad}}$, see Fig.~\ref{fig:twissvsv}.}}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig07.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig07.pdf}
	\caption{\textcolor{orange}{David R.} Dependence of tune on quadrupole voltage computed with a Bmad based model of the guide field. Resonance lines are shown. Typical operating point is \SI{20.4}{\kilo\volt} (red dot). \textcolor{red}{\textit{Change red point to \SI{18.3}{\kilo\volt}; update black points with \runtwo~fiber harp data; remove timestamp and directory info.}}}\label{fig:tuneplane}
\end{figure}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig08.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig08.pdf}
	\caption{\textcolor{orange}{David R. and David T.} Twiss parameters in the closed storage ring. \textcolor{red}{\textit{Harmonize notation; remove timestamp and directory info.}}}\label{fig:twissplot}
\end{figure}

The dependencies of the optical functions of the ring on the quadrupole system high voltage are shown in Figure~\ref{fig:twissvsv}.
\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig09.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig09.pdf}
	\caption{\textcolor{orange}{Mike and David T.} Dependence of horizontal and vertical amplitude functions and horizontal dispersion function on the electrostatic quadrupole system high voltage. The values are for one point in the ring, namely at the entrance to the ring at the end of the inflector.}\label{fig:twissvsv}
\end{figure}

The quadrupole field is superimposed on the main dipole field. The reference trajectory through the quadrupoles has significant curvature and the quadrupoles share that curvature. As a result, the quadrupole field is necessarily nonlinear, with a significant sextupole term. An effect of this and other nonlinearities associated with the geometry of the quad electrodes is an amplitude dependence of the tunes. The tune shifts associated with the various quad multipoles~\cite{Semertzidis:2003zs} are shown in Fig.~\ref{fig:tuneshift}. Figure~\ref{fig:2dtuneshift} shows that the magnetic field imperfections also lead to amplitude-dependent tune shifts. The magnetic field \textcolor{red}{\textit{Someone should say something about the tune dependence on momentum and chromaticity dependence on quadrupole voltage, see Figs.~\ref{fig:tunedepp} and~\ref{fig:chromat}.}} The nonlinearities of the electrostatic quadrupoles, as well as residual magnetic multipoles~\cite{Grange:2015fou} can drive resonances (see Fig.~\ref{fig:tuneplane}). Operation near resonances is avoided to mitigate losses. A tune scan that extends over the operating region is shown in Fig.~\ref{fig:quadscan}. The storage fraction is measured as quadrupole voltage is increased from \SI{18}{\kilo\volt} to \SI{23}{\kilo\volt}. The degraded storage fractions evident at \SI{18.8}{\kilo\volt} and \SI{21.2}{\kilo\volt} correspond to the $3\nu_x=1$ and $\nu_x+3\nu_y=2$ resonances.

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig10.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig10.pdf}
	\caption{\textcolor{orange}{David R.} Simulated contribution to amplitude dependent tune shift from each of the quad multipoles, their sum, and the decoherence rate $\Gamma$ as determined by tracking. \textcolor{red}{\textit{Harmonize notation; remove timestamp and directory info.}}}\label{fig:tuneshift}
\end{figure}

\begin{figure*}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=1.95\columnwidth]{fig11.png}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=1.95\columnwidth]{fig11.png}
	\caption{\textcolor{orange}{David T.} Amplitude-dependent tune shifts ($\delta=\left.p_{x}\middle/\pmagic\right.=\left.p_{y}\middle/\pmagic\right.=0$) within the storage region ($r\leq\SI{45}{\milli\meter}$) for an ideal magnetic field. \textcolor{red}{\textit{Harmonize notation.}}}\label{fig:2dtuneshift}
\end{figure*}

Figure~\ref{fig:tunedepp} indicates the horizontal and vertical betatron tune shifts from nominal values due to deviations in momentum from the central value. For this figure the central tunes would be $\nu_x$ = 0.945 and $\nu_y$ = 0.329 for a nominal quadrupole high voltage of 18.3 kV.

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig12.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig12.pdf}
	\caption{\textcolor{orange}{Mike and David T.} Dependence of zero-amplitude horizontal and vertical betatron tunes from their design values as functions of relative momentum deviation, for a quadrupole system high voltage of 18.3 kV. \textcolor{red}{\textit{Define the dashed lines.}}}\label{fig:tunedepp}
\end{figure}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig13.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig13.pdf}
	\caption{\textcolor{orange}{David T.} Chromaticity dependence on quadrupole voltage. \textcolor{red}{\textit{Harmonize notation; is this chromaticity or relative chromaticity; needs legend; readable font size.}}}\label{fig:chromat}
\end{figure}

\begin{figure}[]
	\centering
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig14a}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig14a}
		\caption{}\label{fig:20180210quadscan}
	\end{subfigure}
	%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc (or a blank line to force the subfigure onto a new line).
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig14b}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig14b}
		\caption{}\label{fig:20180324quadscan}
	\end{subfigure}
	\caption{\textcolor{orange}{Sudeshna} Relative number of decay positrons in a fill as a function of quadrupole voltage. Storage efficiency is degraded by betatron resonances at 18.8 and \SI{21.2}{\kilo\volt}. \textcolor{red}{\textit{Harmonize notation; update with \runtwo~calo data; do we need to compare to \runone~data.}}}\label{fig:quadscan}
\end{figure}

The guide field is characterized by measurements of closed orbit, tunes, and modulation of the beam width and centroid. Measurements of the tunes with the fiber harps are shown in Fig.~\ref{fig:tuneplane}. \textcolor{red}{\textit{Someone should say something about the tune footprint, see Fig.~\ref{fig:tunefootprint}.}}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig15.png}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig15.png}
	\caption{\textcolor{orange}{David T.}  Tune footprint of a beam distribution at \SI{149}{\micro\second} after injection and for a magnetic field measurement. \textcolor{red}{\textit{Remake with the ideal magnetic field; add a z-axis that defines the color range.}}}\label{fig:tunefootprint}
\end{figure}

\subsection{\label{sec:inject} Injection}
\textcolor{orange}{David R.}
\medskip

\textcolor{red}{\textit{Maybe we should put IBMS and T0 figures in this section, as they provide beam information just before injection.}}

The beam is injected into the ring through a hole in the back leg iron. The \SI{1.7}{\meter} long superconducting inflector bucks the main dipole field so that the beam traverses the inflector without significant deflection and exits the inflector on a trajectory tangent to a displaced circular orbit. The beam crosses the design orbit in the gap of the pulsed kicker that steers the beam radially outward and onto the central orbit as shown in Fig.~\ref{fig:schematic}. 

The inflector aperture (\SI{18}{\milli\meter} horizontally by \SI{56}{\milli\meter} vertically) is very much smaller than the aperture of the ring (\SI{90}{\milli\meter} round). In order to maximize transmission, the beam is focused to a narrow waist through the inflector and with zero dispersion. 

Manipulation of the beam width to maximize transmission through the inflector and into the ring is illustrated in Fig.~\ref{fig:mismatchap}. The mismatch of $\beta$ and $\eta$ functions leads to a modulation of beam width with components at the betatron frequency and twice the betatron frequency respectively. The relative contribution of betatron motion and momentum offset to the width can be extracted from the width measurement (Fig.~\ref{fig:fiberwidth}) by suitable decomposition. The phase space at the inflector exit is defined by the inflector aperture and shown in Fig.~\ref{fig:beamphasespace}.

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig16.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig16.pdf}
	\caption{\textcolor{orange}{David R.} Propagating beam betatron and energy width through narrow aperture inflector and into the storage ring. The dashed line is the horizontal aperture. \textcolor{red}{\textit{What are $a_{x}\left(\beta_{x}\right)^{\left.1\middle/2\right.}$ and $\sigma_{\delta}$; is the y-axis label really right; remove timestamp and directory info.}}}\label{fig:mismatchap}
\end{figure}

\begin{figure}[]
	\centering
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig17a.pdf}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig17a.pdf}
		\caption{Horizontal phase space at the exit of the inflector.}\label{fig:xbeamphasespace}
	\end{subfigure}
	%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc (or a blank line to force the subfigure onto a new line).
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig17b.pdf}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig17b.pdf}
		\caption{Vertical phase space at the exit of the inflector.}\label{fig:ybeamphasespace}
	\end{subfigure}
	\caption{\textcolor{orange}{David R.} Simulated muon beam phase space at the downstream end of the inflector. \textcolor{red}{\textit{Harmonize notation; show full coordinate ranges; change from scatter plot to 2D histogram; remove timestamp and directory info.}}}\label{fig:beamphasespace}
\end{figure}

The kicker is located $\phi_\beta=\left.\pi\middle/2\right.$ downstream from the injection point at the inflector exit. The beam crosses the design orbit with an angle determined by the radial displacement of the inflector axis (nominally \SI{77}{\milli\meter} from the design orbit and indicated as `d' in Fig.~\ref{fig:schematic}), and the exit angle. The crossing angle, and therefore the kick required to steer the beam onto the closed orbit, is minimum if the exit angle is zero. The dependencies can be made quantitative with a few simplifying assumptions, namely that the $\beta$ and $\eta$ functions are uniform around the ring, and as long as we treat the kickers as a $\delta$-function in azimuthal angle. (The kickers~\cite{Grange:2015fou,Schreckenberger:IPAC2018-THPML093} in fact extend over about \SI{36}{\degree} of arc). With these assumptions, the horizontal displacement of the trajectory is
\begin{align} % {} before the - sign turns it into a binary operator instead of a unary operator (spacing issues)
	x\left(s\right) &=\left(x_{\textnormal{inf}}-\delta\eta\right)\cos\left[\phi\left(s\right)\right]+\eta\delta\nonumber\\
	                     &\qquad{}-k\beta_{0}\cos\left[\phi\left(s\right)\right]+x^{\prime}_{\textnormal{inf}}\sin\left[\phi\left(s\right)\right]\nonumber\\ 
	                     &=A\cos\left[\phi\left(s\right)+\phi_{0}\right]+\eta\delta,\nonumber
%	\label{eq:horiz_disp} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
where $x_{\textnormal{inf}},x^{\prime}_{\textnormal{inf}}$ are the displacement and angle of the trajectory at the inflector exit, $\eta$ the dispersion, $\delta$ is the fractional momentum offset, $k$ is the kick angle, $\phi\left(s\right)$ the betatron phase advance with $s=0$ at the injection point, 
\begin{align}
	A                 &=\pm\sqrt{\left(x_{\textnormal{inf}}+\delta\eta-k\beta\right)^{2}+\left(x^{\prime}_{\textnormal{inf}}\beta\right)^{2}}\nonumber\\
	\tan\phi_{0} &= \frac{x^{\prime}_{\textnormal{inf}}\beta}{x_{\textnormal{inf}}-\delta\eta-k\beta}.\nonumber
%	\label{eq:ampl_phase} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
The extremes of the displacement of the motion, that is the envelope of the motion is given by $x_{\textnormal{ext}}=\pm\left|A\right|+\eta\delta$. The envelope is plotted in Fig.~\ref{fig:EnergyAcceptance1} as a function of momentum for three different injection angles, and for a kick angle $k=\SI{8}{\milli\radian}$, which is about \SI{80}{\percent} of the nominal kick. The minimum momentum that can be stored decreases as the kicker angle approaches nominal. Under kicking skews the momentum distribution high. Kick and and injection angle both contribute to the amplitude of the oscillations about the closed orbit. Non zero injection angle reduces momentum acceptance symmetrically about zero.

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig18.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig18.pdf}
	\caption{\textcolor{orange}{David R.} Kick angle \SI{\sim80}{\percent} of nominal. The green lines mark the envelope of the motion of a muon that exits the inflector with zero angle. The on momentum muon oscillates between \SI{\pm2}{\centi\meter}. If momentum offset is \SI{0.2}{\percent} the peak to peak oscillation is \SI{\sim5}{\milli\meter}. A muon with momentum offset of \SI{-0.18}{\percent} is outside the \SI{4.5}{\centi\meter} aperture. \textcolor{red}{\textit{Harmonize notation; should we change \SI{80}{\percent} nominal kick to \SI{90}{\percent} nominal kick as $\left.\SI{149}{\kilo\volt}\middle/\SI{165}{\kilo\volt}\right.=0.9$; remove timestamp and directory info.}}}\label{fig:EnergyAcceptance1}
\end{figure}

\textcolor{red}{\textit{Figure~\ref{fig:amplvsequpos} needs to be discussed somewhere in the text.}}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig19.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig19.pdf}
	\caption{\textcolor{orange}{David R.} Horizontal betatron amplitude vs. average equilibrium position for stored muons. \textcolor{red}{\textit{Harmonize notation; check units used for calculations; change scatter plot to 2D histogram; remove timestamp and directory info.}}}\label{fig:amplvsequpos}
\end{figure}

\subsection{\label{sec:tunes}Average Tune \& Chromaticity Measurements}
\textcolor{orange}{Dat}
\medskip

The horizontal ($\nu_{x}$) and vertical ($\nu_{y}$) tunes are defined as
\begin{align}
	\nu_{x} &\equiv\mathcal{N}_{x}=\cfrac{\left.\mathcal{N}_{x}\middle/\mathcal{T}\right.}{\left.1\middle/\mathcal{T}\right.}=\frac{f_{x}}{f_{c}}=1-\frac{f_{\textnormal{cbo}}}{f_{c}}\nonumber\\
	\nu_{y} &\equiv\mathcal{N}_{y}=\cfrac{\left.\mathcal{N}_{y}\middle/\mathcal{T}\right.}{\left.1\middle/\mathcal{T}\right.}=\frac{f_{y}}{f_{c}}=\frac{1}{2}\left(1-\frac{f_{\textnormal{vw}}}{f_{c}}\right),
	\label{eq:tunedef} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
where $\mathcal{N}_{x}$ is the number of horizontal betatron oscillations per 1 turn around the storage ring, $\mathcal{T}$ is the time it takes traverse 1 turn around the storage ring, $f_{x}$ is the horizontal betatron frequency, $f_{c}$ is the cyclotron frequency, $f_{\textnormal{cbo}}$ is the coherent betatron oscillation frequency, $\mathcal{N}_{y}$ is the number of vertical betatron oscillations per 1 turn around the storage ring, $f_{y}$ is the vertical betatron frequency, and $f_{\textnormal{vw}}$ is the vertical waist frequency.

\textcolor{red}{\textit{Figure~\ref{fig:freq_ext} needs to be discussed somewhere in the text.}}

\begin{figure}[]
	\centering
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig20a.pdf}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig20a.pdf}
		\caption{}\label{fig:freq_ext_low_f}
	\end{subfigure}
	%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc (or a blank line to force the subfigure onto a new line).
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig20b.pdf}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig20b.pdf}
		\caption{}\label{fig:freq_ext_high_f}
	\end{subfigure}
	\caption{\textcolor{orange}{Dat} A sum of Gaussian functions is fitted to the FFT of the fiber harp signals to extract the $\left<f_{\textnormal{cbo}}\right>$, $\left<f_{y}\right>$, $\left<f_{\textnormal{vw}}\right>$, $\left<f_{x}\right>$, and $\left<f_{c}\right>$ values for a given $V_{Q}$ setting. \textcolor{red}{\textit{What do we really want to show?}}}\label{fig:freq_ext}
\end{figure}

The electrostatic quadrupole system produces vertically focusing and horizontally defocusing, where the $V_{Q}$ settings need to be translated into beam dynamics parameters to help understand the operational behavior of the storage ring. The FBM, trackers, and calorimeters can be used to measure the average cyclotron ($\left<f_{c}\right>$), coherent betatron oscillation ($\left<f_{\textnormal{cbo}}\right>$), vertical betatron ($\left<f_{y}\right>$), and vertical waist ($\left<f_{\textnormal{vw}}\right>$) frequencies. These average frequencies can in turn be used to determine the average horizontal ($\left<\nu_{x}\right>$) and vertical ($\left<\nu_{y}\right>$) tunes, see Table~\ref{tab:tune_data}. 

\begin{table*}[]
\caption{\label{tab:tune_data} \textcolor{orange}{Dat} Measured $\left<f_{c}\right>$, $\left<f_{\textnormal{cbo}}\right>$, and $\left<f_{y}\right>$ (only statistical errors are given) along with the corresponding $\left<\nu_{x}\right>$ and $\left<\nu_{y}\right>$ calculated via Eq.~(\ref{eq:tunedef}). This data was collected during \runone~with the \SI{180}{\degree} horizontal and vertical fiber harp central (no. 4) fibers, where the first \SI{3}{\micro\second} of data are not used for these measurements. The $\left<f_{c}^{x}\right>$ is the $\left<f_{c}\right>$ measured by the horizontal fiber harp and used to calculate $\left<\nu_{x}\right>$, while the $\left<f_{c}^{y}\right>$ is the $\left<f_{c}\right>$ measured by the vertical fiber harp and used to calculate $\left<\nu_{y}\right>$.  \textcolor{red}{\textit{Update with \runtwo~fiber harp data; do we need to compare to \runone~data.}}}
\begin{ruledtabular}
\begin{tabular}{ccccccc}
$V_{\textnormal{Q}}$~\textnormal{[\SI{}{\kilo\volt}]}  & $\left<f_{c}^{x}\right>$~\textnormal{[\SI{}{\mega\hertz}]} & $\left<f_{\textnormal{cbo}}\right>$~\textnormal{[\SI{}{\mega\hertz}]} & $\left<\nu_{x}\right>$ & $\left<f_{c}^{y}\right>$~\textnormal{[\SI{}{\mega\hertz}]} & $\left<f_{y}\right>$~\textnormal{[\SI{}{\mega\hertz}]} & $\left<\nu_{y}\right>$\\
\colrule
13.0 & 6.697(5) & 0.2600(30) & 0.9612(4) & 6.715(5) & 1.8555(50) & 0.2763(8)\\
15.0 & 6.697(5) & 0.3005(30) & 0.9551(4) & 6.715(5) & 1.9940(50) & 0.2969(8)\\
17.6 & 6.697(5) & 0.3553(30) & 0.9469(4) & 6.715(5) & 2.1680(50) & 0.3229(8)\\
19.0 & 6.697(5) & 0.3845(30) & 0.9426(5) & 6.715(5) & 2.2540(50) & 0.3357(8)\\
20.2 & 6.697(5) & 0.4100(30) & 0.9388(5) & 6.715(5) & 2.3235(50) & 0.3460(8)\\
20.5 & 6.697(5) & 0.4143(30) & 0.9381(5) & 6.715(5) & 2.3370(50) & 0.3480(8)\\
\end{tabular}
\end{ruledtabular}
\end{table*}

For a circular storage ring with a perfect dipole magnetic field (\dipbfield), the field index inside of a quadrupole ($n_{0}$) is defined as
\begin{equation}
	n_{0}\equiv\frac{m\gamma r}{p\dipbfield}\frac{\partial E_{r}}{\partial r},
	\label{eq:n_0_deff}
\end{equation}
where $m$ is mass, $\gamma$ is the Lorentz factor, $r$ is the radial distance from the center of the storage ring, $p$ is momentum, and $E_{r}$ is the radial component of the quadrupole electric field.

\textcolor{red}{\textit{Figure~\ref{fig:tune_vs_p} needs to be discussed somewhere in the text.}}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig21.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig21.pdf}
	\caption{\textcolor{orange}{Dat} A measurement of $\left<\nu_{x}\right>$ versus $\left<\delta\right>$ for $V_{Q}=\SI{18.3}{\kilo\volt}$, where the slope of the fit line gives an estimate of $\left.d\nu_{x}\middle/d\delta\right.$. This data was collected during \runtwo~with the \SI{180}{\degree} horizontal fiber harp. \textcolor{red}{\textit{What do we really want to show?}}}\label{fig:tune_vs_p}
\end{figure}

The smoothed quadrupole model describes the EQS as being continuous around the entire storage ring. The effective field index ($n$) in the smoothed model is defined as
\begin{equation}
	n\equiv\left(\frac{4l_{q}}{\cmagic}\right)n_{0}=\left(\frac{\left.l_{q}\middle/\rmagic\right.}{\left.\pi\middle/2\right.}\right)n_{0},
	\label{eq:n_deff}
\end{equation}
where $\rmagic=\SI{7112}{\milli\meter}$ is the storage ring equilibrium orbit radius, $\cmagic=2\pi\rmagic$ is the storage ring equilibrium orbit circumference, and $l_{q}$ is the quadrupole long-short pair length.

The smoothed model approximates~\cite{Semertzidis:2003zs} the storage ring tunes as
\begin{align}
	\nu_{x} &\approx\sqrt{1-n}\nonumber\\
	\nu_{y} &\approx\sqrt{n}.
	\label{eq:tunes_smooth} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}

\textcolor{red}{\textit{Figure~\ref{fig:chromat_vs_vq} needs to be discussed somewhere in the text.}}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig22.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig22.pdf}
	\caption{\textcolor{orange}{Dat} An estimate of $\left.d\nu_{x}\middle/d\delta\right.$ versus $V_{Q}$ that is based on fiber harp data. This data was collected during \runtwo~with the \SI{180}{\degree} horizontal fiber harp. \textcolor{red}{\textit{What do we really want to show?}}}\label{fig:chromat_vs_vq}
\end{figure}

The discrete quadrupole model describes the EQS as being a set of 4 separate quadrupoles that have a four-fold symmetry around the storage ring. The discrete model approximates~\cite{Semertzidis:2003zs} the storage ring tunes as
\begin{align} % {} before the - sign turns it into a binary operator instead of a unary operator (spacing issues)
	\cos\left(\frac{\pi}{2}\nu_{x}\right) &\approx c_{i}\cos\left(\frac{l_{q}}{\rmagic}\sqrt{m}\right)\nonumber\\
	                                                     &\qquad{}-\frac{1}{2}s_{i}\left(\sqrt{m}+\frac{1}{\sqrt{m}}\right)\sin\left(\frac{l_{q}}{\rmagic}\sqrt{m}\right)\nonumber\\
	\cos\left(\frac{\pi}{2}\nu_{y}\right) &\approx\cos\left(\frac{l_{q}}{\rmagic}\sqrt{n_{0}}\right)\nonumber\\
	                                                     &\qquad{}-\frac{1}{2}\frac{l_{i}}{\rmagic}\sqrt{n_{0}}\sin\left(\frac{l_{q}}{\rmagic}\sqrt{n_{0}}\right),
	\label{eq:tunes_discrete} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
where $c_{i}\equiv\cos\left(l_{i}\middle/\rmagic\right)$, $s_{i}\equiv\sin\left(l_{i}\middle/\rmagic\right)$, $m\equiv1-n_{0}$ and $l_{i}$ is the interval length between quadrupole long-short pairs. The following numerical relations obtained from~\cite{Semertzidis:2003zs} are assumed for Eq.~(\ref{eq:tunes_discrete}): $\left.l_{i}\middle/\rmagic\right.=0.895354$, $\left.l_{q}\middle/\rmagic\right.=0.675442$, and $n_{0}=\left.n\middle/0.43\right.$.

Equations~(\ref{eq:n_0_deff}) and~(\ref{eq:n_deff}) show that $n\propto\partial E_{r}/\partial r$, and $E_{r}\propto V_{\textnormal{quad}}$ when assuming that the quadrupole geometry and HV pulse generation are independent of $V_{\textnormal{quad}}$, which then implies that $n\propto V_{\textnormal{quad}}$:
\begin{equation}
	n=\sigma V_{\textnormal{quad}},
	\label{eq:volt_to_index}
\end{equation}
where $\sigma$ is the proportionality constant (conversion factor) between $n$ and $V_{\textnormal{quad}}$ \textcolor{red}{\textit{[need to pick a different symbol for $\sigma$, as it gets confusing when talking about the standard deviation difference]}}. Equation~(\ref{eq:volt_to_index}) is combined with Eqs.~(\ref{eq:tunes_smooth}) and~(\ref{eq:tunes_discrete}), and the resulting functions are fit to the $\left<\nu_{x}\right>$ and $\left<\nu_{y}\right>$ data in Table~\ref{tab:tune_data}, see Fig~\ref{fig:nu_vs_v}. The $\sigma_{x}^{s}$, $\sigma_{y}^{s}$, $\sigma_{x}^{d}$, and $\sigma_{y}^{d}$ fit parameters in Fig.~\ref{fig:nu_vs_v} correspond to the $\sigma$ in Eq.~(\ref{eq:volt_to_index}). In the ideal case, $\sigma_{x}^{s}=\sigma_{y}^{s}$ and $\sigma_{x}^{d}=\sigma_{y}^{d}$. 

\begin{figure}[]
	\centering
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig23a}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig23a}
		\caption{$\left<\nu_{x}\right>$ vs. $V_{\textnormal{quad}}$}\label{fig:nu_x_vs_v}
	\end{subfigure}
	%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc (or a blank line to force the subfigure onto a new line).
	\begin{subfigure}{\columnwidth}
		\begin{tikzpicture}
			\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig23b}};
			\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
		\end{tikzpicture}
		%\includegraphics[width=0.95\columnwidth]{fig23b}
		\caption{$\left<\nu_{y}\right>$ vs. $V_{\textnormal{quad}}$}\label{fig:nu_y_vs_v}
	\end{subfigure}
	\caption{\textcolor{orange}{Dat} Average tune data (blue circular points), see Table~\ref{tab:tune_data}, along with fits using the smoothed quadrupole model (solid black lines) and discrete quadrupole model (red dashed lines), see Eqs.~(\ref{eq:tunes_smooth}),~(\ref{eq:tunes_discrete}), and~(\ref{eq:volt_to_index}). The $\sigma_{x}^{s}$, $\sigma_{y}^{s}$, $\sigma_{x}^{d}$, and $\sigma_{y}^{d}$ fit parameters are for the smoothed model fit to $\left<\nu_{x}\right>$ data, smoothed model fit to $\left<\nu_{y}\right>$ data, discrete model fit to $\left<\nu_{x}\right>$ data, and discrete model fit to $\left<\nu_{y}\right>$ data respectively. \textcolor{red}{\textit{Harmonize notation; update with \runtwo~fiber harp data; do we need to compare to \runone~data; should we add gm2ringsim tune curves.}}}\label{fig:nu_vs_v}
\end{figure}

The $\chi^{2}/\textnormal{ndf}<1$ for all of the fits in Fig.~\ref{fig:nu_vs_v}, which indicates that the precision of the fit parameters is limited by the ``large'' size of the data point errors. There is some mild tension between the horizontal and vertical tune fits within each model, as
\begin{align}
	\frac{\left|\sigma_{x}^{s}-\sigma_{y}^{s}\right|}{\sqrt{\left(\delta_{x}^{s}\right)^{2}+\left(\delta_{y}^{s}\right)^{2}}} &=\SI{1.990}{\sigma}\nonumber\\
	\frac{\left|\sigma_{x}^{d}-\sigma_{y}^{d}\right|}{\sqrt{\left(\delta_{x}^{d}\right)^{2}+\left(\delta_{y}^{d}\right)^{2}}} &=\SI{2.147}{\sigma},
	\label{eq:tunes_xydiff} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
where $\delta_{x}^{s}$, $\delta_{y}^{s}$, $\delta_{x}^{d}$, and $\delta_{y}^{d}$ are the errors for the $\sigma_{x}^{s}$, $\sigma_{y}^{s}$, $\sigma_{x}^{d}$, and $\sigma_{y}^{d}$ values respectively. This tension is likely due to some undetermined systematic effect in the tune data. This tension can be eliminated by rescaling the errors so that the standard deviations difference is \SI{1}{\sigma}, where these multiplicative scale factors are $\epsilon^{s}=1.990$ and $\epsilon^{d}=2.147$ for the smoothed and discrete models respectively.

The horizontal and vertical fit parameters can be averaged to produce a final estimation of the conversion factor between $n$ and $V_{\textnormal{quad}}$:
\begin{align}
	\sigma^{s} &=\frac{1}{2}\left(\sigma_{x}^{s}+\sigma_{y}^{s}\right)\pm\frac{1}{2}\sqrt{\left(\epsilon^{s}\delta_{x}^{s}\right)^{2}+\left(\epsilon^{s}\delta_{y}^{s}\right)^{2}}\nonumber\\
	                  &=\left(5.886\pm0.023\right)\times\SI{e-3}{\per\kilo\volt}\nonumber\\
	\sigma^{d} &=\frac{1}{2}\left(\sigma_{x}^{d}+\sigma_{y}^{d}\right)\pm\frac{1}{2}\sqrt{\left(\epsilon^{d}\delta_{x}^{d}\right)^{2}+\left(\epsilon^{d}\delta_{y}^{d}\right)^{2}}\nonumber\\
	                  &=\left(5.892\pm0.025\right)\times\SI{e-3}{\per\kilo\volt},
	\label{eq:nvspconv} % get an error if last line has \nonumber. % manually put in parentheses for inline eq. references.
\end{align}
where $\sigma^{s}$ and $\sigma^{d}$ are the average conversion factors for the smoothed and discrete models. Equations~(\ref{eq:tunes_xydiff}) and~(\ref{eq:nvspconv}) show that the smoothed and discrete models produce consistent results, and Table~\ref{tab:n_nu_estim} provides \runone~field index and tune values that are based on the smoothed model \textcolor{red}{\textit{[maybe this should also be done for the discrete model]}}.

\begin{table}[]
\caption{\label{tab:n_nu_estim} \textcolor{orange}{Dat} Field index and tune values based on the smoothed model for different quadrupole storage voltages used in \runone~data collection, see Eqs.~(\ref{eq:tunes_smooth}),~(\ref{eq:volt_to_index}), and~(\ref{eq:nvspconv}), along with the numerical relation $n_{0}=\left.n\middle/0.43\right.$ obtained from~\cite{Semertzidis:2003zs}. \textcolor{red}{\textit{Should the field indices also be calculated using the discrete model?}}}
\begin{ruledtabular}
\begin{tabular}{ccccc}
$V_{\textnormal{quad}}$~\textnormal{[\SI{}{\kilo\volt}]} & $n_{0}$         & $n$              & $\nu_{x}$      & $\nu_{y}$\\
\colrule
15.0                                                                                & 0.20533(80) & 0.08829(35) & 0.95484(18) & 0.29714(58)\\
18.3                                                                                & 0.25050(98) & 0.10771(42) & 0.94461(22) & 0.32820(64)\\
20.4                                                                                & 0.2792(11)   & 0.12007(47) & 0.93804(25) & 0.34652(68)\\
\end{tabular}
\end{ruledtabular}
\end{table}

\subsection{\label{sec:closedorbit}Closed Orbit \& Quadrupole Distortions}
\textcolor{orange}{Mike}
\medskip

Distortions of the closed orbit and of the amplitude functions are created due to misalignments of the electrostatic quadrupole plates and imperfections of the magnetic field.  Systematic  displacement of a pair of quadrupole plates (horizontal or vertical) will create horizontal or vertical orbit distortions.  Likewise, local deviations in the vertical  or radial magnetic field components will cause deviations in the horizontal or vertical components of the closed orbit, respectively.  Assembly of the electrostatic quadrupole included measurement and fiducialization of the plate locations and, upon installation and alignment, provide knowledge of final placement.  Table~\ref{tab:tmp_quad_align} shows the average measured residual displacements of plate pairs for the eight electrostatic quadrupoles in the Storage Ring.  Non-zero values of $dx$ and $dy$ will steer the beam horizontally or vertically, while $dax$ and $day$ -- deviations in plate separation -- alter the focusing strength of the quadrupoles and hence introduce beam envelope distortions.
In addition, from Fig~\ref{fig:bfield}, closed orbit and focusing distortions can be ascertained from the dipole and quadrupole errors of the main magnetic field.

\begin{table}[]
\caption{\label{tab:tmp_quad_align}\textcolor{orange}{Mike} Quadrupole in situ alignment data; $dx$ and $dy$ indicate the displacement of the center of quadrupole plate pairs which will generate steering, while $dax$ and $day$ are the deviations in plate pair separation which will affect the focusing strength of the quadrupoles.}
\begin{ruledtabular}
\begin{tabular}{lcccc}
\textnormal{Quadrupole} & $dx$~\textnormal{[\SI{}{\milli\meter}]} & $dy$~\textnormal{[\SI{}{\milli\meter}]} & $dax$~\textnormal{[\SI{}{\milli\meter}]} & $day$~\textnormal{[\SI{}{\milli\meter}]}\\
\colrule
\textnormal{Q1S}             & -0.325                                                 & 2.235                                                   & 0.265                                                     & 0.185\\
\textnormal{Q1L}             & -0.245                                                  & -0.980                                                 & 0.285                                                     & -0.140\\
\textnormal{Q2S}             & -0.995                                                 & -0.675                                                  & -0.295                                                    & -0.185\\
\textnormal{Q2L}              & -0.035                                                & 0.380                                                   & -0.095                                                    & -0.290\\
\textnormal{Q3S}             & -0.20                                                   & 0.75                                                    & 0.20                                                        & -0.41\\
\textnormal{Q3L}              & 0.115                                                 & -1.965                                                  & -0.195                                                    & -0.125\\
\textnormal{Q4S}             & 2.045                                                 & -1.315                                                  & 0.195                                                      & -0.155\\
\textnormal{Q4L}              & 0.085                                                 & -0.220                                                  & -0.115                                                    & 0.220\\
\end{tabular}
\end{ruledtabular}
\end{table}

Figures~\ref{fig:orbitdistort} and~\ref{fig:betadistort} show the effects computed from the errors described above.  We see that expected orbit distortions will be on the scale of 2~mm in both the horizontal and vertical planes, and that amplitude function distortions will be on the scale of a few percent, mostly due to a strong, local quadrupole magnetic field error near the entrance to the Storage Ring due to the inflector magnet.

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig24.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig24.pdf}
	\caption{\textcolor{orange}{Mike and David T.} Computed horizontal (solid) and vertical (dashed) closed orbit distortions due to quadrupole plate alignment errors (red) and main dipole field errors (blue); the heavy black curves are the sum of the effects from the quadrupole and dipole errors. \textcolor{red}{\textit{Check with field, tracker, \& quad experts.}}}\label{fig:orbitdistort}
\end{figure}

\begin{figure}[]
	\centering
	\begin{tikzpicture}
		\draw (0, 0) node[inner sep=0]{\includegraphics[width=0.95\columnwidth]{fig25.pdf}};
		\draw (0, 0) node[rotate=45,opacity=0.4]{{\fontsize{45}{54}\selectfont\textcolor{red}{\textbf{Preliminary}}}}; % rule of thumb: \fontsize{size}{1.2*size}
	\end{tikzpicture}
	%\includegraphics[width=0.95\columnwidth]{fig25.pdf}
	\caption{\textcolor{orange}{Mike and David T.} Computed horizontal (solid) and vertical (dashed) amplitude function distortions due to quadrupole plate alignment errors (red) and main dipole field gradient errors (blue); the heavy black curves are the sum of the effects from the quadrupole and dipole errors. \textcolor{red}{\textit{Harmonize notation; check with field, tracker, \& quad experts.}}}\label{fig:betadistort}
\end{figure}
