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
Revert "Think this is the correct handeling in survey." #642
Revert "Think this is the correct handeling in survey." #642
Conversation
I think the current implementation is correct. Remember that it is a rotation of the coordinate system which is the opposite to rotating the element also remember that we are not in the normal right handed system. |
I'm fully aware, and I assumed a confusion with precisely this fact was the reason for the inconsistency. Therefore, let's best stick to the example first.
I did not know about that, please clarify. In which exact circumstances are we not in the right-handed coordinate system? As far as I'm aware, the documentation states and shows only right-handed coordinate systems? Anyway, if the coordinate system is right or left handed should not matter. According to the documentation:
This is even the exact example given in the manual in the section about SROTATION, I quote:
However, SURVEY shows upward bend. Twiss on the other hand correctly shows that a particle initially located on my left (positive x) is below me after the SROTATION (roll right), and one above me (positive Y) will be on my left (positive X) after I rotate -- as expected. So I'm still convinced there is an inconsistency somewhere, either in the documentation or SURVEY/TWISS use different notions of up/down or something the like. |
Thanks a lot for your comments. I already agreed to the twiss but you also convinced me for survey. I was oversimplifying and was thinking of it as just a point that got rotated where it is indeed a element being installed in the new reference system. In this case you are right the bending is downwards. Many thanks for spotting and fixing this! |
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 is the correct implementation.
Great, thanks a lot! :) |
I believe the sign change in SURVEY for SROTATION angles is inconsistent with the MAD-X manual and TWISS.
According to the manual:
"A positive angle means that the new reference system is rotated clockwise about the s-axis with respect to the old system"
.This means, when I specify a positive ANGLE=pi/2, followed by a SBEND with positive ANGLE (i.e. bending to the right), I expect a downward bend in global coordinates. However, SURVEY shows positive Y atfer the SBEND.
Example:
From this, we can also see that TWISS behaves as described in the manual.
Please let me know if I did some stupid mistake.
Best, Thomas