Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taper command finalised #1034

Merged
merged 5 commits into from Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions Makefile_test
Expand Up @@ -28,6 +28,8 @@
# added shrink tests in test-setvars_lin and renamed to test-table
# 2016-Jun-16 14:25:56 Irina:
# added test-twiss-12 for sigma matrix calculation
# 2021-Sep-02 20:59:00 ghislain:
# added test-taper
#################################################
# testsuite

Expand All @@ -44,13 +46,15 @@ tests-all = \
test-table test-table-2 \
test-memory test-control \
\
test-makethin test-makethin-2 test-makethin-3 test-makethin-4 test-elseparator\
test-makethin test-makethin-2 test-makethin-3 test-makethin-4 \
test-elseparator\
test-survey test-survey-2 test-survey-3 test-survey-4 \
test-taper \
test-track test-track-2 test-track-3 test-track-4 test-track-5 test-track-6 \
test-track-7 test-track-8 test-track-9 test-track-10 test-track-11 test-track-12 test-track-13 test-track-14 \
test-track-acd test-track-rotations \
test-twiss test-twiss-2 test-twiss-3 test-twiss-4 test-twiss-5 \
test-twiss-6 test-twiss-8 test-twiss-9 test-twiss-10 test-twiss-11 test-tapering \
test-twiss-6 test-twiss-8 test-twiss-9 test-twiss-10 test-twiss-11 \
test-twiss-12 test-twiss-13 test-twiss-14 test-twiss-15 test-twiss-exact test-translation test-crabcavity \
test-xrotation test-yrotation test-rotations test-interpolate test-rf-fringe \
test-cororbit test-cororbit-2 test-cororbit-3 test-cororbit-4 \
Expand Down Expand Up @@ -98,6 +102,7 @@ $(call onlx64,$(user-cases),)
# to know the timing: make tests-all TIMER=time (on Unixes)
tests-long = \
test-memory \
test-taper \
test-track-7 test-track-8 test-track-10 test-track-11 \
test-dynap \
test-c6t-4 \
Expand Down Expand Up @@ -154,7 +159,7 @@ test-ptc-twiss: TESTSUITE := PTC Twiss testsuite
test-rfmultipole: TESTSUITE := RF Multipole testsuite
test-sequence: TESTSUITE := Sequence testsuite
test-survey: TESTSUITE := Survey testsuite
test-table: TESTSUITE := Table testsuite
test-table: TESTSUITE := Table testsuite
test-thick-quad: TESTSUITE := Thick Element testsuite
test-touschek: TESTSUITE := Touschek testsuite
test-track: TESTSUITE := Track testsuite
Expand Down
80 changes: 57 additions & 23 deletions doc/latexuguide/elements.tex
Expand Up @@ -61,14 +61,14 @@ \section{Bending Magnet}
\> K0=real, K1=real, K2=real, K1S=real,\\
\> E1=real, E2=real, FINT=real, FINTX=real,\\
\> HGAP=real, H1=real, H2=real,\\
\> THICK=logical;\\
\> KTAP=real, THICK=logical;\\
\> \\
\> \\
label: RBEND, \> L=real, ANGLE=real, TILT=real, \\
\> K0=real, K1=real, K2=real, K1S=real,\\
\> E1=real, E2=real, FINT=real, FINTX=real, \\
\> HGAP=real, H1=real, H2=real, \\
\> THICK=logical, \\
\> KTAP=real, THICK=logical, \\
\> ADD\_ANGLE='array';
}

Expand Down Expand Up @@ -108,14 +108,23 @@ \section{Bending Magnet}
$K_1 = (1/B\rho) (\partial B_y / \partial x)$. \\
A positive quadrupole strength implies horizontal focussing of particles,
irrespective of their charge. K1 is taken into account in thick bend transfer map.
Only K0 and K1 are considered for think transfer map, not any other strengths (like K2, K1S).
Only K0 and K1 are considered for think transfer map, not any other
strengths (like K2, K1S).
% positively charged particles. % Ghislain: sera chang� dans le futur!

\ttitem{E1} The rotation angle for the entrance pole face (Default: 0 rad).
\ttitem{E2} The rotation angle for the exit pole face (Default: 0 rad). \\
The pole face rotation angles are referred to the magnet model for
\hyperref[F-RBND]{rectangular bend} and \hyperref[F-SBND]{sector
bend} respectively. If \texttt{E1} and \texttt{E2} are of the same sign as the bending angle, they reduce the external length (i.e. opposite to the centre of curvature) of the magnet. \texttt{E1} and \texttt{E2} must be specified as half of the bending angle of the magnet to get a \texttt{SBEND} with parallel faces, i.e. turning it into a \texttt{RBEND}. \texttt{E1} and \texttt{E2} must be specified as {\it minus} half of the bending angle of the magnet to get a \texttt{RBEND} with sector faces, i.e. turning it into a \texttt{SBEND}.
bend} respectively. If \texttt{E1} and \texttt{E2} are of the same
sign as the bending angle, they reduce the external length
(i.e. opposite to the centre of curvature) of the magnet. \texttt{E1}
and \texttt{E2} must be specified as half of the bending angle of the
magnet to get a \texttt{SBEND} with parallel faces, i.e. turning it
into a \texttt{RBEND}. \texttt{E1} and \texttt{E2} must be specified
as {\it minus} half of the bending angle of the magnet to get a
\texttt{RBEND} with sector faces, i.e. turning it into a
\texttt{SBEND}.

\ttitem{FINT} The fringe field integral at entrance and exit of the
bend. (Default: 0).
Expand Down Expand Up @@ -150,23 +159,34 @@ \section{Bending Magnet}
\ttitem{K0} Please take note that $K_0$ and $K_0S$ are left in the
data base but are no longer used for the MAP of the bends,
instead \texttt{ANGLE} and \texttt{TILT} are used exclusively. \\
However, \texttt{K0} is assignment of \textbf{relative} field errors to a bending magnet because
However, \texttt{K0} is assignment of \textbf{relative} field errors
to a bending magnet because
\texttt{K0} is used for the normalization instead of the
\texttt{ANGLE}. (see \hyperref[sec:efcomp]{\texttt{EFCOMP}}).\\
With $K_0 = (1 / B \rho) B_y$, one gets \texttt{K0 = ANGLE / arclength}.


\ttitem{KTAP} The relative change of the dipole strength (See
\texttt{K0} above) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the dipole is calculated as \texttt{K0 * L = ANGLE
* (1 + KTAP)}. See the \hyperref[chap:taper]{\texttt{TAPER}}
command. (Default:~0)

\ttitem{THICK} If this logical flag is set to true the bending
magnet is kept as a thick-element, instead of being
converted into thin-lenses after MAKETHIN. Note that
if used in tracking without a MAKETHIN command it will
remain THICK even if this attribute is false. \\
(Default: false)

\ttitem{KILL\_ENT\_FRINGE} If this logical flag is set to true the fringe fields on the entrance of the element are not taken into account (not calculated). \\
\ttitem{KILL\_ENT\_FRINGE} If this logical flag is set to true the
fringe fields on the entrance of the element are not taken into
account (not calculated). \\
(Default: false)

\ttitem{KILL\_EXI\_FRINGE} If this logical flag is set to true the fringe fields on the exit of the element are not taken into account (not calculated). \\
\ttitem{KILL\_EXI\_FRINGE} If this logical flag is set to true the
fringe fields on the exit of the element are not taken into account
(not calculated). \\
(Default: false)
\end{madlist}

Expand Down Expand Up @@ -267,11 +287,11 @@ \section{Quadrupole}

\madbox{
label: QUADRUPOLE, \= L=real, K1=real, K1S=real, TILT=real,\\
\> THICK=logical;
\> KTAP=real, THICK=logical;
}


A \texttt{QUADRUPOLE} has five attributes:
A \texttt{QUADRUPOLE} has six attributes:
\begin{madlist}
\ttitem{L} The quadrupole length (default: 0 m).
\ttitem{K1} The normal quadrupole coefficient:
Expand Down Expand Up @@ -299,12 +319,20 @@ \section{Quadrupole}
about the actual meaning of the \texttt{TILT} attribute for
various elements.}

\ttitem{THICK} If this logical flag is set to true the bending
\ttitem{KTAP} The relative change of the quadrupoles strengths (both
\texttt{K1} and \texttt{K1S}) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the quadrupole is calculated as \texttt{K1act = K1
* (1 + KTAP)}. See the \hyperref[chap:taper]{\texttt{TAPER}}
command. (Default:~0)

\ttitem{THICK} If this logical flag is set to true the bending
magnet is kept as a thick-element, instead of being
converted into thin-lenses after MAKETHIN. Note that
if used in tracking without a MAKETHIN command it will
remain THICK even if this attribute is false. \\
(Default: false)

\end{madlist}

\textbf{Note also that $K_1$ or $K_{1s}$ can be considered as
Expand All @@ -317,28 +345,26 @@ \section{Quadrupole}
Example:
\madxmp{QF: QUADRUPOLE, L=1.5, K1=0.001, THICK=true;}

%irina
\textbf{Note:} Quadrupoles doesn't carry any attributes of the other orders magnets,
for example, bend($K_0$) or sextupole($K_2$).In case these have to be considered
in the element, please use multipole as a type of an element.

\textbf{Note:} Quadrupoles cannot have any of the attributes of other
magnetic elements, for example, bend (\texttt{K0}) or sextupole
(\texttt{K2} opr \texttt{K2S}). If these have to be considered in
the element, one should use the \texttt{MULTIPOLE} element.

\textbf{Note:} Additional attributes can be given to quadrupoles; They
are useful for \ptc and are defined in \ref{sec:add-option-PTC}.

The \hyperref[subsec:local-straight]{straight reference system} for
a quadrupole is a Cartesian coordinate system.


\section{Sextupole}
\ttindex{sextupole}
\label{sec:sextupole}

\madbox{
label: SEXTUPOLE, L=real, K2=real, K2S=real, TILT=real;
label: SEXTUPOLE, L=real, K2=real, K2S=real, TILT=real, KTAP=real;
}

A \texttt{SEXTUPOLE} has four real attributes:
A \texttt{SEXTUPOLE} has five real attributes:
\begin{madlist}
\ttitem{L} The sextupole length (default: 0 m).
\ttitem{K2} The normal sextupole coefficient $K_2 = \frac{1}{B \rho}
Expand Down Expand Up @@ -368,6 +394,14 @@ \section{Sextupole}
0~rad. This was needed to avoid the confusion in \madeight about
the actual meaning of the \texttt{TILT} attribute for various
elements.}

\ttitem{KTAP} The relative change of the sextupole strengths (both
\texttt{K2} and \texttt{K2S}) to account for energy change of the
reference particle due to RF cavities or synchrotron radiation. The
actual strength of the sextupole is calculated as
\texttt{K2act = K2 * (1 + KTAP)}. See the \texttt{TAPER}
command.\ref{chap:taper}. (Default:~0)

\end{madlist}

\textbf{Note also that $K_2$ or $K_{2s}$ can be considered as the normal
Expand All @@ -379,10 +413,10 @@ \section{Sextupole}
Example:
\madxmp{S: SEXTUPOLE, L=0.4, K2=0.00134;}

%irina
\textbf{Note:} Sextupole doesn't carry any attributes of other orders magnets,
for example, bend($K_0$) or quadrupole($K_1, K1_S$). In case these have to be
considered in the element, please use multipole as a type of an element.
\textbf{Note:} Sextupoles cannot have any of the attributes of other
magnetic elements, for example, bend (\texttt{K0}) or
quadrupole (\texttt{K1} or \texttt{K1S}). If these have to be considered
in the element, one should use the \texttt{MULTIPOLE} element.


\textbf{Note:} Additional attributes can be given to sextupoles; They
Expand Down
18 changes: 11 additions & 7 deletions doc/latexuguide/match.tex
Expand Up @@ -122,18 +122,16 @@ \section{Insertion Matching}
\madbox{
MATCH, \=SEQUENCE= 'name1', 'name2', \ldots , 'name-n',\\
\>BETA0= 'beta01', 'beta02', \ldots , 'beta0n', \\
\>SLOW=logical, TAPERING=logical;
\>SLOW=logical;
}

or

\madbox{
MATCH, \=SEQUENCE='seqname', \\
\>BETX=real, ALFX=real, MUX=real, \\
\>BETY=real, ALFY=real, MUY=real, \\
\>X=real, PX=real, Y=real, PY=real, \\
\>DX=real, DY=real, DPX=real, DPY=real, \\
\>DELTAP=real, SLOW=logical, TAPERING=logical;
\>BETX=real, ALFX=real, MUX=real, BETY=real, ALFY=real, MUY=real, \\
\>X=real, PX=real, Y=real, PY=real, DX=real, DPX=real, DY=real, DPY=real, \\
\>DELTAP=real, SLOW=logical;
}

In the second mode, called insertion matching, the matching routine is
Expand Down Expand Up @@ -164,7 +162,7 @@ \section{Insertion Matching}

\textbf{Example 1:}
\begin{verbatim}
CELL: SEQUENCE=(...) ;
CELL: SEQUENCE=(...) ;
INSERT: SEQUENCE=(...) ;
USE, PERIOD=cell;
SAVEBETA, LABEL=bini, PLACE=#e;
Expand Down Expand Up @@ -272,6 +270,12 @@ \section{Useful TWISS attributes}
repective keywords
\hyperref[subsec:tables-chrom]{\texttt{WX, PHIX, WY, PHIY,...}} for
the chromatic functions.

\ttitem{TAPERING} Adjust the strengths of the quadrupoles and sextupoles
in order to compensate for the offset in energy. This flag triggers a
call to the \hyperref[chap:taper]{\texttt{TAPER}} command with default
parameters and no output file.

\end{madlist}


Expand Down