Page 1 of 1

### Setting CWIGGLER

Posted: 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?

### Re: Setting CWIGGLER

Posted: 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

### Re: Setting CWIGGLER

Posted: 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 ?

### Re: Setting CWIGGLER

Posted: 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

### Re: Setting CWIGGLER

Posted: 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"``````

### Re: Setting CWIGGLER

Posted: 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

### Re: Setting CWIGGLER

Posted: 27 Jul 2022, 20:03
Mikhail,

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

--Michael

### Re: Setting CWIGGLER

Posted: 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.