Commit 98531c5b authored by snuverink_j's avatar snuverink_j
Browse files

fix sinus by hand

parent cc716c47
...@@ -12,9 +12,9 @@ In \textit{OPAL-t} the elements are implemented as external fields that are read ...@@ -12,9 +12,9 @@ In \textit{OPAL-t} the elements are implemented as external fields that are read
\end{equation} \end{equation}
To maximize the energy gain we have to take the derivative with respect to the lag, $\varphi$ and set the result to zero: To maximize the energy gain we have to take the derivative with respect to the lag, $\varphi$ and set the result to zero:
\begin{multline} \begin{multline}
\differential{\Delta E(\varphi,r)}{\varphi} = -\int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) n(\omega t(z,\varphi) + \varphi) E_z(z,r)\\ \differential{\Delta E(\varphi,r)}{\varphi} = -\int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) \sin(\omega t(z,\varphi) + \varphi) E_z(z,r)\\
= -\cos(\varphi) \int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) n(\omega t(z,\varphi)) E_z(z,r) dz \\ = -\cos(\varphi) \int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) \sin(\omega t(z,\varphi)) E_z(z,r) dz \\
-n(\varphi) \int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) \cos(\omega t(z,\varphi)) E_z(z,r) dz \stackrel{!}{=} 0. -\sin(\varphi) \int_{z_\text{begin}}^{z_\text{end}} (1 + \omega \diffp{t(z,\varphi)}{\varphi}) \cos(\omega t(z,\varphi)) E_z(z,r) dz \stackrel{!}{=} 0.
\end{multline} \end{multline}
Thus to get the maximum energy the lag has to fulfill Thus to get the maximum energy the lag has to fulfill
\begin{equation} \label{eq:rulelag} \begin{equation} \label{eq:rulelag}
...@@ -23,7 +23,7 @@ Thus to get the maximum energy the lag has to fulfill ...@@ -23,7 +23,7 @@ Thus to get the maximum energy the lag has to fulfill
where where
\begin{equation} \begin{equation}
\label{eq:Gamma1} \label{eq:Gamma1}
\Gamma_1 = \sum_{i=1}^{N-1} (1 + \omega \diffp{t}{\varphi}) \int_{z_{i-1}}^{z_{i}} n\left(\omega (t_{i-1} + \Delta t_{i}\frac{z-z_{i-1}}{\Delta z_{i}})\right)\left(E_{z,i-1} + \Delta E_{z,i} \frac{z-z_{i-1}}{\Delta z_{i}}\right) dz \Gamma_1 = \sum_{i=1}^{N-1} (1 + \omega \diffp{t}{\varphi}) \int_{z_{i-1}}^{z_{i}} \sin\left(\omega (t_{i-1} + \Delta t_{i}\frac{z-z_{i-1}}{\Delta z_{i}})\right)\left(E_{z,i-1} + \Delta E_{z,i} \frac{z-z_{i-1}}{\Delta z_{i}}\right) dz
\end{equation} \end{equation}
and and
\begin{equation} \begin{equation}
...@@ -40,10 +40,10 @@ and ...@@ -40,10 +40,10 @@ and
\end{equation*} \end{equation*}
where where
\begin{align*} \begin{align*}
\Gamma_{11,i} &= \int_0^1 n(\omega(t_{i-1} + \tau \Delta t_{i})) d\tau = - \frac{\cos(\omega t_{i}) - \cos(\omega t_{i-1})}{\omega \Delta t_{i}}\\ \Gamma_{11,i} &= \int_0^1 \sin(\omega(t_{i-1} + \tau \Delta t_{i})) d\tau = - \frac{\cos(\omega t_{i}) - \cos(\omega t_{i-1})}{\omega \Delta t_{i}}\\
\Gamma_{12,i} &= \int_0^1 n(\omega(t_{i-1} + \tau \Delta t_{i})) \tau d\tau = \frac{-\omega \Delta t_{i} \cos(\omega t_{i}) + n(\omega t_{i}) - n(\omega t_{i-1})}{\omega^2 (\Delta t_{i})^2}\\ \Gamma_{12,i} &= \int_0^1 \sin(\omega(t_{i-1} + \tau \Delta t_{i})) \tau d\tau = \frac{-\omega \Delta t_{i} \cos(\omega t_{i}) + \sin(\omega t_{i}) - \sin(\omega t_{i-1})}{\omega^2 (\Delta t_{i})^2}\\
\Gamma_{21,i} &= \int_0^1 \cos(\omega(t_{i-1} + \tau \Delta t_{i})) d\tau = \frac{n(\omega t_{i}) - n(\omega t_{i-1})}{\omega \Delta t_{i}}\\ \Gamma_{21,i} &= \int_0^1 \cos(\omega(t_{i-1} + \tau \Delta t_{i})) d\tau = \frac{\sin(\omega t_{i}) - \sin(\omega t_{i-1})}{\omega \Delta t_{i}}\\
\Gamma_{22,i} &= \int_0^1 \cos(\omega(t_{i-1} + \tau \Delta t_{i})) \tau d\tau = \frac{\omega \Delta t_{i} n(\omega t_{i}) + \cos(\omega t_{i}) - \cos(\omega t_{i-1})}{\omega^2 (\Delta t_{i})^2} \Gamma_{22,i} &= \int_0^1 \cos(\omega(t_{i-1} + \tau \Delta t_{i})) \tau d\tau = \frac{\omega \Delta t_{i} \sin(\omega t_{i}) + \cos(\omega t_{i}) - \cos(\omega t_{i-1})}{\omega^2 (\Delta t_{i})^2}
\end{align*} \end{align*}
It remains to find the progress of time with respect to the position. In \textit{OPAL} this is done iteratively starting with It remains to find the progress of time with respect to the position. In \textit{OPAL} this is done iteratively starting with
...@@ -85,7 +85,7 @@ FINLB02_RAC: TravelingWave, L=2.80, VOLT=14.750*30/31, ...@@ -85,7 +85,7 @@ FINLB02_RAC: TravelingWave, L=2.80, VOLT=14.750*30/31,
\end{fmpage} \end{fmpage}
For this example we find For this example we find
\begin{align*} \begin{align*}
V_\text{core} &= \frac{V_{0}}{n(2.0/3.0 \pi)} = \frac{2 V_{0}}{\sqrt{3.0}}\\ V_\text{core} &= \frac{V_{0}}{\sin(2.0/3.0 \pi)} = \frac{2 V_{0}}{\sqrt{3.0}}\\
\varphi_\text{c1} &= \frac{\pi}{6}\\ \varphi_\text{c1} &= \frac{\pi}{6}\\
\varphi_\text{c2} &= \frac{\pi}{2}\\ \varphi_\text{c2} &= \frac{\pi}{2}\\
\varphi_\text{ef} &= - 2\pi \cdot(\text{\texttt{NUMCELLS}} - 1) \cdot \text{\texttt{MODE}} = 26\pi \varphi_\text{ef} &= - 2\pi \cdot(\text{\texttt{NUMCELLS}} - 1) \cdot \text{\texttt{MODE}} = 26\pi
...@@ -100,25 +100,25 @@ If $\beta$ doesn't change much along the traveling wave structure (ultra relativ ...@@ -100,25 +100,25 @@ If $\beta$ doesn't change much along the traveling wave structure (ultra relativ
\end{multline*} \end{multline*}
Here $\beta c = 2.9886774\cdot10^8\;\text{m s}^{-2}$, $\omega = 2\pi\cdot 1.4989534\cdot10^9$~Hz and, the cell length, $s = 0.06\bar{6}$~m. To maximize this energy we have to take the derivative with respect to $\varphi$ and set the result to $0$. We split the field up into the core field, $E_z^{(1)}$ and the fringe fields (entry fringe field plus first half cell concatenated with the exit fringe field plus last half cell), $E_z^{(2)}$. The core fringe field is periodic with a period of $3\,s$. We thus find Here $\beta c = 2.9886774\cdot10^8\;\text{m s}^{-2}$, $\omega = 2\pi\cdot 1.4989534\cdot10^9$~Hz and, the cell length, $s = 0.06\bar{6}$~m. To maximize this energy we have to take the derivative with respect to $\varphi$ and set the result to $0$. We split the field up into the core field, $E_z^{(1)}$ and the fringe fields (entry fringe field plus first half cell concatenated with the exit fringe field plus last half cell), $E_z^{(2)}$. The core fringe field is periodic with a period of $3\,s$. We thus find
\begin{multline*} \begin{multline*}
0 \stackrel{!}{=} \int_{0}^{1.5\cdot s} n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z,r)\, dz \\ 0 \stackrel{!}{=} \int_{0}^{1.5\cdot s} \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z,r)\, dz \\
+ \frac{2}{\sqrt{3}} \int_{0}^{39\cdot s}n\left(\omega \left(\frac{z + 1.5\,s}{\beta c} + t_{0}\right) + \frac{\pi}{6} + \varphi \right) E_z^{(1)}(z \text{ mod}(3\,s)\;\;\qquad,r)\,dz \\ + \frac{2}{\sqrt{3}} \int_{0}^{39\cdot s}\sin\left(\omega \left(\frac{z + 1.5\,s}{\beta c} + t_{0}\right) + \frac{\pi}{6} + \varphi \right) E_z^{(1)}(z \text{ mod}(3\,s)\;\;\qquad,r)\,dz \\
+ \frac{2}{\sqrt{3}} \int_{0}^{39\cdot s}n\left(\omega \left(\frac{z + 1.5\,s}{\beta c} + t_{0}\right) + \frac{\pi}{2} + \varphi \right) E_z^{(1)}((z + s) \text{ mod} (3\,s),r)\, dz \\ + \frac{2}{\sqrt{3}} \int_{0}^{39\cdot s}\sin\left(\omega \left(\frac{z + 1.5\,s}{\beta c} + t_{0}\right) + \frac{\pi}{2} + \varphi \right) E_z^{(1)}((z + s) \text{ mod} (3\,s),r)\, dz \\
+ \int_{1.5\cdot s}^{3\cdot s} n\left(\omega\left(\frac{z + 39\,s}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z,r)\, dz + \int_{1.5\cdot s}^{3\cdot s} \sin\left(\omega\left(\frac{z + 39\,s}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z,r)\, dz
\end{multline*} \end{multline*}
This equation is much simplified if we take into account that $\omega / \beta c \approx 10\pi$. We then get This equation is much simplified if we take into account that $\omega / \beta c \approx 10\pi$. We then get
\begin{multline*} \begin{multline*}
0 \stackrel{!}{=} \int_{0}^{3\cdot s} n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z)\, dz \\ 0 \stackrel{!}{=} \int_{0}^{3\cdot s} \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) E_z^{(2)}(z)\, dz \\
+ \frac{26}{\sqrt{3}} \int_{0}^{3\cdot s}\left(n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{7\pi}{6} + \varphi \right) + \frac{26}{\sqrt{3}} \int_{0}^{3\cdot s}\left(\sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{7\pi}{6} + \varphi \right)
+ n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{5\pi}{6} + \varphi \right)\right) E_z^{(1)}(z)\, dz \\ + \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{5\pi}{6} + \varphi \right)\right) E_z^{(1)}(z)\, dz \\
= \int_{0}^{3\cdot s}n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) \left(E_z^{(2)} - 26\cdot E_z^{(1)}\right)(z)\,dz = \int_{0}^{3\cdot s}\sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) \left(E_z^{(2)} - 26\cdot E_z^{(1)}\right)(z)\,dz
\end{multline*} \end{multline*}
where we used where we used
\begin{multline*} \begin{multline*}
\int_{0}^{3\cdot s} n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{3\pi}{2} + \varphi\right) E_z^{(1)}((z + s) \text{ mod}(3\,s),r) dz \\ \int_{0}^{3\cdot s} \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{3\pi}{2} + \varphi\right) E_z^{(1)}((z + s) \text{ mod}(3\,s),r) dz \\
\stackrel{z' = z + s}{\longrightarrow} \int_{s}^{4\cdot s} n\left(\omega \left(\frac{z'-s}{\beta c} + t_{0} \right) + \frac{3\pi}{2} + \varphi\right)E_z^{(1)}(z' \text{ mod}(3\,s),r)dz' \\ \stackrel{z' = z + s}{\longrightarrow} \int_{s}^{4\cdot s} \sin\left(\omega \left(\frac{z'-s}{\beta c} + t_{0} \right) + \frac{3\pi}{2} + \varphi\right)E_z^{(1)}(z' \text{ mod}(3\,s),r)dz' \\
= \int_{0}^{3\cdot s} n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{5\pi}{6} + \varphi\right) E_z^{(1)}(z,r)\,dz. = \int_{0}^{3\cdot s} \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{5\pi}{6} + \varphi\right) E_z^{(1)}(z,r)\,dz.
\end{multline*} \end{multline*}
In the last equal sign we used the fact that both functions, $n(\frac{\omega}{\beta c}z)$ and $E_z^{(1)}$ have a periodicity of $3\cdot s$ to shift the boundaries of the integral. In the last equal sign we used the fact that both functions, $\sin(\frac{\omega}{\beta c}z)$ and $E_z^{(1)}$ have a periodicity of $3\cdot s$ to shift the boundaries of the integral.
Using the convolution theorem we find Using the convolution theorem we find
\begin{equation*} \begin{equation*}
...@@ -129,7 +129,7 @@ where ...@@ -129,7 +129,7 @@ where
\begin{align*} \begin{align*}
g(z) & = g(z) & =
\begin{cases} \begin{cases}
-n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right)\right)\qquad & 0 \le z \le 3\cdot s\\ -\sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right)\right)\qquad & 0 \le z \le 3\cdot s\\
0 & \text{otherwise} 0 & \text{otherwise}
\end{cases}\\ \end{cases}\\
G(z) & = G(z) & =
...@@ -147,12 +147,12 @@ where ...@@ -147,12 +147,12 @@ where
\end{align*} \end{align*}
Here we also used some trigonometric identities: Here we also used some trigonometric identities:
\begin{multline*} \begin{multline*}
n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \pi + \frac{\pi}{6} + \varphi \right) + \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \pi + \frac{\pi}{6} + \varphi \right) +
n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \pi - \frac{\pi}{6} + \varphi \right) \\ \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \pi - \frac{\pi}{6} + \varphi \right) \\
= -\left(n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{\pi}{6} + \varphi\right) + = -\left(\sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \frac{\pi}{6} + \varphi\right) +
n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) - \frac{\pi}{6} + \varphi\right)\right) \\ \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) - \frac{\pi}{6} + \varphi\right)\right) \\
= -2\cdot \cos\left(\frac{\pi}{6}\right) n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) \\ = -2\cdot \cos\left(\frac{\pi}{6}\right) \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) \\
= -\sqrt{3} n\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right) = -\sqrt{3} \sin\left(\omega \left(\frac{z}{\beta c} + t_{0}\right) + \varphi\right)
\end{multline*} \end{multline*}
\input{footer} \input{footer}
\ No newline at end of file
...@@ -834,8 +834,8 @@ added to each emitted particle's momentum in a random way: ...@@ -834,8 +834,8 @@ added to each emitted particle's momentum in a random way:
\begin{equation*} \begin{equation*}
\begin{aligned} \begin{aligned}
p_{total} &= \sqrt{\left(\frac{\texttt{EKIN}}{mc^{2}} + 1\right)^{2} - 1} \\ p_{total} &= \sqrt{\left(\frac{\texttt{EKIN}}{mc^{2}} + 1\right)^{2} - 1} \\
p_{x} &= p_{total} n(\phi) \cos(\theta)) \\ p_{x} &= p_{total} \sin(\phi) \cos(\theta)) \\
p_{y} &= p_{total} n(\phi) n(\theta)) \\ p_{y} &= p_{total} \sin(\phi) \sin(\theta)) \\
p_{z} &= p_{total} |{\cos(\theta)}| p_{z} &= p_{total} |{\cos(\theta)}|
\end{aligned} \end{aligned}
\end{equation*} \end{equation*}
......
...@@ -263,7 +263,7 @@ edge angle, and a positive exit edge angle. ...@@ -263,7 +263,7 @@ edge angle, and a positive exit edge angle.
\item[L] \item[L]
Chord length of the bend reference arc in meters (see Figure~\ref{sbend}), given by: Chord length of the bend reference arc in meters (see Figure~\ref{sbend}), given by:
\begin{equation*} \begin{equation*}
L = 2 R sin\left(\frac{\alpha}{2}\right) L = 2 R \sin\left(\frac{\alpha}{2}\right)
\end{equation*} \end{equation*}
\item[GAP] \item[GAP]
...@@ -863,10 +863,10 @@ F'''(z) &\equiv \diff[3]{F(z)}{z} ...@@ -863,10 +863,10 @@ F'''(z) &\equiv \diff[3]{F(z)}{z}
we can expand the field off axis, with the result: we can expand the field off axis, with the result:
\begin{align*} \begin{align*}
B_x(\Delta_x, y, \Delta_z) &= -\frac{B_0 \frac{n}{R}}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z}}} e^{-\frac{n}{R} \Delta_x} n \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] F(\Delta_z) \\ B_x(\Delta_x, y, \Delta_z) &= -\frac{B_0 \frac{n}{R}}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z}}} e^{-\frac{n}{R} \Delta_x} \sin \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] F(\Delta_z) \\
B_y(\Delta_x, y, \Delta_z) &= B_0 e^{-\frac{n}{R} \Delta_x} \cos \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] F(\Delta_z) \\ B_y(\Delta_x, y, \Delta_z) &= B_0 e^{-\frac{n}{R} \Delta_x} \cos \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] F(\Delta_z) \\
B_z(\Delta_x, y, \Delta_z) &= B_0 e^{-\frac{n}{R} \Delta_x} \left\{\frac{F'(\Delta_z)}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} n \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] \right. \\ B_z(\Delta_x, y, \Delta_z) &= B_0 e^{-\frac{n}{R} \Delta_x} \left\{\frac{F'(\Delta_z)}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} \sin \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right] \right. \\
&- \frac{1}{2 \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} \left(F'''(\Delta_z) - \frac{F'(\Delta_z) F''(\Delta_z)}{F(\Delta_z)} \right) \left[ \frac{n \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right]}{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right. \\ &- \frac{1}{2 \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} \left(F'''(\Delta_z) - \frac{F'(\Delta_z) F''(\Delta_z)}{F(\Delta_z)} \right) \left[ \frac{\sin \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right]}{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right. \\
&- \left. \left. y \frac{\cos \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right]}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} \right] \right\} &- \left. \left. y \frac{\cos \left[ \left( \sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}} \right) y \right]}{\sqrt{\frac{n^2}{R^2} + \frac{F''(\Delta_z)}{F(\Delta_z)}}} \right] \right\}
\end{align*} \end{align*}
These expression are not well suited for numerical calculation, so, we expand them about $y$ to $O(y^2)$ to obtain: These expression are not well suited for numerical calculation, so, we expand them about $y$ to $O(y^2)$ to obtain:
...@@ -1437,7 +1437,7 @@ label:RFCAVITY, APERTURE=real-vector, L=real, ...@@ -1437,7 +1437,7 @@ label:RFCAVITY, APERTURE=real-vector, L=real,
\item[VOLT] \item[VOLT]
The peak RF voltage (default: 0~MV). The peak RF voltage (default: 0~MV).
The effect of the cavity is The effect of the cavity is
$\delta E=\text{\texttt{VOLT}}\cdotn(2\pi(\text{\texttt{LAG}}-\text{\texttt{HARMON}}\cdot f_0 t))$. $\delta E=\text{\texttt{VOLT}}\cdot\sin(2\pi(\text{\texttt{LAG}}-\text{\texttt{HARMON}}\cdot f_0 t))$.
\item[LAG] \item[LAG]
The phase lag [{rad}] (default: 0). In \textit{OPAL-t} this phase is in general relative to the phase at which the reference particle gains the most energy. This phase is determined using an auto-phasing algorithm (see~Appendix~\ref{autophasing}). This auto-phasing algorithm can be switched off, see \texttt{APVETO}. The phase lag [{rad}] (default: 0). In \textit{OPAL-t} this phase is in general relative to the phase at which the reference particle gains the most energy. This phase is determined using an auto-phasing algorithm (see~Appendix~\ref{autophasing}). This auto-phasing algorithm can be switched off, see \texttt{APVETO}.
\end{kdescription} \end{kdescription}
...@@ -1547,7 +1547,7 @@ placed using the \texttt{RingDefinition} element. ...@@ -1547,7 +1547,7 @@ placed using the \texttt{RingDefinition} element.
\end{kdescription} \end{kdescription}
The field inside the cavity is given by The field inside the cavity is given by
\begin{equation} \begin{equation}
\mathbf{E} = \big(0, 0, E_0(t)n[2\pi f(t) t+\phi(t)]\big) \mathbf{E} = \big(0, 0, E_0(t)\sin[2\pi f(t) t+\phi(t)]\big)
\end{equation} \end{equation}
with no field outside the cavity boundary. There is no magnetic field or with no field outside the cavity boundary. There is no magnetic field or
transverse dependence on electric field. transverse dependence on electric field.
...@@ -1637,7 +1637,7 @@ Figure~\ref{FINSB-RAC-field} using ...@@ -1637,7 +1637,7 @@ Figure~\ref{FINSB-RAC-field} using
\begin{equation*} \begin{equation*}
\begin{split} \begin{split}
\mathbf{E} ( \mathbf{r},t ) &= \frac{\text{\texttt{VOLT}}}{n (2 \pi \cdot \text{\texttt{MODE}})} \\ \mathbf{E} ( \mathbf{r},t ) &= \frac{\text{\texttt{VOLT}}}{\sin (2 \pi \cdot \text{\texttt{MODE}})} \\
&\phantom{=} &\phantom{=}
\times \Biggl\{ \mathbf{E_{from-map}} (x,y,z) \cdot \cos \biggl( 2 \pi \cdot \text{\texttt{FREQ}} \cdot t + \text{\texttt{LAG}}+ \frac{\pi}{2} \cdot \text{\texttt{MODE}} \Bigr) \\ \times \Biggl\{ \mathbf{E_{from-map}} (x,y,z) \cdot \cos \biggl( 2 \pi \cdot \text{\texttt{FREQ}} \cdot t + \text{\texttt{LAG}}+ \frac{\pi}{2} \cdot \text{\texttt{MODE}} \Bigr) \\
&\phantom{= \times \Biggl\{} &\phantom{= \times \Biggl\{}
...@@ -1664,7 +1664,7 @@ label:TRAVELINGWAVE, APERTURE=real-vector, L=real, ...@@ -1664,7 +1664,7 @@ label:TRAVELINGWAVE, APERTURE=real-vector, L=real,
\item[VOLT] \item[VOLT]
The peak RF voltage (default: 0~MV). The peak RF voltage (default: 0~MV).
The effect of the cavity is The effect of the cavity is
$\delta E=\text{\texttt{VOLT}}\cdotn(\text{\texttt{LAG}}- 2\pi\cdot\text{\texttt{FREQ}}\cdot t)$. $\delta E=\text{\texttt{VOLT}}\cdot\sin(\text{\texttt{LAG}}- 2\pi\cdot\text{\texttt{FREQ}}\cdot t)$.
\item[LAG] \item[LAG]
The phase lag [{rad}] (default: 0). In \textit{OPAL-t} this phase is in general relative to the phase at which the reference particle gains the most energy. This phase is determined using an auto-phasing algorithm (see~Appendix~\ref{autophasing}). This auto-phasing algorithm can be switched off, see \texttt{APVETO}. The phase lag [{rad}] (default: 0). In \textit{OPAL-t} this phase is in general relative to the phase at which the reference particle gains the most energy. This phase is determined using an auto-phasing algorithm (see~Appendix~\ref{autophasing}). This auto-phasing algorithm can be switched off, see \texttt{APVETO}.
\item[FMAPFN] \item[FMAPFN]
......
...@@ -435,7 +435,7 @@ Given the factors ...@@ -435,7 +435,7 @@ Given the factors
\[ \[
\psi_k = (k + 1) * \texttt{ROT[k]}, \psi_k = (k + 1) * \texttt{ROT[k]},
c_k = \cos \psi_k, c_k = \cos \psi_k,
s_k = - n \psi_k, s_k = - \sin \psi_k,
f_k = \texttt{RADIUS[k]}^(k-n) * n! / k!. f_k = \texttt{RADIUS[k]}^(k-n) * n! / k!.
\] \]
the field components the field components
......
...@@ -652,12 +652,12 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}. ...@@ -652,12 +652,12 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}.
\begin{tikzpicture}[scale=4] \begin{tikzpicture}[scale=4]
\pgfmathsetmacro\Alpha{60} \pgfmathsetmacro\Alpha{60}
\pgfmathsetmacro\E2{40} \pgfmathsetmacro\E2{40}
\pgfmathsetmacronAlpha{sin(\Alpha)} \pgfmathsetmacro\sinAlpha{sin(\Alpha)}
\pgfmathsetmacro\cosAlpha{cos(\Alpha)} \pgfmathsetmacro\cosAlpha{cos(\Alpha)}
\pgfmathsetmacronAlphaHalf{sin(0.5*\Alpha)} \pgfmathsetmacro\sinAlphaHalf{sin(0.5*\Alpha)}
\pgfmathsetmacro\cosAlphaHalf{cos(0.5*\Alpha)} \pgfmathsetmacro\cosAlphaHalf{cos(0.5*\Alpha)}
\pgfmathsetmacro\width{2*nAlphaHalf*cos(10)} \pgfmathsetmacro\width{2*\sinAlphaHalf*cos(10)}
\pgfmathsetmacronE2Half{sin(0.5*\E2)} \pgfmathsetmacro\sinE2Half{sin(0.5*\E2)}
\pgfmathsetmacro\cosE2Half{cos(0.5*\E2)} \pgfmathsetmacro\cosE2Half{cos(0.5*\E2)}
% First draw rectangular magnet shape. % First draw rectangular magnet shape.
...@@ -675,15 +675,15 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}. ...@@ -675,15 +675,15 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}.
\node[above=2pt] at (-0.7,0.0) {\textbf{\color{black}Reference Trajectory}}; \node[above=2pt] at (-0.7,0.0) {\textbf{\color{black}Reference Trajectory}};
\draw[arrows=->,line width=2pt] (-1.1,0.0) -- (-0.5,0.0); \draw[arrows=->,line width=2pt] (-1.1,0.0) -- (-0.5,0.0);
\draw[arrows=->,line width=2pt] (-0.5, 0.0) -- (0.0,0.0) arc (90:60:1.0); \draw[arrows=->,line width=2pt] (-0.5, 0.0) -- (0.0,0.0) arc (90:60:1.0);
\draw[arrows=->,line width=2pt] ($(0.0, -1.0) + (nAlphaHalf, \cosAlphaHalf)$) arc (60:30:1.0) -- +(-60:0.6);%1.1160254,-0.9330127); \draw[arrows=->,line width=2pt] ($(0.0, -1.0) + (\sinAlphaHalf, \cosAlphaHalf)$) arc (60:30:1.0) -- +(-60:0.6);%1.1160254,-0.9330127);
% Draw bend angle. % Draw bend angle.
\fill[green!50!white] (0.0,-1.0) -- (0.0,-0.5) arc (90:30:0.5) -- (0.0,-1.0); \fill[green!50!white] (0.0,-1.0) -- (0.0,-0.5) arc (90:30:0.5) -- (0.0,-1.0);
\node[fill=white] at ($(0.0,-1.0) + 0.25*(nAlphaHalf,\cosAlphaHalf)$) {\Large{\textbf{\color{blue}$\alpha$}}}; \node[fill=white] at ($(0.0,-1.0) + 0.25*(\sinAlphaHalf,\cosAlphaHalf)$) {\Large{\textbf{\color{blue}$\alpha$}}};
\node[blue,left=1pt,fill=white] at (0.0, -0.5) {\Large{\textbf{$R$}}}; \node[blue,left=1pt,fill=white] at (0.0, -0.5) {\Large{\textbf{$R$}}};
\node[below=6pt,right=0pt,fill=white] at ($(0,-1) + 0.5*(nAlpha,\cosAlpha)$) {\Large{\textbf{$R$}}}; \node[below=6pt,right=0pt,fill=white] at ($(0,-1) + 0.5*(\sinAlpha,\cosAlpha)$) {\Large{\textbf{$R$}}};
\draw[arrows=<->,blue,line width=4pt] (0,0) -- (0.0,-1.0) -- ($(0,-1) + (nAlpha, \cosAlpha)$); \draw[arrows=<->,blue,line width=4pt] (0,0) -- (0.0,-1.0) -- ($(0,-1) + (\sinAlpha, \cosAlpha)$);
\begin{scope}[rotate=-20] \begin{scope}[rotate=-20]
% Draw entrance fringe field region. % Draw entrance fringe field region.
...@@ -711,13 +711,13 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}. ...@@ -711,13 +711,13 @@ Section~\ref{1DProfile1Type1} and Section~\ref{1DProfile1Type2}.
\draw (0.0, 0.4) arc (90:70:0.4); \draw (0.0, 0.4) arc (90:70:0.4);
\node[anchor=west] at (0.0, 0.6) {\Large{$E_1$}}; \node[anchor=west] at (0.0, 0.6) {\Large{$E_1$}};
\draw ($(0,-1) + (nAlpha,\cosAlpha)$) -- ($(0,-1) + 1.8*(nAlpha,\cosAlpha)$); \draw ($(0,-1) + (\sinAlpha,\cosAlpha)$) -- ($(0,-1) + 1.8*(\sinAlpha,\cosAlpha)$);
\draw ($(0,-1) + 1.4*(nAlpha,\cosAlpha)$) arc (30:70:0.4); \draw ($(0,-1) + 1.4*(\sinAlpha,\cosAlpha)$) arc (30:70:0.4);
\node at ($(1.4*nAlpha,-1+1.4*\cosAlpha) + (-0.05,0.2)$) {\Large{$E_2$}}; \node at ($(1.4*\sinAlpha,-1+1.4*\cosAlpha) + (-0.05,0.2)$) {\Large{$E_2$}};
% Label reference trajector entry and exit points. % Label reference trajector entry and exit points.
\node[fill=white] at (0.3, 0.15) {\Large{$O_{entrance}$}}; \node[fill=white] at (0.3, 0.15) {\Large{$O_{entrance}$}};
\node[fill=white, below=12pt, right=3pt] at ($(0,-1) + 1.1*(nAlpha,\cosAlpha)$) {\Large{\textbf{$O_{exit}$}}}; \node[fill=white, below=12pt, right=3pt] at ($(0,-1) + 1.1*(\sinAlpha,\cosAlpha)$) {\Large{\textbf{$O_{exit}$}}};
\end{tikzpicture} \end{tikzpicture}
\end{center} \end{center}
\caption{Illustration of a rectangular bend (\texttt{RBEND}, see Section~\ref{RBend}) showing the entrance and exit fringe field regions. $\Delta_{1}$ is the perpendicular distance in front of the entrance edge of the magnet where the magnet fringe fields are non-negligible. $\Delta_{2}$ is the perpendicular distance behind the entrance edge of the magnet where the entrance Enge function stops being used to calculate the magnet field. The reference trajectory entrance point is indicated by $O_{entrance}$. $\Delta_{3}$ is the perpendicular distance in front of the exit edge of the magnet where the exit Enge function starts being used to calculate the magnet field. (In the region between $\Delta_{2}$ and $\Delta_{3}$ the field of the magnet is a constant value.) $\Delta_{4}$ is the perpendicular distance after the exit edge of the magnet where the magnet fringe fields are non-negligible. The reference trajectory exit point is indicated by $O_{exit}$} \caption{Illustration of a rectangular bend (\texttt{RBEND}, see Section~\ref{RBend}) showing the entrance and exit fringe field regions. $\Delta_{1}$ is the perpendicular distance in front of the entrance edge of the magnet where the magnet fringe fields are non-negligible. $\Delta_{2}$ is the perpendicular distance behind the entrance edge of the magnet where the entrance Enge function stops being used to calculate the magnet field. The reference trajectory entrance point is indicated by $O_{entrance}$. $\Delta_{3}$ is the perpendicular distance in front of the exit edge of the magnet where the exit Enge function starts being used to calculate the magnet field. (In the region between $\Delta_{2}$ and $\Delta_{3}$ the field of the magnet is a constant value.) $\Delta_{4}$ is the perpendicular distance after the exit edge of the magnet where the magnet fringe fields are non-negligible. The reference trajectory exit point is indicated by $O_{exit}$}
......
...@@ -144,13 +144,13 @@ in the \texttt{CYCLOTRON} element see~Section~\ref{cyclotron}. Note that $p_{\ph ...@@ -144,13 +144,13 @@ in the \texttt{CYCLOTRON} element see~Section~\ref{cyclotron}. Note that $p_{\ph
automatically from $p_{total}$, $p_{r0}$, and $p_{z0}$. automatically from $p_{total}$, $p_{r0}$, and $p_{z0}$.
\begin{align*} \begin{align*}
X &= x\cos(\phi_0) - yn(\phi_0) + r_0\cos(\phi_0) \\ X &= x\cos(\phi_0) - y\sin(\phi_0) + r_0\cos(\phi_0) \\
Y &= xn(\phi_0) + y\cos(\phi_0) + r_0n(\phi_0) \\ Y &= x\sin(\phi_0) + y\cos(\phi_0) + r_0\sin(\phi_0) \\
Z &= z + z_0 Z &= z + z_0
\end{align*} \end{align*}
\begin{align*} \begin{align*}
PX &= (p_x+p_{r0})\cos(\phi_0) - (p_y+p_{\phi 0})n(\phi_0) \\ PX &= (p_x+p_{r0})\cos(\phi_0) - (p_y+p_{\phi 0})\sin(\phi_0) \\
PY &= (p_x+p_{r0})n(\phi_0) + (p_y+p_{\phi 0})\cos(\phi_0) \\ PY &= (p_x+p_{r0})\sin(\phi_0) + (p_y+p_{\phi 0})\cos(\phi_0) \\
PZ &= p_z + p_{z0} PZ &= p_z + p_{z0}
\end{align*} \end{align*}
......
...@@ -327,22 +327,22 @@ W=\Theta\Phi\Psi ...@@ -327,22 +327,22 @@ W=\Theta\Phi\Psi
where where
\[ \[
\Theta=\left(\begin{array}{ccc} \Theta=\left(\begin{array}{ccc}
\cos\theta & 0 & n\theta \\ \cos\theta & 0 & \sin\theta \\
0 & 1 & 0 \\ 0 & 1 & 0 \\
-n\theta & 0 & \cos\theta -\sin\theta & 0 & \cos\theta
\end{array}\right), \end{array}\right),
\quad \quad
\Phi=\left(\begin{array}{ccc} \Phi=\left(\begin{array}{ccc}
1 & 0 & 0 \\ 1 & 0 & 0 \\
0 & \cos\phi & n\phi \\ 0 & \cos\phi & \sin\phi \\
0 & -n\phi & \cos\phi 0 & -\sin\phi & \cos\phi
\end{array}\right), \end{array}\right),
\quad \quad
\] \]
\[ \[
\Psi=\left(\begin{array}{ccc} \Psi=\left(\begin{array}{ccc}
\cos\psi & -n\psi & 0 \\ \cos\psi & -\sin\psi & 0 \\
n\psi & \cos\psi & 0 \\ \sin\psi & \cos\psi & 0 \\
0 & 0 & 1 0 & 0 & 1
\end{array}\right). \end{array}\right).
\] \]
...@@ -453,13 +453,13 @@ For both types of magnets ...@@ -453,13 +453,13 @@ For both types of magnets
R=\left(\begin{array}{c} R=\left(\begin{array}{c}
\rho(\cos\alpha-1) \\ \rho(\cos\alpha-1) \\
0 \\ 0 \\
\rhon\alpha \rho\sin\alpha
\end{array}\right), \end{array}\right),
\qquad \qquad
S=\left(\begin{array}{ccc} S=\left(\begin{array}{ccc}
\cos\alpha & 0 & -n\alpha \\ \cos\alpha & 0 & -\sin\alpha \\
0 & 1 & 0 \\ 0 & 1 & 0 \\
n\alpha & 0 & \cos\alpha \sin\alpha & 0 & \cos\alpha
\end{array}\right), \end{array}\right),
\] \]
where $\alpha$ is the bend angle. where $\alpha$ is the bend angle.
...@@ -480,8 +480,8 @@ where $T$ is the orthogonal rotation matrix ...@@ -480,8 +480,8 @@ where $T$ is the orthogonal rotation matrix
\[ \[
T= T=
\begin{pmatrix} \begin{pmatrix}
\cos\psi & -n\psi & 0 \\ \cos\psi & -\sin\psi & 0 \\
n\psi & \cos\psi & 0 \\ \sin\psi & \cos\psi & 0 \\
0 & 0 & 1 0 & 0 & 1
\end{pmatrix}. \end{pmatrix}.
\] \]
...@@ -607,8 +607,8 @@ For a rotation of the reference system by an angle $\psi$ about the ...@@ -607,8 +607,8 @@ For a rotation of the reference system by an angle $\psi$ about the
beam ($s$) axis see~Figure~\ref{srot}: beam ($s$) axis see~Figure~\ref{srot}:
\[ \[
S=\left(\begin{array}{ccc} S=\left(\begin{array}{ccc}
\cos\psi & -n\psi & 0 \\ \cos\psi & -\sin\psi & 0 \\
n\psi & \cos\psi & 0 \\ \sin\psi & \cos\psi & 0 \\
0 & 0 & 1 \\ 0 & 0 & 1 \\
\end{array}\right), \end{array}\right),
\] \]
...@@ -617,9 +617,9 @@ rotation of the reference system by an angle $\theta$ about ...@@ -617,9 +617,9 @@ rotation of the reference system by an angle $\theta$ about
the vertical ($y$) axis see~Figure~\ref{yrot}: the vertical ($y$) axis see~Figure~\ref{yrot}:
\[ \[
S=\left(\begin{array}{ccc} S=\left(\begin{array}{ccc}
\cos\theta & 0 & -n\theta \\ \cos\theta & 0 & -\sin\theta \\
0 & 1 & 0 \\ 0 & 1 & 0 \\
n\theta & 0 & \cos\theta \sin\theta & 0 & \cos\theta
\end{array}\right). \end{array}\right).
\] \]
In both cases the displacement $R$ is zero. In both cases the displacement $R$ is zero.
...@@ -1825,11 +1825,11 @@ to the closed orbit and the absolute and normalised coordinates as follows: ...@@ -1825,11 +1825,11 @@ to the closed orbit and the absolute and normalised coordinates as follows:
\[ \[
\begin{array}{rcl} \begin{array}{rcl}
Z = Z_{co}&+& \sqrt{E_x} \hbox{\tt FX} Z = Z_{co}&+& \sqrt{E_x} \hbox{\tt FX}
(\Re V_k \cos \hbox{\tt PHIX} + \Im V_k n \hbox{\tt PHIX}) \\ (\Re V_k \cos \hbox{\tt PHIX} + \Im V_k \sin \hbox{\tt PHIX}) \\
&+& \sqrt{E_y} \hbox{\tt FY} &+& \sqrt{E_y} \hbox{\tt FY}
(\Re V_k \cos \hbox{\tt PHIY} + \Im V_k n \hbox{\tt PHIY}) \\ (\Re V_k \cos \hbox{\tt PHIY} + \Im V_k \sin \hbox{\tt PHIY}) \\
&+& \sqrt{E_t} \hbox{\tt FT} &+& \sqrt{E_t} \hbox{\tt FT}
(\Re V_k \cos \hbox{\tt PHIT} + \Im V_k n \hbox{\tt PHIT}) (\Re V_k \cos \hbox{\tt PHIT} + \Im V_k \sin \hbox{\tt PHIT})
\end{array} \end{array}
\] \]
where $Z_{co}$ is the closed orbit vector, and $Z$ is the vector where $Z_{co}$ is the closed orbit vector, and $Z$ is the vector
...@@ -2319,8 +2319,8 @@ about the vertical ($y$) axis see~Figure~\ref{yrot}. ...@@ -2319,8 +2319,8 @@ about the vertical ($y$) axis see~Figure~\ref{yrot}.
\texttt{YROT} has no effect on the beam, \texttt{YROT} has no effect on the beam,
but it causes the beam to be referred to the new coordinate system but it causes the beam to be referred to the new coordinate system
\[\begin{array}{lcl} \[\begin{array}{lcl}
x_2&=&x_1\cos\theta-s_1n\theta, \\ x_2&=&x_1\cos\theta-s_1\sin\theta, \\
y_2&=&x_1n\theta+s_1\cos\theta, y_2&=&x_1\sin\theta+s_1\cos\theta,
\end{array}\] \end{array}\]
It has one real attribute: It has one real attribute:
\begin{description} \begin{description}
...@@ -2352,8 +2352,8 @@ about the longitudinal ($s$) axis see~Figure~\ref{srot}. ...@@ -2352,8 +2352,8 @@ about the longitudinal ($s$) axis see~Figure~\ref{srot}.
\texttt{SROT} has no effect on the beam, \texttt{SROT} has no effect on the beam,
but it causes the beam to be referred to the new coordinate system but it causes the beam to be referred to the new coordinate system
\[\begin{array}{lcl} \[\begin{array}{lcl}
x_2&=&x_1\cos\psi-y_1n\psi, \\ x_2&=&x_1\cos\psi-y_1\sin\psi, \\
y_2&=&x_1n\psi+y_1\cos\psi, y_2&=&x_1\sin\psi+y_1\cos\psi,
\end{array}\] \end{array}\]
It has one real attribute: It has one real attribute:
\begin{description} \begin{description}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment