Setting CWIGGLER

Moderators: cyao, michael_borland

Post Reply
Skamarokha
Posts: 23
Joined: 14 Apr 2021, 09:42

Setting CWIGGLER

Post by Skamarokha » 19 May 2022, 20:18

Hello!

I need to set up helical wiggler with following distribution of magnetic field. How can I achieve this?
I've tried doing that like this

Code: Select all

CWIGGLER, L=4.864, BX_MAX=0.1,  BY_MAX=0.49, PERIODS=23, SINUSOIDAL=1, HELICAL=1, FIELD_OUTPUT= "EU6.sdds",FORCE_MATCHED=0,DZ=0.07
but there is a problem with field magnitude at the ends of the wiggler ends. I was hoping POLE1_FACTOR, POLE2_FACTOR and POLE3_FACTOR will help me with this, but no.
Could you give me some tips on how to proceed?
Attachments
2022-05-20_08-17-19.png
Desired field distribution
2022-05-20_08-15-32.png
Field distribution from Elegant
Respectfully,
Mikhail A. Skamarokha.

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

Re: Setting CWIGGLER

Post by michael_borland » 23 May 2022, 13:13

Mikhail,

The problem was just that the field output was not reflecting the pole factors. The code includes the pole factors in the beam dynamics. The problem with the field output will be fixed in the next release.

Thanks for reporting the bug.

--Michael

Skamarokha
Posts: 23
Joined: 14 Apr 2021, 09:42

Re: Setting CWIGGLER

Post by Skamarokha » 27 Jun 2022, 05:25

Is it possible to also add some simple division of CWIGGLER? I understand that it is more difficult to do, than for CSBEND, but is it possible to divide CWIGGLER at least by the number of poles/periods?
Can you propose temporary solution for division of helical CWIGGLER ?
Respectfully,
Mikhail A. Skamarokha.

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

Re: Setting CWIGGLER

Post by michael_borland » 01 Jul 2022, 16:27

Mikhail,

Thanks for the suggestion.

I'm looking at how this might be done. There's no simple workaround that I can think of.

--Michael

Skamarokha
Posts: 23
Joined: 14 Apr 2021, 09:42

Re: Setting CWIGGLER

Post by Skamarokha » 18 Jul 2022, 01:13

I'm using elegant 2022.1.0, Jul 1 2022.

Is model have odd number of poles? I can see that in output.
Is it possible to have an option of setting an even number of poles in the future?

Something is wrong with vertical field distribution at the end of the end pole. If POLE1_FACTOR is less than 0.35 the field at the end gets distorted. Field distribution attached.

Code: Select all

MS15.EU6:  CWIGGLER, L=4.664, BX_MAX=0.1,  BY_MAX=0.49, POLE1_FACTOR=0.25,POLE2_FACTOR=0.75,PERIODS=22,&
			SINUSOIDAL=1, HELICAL=1, FIELD_OUTPUT= "EU6.sdds"
Attachments
2022-07-18_12-55-26.png
Field distribution
Respectfully,
Mikhail A. Skamarokha.

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

Re: Setting CWIGGLER

Post by michael_borland » 27 Jul 2022, 19:19

Mikhail,

The model has an even number of poles, but starts and ends with a half-length pole. This ensures that the dispersion returns to zero at the end.

The problem with the field calculation with pole factors has to do with the number of integration steps per pole. It should be 4*n, where n is an integer, so that the number of steps per half-period is even. However, the default is 10, which messes up the setting of boundaries for the pole factors. If you set it STEPS_PER_PERIOD=12 instead, things should be ok.

I'll change the code to enforce that.

--Michael

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

Re: Setting CWIGGLER

Post by michael_borland » 27 Jul 2022, 20:03

Mikhail,

By the way, I added the ability to subdivide CWIGGLER elements in the last version.

--Michael

Skamarokha
Posts: 23
Joined: 14 Apr 2021, 09:42

Re: Setting CWIGGLER

Post by Skamarokha » 19 Sep 2022, 02:59

michael_borland wrote:
27 Jul 2022, 19:19
If you set it STEPS_PER_PERIOD=12 instead, things should be ok.

I'll change the code to enforce that.
Thank you for the reply.
michael_borland wrote:
27 Jul 2022, 20:03
By the way, I added the ability to subdivide CWIGGLER elements in the last version.
That's great! How can I use this ability? Haven't found a description in user guide.
Respectfully,
Mikhail A. Skamarokha.

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

Re: Setting CWIGGLER

Post by michael_borland » 19 Sep 2022, 15:16

Using the subdivision feature in CWIGGLER is the same as other elements. You have two options
  • Use the element_divisions parameter of the run_setup command.
  • Use the divide_elements command.
--Michael

Post Reply