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

Weak focusing for thin dipoles in TWISS #888

Closed
tpersson opened this issue Apr 15, 2020 · 8 comments
Closed

Weak focusing for thin dipoles in TWISS #888

tpersson opened this issue Apr 15, 2020 · 8 comments
Assignees
Labels
bug the behaviour is not documented and should be fixed in the code

Comments

@tpersson
Copy link
Contributor

tpersson commented Apr 15, 2020

I saw an issue where the chromaticity using the CHROM option and the "normal" was not giving the same result for a case with 0 coupling. It seems to me to come from the weak focusing for a thin dipole
It seems that there is a division with the (1+dp)^2 for the thin focusing when I think it should only be scaled with (1+dp). The line looks like:
re(2,1) = re(2,1) - dipr*dipr/elrad, where dipr = k0L/(1+dp). => re21 = (k0/(1+deltap))^2/lrad

If I add multiply the line above with (1+dp) (it is easier to do it in this way because of all the rotations that takes place before.. ) then re21 = (k0^2/(1+deltap))/lrad

After this modifications the results then becomes consistent with both MAD-X without (chrom option) SixTrack and PTC.

You can see the changes in the code in PR #887 (this also fixes so that chromaticity is given as DQ/DPT even when the chrom option is in use.
The link to an example is attached below.

Anyone has any thoughts? @rdemaria @alatina @ldeniau

@tpersson
Copy link
Contributor Author

togihub.madx.txt

@tpersson
Copy link
Contributor Author

After a short discussion with Riccardo which pointed me in the right direction I also found this :
https://www.cockcroft.ac.uk/wp-content/uploads/2014/12/wolski-3.pdf

It is very clear that there is a geometrical term and a kind of bending term and my proposed change is therefore correct.

@rdemaria
Copy link
Contributor

rdemaria commented Apr 21, 2020

I think dipr*dipr should be replaced by dipr*h to take into account the case in which k0L is different from angle

@tpersson
Copy link
Contributor Author

Absolutely! I was just changing that now

@tpersson
Copy link
Contributor Author

Thanks for the comment... Just realized that the "angle" is only for horizontal dipoles, not impossible to change but a bit tricky.. I think we can leave it like this for now..

@rdemaria
Copy link
Contributor

Can't you use angle and tilt? I am not familiar with the code, but I expect you have something similar for other energy dependent effects

@tpersson
Copy link
Contributor Author

If you make the vertical dipole from the horizontal using tilt you will get the same result indeed but if you instead would have ksl and an angle then the angle would still be in the horizontal plane. I wasn't the one who implemented this and don't know how well this is documented.. I will have a look.
I agree that you can make a vertical dipole just have to be careful how it is done.

@ldeniau ldeniau added the bug the behaviour is not documented and should be fixed in the code label Apr 22, 2020
@tpersson
Copy link
Contributor Author

tpersson commented May 7, 2020

This is fixed in PR #887

@tpersson tpersson closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the behaviour is not documented and should be fixed in the code
Projects
None yet
Development

No branches or pull requests

3 participants