Skip to content

Commit

Permalink
Fixed conflicts (#1007)
Browse files Browse the repository at this point in the history
* fiducial_pt now ready for testing.
  • Loading branch information
DavidSagan authored Jun 19, 2024
1 parent 914f5e8 commit 459946f
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 109 deletions.
27 changes: 0 additions & 27 deletions bmad/doc/attributes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,6 @@ \section{Dependent and Independent Attributes}
(\sref{s:field.master}) can be used to determine if the be normalized or unnormalized, values are
dependent or independent.

\index{lattice!expansion}\index{harmon}\index{delta_e}\index{gradient}
\index{rho}\index{g}\index{angle}\index{rf_frequency}
No attempt should be made to set or vary within a program dependent attributes. It should be
remarked that this is not an iron clad rule. If a program properly bypasses \bmad's attribute
bookkeeping routine then anything is possible. In a lattice file, before lattice expansion
(\sref{s:expand}), \bmad allows the setting of a select group of dependent attributes if the
appropriate independent attributes are not set. The list of settable dependent variables is given in
Table~\ref{t:dep.except}. After reading in the lattice \bmad will set the appropriate independent
variable based upon the value of the dependent variable. \vn{harmon} is the exception in that it
will never be set by the bookkeeping routine.
\index{lcavity}\index{rbend}
\index{sbend}\index{rfcavity}
\begin{table}[ht]
\centering {
\begin{tabular}{lll} \toprule
{\em Element} & {\em Dependent Variable Set} & {\em Independent Variables Not Set} \\ \midrule
\vn{Lcavity} & \vn{voltage} & \vn{gradient} \\
\vn{Rbend}, \vn{Sbend} & \vn{rho} & \vn{g} \\
\vn{Rbend}, \vn{Sbend} & \vn{angle} & \vn{g}, or \vn{l} \\
\vn{RFcavity} & \vn{rf_frequency} & \vn{harmon} \\
\vn{Wiggler} (periodic type) & \vn{n_pole} & \vn{l_pole} \\ \bottomrule
\end{tabular}
}
\caption {Dependent variables that can be set in a primary lattice file.}
\label{t:dep.except}
\end{table}

%-----------------------------------------------------------------
\section{Field_Master and Normalized Vs. Unnormalized Field Strengths}
\label{s:field.master}
Expand Down
5 changes: 2 additions & 3 deletions bmad/doc/charged-tracking.tex
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,8 @@ \section{Bend: Fiducial Point Calculations}
of \vn{rho}, \vn{g}, \vn{b_field} or \vn{angle} in a program (that is, changing after the lattice
has been read in and the bend parameters calculated) involves adjustment to the other three
parameters along with adjustment to \vn{e1}, \vn{e2}, \vn{l}, \vn{l_chord}, and
\vn{l_rectangle}. This is done to keep the shape of the bend is invariant. Invariance is not
maintained with variation of any other parameter besides \vn{rho}, \vn{g}, \vn{b_field} and
\vn{angle}. For example, if \vn{e1} is varied the bend shape will vary.
\vn{l_rectangle}. This is done to keep the shape of the bend invariant. Invariance is not maintained
with variation of any other parameter (EG variation of \vn{e1}).

\begin{figure}[tb]
\centering
Expand Down
2 changes: 1 addition & 1 deletion bmad/doc/cover-page.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

\begin{flushright}
\large
Revision: June 3, 2024 \\
Revision: June 19, 2024 \\
\end{flushright}

\pdfbookmark[0]{Preamble}{Preamble}
Expand Down
81 changes: 58 additions & 23 deletions bmad/doc/elements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ \section{Bends: Rbend and Sbend}
\index{hgap}\index{hgapx}\index{roll}\index{k1}\index{exact_multipoles}
Attributes specific to \vn{rbend} and \vn{sbend} elements are:
\begin{example}
angle = <Real> ! Design bend angle. Settable dependent var (\sref{s:depend}).
angle = <Real> ! Design bend angle. Dependent var (\sref{s:depend}).
b_field = <Real> ! Design field strength (= P_0 g / q) (\sref{s:depend}).
db_field = <Real> ! Actual - Design bending field difference (\sref{s:depend}).
b_field_tot ! Net field = b_field + db_field. Dependent param (\sref{s:depend}).
Expand All @@ -515,7 +515,7 @@ \section{Bends: Rbend and Sbend}
l_sagitta ! Sagittal length. Dependent param (\sref{s:depend}).
ptc_field_geometry = <Switch> ! See below. Default is \vn{sector}.
ptc_fringe_geometry = <Switch> ! \Sref{s:fringe.type}
rho = <Real> ! Design bend radius. Settable dependent param (\sref{s:depend}).
rho = <Real> ! Design bend radius. Dependent param (\sref{s:depend}).
roll = <Real> ! See \ref{s:offset}.
fiducial_pt = <switch> ! See below. Default is \vn{none}.
field_master = <T/F> ! See \ref{s:field.master}.
Expand All @@ -525,19 +525,17 @@ \section{Bends: Rbend and Sbend}
\centering
\hfill
\begin{subfigure}[b]{0.32\textwidth}
\includegraphics{rbend-coords.pdf}
\caption{Rbend (with \vn{fiducial_pt} set to \vn{none} or \vn{center}).}
\includegraphics[width=1.05\textwidth]{rbend-coords.pdf}
\caption{Rbend}
\label{f:rbend}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.32\textwidth}
\includegraphics{sbend-coords.pdf}
\includegraphics[width=1.05\textwidth]{sbend-coords.pdf}
\caption{Sbend}
\label{f:sbend}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.32\textwidth}
\includegraphics{sbend-rev.pdf}
\includegraphics[width=1.05\textwidth]{sbend-rev.pdf}
\caption{Reversed sbend}
\label{f:sbend.rev}
\end{subfigure}
Expand All @@ -547,13 +545,11 @@ \section{Bends: Rbend and Sbend}
Coordinate systems for (a) normal (non-reversed)\vn{rbend}, (b) normal \vn{sbend}, and (c)
\vn{reversed sbend} elements. The bends are viewed from ``above'' (viewed from positive $y$).
Normal bends have \vn{g}, \vn{angle}, and \vn{rho} all positive. Reversed bends have \vn{g},
\vn{angle}, and \vn{rho} all negative. For (a) and (b), as drawn, the \vn{e1} and \vn{e2} face
\vn{angle}, and \vn{rho} all negative. The face angles \vn{e1} and \vn{e2} are drawn for
\vn{reference_pt} set to \vn{none} or \vn{center}. For (a) and (b), as drawn, the \vn{e1} and \vn{e2} face
angles are both positive. For (c), as drawn, \vn{e1} and \vn{e2} are both negative. In all cases,
\vn{L} is positive. Notice that for reversed bends, the $x$-axis points towards the center of the
bend while for normal bends the $x$-axis points towards the outside. Note: The geometry of the face
angles for \vn{rbend}s as shown in \fig{f:rbend} is modified if \vn{fiducial_pt} is set to
\vn{entrance_end} or \vn{exit_end}. See below for details.

bend while for normal bends the $x$-axis points towards the outside.
}
\label{f:bend}
\end{figure}
Expand All @@ -578,12 +574,19 @@ \section{Bends: Rbend and Sbend}
\index{e1}\index{e2}
\item[e1, e2] \Newline
The rotation angle of the entrance pole face is \vn{e1} and at the exit face it is \vn{e2}. Zero
\vn{e1} and \vn{e2} for an \vn{rbend} gives a rectangular magnet (\fig{f:rbend}). Zero \vn{e1}
and \vn{e2} for an \vn{sbend} gives a wedge shaped magnet (\fig{f:sbend}). An \vn{sbend} with
an \vn{e1} = \vn{e2} = \vn{angle}/2 is equivalent to an \vn{rbend} with \vn{e1} = \vn{e2} = 0.
This formula holds for both positive and negative angles. The geometry of the face
angles for \vn{rbend}s as shown in \fig{f:rbend} is modified if \vn{fiducial_pt} is set to
\vn{entrance_end} or \vn{exit_end}. See below for details.
\vn{e1} and \vn{e2} for an \vn{rbend} gives a rectangular magnet (\fig{f:rbend}). Zero \vn{e1} and
\vn{e2} for an \vn{sbend} gives a wedge shaped magnet (\fig{f:sbend}). An \vn{sbend} with an
\vn{e1} = \vn{e2} = \vn{angle}/2 is equivalent to an \vn{rbend} with \vn{e1} = \vn{e2} = 0. This
formula holds for both positive and negative angles. For \vn{rbend} elements, the above discussion
is true if \vn{fiducial_pt} is set to \vn{none} or \vn{center}. If \vn{fiducial_pt} is set to
\vn{entrance_end}, then the face angles are measured with respect to the entrace coordinates $(s_1
x_1)$.
If the \vn{fiducial_pt} is set to \vn{exit_end}, the face angles are measured with respect to
the exit coordinates $(s_2, x_2)$. Thus
\begin{example}
e1(f_pt=none) = e1(f_pt=entrance_end) - angle/2 = e1(f_pt=exit_end) + angle/2
e2(f_pt=none) = e2(f_pt=entrance_end) + angle/2 = e2(f_pt=exit_end) - angle/2
\end{example}

Note: The correspondence between \vn{e1} and \vn{e2} and the corresponding parameters used in the
SAD program \cite{b:sad} is:
Expand Down Expand Up @@ -673,6 +676,31 @@ \section{Bends: Rbend and Sbend}
\begin{equation}
C_1 = \frac{1}{2 \,H_{gap} \, F_{int}}
\end{equation}
%
\item[fiducial_pt] \Newline
The \vn{fiducial_pt} parameter sets a fiducial point which can be used to keep the shape of the bend
constant when, in a program, the parameters \vn{rho}, \vn{g}, \vn{b_field} or \vn{angle} are varied.
Varying these parameters typically happens when doing machine design. Using a fiducial point can be
helpful when designing a machine usin bend magnets that already exist.

The \vn{fiducial_pt} parameter
has four possible settings:
\begin{example}
none ! No fiducial point (default).
entrance_end ! The entrance point is the fiducial point.
center ! The center of the reference curve is the fiducial point.
exit_end ! The exit point is the fiducial point.
\end{example}
With \vn{fiducial_pt} set to \vn{none} (the default). The bend shape is not held constant. With the
other three settings, the bend shape will be help constant as discussed in \sref{s:bend.fiducial}.
With \vn{fiducial_pt} set to \vn{entrance_end}, the reference trajectory at the entrance end is held
fixed in both position and orientation with respect to the bend face and \vn{g}, \vn{l} and \vn{e2},
along with the other depdendent parameters, are adjusted to both give the desired change in what was
varied (which is one of \vn{rho}, \vn{g}, \vn{b_field} or \vn{angle}) and to keep the shape of the
bend unchanged. See \fig{f:bend.fid1}. Similarly, if \vn{fiducial_pt} is set to \vn{center}, the
center of the reference trajectory is held fixed in both position and orientation and if
\vn{fiducial_pt} is set to \vn{exit_end}, the exit point is held fixed in both position and
orientation.
%
\index{g}\index{rho}\index{dg}
\item[g, dg, rho] \Newline
Expand Down Expand Up @@ -732,6 +760,13 @@ \section{Bends: Rbend and Sbend}

The \vn{l_rectangle} parameter is the ``rectangular'' length. See the documentation on the \vn{fiducial_pt}
parameter above.
%
item[l_rectangle] \Newline
The ``rectangular length'' is the distance between the entrance and exit points along the $s$ axis
defined by the setting of \vn{fiducial_pt}. \fig{f:rbend} shows \vn{l_rectangle} for
\vn{fiducial_pt} set to \vn{entrance_end}. If \vn{fiducial_pt} is set to \vn{none} or \vn{center},
\vn{l_rectangle} is the same as the chord length. If \vn{fiducial_pt} is set to \vn{entrance_end}
or \vn{exit_end} the rectangular length will be $\rho \sin\alpha$.
%
\index{ref_tilt}
\item[ref_tilt] \Newline
Expand Down Expand Up @@ -965,7 +1000,7 @@ \section{Converter}
angle_out_max = <Real> ! Maximum outgoing angle.
species_out = <SpeciesID> ! Output species.
p0c = <Real> ! Output ref momentum.
E_tot = <Real> ! Output ref energy. Settable dependent var (\sref{s:depend}).
E_tot = <Real> ! Output ref energy. Dependent var (\sref{s:depend}).
\end{example}

The species of the outgoing particles is specified by the \vn{species_out} parameter
Expand Down Expand Up @@ -4556,14 +4591,14 @@ \section{RF_bend}
Attributes specific to an \vn{rf_bend} are:
\begin{example}
! Bend-like attributes:
angle = <Real> ! Design bend angle. Settable dependent var (\sref{s:depend}).
angle = <Real> ! Design bend angle. Dependent var (\sref{s:depend}).
b_field = <Real> ! Design field strength (= P_0 g / q) (\sref{s:depend}).
g = <Real> ! Design bend strength (= 1/rho).
l = <Real> ! "Length" of bend. See below.
l_arc = <Real> ! Arc length. For \vn{rbend}s only.
l_chord = <Real> ! Chord length. See \sref{s:l}.
l_sagitta ! Sagittal length. Dependent param (\sref{s:depend}).
rho = <Real> ! Design bend radius. Settable dependent param (\sref{s:depend}).
rho = <Real> ! Design bend radius. Dependent param (\sref{s:depend}).
roll = <Real> ! See \ref{s:offset}.
field_master = <T/F> ! See \ref{s:field.master}.
Expand Down Expand Up @@ -5365,7 +5400,7 @@ \section{Wiggler and Undulator}
\begin{example}
b_max = <Real> ! Maximum magnetic field (in T) on the wiggler centerline.
l_period = <Real> ! Length over which field vector returns to the same orientation.
n_period = <Real> ! The number of periods. Settable dependent attribute (\sref{s:depend}).
n_period = <Real> ! The number of periods. Dependent attribute (\sref{s:depend}).
l_pole = <Real> ! Wiggler pole length. DEPRECATED. USE L_PERIOD INSTEAD.
n_pole = <Real> ! The number of poles. DEPRECATED. USE N_PERIOD INSTEAD.
polarity = <Real> ! For scaling the field.
Expand Down
Loading

0 comments on commit 459946f

Please sign in to comment.