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

fixes #1181 #1182

Merged
merged 3 commits into from May 26, 2023
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
2 changes: 2 additions & 0 deletions Changes.md
@@ -1,4 +1,6 @@
MAD-X master
* Track
* [PR 1182](https://github.com/MethodicalAcceleratorDesign/MAD-X/pull/1182) Fix thick dipole tracking


MAD-X release 5.09.00 (2023.05.05)
Expand Down
9 changes: 4 additions & 5 deletions src/trrun.f90
Expand Up @@ -4662,15 +4662,14 @@ subroutine tttdipole(track, ktrack, code)
!---- Apply errors
f_errors = zero
n_ferr = node_fd_errors(f_errors)
! tapering on the main field is applied consistently
! with twiss, but needs to be revised
if (k0.ne.0) then
f_errors(0) = f_errors(0) + k0*length - angle
k0 = k0 * (one + ktap) + f_errors(0)/length
else
k0 = h
k0 = h * (one + ktap) + f_errors(0)/length
endif

k0 = k0 * (one + ktap) ! tapering to main field only

k0 = k0 + f_errors(0) / length ! dipole term
k1 = k1 + f_errors(2) / length ! quad term

if (k0.eq.zero .and. k1.eq.zero) then
Expand Down