A New Computational Framework for Particle and Spin Simulations Based
Total Page:16
File Type:pdf, Size:1020Kb
Draft for PRE September 15, 2018 A new computational framework for particle and spin simulations based on the stochastic Galerkin method J. Slim,1 F. Rathmann,2, ∗ and D. Heberling1, 3 1Institut für Hochfrequenztechnik, RWTH Aachen University, 52056 Aachen, Germany 2Institut für Kernphysik, Forschungszentrum Jülich, 52425 Jülich, Germany 3JARA–FAME (Forces and Matter Experiments), Forschungszentrum Jülich and RWTH Aachen University, Germany An implementation of the Polynomial Chaos Expansion is introduced here as a fast solver of the equations of beam and spin motion inside an RF Wien filter. The device shall be used to search for the deuteron electric dipole moment in the COSY storage ring. The new approach is based on the stochastic Galerkin method, and it is shown that this constitutes a new and very powerful alternative to the commonly used Monte-Carlo methods. I. INTRODUCTION AND MOTIVATION the electromagnetic performance of the above mentioned RF Wien filter under mechanical uncertainties [3]. This The JEDI1 collaboration aims at a measurement of the investigation made use of the so-called Polynomial Chaos electric dipole moment (EDM) of charged hadronic par- Expansion (PCE) [4], as an efficient and yet accurate al- ticles, such as deuterons and protons. In the near future, ternative to the MC method. a first direct EDM measurement of the deuteron will be In this paper, we present a computational framework carried out at the COoler SYnchrotron COSY, a conven- to further reduce the complexity of the problem in terms tional magnetic storage ring. To this end, an RF Wien of the required number of tracking simulations. The same filter [1] has recently been installed, which will be oper- methodology as in Ref. [3] is used here, but as we have ated at some harmonic of the spin precession frequency, access to the equations governing the system, here an whereby the sensitivity to the deuteron EDM is substan- intrusive version of the PCE is employed. tially enhanced. This paper is organized as follows. Section II briefly In order to eliminate the false EDM signals, it is of reviews the basic theoretical foundations of the PCE. crucial importance to understand the sources of mag- Section III introduces the stochastic Galerkin method netic imperfections in the accelerator ring [2]. Particle (SGM) and applies it to the beam and spin equations. and spin tracking simulation constitute powerful tools to Section IV describes the main steps required to perform do so. Conducting a realistic simulation for a machine the SGM. Section V presents the results and compares that includes mechanical, electrical and electromagnetic them quantitatively to the equivalent MC results. Sec- uncertainties of all of its elements is indeed a challenging tion VI summarizes and concludes the paper. task. The well-known Monte-Carlo (MC) simulation as a tool to conduct such a study is computationally very expensive. The dimension (number of random parame- II. POLYNOMIAL CHAOS EXPANSION ters) in such simulations is particularly large. To further clarify the complexity of the problem, just consider that The polynomial chaos expansion (PCE) is a stochas- the current in a dipole magnet is not perfectly uniform, tic spectral method that allows for stochastically varying and this will alter the magnetic fields, which will affect physical entities Y, as a response of some random input the spin motion and orbit motion of the particles. It ξ to be represented in terms of orthogonal polynomials. is therefore important to quantify such uncertainties be- PCE permits Y to be expanded into a series of orthogonal forehand for the intended EDM experiment. In addition, polynomials of degree p (the expansion order) as function many other factors like the mechanical fabrication tol- of the input variables ξ. Thus it follows that erance and the accuracy of the alignment contribute as arXiv:1707.09274v1 [physics.comp-ph] 28 Jul 2017 well. N The principle problem with the MC method is the ne- Y = aiΨi(ξ). (1) i cessity to repeat the simulation 10000 or even tens of X millions of times. For limited-budget projects such as Here the Ψi are the multivariate orthogonal polynomi- ours, this is therefore not an option. Recently, as a first als (the basis functions) of degree p, and the ai are the step toward a full systematic analysis of the future EDM expansion coefficients to be computed. The orthogonal experiments at COSY, we conducted a study to quantify polynomials can be the Hermite, Legendre, Laguerre, or any other set of orthogonal polynomials, depending on the probabilistic distribution of the random input vari- ∗ Corresponding author: [email protected] ables ξ. This paper deals with physical entities Y that 1 Jülich Electric Dipole moment Investigations, include electromagnetic fields with uncertainties, particle http://collaborations.fz-juelich.de/ikp/jedi/. positions, velocities and spin vectors. 2 The first step in building a polynomial chaos series is (FEM) [11, 12]. In 1921 Boris Galerkin, a Russian math- to determine the probabilistic distribution of the input ematician, proposed a method to solve differential equa- random variables and their number (the dimensionality tions based on functional analysis. In contrast to other of the problem). Once known, the multivariate orthogo- methods, such as finite difference (FD) schemes, the nal polynomials can be constructed using the three-terms Galerkin method does not solve the differential equa- recurrence properties that can be found e.g., in [5]. tions directly, but transforms them into a variational Oftentimes, the number of random variables is larger form (a functional) that is then minimized. The func- than unity, which implies that multivariate polynomials tions minimizing this functional are the solutions to the must be used instead of univariate ones. Obviously, the required differential equations. The variational form is expansion order must be known and, as explained in [6, constructed via the Galerkin projection techniques [in- 7], can be changed adaptively during processing. sert proper ref]. The expansion coefficients can be calculated using in- In this section, the construction of the variational trusive and non-intrusive methods. Non-intrusive meth- form of the beam and spin dynamic equations using the ods consider the deterministic code as a black box, i.e., stochastic Galerkin projection is described in detail. Ne- they do not alter the code nor the equations. The ex- glecting forces other than the electromagnetic ones acting pansion coefficients are calculated using multiple calls to on the charged particles, the beam equations read the deterministic code either via projection or regression. Both require a number of N realization pairs (ξ , Ψ ) (see d q 1 i i ~v = E~ + ~v × B~ − ~v ~v · E~ , and Eq. (1)). Projection requires the evaluation of expecta- dt mγ c2 (5) tion values and relies on the orthogonality of polynomials d ~r = ~v. to compute the coefficients in the form of dt E {YΨ} a = , (2) The expansion of Eq. (5) in Cartesian coordinates E 2 {Ψ } yields a linear system of six coupled ordinary differen- where the computation of the expectation values (E{·}) tial equations, necessitates the evaluation of integrals. Quadrature methods are one way to do so, and are commonly used d q 1 1 1 1 vx = Ex + vyBz − vzBy − vx(~v · E~ ) , in PCE analyses. Depending on the type of input distri- dt m γ γ γ c2γ bution, the corresponding quadrature rule can be used. The Gauss-Laguerre quadrature for instance [8], is used (6a) in the case of uniformly distributed random variables. d q 1 1 1 1 This projection method is widely known as non-intrusive vy = Ey + vzBx − vxBz − vy(~v · E~ ) , dt m γ γ γ c2γ spectral projection (NISP) [9]. (6b) Regression, on the other hand, estimates the coeffi- cients that minimize the functional difference between d q 1 1 1 1 v = E + v B − v B − v (~v · E~ ) , and the estimated response Yˆ and the actual response Y, dt z m γ z γ x y γ y x c2γ z given by (6c) 2 d a = arg min E Yˆ − Y . (3) x = vx , (6d) dt n o d The solution of Eq. (3), obtained by linear regression, y = vy , (6e) dt yields d T z = vz . (6f) ai = Ψ · Ψ · Ψ · Y. (4) dt In the context of this work, the regression method [10] Here, ~v denotes the velocity vector of the particles, q the provides more accurate results than the projection particle charge, m the mass, γ the Lorentz factor, and ~r method, it is therefore used here to calculate the expan- the position vector. sion coefficients ai, which are subsequently fed into the When intra-beam scattering and other collective ef- stochastic Galerkin solver. fects are neglected, the simulation of a beam of parti- cles is equivalent to individual simulations with different initial conditions. It is furthermore assumed that the III. STOCHASTIC GALERKIN METHOD number of single particle simulations is sufficiently large APPLIED TO BEAM AND SPIN DYNAMICS to describe the beam. These assumptions permit us to use stochastic methods to solve the differential equations A. Beam dynamics with random coefficients, or with uncertain input vari- ables, or even with random boundary values. According One of the most common methods to solve differ- to a probabilistic distribution, each individual particle of ential equations is the Galerkin-finite element method the population has a different initial position ~r and veloc- 3 (a) C14jl (b) C26jl (c) C37jl (d) C45jl (e) C69jl (f) C77jl (g) C86jl (h) C93jl (i) C105jl (j) C116jl FIG. 1. With the m = 5 dimensional problem and an expansion order of p = 4, the number of basis functions is P = 126 (see Eq. (7) of [3]), which results in a (126 × 126 × 126) Cijl tensor.