Nonlinear dynamics in a SPEAR wiggler

BL11, the most recently installed wiggler in the SPEAR storage ring at the Stanford Synchrotron Radiation Laboratory, produces a large nonlinear perturbation of the electron beam dynamics, which was not directly evident in the integrated magnetic ﬁeld measurements. Measurements of tune shifts with betatron oscillation amplitude and closed orbit shifts were used to characterize the nonlinear ﬁelds. Because of the narrow pole width in BL11, the nonlinear ﬁelds seen along the wiggling electron trajectory are dramatically different from the magnetic measurements made along a straight line with a stretched wire. This difference explains the tune shift measurements and the observed degradation in dynamic aperture. Because of the relatively large dispersion (1.2 m) at BL11, the nonlinearities particularly reduced the off-energy dynamic aperture. Because of the nature of these nonlinear ﬁelds, it is impossible, even theoretically, to cancel them completely with short multipole correctors. Magic ﬁnger corrector magnets were built, however, that partially correct the nonlinear perturbation, greatly improving the storage ring performance.


I. INTRODUCTION
When the BL11 wiggler was installed in SPEAR in 1998, it was discovered that beam could not be stored at the 2.3 GeV injection energy when the wiggler gap was fully closed. The beam lifetime was short enough that all beam was lost while closing the wiggler gap, before the minimum gap was reached. Once the beam was ramped to the standard operational energy of 3 GeV, the effect was less severe. Closing the gap reduced the lifetime from 48 to 33 h, provided the orbit was centered in the wiggler. If the horizontal orbit was off center by more than 3 mm, the lifetime dropped to minutes, indicating that the reduction in dynamic aperture was highly closed orbit dependent.
The lifetime degradation was determined to be the result of nonlinear fields associated with the finite wiggler pole width. The poles are 50 mm wide in BL11, while the poles in previously installed wigglers are 90 mm or larger. The wiggler was retrofitted with magic finger nonlinear field correctors to cancel the wiggler nonlinearities. The lessons learned from BL11 could prove useful when building future wigglers for light sources, storage ring colliders, and damping rings.
Danfysik met or exceeded all specifications with BL11. The specification they were given for transverse field roll-off in a single pole should have been tighter.

II. BEAM DYNAMICS IN WIGGLERS
Even an ideal wiggler with perfect mechanical construction and no variation in magnetic material generates linear focusing and nonlinear perturbations of the electron beam dynamics [1]. We call these perturbations dynamic field integrals, because they are seen only along the wiggling electron trajectory. They do not show up in stretched wire magnetic field measurements. A wiggler with infinitely wide poles and vertical magnetic fields in the midplane generates dynamic field integrals perturbing only the vertical electron equation of motion; the wiggler looks like a drift space in x. Finite horizontal pole width, however, creates a roll-off in B y ͑x͒, which generates linear and nonlinear perturbations to the horizontal equation of motion as well. It was these perturbations to the horizontal motion that limited the dynamic aperture and lifetime with BL11.
The horizontal dynamic field integrals can be illustrated with a simple analytical calculation. Assume the wiggler fields have only the first longitudinal harmonic in the wiggler period. In the midplane ͑y 0͒, the wiggler fields are Once all three of the field components are specified in the midplane, they are fixed everywhere by Maxwell's equations. The real fields in BL11 have significant third and fifth harmonics, but this approximation still gives useful qualitative results. Figure 1 shows B y ͑x͒ for a TOSCA [2] model of BL11. The 50 mm pole width results in the fields rolling off quickly at 1͞225 mm. For Eq. (1), R B y dz is zero for fixed x over an integer number of periods. The field integral in one pole cancels that from the next pole. With the electron trajectory wiggling in x, however, the electron is in a different transverse position from pole to pole, so the field integral does not cancel. The dynamic field integral along the wiggling electron trajectory R B y ds is nonzero. If a particle is launched at the entrance to the wiggler with ͑x, x 0 ͒ ͑x i , 0͒ it will follow a wiggling trajectory of x p B y ͑x͒͞k 2 Br (2) (neglecting the small curve in the trajectory from the wiggler focusing). The integrated field seen along the wiggling trajectory is where L is the wiggler length. The dynamic field integral scales as the derivative of transverse field roll-off in a single pole as sampled by the wiggling trajectory. Generally, x p is small (for BL11, the wiggler period, 2p͞k is 17.5 cm and the peak field is 2 T, so x p is 155 mm), but with narrow wiggler poles dB y ͑x͒͞dx can be large, generating a strong perturbation. The integral scales as the wiggler period squared (via x p ), so wigglers with longer period generate larger nonlinear fields. The dynamic field integral also scales as 1͞Br, so the perturbation in the electron equation of motion scales as 1͑͞Br͒ 2 , in contrast to standard multipoles which scale as 1͞Br. The dynamic field integral has an extra factor of the rigidity associated with the wiggle amplitude.
With the lessons learned from BL11, Eq. (3) has proven useful at the Stanford Synchrotron Radiation Laboratory  when specifying field tolerances for the design of future wigglers. Tolerances on R B y ds are determined with tracking studies. Then Eq. (3) translates these into tolerances on the transverse field roll-off. Once a wiggler design has been generated that meets the roll-off specification, a more accurate derivation of the dynamic field integrals, including all longitudinal harmonics, can be generated by numerically integrating trajectories through a single wiggler period. Figure 2 compares the field integrals from Eq. (3) to those from numerical integration for BL11, showing reasonable qualitative agreement.
Because the pole design in BL11 is symmetric in x, dB y ͑x͒͞dx is an odd function of x, so the horizontal equation of motion has only terms that look like the odd multipoles -quadrupole, octupole, etc.

III. ELECTRON BEAM MEASUREMENTS WITHOUT MAGIC FINGERS
Measurements were made to characterize the effect of BL11 on SPEAR. Figure  motion monitor [3]. The large change in the linear term of n x vs x 2 b from BL11 indicates a strong octupolelike x 3 component in the horizontal equation of motion. Also note the limited amplitude to which the beam could be kicked with BL11 closed, indicating reduced dynamic aperture. These two measurements were made with all other wigglers closed. With all wigglers open, the beam could be kicked to x 2 b 245 mm 2 , so wigglers had already compromised the dynamic aperture before BL11 was installed.
This octupolelike term was confirmed with measurements of the horizontal tune with horizontal closed orbit bump shown in Fig. 4. With the BL11 gap open, the closed orbit could be moved well beyond the range shown in Fig. 4 with no reduction in beam lifetime. With BL11 closed, the bump range was limited to the range shown in Fig. 4 by the lifetime dropping to minutes.
The horizontal tune was also measured as a function of the rf frequency with BL11 gap opened and closed. The dispersion at BL11 is relatively large (1.2 m), so varying the rf frequency is simply another way to vary the horizontal closed orbit. This measurement gave results similar to those shown in Fig. 4.
The tune shift with closed orbit in a wiggler measures the transverse variation of the derivative of the integrated field gradient vs x ͓d͑ R B y ds͒͞dx 4pBrDn x ͞b͔. There are two contributions to the field integral -random errors from construction tolerances and the dynamic field integral intrinsic to the wiggler. To a good approximation, the random errors produce field integrals that are the same in the coordinate system fixed to the wiggler as in the curvilinear coordinates that move along the electrons wiggling trajectory, so the random errors show up in stretched wire magnetic measurements. The dynamic integrals are nonzero only in the curvilinear coordinates, so they do not show up in the stretched wire measurements. Figure 5 shows the derivative of the field integral according to the electron beam measurements of Fig. 4 compared to the stretched wire magnetic measurements and the dynamic field integrals (the derivative of Fig. 2). A poly-  nomial was fit to the stretched wire field integrals, and the derivative of this polynomial is shown in Fig. 5. The first item to note is that the dynamic field integral is very large. The negative peaks in the dynamic integral at 1͞219 mm are -9 kG, far off scale in Fig. 5. A -9 kG field integral would generate a horizontal tune shift of 20.15 in SPEAR. The field integrals from construction tolerances ("stretched wire" in Fig. 5) are negligible in comparison. The field integrals from tune measurements show good qualitative agreement with the dynamic integrals (with some vertical offset that can be attributed with uncertainty in the b function at BL11, and with some horizontal offset due to the uncertainty in the electrical centers of the beam position monitors).
For comparison to the BL11 measurements, n x vs horizontal closed orbit was measured in the other SPEAR insertion devices. Figure 6 shows the derivative of the field integral for BL9 according to tune measurements and stretched wire measurements. The field roll-off data were not readily available for BL9, so the dynamic field integrals are not shown in Fig. 6. The good agreement between the tune and stretched wire measurements, however, indicates   Fig. 2 reasonably predicts the electron beam measurements. The horizontal tune shift when closing the BL11 magnet gap indicated an integrated field gradient of 20.084 T, while the TOSCA field model in Fig. 2 has an integrated gradient of 20.069 T. Table I shows the agreement between the octupolelike cubic term predicted by the TOSCA field model and that from three different electron beam measurements.
The quadrupolelike focusing generates a horizontal beta beat of 12% and 21% at 3 and 2.3 GeV, respectively. This linear perturbation is not enough to explain the reduction in dynamic aperture. The dynamic aperture reduction results from nonlinear fields.

IV. MODELING THE WIGGLER WITH RADIA AND BETA
A nonlinear map of BL11 was generated using the 3D RADIA magnet modeling code [4] and studied using the BETA accelerator modeling code [5,6]. Figure 7 shows results from BETA that dramatically demonstrate the strength of the nonlinear fields perturbing the SPEAR dynamics. The optics in SPEAR have a 1.2 m dispersion at BL11. Without BL11, the closed orbit at BL11 vs energy is close to a straight line with slope 1.2 m. With BL11 it is discontinuous when x at BL11 approaches the half-pole width, because of the large d͑ R B y ds͒͞dx (see Fig. 2). Figure 8 shows the dynamic aperture at 3 GeV with and without BL11. As could be guessed from Fig. 7, BL11 particularly reduces the off-energy dynamic aperture.   Figure 9 shows a lower jaw of the magnetic finger assemblies designed to cancel the dynamic field integrals. The jaws are attached in pairs to the two ends of the wiggler to create normal multipoles and must fit in a narrow wedge-shaped space between the wiggler end and the vacuum chamber flange.

V. MAGIC FINGER NONLINEAR FIELD CORRECTORS
To limit the number of magnet blocks needed, it was decided the dynamic field integral on the magnetic midplane should be canceled in the interval jxj , 25 mm. The resulting design has six magnet blocks in each jaw. The large blocks take care of the dominating 12-pole component, while the smaller blocks adjust the 8-pole and 4-pole components. The bolt arrangement shown in Figure 9 allows small changes in the block positions in the shimming process.
The four magnet assemblies were attached to an adjustable holder and measured using the single wire bench at European Synchrotron Radiation Facility (ESRF) in Grenoble, France. This bench uses precision linear slides and can measure absolute integrals. The vertical distance between the jaws and the relative distances between the magnet blocks were adjusted until the measured integral agreed with the dynamic field integral on the magnetic midplane. Care was taken to keep the skew multipoles small. Figure 10 shows the correction achieved. After the shimming, the magnetic center was marked using the single wire bench, and the blocks were locked in position with Al filler pieces and a brass foil placed over the magnet blocks as an extra protection.
The correction does not perfectly restore the beam dynamics for a number of reasons.
(i) Given the small longitudinal space available for the correctors, it was impossible to perfectly cancel R B y ds (Fig. 10).
(ii) The wiggler fields are not standard multipoles, while the correctors must be. (More on this below.) (iii) The wiggler errors scale as the square of the electron energy E 2 (electron rigidity and wiggle amplitude), the correctors as E (rigidity only).
(iv) The wiggler errors and correctors scale differently with magnet gap.
(v) The correction is not perfectly local; the correctors will be on either end of the 2.3 m wiggler.
The correctors are thin lens multipoles, so the integrated fields have to be of the form It can be shown that the field integrals must satisfy Eq. (4) if the change in x and y is negligible throughout the magnet (i.e., ds dz). For example, the field integrals measured with a straight stretched wire shown in Fig. 5 satisfy Eq. (4). The dynamic field integrals do not [1]. It is theoretically possible to make correctors that cancel the R B y ͑x, y 0, z͒ ds shown in Fig. 2, but the correctors will only correct the fields for y 0. The correction for y fi 0 will be wrong. Figure 11 shows the magic finger compensation of the dynamic integral over the entire ͑x, y͒ plane. Off the midplane, R B x ds I x is nonzero, so the electrons get a vertical as well as a horizontal kick. The magnitude of the total kick is proportional to q ͑I 2 x 1 I 2 y ͒, which is plotted in Fig. 11. The magic fingers make little improvement in the dynamics for y fi 0.
SPEAR has relatively large b x and h x at BL11 ͑b x 21 m, h x 1.2 m, b y 1.8 m͒, so the optics perturbation is largest in x and energy. Correcting the dynamics in x while ignoring the dynamic integral for y fi 0 was the best way to restore the ring performance. Figure 8 includes the dynamic aperture with magic fingers. The magic fingers are particularly effective for improving the off-energy dynamic aperture.

VI. SPEAR PERFORMANCE WITH MAGIC FINGERS
With magic fingers installed, the storage ring performance was restored nearly to that without BL11. Before magic fingers at the 2.3 GeV injection energy, beam injected with the BL11 gap open would be lost while closing the gap. After magic fingers were installed, the dynamic aperture was sufficiently improved that beam can be stored and injected at 2.3 GeV. With the gap closed, however, the injection rate is still more sensitive to small variations in machine parameters, so the gap is usually opened several millimeters prior to injection. At the 3 GeV operational energy, closing the gap gives no degradation in the ring performance for synchrotron radiation users. There is no measurable change in the lifetime when closing the wiggler gap at 3 GeV.
Both the tune shift with betatron oscillation amplitude and the tune shift with a closed orbit bump were remeasured after the installation of the magic fingers. Figure 12 shows the tune shift with betatron oscillation amplitude with the BL11 gap opened and closed. Comparing Fig. 12 to Fig. 3 shows that the magic fingers greatly reduced the tune shift with amplitude from BL11. The magic fingers also increased the maximum betatron oscillation amplitude to which the beam could be kicked before beam loss. A few comments are necessary to explain other differences between Figs. 12 and 3. The data in Fig. 3 were measured with all other SPEAR wigglers closed, while those in Fig. 12 were made with all other wigglers open. This explains the difference in the slope of n x vs x 2 b for the two measurements with BL11 gap open. Also, there are two reasons the maximum kick amplitude is greater for both curves in Fig. 12 than in Fig. 3. The other wiggler gaps were opened, and beam loss for the maximum kick was greater when measuring the data in Fig. 12. Figure 13 shows the horizontal tune with a horizontal closed orbit bump after the magic fingers were installed. Comparison to Fig. 4 shows that the magic fingers greatly  reduced the tune shift with x from BL11. Also, magic fingers increased by nearly a factor of 3 the range over which the beam could be bumped before the lifetime decreased to minutes. (The change in the starting horizontal tune from 0.13 to 0.17 between Figs. 4 and 13 was a change in the operational value in the 1.5 yr between the two measurements and had nothing to do with BL11.)

VII. CONCLUSION
The narrow poles of the BL11 wiggler generate strong nonlinear fields seen along the electron's wiggling trajectory. The magic finger correction magnets successfully compensate this nonlinear perturbation of the electron dynamics, restoring the storage ring performance for users. Building wigglers with narrow poles has financial advantages, so there is reason to consider designing future wigglers with narrow poles and magic fingers. The wiggler requires less magnetic material, and the force between the magnet jaws is smaller, which reduces the size and complexity of the structure holding the jaws.
The success of the magic fingers with BL11, however, was somewhat dependent upon the particulars of the SPEAR storage ring optics at the wiggler. The magic fingers could not correct the wiggler perturbation in x and y. The low vertical beta function at the wiggler made correction of the vertical dynamics less critical in SPEAR. If a narrow pole device with magic fingers is considered at some other light source or damping ring, a thorough study of the dynamics should be made.