-
Notifications
You must be signed in to change notification settings - Fork 28
[WIP] ConstF: Allow kx<0 and ky<0 #1041
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
base: development
Are you sure you want to change the base?
Conversation
@kyrsjo I don't see an element exactly analogous to this one in the MAD-X documentation. However, (at least for the transverse focusing), the closest analogy is the SOLENOID. If the rotation in x-y is ignored, then the solenoid provides equal focusing in x/y with strength k=Bz/Brho, following the convention defined here. In other words, the focusing field strength normalized by Brho. |
m_cos_kyds = cos_kyds; | ||
m_const_y = -m_ky * sin_kyds; | ||
// Note: The convention here is m_kx[1/m] = sign(k)*sqrt(abs(k)) | ||
// where k[1/m^2] is in the usual MADX convention |
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.
This statement is not clear, since there is not direct MADX analog. For solenoids, the focusing strength is k [1/m].
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.
I was mainly thinking that this is a strong analog to quadrupole mangets and plasma lenses, since the equations are exactly the same*, and there is no rotation implemented between the horizontal/vertical plane? So providing the conversion explicitly to the units used for quadrupoles makes sense IMO.
*
Except for the convention of how k
works.
auto const [sin_kyds, cos_kyds] = amrex::Math::sincos(m_ky * slice_ds); | ||
amrex::ParticleReal const_y = -m_ky * sin_kyds; | ||
// Note: The convention here is m_kx[1/m] = sign(k)*sqrt(abs(k)) | ||
// where k[1/m^2] is in the usual MADX convention |
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.
See the comment above.
This looks great; thanks a lot! I made only a minor comment. It looks ready to go once a simple test is added. Let us know if you would like some help with this. |
Hi, that's great! I'm on summer holiday right now, will be back in August. I can look at it then, or if you want to add the test and merge, please feel free! Thanks again for all the help - it makes it a lot more likely that I will contribute again, and now I know your setup and standards! |
Basically in
|
In tests, also look at this for how I get the data out:
Relative to: |
This pulls out the changes to ConstF from PR #1030 . It allows the ConstF elements to handle negative (defocusing) k values.
Question: Why is the unit of kx and ky in this element 1/m, i.e. the square root of the more common definition of k?