\begin{flushright}
D. Rubin\phantom{1111} \\
September 8,  2020
\end{flushright}
\begin{center}
{\bf \Large Closed Orbit Distortion}
\end{center}
\def\bmhr{{\hat{\bm\rho}}}
\def\bmhp{{\hat{\bm\phi}}}
\def\bmbetahat{{\hat{\bm\beta}}}
\def\bfs{{\bf s}}
\def\bfhz{{\hat{\bf z}}}
\section*{Contribution from Electric Field}
We have
\begin{eqnarray*}
\Delta\omega_E &=& -\frac{e}{mc}a_\mu(-2\frac{\Delta p}{p}\beta_\gamma E_\rho)\\
\rightarrow \frac{\Delta\omega_E}{\omega_a}=C_e &=&\frac{-2\vev{\frac{\Delta p}{p} \beta_\gamma E_\rho}}{B}
\end{eqnarray*}
We can write
$\frac{\Delta p}{p} = x_e\eta$, where $x_e$ is the momentum dependent displacement of the closed orbit from the magic radius. 
The radial electric field is given by
$$E_\rho = n\left(\frac{\beta_\gamma B}{R_0}\right) x_e$$
so that
$$\vev{C_e} = -2\beta_\gamma^2 n(1-n)\frac{\vev{x_e^2}}{R_0^2}$$ 
where we have used $\eta = R_0/(1-n)$.


What can go wrong?
We measure the revolution frequency. 
\begin{eqnarray*}
\Delta T &=& 2\pi\vev{x(\phi)}/ v\\
x(\phi) &=& \eta(\phi)\frac{\Delta p}{p}\\
\Delta T v &=& 2\pi\vev{\eta}\frac{\Delta p}{p}\\
2\pi \frac{\Delta \omega}{\omega^2}v&=& 2\pi\vev{\eta}\frac{\Delta p}{p}\\
%\Delta C = 2\pi \vev{x} = 2\pi\vev{\eta}\frac{\Delta p}{p}\\
%(T-T_0)v = v(\frac{2\pi}{\omega}-\frac{2\pi}{\omega_0}) &=&\frac{\Delta p}{p}\vev{\eta}\\
\frac{v\Delta\omega}{\omega^2}&=& \frac{\Delta p}{p}\vev{ \eta(\phi)}\\
R\frac{\Delta\omega}{\omega}&=& \frac{\Delta p}{p}\vev{ \eta(\phi)}\\
\frac{\Delta p}{p} &=& \frac{R}{\vev{\eta}}\frac{\Delta\omega}{\omega}
\end{eqnarray*}
We see that to convert frequency offset into momentum offset, we need the dispersion averaged around the ring.
Now our usual approximation of the electric field is 
$$E_\rho = n\left(\frac{\beta_\gamma B}{R}\right) x_e = k x_e$$
and including the possibility of a closed orbit error 
$$x_e = x_c(\phi)+\eta(\phi)\frac{\Delta p}{p}$$
Then we can write
$$\frac{B}{\beta_\gamma}C_e=-2\left(\frac{\Delta p}{p}\right)(\vev{x_c(\phi)k(\phi)}+\frac{\Delta p}{p}\vev{\eta(\phi) k(\phi)})$$
So we need
$$\vev{\eta} = \frac{1}{2\pi}\oint\eta(\phi) d\phi$$
$$\vev{\eta k} = \frac{1}{2\pi}\oint \eta(\phi) k(\phi) d\phi$$
$$\vev{x_c k } = \frac{1}{2\pi}\oint x_c(\phi) k(\phi) d\phi$$
Magnetic field is periodic.
$$B = \sum_r B_r\cos(r\theta)$$
$r=0$ establishes closed orbit. $r>0$ leads to closed orbit distortion.
Evaluate closed orbit and dispersion
\begin{eqnarray*}
\eta(s) &=& \frac{\sqrt{(\beta(s)}}{2\sin\pi\nu}\oint \frac{e}{p}\sum_r B_r\cos(r\theta(s^\prime)) \sqrt{\beta(s^\prime)}\cos(\phi(s)-\phi(s^\prime) - \pi\nu) ds^\prime\\
d\phi&=& ds/\beta,\ \ \phi = \nu\theta\\
\eta(\theta) &=& \frac{\sqrt{\beta(\theta)}}{2\sin\pi\nu}\int_{\theta-2\pi}^{\theta}\frac{e}{p} \sum B_r\cos(r\theta^\prime) \nu\sqrt{\beta^3(\theta^\prime)}\cos(\nu\theta - \nu\theta^\prime-\pi\nu) d\theta^\prime\\
\end{eqnarray*}
If $n=0$ and $\frac{e}{p}B_0 = 1/R_0$ and $\beta(\theta) = \beta$
\begin{eqnarray*}
\eta(\theta) &=&\frac{\nu}{2\sin\pi\nu}\frac{\beta^2}{R_0}\frac{\sin(\nu\theta-\nu\theta^\prime-\pi\nu)}{-\nu}|_{\theta-2\pi}^{\theta}\\
\eta(\theta) &=&\frac{\nu}{2\sin\pi\nu}\frac{\beta^2}{R_0}\frac{\sin(-\pi\nu)-\sin(\pi\nu)}{-\nu}\\
\eta(\theta) &=&\frac{\beta^2}{R_0} = \frac{R_0}{1-n}\\
\end{eqnarray*}
where $\beta = R_0/\sqrt{1-n}$.
More generally the $r^{th}$ moment of the dispersion 
\begin{eqnarray}
\eta_r(\theta) &=&\frac{\sqrt{\beta(\theta)}}{2\sin\pi\nu}\int_{\theta-2\pi}^\theta b_r\cos(r\theta^\prime)\nu\beta^{3/2}(\theta^\prime)
        \left(\cos(\nu\theta-\nu\theta^\prime-\pi\nu\right) d\theta^\prime\nonumber\\
\eta_r(\theta) &=&\frac{\sqrt{\beta(\theta)}}{2\sin\pi\nu}\int_{\theta-2\pi}^\theta b_r\nu\beta^{3/2}(\theta^\prime)
          \onehalf\left(\cos(r\theta^\prime+\nu\theta-\nu\theta^\prime-\pi\nu) +\cos(r\theta^\prime - \nu\theta+\nu\theta^\prime +\pi\nu) \right)d\theta^\prime \nonumber\\
\eta_r(\theta) &\approx&\frac{\beta^2}{2\sin\pi\nu} b_r\nu
          \onehalf\left(\frac{1}{r-\nu}\sin(r\theta^\prime+\nu\theta-\nu\theta^\prime-\pi\nu) +\frac{1}{r+\nu}\sin(r\theta^\prime - \nu\theta+\nu\theta^\prime +\pi\nu) \right)\mid_{\theta-2\pi}^\theta\nonumber \\
\eta_r(\theta) &\approx&\frac{\beta^2}{2\sin\pi\nu} b_r\nu
          \onehalf\left(\frac{1}{r-\nu}\left(\sin(r\theta-\pi\nu)-\sin(r\theta+\pi\nu)\right) +\frac{1}{r+\nu}\left(\sin(r\theta+\pi\nu)-\sin(r\theta-\pi\nu)\right) \right) \nonumber\\
\eta_r(\theta) &\approx&\frac{\beta^2}{2\sin\pi\nu} b_r\nu
          \left(\frac{-\cos(r\theta)\sin(\pi\nu)}{r-\nu} +\frac{\cos(r\theta)\sin(\pi\nu)}{r+\nu} \right) \nonumber\\
\eta_r(\theta) &\approx& \onehalf \beta^2 b_r\cos(r\theta)\left(-\frac{\nu}{r-\nu} +\frac{\nu}{r+\nu} \right)\nonumber\\
\eta_r(\theta) &\approx&  \beta^2 b_r\cos(r\theta)\left(\frac{-\nu^2}{r^2-\nu^2} \right)\label{eq:etan}
\end{eqnarray}
where $b_r = \frac{e}{p}B_r$ with dimensions of inverse length and in the third line we assume $\beta$ is constant. Equation ~\ref{eq:etan} also gives the closed orbit distortion for the on energy particle
for the $r^{th}$ multipole ($r>0$) of the magnetic field. 
For $r=0$ ~\ref{eq:etan} becomes
$$\eta = \frac{\beta^2}{R_0} = \frac{R_0}{1-n}$$
where $b_0 = 1/R_0$ and $\beta = R_0/\sqrt{1-n}$. 
For $r=1$, looks pretty much like the calculation with the measured field so most of field error is $n=1$ and $b_r\sim 5.6 \times 10^{-6} {\rm m}^{-1}$ or
about $40$ ppm.

The closed orbit distortion for the on momentum particle is $x_r(\theta)=\eta(\theta)$.

The next step is to compute $\vev{\eta k}$. We can write the azimuthal dependence of the electric field, just like the 
magnetic. Due to the four fold symmetry
$$k(\theta) = \sum k_m\cos(4 m\theta +\phi_m)$$ where $k_1 =k_0$ so that the first 2 terms give
$$k(\theta) = k_0(1+\cos(4\theta+\phi_m))$$
 Then
\begin{eqnarray*}
\vev{\eta k}_{r,m}&=&2\beta^2 b_r\left(\frac{-\nu^2}{r^2-\nu^2}\right)\int \sum_{m=0} k_m\cos(4m\theta+\phi_m)\cos(r\theta)d\theta\\
\vev{\eta k}_{r,m}&=&\beta^2 b_r\left(\frac{-\nu^2}{r^2-\nu^2}\right) \sum_m k_m \delta_{4m,r}
\end{eqnarray*}
We find that only $r=0,4,8,\ldots$ contribute to the average.
We can try to compare the contribution from the $m=1,r=4$ to the $m=r=0$ part.
\begin{eqnarray*}
\frac{\vev{\eta k}_{4,1}}{\vev{\eta k}_{0,0}}=\frac{-\nu^2}{16-\nu^2}\frac{b_4}{b_0}\frac{k_1}{k_0}\\
\end{eqnarray*}
Keeping the leading terms $$k(\theta) = k_0 + k_1\cos(4\theta+\phi_m)$$
it appears that $k_0 = k_1$ so that $k$ varies between $0$ and $2k_0$.
\begin{eqnarray*}
\frac{\vev{\eta k}_{4,1}}{\vev{\eta k}_{0,0}}=\frac{\nu^2}{16-\nu^2}\frac{b_4}{b_0}\\
\end{eqnarray*}
Fitting to the measured azimuthal field on the closed orbit from the measured field we find that $b_4/b_0\sim 4$\ ppm and therefore  
\begin{eqnarray*}
\frac{\vev{\eta k}_{4,1}}{\vev{\eta k}_{0,0}}\sim 233\ {\rm ppb}\\
\end{eqnarray*}
That is, the correction due to the distortion of the dispersion function is less than 1 part in a million.
\subsection*{Closed Orbit Distortion}
As $x_r(\theta) = \eta(\theta)_r$ we know that
\begin{eqnarray*}
\vev{x_r k} = 0, \ r\ne 4\\
\vev{x_4 k_1} = \beta^2 b_4 \left(\frac{-\nu^2}{r^2-\nu^2}\right) k_1  \sim 10^{-5}{\rm m}^{-1} k_1
\end{eqnarray*}
To what do we compare this contribution? Let's try
\begin{eqnarray*}
\frac{\vev{x_c k}}{(\Delta p/p)\vev{\eta k}}&=& \frac{10^{-5}}{(\Delta p/p)\eta_0}\sim \frac{10^{-5}}{8} = \frac{1.3\times 10^{-6}}{\Delta p/p}
\end{eqnarray*}
If $\Delta p/p < 1\times 10^{-6}$ the closed orbit distortion dominates. The correction for such a momentum offset is
\begin{eqnarray*}
C_e(\Delta p/p) &=& -2\beta^2 n(1-n)\frac{\vev{x_e^2}}{R_0^2}\\
&=&-2\beta^2 n(1-n)\frac{\vev{(\eta\Delta p/p)^2}}{R_0^2}\\
&=&-2\beta^2 n\frac{\vev{(\Delta p/p)^2}}{1-n}\\
&\sim&-2 \frac{n}{1-n}(\Delta p/p)^2\\
&\sim&-2 \frac{0.11}{1-0.11}(10^{-6})^2\\
&\sim& -.25\times 10^{-12}
\end{eqnarray*}
or $-0.25\times 10^{-3}$\ ppb.

What about that earlier approximation that $\beta$ is constant around the ring. A better approximation is
$$\beta(\theta) = \beta_0 +\beta_4\cos(4\theta + \phi_\beta)$$
The term
\begin{eqnarray*}
\beta^{3/2}(\theta) \sim \beta_0^{3/2}(1+\frac{3}{2}\frac{\beta_4}{\beta_0}\cos(4\theta+\phi_\beta))
\end{eqnarray*}
Compute the contribution to the  dispersion due to the variations in $\beta$.
\begin{eqnarray}
\eta_r(\theta) &=&\beta_0^{2}\frac{1+\onehalf\frac{\beta_4}{\beta_0}\cos(4\theta+\phi_\beta)}{2\sin\pi\nu}\int_{\theta-2\pi}^\theta b_r\frac{3\beta_4}{2\beta_0}\cos(r\theta^\prime)\nu\cos(4\theta^\prime+\phi_\beta)
        \left(\cos(\nu\theta-\nu\theta^\prime-\pi\nu\right) d\theta^\prime\nonumber\\
\end{eqnarray}
It looks like we will end up with terms proportional to $\cos(r\pm 4)$ and $\cos(r\pm 4\pm 4)$, neither of which will contribute to the integral of dispersion and electric field.  
