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

bv issue in crab cavities #910

Closed
rdemaria opened this issue Jun 19, 2020 · 7 comments
Closed

bv issue in crab cavities #910

rdemaria opened this issue Jun 19, 2020 · 7 comments

Comments

@rdemaria
Copy link
Contributor

After a recent check on LHC we found the bv flag for the crab cavities is applied in the wrong way.

The reason is that the bv flag needs to invert the kick in px and energy, but not in py. The implementation however applies the bv flag before applying the tilt attribute instead at the end.

RF multipoles are not yet re-checked (to be followed up)

@ldeniau
Copy link
Contributor

ldeniau commented Jun 22, 2020

Could you please provide a minimal example with the expected results (in a comment or so), I would like to compare with PTC and MAD-NG...

@rdemaria
Copy link
Contributor Author

I put two examples: one with crab cavities and one with rf-multipoles. They give the same kick with bv=1, but they give opposite kicks with bv=-1

job_rfm.madx.txt
job_cc.madx.txt

I cannot tell (yet?) which one is correct. It is possibly a matter of conventions, but I am not convinced either. Certainly it is not good they behave differently.

@rdemaria
Copy link
Contributor Author

Probably it is also good if the rfmultipoles behave as multipoles when the frequency is 0 and behave as the cavity.

@ldeniau
Copy link
Contributor

ldeniau commented Jun 22, 2020

RFmultipole should normally behave as a multipole when the voltage is zero, and in this case, frequency and phases are ignored as they should in your example, so I am surprised by the output...

@rdemaria
Copy link
Contributor Author

rdemaria commented Jun 22, 2020

I am thinking a bit more about the issue. Beside the fact the rf-multipoles are always straight, if the kick is magnetic it should behave as multipole, if electric it should be the other way. In case of RF cavity the kick is indeed a mix of the two, therefore it is not possible to determine the effect on a particle going in one direction by knowing the effect in the other direction. The kick therefore does not carry an information of the field direction, contrary to the mulitpoles. Re-reading the paper from Andrea and myself we did not write explicitly the type of convention. According to the paper, the map is simply P M^-1 P. This means that when reflecting the sequence the strength of the element should not flipped. I think the problem then reduces to understand why crab cavities (which is a special case of rf-multipole) behave differently than the rf-multipole.

@tpersson
Copy link
Contributor

I had a look at the paper and I think the RF-multipoles are doing the correct thing. In the crabcavity there is an addtional multiplication of the bv flag of the voltage in this line:
rfv = bvk * node_value('volt ')

Removing bvk from there and the results from the crabcavities and the rfmultipole seem to be identical (the code is also almost identical).

I will make PR shortly.

@tpersson
Copy link
Contributor

Fixed in #919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants