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

Kickers with non zero length lead to incorrect thick tracking #848

Closed
chernals opened this issue Oct 28, 2019 · 4 comments
Closed

Kickers with non zero length lead to incorrect thick tracking #848

chernals opened this issue Oct 28, 2019 · 4 comments

Comments

@chernals
Copy link
Contributor

chernals commented Oct 28, 2019

I understand that this is meant to be used after a MAKETHIN, neverthless:

  • there is no complaint from the code when not doing a makethin (ie. doing thick lens tracking)
  • this is straightforward physics anyway, so there is no reason not to do it

This goes in multiple steps.

1 - Incorrect drift

Minimal example:

BEAM, PARTICLE=PROTON, BETA=0.5;
SEQ: SEQUENCE, REFER=ENTRY, L=1.0;
    K1: HKICKER, AT=0.0, HKICK=1.0, L=1.0;
ENDSEQUENCE;
USE, SEQUENCE=SEQ;

track, deltap=0.0, onepass=true, onetable=true, quantum=false;
start, x=0.0, px=0.1, y=0.0, py=0.0, t=0.0, pt=0.0;
run, turns=1;
endtrack;

The X coordinate is not modified, indeed the code only applied a kick. The sequence is correctly recognized as having a length of 1m.

2 - Adding a marker

Minimal example:

BEAM, PARTICLE=PROTON, BETA=0.5;
SEQ: SEQUENCE, REFER=ENTRY, L=1.0;
    K1: HKICKER, AT=0.0, HKICK=1.0, L=1.0;
    M1: MARKER, AT=1.0;
ENDSEQUENCE;
USE, SEQUENCE=SEQ;
MAKETHIN, SEQUENCE=SEQ;
USE, SEQUENCE=SEQ;

track, deltap=0.0, onepass=true, onetable=true, quantum=false;
start, x=0.0, px=0.1, y=0.0, py=0.0, t=0.0, pt=0.0;
observe, place=M1;
run, turns=1;
endtrack;

Basically just adding a marker and doing a MAKETHIN.

Now, all the non-modified variables (they should have been but are not), ie. X, Y and PT are nan.

3 - Chromatic effects neglected

Minimal example:

BEAM, PARTICLE=PROTON, BETA=0.5;
SEQ: SEQUENCE, REFER=ENTRY, L=1.0;
    K1: HKICKER, AT=0.0, HKICK=1.0, L=1.0;
ENDSEQUENCE;
USE, SEQUENCE=SEQ;
USE, SEQUENCE=SEQ;

track, deltap=0.0, onepass=true, onetable=true, quantum=false;
start, x=0.0, px=0.1, y=0.0, py=0.0, t=0.0, pt=0.5;
run, turns=1;
endtrack;

Removed the marker, expect the kick to be scaled according to PT, it is not (the scaling should be the usual delta_plus_one).

@rdemaria
Copy link
Contributor

Hello Cedric,
for your point 3, px is the momentum (px=Px/P0) and not the angle (x'=px/(1+delta) = Px/P), therefore it is ok that the change in px does not depend on pt.

@tpersson
Copy link
Contributor

  1. I agree. This is now allowed in tracking so we have to follow the implementation there. Thanks for pointing it out!
  2. It is not allowed to use Makethin with refer=entry. This is written in the manual but I will have a look and see if we can throw an error when this is being done since this question has come up before.
  3. Riccardo already answered and I agree.

@chernals
Copy link
Contributor Author

@rdemaria

OK I was confused as I looked at the MAD-8 manual where the KICK is the kick angle, while in MAD-X KICK is indeed the momentum change.

@tpersson

  1. For the implementation, it seems that there are two ways we could choose: the old code which is commented out but already present, where it is HALF-KICK - DRIFT - HALF-KICK and the MAD8 physics guide which mentions DRIFT-KICK-DRIFT . Not sure which way we should go. Or we could simply make it a kind of BEND to actually treat it as a thick element.

  2. OK, I didn't see that but I agree.

  3. See above.

@tpersson
Copy link
Contributor

tpersson commented Nov 6, 2019

This is fixed in PR #851

@tpersson tpersson closed this as completed Nov 6, 2019
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