atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

pyAT Distinguish between a sector bending magnet and a rectangular bending magnet #725

Closed tfs563 closed 2 months ago

tfs563 commented 9 months ago

Hi all,

I'm trying to figure out if the Dipole element has a way to identify a bending magnet as either a rectangular magnet or a sector magnet. I looked into the Dipole element within the at.lattice.element documentation website, but I'm not sure which parameters or keyword arguments would need to be included/changed to make the magnet one or the other. My first thoughts were the EntranceAngle and ExitAnfgle arguments could do this, but, to me, it seems like it would change the angle of the incoming beam?

Anyway, some help in figuring out how to do this would be much appreciated!

lfarv commented 9 months ago

Hello @tfs563,

What defines the dipole as sector or rectangular is the pass method. The "geometrical" description of the magnet as length, bending angle and entrance/exit angles is the same for both. There is a short description in the documentation of passmethods:

" bending magnet passmethods For bending magnet passmethods, the term “rectangular” refers to the layout of the magnetic field, not to the shape of the magnet or to the angle of the pole faces.

In a “sector” magnet, the magnetic axis is an arc of a circle following the design trajectory, In a “rectangular” magnet, the magnetic axis is a straight line (ex.: off-axis quadrupole). In case of a pure dipole (uniform magnetic field), both are equivalent, so one can use any of the available methods. They give identical results. "

But I agree it's missing in the documentation of dipole elements.

Note that there are only 2 passmethods for rectangular magnets: ExactRectangularBendPass and BndStrMPoleSymplectic4Pass (undocumented)

swhite2401 commented 2 months ago

I move this to discussion