Body

Hi,

Can anyone further descibe the inputs needed in the MAG file for the analytic expression? I have the period of the wiggler and the peak field (and number of periods).

To me it looks like the peak field is input as K2 but I do not know how to obtain the Kx input.

Also, how is the wiggler set-up if the input does not require either the length or the number of periods?

Any help will be greatly appreciated!

Thanks

Submitted by Marton Ady 5 years ago

For a wiggler, I would use the sine/cosine option.

Its format is:

period dirX dirY dirZ N
A1 B1
A2 B2
...
AN BN

Where period is the period of the sine and cosine function. DirX, dirY and dirZ are the same as before. N is the number of lines that follow.

A1, B1, A2, B2, ... are coefficients, to give the following magnetic field:

B(distance)=
A1*sin(distance*2PI/period) + B1*cos(distance*2PI/period) +
A2*sin^2(distance*2PI/period) + B2*cos^2(distance*2PI/period) +
...
AN*sin^N(distance*2PI/period) + BN*cos^N(distance*2PI/period)

 

For example, a simple wiggler, going along axis Z with 0.5 Tesla peak field, and 25 full-periods of 3cm would look like:

3 0 0 1 25 1
0.5 0

Update: the number 25 should be deleted, it was there by mistake. The number of periods will be determined by the region length (75 cm / 3cm period = 25 periods)

The magnetic region that loads this file should be 75 cm long, and its starting direction (theta angle) should be found with trial and error so that its endpoint is still on the Z axis.

If you need an example let me know and I'll attach.

Submitted by 9e5fd0627c10a3b80b0f 5 years ago

Thank you! Your example input makes sense, we will try to use the sine/cosine input instead.

I am still curious how one would use the analytical expression if anyone knows.

Submitted by Marton Ady 5 years ago

The "Analytic expression" has been ported from the original (DOS) version of Synrad. Upon looking at it closer, it contains the analytic expression for describing the magnetic field in a wiggler following the Halbach wiggler field model:

Where k=2PI/wiggler_period.

If you use the Halbach wiggler model: you choose "Analytic" as the X component in Synrad's region editor, and define the k, kx and B0 parameters in an external MAG file. The x,y,z coordinates are aboslute, so you'll have to position your undulator at the origin.

That said, so far we always used the Sine/Cosine approximation.

Submitted by Marton Ady 5 years ago

Corrected the MAG file, it contained a mistake, sorry.

See correction in red in the original comment.

I've tested the new file and it works:

2018-12-03 11_16_54-Window.png

wiggler1.mag
wiggler1.param