[Go to BBS]
All articles in a thread
SubjectSAD Update. V1.0.10.3.10. Fringe of Solenoid.
Article No760
Date: 2009/12/29(Tue) 17:04:59
ContributorK. Oide
Dear Users,

1. Nonlinear fringe of solenoid will be included soon. Description in LaTeX follows. You need to specify DISFRING = 1 for each SOL element to disable the effect. The default is DISFRING = 0.

============================================
\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}(s/f+1/2)\theta(s+f/2)+\frac{B_0(x^2+y^2)y}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}(s/f+1/2)\theta(s+f/2)-\frac{B_0(x^2+y^2)x}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry.

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/4\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/4\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/4\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/4
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0p_0/(B\rho p$, up to the first order of $B_0$. The transformation (\ref{apptrans}) can be generated by a generating function:
\begin{equation}
G(\overline{x},p_x,\overline{y},p_y)=\overline{x}p_x+\overline{y}p_y-\frac{b}{4}\left[(p_x^2-p_y^2)\overline{x}\overline{y}-p_xp_y(\overline{x}^2-\overline{y}^2)\right]\ ,\label{genf}
\end{equation}
with the accuracy of the first order of $b$. An interesting thing is that (\ref{genf}) is independent on the length of fringe, $f$.

We can solve (\ref{genf}) by two parts
\begin{eqnarray}
G_1(\overline{x},p_x,\overline{y},p_y)&=&\overline{x}p_x+\overline{y}p_y-\frac{b}{4}(p_x^2-p_y^2)\overline{x}\overline{y}\label{genf1}\\
G_2(x,\overline{p_x},y,\overline{p_y})&=&x\overline{p_x}+y\overline{p_y}-\frac{b}{4}(x^2-y^2)\overline{p_x}\overline{p_y}\ ,\label{genf2}
\end{eqnarray}
as we are interested only in the first order of $b$. The generating function (\ref{genf1}) has the solution for $x$ and $y$:
\begin{eqnarray}
x&=&\frac{\partial G_1}{\partial p_x}=\overline{x}-\frac{b}{2}\overline{x}\overline{y}p_x\\
y&=&\frac{\partial G_1}{\partial p_y}=\overline{y}+\frac{b}{2}\overline{x}\overline{y}p_y
\end{eqnarray}
which are satisfied by
\begin{eqnarray}
\overline{x}&=&\frac{4x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,\\
\overline{y}&=&\frac{4y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,
\end{eqnarray}
assuming that the terms with $b$ are smaller than 1.
Then the transformations for momenta caused by $G_1$ are given by
\begin{eqnarray}
\overline{p_x}&=&\frac{\partial G_1}{\partial\overline{x}}=p_x-\frac{b}{2}(p_x^2-p_y^2)\overline{y}\ ,\\
\overline{p_y}&=&\frac{\partial G_1}{\partial\overline{y}}=p_y-\frac{b}{2}(p_x^2-p_y^2)\overline{x}\ .
\end{eqnarray}
The solution for $G_2$ is quite similar to above:
\begin{eqnarray}
\overline{p_x}&=&\frac{4p_x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,\\
\overline{p_y}&=&\frac{4p_y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,\\
\overline{x}&=&\frac{\partial G_2}{\partial\overline{p_x}}=x-\frac{b}{2}(x^2-y^2)\overline{p_y}\ ,\\
\overline{y}&=&\frac{\partial G_2}{\partial\overline{p_y}}=y-\frac{b}{2}(x^2-y^2)\overline{p_x}\ .
\end{eqnarray}


\end{document}

SubjectRe: SAD Update. V1.0.10.3.10a00. Fringe of Solenoid.
Article No761
Date: 2009/12/30(Wed) 07:56:20
ContributorK. Oide
Dear Users,

1. This version implements the fringe of solenoid only for tracking. The description was updated as below, correcting some signs in the previous description.

===============================
\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}(s/f+1/2)\theta(s+f/2)+\frac{B_0(x^2+y^2)y}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}(s/f+1/2)\theta(s+f/2)-\frac{B_0(x^2+y^2)x}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry.

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/4\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/4\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/4\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/4
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0p_0/(B\rho p$, up to the first order of $B_0$. The transformation (\ref{apptrans}) can be generated by a generating function:
\begin{equation}
G(\overline{x},p_x,\overline{y},p_y)=\overline{x}p_x+\overline{y}p_y-\frac{b}{4}\left[(p_x^2-p_y^2)\overline{x}\overline{y}-p_xp_y(\overline{x}^2-\overline{y}^2)\right]\ ,\label{genf}
\end{equation}
with the accuracy of the first order of $b$. An interesting thing is that (\ref{genf}) is independent on the length of fringe, $f$.

We can solve (\ref{genf}) by two parts
\begin{eqnarray}
G_1(\overline{x},p_x,\overline{y},p_y)&=&\overline{x}p_x+\overline{y}p_y-\frac{b}{4}(p_x^2-p_y^2)\overline{x}\overline{y}\label{genf1}\\
G_2(x,\overline{p_x},y,\overline{p_y})&=&x\overline{p_x}+y\overline{p_y}-\frac{b}{4}(x^2-y^2)\overline{p_x}\overline{p_y}\ ,\label{genf2}
\end{eqnarray}
as we are interested only in the first order of $b$. The generating function (\ref{genf1}) has the solution for $x$ and $y$:
\begin{eqnarray}
x&=&\frac{\partial G_1}{\partial p_x}=\overline{x}-\frac{b}{2}\overline{x}\overline{y}p_x\\
y&=&\frac{\partial G_1}{\partial p_y}=\overline{y}+\frac{b}{2}\overline{x}\overline{y}p_y
\end{eqnarray}
which are satisfied by
\begin{eqnarray}
\overline{x}&=&\frac{4x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,\\
\overline{y}&=&\frac{4y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,
\end{eqnarray}
assuming that the terms with $b$ are smaller than 1.
Then the transformations for momenta caused by $G_1$ are given by
\begin{eqnarray}
\overline{p_x}&=&\frac{\partial G_1}{\partial\overline{x}}=p_x-\frac{b}{2}(p_x^2-p_y^2)\overline{y}\ ,\\
\overline{p_y}&=&\frac{\partial G_1}{\partial\overline{y}}=p_y-\frac{b}{2}(p_x^2-p_y^2)\overline{x}\ .
\end{eqnarray}
The solution for $G_2$ is quite similar to above:
\begin{eqnarray}
\overline{p_x}&=&\frac{4p_x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,\\
\overline{p_y}&=&\frac{4p_y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,\\
\overline{x}&=&\frac{\partial G_2}{\partial\overline{p_x}}=x-\frac{b}{2}(x^2-y^2)\overline{p_y}\ ,\\
\overline{y}&=&\frac{\partial G_2}{\partial\overline{p_y}}=y-\frac{b}{2}(x^2-y^2)\overline{p_x}\ .
\end{eqnarray}

SubjectRe: SAD Update. V1.0.10.3.10a02. Fringe of Solenoid.
Article No762
Date: 2009/12/30(Wed) 14:43:36
ContributorK. Oide
Dear Users,

1. Now this version includes SOL fringe in tracking, calc, and emittance. Description in LaTeX follows. (The dependence on p is not written here but it is in the coding.) In the actual implementation G1/2, G2, G1/2 are applied successively.

============================

\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}(s/f+1/2)\theta(s+f/2)+\frac{B_0(x^2+y^2)y}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}(s/f+1/2)\theta(s+f/2)-\frac{B_0(x^2+y^2)x}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry.

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/4\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/4\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/4\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/4
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0p_0/(B\rho p$, up to the first order of $B_0$. The transformation (\ref{apptrans}) can be generated by a generating function:
\begin{equation}
G(\overline{x},p_x,\overline{y},p_y)=\overline{x}p_x+\overline{y}p_y-\frac{b}{4}\left[(p_x^2-p_y^2)\overline{x}\overline{y}-p_xp_y(\overline{x}^2-\overline{y}^2)\right]\ ,\label{genf}
\end{equation}
with the accuracy of the first order of $b$. An interesting thing is that (\ref{genf}) is independent on the length of fringe, $f$.

We can solve (\ref{genf}) by two parts
\begin{eqnarray}
G_1(\overline{x},p_x,\overline{y},p_y)&=&\overline{x}p_x+\overline{y}p_y-\frac{b}{4}(p_x^2-p_y^2)\overline{x}\overline{y}\label{genf1}\\
G_2(x,\overline{p_x},y,\overline{p_y})&=&x\overline{p_x}+y\overline{p_y}-\frac{b}{4}(x^2-y^2)\overline{p_x}\overline{p_y}\ ,\label{genf2}
\end{eqnarray}
as we are interested only in the first order of $b$. The generating function (\ref{genf1}) has the solution for $x$ and $y$:
\begin{eqnarray}
x&=&\frac{\partial G_1}{\partial p_x}=\overline{x}-\frac{b}{2}\overline{x}\overline{y}p_x\\
y&=&\frac{\partial G_1}{\partial p_y}=\overline{y}+\frac{b}{2}\overline{x}\overline{y}p_y
\end{eqnarray}
which are satisfied by
\begin{eqnarray}
\overline{x}&=&\frac{4x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,\\
\overline{y}&=&\frac{4y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2+4b(p_yx-p_xy)}}\ ,
\end{eqnarray}
assuming that the terms with $b$ are smaller than 1.
Then the transformations for momenta caused by $G_1$ are given by
\begin{eqnarray}
\overline{p_x}&=&\frac{\partial G_1}{\partial\overline{x}}=p_x-\frac{b}{4}(p_x^2-p_y^2)\overline{y}\ ,\\
\overline{p_y}&=&\frac{\partial G_1}{\partial\overline{y}}=p_y-\frac{b}{4}(p_x^2-p_y^2)\overline{x}\ .
\end{eqnarray}
The solution for $G_2$ is quite similar to above:
\begin{eqnarray}
\overline{p_x}&=&\frac{4p_x}{2-b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,\\
\overline{p_y}&=&\frac{4p_y}{2+b(p_yx+p_xy)+\sqrt{4+b^2(p_yx+p_xy)^2-4b(p_yx-p_xy)}}\ ,\\
\overline{x}&=&\frac{\partial G_2}{\partial\overline{p_x}}=x-\frac{b}{4}(x^2-y^2)\overline{p_y}\ ,\\
\overline{y}&=&\frac{\partial G_2}{\partial\overline{p_y}}=y-\frac{b}{4}(x^2-y^2)\overline{p_x}\ .
\end{eqnarray}

SubjectRe: SAD Update. V1.0.10.3.10a03. Fringe of Solenoid.
Article No763
Date: 2009/12/31(Thu) 14:42:24
ContributorK. Oide
Dear Users,

1. Now a better transformation, which is completely reversible, is implemented. Description is below.

=====================

\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}(s/f+1/2)\theta(s+f/2)+\frac{B_0(x^2+y^2)y}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}(s/f+1/2)\theta(s+f/2)-\frac{B_0(x^2+y^2)x}{8f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry.

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/4p^2\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/4p^2\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/4p^2\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/4p^2
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0/(B\rho)$, up to the first order of $B_0$. The transformation (\ref{apptrans}) is expressed as $\exp(:H:)$ with a Hamiltonian:
\begin{equation}
H=-\frac{b}{4p^2}(xp_y-yp_x)(xp_x+yp_y)\ .\label{hami}
\end{equation}

To solve Eq.~{\ref{hami}), it is convenient to use another set of variables:
\begin{equation}
\begin{pmatrix}
r\\ p_r\\ \varphi\\ p_\varphi\end{pmatrix}=\begin{pmatrix}
\log(x^2+y^2)/2\\xp_x+yp_y \\
\tan^{-1}(y/x)\\
xp_y-yp_x\end{pmatrix}\ ,
\end{equation}
which is generated by a generating function:
\begin{equation}
G(x,p_r,y,p_\varphi)=\frac{\log(x^2+y^2)}{2}p_r+\tan^{-1}\left(\frac{y}{x}\right)p_\varphi\ .
\end{equation}
Then the Hamiltonian (\ref{hami}) is rewritten as
\begin{equation}
H=-\frac{b}{4p^2}p_\varphi p_r\ .\label{hami1}
\end{equation}

The transformation with (\ref{hami1}) is simply written as:
\begin{equation}
\begin{pmatrix}
r_1\\ \varphi_1 \end{pmatrix}=\begin{pmatrix}r_0-bp_\varphi/4p^2\\ \varphi_0-bp_r/4p^2\end{pmatrix}\ ,
\end{equation}
where $p_r$ and $p_\varphi$ are constant.

SubjectRe: SAD Update. V1.0.10.3.10a04. Fringe of Solenoid.
Article No764
Date: 2009/12/31(Thu) 19:26:03
ContributorK. Oide
Dear Users,

1. There may be a factor of 2 difference. See below.
===================================

\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}{\rm max}(s+f/2,0)+\frac{B_0(x^2+y^2)y}{16f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}{\rm max}(s+f/2,0)-\frac{B_0(x^2+y^2)x}{16f}\left(\delta(s+f/2)-\delta(s-f/2)\right)\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry.

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/8p^2\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/8p^2\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/8p^2\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/8p^2
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0/(B\rho)$, up to the first order of $B_0$. The transformation (\ref{apptrans}) is expressed as $\exp(:H:)$ with a Hamiltonian:
\begin{equation}
H=-\frac{b}{8p^2}(xp_y-yp_x)(xp_x+yp_y)\ .\label{hami}
\end{equation}

To solve Eq.~{\ref{hami}), it is convenient to use another set of variables:
\begin{equation}
\begin{pmatrix}
r\\ p_r\\ \varphi\\ p_\varphi\end{pmatrix}=\begin{pmatrix}
\log(x^2+y^2)/2\\xp_x+yp_y \\
\tan^{-1}(y/x)\\
xp_y-yp_x\end{pmatrix}\ ,
\end{equation}
which is generated by a generating function:
\begin{equation}
G(x,p_r,y,p_\varphi)=\frac{\log(x^2+y^2)}{2}p_r+\tan^{-1}\left(\frac{y}{x}\right)p_\varphi\ .
\end{equation}
Then the Hamiltonian (\ref{hami}) is rewritten as
\begin{equation}
H=-\frac{b}{8p^2}p_\varphi p_r\ .\label{hami1}
\end{equation}

The transformation with (\ref{hami1}) is simply written as:
\begin{equation}
\begin{pmatrix}
r_1\\ \varphi_1 \end{pmatrix}=\begin{pmatrix}r_0-bp_\varphi/8p^2\\ \varphi_0-bp_r/8p^2\end{pmatrix}\ ,
\end{equation}
where $p_r$ and $p_\varphi$ are constant.

SubjectRe^2: SAD Update. V1.0.10.3.10a04. Fringe of Solenoid.
Article No765
Date: 2010/01/01(Fri) 07:38:06
ContributorK. Oide
Dear Users,

1. A little bit detailed description follows. No change in the coding this time.

=============================


\section{Model of Magnetic Field}
We consider a longitudinal solenoid field with an axial symmetry:
\begin{equation}
B_z(s)= \left\{\begin{array}{lc}
0, & s<-f/2\\
B_0(s/f+1/2), & -f/2\le s \le f/2\\
B_0, & f/2<s
\end{array}\right.\ ,
\end{equation}
where $f$ is the length of the fringe. The associated vector potentials for $s\le f/2$ are
\begin{eqnarray}
A_x&=&-\frac{B_0y}{2}{\rm max}(s+f/2,0)+\frac{B_0(x^2+y^2)y}{16f}\left[\delta(s+f/2)-\delta(s-f/2)\right]\ ,\label{ax}\\
A_y&=& \frac{B_0x}{2}{\rm max}(s+f/2,0)-\frac{B_0(x^2+y^2)x}{16f}\left[\delta(s+f/2)-\delta(s-f/2)\right]\ ,\label{ay}\\
A_z&=&0\ ,
\end{eqnarray}
where the terms with $\delta$-functions are necessary in order to satisfy the Maxwell equations, while keeping the axial symmetry. The magnetic field derived from the $\delta$-function terms in (\ref{ax}) and (\ref{ay}) are
\begin{eqnarray}
B_x&=&-\frac{\partial A_y}{\partial s}=\frac{B_0(x^2+y^2)x}{16f}\left[\delta'(s+f/2)-\delta'(s-f/2)\right]\ ,\label{bx}\\
B_y&=& \frac{\partial A_x}{\partial s}=\frac{B_0(x^2+y^2)y}{16f}\left[\delta'(s+f/2)-\delta'(s-f/2)\right]\ ,\label{by}\\
B_z&=&\frac{\partial A_y}{\partial x}-\frac{\partial A_x}{\partial y}=-\frac{B_0(x^2+y^2)}{4f}\left[\delta(s+f/2)-\delta(s-f/2)\right]\ .\label{bx}
\end{eqnarray}
Thus the changes in momenta due to these fields at $s=-f/2$ are
\begin{eqnarray}
p_x'&=&\frac{p_y}{p}B_z-B_y=-\frac{p_y}{p}\frac{B_0(x^2+y^2)}{4f}\delta(s+f/2)-\frac{B_0(x^2+y^2)y}{16f}\delta'(s+f/2)\\
&=&\frac{B_0}{16f}\left[-(3x^2+y^2)\frac{p_y}{p}+2xy\frac{p_x}{p}\right]\delta(s+f/2)\label{dpx}\\
p_y'&=&-\frac{p_x}{p}B_z+B_x=\frac{p_x}{p}\frac{B_0(x^2+y^2)}{4f}\delta(s+f/2)+\frac{B_0(x^2+y^2)y}{16f}\delta'(s+f/2)\\
&=&\frac{B_0}{16f}\left[(x^2+3y^2)\frac{p_x}{p}-2xy\frac{p_y}{p}\right]\delta(s+f/2)\ ,\label{dpy}
\end{eqnarray}
where we have used $x'\approx p_x/p$ and $y'\approx p_y/p$. The equations of motion (\ref{dpx}) and (\ref{dpy}) are derived from a Hamiltonian:
\begin{equation}
D=\frac{B_0}{16fp}(x^2+y^2)(xp_y-yp_x)\left[\delta(s+f/2)-\delta(s-f/2)\right]\ .\label{D}
\end{equation}

\section{Solution}
The fringe field has at least two effects, linear and nonlinear. The linear effect is caused by the first terms in Eqs. (\ref{ax}) and (\ref{ay}) that are linear in $x$ and $y$. We can expect that such linear effects can be expressed by a model with hard edges sliced along $s$, if the number of slices is sufficiently large. Thus here we concentrate on the nonlinear effects that are caused by the $\delta$-function terms in Eqs. (\ref{ax}) and (\ref{ay}), or their Hamitonian (\ref{D}).

Let us obtain the transformation associated with the nonlinear terms up to the first order of $B_0$. It is expressed as
\begin{equation}
\exp(:-f/2:)\exp(:-\delta:)\exp(:f:)\exp(:\delta:)\exp(:-f/2:)\ ,\label{trans}
\end{equation}
where $\exp(:-f/2:)$ is a drift-back by a distance $-f/2$, and $\exp(:\delta:)$ is the nonlinear term at $s=-f/2$, etc. Then the transformation (\ref{trans}) is approximated as
\begin{equation}
\begin{pmatrix}
x_1\\p_{x1}\\y_1\\p_{y1}\end{pmatrix}=
\begin{pmatrix}
x_0+b\left(2p_{x0}x_0y_0-p_{y0}(x_0^2-y_0^2)\right)/8p^2\\
p_{x0}+b\left(2p_{x0}p_{y0}x_0-(p_{x0}^2-p_{y0}^2)y_0\right)/8p^2\\
y_0-b\left(2p_{y0}x_0y_0+p_{x0}(x_0^2-y_0^2)\right)/8p^2\\
p_{y0}-b\left(2p_{x0}p_{y0}y_0+(p_{x0}^2-p_{y0}^2)x_0\right)/8p^2
\end{pmatrix}\ ,\label{apptrans}
\end{equation}
where $b\equiv B_0/(B\rho)$, up to the first order of $B_0$. The transformation (\ref{apptrans}) is expressed as $\exp(:H:)$ with a Hamiltonian:
\begin{equation}
H=-\frac{b}{8p^2}(xp_y-yp_x)(xp_x+yp_y)\ .\label{hami}
\end{equation}
It is interesting that the transformation (\ref{apptrans}) and thus the Hamiltonian (\ref{hami}) are independent on the length of fringe, $f$.

To solve Eq.~{\ref{hami}), it is convenient to use another set of variables:
\begin{equation}
\begin{pmatrix}
r\\ p_r\\ \varphi\\ p_\varphi\end{pmatrix}=\begin{pmatrix}
\log(x^2+y^2)/2\\xp_x+yp_y \\
\tan^{-1}(y/x)\\
xp_y-yp_x\end{pmatrix}\ ,
\end{equation}
which is generated by a generating function:
\begin{equation}
G(x,p_r,y,p_\varphi)=\frac{\log(x^2+y^2)}{2}p_r+\tan^{-1}\left(\frac{y}{x}\right)p_\varphi\ .
\end{equation}
Then the Hamiltonian (\ref{hami}) is rewritten as
\begin{equation}
H=-\frac{b}{8p^2}p_\varphi p_r\ .\label{hami1}
\end{equation}

The transformation with (\ref{hami1}) is simply written as:
\begin{equation}
\begin{pmatrix}
r_1\\ \varphi_1 \end{pmatrix}=\begin{pmatrix}r_0-bp_\varphi/8p^2\\ \varphi_0-bp_r/8p^2\end{pmatrix}\ ,
\end{equation}
where $p_r$ and $p_\varphi$ are constant.

SubjectRe: SAD Update. V1.0.10.3.10a10. Fringe of Solenoid.
Article No766
Date: 2010/01/05(Tue) 09:58:41
ContributorK. Oide
Dear Users,

1. The next version will have a new keyword F1 for SOL. It only affects the emittance calculation to determine the magnitude of the transverse field at the fringe. If F1 is zero (default), no radiation arises.

SubjectRe: SAD Update. V1.0.10.4a08. Fringe of Solenoid.
Article No769
Date: 2010/01/28(Thu) 13:48:59
ContributorK. Oide
Dear Users,

1. When BZ does not change at a SOL element, now all calculation of nonlinear fringe is bypassed.