# Kernel Density Estimators for Axisymmetric Particle Beams

^{*}

## Abstract

**:**

## 1. Introduction

## 2. A Motivating Problem

## 3. The Radial Density

## 4. Density in Phase Space

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Appendix A. Calculation of the Phase Space Kernel

## References

- Hockney, R.W.; Eastwood, J.W. Computer Simulation Using Particles; CRC Press: Boca Raton, FL, USA, 2021. [Google Scholar]
- Reiche, S. GENESIS 1.3: A Fully 3D Time-Dependent FEL Simulation Code. Nucl. Instrum. Methods Phys. Res. Sect. Accel. Spectrometers Detect. Assoc. Equip.
**1999**, 429, 243–248. [Google Scholar] [CrossRef] - Tran, T.M.; Wurtele, J.S. TDA—A Three-Dimensional Axisymmetric Code for Free-Electron-Laser (FEL) Simulation. Comput. Phys. Commun.
**1989**, 54, 263–272. [Google Scholar] [CrossRef] - Edelen, A.L.; Biedron, S.G.; Milton, S.V.; Edelen, J.P. First Steps toward Incorporating Image Based Diagnostics into Particle Accelerator Control Systems Using Convolutional Neural Networks. arXiv
**2016**, arXiv:physics/1612.05662. [Google Scholar] [CrossRef] - Lagaris, I.E.; Likas, A.; Fotiadis, D.I. Artificial Neural Networks for Solving Ordinary and Partial Differential Equations. Comput. Phys.
**1997**, 9, 987–1000. [Google Scholar] [CrossRef] - Raissi, M.; Perdikaris, P.; Karniadakis, G. Physics-Informed Neural Networks: A Deep Learning Framework for Solving Forward and Inverse Problems Involving Nonlinear Partial Differential Equations. J. Comput. Phys.
**2019**, 378, 686–707. [Google Scholar] [CrossRef] - Cuomo, S.; Di Cola, V.S.; Giampaolo, F.; Rozza, G.; Raissi, M.; Piccialli, F. Scientific Machine Learning Through Physics-Informed Neural Networks: Where We Are and What’s Next. J. Sci. Comput.
**2022**, 92, 88. [Google Scholar] [CrossRef] - Reiser, M. Theory and Design of Charged Particle Beams, 2nd ed.; Updated and Expanded; Wiley-VCH: Weinheim, Germany, 2008. [Google Scholar]
- Roussel, R.; Edelen, A.; Mayes, C.; Ratner, D.; Gonzalez-Aguilera, J.P.; Kim, S.; Wisniewski, E.; Power, J. Phase Space Reconstruction from Accelerator Beam Measurements Using Neural Networks and Differentiable Simulations. Phys. Rev. Lett.
**2023**, 130, 145001. [Google Scholar] [CrossRef] - Mohayai, T.A.; Snopok, P.; Neuffer, D. A Non-Parametric Density Estimation Approach to Measuring Beam Cooling in MICE. arXiv
**2018**, arXiv:physics/1806.01834. [Google Scholar] [CrossRef] - Xu, T.; Jing, C.; Kanareykin, A.; Piot, P.; Power, J. Spatio-Temporal Shaping of the Photocathode Laser Pulse for Low-Emittance Shaped Electron Bunches. In Proceedings of the 10th International Particle Accelerator Conference IPAC2019, Melbourne, Australia, 19–24 May 2019; pp. 2163–2166. [Google Scholar] [CrossRef]
- Chen, X.; Yang, L.; Duan, J.; Karniadakis, G.E. Solving Inverse Stochastic Problems from Discrete Particle Observations Using the Fokker–Planck Equation and Physics-Informed Neural Networks. Siam J. Sci. Comput.
**2021**, 43, B811–B830. [Google Scholar] [CrossRef] - O’Leary, J.; Paulson, J.A.; Mesbah, A. Stochastic Physics-Informed Neural Ordinary Differential Equations. J. Comput. Phys.
**2022**, 468, 111466. [Google Scholar] [CrossRef] - Parzen, E. On Estimation of a Probability Density Function and Mode. Ann. Math. Stat.
**1962**, 33, 1065–1076. [Google Scholar] [CrossRef] - Park, B.U.; Marron, J.S. Comparison of Data-Driven Bandwidth Selectors. J. Am. Stat. Assoc.
**1990**, 85, 66–72. [Google Scholar] [CrossRef] - Sheather, S.J.; Jones, M.C. A Reliable Data-Based Bandwidth Selection Method for Kernel Density Estimation. J. R. Stat. Soc. Ser. (Methodol.)
**1991**, 53, 683–690. [Google Scholar] [CrossRef] - Jones, M.C.; Marron, J.S.; Sheather, S.J. A Brief Survey of Bandwidth Selection for Density Estimation. J. Am. Stat. Assoc.
**1996**, 91, 401–407. [Google Scholar] [CrossRef] - Abramowitz, M.; Stegun, I.A. Handbook of Mathematical Functions: With Formulas, Graphs and Mathematical Tables. Dover Books on Advanced Mathematics; Dover Publications: Mineola, NY, USA, 1972. [Google Scholar]
- Press, W.H.; Vetterling, W.T.; Teukolsky, S.A.; Flannery, B.P. Numerical Recipes in C++: The Art of Scientific Computing, 2nd ed.; Cambridge University Press: New York, NY, USA, 2001. [Google Scholar]
- Dattoli, G.; Giannessi, L.; Mezi, L.; Torre, A. Theory of Generalized Bessel Functions. Nuovo C. Ser.
**1990**, 105, 327–348. [Google Scholar] [CrossRef] - Dattoli, G.; Torre, A.; Lorenzutta, S.; Maino, G.; Chiccoli, C. Theory of Generalized Bessel Functions.-II. Nuovo C. B
**1991**, 106, 21–51. [Google Scholar] [CrossRef] - Dattoli, G.; Chiccoli, C.; Lorenzutta, S.; Maino, G.; Richetta, M.; Torre, A. Advances on the Theory of Generalized Bessel Functions and Applications to Multiphoton Processes. J. Sci. Comput.
**1993**, 8, 69–109. [Google Scholar] [CrossRef]

**Figure 1.**Densities of samples drawn from the 2D normal distribution with unit variance; (green) analytical radial part of the density function; (blue) density of the radial coordinate of samples; (orange) estimate of radial density using a weighted histogram.

**Figure 2.**Density of points sampled from a beam with nonlinear correlation estimated with the weighted histogram method and the axisymmetric kernel density estimator. The analytical density is shown to the right.

**Figure 3.**(

**a**) The averaged kernel for evaluating the axisymmetric radial density of the spatial coordinates; (

**b**) the same function evaluated along $f(r,r)$ compared with its asymptotic form (with $k=1/{\left(2\pi \right)}^{3/2}$).

**Figure 4.**Comparison between the axisymmetric kernel density estimator (blue), the weighted histogram method (orange), and the analytical expression for the radial part of the 2D density of normally distributed points.

**Figure 5.**The averaged phase space kernel (Equation (9)) evaluated for different locations of the sample. The sample’s location is shown as the red cross in each image, and the coordinates are displayed in the header of each column. The angular velocity of the sample is varied along the rows and shown in each row label. The colormaps are normalized to the maximum of the data in each panel to highlight the shape of the kernels rather than their relative magnitude.

**Figure 6.**Estimates of the mean integrated square error of the two density estimators for a variety of sample sizes. For each point, 32 samples were evaluated, and the integrated error was calculated using a 64 × 64 grid of points.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Pierce, C.M.; Kim, Y.-K.
Kernel Density Estimators for Axisymmetric Particle Beams. *Instruments* **2023**, *7*, 44.
https://doi.org/10.3390/instruments7040044

**AMA Style**

Pierce CM, Kim Y-K.
Kernel Density Estimators for Axisymmetric Particle Beams. *Instruments*. 2023; 7(4):44.
https://doi.org/10.3390/instruments7040044

**Chicago/Turabian Style**

Pierce, Christopher M., and Young-Kee Kim.
2023. "Kernel Density Estimators for Axisymmetric Particle Beams" *Instruments* 7, no. 4: 44.
https://doi.org/10.3390/instruments7040044