Open LucaBiasia opened 1 year ago
I never use MADX-PTC from Python so my comments will only focus on the quadrupole definition and its use. The best is also to provide the MADX-PTC script generated by your Python script (I let Riccardo take over this part).
remove the definition of the aperture just to be sure that you don't hit the limits (can be restored once things get back to normal)
define your quad in the simplest way, your definition uses a contradictory setup...
simplify the setup of PTC to what is really needed
In 5D, pt=(E-E0)/p0c, your setup with pt_ps tends to set it to delta_p, which is the same as soon as your energy is large enough to get relativistic beta = 1
Then tell us what are the obtained results.
Thank you for your fast reply.
I was defining knl={} because subsequently i would like to include multipoles (as i know that PTC can treat multipoles as thick elements).
Anyway I followed all of your suggestions and the result is the following:
It looks like the non focusing axis (Y) have a different behaviour (I've found a similar result in other previous simulations).
For what concerns 4., Is it correct with time=false in 5D to define pt_ps as deltap instead of pt? (my particles won't get relativistic and relativistic beta is not ~1).
Thanks.
I was defining knl={} because subsequently i would like to include multipoles (as i know that PTC can treat multipoles as thick elements).
It is the opposite, thick elements can have multipoles with MADX-PTC and MAD-NG, so better to define your quad as mentioned and add later the knl (and ksl) without the k1l included.
Concerning 4. you are right.
For more investigation, we need a pure MADX standalone working example.
Hi, I am trying to track 1000 non-relativistic muons (28 MeV) passing through a quadrupole using MAD-X PTC library. In the case of monochromatic particles I get the expected results (compared with other programs). When I try to include momentum spread in the sampled particles (I sample only the particles on the border of the phase space ellipse) I would expect only a slightly deviation of the points from the phase space ellipse border, but I get the artifatc you can see in the following image (representing the normalized final phase space):
This gets worse if the momentum spread increases and also if the CORRELATION in the initial phase space increases!
The following plot shows the same result, but with -0.995 x axis correlation and 0.995 y axis correlation:
![NORM_PS_WITH_MOMENTUM_SPREAD_CORR](https://user-images.githubusercontent.com/72028757/225691936-d6923bb2-5761-4955-84bd-70a9a44541f5.png)
I tried to apply different models for the PTC tracking procedure but i didn't manage to find the reason behind this problem. I will attach an example of the python code below. particle_tracking.zip
This is how the initial phase space looks like:![PHASE_SPACE_TEST](https://user-images.githubusercontent.com/72028757/225691127-d41e9a51-ca65-44fb-bab1-b6d946ce05a8.png)
Thank you for your help!