Cwiggler element in the Elegant

Moderators: cyao, michael_borland

Post Reply
YujieLu
Posts: 2
Joined: 02 Oct 2024, 02:24

Cwiggler element in the Elegant

Post by YujieLu » 02 Oct 2024, 08:25

Hello Michael,
I am currently using elegant to perform simulation with both the Cwiggler model and the bending magnet model. Here we use the ideal sinusoidal wiggler (sinusoidal=1). The bending magnet model is implemented by dividing an ideal 8-period sine distributed magnetic field into 1600 thin bending sections, which is directly based on the By field along the axis. The main files are attached. However, I've noticed the difference in their Twiss parameters especially the dispersion function, as shown in the attached plot. Could you explain why there is such a large discrepancy between the two models?
cwiggler_twiss.png
bend_model_twiss.png
Secondly, I am tracking one particle using the Cwiggler model, starting with a six-dimensional coordinate of (0, 0, 0, 0, 0, 0) at the entrance. To my surprise, the six-dimensional coordinates remain at zero after tracking. Why does the Cwiggler model can maintain trajectory transparency?

Thirdly, I am curious about how the elegant uses Cwiggler model to calculate the equilibrium emittance in the storage ring. It seems that changing the period length of the Cwiggler will affect the equilibrium emittance of the storage ring. However, the dispersion functions are always equal to zero in the Cwiggler model section. Could you explain the underlying mechanisms or factors at play?

Any insights or explanations would be greatly appreciated!

Best regard!
Yujie
Attachments
wiggler.zip
(2.92 KiB) Downloaded 786 times

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Cwiggler element in the Elegant

Post by michael_borland » 17 Oct 2024, 12:40

Yujie,

The problem is that you need to have half-length starting and ending poles in order to get matched trajectory and dispersion. The reason is that the beam enters with x'=0 and etax'=0, a condition that is satisfied at the center of a full-length pole.

There's a script distributed with elegant called makeWigglerFromBends that will help you construct a wiggler correctly from bending elements. An example is attached.

--Michael
Attachments
wig.lte
(3.58 KiB) Downloaded 808 times

YujieLu
Posts: 2
Joined: 02 Oct 2024, 02:24

Re: Cwiggler element in the Elegant

Post by YujieLu » 07 Jan 2025, 00:49

Hello, Michael
I understand what you mean. I thank you very much for your help.
Thank you.

Post Reply