ocelot-collab / ocelot

OCELOT is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources.
GNU General Public License v3.0
86 stars 58 forks source link

Round dipole #259

Open SchroederSa opened 2 months ago

SchroederSa commented 2 months ago

Hi,

A question:

Is there a way to simulate a round pole dipole?

Best Sarah

Screenshot 2024-09-02 at 6 17 35 PM
sergey-tomin commented 2 months ago

Hi, I didn’t know that such magnets exist. What are they used for? do you have a reference? Just looking at the geometry, I would assume it has an edge quadrupole and sextuple components. Isn’t that the case? If we’re talking about linear optics, I assume you can calculate the position of the ideal beam and find the beta angles (as shown in the picture you attached), which would give you the linear matrix. To track the beam through the magnet, we’d need to implement the R and T matrices if you have them, or alternatively, you can use the RK integrator embedded in Ocelot.

st-walker commented 2 months ago

Can something similar and relatively simple be achieved with sbend and h_pole1/h_pole2 perhaps?

sergey-tomin commented 2 months ago

You’re right. I forgot that it’s already included. Although I have never used it. It is in docstring in ocelot.
h_pole1 - the curvature (1/r) of the entrance face h_pole2 - the curvature (1/r) of the exit face

SchroederSa commented 2 months ago

Thanks for your quick help.

We use such a dipole as an electron spectrometer. References would be:

https://escholarship.org/uc/item/98h5r889

If I understand it correctly, such a design minimises edge focusing. The beam enters and exits the pole at the exact same angle.

st-walker commented 2 months ago

I only very briefly looked at the paper, fig 3 shows this "wedge" magnet, I guess this is same as using h_pole1/hpole_2 in ocelot. So I suppose it's different to a truly round magnet.

Instead, can you just take the matrix in Equation 5 and use ocelot.cpbd.element.Matrix?

SchroederSa commented 2 months ago

The paper discusses two dipoles, a round one and a wedged (Pacman) dipole.

Thanks for your help and ideas, I will give it a try and report. I have never used the Matrix element, I will take a look - thanks!

Sarah