Open jonasbjorklundsvensson opened 2 years ago
HI Jonas,
Ocelot uses almost the same coordinate system as MAD8, except for the sign in the 5th coordinate. Thus:
x' = px/p0 and y' = py/p0.
A description of the coordinate system can be found in tutorial N2
https://nbviewer.org/github/ocelot-collab/ocelot/blob/master/demos/ipython_tutorials/2_tracking.ipynb
I think we need to move it to a more prominent place. Cheers, Sergey.
Hi Sergey, and thanks for the quick reply!
This is indeed one of the locations I am referring to and the one that I was using originally. I realized that I could attach some figures to make myself more clear. Here is a screenshot of what I can see in Spyder when I look at the generate_parray
function - the "angular" coordinate px
is literally referred to as canonical momentum (i.e., not an angle).
And when similarly taking a look at how one of the output p_array
s look, one can see the field px
, for example.
In the p_array
description it says the same, usual definition that you give here as well, using px
and py
as transverse normalized momenta. However, the fields in p_array
are still called for example p_array.px
, but I take it that this is not actually px
but "xp
"? How should I interpret the px
in the generate_parray
function?
And with respect to your last remark - as a newcomer to the code I can vouch that some more documentation and/or consolidation of information would help a lot. Best regards, Jonas
Ocelot uses canonical momentums. So everywhere it should be px and py. in description I wrote x'=px/p0 just to describe second variable of the canonical pair. But I agree it should be written more transparent maybe like px = Px/P0. I will change it in future.
Hi,
I have some trouble working out the angular coordinates in the code. On the one hand, it is stated literally in various placed in the documentation that it is the angles
x'
andy'
that are being used, but both the input ofgenerate_parray
and the outputp_array
from tracking have the coordinatespx
andpy
, implying the normalized momenta.When I use the
p_array.px
andp_array.py
output and calculate for example the slice normalized emittance, assuming that these coordinates are the anglesx'
andy'
, it matches (more or less) what I see when plotting withshow_e_beam()
. If I use them as normalized momenta, I get completely wonky values.I have a similar (and probably related) problem with the bunch generation - I specify transverse coordinates and Twiss functions, but can never seem to achieve the same normalized emittance that I specify my bunch to have when calculating the rms values using the nominal input Twiss parameters. I tried various combinations of angles and momenta and the closest I can get is within a factor of 4, which seems quite random.
Would much appreciate some input in this matter! Best regards, Jonas