## Abstract

The objective of this article is to propose a scheme to increase the stability zone of a charged particles beam in synchrotrons using a suitable objective function that, when optimized, inhibits the resonances onset in phase space and the dynamic aperture of electrons in storage rings can be improved. The proposed technique is implemented by constructing a quasi-invariant in a neighborhood of the origin of the phase space, then, by using symbolic computation software, sets of coupled differential equations for functions involved in nonlinear dynamics are obtained and solved numerically with periodic boundary conditions. The objective function is constructed by proposing that the innermost momentum solution branch of the polynomial quasi-invariant approaches to the corresponding ellipse of the linear dynamics. The objective function is optimized using a genetic algorithm, allowing the dynamic aperture to be increased. The quality of results obtained with this scheme are compared with particle tracking simulations performed with available software in the field, showing good agreement. The scheme is applied to a synchrotron light source model that can be classified as third generation due to its emittance.

## Introduction

Nowadays, the design of storage rings of synchrotron light sources is a major challenge, mainly because the dynamic aperture is reduced by non-linear properties of the lattice. In the first stage of the design, magnetic dipoles and quadrupoles are used to generate a linear achromatic lattice^{1} with a given emittance. The second step involves the introduction of magnetic sextupoles, and if needed, octupoles, which transform dynamics from linear to nonlinear, generating new phenomena that, if not controlled, are sources of instability of the electron beam. In such a case, the brilliance of the synchrotron radiation could be degraded affecting the ongoing experiments of technological, basic, and applied scientific research^{2}.

When a synchrotron light source is operated, there can be several hundred electron bunches distributed along the ring. The bunches travel inside a metal tube at very high vacuum conditions, minimizing collisions with gas molecules. The tube passes through the center of all the magnets. The electron bunches must be stabilized by interacting with magnetic forces, provided by several magnetic multipoles. In operation, such stability must be guaranteed for several hours.

When searching for a good design, it is necessary to optimize the different lengths of all magnets, their field strengths (the latter are described by the functions \(b_1(s)\), \(b_2(s)\), and \(b_3(s)\) which are piecewise constant functions, as shown in Fig. 1), as well as the lengths of the free spaces between them, the so-called drift spaces. Usually, this process gives the ring a physical structure based on a periodic arrangement of magnetic cells, as indicated in Fig. 2. The process seeks for an arrangement of these magnets to allow electrons describe stable trajectories, traveling at speeds close to the speed of light.

In the continual search to reduce the emittance of new synchrotrons, the use of increasingly intense magnetic quadrupoles is required, giving rise to more noticeable chromatic effects. The use of high intensity magnetic sextupoles (chromatic), and higher order multipoles, is required to correct these effects. A different type of sextupoles, called geometric, is added to correct undesirable effects produced by chromatic sextupoles to improve the dynamic aperture. The more intense the sextupoles and higher order multipoles are, the more difficult it is to keep dynamic stability under control. At this level, the problem to be solved in the design process is to adjust the sextupoles families to simultaneously maximize both, the dynamic aperture, and the moment aperture. Additionally, the complexity increases if other types of important variables are included in the optimization^{3}. Ultimately, the ring designs must be robust in the presence of non-linearities, intentional such as sextupoles, or unintentional, such as errors and imperfections in the field of the magnets. The conventional method to make these adjustments is to minimize many resonant terms^{4,5}. These results are then validated with particle tracking simulation^{6,7}. Moreover, it is common to use complementary tools such as frequency map analysis^{8} to have a better picture of the tune diffusion and resonance structures. Other effective optimization methods, very demanding in computational resources^{9}, directly calculate the dynamic aperture by means of particle tracking^{10,11,12,13}, including the calculation of resonant terms if required^{14}. Nonlinear systems of great complexity in their analytical resolution procedures led some authors to analyze and develop novel methods to treat them numerically^{12,13}. Some of those methods are based on highly accurate descriptive procedures^{6,7}. Furthermore, the need to have machines with better performance has motivated researchers to propose new solutions such as integrable accelerators^{15,16,17}, where the magnetic fields are modulated in such a way that integrals of motion are achieved.

It has also been suggested that averaged invariants could be useful to analyze the fully coupled dynamics over a single synchrotron oscillation^{18}. There are also proposals for the use of approximate invariants, (or quasi-invariants)^{19,20,21,22}, to advance the understanding of nonlinear dynamics in synchrotrons. Some of these proposals use particle tracking to make the system approximately integrable^{20}.

Another proposed way of introducing approximate in- variants^{23,24,25}, focusing on describing the phase space of design-friendly synchrotrons (such as a booster), seems appropriate to describe resonances appearing in the synchrotrons transverse phase space. These ideas had not been widely explored until recently, when an extension of this formalism to a 5th degree polynomial was applied to a 3rd. generation light source^{26}. Our aim is to take a step forward from what has been presented in references^{23,24,25,26}, supplying content and concepts that may be useful to understand nonlinear processes in synchrotrons and to improve synchrotron design performance. Now this formalism is employed to develop an algorithm for the exploration and manipulation of the phase space of these systems, focused on increasing the dynamic aperture of dynamically more complex synchrotrons. In this paper, an objective function, and an optimization scheme, based on it, are proposed to maximize the dynamic aperture of a synchrotron light-source. Although the optimization of the dynamic aperture of these systems using quasi-invariants has been addressed before^{20}, the present work has a different approach and methodology. While Ref.^{20} uses particle tracking to make the system quasi-integrable, the present work proposes the search for a bounded stability zone using an objective function, forcing the phase space of the nonlinear system to resemble the linear one. This is based on the determination of the roots of a polynomial quasi-invariant, without using particle tracking nor considering the resonant terms. As far as we know, this approach has not been used before. In addition, this proposal has the advantage of locally considering, at a given approximation order, the possibility of inhibiting resonance onset. It will be shown that robust results are obtained as the amplitude of the oscillations increases and as the momentum dispersion is considered. In this way, it is shown that the proposed quasi-invariant based method can be a useful tool to increase the dynamic aperture of the electron beam in a synchrotron light source. Particle tracking methods (such as the one used by OPA) were used in the present work only for comparative purposes, showing a good agreement with the results obtained. A one-dimensional problem has been treated in this work, but it can be easily extended to 2D. This method provides a different strategy to address the problem of optimizing the dynamics of these systems and facilitate the design of new state-of-the-art synchrotron light sources.

## Approximate constants of motion

References^{23,24,25} describe a method to extend the linear theoretical structure to the nonlinear case in the study of synchrotron dynamics. There, the existence of nonlinear functions that play a similar role to that of functions \( \alpha \), \( \beta \), and \( \gamma \) used in the linear case^{27} is proposed. With these nonlinear functions, quasi-invariants can be established, with validity in a local range of phase space.

Interest in quasi-invariants formalism continues^{18} because it could help in the design of modern particle accelerators,^{28,29}, where the effects of nonlinear dynamics are increasingly important, adding complexity to the implementation of each design. Reducing these effects may contribute to have light sources with emittances that provide better quality and properties of the emitted light, enhancements that are very useful in cutting-edge experimental techniques in various areas of science.

### Approximate constants of motion for the one dimensional problem

Since there are 3 physical variables in synchrotron dynamics, the phase space of this system is 6-dimensional. Hence, in the long term, our objective is to address a more complex structure than the one presented here. However, constructing a more general formulation to address this complexity is not trivial, so it is very important to proceed in small but firm steps. In this way, a one-dimensional approximation is very useful for a deep understanding of dynamical problems of accelerators in lower dimensions. Similar approaches can be found in references^{30,31,32}.

Following the structure of a previous work^{26}, and for completeness of this work, one can consider a one-dimensional linear motion where the Hamiltonian has the form

where (\(x,p_x\)) are canonical conjugate variables, \( K (s) = K (s + c) \) is a periodic function of *s*, with period *c*, and represents the intensity of the magnetic quadrupoles of the storage ring. The red piece-wise constant function in Fig. 1 is related to function *K*(*s*). This system has the invariant

where \( \alpha _x(s)\), \( \beta _x(s) \) and \( \gamma _x(s)\) are the periodic Courant-Snyder functions, also with period *c*^{27}.

As reference^{23} shows, the above description can be extended to the one-dimensional nonlinear case described by the Hamiltonian

In reference^{23}, it is proposed that this system has an approximate invariant of the form

where \(A^{(0)}(s)=A^{(0)}(s+c)\) are periodic functions, which must satisfy differential equations imposed by the invariant condition

and can be viewed as a generalization of the linear Courant-Snyder functions \(\alpha _x\), \(\beta _x\), and \(\gamma _x\), for the nonlinear regime. Therefore, the proposed approximate invariant in Eq. (4) is a generalization of the linear Courant-Snyder invariant of Eq. (2). This idea has been proposed in references^{23,25} to treat chromatic effects in these systems, i.e., taking into account the possibility that the particles have a momentum *p* different from the design momentum \(p_0\). It has been shown that when chromatic effects are included in this way, the results obtained are in good agreement with those obtained by simulations using numerical solutions of Hamilton equations.

The linear system (1) is relevant since its invariant (2) is well understood; thus, it is possible to compare the phase space structure of the nonlinear system with respect to the linear case by using an extension of the expression (2). Furthermore, this representation could be used to develop semi-analytical tools that can be useful in the nonlinear regime addressed in the accelerator design process.

This extension also allows the introduction of chromatic effects in the analytical framework, suggesting its usefulness as a complement within the analysis of Hamiltonian systems, as it will be discussed below.

### Searching for an approximate constant of motion for the two-dimensional problem

The approach to study electron dynamics in these systems usually consists of transforming the well-known relativistic Hamiltonian of a charged particle in an electromagnetic field, originally expressed in the laboratory system, to a moving reference system. After this change of coordinates, a transformation of variables is made allowing the longitudinal coordinate *s* to be the independent variable instead of the time *t*. From the resulting Hamiltonian, the equations of motion can be obtained; these calculations are standard, and their details can be seen in reference^{4}. In certain circumstances the longitudinal motion (*s*, \(p_s\)) can be decoupled from the transverse motion (*x*, \(p_x\), *y*, \(p_y\)), and it is even possible to decouple the transverse motion into a horizontal (*x*, \(p_x\)) and a vertical motions (*y*, \(p_y\)).

Let us use a more general expression of the Hamiltonian that appears in Eq. (3). Following the notation of references^{4,33}, a Hamiltonian of the form

describes the transverse dynamics of particles in a synchrotron. This Hamiltonian has been widely used in preliminary dynamic aperture studies^{4,34,35}, in the first stage of storage ring design.

The functions \( b_1 (s)\), \( b_2 (s)\), and \( b_3 (s)\) are periodic functions with piece-wise constant behavior, respectively describing the curvature of the dipoles and the intensities of the quadrupoles and sextupoles of the accelerator and \(\delta = \Delta p / p_0\), where \( \Delta p \) is the momentum deviation with respect to design momentum \(p_0\). \(b_1(s) = 1 / \rho \) (\(\rho \) is the radius of curvature of a particular dipole) and the remaining parameters are given by the following expression^{34}

where \( B\rho \) is the magnetic rigidity that connects magnetic field and radius of curvature with the energy of a relativistic electron via \(B\rho [Tm] = 3.3356\, E[GeV]\). Also, if *R* is the pole inscribed radius, \(b_n\) is related to the pole tip magnetic field \(B_{pt}\) (Fig. 1) by the equation

that is very useful in determining fields for magnet design.

In references^{24} and^{25} it has been proposed that a quasi-invariant of the form

can be associated with this Hamiltonian (Eq. (6)). Here, the chromatic nonlinear functions (\( n \ge 1 \)) are also periodic, that is, \(A^{(n)}_{ijkl}(s)=A^{(n)}_{ijkl}(s+c)\). When computed for a particular arc length *s*, these functions acquire numerical values.

Equation (9) represents a nonlinear extension of the Courant-Snyder invariant, Eq. (2); which means that to a second degree, the lowest order, only the *horizontal* functions \(A^{(0)}_{ijkl}(s)\) are different from zero. The substitution of Eq. (9) in expression (5) leads to a system of linear differential equations. The number of equations depends on the polynomial degree considered. In this paper we consider a fifth-degree polynomial. The sixty meaningful associated differential equations corresponding to non-null, nonlinear functions related to on-momentum (\(\delta = 0\)) particles are presented below in Eqs. (10)–(18). The Eqs. (10)–(12) have already been considered in reference^{26}.

Although equations for the non-linear functions \(A^{(1)}_{ijkl}(s)\) for \(\delta \ne 0\) were presented in Ref.^{26}, that can be implemented for treating off-momentum particles, we have only used \(A^{(0)}_{ijkl}(s)\) (on-momentum) in order to investigate the suitability of the proposed approach to produce good results when optimizing dynamic aperture. An extension to off-momentum analysis is underway.

It is possible to incorporate the longitudinal motion into a more general Hamiltonian and reapply the quasi-invariant protocol in 6D space, as is done using other methods (TPSA/tracking)^{36}. This, however, is beyond the scope of this work as the 4D system has not yet been developed.

The differential equations (10-18) for the \(A's\) functions, and the periodicity conditions \(A(s+c) = A(s)\), imposed by the considered magnetic lattice (the specific selection of magnetic multipoles in the ring), determine the values of the functions *A*(*s*) in a period, which is usually a synchrotron cell. The synchrotron ring consists of an assembly of several of these cells.

Note that expressions (10) reproduce the equations satisfied by the Courant-Snyder parameters \(\alpha _x\), \(\beta _x\) and \(\gamma _x\), inherent to linear dynamics; while Eqs. (11) and (12) are the equations of the first non-null nonlinear functions in the expansion (Eq. (9)), which must be satisfied for invariant condition (Eq. (5)) to be fulfilled. Equation system (11) only involves functions associated with the horizontal motion *x* in the accelerator, while the functions of equation system (12) couple the horizontal and vertical motions. In all the equation systems there are only functions \(A^{(0)}\), which describe on-momentum particles. The algebraic manipulation to obtain these equations has been carried out with wxMaxima^{37}.

Another point that deserves attention is that the set of functions in Eq. (10): \(A^{(0)}_{2000}\), \(A^{(0)}_{1100}\) and \(A^{(0)}_{0200}\) are of essential importance. Real and bounded values of these functions are possible thanks to an appropriate selection of quadrupoles in the lattice, whereas the use of inappropriate values would lead to instability of the linear solution. The existence of non-zero values of higher order functions, like those appearing in Eqs. (11) and (12), occurs thanks to the fact that the aforementioned functions intervene in the non-homogeneous part of the equations, giving them nonzero values. Analogously, in those equations that contain nonlinear functions, the sextupolar contribution \(b_3(s)\) appears for the first time. If this contribution were zero, the functions contained in Eqs. (11) and (12) must be zero, i.e., the quasi-invariant Eq. (9) will be reduced to the Courant-Snyder invariant of Eq. (2).

Reference^{26} outlines the procedure to determine the sixty values of the functions \(A^{(0)}(s)\), at \(s=0\), appearing in Eqs. (10)–(18), subjected to periodic boundary conditions \(A^{(0)}_{ijkl}(0)=A^{(0)}_{ijkl}(0+c)\).

Only the quasi-invariant associated with horizontal motion has been studied in this work since the oscillation amplitudes in the horizontal plane are larger than those in the vertical plane; therefore, dynamics in the horizontal phase space is more complex than in the vertical phase space.

### An analytical approximate representation for Poincaré sections through quasi-invariants

It is well known that the quadrupolar magnetic components (represented in general by \( b_2(s))\) contained in an accelerator affect the off-momentum particles (\( p_0 + \Delta p \)) differently from the reference particle with momentum \(p_0\). This changes the number of oscillations in the horizontal and vertical planes (tunes \(\nu _x\), \(\nu _y\)), deviating them from the original tunes \(\nu _{0x}\), \(\nu _{0y}\), in the following way

where \(\xi _{x,y}\), the horizontal and vertical chromaticities, are given by expression (20) taking \(b_3(s)=0\).

In a bunch, particles have energies that differ from the energy of design. Therefore, quadrupoles in the accelerator supply a focusing force to each particle that depends on its energy, originating a chromatic effect. Furthermore, any kind of field imperfections in the quadrupoles will cause the same effect on electrons traveling in their orbits (see Ref.^{38}).

Stability of the off-momentum particles requires that \(\xi _x\) and \(\xi _y\) be close to zero to keep tunes near to the operating point, while small positive values are required to avoid collective resonances. To satisfy these requirements, it is necessary to introduce magnetic sextupoles \(b_3(s)\) in the lattice. Sextupoles affect chromaticities in the form^{34,39,40,41,42}

The function \(\beta _y(s)\) plays a similar role for the vertical motion as \(\beta _x(s)\) does for the horizontal case, and *C* is the circumference of full storage ring. \(\eta (s)\) is known as dispersion function and it quantifies how much off-momentum particles closed orbit differs from on-momentum particles closed orbit.

## Application of the quasi-invariant technique to a third-generation synchrotron

Synchrotron light sources are classified into generations, based on the properties of the emitted light and the devices used to produce it. The complexity of beam dynamics increases with each generation, in such a way that new facilities demand better optimization techniques for a superior performance. In this work, a third-generation typical lattice is used to study some relevant aspects of our quasi-invariant method (see also^{23,24,25}), since our main objective is to present its advantages.

### Application of quasi-invariants to a toy model for the Mexican synchrotron

The storage ring model presented below was, at some point, considered a low-risk scheme for the Mexican project^{43}. It is based on the ALBA lattice^{44} and due to its emittance value, 1.3 nm\(\cdot \)rad, can be considered as a third-generation light source. Its linear optic functions are shown in Fig. 2 for one half super period. DBA-cells are shown at the bottom of the figure, where dipoles, quadrupoles, and sextupoles are depicted in blue, red, and green, respectively. The complete ring has 4 super periods; each super period consists of six DBA-cells: two matching cells at the ends and four-unit cells in the middle. In Fig. 1 the whole matching cell and half a unit cell are shown in more detail, depicting the magnetic fields of each magnet, following the magnets color code.

Once the dipole and quadrupole magnetic fields have been fixed, the storage ring optical functions and main parameters are determined; the latter are shown in Table 1. Natural chromaticities indicate that the sextupole intensities should not be very large, therefore, when performing chromaticity corrections, undesirable nonlinear phenomena should be minimal. We used this simple lattice to show the capability of the quasi-invariant formalism to inhibit the onset of resonances and to increase the dynamic aperture of synchrotrons.

### Manipulating the onset of low order resonances to increase the dynamic aperture

The mechanism to find the roots of the polynomial quasi-invariant was described in refs.^{23,26}, however, for the sake of completeness of this work, the methodology to find the points (\(x,p_x\)) that belong to a value of the quasi-invariant of Eq. (9), is outlined below. For \(p_x=0\), the magnitude of the initial oscillation amplitude \(x_0\), a numerical value of the quasi-invariant is obtained through the Courant-Snyder expression as \(I=x_0^2/\gamma _x\); in our case (\(\alpha _x=0\) since \(s_0=0\) is a point of symmetry in the lattice). The numerical value of *I* is kept for the non-linear case and then the topological deformation of the phase space is calculated. Then, scanning *x*, for each value of *x*, the 5 values of \(p_x\) (roots of the polynomial of degree 5) are found, which can be complex by pairs or real, using the root-finding function *roots* from \(\hbox {MATLAB}^{\circledR}\). In this way, a set of points \((x,p_{x1}),...,(x,p_{x5})\) is obtained for a specific value of the quasi-invariant *I*. By plotting these pairs (\(x, p_x\)) in phase space, a sequence of nearby points is obtained that visually appear to form (interpolating) a continuous curve. These sequences will form what we have called a branch.

When a pair of branches overlap, the overlapping zone contains complex roots, and the non-overlapping portions will form islands indicating the presence of resonances. If there is no such overlap the resonances will not appear, as described in Ref.^{26}. A similar procedure could be carried out by scanning \(p_x\) and finding the values of the *x* roots of the quasi-invariant polynomial.

Once the process of resonances onset has been identified, we are interested in avoiding resonance formation while increasing the oscillation amplitude. With this, the method can provide a mechanism to increase the dynamic aperture of the synchrotron under consideration. A protocol is required to handle the roots in a controlled manner as the nonlinear elements are changed by the numerical optimization of the objective function, Eq. (21).

One way to do this is to separate the real root branches that give rise to resonances while increasing the amplitude of the horizontal oscillation. This is largely achieved by requiring that the innermost branches, which in principle form the deformed ellipse, have the best resemblance to the ellipse that arises when nonlinear elements (sextupoles, octupoles, etc.) are not present in the calculus, i.e., linear dynamics. With this procedure, a nonlinear phase space is forced to resemble a linear one by finding near-integrable solutions in a bound area of small amplitudes.

### The proposal of an objective function

A simple way to define an objective function is to quantify the separation between the branches of real roots corresponding to the nonlinear problem {\(p_x^{nl}\}\) and the branches of real roots corresponding to the linear problem {\(p_x^{ l}\}\); that is, the upper and lower branches of an ellipse that are obtained for the reference particle, when only dipoles and quadrupoles are considered. If we consider *N* points on the *x* axis, the corresponding lower and upper roots are in abbreviated form, {\(p_x(x_i), i=1\cdot \cdot \cdot N\}\). Then, the 2*N* distances between the upper branches (*u*) and the lower branches (*d*) of the two systems, linear and nonlinear, are added to define the objective function \(f_{obj}\) as

Minimizing \(f_{obj}\), we will be looking for solutions of the nonlinear problem that are as close as possible to the linear problem. As mentioned before, the nonlinear phase space is intended to resemble that of the linear case for small amplitudes.

The definition of \(f_{obj}\) in Eq. (21) is done for the on-momentum reference particle, i.e, at \(\delta =0\), but it can be extended to include terms corresponding to off-momentum particles (\(\delta \ne 0\)).

The objective function defined in the expression (21) considers the sum of point-to-point distances between the linear and non-linear trajectories in phase space. Since these distances depend on the nonlinear functions \(A^{0}(s)\), the terms that most deform the phase space will be penalized the most. Being the only function that is intended to be optimized, the inclusion of weights in the problem is not necessary. We consider this to be a strength of the algorithm and the use of the objective function of Eq. (21).

### Initial stage

Defining \(S=b_3/3\), the free parameters to optimize are

while the sextupoles

are adjusted at each change made to \(\{S\}_{free}\), by the optimization algorithm, in order to keep the chromaticities close to zero, \(\xi _{x,y} \sim 0\).

Let us write the union of the above sets simply as

The initial set \(S_0\) comes from the first attempts to confirm that the quasi-invariant method gave reliable results and compatible with particle tracking simulation. It was used in Ref.^{26} and has the following numerical values

Figure 3 represents the horizontal phase corresponding to the initial set \(\{S_0\}\), showing the resonances arising at an oscillation amplitude of \(x_0=1.53\) mm.

The location of these sextupoles in the unit cell of the synchrotron toy model considered here can be seen in Fig. 2, in green.

The initial \(\{S_0\}\) free values can in general be selected as a set of small, arbitrary sextupole intensities, and the \(x_0\) initially must be small enough to contain a stable zone. By increasing \(x_0\), the optimization yields new sets of sextupoles with larger stable zones.

### Second stage: sextupoles optimization

The optimization process was started with a small \(x_0\) since the non-linear effects produced by the sextupoles are small. Within the optimization process, as \(x_0\) grows, the algorithm seeks the trajectories in phase space to be stable. In this stage, starting from the set of sextupoles \(\{S_0\}\), the search for a set of sextupoles that increases the previous dynamic aperture begins; here the oscillation amplitude is taken to be \(x_0=7\) mm. This is done using genetic algorithms^{45} trying to minimize the objective function \(f_{obj}\). Other methods, such as simplex of the \(\hbox {MATLAB}^{\circledR}\) function *fminsearch* and simulated annealing, could also be useful. This process is shown in Fig. 4, where the vertical axis is the relative value of \(f_{obj}\) with respect to its initial value \(f^{initial}_{obj}\). It is convenient to note that in the optimization process of the sextupoles, the interval of values of the objective function is (0.9859, 66.432). However, only the range of interest (\(f_{obj}/{f^{initial}_{obj}}) < 1\),where the objective function decreases, is shown in Fig. 4. The apparently small improvement is due to the fact that the initial \(\{S_0\}\) was a set of sextupoles that already gave a small value of the objective function. The horizontal axis is the cumulative CPU time (in sec) of the genetic algorithm on a Pentium7 PC. The number of populations involved in the calculation was 14, and the process converged in around 1000 generations (Fig. 4).

As has been studied in detail in reference^{26}, the resonances that appear in Fig. 3 arise when two branches of real solutions, from the quasi-invariant (Eq. (9)) proposed for the nonlinear case, overlap becoming complex solutions. The non-overlapping regions form the islands of the resonances. When the optimization process starts, in search of new sextupoles that allow increasing the dynamic aperture, the mentioned branches of real solutions are affected due to the numerical change of \(\{S\}\) values. Minimization of function \(f_{obj}\) (Eq. (21)) requires that the inner branch of real solutions be close to the corresponding solution of the linear problem (ellipse). This behavior occurs when the dynamics of the nonlinear problem allows an increase of dynamic aperture; otherwise, the roots overlap, generating resonances that limit stability.

Figure 5 shows the behavior of these two branches of real solutions (in red), as the values of *S* change. The external branch, contained mainly in the green rectangle, has a more erratic behavior than the internal branch and, in general, the external branch separates from the internal one under the optimization process. It is expected that the farther away a polynomial solution is from the origin of the phase space, \(p_x\) will have a higher degree of uncertainty. Particle tracking simulation will show the agreement when comparing the results obtained with the proposed method with simulation, even for large oscillation amplitudes, as shown later. The linear-problem ellipse is used as a goal of the optimization method. It can be seen that the inner branch of real solutions tends to approach the blue curve that represents the trajectory corresponding to the Courant-Snyder invariant for the linear problem^{27}. The latter can be appreciated in greater detail in Fig. 6 where a band of real solutions in red can be seen next to the blue ellipse. At the end of the optimization process, the real nonlinear solution, which is closest to the linear solution, is the one with a minimum value of \(f_{obj}\). This will become clearer in the next stage of optimization.

The above procedure allows to find the value of new sextupoles \(\{S_1\}\) that minimize \(f_{obj}\) as shown in Fig. 4. The new \(\{S\}\) values are:

where the order of \(\{S_1\}\) values is the same as that used in Eq. (24). As before, for each free parameter choice \(\{S_1\}_{free}\), two chromatic sextupoles \(\{S_1\}_{chrom}\) that allow keeping the chromaticities close to zero are determined. The following section addresses the implications of a new set of sextupoles \(\{S_1\}\) in the nonlinear dynamics described in phase space (\(x,p_x\)). When this set of sextupoles is used, the phase space of Fig. 7 shows that the region of stability grows from \(\sim 2\) mm to \(\sim 6-7\) mm, since low order resonances onset have been inhibited in that region.

### Third stage: Further optimization of sextupoles

Now, we are exploring the possibility of continuing to grow the stability zone with a new optimization of sextupoles. This stage is carried out at a higher oscillation amplitude, \(x_0=10\) mm, taking \(\{S_1\}\) as the initial set of sextupoles for this stage of the optimization process, under the same guidelines as the previous optimization at \( x_0=7\) mm.

The inner and outer branches of real solutions that give a smaller value of the objective function \(f_{obj}\) are shown in black in Fig. 8. They represent the final result of the optimization for the invariant corresponding to \(x_0=10\) mm. Two of the branches of real solutions (inner branches) are close to the Courant-Snyder invariant represented by the blue ellipse. The other two branches (outer branches) are now far from the inner ones, meaning that, the possibility to generate low order resonances, by overlapping, has been diminished by the optimization process, increasing in this way the stability zone due to a better selection of sextupoles set. We see that the internal black branches resemble an ellipse, as requested in Eq. (21) of \(f_{obj}\). The detail of this behavior is clearer in Fig. 9, where a bundle of intermediate solutions of the nonlinear problem in the optimization process is shown in red. The black solution is the best approximation to the linear solution in blue. The set \(\{S_2\}\) of sextupoles obtained at the end of this stage is

Again, for comparison, the gray curves shown in Fig. 9 are the ones shown in Fig. 7 for the optimization \(\{S_1\}\).

The next point of interest to investigate is the increase in dynamic aperture achieved with the \(\{S_2\}\) optimization. For this, different values of oscillation amplitude \(x_0\) are used that produce the trajectories shown in Fig. 10. We notice that closed trajectories start to break up at around 17 mm, although results coming from the quasi-invariant have been found to overestimate the dynamic aperture compared to that obtained by tracking simulation^{26}.

### Comparison of dynamic apertures from quasi-invariant techniques with those from particle tracking simulations

How the theoretical results obtained with quasi-invariants compare with those of particle tracking simulation given by OPA? Using the set of sextupoles \(\{S_2\}\) in OPA, the good agreement between both schemes is noteworthy. This is shown in Fig. 11, which represents the phase space (\(x,p_x\)) for on-momentum particles (\(\delta =0\)). In blue, several trajectories calculated with OPA, using different amplitudes, are shown. No low-order resonances are observed, which are a major problem in synchrotron light sources. The dynamic aperture shown in Fig. 11, of the order of 15 mm, confirms that the method of quasi-invariants gives a good prediction of the dynamic aperture. To make this agreement noticeable, the curves in Fig. 10 are superimposed in faint red.

### Optimization over on-momentum particles permeates to off-momentum particles

Interestingly, although this work does not incorporate the formalism related to off-momentum particles \((\delta \ne 0)\), we see that the corresponding phase space, in this case provided by particle tracking simulation with OPA, also seems to follow the inertia of a linear dynamic, to which on-momentum particles have been forced with a small value of the objective function \(f_{obj}\). That is, there is a certain degree of transmissibility of the stability of the considered phase space, when going from \(\delta =0\) to \(\delta \ne 0\). This process is observed in the following six figures (Figs. 12, 13, 14, 15, 16, 17), calculated with the set of sextupoles \(\{S_2\}\), for a momentum deviation \(\delta = -3,- 2,-1,1,2\) and \(3 \%\). This is surprising because no optimization was done involving momentum deviation \(\delta \ne 0\).

The origin shift in Figs. 12, 13, 14, 15, 16, 17 is consistent with the displacement of the off-momentum closed orbit given by \(\eta \delta \) for a value of \(\eta =0.2039\) m, which is the dispersion value in the straight sections for our toy model synchrotron.

### Limit on the oscillation amplitude for the optimization of the quasi-invariant

In previous sections phase space area results have been obtained by optimizations using the quasi-invariant defined in Eq. (9), carried out at amplitude values \(x_0=7\) and 10 mm. What is being explored now is the possibility of further increasing the value of \(x_0\). A new optimization is performed at \(x_0=12\) mm and it is shown that the increase in dynamic aperture is insignificant, indicating that the non-linear dynamics of the considered synchrotron does not allow a greater increase in dynamic aperture, and/or the description of the quasi-invariant is less exact (the degree of the polynomial considered is not large enough) as the amplitudes \(x_0\) increase. In Fig. 18 this process is shown. Optimization at 10 mm of Fig. 11 is shown in faint blue, while a new calculation (dark blue, superimposed) is obtained by the optimization process using an amplitude of 12 mm. Figure 11 was obtained with the set of sextupoles \(\{S_2\}\), while this dark blue figure is made with the new set of sextupoles \(\{S_3\}\), shown in Eq. (28), both, for on-momentum particles (\(\delta =0\)). Comparing both results, it is observed that the outer high order islands chain (faint blue) is inhibited. New KAM tori appear, marginally expanding the stable area of the phase space. It is interesting to note that the new selection \(\{S_3\}\) differs less than \(<2\%\) from \(\{S_2\}\) which represents a fine adjustment of sextupole intensities. The effect is significantly smaller than that obtained going from 7 to 10 mm. This suggests that the optimization limit is being reached.

For a synchrotron represented in one dimension, the results obtained are a clear indication of the robustness of the quasi-invariant concept and its use in increasing synchrotron dynamic aperture, requesting the topologies of the phase space of a nonlinear and a linear system to be similar in a bounded area of small oscillation amplitudes. The mathematical formalism of this idea can be extended to higher dimensions to achieve low emittance designs.

Although not analyzed in this paper, it is also noteworthy that studies using quasi-invariants report a large amplitude-dependent tune spread^{20}. Therefore, it is expected that with our technique, resonance lines, probably of higher orders, can be crossed without noticeable effects due to their narrow stop bandwidths.

## Concluding remarks

This work has been motivated by the increasing requirements in optimizing the magnetic lattices of synchrotron light sources to meet the growing needs of users of synchrotron radiation, such as increased brightness and coherence. Methods developed by other authors have been essential to deal with the nonlinear problem, some of them involve a large capacity of computational resources. In this work, it is shown that the scheme based on a polynomial quasi-invariant is a dynamic aperture optimization technique complementary to methods using resonant terms or many turns particle tracking simulation^{9}. The precision achieved with the quasi-invariants is sufficient to accomplish a dynamic aperture compatible with numerical tracking results. With these ideas, we introduce and explore one more mechanism useful to find solutions that allows advancing in the understanding of dynamic processes in synchrotrons. The proposed algorithm requires the construction of a quasi-invariant of motion whose use is valid in a restricted phase space area including its origin, where the electron beam should be stable. A quasi-invariant mechanism, and an objective function that allows manipulating the onset of resonances and, thereby, increasing the dynamic aperture of a particular synchrotron design, were studied. In the stability region, the resemblance between a non-linear system phase space topology and the one of the linear system, seems to be a key to achieve good results in increasing the dynamic aperture. The results obtained were validated by comparison with particle tracking simulations, using available software in the field of accelerator physics. The numerical results indicate that the proposed method can be used as a suitable scheme to increase the dynamic aperture in the one-dimension studied model. The methodology can be easily extended to two dimensions by building a second quasi-invariant, allowing to increase the dynamic aperture of the two-dimensional nonlinear problem, a phenomenon that is quite restrictive in fourth generation light sources. Work is ongoing in this direction.

## Data availability

The data generated or analyzed during the current study are available from the corresponding author on reasonable request.

## References

Einfeld, D., Schaper, J. & Plesko, M. A lattice design to reach the theoretical minimum emittance for a storage ring. in

*Proceedings of the EPAC***96**, 638 (1996).Mobilio, S., Boscherini, F. & Meneghini, E. C. Synchrotron Radiation: Basics. Methods and Applications. Springer, New York. https://doi.org/10.1007/978-3-642-55315-8 (2015).

Sajaev, M. B. V., Emery, L. & Xiao, A. Multi-objective direct optimization of dynamic acceptance and lifetime for potential upgrades of the advanced photon source.

*ANL/APS/*vol. LS-319 (2010).Bengtsson, J. The sextupole scheme for the swiss light source (sls): An analytical approach. https://ados.web.psi.ch/slsnotes/sls0997.pdf (1997).

Soutome, K. & Tanaka, H. Higher-order formulas of amplitude-dependent tune shift caused by a sextupole magnetic field distribution.

*Phys. Rev. Accel. Beams***20**, 064001 (2017).Brown, K. L., Belbeoch, R., & Bounin, P. First- and second- order magnetic optics matrix equations for the midplane of uniform- field wedge magnets.

*Rev. Sci. Instrum.***35**, 481 https://doi.org/10.1063/1.171885.Douglas, D. R. & Dragt, A. J. Lie algebraic methods for particle tracking calculations.

*Proc. 12th Int. Conf. High-Energy Accel.***32**, 139 (1983).Papaphilippou, Y. Detecting chaos in particle accelerators through the frequency map analysis method.

*Chaos: Interdiscipl. J. Nonlinear Sci.***24**(2), 024412. https://doi.org/10.1063/1.4884495 (2014).Borland, M. Elegant: A flexible sdds-compliant code for accelerator simulation.

*Adv. Photon Sourc.*vol. LS-**287**, (2000).Gao, W., Wang, L. & Li, W. Simultaneous optimization of beam emittance and dynamic aperture for electron storage ring using genetic algorithm.

*Phys. Rev. ST Accel. Beams***14**, 094001 (2011).Kranjčević, M., Riemann, B., Adelmann, A. & Streun, A. Multiobjective optimization of the dynamic aperture using surrogate models based on artificial neural networks.

*Phys. Rev. Accel. Beams***24**, 014601. https://doi.org/10.1103/PhysRevAccelBeams.24.014601 (2021).Sun, Y. & Borland, M. Comparison of nonlinear dynamics optimization methods for aps-u. in

*Proceedings of 2nd North American Particle Accelerator Conference*, p. WEPOB15 (2016).Li, Y. & Yu, L.-H. Using square matrix to realize phase space manipulation and dynamic aperture optimization. in

*Proceedings of 2nd North American Particle Accelerator Conference*, p. TUPOB54, (2016).Yang, L., Li, Y., Guo, W. & Krinsky, S. Multiobjective optimization of dynamic aperture.

*Phys. Rev. Spec. Top. Accel. Beams***14**, 054001 (2011).Antipov, S.

*et al.*Iota (integrable optics test accelerator): facility and experimental beam physics program.*J. Instrum.***12**, T03002. https://doi.org/10.1088/1748-0221/12/03/t03002 (2017).Danilov, V. & Nagaitsev, S. Nonlinear accelerator lattices with one and two analytic invariants.

*Phys. Rev. Spec. Top. Accel Beams***13**, 084002 (2010).Antipov, S., Nagaitsev, S. & Valishev, A. Single-particle dynamics in a nonlinear accelerator lattice: attaining a large tune spread with octupoles in iota.

*JINST***12**, P04008 (2017).Webb, S., Cook, N. & Eldred, J. Averaged invariants in storage rings with synchrotron motion.

*J. Instrum.***15**, 12032. https://doi.org/10.1088/1748-0221/15/12/p12032 (2020).Warnock, R. L., Berg, J. S. & Forest, E. Fast symplectic mapping and quasi-invariants for the large hadron collider.

*Proc. Particle Accel. Conf.***5**, 2804–2806. https://doi.org/10.1109/PAC.1995.505699 (1995).Li, Y.

*et al.*Design of double-bend and multibend achromat lattices with large dynamic aperture and approximate invariants.*Phys. Rev. Accel. Beams***24**, (2021).Gabella, W. E., Ruth, R. D. & Warnock, R. L. Iterative determination of invariant tori for a time-periodic hamiltonian with two degrees of freedom.

*Phys. Rev. A***46**(6), 3493 (1992).Li, Y., Cheng, W., Yu, L. H. & Rainer, R. Genetic algorithm enhanced by machine learning in dynamic aperture optimization.

*Phys. Rev. Accel. Beams***21**, (2018).Antillón, A. Emittance for a nonlinear machine: the one-dimensional problem.

*Part. Accel.***23**, 187–195 (1988).Antillón, A., Forest, E., Hoeneisen, B. & Leyvraz, F. Transport matrices for nonlinear lattice functions.

*Nucl. Instrum. Methods Phys. Res., Sect. A***305**(2), 247–256. https://doi.org/10.1016/0168-9002(91)90544-Z (1991).Antillón, A. & Hoeneisen, B. Emittance of a nonlinear machine: the two-dimensional problem.

*Nucl. Instrum. Methods Phys. Res., Sect. A***305**(2), 239–246. https://doi.org/10.1016/0168-9002(91)90543-Y (1991).Sánchez, E. A., Flores, A., Hernández-Cobos, J., Moreno, M. & Antillón, A. Onset of resonances by roots overlapping using quasi-invariants in nonlinear accelerator dynamics.

*Nonlinear Dyn.*Accepted (2022).Courant, E. & Snyder, H. Theory of the alternating-gradient synchrotron.

*Ann. Phys.***3**(1), 1–48. https://doi.org/10.1016/0003-4916(58)90012-5 (1958).Dimper, R., Reichert, H., Raimondi, P., Ortiz, L.S., Sette, F. & Susini, J. ESRF upgrade programme phase II (2015 - 2022). https://www.esrf.fr/Apache_files/Upgrade/ESRF-orange-book.pdf (2014).

Aiba, M.

*et al.*SLS-2 Conceptual Design Report.*PSI-Bericht 17-03, Editor: Andreas Streun*(2017).Herr, W. & Forest, E. Non-linear dynamics in accelerators. in

*Particle Physics Reference Library : Volume***3***: Accelerators and Colliders*(S. Myers and H. Schopper, eds.), pp. 51–104, Springer International Publishing, 2020. https://doi.org/10.1007/978-3-030-34245-6_3.Suzuki, T. Hamiltonian formulation for synchrotron oscillations and Sacherer’s integral equation.

*Particle Accel.***12**, 237–246 (1982). http://cds.cern.ch/record/139498/files/p237.pdf.Stupakov, G. Lecture notes on classical mechanics and electromagnetism in accelerator physics. https://jseldredphysics.files.wordpress.com/2018/03/stupakov-notes-2011.pdf (2011).

Bengtsson, J. & Streun, A. Robust design strategy for sls-2. https://wiki.classe.cornell.edu/pub/CBB/RDTProject/SLS2-BJ84-001.pdf (2017).

Streun, A. Experimental methods of particle physics particle accelerators. https://ipnp.cz/~dolezal/teach/accel/talks/empp.pdf.

Cai, Y. Singularity and stability in a periodic system of particle accelerators. https://www.slac.stanford.edu/pubs/slacpubs/17250/slac-pub-17251.pdf (2018).

Fjellström, M. Particle tracking in circular accelerators using the exact hamiltonian in sixtrack.

*CERN-THESIS-2013-248*(2013). https://inspirehep.net/files/74c88492a8d6a790563d145198c4813d.wxMaxima, https://wxmaxima.sourceforge.net/,

*wxMaxima, Version 22.03.0*, (2022).Sands, M. Physics of electron storage rings: An introduction. Tech. rep., Stanford Linear Accelerator Center, CA (1970).

Ohnuma, S. Effects of correction sextupoles in synchrotrons.

*AIP Conf. Proc.***123**, 415–423. https://doi.org/10.1063/1.34886 (1984).Cornacchia, M. Lattices for synchrotron radiation sources.

*SLAC-PUB-6459*, p. 16 (1994).Levichev, E. B. Low emittance electron storage rings.

*Phys. Usp.***61**, 29. https://doi.org/10.3367/ufne.2016.12.038014 (2018).Steinhagen, R. J. Tune and chromaticity diagnostics.

*CERN*p. 324 (2009). https://cds.cern.ch/record/1213281/files/p317.pdf.Antillón, A.,

*et al.*, Laboratorio nacional de aceleradores y luz sincrotrón: Fase de diseňo y prototipos. https://www.fisica.unam.mx/sincrotron/fomix/PDFs/Vol1.pdf (2015).Muňoz, M., & Einfeld, D. Optics for the alba light source.

*Proc. PAC 2005, Knoxville, Tennessee*pp. 3777–3779 (2005).Yang, X.-S. Nature-inspired optimization algorithms. Academic Press, Cambridge (2020).

## Acknowledgements

This work was supported by UNAM-PAPIIT IN108522 and CONACYT CF-2023-I-119. E.A.S. is grateful to CONACYT for funding a postdoctoral fellowship.

## Author information

### Authors and Affiliations

### Contributions

E.A.S., A.F., J.H-C., M.M and A.A. conceptualized this research, analyzed, and interpreted the results, wrote computer codes, prepared figures and wrote and revised the manuscript.

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Additional information

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Sánchez, E.A., Flores, A., Hernández-Cobos, J. *et al.* Increasing beam stability zone in synchrotron light sources using polynomial quasi-invariants.
*Sci Rep* **13**, 1335 (2023). https://doi.org/10.1038/s41598-023-27732-y

Received:

Accepted:

Published:

DOI: https://doi.org/10.1038/s41598-023-27732-y

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.