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

APERTURE silently assumes CENTRE=False in previous TWISS #603

Closed
roman-martin opened this issue Mar 15, 2018 · 3 comments
Closed

APERTURE silently assumes CENTRE=False in previous TWISS #603

roman-martin opened this issue Mar 15, 2018 · 3 comments
Labels
enhancement the behaviour should be changed in the code sometime

Comments

@roman-martin
Copy link

The following example demonstrates an undocumented pitfall when using TWISS with the option CENTRE=True:

!----EXAMPLE-----------------------------------------------------------------------

!----generic test sequences----------------------------------------
KQ1 = 0.01;
KQ2 = -0.01;

testseq: SEQUENCE, l = 50.0;
        MQ1: QUADRUPOLE, K1=KQ1, l= 2, at=15, APERTYPE=CIRCLE, APERTURE={0.02};
        MQ2: QUADRUPOLE, K1=KQ2, l= 2, at=45, APERTYPE=CIRCLE;
ENDSEQUENCE;

BEAM, PARTICLE=PROTON, ENERGY=7000.0, EXN=2.2e-6, EYN=2.2e-6;


!---TWISS with centre=True and APERTURE
USE, SEQUENCE=testseq;
TWISS, BETX=100, BETY=100, file=twiss.out, CENTRE=True;
APERTURE, file=aperture.out;

!---/EXAMPLE-----------------------------------------------------------------------

You will find that the sliced quadrupole MQ1 is located at s=14..16m but in the aperture table it appears at s = 13..15m. APERTURE also wrongly calculates e.g. the beta functions for MQ1.

@tpersson
Copy link
Contributor

tpersson commented Sep 5, 2018

I looked into this a bit more and in case you have CENTRE=TRUE and only COLLIMATOR have an aperture limitation it all works fine. I also tried with an RBEND but it gave the same behaviour as with the the Quadrupole in the example.

@tpersson tpersson added the bug the behaviour is not documented and should be fixed in the code label Sep 5, 2018
@tpersson
Copy link
Contributor

tpersson commented Sep 5, 2018

This is fixed in #667.

@tpersson tpersson closed this as completed Sep 5, 2018
@tpersson tpersson reopened this Sep 12, 2018
@madcern madcern added enhancement the behaviour should be changed in the code sometime and removed bug the behaviour is not documented and should be fixed in the code labels Oct 25, 2018
@madcern
Copy link
Contributor

madcern commented Oct 25, 2018

The bug is fixed but in case we want to be able to run with all twiss settings there is still work to be done. I changed it to a possible enhancement.

@tpersson tpersson closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement the behaviour should be changed in the code sometime
Projects
None yet
Development

No branches or pull requests

3 participants