Proceedings of the 20th Annual Meeting of Particle Accelerator Society of Japan
August 29 - September 1, 2023, Funabashi

PASJ2023 TUP50

LINEAR OPTICS CORRECTION OF STORAGE RING WITH
CLOSED ORBIT DATA BASED ON MACHINE LEARNING
E. Salehi†, M. Katoh1, UVSOR, Institute for Molecular Science, Okazaki, Japan1
also at HSRC, Hiroshima University, Higashi-Hiroshima, Japan
Abstract
The LOCO algorithm based on orbit response matrix(ORM), which is the change in orbit at beam position monitors (BPMs) with changes in steering magnets, has been
widely used for linear optics correction in storage rings. It
computes the orbit response matrix and fits it to the experiment data linearly as making quadrupole strengths andothers as free parameters. In order to solve the difficulty on
convergence of ORM method when the change of focusing
optics or the effect of nonlinear optics on the closed orbit
is large, we propose a method based on machine learning.
The closed orbit of the design lattice produced by eachsteering magnet at BPMs is calculated using ELEGANT
simulation code which fully includes non-linear components and is fitted to the measured closed orbit data in theexperiment. This method can nonlinearly compute the correction parameters of the lattice by minimizing the discrepancies between measured and predicted closed orbits. We
have applied this method to the lattice of UVSOR_III.

INTRODUCTION
In order to have a successful operation of particle accelerators, the study of linear optics to understand and remove
or compensate the source of the optics perturbations is required. Linear optics from closed orbit (LOCO) method,which based on the orbit transform matrix (ORM) is a powerful method to fit the measured data to a lattice model todetermine the quadrupole errors in the machine [1-3]. The
orbit response matrix consists of orbit deviations at beam
position monitor (BPM) locations when the orbit correctors
are changed, one at a time. Each column of the orbit response matrix corresponds to the response of one corrector.
One limitation of the LOCO method is its sensitivity to
the linear dependency on quadrupole strength, rendering it
unsuitable for machines with strong nonlinear parameters.
This new method is similar to LOCO in that it alsomeasures closed orbits, may be referred to as nonlinear optics from closed orbit (nLOCO). In the case of fast calculation, we use a machine learning method based on Bayesian optimization method to obtain the fitted model parameters to the measurements quickly.
In this study, we introduce an innovative approach forlinear optics correction, incorporating nonlinear components through the computation of closed orbit shifts using
a particle tracking simulation code. We refer to this novel
method as "nonlinear optics from closed orbit" (nLOCO),
and it shares similarities with LOCO in its focus on closed
orbit measurements. To speed up the parameter fitting pro-cess, we use a machine learning technique based on Bayesian optimization. This allows us to obtain fitting parameters in situations requiring rapid calculations.
In this paper, we will describe the nLOCO method in
more detail in section III. In Sec. IV, simulation results areshown for UVSOR_III. The conclusion is given in Sec. IV.

THE LOCO METHOD
The closed orbit correction can be calculated by theLOCO method which originally relies on orbit responsematrix method (ORM). ORM is based on the linear orbit
response equation for a small change of j-th dipole kick angle 𝜃𝜃𝑗𝑗 [4]:𝑥𝑥𝑖𝑖 = 𝑀𝑀𝑖𝑖𝑖𝑖 𝜃𝜃𝑗𝑗
where 𝑥𝑥𝑖𝑖 is the measured position at monitor 𝑖𝑖, 𝑀𝑀𝑖𝑖𝑖𝑖 is theelement in the response matrix. Therefore, the ORM matrix
can be both measured and calculated theoretically if the linear optics is known. Therefore, it is an appropriate way tojudge the agreement between the design and real machineis described by a merit function [5],2𝑀𝑀𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 − 𝑀𝑀𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚
�𝜒𝜒 2 (𝑝𝑝) = � �𝜎𝜎𝑖𝑖𝑖𝑖 𝑗𝑗

where 𝜎𝜎𝑖𝑖 is the measured noise level on the ith BPM. Thegoal is minimization of 𝜒𝜒 2 which is the difference between
measured and model response matrix. The minimization
process can be achieved by varying some model parameters based on singular value decomposition (SVD) algorithm.
However, the convergence of fitting is very much limited within linear dependence of 𝜒𝜒 2 on quadrupole
strengths, orbit kickers, and BPM gain. The assumption ofthis linearity is usually invalid in real cases. Therefore, one
should iterate the fitting algorithm. To include the nonlinearity, we propose a new method in the next section.

THE NLOCO METHOD
Modeling
The closed orbit shift can be measured experimentallyand calculated theoretically at each BPM when one orbit
corrector is changed to give an angular kick to the beam.
In order to make a judge between measured closed orbit
and model one, we introduce a function which is the difference between the measurement and the model closed orbit,___________________________________________† elham@ims.ac.jp- 438 -2

Δ𝐶𝐶 2 = � ��Δ𝑥𝑥𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 − Δ𝑥𝑥𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 �𝑖𝑖 𝑗𝑗

2+ �Δ𝑦𝑦𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 − Δ𝑦𝑦𝑖𝑖𝑖𝑖𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 � �Proceedings of the 20th Annual Meeting of Particle Accelerator Society of Japan
August 29 - September 1, 2023, Funabashi

PASJ2023 TUP50

where Δ𝑥𝑥𝑖𝑖𝑖𝑖 and Δ𝑦𝑦𝑖𝑖𝑖𝑖 are horizontal and vertical closed orbit shift at ith BPM for an angular kick of jth steering magnet, respectively.
In this method, the closed orbit of the model is calculated
by using a single particle simulation code such as ELEGANT [6] which can consider not only nonlinear components on the electron beam, but also correct the betatrontune for each fitting parameters set. Dispersion functions isincluded as fitting data; Δ𝐸𝐸/𝐸𝐸 , as is done for the LOCO
method. The electron energy shifts proportional to the dispersion at the steering magnet when a horizontal steering
magnet strength is changed.
Δ𝐸𝐸𝑗𝑗 𝜃𝜃𝑥𝑥𝑥𝑥 𝜂𝜂𝑥𝑥𝑥𝑥=𝐸𝐸
𝛼𝛼𝐶𝐶 𝐿𝐿0where 𝜂𝜂𝑥𝑥𝑥𝑥 is the horizontal dispersion at the steering magnet, 𝛼𝛼𝐶𝐶 is the momentum compaction, and 𝐿𝐿0 is the storage
ring circumference defined by RF frequency.
In order to fit the model closed orbit to the measurement,
the minimization of the function Δ𝐶𝐶 2 is required. The minimization can be achieved by surveying the model parameters such as strength of quadrupoles, BPM gains and steering magnet calibrations. In general, the minimization process by surveying each parameter while using a particle
tracking simulation code is computationally expensive interms of CPU time (time consuming).

take a long time to evaluate, there are some global optimization algorithms which can approach the global optima inbetter performance on time limited and noisy measurements. Recently Bayesian optimization method has been
attracted in accelerator community [10, 11].
Bayesian optimization is a framework to optimize acostly function which may perform a large number of evaluations. It consists of two elements; a surrogate model
which is a mathematical model to approximate the real objective function and an acquisition function which describes the strategy to determine the next points in input
space to measure. The surrogate model is usually generated
through Gaussian process regression that returns a probability distribution of possible functions compatible withprevious evaluations and is much faster and/or cheaper toevaluate. The model can predict the most probable value ofobjective function at an unexplored location and provides
an uncertainty for this prediction. Then the model predictions and their uncertainties are combined into an acquisition function to determine the next parameters to sample.
After the evaluation, the model is refined with the newly
gathered information. This process is repeated iterativelyto find the optimum parameters that optimize the objectivefunction.

Bayesian Optimization Method

The lattice of UVSOR_III [12, 13] is formed by 8 identical dipoles, 32 quadrupoles grouped in 4 families and 5sextupoles families. The ring has 8 straight sections and sixof them are occupied with undulators of various kinds issignificant at the beam energy 750 MeV. Beam diagnostics
used for lattice corrections consists of 24 BPMs.
The nLOCO has been applied on the lattice design andbeam diagnosis to discover quadrupole gradients ofUVSOR_III storage ring. The fitting parameters forUVSOR_III are 40 quadrupole strengths, 48 horizontal andvertical BPM gains (2 × 24), and 35 steering magnets calibration. There is a total of 123 fitting parameters. The moststraight forward way to fit the parameters is completely
surveying the fitting parameters. If we examine at least 5
values for each parameter, the number of running the simulation code will be around 5123, which is very expensive
in CPU time. To decrease the number of running simulation code, we used Bayesian optimization method through
GPyOPT algorithm [14] to have better performance ontime. This algorithm can calculate the optimum fitting parameters by modelling the data points with Gaussian process regression and using acquisition functions to filter out
the maximum information about the location of the minimum of function Δ𝐶𝐶 2 . Therefore, it can approach to optimum fitted parameters in small number of iterations asshown in Fig. 1. In this calculation, Δ𝐶𝐶 2 , the difference between evaluated closed orbit by ELEGANT and measurement one, is objective function for each trial solution. For
the acquisition function which is defined as the target for
selecting next trial solution, we chose the lower confidencebound (LCB) with GP model as a prior function. Figure 1(up) represents the distance between consecutive’s evalua-To optimize a black-box function there are a large variety of optimization algorithms in use [7-9]. For the functions which are noiseless and do not require significant
time, local optimization methods can be used with verystrong performance. While for expensive functions which

Figure 1: Convergence plots of bayesian optimization
method.

APPLICATION- 439 -Proceedings of the 20th Annual Meeting of Particle Accelerator Society of Japan
August 29 - September 1, 2023, Funabashi

PASJ2023 TUP50

tions in terms of the number of times has evaluated the objective function Δ𝐶𝐶 2 . Figure 1 (botom) shows that Bayesianoptimization method can approach the fitted parameters after 500 iterations (it takes around 7 hours). While the surveying method to find the fitted parameters needs at least
5132 of running simulation code which requires some processor days to complete.

CONCLUSION
We propose a new method to measure the linear optics
and coupling of a storage ring with BPM data. This methodcalled nLOCO is an effective and robust solution to nonlinear fitting problems with hundreds of variable fitting parameters. In this method, a particle tracking simulations
code has been used to include the nonlinear components.
To have better performance on time, we used Bayesian optimization method to minimize the difference between themeasurements and the model closed orbit fast. BPM gains
and calibration of the correctors are included in the fitting.
A simulation was done with the UVSOR_III storage ringlattice to find out the gradient of each quadrupole strengtherror, correct the beta function and dispersion. It can also
obtain the calibrations of BPM and corrector.

ACKNOWLEDGEMENTS
Figure 2: beta function before (green and yellow) and after(blue and red) correction with nLOCO.

The authors thank Prof. S. Kera, the facility director, for
his support and other facility staffs for their cooperation.

REFERENCES[1] J. Safranek, Nucl. Instrum. Methods Phys. Res., Sect. A, 388,
27 (1997).
[2] J. Safranek, Beam-based lattice diagnostics, Proceedings ofthe Joint US-CERN-JAPAN-RUSSIA School on Particle Accelerators, Beam Measurement (E.Perevedentsev Si.Kurokawa, S.Y.Lee and S.Turner, eds.), World Scientific, 1998.
[3] X. Huang, J. Safranek, and G. Portmann, ICFA Newsletter
44, 60 (2007).
[4] D. J. Adams, K. Tilley and C. M. Warsop, in Proc. 1999
Particle Accelerator Conf. (Cat.No.99CH36366), NewYork, NY, USA, 1999, pp. 2199-2201 vol. 3.

Figure 3: Comparison of measured (green star) and model
dispersion function before correction (red), after correction(blue).
Figure 2 compares the designed betateron function for
before and after applying nLOCO. Figure 3 shows the dispersion function measurement compared with the model
before and after fit by nLOCO. Clearly the measured dispersion function differs significantly from the designed one.
After correction by nLOCO method, the model is fitted tothe measurements. The initial Δ𝐶𝐶 2 which is 1.2 × 10-5, isreduced to 8.19× 10-6, after 400 run iteration numbers. The
gradient of each quadrupole magnet has been shown inFig. 4.

doi:10.1109/PAC.1999.794419[5] J. Safranek, 44th ICFA newsletter, Dec 2007, p. 44.
[6] M. Borland, APS LS-287 , 2000. doi : 10. 2172/ 761286[7] J. A. Nelder and R. Mead, The computer journal 7, 1965, pp.
308. doi : 10. 1093/ c omj nl / 7. 4. 308[8] K. Tian, J. Safranek, and Y. Yan, Phys. Rev. ST Accel.
Beams 17, 020703 (2014).
doi : 10. 1103/ Phys Re vSTAB. 17. 020703[9] X. Huang and J. Safranek, Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 757, 2014, pp.
48. doi : 10. 1016/ j . ni ma . 2014. 04. 078[10] J. Kirschner, M. Mutný, N. Hiller, R. Ischebeck, and A.
Krause, in Proc. Int. Conf. on MachineLearning, vol. 97, pp.
3429-3438. 2019.
ht t ps : / / a r xi v. or g/ a bs / 1902. 03229v2[11] J. Duris, D. Kennedy, A. Hanuka, J. Shtalenkova, A. Edelen,
P. Baxevanis, A. Egger, T. Cope, M. McIntire, S. Ermon, andD. Ratner, Physical review letters 124, 2020, pp. 124801.
doi : 10. 1103/ Phys Re vLe t t . 124. 124801[12] M. Katoh, M. Hosaka, A. Mochihashi, et al., AIP Conf. Proc.
705, 2004, pp. 49.
[13] M. Adachi, H. Zen, T. Konomi, J. Yamazaki, K. Hayashi,
M. Katoh, J. Phys. Conf. Ser. 425, 2013, pp. 042013.

Figure 4: Quadrupole strengths designed (red) after
nLOCO (blue).

[14] GPyOpt, ht t ps : / / s he f f i e l dml . gi t hub. i o/ GPyOpt /- 440 -