FFAG

class zgoubidoo.commands.magnetique.FFAG(label1: str = '', label2: str = '', *params, **kwargs)[source]

Bases: zgoubidoo.commands.magnetique.PolarMultiMagnet

FFAG magnet, N-tuple.

Zgoubi manual description

FFAG works much like DIPOLES as to the field modelling, apart from the radial dependence of the field, \(B = B_0 (\frac{r}{r_0})^k\), so-called “scaling”. Note that DIPOLES does similar job by using a Taylor r-expansion of \(B_0(\frac{r}{r_0})^k\). The FFAG procedure allows overlapping of fringe fields of neighboring dipoles, thus simulating in some sort the field in a dipole N-tuple - as for instance in an FFAG doublet or triplet. A detailed application, with five dipoles, can be found in Ref. [44]. This is done in the way described below.

The dimensioning of the magnet is defined by :

  • AT : total angular aperture

  • RM : mean radius used for the positioning of field boundaries

For each one of the N = 1 to (maximum) 5 dipoles of the N-tuple, the two effective field boundaries (entrance and exit EFBs) from which the dipole field is drawn are defined from geometric boundaries, the shape and position of which are determined by the following parameters (in the same manner as in DIPOLE, DIPOLE-M ) (see Fig. 11-A page 98, and Fig. 31):

  • \(ACN_i\) : arbitrary inner angle, used for EFBs positioning

  • ω : azimuth of an EFB with respect to ACN

  • θ : angle of an EFB with respect to its azimuth (wedge angle)

  • R1, R2 : radius of curvature of an EFB

  • U1, U2 : extent of the linear part of an EFB

Calculation of the Field From a Single Dipole

The magnetic field is calculated in polar coordinates. At all (R, θ) in the median plane (z = 0), the magnetic field due a single one (index i) of the dipoles of a N-tuple FFAG magnet is written $$B_{Z_i}(R, θ) = B_{Z_{0,i}} F_i(R, θ) (R/RM)^{K_i}$$ wherein \(B_{Z_{0,i}}\) is a reference field, at reference radius \(RM_i\), whereas F(R,θ) is calculated as described below.

Calculation of \(F_i(R, θ)\)

The fringe field coefficient \(F_i(R, θ)\) associated with a dipole is computed as in the procedure DIPOLES (eq. 6.4.16), including (rigorously if the interpolation method is used, see page 125, or to order zero if the analytic method is used, see page 125) radial dependence of the gap size $$g(R) = g_0 (RM/R)^κ (6.4.19) $$ so to simulate the effect of gap shaping on \(B_{Z_i}(R,θ)|_R\) field fall-off, over the all radial extent of a scaling FFAG dipole (with normally - but not necessarily in practice - κ ≈ Ki).

Calculation of the Field Resulting From All N Dipoles

For the rest, namely, calculation of the full field at particle position from the N dipoles, analytical calculation or numerical interpolation of the mid-plane field derivatives, extrapolation off median plane, etc., things are performed exactly as in the case of the DIPOLES procedure (see page 125).

Sharp Edge

Sharp edge field fall-off at a field boundary can only be simulated if the following conditions are fulfilled :

  • Entrance (resp. exit) field boundary coincides with entrance (resp. exit) dipole limit (it means in particular see Fig. 11, \(ω^+ = ACENT\) (resp. \(ω^- = −(AT − ACENT\))), together with θ = 0 at entrance (resp. exit) EFBs)

  • Analytical method for calculation of the mid-plane field derivatives is used.

Command attributes

LABEL1=''

Primary label for the Zgoubi command (default: auto-generated hash).

Type

str

LABEL2=''

Secondary label for the Zgoubi command.

Type

str

HEIGHT='20 centimeter'

Height of the magnet (distance between poles), used by plotting functions.

Type

Quantity

POLE_WIDTH='150 centimeter'

Pole width (used for plotting only).

Type

Quantity

PIPE_THICKNESS='2 centimeter'

Thickness of the pipe, used by plotting functions.

Type

Quantity

PIPE_COLOR='grey'

Color of the pipe, used by plotting functions.

Type

str

REFERENCE_FIELD_COMPONENT='BZ'

Orientation of the reference field (used by field maps)

Type

str

KINEMATICS='None'

A kinematics object.

Type

NoneType

APERTURE_LEFT='10 centimeter'

Aperture size of the magnet, left side (used for plotting only).

Type

Quantity

APERTURE_RIGHT='10 centimeter'

Aperture size of the magnet, right side (used for plotting only).

Type

Quantity

APERTURE_TOP='10 centimeter'

Aperture size of the magnet, top side (used for plotting only).

Type

Quantity

APERTURE_BOTTOM='10 centimeter'

Aperture size of the magnet, bottom side (used for plotting only).

Type

Quantity

IL='0'

Print field and coordinates along trajectories

Type

int

N='1'

Number of dipoles in the FFAG N -tuple (maximum 5)

Type

int

AT='0.0 degree'

Total angular extent of the N dipoles

Type

Quantity

RM='0.0 centimeter'

Reference radius: mean radius used for the positioning of field boundaries

Type

Quantity

ACN='[0.0 0.0 0.0 0.0 0.0] degree'

Azimuth for dipole positioning

Type

Quantity

DRM='[0.0 0.0 0.0 0.0 0.0] centimeter'

Offset for the reference radius of each dipole RM_i = RM + DRM

Type

Quantity

BZ0='[0.0 0.0 0.0 0.0 0.0] kilogauss'

Field of each dipole

Type

Quantity

K='[0.0, 0.0, 0.0, 0.0, 0.0]'

Field index for each dipole

Type

list

G0_E='[1e-08 1e-08 1e-08 1e-08 1e-08] centimeter'

Reference gaps for the entrance fringe fields of each dipole.

Type

Quantity

K_E='[0, 0, 0, 0, 0]'

Fringe field parameter kappa

Type

list

C0_E='[0, 0, 0, 0, 0]'

Fringe field coefficient C0

Type

list

C1_E='[1, 1, 1, 1, 1]'

Fringe field coefficient C1

Type

list

C2_E='[0, 0, 0, 0, 0]'

Fringe field coefficient C2

Type

list

C3_E='[0, 0, 0, 0, 0]'

Fringe field coefficient C3

Type

list

C4_E='[0, 0, 0, 0, 0]'

Fringe field coefficient C4

Type

list

C5_E='[0, 0, 0, 0, 0]'

Fringe field coefficient C5

Type

list

SHIFT_E='[0.0 0.0 0.0 0.0 0.0] centimeter'

Shift of the EFB

Type

Quantity

OMEGA_E='[0.0 0.0 0.0 0.0 0.0] degree'
Type

Quantity

THETA_E='[0.0 0.0 0.0 0.0 0.0] degree'

Entrance face wedge angle

Type

Quantity

R1_E='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Entrance EFB radius

Type

Quantity

U1_E='[-1000000000.0 -1000000000.0 -1000000000.0 -1000000000.0 -1000000000.0] centimeter'

Entrance EFB linear extent

Type

Quantity

U2_E='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Entrance EFB linear extent

Type

Quantity

R2_E='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Entrance EFB radius

Type

Quantity

G0_S='[1e-08 1e-08 1e-08 1e-08 1e-08] centimeter'

Reference gaps for the exit fringe fields of each dipole.

Type

Quantity

K_S='[0, 0, 0, 0, 0]'

Fringe field parameter kappa

Type

list

C0_S='[0, 0, 0, 0, 0]'

Fringe field coefficient C0

Type

list

C1_S='[1, 1, 1, 1, 1]'

Fringe field coefficient C1

Type

list

C2_S='[0, 0, 0, 0, 0]'

Fringe field coefficient C2

Type

list

C3_S='[0, 0, 0, 0, 0]'

Fringe field coefficient C3

Type

list

C4_S='[0, 0, 0, 0, 0]'

Fringe field coefficient C4

Type

list

C5_S='[0, 0, 0, 0, 0]'

Fringe field coefficient C5

Type

list

SHIFT_S='[0.0 0.0 0.0 0.0 0.0] centimeter'

Shift of the EFB

Type

Quantity

OMEGA_S='[0.0 0.0 0.0 0.0 0.0] degree'
Type

Quantity

THETA_S='[0.0 0.0 0.0 0.0 0.0] degree'

Entrance face wedge angle

Type

Quantity

R1_S='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Exit EFB radius

Type

Quantity

U1_S='[-1000000000.0 -1000000000.0 -1000000000.0 -1000000000.0 -1000000000.0] centimeter'

Exit EFB linear extent

Type

Quantity

U2_S='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Exit EFB linear extent

Type

Quantity

R2_S='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

Exit EFB radius

Type

Quantity

G0_L='[0.0 0.0 0.0 0.0 0.0] centimeter'

UNUSED Reference gaps for the lateral fringe fields of each dipole.

Type

Quantity

K_L='[-1, -1, -1, -1, -1]'

UNUSED Fringe field parameter kappa

Type

list

C0_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C0

Type

list

C1_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C1

Type

list

C2_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C2

Type

list

C3_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C3

Type

list

C4_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C4

Type

list

C5_L='[0, 0, 0, 0, 0]'

UNUSED Fringe field coefficient C5

Type

list

SHIFT_L='[0.0 0.0 0.0 0.0 0.0] centimeter'

UNUSED Shift of the EFB

Type

Quantity

OMEGA_L='[0.0 0.0 0.0 0.0 0.0] degree'

UNUSED

Type

Quantity

THETA_L='[0.0 0.0 0.0 0.0 0.0] degree'

UNUSED Entrance face wedge angle

Type

Quantity

R1_L='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

UNUSED Lateral EFB radius

Type

Quantity

U1_L='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

UNUSED Lateral EFB linear extent

Type

Quantity

U2_L='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

UNUSED Lateral EFB linear extent

Type

Quantity

R2_L='[1000000000.0 1000000000.0 1000000000.0 1000000000.0 1000000000.0] centimeter'

UNUSED Lateral EFB radius

Type

Quantity

KIRD='2'

Analytical computation (KIRD = 0) or numerical interpolation (KIRD = 2,4, 25) of field derivatives

Type

int

RESOL='2'
Type

int

XPAS='1.0 millimeter'

Integration step

Type

Quantity

KPOS='2'
Type

int

RE='0.0 centimeter'
Type

Quantity

TE='0.0 radian'
Type

Quantity

RS='0.0 centimeter'
Type

Quantity

TS='0.0 radian'
Type

Quantity

DP='0.0'
Type

float

Default initializer for all Commands.

Attributes Summary

KEYWORD

Keyword of the command used for the Zgoubi input data.

PARAMETERS

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g.

Methods Summary

post_init(**kwargs)

param **kwargs

Attributes Documentation

KEYWORD: str = 'FFAG'

Keyword of the command used for the Zgoubi input data.

PARAMETERS: dict = {'ACN': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, 'Azimuth for dipole positioning', 5), 'APERTURE_BOTTOM': (<Quantity(10, 'centimeter')>, 'Aperture size of the magnet, bottom side (used for plotting only).'), 'APERTURE_LEFT': (<Quantity(10, 'centimeter')>, 'Aperture size of the magnet, left side (used for plotting only).'), 'APERTURE_RIGHT': (<Quantity(10, 'centimeter')>, 'Aperture size of the magnet, right side (used for plotting only).'), 'APERTURE_TOP': (<Quantity(10, 'centimeter')>, 'Aperture size of the magnet, top side (used for plotting only).'), 'AT': (<Quantity(0.0, 'degree')>, 'Total angular extent of the N dipoles', 3), 'BZ0': (<Quantity([0. 0. 0. 0. 0.], 'kilogauss')>, 'Field of each dipole', 7), 'C0_E': ([0, 0, 0, 0, 0], 'Fringe field coefficient C0', 12), 'C0_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C0', 44), 'C0_S': ([0, 0, 0, 0, 0], 'Fringe field coefficient C0', 28), 'C1_E': ([1, 1, 1, 1, 1], 'Fringe field coefficient C1', 13), 'C1_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C1', 45), 'C1_S': ([1, 1, 1, 1, 1], 'Fringe field coefficient C1', 29), 'C2_E': ([0, 0, 0, 0, 0], 'Fringe field coefficient C2', 14), 'C2_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C2', 46), 'C2_S': ([0, 0, 0, 0, 0], 'Fringe field coefficient C2', 30), 'C3_E': ([0, 0, 0, 0, 0], 'Fringe field coefficient C3', 15), 'C3_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C3', 47), 'C3_S': ([0, 0, 0, 0, 0], 'Fringe field coefficient C3', 31), 'C4_E': ([0, 0, 0, 0, 0], 'Fringe field coefficient C4', 16), 'C4_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C4', 48), 'C4_S': ([0, 0, 0, 0, 0], 'Fringe field coefficient C4', 32), 'C5_E': ([0, 0, 0, 0, 0], 'Fringe field coefficient C5', 16), 'C5_L': ([0, 0, 0, 0, 0], 'UNUSED Fringe field coefficient C5', 49), 'C5_S': ([0, 0, 0, 0, 0], 'Fringe field coefficient C5', 33), 'COLOR': ('#4169E1',), 'DP': (0.0, '', 61), 'DRM': (<Quantity([0. 0. 0. 0. 0.], 'centimeter')>, 'Offset for the reference radius of each dipole RM_i = RM + DRM', 6), 'G0_E': (<Quantity([1.e-08 1.e-08 1.e-08 1.e-08 1.e-08], 'centimeter')>, 'Reference gaps for the entrance fringe fields of each dipole.', 9), 'G0_L': (<Quantity([0. 0. 0. 0. 0.], 'centimeter')>, 'UNUSED Reference gaps for the lateral fringe fields of each dipole.', 41), 'G0_S': (<Quantity([1.e-08 1.e-08 1.e-08 1.e-08 1.e-08], 'centimeter')>, 'Reference gaps for the exit fringe fields of each dipole.', 25), 'HEIGHT': (<Quantity(20, 'centimeter')>, 'Height of the magnet (distance between poles), used by plotting functions.'), 'IL': (0, 'Print field and coordinates along trajectories', 1), 'K': ([0.0, 0.0, 0.0, 0.0, 0.0], 'Field index for each dipole', 8), 'KINEMATICS': (None, 'A kinematics object.'), 'KIRD': (2, 'Analytical computation (KIRD = 0) or numerical interpolation (KIRD = 2,4, 25) of field derivatives', 57), 'KPOS': (2, '', 60), 'K_E': ([0, 0, 0, 0, 0], 'Fringe field parameter kappa', 10), 'K_L': ([-1, -1, -1, -1, -1], 'UNUSED Fringe field parameter kappa', 42), 'K_S': ([0, 0, 0, 0, 0], 'Fringe field parameter kappa', 26), 'LABEL1': ('', 'Primary label for the Zgoubi command (default: auto-generated hash).'), 'LABEL2': ('', 'Secondary label for the Zgoubi command.'), 'N': (1, 'Number of dipoles in the FFAG N -tuple (maximum 5)', 2), 'OMEGA_E': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, '', 19), 'OMEGA_L': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, 'UNUSED ', 51), 'OMEGA_S': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, '', 35), 'PIPE_COLOR': ('grey', 'Color of the pipe, used by plotting functions.'), 'PIPE_THICKNESS': (<Quantity(2, 'centimeter')>, 'Thickness of the pipe, used by plotting functions.'), 'POLE_WIDTH': (<Quantity(150, 'centimeter')>, 'Pole width (used for plotting only).'), 'R1_E': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Entrance EFB radius', 21), 'R1_L': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'UNUSED Lateral EFB radius', 53), 'R1_S': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Exit EFB radius', 37), 'R2_E': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Entrance EFB radius', 24), 'R2_L': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'UNUSED Lateral EFB radius', 56), 'R2_S': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Exit EFB radius', 40), 'RE': (<Quantity(0.0, 'centimeter')>, '', 61), 'REFERENCE_FIELD_COMPONENT': ('BZ', 'Orientation of the reference field (used by field maps)'), 'RESOL': (2, '', 58), 'RM': (<Quantity(0.0, 'centimeter')>, 'Reference radius: mean radius used for the positioning of field boundaries', 4), 'RS': (<Quantity(0.0, 'centimeter')>, '', 63), 'SHIFT_E': (<Quantity([0. 0. 0. 0. 0.], 'centimeter')>, 'Shift of the EFB', 18), 'SHIFT_L': (<Quantity([0. 0. 0. 0. 0.], 'centimeter')>, 'UNUSED Shift of the EFB', 50), 'SHIFT_S': (<Quantity([0. 0. 0. 0. 0.], 'centimeter')>, 'Shift of the EFB', 34), 'TE': (<Quantity(0.0, 'radian')>, '', 62), 'THETA_E': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, 'Entrance face wedge angle', 20), 'THETA_L': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, 'UNUSED Entrance face wedge angle', 52), 'THETA_S': (<Quantity([0. 0. 0. 0. 0.], 'degree')>, 'Entrance face wedge angle', 36), 'TS': (<Quantity(0.0, 'radian')>, '', 64), 'U1_E': (<Quantity([-1.e+09 -1.e+09 -1.e+09 -1.e+09 -1.e+09], 'centimeter')>, 'Entrance EFB linear extent', 22), 'U1_L': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'UNUSED Lateral EFB linear extent', 54), 'U1_S': (<Quantity([-1.e+09 -1.e+09 -1.e+09 -1.e+09 -1.e+09], 'centimeter')>, 'Exit EFB linear extent', 38), 'U2_E': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Entrance EFB linear extent', 23), 'U2_L': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'UNUSED Lateral EFB linear extent', 55), 'U2_S': (<Quantity([1.e+09 1.e+09 1.e+09 1.e+09 1.e+09], 'centimeter')>, 'Exit EFB linear extent', 39), 'XPAS': (<Quantity(1.0, 'millimeter')>, 'Integration step', 59)}

Parameters of the command, with their default value, their description and optinally an index used by other commands (e.g. fit).

Methods Documentation

post_init(**kwargs)[source]
Parameters

**kwargs

Returns: