Intrinsic nonlinear effects of dipole magnets in small rings

We find that dynamic aperture depends significantly on the bending radii of dipole magnets when designing a small storage ring for Tsinghua Thomson scattering X-ray source (TTX) mainly because of the nonlinearity of the dipole field. In this paper, we present systematic studies on the intrinsic-geometric nonlinearity of dipole magnets. The Hamiltonian approach is used to determine the expressions of the geometric nonlinear potential and the corresponding third-order resonance strengths. Simulations are conducted to study these resonances. Our analysis results agree well with the tracking results at the third-order resonances 3 ν x ¼ l and ν x (cid:2) 2 ν z ¼ l , where l ’ s are the integer multiple of the number of superperiods.


I. INTRODUCTION
Compact rings, which have many applications in various research fields, such as compact light sources [1][2][3], boosters [4], and hadron therapy [5][6][7][8], are of great interest to many researchers mainly because of their inexpensive, flexible, and high-performance properties. They are therefore considered excellent supplements to large-scale accelerator complexes.
The idea of using a compact laser-electron storage ring in an inverse Compton scattering (ICS) X-ray source was proposed by Huang and Ruth [1]. Intense ICS X-rays can be produced at a MHz-repetition rate by the interactions between electron beams stored in a compact ring and high power laser pulses accumulated in an optical cavity. We plan to add a small electron storage ring to the existing Tsinghua Thomson scattering X-ray source (TTX) [9]. The design of a 4.8-m ring for TTX is presented in [10].
Our lattice design ideas use dipole magnets with carefully adjusted bending radii and edge angles to provide proper focusing in both transverse directions and quadrupole magnets to adjust the damping partition number and momentum compaction factor. The bending radii of the dipole magnets in the ring need to be very small because the horizontal focusing strength induced by the dipole field is inversely proportional to the square of the bending radius (this dependence is shown in Sec. II A). Meanwhile, the edge angles of the dipole magnets should be large enough to provide a strong enough vertical focusing.
At the beginning, we designed several lattices with circumferences of 2.8 m, 3.0 m, 3.6 m, 4.8 m, and 6.0 m, with bending radii of 0.1082 m, 0.1401 m, 0.1464 m, 0.2546 m, and 0.3501 m, respectively. In these cases, the nonzero edge angles of the dipole magnets were used to adjust the vertical betatron tunes. Only the linear effects of the dipole fringe fields were considered by applying Karl L. Brown's formalism [11]. The fringe fields of the quadrupole magnets were not included in the studies. However, we found that enlarging the dynamic aperture became more and more difficult when the bending radii of dipole magnets became smaller. We started to look at the nonlinearity of the dipole field, which was eventually demonstrated the key limitation of the dynamic aperture in the lattices mentioned above because nonlinear multipole field did not exist in the lattice. We call this nonlinearity the intrinsic-geometric nonlinearity of dipole field.
Furthermore, many studies [11][12][13][14][15][16] indicated that the fringe fields of dipole magnets can influence the beam dynamics in a ring, especially when the bending radii of dipole magnets are small. In our studies [10], we have considered the linear effects of dipole fringe fields, in which the vertical gap of the dipole magnets (g) and the fringe field integral (FINT) are variables. A Lie map generator of the dipole fringe field was derived by Hwang and Lee recently [16]. Their results show that the nonlinear effects of dipole fringe fields are critical in the TTX ring. Therefore, the serious consideration of the fringe field effects is necessary in both the optimization of lattice and the design of magnets. However, the nonlinear fringe field effects are out of the scope of our paper.
In this paper, we present our studies of the intrinsicgeometric nonlinearity of dipole magnets. We exclude all the other nonlinear sources, such as the nonlinearity of the dipole fringe fields and the nonlinear multipole fields, to simplify our study. The rest of this paper is organized as follows. In Sec. II, the nonlinear Hamiltonian dynamics in the Frenet-Serret coordinate system is discussed. The expressions of the new Hamiltonian and the corresponding resonance strengths in the action-angle variables are provided in this section. In Sec. III, we present the calculations of the resonance strengths using the lattices based on the TTX ring layout as examples. The resonance strengths of the third-order resonance 3ν x ¼ 4 and the third-order coupling resonance ν x − 2ν z ¼ −2 driven by the dipole fields are calculated both analytically and by fitting the tracking data. The results from these two methods are compared. The dependence of the resonance strengths on the bending radii of dipole magnets is also studied. The conclusion is in Sec. IV.

A. Hamiltonian for particle motion
The Hamiltonian for particle motion in the Frenet-Serret coordinate system can be expressed by (e.g., [17]) where the six dimensional phase-space coordinates are ðx; p x ; z; p z ; t; −HÞ, ρ denotes the bending radius, and ϕ andÃðA x ; A z ; A s Þ are the scalar potential and vector potential in the Frenet-Serret coordinate system, respectively. Since the transverse conjugate momenta p x and p z are much smaller than the total momentum , we expand the HamiltonianH up to the second order in p x and p z . The expanded Hamiltonian is as follows: As mentioned above, we need to exclude all the nonlinear multipole components (e.g., sextupole terms) to study the intrinsic-geometric nonlinearity of dipole field. Therefore, the vector potential for a ring consisting of ideal dipole and quadrupole fields can be represented by where B 0 ðsÞ ¼ −p=ðeρÞ and B 1 ðsÞ ¼ ∂B z =∂x are the dipole field strength and quadrupole gradient, respectively. By substituting the expressions of the vector potential AðA x ; A z ; A s Þ mentioned above into Eq. (2) and usingp x ¼ p x =p andp z ¼ p z =p as the conjugate momenta, we can obtain new Hamiltonian as follows: Bρ are the horizontal and vertical focusing functions with the dimension ½m −2 , respectively, where H 0 is the unperturbed Hamiltonian for the linear betatron motion and V nonlinear is the nonlinear perturbing potential. Unlike the nonlinearities of multipole fields discussed in many books (e.g., Chapter 2.VII in [17]; Chapter 13 and 14 in [18]), the V nonlinear shown in Eq. (3) is induced by the dipole field. This term is usually negligible in the analysis of nonlinearity in a synchrotron with large ρ. However, the expression of V nonlinear shows that its importance in compact rings increases with decreased ρ.

B. Floquet transformation
We carry out the Floquet transformation [17] to the Hamiltonian shown in Eq. (3) to obtain a clearer picture of the particle motion. The original position-momentum variables ðx;p x ; z;p z Þ are replaced by the action-angle variables ðJ x ; ϕ x ; J z ; ϕ z Þ using β z ds are the betatron phases, ν x and ν z are betatron tunes, and θ ¼ s=R denotes the orbiting angle around the ring, while R is the mean radius of the ring.
The resulting Hamiltonian in action-angle variables can be written asH ¼H 0 þV nonlinear , where the unperturbed depending only on action variables J x and J z . The unperturbed Hamiltonian H 0 is a constant in the new action-angle coordinate system because θ is the new independent "time" variable after the transformation.

C. Resonances
The nonlinear perturbing potentialV nonlinear in Eq. (5) shows that three kinds of resonances (ν x ¼ l, 3ν x ¼ l, and ν x AE 2ν z ¼ l, where l is an integer) can be driven by the dipole field.
A particle's motion is widely known to be dominated by the specific resonance when the betatron tunes of the particle are close to this resonance line. Therefore, when the betatron tunes of a particle are near the resonance line mν x þ nν z ¼ l, the Hamiltonian can be written in the following form: where m, n, p, q, and l are all integers; (jmj þ jnj) denotes the order of the resonance; p and q satisfy p ≥ jmj and q ≥ jnj, respectively; ξ m;n;p;q;l is the resonance phase; and g m;n;p;q;l is the resonance strength. The subscripts of the resonances, which can be driven by the dipole field, are listed in Table I. The expressions of the corresponding g m;n;p;q;l of these resonances are shown in Eq. (6), which can be used to estimate the resonance strengths driven by the dipole fields analytically. The resonance strengths shown in Eq. (6) are determined by the bending radius ρ, the Courant-Snyder parameters, and the resonance proximity numbers δ (for a particle near the resonance line mν x þ nν z ¼ l, δ ¼ mν x þ nν z − l). We notice that ρ is always in the denominators, which implies that the resonances tend to become stronger when the bending radius becomes smaller. If all the other terms remain the same, the resonance strengths are inversely proportional to the bending radius ρ. The Hamiltonian shown in Eq. (7) is valid for describing the particle motion close to any resonance line, regardless if it is driven by dipole or sextupole fields. However, the expressions of g m;n;p;q;l are different in these two cases. Supposing P superperiods are in a ring, the positions of the dipole fields satisfy the same periodic condition automatically. Therefore, the systematic resonances driven by dipole fields are always located at the l ¼ P × integer. However, it is not as straightforward for the sextupole driven resonances because the arrangement of the sextupole magnets requires extra attention to ensure that the sextupole fields satisfy the same periodic condition.

III. CALCULATIONS OF THE RESONANCE STRENGTHS
The derivation of the Hamiltonian and the resonance strengths corresponding to the dipole-driven resonances are provided in the last section. In this section, we present the calculations of the resonance strengths by applying the analytical formulas shown in Eq. (6) and compare them with the results extracted from particle tracking. Integer and half-integer resonances should be avoided in designing a lattice because they are extremely dangerous. Therefore, the strength of the dipole-driven integer resonance is not calculated here. We study the third-order resonances 3ν x ¼ l and ν x AE 2ν z ¼ l induced by dipole fields carefully in this section.
The layout of the TTX electron storage ring, consisting of only four dipole and two quadrupole magnets, is used as an example here. The schematic drawing of the ring is shown in Fig. 1. In this example, each dipole magnet should provide a 90°bending angle to the reference particle. In addition, the nonzero edge angles at both the entrance and exit of the dipole magnets provide vertical focus to the beam. Neither the nonlinear multipole magnets nor the nonlinear fringe fields of the dipole magnets are included in the lattice, which means that the dipole magnets are the only possible sources of nonlinearity. Two ideal quadrupole magnets are located at the centers of the two opposite straight sections. A lattice using the layout mentioned above has two superperiods. Therefore, a resonance is systematic when l is an even integer.
Using the layout mentioned above, we are able to obtain many lattices, which satisfy the necessary condition for orbit stability jTraceðMÞj ≤ 2 (M denotes the one-turn transfer matrix). The optical functions can be calculated easily. The resonance strengths can then be calculated by substituting the Courant-Snyder parameters, the betatron tunes, and ρ into Eq. (6).
The resonance strengths can also be obtained by fitting the turn-by-turn tracking data to the Hamiltonian [see Eq. (7)] when the betatron tunes are adjusted closely to the specific resonance line. The fitting process near a 3ν x ¼ l resonance can be simplified to a 1D problem because the particle motion can be well approximated by a 1D Hamiltonian. However, the fitting near a coupling resonance is not as straightforward. The proper canonical transformation needs to be carried out first to decouple the equations of motion.
The code ELEGANT [19] is selected for the calculations of the optical functions and tracking because ELEGANT performs symplectic integration for hard-edge dipole magnets using the exact Hamiltonian [shown in Eq. (1)] [20] instead of the truncated Hamiltonian. In principle, all the nonlinear perturbing potential terms we require are included automatically in the tracking because of the usage of the exact Hamiltonian. The fourth-order symplectic integration method is applied in the particle tracking.
The bending radius, edge angles of the dipole magnets, quadrupole strength, and circumference are used to adjust the optical functions of the lattices, while maintaining two superperiods in each lattice.
A. Third-order resonances 3ν x = l Using the layout shown in Fig. 1, we achieve the design of a 4.8-m lattice with ν x ¼ 1.
amplitude and horizontal dispersion functions are shown in Fig. 2.
Because the horizontal bare betatron tune ν x ¼ 1.2783 is close to the systematic third-order resonance line 3ν x ¼ 4, the particle motion is dominated by this resonance. The resonance strength g 3;0;3;0;4 ¼ 1.0179 ½πm −1=2 can be obtained by substituting the values of the required optics parameters into the analytical expression of g 3;0;3;0;l , where l equals 4 in this case. The calculation can be simplified by selecting the s ¼ 0 position properly to make sure that the resonance phase ξ 3;0;3;0;4 ¼ 0.
We track several on-momentum particles with different horizontal amplitudes to calculate the resonance strength through the tracking method. The coordinates of these particles are recorded turn-by-turn. Figure 3 is the Poincaré map showing the trajectories of the tracked particles in the normalized horizontal phase space ðX; P x Þ, where X ¼ x and P x ¼ β xpx þ α x x. The triangle distortion of the phasespace trajectories indicates clearly that the corresponding particles are dominated by a third-order resonance.
Since the particle motion is dominated by the resonance 3ν x ¼ 4, the Hamiltonian can be well-approximated by the following 1D form After transforming the particles' coordinates ðx;p x Þ to the action-angle variables ðJ x ; ϕ x Þ, we can fit the tracking data using Eq. (8) to extract the resonance strength. Both the tracking data and the fitted Hamiltonian tori are shown in Fig. 4, where the solid curves denote the fitted Hamiltonian tori, and the cross marks are the tracking data points. The fitted value of the resonance strength is g 3;0;3;0;4 ¼ 0.8685 ½πm −1=2 .
We developed four more cases with different bending radii similar to the case described above. In all these cases, the horizontal betatron tune is selected to be the same value (ν x ¼ 1.2783), which means that the same systematic thirdorder resonance line 3ν x ¼ 4 dominates. The resulting resonance strengths g 3;0;3;0;4 calculated by both analytical and tracking methods are listed in Table II. The relative differences between the fitted and analytical values of the resonance strength g 3;0;3;0;4 are also presented in the same table. We notice that the absolute values of the relative differences are always smaller than 30% in all the examples, which means that the estimation of the resonance strength g 3;0;3;0;4 by the analytical formula is reasonably good. The discrepancy between the analytical estimations and the values extracted from the tracking results may be due to the fact that more than one resonance line influences the particle motion. Even though the resonance 3ν x ¼ 4 may be dominant, at least one other resonance that is not negligible exists. However, we are still able to predict roughly whether the third-order resonance lines 3ν x ¼ l dominate and evaluate roughly how strong the resonances are by estimating the resonance strengths g 3;0;3;0;l using the analytical formula instead of carrying out massive tracking simulations. Tracking is only required when the influences of the resonances need to be studied quantitatively.
The results in Table II show that the resonance strength is higher when the bending radius is becoming smaller, except in case 3. This phenomena is caused by the dependence of the resonance strength not only on the bending radius but also on the Courant-Snyder parameters. We need to exclude the influences of the Courant-Snyder parameters to check the dependence of the resonance strength g 3;0;3;0;4 on the bending radii. Therefore, 100 stable lattices are randomly generated at each ρ value, which means that the Courant-Snyder parameters are also randomly generated. The random variables are the strength of quadrupoles, edge angles of the dipole magnets, and the length of the straight sections. All the randomly generated lattices have the same horizontal betatron tunes to maintain a fair comparison. The resonance strength g 3;0;3;0;4 is calculated in each case by the analytical formula. The mean values and standard deviations of g 3;0;3;0;4 , calculated at each bending radius, are represented by the cross marks and error bars in Fig. 5, respectively. The resonance strength is inversely proportional to ρ if the influences of the Courant-Snyder parameters are excluded. Therefore, we apply the hyperbolic fitting on the calculated resonance strengths. The fitted curve is represented by the blue dashed curve in Fig. 5. The good agreement between the calculated resonance strengths and the fitting curve shows that the resonance strength g 3;0;3;0;4 tends to be inversely proportional to the bending radius of the dipole magnets. The larger standard deviation of resonance strength at the smaller ρ indicates that the nonlinearity becomes more sensitive to the lattice design.
B. Third-order coupling resonances ν x − 2ν z = l When the betatron tunes are adjusted closely to the thirdorder coupling resonance lines ν x − 2ν z ¼ l, the coupling Hamiltonian can be expressed by which is no longer a 1D Hamiltonian. Therefore, fitting the tracking data to this Hamiltonian is very difficult. A proper canonical transformation needs to be carried out to decouple the particle motion and determine the proper way to extract the resonance strength g 1;−2;1;2;l .
We can carry out the canonical transformation using the second type of generating function where ϕ x and ϕ z denote the old phase variables, corresponding to the old action variables J x and J z , and J 1 and J 2 denote the new action variables corresponding to the new phase variables ϕ 1 and ϕ 2 .
The transformation between the old and the new actionangle variables can be expressed by Therefore, the new Hamiltonian in the new action-angle variables is  where δ ¼ ν x − 2ν z − l is the resonance proximity parameter. Because the Hamiltonian H new is independent of ϕ 2 , we obtain _ J 2 ¼ −∂H new =∂ϕ 2 ¼ 0 by the Hamilton's equation, which means that J 2 ¼ 2J x þ J z is an invariant.
The equation of motion becomes which shows that the equation of motion in the new actionangle variables is not coupled. We then design a 4.8-m ring using the layout shown in Fig. 1 to study the coupling resonances ν x − 2ν z ¼ l. The betatron tunes are ν x ¼ 1.0889 and ν z ¼ 1.5379 (close to the resonance ν x − 2ν z ¼ −2) when the length of each dipole magnet is 0.4 m (corresponding to ρ ¼ 0.2546 m), the edge FIG. 6. Betatron amplitude and dispersion functions of a 4.8 m ring, which is used to study the third-order coupling resonance at ν x − 2ν z ¼ l. To study this coupling resonance by tracking, we select a test particle with the following initial coordinates: The nonzero initial betatron amplitudes in both the horizontal and vertical directions are necessary to study the coupled motion.
The Poincaré maps of the test particle in the horizontal and vertical normalized phase spaces are shown in Figs. 7(a) and (b). Both the horizontal and vertical phase-space trajectories are smeared because of the coupling. Figure 7(c) shows the old and new actions turn-by-turn. The J x and J z are out of phase because of the coupling. J 2 seems an invariant, which shows qualitatively that the particle motion is dominated by the resonance ν x − 2ν z ¼ l. The turn-by-turn data points of the particle are recorded in the ðJ x ; J z Þ space (shown as the blue points in Fig. 7(d)) to calculate the value of the new invariant J 2 . Furthermore, linear fitting to the tracking data is carried out, causing the equation of the fitting curve to be J z þ 1.997J x ¼ 1.898 ½μm, which agrees perfectly with the theoretical prediction J z þ 2J x ¼ J 2 ¼ invariant. The R-squared value of this fitting is 0.9667, which is reasonably good.

IV. CONCLUSION
In this paper, we present our study of the intrinsicgeometric nonlinearity of dipole magnets in small rings. We derive the general form of the Hamiltonian near the dipoledriven resonances in action-angle variables. The analysis shows that three kinds of resonances (ν x ¼ l, 3ν x ¼ l, and ν x AE 2ν z ¼ l, where l is an integer) can be driven by the dipole field. The analytical expressions of the strengths of these resonances are provided.
We use the layout of the TTX storage ring as an example to calculate the strengths of the third-order resonances 3ν x ¼ l and ν x AE 2ν z ¼ l both analytically and by simulation and examine the validity of the analytical results. Particle tracking is carried out by the ELEGANT code when the betatron tunes move closely to the systematic resonance lines. The third-order resonance 3ν x ¼ 4 and the thirdorder coupling resonance ν x − 2ν z ¼ −2 are the two resonance lines we use in this paper. The calculation results show that the strengths of these two resonances extracted from tracking agree reasonably well with the values calculated analytically.