Skip to content

Commit

Permalink
Fix bend exact_multipoles bmad tracking.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Oct 28, 2023
1 parent b71e0b5 commit 752725b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bmad/low_level/track_a_bend.f90
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ subroutine apply_multipole_kicks (coef, step_len, r_step, ix_mag_max, an, bn, ix

else
field = em_field_struct()
f_p0c = ele%value(p0c$) / (c_light * charge_of(param%particle))
f_p0c = r_step * ele%value(p0c$) / (step_len * c_light * charge_of(param%particle))

do i = 0, ix_mag_max
if (an(i) == 0 .and. bn(i) == 0) cycle
Expand Down Expand Up @@ -389,12 +389,12 @@ subroutine apply_multipole_kicks (coef, step_len, r_step, ix_mag_max, an, bn, ix

if (ix_mag_max > -1) then
orb0 = orbit
f_coef = r_step * coef * c_dir * (1 + ele%value(g$) * orbit%vec(1)) * c_light / orb0%p0c
f_coef = step_len * coef * c_dir * (1 + ele%value(g$) * orbit%vec(1)) * c_light / orb0%p0c
orbit%vec(2) = orbit%vec(2) - f_coef * field%B(2)
orbit%vec(4) = orbit%vec(4) + f_coef * field%B(1)

if (logic_option(.false., make_matrix)) then
df_coef_dx = r_step * coef * c_dir * ele%value(g$) * c_light / orb0%p0c
df_coef_dx = step_len * coef * c_dir * ele%value(g$) * c_light / orb0%p0c

mat6(2,:) = mat6(2,:) - (f_coef * field%dB(2,1) + df_coef_dx * field%B(2)) * mat6(1,:) - &
(f_coef * field%dB(2,2)) * mat6(3,:)
Expand Down
8 changes: 4 additions & 4 deletions tao/doc/command-list.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3113,10 +3113,10 @@ \subsection{show taylor_map}
Shows the Taylor transfer map for the \vn{model} lattice of the default universe (set by
\vn{set default universe}). See also \vn{show matrix}.

If the \vn{-elements} switch is present, other switches are ignored and the individual element
transfer matrices (along with the zeroth order part of the map) are printed for each element
specified by \vn{<ele_list>}. Element list format (\sref{s:ele.list.format}), without any
embedded blanks, is used for the \vn{<ele_list>} list of elements.
If the \vn{-elements} switch is present, other switches are ignored except \vn{-order} and the
individual element transfer maps are printed for each element specified by \vn{<ele_list>}. The
default order is one. Element list format (\sref{s:ele.list.format}), without any embedded blanks,
is used for the \vn{<ele_list>} list of elements.

If neither \vn{loc1} nor \vn{loc2} are present, the transfer map is computed for the
entire lattice.
Expand Down
2 changes: 1 addition & 1 deletion tao/doc/cover-page.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

\begin{flushright}
\large
Revision: August 31, 2023 \\
Revision: October 28, 2023 \\
\end{flushright}

\vfill
Expand Down
2 changes: 1 addition & 1 deletion tao/version/tao_version_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
!-

module tao_version_mod
character(*), parameter :: tao_version_date = "2023/10/27 01:26:49"
character(*), parameter :: tao_version_date = "2023/10/27 23:43:51"
end module

0 comments on commit 752725b

Please sign in to comment.