-
Notifications
You must be signed in to change notification settings - Fork 20
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
Update zero-strength quad case = drift. #730
Update zero-strength quad case = drift. #730
Conversation
// nothing to do for zero focusing strength | ||
// advance position and momentum (zero strength = drift) | ||
xout = x + slice_ds * px; | ||
// pxout = px; |
Check notice
Code scanning / CodeQL
Commented-out code Note
xout = x + slice_ds * px; | ||
// pxout = px; | ||
yout = y + slice_ds * py; | ||
// pyout = py; |
Check notice
Code scanning / CodeQL
Commented-out code Note
yout = y + slice_ds * py; | ||
// pyout = py; | ||
tout = t + (slice_ds/betgam2) * pt; | ||
// ptout = pt; |
Check notice
Code scanning / CodeQL
Commented-out code Note
} else { | ||
// advance transverse position and momentum (zero focusing strength = drift) | ||
x = xout + slice_ds * px / delta1; | ||
// pxout = px; |
Check notice
Code scanning / CodeQL
Commented-out code Note
x = xout + slice_ds * px / delta1; | ||
// pxout = px; | ||
y = yout + slice_ds * py / delta1; | ||
// pyout = py; |
Check notice
Code scanning / CodeQL
Commented-out code Note
term = (-1_prt+bet*pt)*term; | ||
term = term/(2_prt * std::pow(bet,3) * std::pow(gam,2)); | ||
t = tout - slice_ds * (1_prt / bet + term /std::pow(delta1, 3)); | ||
// ptout = pt; |
Check notice
Code scanning / CodeQL
Commented-out code Note
-(std::pow(p1,2) + std::pow(p2,2))*slice_ds - (std::pow(q1,2)-pow(q2,2)) * std::pow(w,2)*slice_ds); | ||
t = t0 + (-1_prt+bet*pt)/(8_prt*bet * std::pow(delta1,3)*omega) | ||
*(term1+term2+term3+term4+term5); | ||
// ptout = pt; |
Check notice
Code scanning / CodeQL
Commented-out code Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
From a performance perspective, keeping element code small (register usage) would be another possibility by changing under the hood user-specified quads that have no field strengths to drift elements in lattices.
A thick quadrupole with zero focusing strength requires special treatment in the limit k=0, and the element should be equivalent to a drift of the same length.