atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Add files via upload #582

Open catohxb opened 1 year ago

catohxb commented 1 year ago

I uploaded a few pass methods, such as quadrupole linear pass method with fringe fields, straight-geometry bends, straight symplectic integrator with exact drift and with quadrupole fringe fields, exact drift, and crab cavity pass.

catohxb commented 1 year ago

These pass methods were used to compare with Elegant and good agreement was found. See https://journals.aps.org/prab/abstract/10.1103/PhysRevAccelBeams.22.114601

lfarv commented 1 year ago

Hello @catohxb, thanks for uploading these passmethods. I went rapidly through, and have a few questions:

  1. BndStrMPoleSymplectic4Pass is already in the main branch. It is slightly different from yours because of the introduction of the new entry point trackFunction replacing PassFunction. I'll check that it's still exactly equivalent to yours.
  2. LaDriftPass: it looks very similar to the ExactDriftPass proposed in #581. To be checked also, and we'll keep one.
  3. BndMPoleSymplectic2RadQEPass: it look similar to BndMPoleSymplectic4QuantPass, with a few differences:
    • you replace the 4th order integrator with a 2nd order: any reason ?
    • the random generation of the energy loss is different, and I'm not sure that the approximation of the Poisson distribution with a Gaussian is valid. Could you have a look to BndMPoleSymplectic4QuantPass and give your comments?
    • you may have different fringe field effects, I'll come to that later
  4. QuadLinearFNPass: Could we add the fringe fields as optional in the existing QuadLinearPass ? This is what is done in StrMPoleSymplectic4Pass to avoid numerous pass methods. By the way, could you check the method "2" in StrMPoleSymplectic4Pass, described as "elegant-like fringe field effect" and using the fringeIntM0 and fringeIntP0 integrals? It would be nice to have the same inputs for both linear and symplectic passmethods.
  5. StrMPoleSymplectic4NPass: similar to ExactMultipolePass, and same question about fringe fields.
  6. CrabCavityPass: no question, nice addition!

The comparison with Elegant is very interesting and encouraging. You did a lot on fringe fields, could you check what's already in the current passmethods:

catohxb commented 1 year ago

Hi, @lfarv , Thanks for going through the passmethods and the suggestions. Indeed many of these features are already included. It's fine to leave them out. I'll check the fringe field model.

lfarv commented 1 year ago

@catohxb : Anyway, CrabCavityPass is a nice addition. I have another question about BndStrMPoleSymplectic4Pass: how should we use the X0ref end RefDZ parameters ? Could you give some example of how to use this passmethod? Thanks!

catohxb commented 1 year ago

@lfarv Sorry for the late reply. Basically we need to set X0ref to the proper value such that the particle comes at this position and with the correct entrance angle will have a symmetric trajectory across the magnet (exit at X0ref and with the correct angle). Then we set RefDZ to the change of z-coordinate on the magnet. I have a function to look for the correct X0ref value and set RefDZ. I also made an example. But I am not sure how to pass the example to you (there are 4 files).

swhite2401 commented 9 months ago

Hello, are the magnets integrators fully covered in #581? Should we open a separate PR for the CrabCavityPass and close this one?