FIELD MODELING, SYMPLECTIC TRACKING, AND SPIN DECOHERENCE FOR EDM AND MUON G-2 LATTICES By Eremey Vladimirovich Valetov A DISSERTATION Submitted to Michigan State University in partial fulfillment of the requirements for the degree of Physics – Doctor of Philosophy 2017 ABSTRACT FIELD MODELING, SYMPLECTIC TRACKING, AND SPIN DECOHERENCE FOR EDM AND MUON G-2 LATTICES By Eremey Vladimirovich Valetov While the first particle accelerators were electrostatic machines, and several electrostatic storage rings were subsequently commissioned and operated, electrostatic storage rings pose a number of challenges. Unlike motion in the magnetic field, where particle energy remains constant, particle energy generally changes in electrostatic elements. Conservation of energy in an electrostatic element is, in practice, only approximate, and it requires careful and accurate design, manufacturing, installation, and operational use. Electrostatic deflectors require relatively high electrostatic fields, tend to introduce nonlinear aberrations of all orders, and are more challenging to manufacture than homogeneous magnetic dipoles. Accordingly, magnetic storage rings are overwhelmingly prevalent. The search for electric dipole moments (EDMs) of fundamental particles is of key importance in the study of C and CP violations and their sources. C and CP violations are part of the Sakharov conditions that explain the matter–antimatter asymmetry in the universe. Determining the source of CP violations would provide valuable empirical insight for beyond-Standard-Model physics. EDMs of fundamental particles have not to this date been experimentally observed. The search for fundamental particle EDMs has narrowed the target search region; however, an EDM signal is yet to be discovered. In 2008, Brookhaven National Laboratory (BNL) had proposed the frozen spin (FS) concept for the search of a deuteron EDM. The FS concept envisions launching deuterons through a storage ring with combined electrostatic and magnetic fields. The electrostatic and magnetic fields are in a proportion that would, without an EDM, freeze the deuteron’s spin along its momentum as the deuteron moves around the lattice. The radial electrostatic field would result in a torque on the spin vector, proportional to a deuteron EDM, rotating the spin vector out of the midplane. The principle of an anomalous magnetic dipole moment (MDM) measurement using a storage ring, shared by BNL’s completed E821 Experiment and the ongoing E989 Experiment operated by Fermi National Accelerator Laboratory (FNAL), requires injecting muons into a magnetic ring at the so-called magic momentum. The magic momentum, as defined in this context, would freeze the muon’s spin vector along its momentum if the anomalous MDM was zero. The spin precession in the horizontal plane relative to the momentum is proportional to the anomalous MDM. Storage rings for measurement of EDM and anomalous MDM present a new frontier in tracking code accuracy requirements. For accurate tracking of storage rings with electrostatic particle optical elements, it is necessary to model the fringe fields of such elements accurately, in particular, because not doing so provides a mechanism for energy conservation violation. However, the previous research on fringe fields tended to focus on magnetic rather than electrostatic particle optical elements. We will study and model the fringe fields of several electrostatic deflectors. Field falloffs of electrostatic deflectors are slower than exponential, and Enge functions are not suitable for accurate modeling of these falloffs. We will propose an alternative function to model field falloffs of electrostatic deflectors. We will use conformal mapping methods to obtain the main field of the Muon g-2 storage ring high voltage quadrupole, and we will calculate its fringe field and effective field boundary (EFB) using Fourier analysis. Furthermore, we will study tracking of storage rings with electrostatic elements using map methods. We will find that, for simultaneous symplecticity and energy conservation, it is only necessary to enforce symplecticity in COSY INFINITY. We will model and track several benchmark lattices – an electrostatic spherical deflector, a homogeneous magnetic dipole, and a proton EDM lattice – in COSY INFINITY and MSURK89, our in-house eighth order Runge–Kutta–Verner tracking code. Finally, we will investigate spin decoherence and systematic errors in FS and quasifrozen spin (QFS) lattices. Spin decoherence effects are similar in FS and QFS lattices, and spin decoherence in said lattices often remains in the same range over time, indicating the feasibility of EDM measurement using FS and QFS lattices. Copyright by EREMEY VLADIMIROVICH VALETOV 2017 To life itself. v ACKNOWLEDGMENTS I would like to express my most profound gratitude to and appreciation for the people who guided and inspired me during my years of study and research in the doctoral program. First and foremost, I am forever indebted to my primary academic adviser, Martin Berz, for guiding me on this journey, for sharing his wisdom and patience with me, and for motivating me to pursue higher standards in scientific rigor and presentation clarity. I thank him for creating a vibrant, engaging, and diverse research experience, as well as for the opportunities to contribute value to meetings, conferences, and collaborations. Moreover, it is now hard to imagine not having experienced the advantages of applying his systematic and iterative approach to problem solving. Many thanks to my adviser Yurij Senichev, who kindly offered his mentorship at the Institute of Nuclear Physics at Forschungszentrum Jülich, gave me the opportunity to work with him on frozen spin and quasi-frozen spin lattice design, and broadened my perspective of beam physics. I would like to thank my adviser Andreas Lehrach from the RWTH Aachen and the Institute of Nuclear Physics, Forschungszentrum Jülich, for welcoming me into the JEDI collaboration, for discussions about fringe fields, and for sending me to the International Computational Accelerator Physics Conference in Shanghai, China. I am thankful to Kyoko Makino, who is a great role model in demonstrating scientific and technical attention to detail and who patiently worked with me on a report for the Muon g-2 collaboration and other projects. My gratitude extends to the other members of my guidance committee, Phillip Duxbury and Filomena Nunes. I thank the graduate, high energy physics (HEP), and institute secretaries for their helpfulness. I appreciate the collaboration, discussions, and other interactions with the scientists Helmut Soltner, Selcuk Haciomeroglu, Frank Rathmann, Bernd Lorentz, Wanwei Wu, Yannis Semertzidis, Jörg Pretz, Andro Kacharava, Lehel Banjai, and others. Helmut Soltner graciously performed multiple field data calculations for rectangular electrostatic deflectors using COULOMB’s boundary vi element method (BEM) field solver. It was a pleasure working with the current and former fellow student members of the MSU Center for Beam Theory and Dynamical Systems: Robert Hipple, David Tarazona, Ravi Jagasia, Ben Loseth, and Alexander Wittig. The same goes for the current and former fellow students at the Institute of Nuclear Physics, including Stanislav Chekmenev, Alexander Skawran, Alexander Aksentev, Marcel Rosenthal, and Vera Schmidt. I acknowledge the Department of Energy and Forschungszentrum Jülich for providing conference travel funding and other support. I used resources of the National Energy Research Scientific Computing Center to track frozen spin and quasi-frozen spin lattices. Some calculations were performed using MSU’s Obelix computing cluster or an Amazon EC2 computing cluster with MIT’s StarCluster toolkit. Finally, special thanks to my parents for their peaceful and enlightened parenting and for encouraging me to strive for academic excellence. vii TABLE OF CONTENTS LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv KEY TO ABBREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi CHAPTER 1 INTRODUCTION . . . . . . . 1.1 Electric Dipole Moment . . . . . . . . 1.2 Anomalous Magnetic Dipole Moment 1.3 Thomas–BMT Equation . . . . . . . . 1.4 Lattice Tracking Requirements . . . . 1.5 Beamline Coordinate System . . . . . 1.6 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 4 6 7 8 9 CHAPTER 2 FRINGE FIELDS OF ELECTROSTATIC DEFLECTORS . . . . . 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Semi-Infinite Capacitor with Uniform Charge Distribution . . . . . . . . 2.2.1 Taylor Enge Function Coefficients . . . . . . . . . . . . . . . . . 2.2.2 Least-Squares Enge Function Coefficients . . . . . . . . . . . . . 2.2.3 Asymptotic Field Falloff Behavior . . . . . . . . . . . . . . . . . 2.3 Semi-Infinite Capacitor with Plates of Uniform Potential . . . . . . . . . 2.3.1 Infinitely Thin Plates . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1.1 Charge Distribution in the Plates . . . . . . . . . . . . . 2.3.2 Solid Metal Plates . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2.1 One Capacitor . . . . . . . . . . . . . . . . . . . . . . 2.3.2.1.1 Infinitely Thick Plates . . . . . . . . . . . . . 2.3.2.1.2 Plates of Finite Thickness . . . . . . . . . . . 2.3.2.1.3 Plates of Finite Thickness with Rounded Edges 2.3.2.1.4 Infinitely Thin Plates . . . . . . . . . . . . . . 2.3.2.2 Two Adjacent Capacitors with Symmetric Voltages . . . 2.3.2.3 Two Adjacent Capacitors with Antisymmetric Voltages . 2.3.2.4 Two Adjacent Capacitors with Different Voltages . . . . 2.4 Finite Rectangular Electrostatic Capacitors . . . . . . . . . . . . . . . . . 2.4.1 COULOMB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Large Rectangular Capacitor . . . . . . . . . . . . . . . . . . . . 2.4.3 Small Rectangular Capacitor . . . . . . . . . . . . . . . . . . . . 2.5 Comparison of Single-Capacitor Results . . . . . . . . . . . . . . . . . . 2.6 Accurate Fringe Fields Representation . . . . . . . . . . . . . . . . . . . 2.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 12 15 19 20 22 22 24 27 28 28 32 34 38 40 45 50 53 53 55 56 58 61 68 CHAPTER 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MAIN AND FRINGE FIELDS OF THE MUON G-2 STORAGE RING HIGH VOLTAGE QUADRUPOLE . . . . . . . . . . . . . . . . . . . . . . 71 viii 3.1 3.2 3.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Main Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Conformal Mapping Methods . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Conformal Mappings for Main Field Calculation . . . . . . . . . . . . . 3.2.3 Multipole Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3.1 Fourier Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3.2 Differential Algebra Methods . . . . . . . . . . . . . . . . . . 3.2.4 Calculations and Results . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4.1 Nominal Symmetric Case (“SM”) . . . . . . . . . . . . . . . . 3.2.4.1.1 Differential Equation Solution in Mathematica (“Mathematica PDE”) . . . . . . . . . . . . . . . . . 3.2.4.1.2 Fourier Analysis in MATLAB (“MATLAB Fourier”) . . 3.2.4.2 Non-Symmetric Case (“NSM”) . . . . . . . . . . . . . . . . . 3.2.4.2.1 Fourier Analysis in MATLAB (“MATLAB Fourier”) . . 3.2.4.2.2 DA Calculation in Mathematica (“Mathematica DA”) 3.2.4.2.3 DA Calculation in COSY INFINITY (“COSY INFINITY DA”) . . . . . . . . . . . . . . . . 3.2.4.2.4 Python Version of mterms . . . . . . . . . . . . . . . 3.2.4.3 Multipole Terms . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4.4 Error Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4.4.1 “SM Mathematica PDE” . . . . . . . . . . . . . . . . 3.2.4.4.2 “SM MATLAB Fourier” . . . . . . . . . . . . . . . . 3.2.4.4.3 “NSM MATLAB Fourier” . . . . . . . . . . . . . . . 3.2.4.4.4 “NSM Mathematica DA” . . . . . . . . . . . . . . . 3.2.4.4.5 “NSM COSY INFINITY DA” . . . . . . . . . . . . . 3.2.4.4.6 Relative Differences . . . . . . . . . . . . . . . . . . 3.2.4.4.7 Plate Distance Perturbations . . . . . . . . . . . . . . 3.2.5 Main Field Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . Fringe Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Multipole Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 STEP Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.4 STEP Model of the Quadrupole . . . . . . . . . . . . . . . . . . . . . . 3.3.5 Grid-Point Set for Approximated Potential . . . . . . . . . . . . . . . . . 3.3.6 Calculations in COULOMB . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.7 The Enge Function and the EFB . . . . . . . . . . . . . . . . . . . . . . 3.3.8 Comparison with Wu Data . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.9 Fringe Field Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 71 72 72 72 74 75 76 77 78 . . . . . 81 83 84 90 90 . . . . . . . . . . . . . . . . . . . . . . 92 97 97 97 104 105 108 108 110 110 112 114 116 116 116 117 118 119 120 120 123 127 . . . . . 129 129 131 131 131 CHAPTER 4 4.1 SYMPLECTIFICATION METHODS, AND SIMULTANEOUS SYMPLECTICITY AND ENERGY CONSERVATION . . . . Symplecticity and Symplectification of Transfer Maps . . . . . . . . . 4.1.1 Symplecticity Norm . . . . . . . . . . . . . . . . . . . . . . . 4.1.1.1 Weighted Symplecticity Norm . . . . . . . . . . . . 4.1.2 Symplectification Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 4.3 4.1.2.1 Block-Wise Symplectification . . . . . . . . . . . . . . . 4.1.2.2 The Gram–Schmidt Method . . . . . . . . . . . . . . . . 4.1.2.3 Miguel Furman’s Iterative Method . . . . . . . . . . . . . 4.1.2.4 The Gradient Descent Method . . . . . . . . . . . . . . . 4.1.2.5 Symplectification by Generating Functions . . . . . . . . Simultaneous Symplecticity and Energy Conservation . . . . . . . . . . . . 4.2.1 Feasibility of Simultaneous Symplecticity and Energy Conservation 4.2.2 Concept of Iterative Symplectification and Energy Correction . . . . 4.2.3 Energy Conservation in COSY INFINITY . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 133 134 134 135 137 137 138 140 140 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 142 143 143 143 144 145 146 147 148 149 149 149 150 150 151 151 151 154 155 155 155 156 157 159 161 162 163 165 167 170 171 175 CHAPTER 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 ORBITAL TRACKING USING COSY INFINITY AND A CONVENTIONAL RUNGE–KUTTA INTEGRATOR . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bending Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Homogeneous Magnetic Dipole . . . . . . . . . . . . . . . . . . 5.2.2 Electrostatic Spherical Deflector . . . . . . . . . . . . . . . . . . 5.2.2.1 Representations in COSY INFINITY . . . . . . . . . . Off-Midplane Terms of the Potential . . . . . . . . . . . . . . . . . . . . Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tracking in COSY INFINITY . . . . . . . . . . . . . . . . . . . . . . . . MSURK89 Tracking Code . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1 Particle Optical Elements . . . . . . . . . . . . . . . . . . . . . . 5.6.1.1 Homogeneous Magnetic Dipole MIDI . . . . . . . . . . 5.6.1.2 Electrostatic Spherical Deflector MIESP . . . . . . . . . 5.6.1.3 Drift MIDL . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1.4 Momentum Tilt MITA . . . . . . . . . . . . . . . . . . 5.6.2 Integration Step Size . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2.1 Automatic Step-Size Adjustment . . . . . . . . . . . . 5.6.2.2 Initial Step Size . . . . . . . . . . . . . . . . . . . . . 5.6.2.3 Growth of Integrator Errors . . . . . . . . . . . . . . . Magnetic Dipole and Spherical Deflector Tracking Test Cases . . . . . . . 5.7.1 Homogeneous Magnetic Dipole . . . . . . . . . . . . . . . . . . 5.7.1.1 Analytic Representation of Motion . . . . . . . . . . . 5.7.1.2 Tracking results . . . . . . . . . . . . . . . . . . . . . 5.7.2 Electrostatic Spherical Deflector . . . . . . . . . . . . . . . . . . 5.7.2.1 Analytic Representation of Non-Relativistic Motion . . 5.7.2.2 Analytic Representation of Relativistic Motion . . . . . 5.7.2.3 Reference and Non-Reference Trajectories . . . . . . . 5.7.2.4 Tracking Results . . . . . . . . . . . . . . . . . . . . . 5.7.2.4.1 Effect of the Computation Order on Accuracy 5.7.2.4.2 An Additional Benchmark Example . . . . . . Spherical Deflector Transfer Map Test Cases . . . . . . . . . . . . . . . . 5.8.1 Integration of the ODEs in Polar Laboratory Coordinates . . . . . 5.8.2 Kepler Theory Transition Matrix and Lagrange Coefficients . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8.3 Transfer Maps of the Spherical Deflector and Comparison . . . . 5.8.3.1 Integration of the ODEs in Polar Laboratory Coordinates 5.8.3.2 Kepler Theory Transition Matrix . . . . . . . . . . . . 5.8.3.3 COSY INFINITY’s Spherical Deflector Element . . . . . 5.8.3.4 GIOS’s Spherical Deflector Element . . . . . . . . . . . 5.8.4 Calculation Results, Comparison, and Conclusion . . . . . . . . . 5.9 Proton EDM Lattice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.9.1 Lattice Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . 5.9.2 Electrostatic Cylindrical Deflector . . . . . . . . . . . . . . . . . 5.9.2.1 Semi-Circular Geometry . . . . . . . . . . . . . . . . . 5.9.2.2 Generalized Geometry . . . . . . . . . . . . . . . . . . 5.9.2.3 Computation of the Scalar Value . . . . . . . . . . . . . 5.9.2.4 Computation of the DA Value . . . . . . . . . . . . . . 5.9.3 Lattice Potential Model . . . . . . . . . . . . . . . . . . . . . . . 5.9.4 Tracking in MSURK89 . . . . . . . . . . . . . . . . . . . . . . . 5.9.5 Lattice Implementation in COSY INFINITY . . . . . . . . . . . . 5.9.5.1 Fringe Field of Electrostatic Cylindrical Deflector . . . 5.9.6 Tracking in COSY INFINITY . . . . . . . . . . . . . . . . . . . . 5.10 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 182 184 185 186 187 188 188 189 189 190 191 191 193 193 196 197 200 203 . . . . . . . . . . . . . . . . 204 204 205 205 207 208 210 210 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 212 213 214 218 218 219 219 221 223 224 224 225 225 225 CHAPTER 6 6.1 6.2 6.3 6.4 INVESTIGATION OF SPIN DECOHERENCE AND SYSTEMATIC ERRORS IN FROZEN SPIN AND QUASI-FROZEN SPIN LATTICES . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spin Coherence in Lattices for EDM . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Spin Coherence Requirements . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Spin Decoherence Optimization . . . . . . . . . . . . . . . . . . . . . 6.2.3 Suppression of Longitudinal Effects Using an RF Cavity . . . . . . . . 6.2.4 Spin Decoherence Minimization . . . . . . . . . . . . . . . . . . . . . 6.2.4.1 Synchronous Acceleration Principle . . . . . . . . . . . . . . 6.2.4.2 Orbit Lengthening Due to the Betatron Motion and Momentum Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.4.3 Orbit Lengthening Correction Using Sextupoles . . . . . . . 6.2.4.4 Chromaticity Correction Using Sextupoles . . . . . . . . . . 6.2.4.5 Calculation of Chromaticity . . . . . . . . . . . . . . . . . . Frozen Spin and Quasi-Frozen Spin Lattices . . . . . . . . . . . . . . . . . . . 6.3.1 Senichev BNL Frozen Spin Lattice . . . . . . . . . . . . . . . . . . . . 6.3.2 Quasi-Frozen Spin Lattices . . . . . . . . . . . . . . . . . . . . . . . . 6.3.2.1 The QFS Concept . . . . . . . . . . . . . . . . . . . . . . . 6.3.2.2 Senichev 6.3 QFS Lattice . . . . . . . . . . . . . . . . . . . 6.3.2.3 Senichev E+B QFS Lattice . . . . . . . . . . . . . . . . . . . 6.3.3 Sextupole Family Nomenclature . . . . . . . . . . . . . . . . . . . . . Spin Decoherence Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.1 Computational Software . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.2 Fringe Fields of Electrostatic Deflectors . . . . . . . . . . . . . . . . . 6.4.3 Manual Optimization of Sextupole Strengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi 6.5 6.6 6.4.4 Automatic Optimization of Sextupole Strengths . . . . . . . . . . . . 6.4.5 Spin Decoherence Analysis . . . . . . . . . . . . . . . . . . . . . . . Systematic Errors Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.1 EDM Signal Extraction by Tracking in Opposite Directions . . . . . . 6.5.2 Reverse Spin Transfer Map . . . . . . . . . . . . . . . . . . . . . . . 6.5.3 Error Field Implementation . . . . . . . . . . . . . . . . . . . . . . . 6.5.4 Bx Magnetic Field Component Due to Systematic Errors . . . . . . . 6.5.5 Bz Magnetic Field Component Due to Systematic Errors . . . . . . . 6.5.6 EDM Measurement Accuracy with Rotational Magnet Misalignments 6.5.7 Spin-Tracking Datasets . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.8 Spikes in the Horizontal Spin Decoherence Measure at the Poles . . . 6.5.9 Vertical Spin Decoherence Analysis . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . APPENDICES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . APPENDIX A CONFORMAL MAPPING METHODS . . . . . . . . . . . . . SC TOOLBOX POLYGONAL MODELS OF SEMI-INFINITE APPENDIX B CAPACITORS . . . . . . . . . . . . . . . . . . . . . . . . . . . SC TOOLBOX POLYGONAL MODELS OF THE MUON G-2 APPENDIX C QUADRUPOLE . . . . . . . . . . . . . . . . . . . . . . . . . . APPENDIX D MATLAB CODES FOR MUON G-2 QUADRUPOLE FOURIER MODES CALCULATION . . . . . . . . . . . . . . . . . . . . APPENDIX E MATHEMATICA NOTEBOOK FOR MUON G-2 QUADRUPOLE MULTIPOLE TERMS CALCULATION . . . . . . . . . . . . . APPENDIX F PYTHON VERSION OF MTERMS . . . . . . . . . . . . . . . . . APPENDIX G STEP FILE GENERATOR . . . . . . . . . . . . . . . . . . . . CODES FOR SPHERICAL DEFLECTOR TRANSFER MAP APPENDIX H AND ORBIT CALCULATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 228 230 232 233 235 236 237 238 239 240 242 242 . . 246 . . 247 . . 254 . . 259 . . 261 . . 264 . . 267 . . 286 . . 303 BIBLIOGRAPHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 xii LIST OF TABLES Table 2.1: Coefficients of the Enge function F5 (z), fitted to the electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thin plates. The Enge function is accurate for z/D ≤ 4. . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Table 2.2: Fitted coefficients of the function H1 (z), approximating the electrostatic field falloff Ex (z) at z/D ≥ 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Table 3.1: Multipole terms Mn,n in cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM MATLAB Fourier”, and “NSM Mathematica DA”. . . . . . . . . . . . . . 98 Table 3.2: Multipole terms A0 , An , and Bn in case “NSM COSY INFINITY DA”. The sine multipole terms are included for comparison with “NSM COSY INFINITY DA” multipole terms calculated with perturbed geometry and voltages in Tables 3.3, 3.4, 3.5, and 3.6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Table 3.3: Cosine multipole terms A0 , An in case “NSM COSY INFINITY DA” with specified perturbations 4V j of plate voltage coefficients. . . . . . . . . . . . . . 100 Table 3.4: Sine multipole terms Bn in case “NSM COSY INFINITY DA” with specified perturbations 4V j of plate voltage coefficients. . . . . . . . . . . . . . . . . . . 101 Table 3.5: Cosine multipole terms A0 , An in case “NSM COSY INFINITY DA” with specified perturbations D j of plate distances from the origin. . . . . . . . . . . . 102 Table 3.6: Sine multipole terms Bn in case “NSM COSY INFINITY DA” with specified perturbations D j of plate distances from the origin. . . . . . . . . . . . . . . . . 103 Table 3.7: Relative differences between (1) significant multipole terms Mn,n in cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM Mathematica DA”, and “NSM MATLAB Fourier” and (2) significant multipole terms Mn,n in the “NSM COSY INFINITY DA” case. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Table 3.8: Multipole terms Mn,n obtained from the 3D electrostatic potential data calculated in COULOMB, using an FFT transform along the circle of the radius R = 3.6cm at z = −50 cm, scaled to Rref = 4.5 cm. . . . . . . . . . . . . . . . . . . . . . . 121 Table 3.9: Enge function coefficients for the falloff of the multipole strength M2,2 . . . . . . 123 Table 5.1: Enge function coefficients of a semi-infinite capacitor with rounded edges of D/20 plate thickness. Here, we used these Enge function coefficients to model the fringe field of the electrostatic cylindrical deflector in the Proton EDM LSCT lattice. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Table 6.1: Enge function coefficients of a semi-infinite capacitor with rounded edges of D/20 plate thickness. Here, we used these Enge function coefficients to model the fringe fields of the electrostatic deflectors in the Senichev FS and QFS lattices. 226 xiii LIST OF FIGURES Figure 1.1: In the FS lattice concept, the projection sxz of the deuteron’s spin s on the midplane x–z is aligned with the deuteron’s momentum p. An deuteron EDM would cause the azimuthal angle α to slowly grow from the initial α = 0 to a measurable value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 1.2: In the E821 and E989 lattice concepts, the polar angle α between the muon’s spin vector s and momentum p is initially at α = 0. A nonzero muon anomalous MDM aµ causes α to slowly grow to a measurable value. . . . . . . . . . Figure 2.1: The polygonal model of the semi-infinite capacitor with infinitely thin plates. . . Figure 2.2: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with uniform charge distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.3: 5th order Taylor Enge function F5 (z) (dashed red), based on the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.4: 14th (dot-dashed green) and 16th (dashed red) Taylor Enge functions F14 (z) and F16 (z), based on the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. . . . . . . . . . . . . . Figure 2.5: Least-squares Enge function F5 (z) (dashed red), fitted to the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.6: The Schwarz–Christoffel map f from the bi-infinite strip −π ≤ ℑ (v) ≤ −π to the physical domain with semi-infinite infinitely thin plates at x = ±d, y ≤ 0. Figure 2.7: Up to about z/D = 4.5, the least-squares Enge function F5 (z) (dashed red) is a good approximation of the electrostatic field falloff Ex (z) (solid blue) of a semi-infinite capacitor with infinitely thin plates. The curves are offset horizontally by the EFB20 zEFB /D = 0.920945 so that the EFB20 is at z = 0. . . Figure 2.8: Electrostatic potential f (z) = ϕ (d, z) in plane of the upper plate. . . . . . . . . Figure 2.9: Surface charge distribution σ (z) in the upper plate, located at x = d, z ≤ 0. . . . Figure 2.10: The polygonal model of the semi-infinite capacitor with infinitely thick plates. . Figure 2.11: The electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thick plates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.12: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thick plates. The red vertical gridline denotes the EFB20 zEFB /D = 1.41566. . . Figure 2.13: The polygonal model of the semi-infinite capacitor with finitely thick plates. . . Figure 2.14: The electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness. . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.15: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/20 thickness. The red vertical gridline denotes the EFB20 zEFB /D = 0.952043. Figure 2.16: The polygonal model of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.17: The electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. . . . . . . . . . . . . . . . . xiv 4 6 12 16 17 19 20 22 25 26 27 28 30 31 31 33 33 34 36 Figure 2.18: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. The red vertical gridline denotes the EFB20 zEFB /D = 0.962347. . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.19: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/4 thickness and rounded edges. The red vertical gridline denotes the EFB20 zEFB /D = 1.10338. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.20: The polygonal model of the semi-infinite capacitor with infinitely thin plates. . . Figure 2.21: The electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thin plates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.22: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thin plates obtained using the SC Toolbox (dashed red) is visually coincident with the previous result from Fig. 2.7 (dashed blue). The red vertical gridline denotes the EFB20 zEFB /D = 0.920945. . . . . . . . . . . . . . . . . . . . . . Figure 2.23: The polygonal model of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. . . . . . . . . . . . Figure 2.24: The electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. Figure 2.25: EA&B (z) (solid blue) is the electrostatic field of two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. . . . . . . Figure 2.26: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 10 (dashed green), and zoff = 15 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. The origin of each curve is at the edge of the left capacitor A in the respective case. . . . . . . . . . . . . . . . . . . . . . . Figure 2.27: The polygonal model representing the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, antisymmetric voltages, and rounded edges. . . . Figure 2.28: The electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, antisymmetric voltages, and rounded edges in the z ≤ 0, x ≥ 0 quadrant. . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.29: EA&B (z) (solid blue) is the electrostatic field of two adjacent semi-infinite capacitors with plates of 3D/4 thickness, asymmetric voltages, and rounded edges. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. . . . . . . Figure 2.30: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 10 (dashed green), and zoff = 15 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, asymmetric voltages, and rounded edges. . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.31: The polygonal model of the two adjacent semi-infinite capacitors with plates of D/2 thickness at different voltages. . . . . . . . . . . . . . . . . . . . . . . xv 36 37 37 39 39 40 42 43 44 46 47 48 49 51 Figure 2.32: EA&B (z) (solid blue) is the electrostatic field of the two adjacent semi-infinite capacitors with plates of D/2 thickness and different voltages. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. The capacitor edges in this zoff = 5 case are at z/D = ±zoff /D = ±2.5, denoted by red vertical gridlines. Figure 2.33: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 7.5 (dashed green), and zoff = 10 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of D/2 thickness and different voltages. The origin of each curve is at the edge of the left capacitor A in the respective case. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.34: Rendering of the large rectangular capacitor with plates of D/4 thickness and rounded edges. The infinite line represents the z axis. One-eighth of the capacitor geometry, denoted by purple, is stored in the STEP file. The full geometry is recovered in COULOMB by specifying the three reflection symmetries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.35: Electrostatic field falloff Ex (z) of the large rectangular capacitor with plates of D/4 thickness and rounded edges. . . . . . . . . . . . . . . . . . . . . . . . Figure 2.36: Electrostatic field falloff Ex (z) of the small rectangular capacitor with plates of D/4 thickness and rounded edges. . . . . . . . . . . . . . . . . . . . . . . . Figure 2.37: Electrostatic field falloffs Ex (z) of the large (solid green) and small (solid orange) rectangular capacitors modeled by 70, 000 boundary elements, the small rectangular capacitor modeled by 150, 000 boundary elements (dashed blue), and the semi-infinite capacitor with plates of D/4 thickness and rounded edges (dot-dashed red). The Ex (z) curves of the small rectangular capacitor modeled by 70, 000 and 150, 000 boundary elements visually coincide. As expected, the Ex (z) curve of the large rectangular capacitor is only slightly lower than of the semi-infinite capacitor with finitely thick plates and rounded edges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.38: The electrostatic field falloffs Ex (z) in cases 1 (dot-dashed blue), 3 (solid brown), 4 (solid green), and 5 (dashed red). . . . . . . . . . . . . . . . . . . . . Figure 2.39: The electrostatic field falloffs Ex (z) in cases 2 (solid cyan), 3 (solid brown), 5 (solid orange), 6 (dashed blue), 7 (dashed green), and 8 (dot-dashed red). . . . . Figure 2.40: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (solid green), 2 (dashed red), 3 (solid brown), and 6 (dot-dashed blue). Figure 2.41: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (dot-dashed blue), 4 (solid green), and 5 (dashed red). . . . . . . . . Figure 2.42: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (dot-dashed blue), 7 (solid green), and 8 (dashed red). . . . . . . . . Figure 2.43: The electrostatic field falloff Ex (z) of a semi-infinite electrostatic capacitor with infinitely thin plates (solid blue), compared to the magnetic field falloff of a homogeneous magnetic dipole (dashed red). Each curve is horizontally offset so that origin z = 0 is at its EFB (the EFB20 , computed with zext /D = 20, in the electrostatic case). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi 53 54 55 56 57 57 59 59 60 60 61 62 Figure 2.44: An Enge function F5 (z) (dashed red), fitted to the electrostatic field falloff Ex (z) (solid blue) of a semi-infinite capacitor with infinitely thin plates. The electrostatic field falloff Ex (z) is scaled to 1 well inside the capacitor. The origin z = 0 is at the EFB20 . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 2.45: Function H1 (z) (dashed red), fitted to the electrostatic field falloff E (z) (solid blue) over the interval 3 ≤ z/D ≤ 15. The origin z = 0 is at the EFB20 . . . . Figure 2.46: The piecewise function H2 (z) is an improved approximation of electrostatic field falloff Ex (z) compared to the Enge function F5 (z). The function H2 (z) is formed by smoothly gluing F5 (z) and H1 (z) at z/D = 3.5, indicated by the vertical gridline. The origin z = 0 is at the EFB20 . . . . . . . . . . . . . . . Figure 2.47: Function H3 (z) (dashed red) is a Fourier expansion of Ex (z) − H2 (z) (solid blue) over the interval −3.5 ≤ z/D ≤ 6.5. The origin z = 0 is at the EFB20 . . Figure 2.48: The piecewise function G (z), an improved approximation of electrostatic field falloff Ex (z) over function H2 (z). Vertical gridlines at z/D = −3, 3.5, and 6 are points of smooth gluing or smooth boundaries used in construction of G (z), as described in the text. The origin z = 0 is at the EFB20 . . . . . . . . Figure 3.1: Cross section of the Muon g-2 collaboration quadrupole. (Reprinted from Nucl. Instr. Meth. Phys. Res. A, Vol. 503, Yannis K. Semertzidis et al., The Brookhaven Muon (g-2) Storage Ring High Voltage Quadrupoles, Page No. 476, Copyright 2003, with permission from Elsevier.) . . . . . . . . . . . . Figure 3.2: Model of one-eighth of the cross section of the Muon g-2 collaboration quadrupole for the case of non-mispowered plates and no geometric asymmetries (“SM”). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.3: “SM MATLAB”: heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f. . . . . . . . . . . . . . . . . . . . . . . . Figure 3.4: “SM Mathematica PDE”: vertical boundary condition of the Laplace equation for the electrostatic potential ϕ. . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.5: “SM Mathematica PDE”: 3D plot of the solution of the Cauchy–Riemann PDE for the electrostatic potential ϕ. . . . . . . . . . . . . . . . . . . . . . Figure 3.6: “SM Mathematica PDE”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.7: “SM MATLAB Fourier”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.8: “SM MATLAB Fourier”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.9: Model of the cross section of the Muon g-2 collaboration quadrupole for the case of mispowered plates and geometric asymmetries (“NSM”). . . . . . . Figure 3.10: Distances between successive prevertices zn of a conformal mapping from a rectangle to the interior of the polygon representing the cross-sectional geometry in the NSM case. . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.11: “NSM MATLAB”: heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f. . . . . . . . . . . . . . . . . . . . . . . . Figure 3.12: “NSM MATLAB Fourier”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. . . . . . . . . . . . . . . . . . . . . . xvii . . 62 . . 64 . . 66 . . 68 . . 69 . . 77 . . 79 . . 81 . . 82 . . 82 . . 83 . . 84 . . 85 . . 86 . . 86 . . 88 . . 90 Figure 3.13: “NSM MATLAB Fourier”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.14: “NSM Mathematica DA”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.15: “NSM Mathematica DA”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.16: “NSM COSY INFINITY DA”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.17: “NSM COSY INFINITY DA”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. . . . . . . . . . . . . . . . . . . . . . Figure 3.18: “SM Mathematica PDE”: multipole terms Mn,n versus reference radius Rref . Figure 3.19: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “SM Mathematica PDE” as a multipole expansion up to order 24 and in (2) SM from the inverse of the conformal mapping object f. . . . . . . . . . Figure 3.20: “SM MATLAB Fourier”: convergence of multipole terms Mn,n versus error tolerance ε. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.21: “SM MATLAB Fourier”: multipole terms Mn,n versus reference radius Rref . . Figure 3.22: “SM MATLAB Fourier”: apparent accuracy E versus error tolerance ε. . . . Figure 3.23: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “SM MATLAB Fourier” as a multipole expansion up to order 24 and (2) SM from the inverse of the conformal mapping object f. . . . . . . . . . . . Figure 3.24: “NSM MATLAB Fourier”: multipole terms Mn,n versus reference radius Rref . Figure 3.25: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM MATLAB Fourier” as a multipole expansion up to order 24 and (2) NSM from the inverse of the conformal mapping object f. . . . . . . . . Figure 3.26: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM Mathematica DA” as a multipole expansion up to order 24 and in (2) NSM from the inverse of the conformal mapping object f. . . . . . . Figure 3.27: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM COSY INFINITY DA” as a multipole expansion up to order 24 and in (2) NSM from the inverse of the conformal mapping object f. . . . . Figure 3.28: Absolute values of finite difference approximations 4An /D2 of the first derivatives of cosine multipole terms An with respect to perturbations D2 in case “NSM COSY INFINITY DA”. In many cases, plot markers denoting 4An /D2 for lower magnitudes of D2 cover or are in close proximity to plot markers higher magnitudes of D2 . This indicates the validity of the linear interpolation, with limitations shown by some disagreement in 4An /D2 at orders n = 9 and n ≥ 20. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.29: Absolute values of finite difference approximations 4Bn /D2 of the first derivatives of sine multipole terms Bn with respect to perturbations D2 in case “NSM COSY INFINITY DA”. Some plot markers denoting 4Bn /D2 for lower magnitudes of D2 cover or are in close proximity to plot markers higher magnitudes of D2 . Overall, the dependence of multipole terms Bn on D2 does not appear to be linear. . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii . . 91 . . 93 . . 93 . . 96 . . 96 . . 104 . . 105 . . 106 . . 106 . . 107 . . 107 . . 108 . . 109 . . 109 . . 110 . . 113 . . 113 Figure 3.30: Input for the Muon g-2 collaboration quadrupole model: rendering of the resulting STEP-formatted 3D part. . . . . . . . . . . . . . . . . . . . . . . Figure 3.31: Coordinate grid for calculation of Fourier modes of the electrostatic potential, with 605 grid points: z discretization size 4z. The discretization size 4z, as a function of z, was set in an  iterative discretization  process by the mesh 2 refinement function f (z) = 1/ 1 + 9 exp −0.006z . Initially, 4z was set to 10 cm uniformly in the range −50 ≤ z ≤ 150 cm. The grid simplexes were then bisected until the condition 4z (z) ≤ f (z) was met. . . . . . . . . . . . Figure 3.32: Falloff of the multipole strength M2,2 , normalized to M2,2 = 1 well inside the element. The origin of the z axis is aligned with the quadrupole edge. The vertical gridline denotes the EFB zEFB = 1.2195 cm. . . . . . . . . . . . . . Figure 3.33: Enge function and its 2nd and 4th derivatives, for the falloff of the multipole strength M2,2 , plotted using the FP command in COSY INFINITY. . . . . . . Figure 3.34: Muon g-2 collaboration high voltage quadrupole geometry used by Wu for field data calculations using Opera-3d. (Adapted by permission from Wanwei Wu, 3D Electric Field Map From Opera 3D, G-2 Experiment Document GM2doc-4490, Muon g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, Oct. 2016.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.35: Falloffs of 2nd order Fourier modes a2 r j calculated at radii r = 1.8, 2.1, 2.4, 2.7, 3.0 cm from Wu’s field data. Curves with larger magnitudes correspond to larger radii. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 3.36: Fourier modes a2 r j (dashed plot style) versus the true quadrupole strength M2,2 (solid red), all scaled to 1 well inside the quadrupole. . . . . . . . . . Figure 3.37: The falloff of the multipole term M2,2 agrees well between calculations based on Soltner–Valetov field data (zEFB = 1.2195 cm; solid blue) and field data by Wu (zEFB = 1.1233 cm; dashed red). . . . . . . . . . . . . . . . . . . . Figure 5.1: RK89 numerical integration error ε versus initial step size h, in a 100-turn integration of a radius R = 10.1m circular orbit inside an electrostatic spherical deflector. Non-relativistic equations of motion were used. The dashed red line of slope 8.14 is a least-squares fit to the linear pattern. The gridlines separate the linear regime from the part dominated by the floating-point loss of significance, corresponding to initial step size h ' 1 m. . . . . . . . . . . Figure 5.2: RK4 numerical integration error ε versus initial step size h, in a 100-turn integration of a radius R = 10.1m circular orbit inside an electrostatic spherical deflector. Non-relativistic equations of motion were used. The dashed red line of slope 4.07 is a least-squares fit to the linear pattern. The gridlines separate the linear regime from the part dominated by the floating-point loss of significance, corresponding to step size h ' 10−2 m. . . . . . . . . . . . Figure 5.3: RK89 numerical integration error measure ε versus the number of turns n, in the integration of a radius R = 10.1 m circular orbit inside an electrostatic spherical deflector, using non-relativistic equations of motion, with initial step size h = 1.1 m, up to 105 turns. . . . . . . . . . . . . . . . . . . . . . . . . xix . . 119 . . 120 . . 122 . . 124 . . 125 . . 126 . . 126 . . 127 . . 152 . . 153 . . 154 Figure 5.4: The reference orbit (dashed red) and an orbit with initial horizontal offset xi = 0.4 m (solid blue), in a system of sixteen 22.5◦ sectors. (Images source: Kyoko Makino, Eremey Valetov, & Martin Berz, Computation of Nonlinear Fields and Orbit and Spin Transfer Maps of Electrostatic Elements Using Differential Algebras, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.5: Homogeneous magnetic dipole: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns. Particles were launched horizontally, with initial x offsets up to 0.7 m, through a homogeneous magnetic dipole of angle 22.5◦ and radius R0 = 1 m. . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.6: Homogeneous magnetic dipole: the x–a projections of particles tracked in MSURK89 for 160, 000 turns. Particles were launched horizontally, with initial x offsets up to 0.7 m, through a homogeneous magnetic dipole of angle 22.5◦ and radius R0 = 1 m. Calculation CPU time: 314.5 s. . . . . . . . . . . Figure 5.7: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns, with non-relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. . Figure 5.8: Electrostatic spherical deflector: the x–a projections of particles tracked in MSURK89 for 160, 000 turns, with non-relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ . Calculation CPU time: 1579.9 s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.9: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. . Figure 5.10: Electrostatic spherical deflector: the x–a projections of particles tracked in MSURK89 for 160, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU time: 416.0 s. . . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.11: For odd computation orders 1 to 19 (computation order specified in the pictures), the x–a projections of particles tracked in COSY INFINITY, for 160, 000 turns, without symplectification, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU times: 0.4 s, 0.5 s, 0.6 s, 0.9 s, 1.2 s, 1.5 s, 1.9 s, 2.4 s, 2.9 s, and 3.6 s, respectively. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx . 156 . 158 . 159 . 164 . 165 . 166 . 167 . 168 Figure 5.12: For odd computation orders 1 to 19 (computation order specified in the pictures), the x–a projections of particles tracked in COSY INFINITY, for 160, 000 turns, with EXPO symplectification, with relativistic equations of motion. Particles were launched horizontally with initial x offset up to 0.4 m through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU times: 1.0 s, 7.6 s, 9.8 s, 12.9 s, 16.2 s, 19.9 s, 25.1 s, 30.5 s, 34.9 s, 39.4 s, respectively. . . . . . . . . . . . . . . . . . . . Figure 5.13: Electrostatic spherical deflector: the y–b projections of particles tracked in COSY INFINITY (left) and MSURK89 (right), for 160, 000 turns, with nonrelativistic (top) and relativistic (bottom) equations of motion. Particles were launched horizontally, with initial y offsets up to 0.4m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. . . . . . . . . Figure 5.14: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY (left) and MSURK89 (right), for 160, 000 turns, with nonrelativistic (top) and relativistic (bottom) equations of motion. Particles were launched horizontally, with initial y offsets up to 0.4m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. . . . . . . . . Figure 5.15: Orbit of a particle launched counter-clockwise at polar angle fi = 0 with initial beamline coordinates (xi , ai ) = (0.3, 0) through an electrostatic spherical deflector (blue). The reference  orbit  (red) has the radius r0 = 1 m. The plot illustrates the basis vectors ~ie ,~i p of the heliocentric coordinate system in relation to the orbit geometry. The plot was generated by the Mathematica notebook for integration of the ODEs for individual orbits in the polar laboratory coordinate system listed in App. H.2. . . . . . . . . . . . . . . . Figure 5.16: The Metodiev variant of the Proton EDM LSCT lattice. The lattice comprises 16 sections. Each section contains an electrostatic cylindrical deflector, denoted by the continuous wide lines. Geometrical parameters: R1 = 39.985 m, R2 = 40.015 m, α = π/8 − 2θ , and L = 2 m. . . . . . . . . . . . . . . . . . Figure 5.17: The subsystem of two adjacent electrostatic cylindrical deflectors in the Proton EDM LSCT lattice. The subsystem is bounded by the central cross sections of the deflectors. Geometrical parameters: R1 = 39.985 m, R2 = 40.015 m, α = π/8 − 2θ , and L = 2 m. . . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.18: Electrostatic potential ϕ of the two-deflector subsystem, shown in Fig. 5.17. The electrostatic potential is scaled to ±1 at the plates. The x–z coordinate system is the same as in Fig. 5.17. . . . . . . . . . . . . . . . . . . . . . . Figure 5.19: A particle launched with initial offset xi = 7.43682 × 10−4 m and momentum direction angle θx = 5.67880 × 10−4 rad through 16 sectors (16 one-sector turns, or one full turn) of the Proton EDM LSCT lattice. The s coordinate is the distance along the path ABCDEF, and x is the horizontal local transversal coordinate. The two vertical gridlines indicate element edges between the arcshaped drifts and the straight drift (approximately, the electrostatic cylindrical deflector edges). The asymmetry of the x minima may be explained by the formal use of arc-shaped drifts in the lattice model, whereas particles in drifts actually have straight-line trajectories. . . . . . . . . . . . . . . . . . . . . xxi . . 169 . . 170 . . 171 . . 175 . . 188 . . 194 . . 195 . . 195 Figure 5.20: Values of the objective function ε = OBJ (w, z) from eq. 5.34 encountered in the particle tracking shown in Fig. 5.19. The s coordinate is the distance along the path ABCDEF. The objective function ε values are indicative of the electrostatic potential calculation accuracy. . . . . . . . . . . . . . . . . . . Figure 5.21: Blue color denotes the horizontal transversal component Ex of the electrostatic field of two adjacent electrostatic cylindrical deflectors along the path BCDE. The abscissa s/D is the distance s along the path ABCDEF, scaled by the distance D between the plates, and with the origin at point B (a deflector edge). The dashed-red curve is a reflection of the solid-blue curve relative to the midpoint between the deflectors at s/D ≈ 34.7, demonstrating that the field satisfies the reflection symmetry. . . . . . . . . . . . . . . . . . . . . . . . Figure 5.22: Fringe field of one electrostatic cylindrical deflector. The red vertical gridline at sEFB /D = 0.920939 denotes the EFB20 . The electrostatic field Ex is scaled to 1 well inside the deflector. The abscissa s/D is the distance s along the path ABCDEF, scaled by the full aperture d, and with the origin at point B (the deflector edge). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.23: Fringe field falloffs of (1) the electrostatic cylindrical deflector and (2) a semiinfinite capacitor with infinitely thin plates. The electrostatic fields Ex (s) are scaled to 1 well inside the deflectors. The falloffs are horizontally offset by the EFB20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 5.24: Proton EDM LSCT lattice: the x–a projections of particles tracked in COSY INFINITY, for 16, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 7 m. . . . . . . . . . Figure 6.1: The separatrix (blue) of the Senichev BNL FS lattice (introduced in sec. 6.3) with the RF cavity voltage V = 100 kV, the RF cavity harmonic number h = 5, and fringe field calculations off. Particles are launched with initial l offsets up to 12.45 m and tracked in the l–δK plane. Particles within the separatrix (black) have ellipsoidal orbits centered at (l, δK ) = (0, 0), whereas the five particles outside the separatrix (green), by translational symmetry in l, should have elliptic dynamics centered at approximately (l, δK ) = (17 m, 0). However, these five particles appear to have unstable motion because of the decreasing accuracy of a DA representation excessively far from the reference orbit. The blue separatrix graph was obtained by tracking a particle very near the separatrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 6.2: The Senichev BNL FS lattice layout, a plot of its beta and dispersion functions, and a diagram of the BNL E+B bending element used in its bending sections. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) . . . . . . . . . . . . . . . . . Figure 6.3: The ratio k of spin tune νsE in the electrostatic field to spin tune νsB in the magnetic field as a function of kinetic energy K, from 75 MeV to 300 MeV, for the deuteron. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii . . 196 . . 198 . . 198 . . 199 . . 202 . . 210 . . 218 . . 220 Figure 6.4: The Senichev 6.3 QFS lattice layout, a plot of its beta and dispersion functions, and a diagram of the curved electrostatic deflector used in this lattice. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) . . . . . . . . . . . . . . . . . . . 222 Figure 6.5: The Senichev E+B QFS lattice layout, a plot of its beta and dispersion functions, and a diagram of the straight E+B Wien filter element used in this lattice. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) . . . . . . . . . . . . . . . . . . . 223 Figure 6.6: Objective function OBJ as a function of sextupole family strengths in the Senichev 6.3 QFS lattice. Each plot marker color corresponds to a sextupole family – SFP1, SFP2, SDP1, SDP2, SFN1, SDN1, or SDN2 – and the widerange (‘a’) or a narrow-range (‘b’) set of sextupole strengths, as specified within the plot legend codes. Tracking was performed for 2.5 × 104 turns with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Figure 6.7: Spin vector’s polar angle θ after 2.5 × 104 turns as a function of the initial x offset of the tracked particle, after manual and automatic spin decoherence optimization by a sextupole family strength in the Senichev 6.3 QFS lattice. Each solid curve color corresponds to a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as specified within the plot legend codes. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = 5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. The curves appear to be bounded by two symmetric lines (dashed red). . . . . . . . 228 Figure 6.8: Objective function OBJ as a function of sextupole family strengths in the Senichev 6.3 QFS lattice, in the neighborhoods of the respective optimal sextupole family strengths obtained in the automatic optimization. The absolute 00 value ∆B = 0 of sextupole family strength offset corresponds to its optimal value. Each plot marker color corresponds to a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as specified within the plot legend codes. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV.229 xxiii Figure 6.9: Horizontal spin decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev BNL FS lattice, up to 4.2×105 turns. The spin decoherence remains approximately in the same range below 7 × 10−4 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP or SDP – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 3.5 MHz, and RF cavity voltage V = 100 kV.230 Figure 6.10: Horizontal decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev 6.3 QFS lattice, up to 4.2×105 turns. For three of the sextupole families, the spin decoherence remains approximately in the same range below 2 × 10−3 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. . . . . . . . . . . . . . . . . 231 Figure 6.11: Horizontal decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev E+B QFS lattice, up to 4.2 × 105 turns. The spin decoherence remains approximately in the same range below 1.5 × 10−3 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP, SDP, SFN, or SDN – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.9 MHz, and RF cavity voltage V = 100 kV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Figure 6.12: In this example, the RMS of the spin polar angles Θ of the particle bunch (subfigure b) spikes when the azimuthal angle φref of the reference particle’s spin (sub-figure a) passes through the poles φref = ±π/2. Particles were launched through the Senichev E+B lattice with initial x offsets up to xi = ±5 × 10−3 m. 1x corrective spin kicks were used. Tracking was performed in the CCW direction, with a Bx magnetic error field component, in fringe field mode FR 3, with the RF cavity on. The RF cavity frequency was ν = 4.9 MHz, and the RF cavity voltage was V = 100 kV. The horizontal spin decoherence objective function OBJ was pre-optimized by the SDP sextupole family strength. . . . . . 241 xxiv Figure 6.13: RMS of the vertical spin decoherence as a function of the number N of tracked turns in the Senichev BNL and E+B lattices, up to 4.2 × 105 turns. No corrective spin kicks were used. The vertical spin decoherence remains in approximately in the same range during the tracking for the CCW lattice traversal and grows below the respective upper bound for the CW lattices. For the CW direction, tracking with a Bx and Bz magnetic error field component is denoted by blue and green curve colors, respectively. For the CCW direction, tracking with a Bx and Bz magnetic error field component is denoted by orange and red curve colors, respectively. Particles were launched with initial x offsets up to xi = ±5 × 10−3 m. Tracking was performed with the RF cavity on, with the spin decoherence function OBJ pre-optimized by the SDP sextupole family strength, and in fringe field mode FR 3. The RF cavity harmonic number was h = 5, and the RF cavity voltage was V = 100 kV. . . . . . . . . . . . . . . . . 243 Figure 6.14: RMS of the vertical spin decoherence as a function of the number N of tracked turns in the Senichev BNL and E+B lattices, up to 4.2 × 105 turns. 1x corrective spin kicks were used. The vertical spin decoherence remains in approximately the same range. For the CW direction, tracking with a Bx and Bz magnetic error field component is denoted by blue and green curve colors, respectively. For the CCW direction, tracking with a Bx and Bz magnetic error field component is denoted by orange and red curve colors, respectively. Particles were launched with initial x offsets up to xi = ±5×10−3 m. Tracking was performed with the RF cavity on, with the spin decoherence function OBJ pre-optimized by the SDP sextupole family strength, and in fringe field mode FR 3. The RF cavity harmonic number was h = 5, and the RF cavity voltage was V = 100 kV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 xxv KEY TO ABBREVIATIONS BEM Boundary element method BNL Brookhaven National Laboratory C Charge CCW Counter-clockwise CKM Cabibbo–Kobayashi–Maskawa CL Confidence level CMBR Cosmic microwave background radiation CP Charge and parity CPU Central processing unit CRDT Cross ratios of the Delaunay triangulation CW Clockwise DA Differential algebra DFT Discrete Fourier transform EDM Electric dipole moment EFB Effective field boundary FDAFD Finite difference approximation of the first derivative FEM Finite element method FFT Fast Fourier transform FNAL Fermi National Accelerator Laboratory FOM Figure of merit JEDI Jülich Electric Dipole Moment Investigations JPL Jet Propulsion Laboratory LCS Laboratory coordinate system LSCT Long spin coherence time MDM Magnetic dipole moment xxvi MIT Massachusetts Institute of Technology MSU Michigan State University NSM Non-symmetric model ODE Ordinary differential equation QCD Quantum chromodynamics QED Quantum electrodynamics RF Radio frequency RMS Root mean square RWTH Rheinisch-Westfälische Technische Hochschule SC Schwarz–Christoffel SCT Spin coherence time SI International System of Units SM Standard Model (of particle physics) SM Symmetric model STEP Standard for the exchange of product model data SUSY Supersymmetry Thomas–BMT Thomas–Bargmann–Michel–Telegdi xxvii CHAPTER 1 INTRODUCTION Particle accelerators are machines that use electromagnetic fields to accelerate atomic or subatomic particles to high energies. The applications of particle accelerators include experiments to research fundamental forces and matter, as well as mass spectrometry, isotope production, and medical diagnostics. Because of the similarity between optics in optical systems and particle beam dynamics in particle accelerators, and for historical reasons, particle beam dynamics are also called particle beam optics. In high energy physics, after the acceleration of particle bunches, it is often desirable to store them or to observe their dynamics for a period of time in a specific system or regime. This is achieved by storage rings, which are characterized by cyclic motion through a closed system of particle optical elements, often at a constant particle energy. The first particle accelerators, such as the Van de Graaf accelerator and the Cockroft–Walton generator, were electrostatic machines [101]. There were a few electrostatic storage rings such as DESIREE in Stockholm [39] and, most notably, the 1954 Brookhaven Electrostatic AGS Analog Ring [85, 107]. However, electrostatic storage rings pose multiple challenges. Unlike motion in the magnetic field, where particle energy remains constant, particle energy generally changes in electrostatic elements. Conservation of energy in an electrostatic element is, in practice, only approximate, and it requires careful and accurate design, manufacturing, installation, and operational use. Moreover, electrostatic deflectors require relatively high electrostatic fields, tend to introduce nonlinear aberrations of all orders, and are more challenging to manufacture than homogeneous magnetic dipoles. Accordingly, magnetic storage rings are overwhelmingly prevalent. 1 1.1 Electric Dipole Moment An electric dipole is a system characterized by centers of equal and opposite total charges ±q separated by a very short distance d. The electric dipole moment (EDM) of two point-like charges is defined as p = qd. A uniform electrostatic field E acts on an electric dipole of the EDM p with torque τ = p × E. For a charge distribution ρ (r) in a volume V , the EDM is ˆ p (r) = V ρ (r0 ) (r0 − r) d 3 r0 , where r is the point of observation. ´ If the net charge Q in the volume V is zero, that is, Q = V ρ (r0 ) d 3 r0 = 0, then the EDM p (r) does not depend on the point of observation r. For charged particles, the net charge Q is not zero, and the EDM definition is specialized by setting the point of observation r as the center of mass of the particle [88]. EDMs of fundamental particles were not experimentally observed so far. However, one of the principal challenges in the Standard Model (SM) is baryon asymmetry, that is, the abundance of matter observed in the universe, in contrast to almost no antimatter. The baryon asymmetry  is quantified by the baryon asymmetry parameter η = nB − nB̄ /nγ ' 5 × 10−10 , where nB , nB̄ , and nγ are baryon, antibaryon, and photon number densities in the cosmic microwave background radiation (CMBR), respectively [49, 25]. If the baryon asymmetry existed as an initial condition at the beginning of the Big Bang, it would be eliminated by dilution during the inflationary period [25, 50]. The Sakharov conditions, proposed by Andrei Sakharov in his seminal 1967 article [92], represent a dynamic mechanism for baryon asymmetry generation, called baryogenesis, that does not require baryon asymmetry as an initial condition. The Sakharov conditions are as follows: (1) baryon number B violation, (2) C and CP violation, and (3) departure from thermal equilibrium [103, 92]. A nonzero EDM in a fundamental particle would result in both C and CP violation [88], which would support the Sakharov conditions as the reason for the baryon asymmetry. 2 The order of a neutron EDM due to C and CP violations is estimated as |dn | ' 10−23 e · cm [5, p. 107]. The SM predicts, due to the CP-violating phase δ in the CKM matrix, |dn | ' 10−31 e · cm [5, p. 112][74]. This suggests a target search region for a beyond-SM neutron EDM [89] as 10−31 e · cm > |dn | > 10−23 e · cm. This region applies to nucleon EDMs in general because of their order-wise approximate equivalency, as dimensional analysis and SUSY considerations show [3, pp. 7–9]. It is desirable to search for intrinsic EDMs of multiple particles in order to apply complementary methods over a broad search domain and to determine the source of CP violation from EDMs of multiple particles [89] (e.g., the CP-violating phase δ in the CKM matrix, the CP-violating parameter θ̄ of QCD, spontaneous CP violation in the Higgs field interaction [5, pp. 108–116][3, pp. 7–9]). So far, the search for intrinsic particle EDMs has narrowed the EDM limits, for example, to |de | < 1.85 × 10−27 e · cm for electrons (at 95.8% confidence level (CL); indirect measurement using the YbF molecules) [59, p. 29], |dn | < 3.6 × 10−26 e · cm for neutrons (at 95% CL) [84, p. 21], and d p < 7.9 × 10−25 e · cm for protons (including 30% theoretical uncertainty; based on measurement of 199 80 Hg EDM at 95% CL) [44, p.101601-4], but an EDM signal is yet to be discovered. Experiments continue with increasing measurement precisions, and an expansion of the search domain to include deuterons is envisioned. The idea of using storage rings for the search of charged hadron EDMs is an alternative with the potential of higher sensitivity than current state-of-the-art methods, including ultracold neutron, paramagnetic atom, and diamagnetic atom EDM experiments [5, 40]. In 2008, BNL’s Storage Ring EDM collaboration had proposed the frozen spin (FS) concept [2] for measurement of the deuteron EDM, illustrated in Fig. 1.1. The FS concept envisions launching deuterons through a storage ring with combined radial electrostatic and vertical magnetic fields. The electrostatic (E) and magnetic (B) fields are in a proportion that would, without an EDM, freeze the deuteron’s spin1 along its momentum as the deuteron moves around the lattice. The radial 1 Spin is the intrinsic angular momentum of a particle, as opposed to orbital angular momentum. 3 S SxzP Figure 1.1: In the FS lattice concept, the projection sxz of the deuteron’s spin s on the midplane x–z is aligned with the deuteron’s momentum p. An deuteron EDM would cause the azimuthal angle α to slowly grow from the initial α = 0 to a measurable value. electrostatic field would result in a torque on the spin vector, proportional to a deuteron EDM, rotating the spin vector out of the midplane. Measurement of the proton EDM using the FS method had been proposed by the Storage Ring EDM collaboration in 2011 [3]. The Jülich Electric Dipole moment Investigations (JEDI) collaboration, based at the Institute of Nuclear Physics at Forschungszentrum Jülich, is considering the FS method for design of a deuteron EDM storage ring, as well as its modification called the quasi-frozen spin (QFS) method [65, 98]. We will introduce the QFS method in sec. 6.3.2.1. 1.2 Anomalous Magnetic Dipole Moment The magnetic dipole moment (MDM) µ is defined by the relation τ = µ × B, where τ is the torque exerted on an object, such as a magnet, by an external magnetic field B. e s, where The spin MDM of a lepton (an electron e− , a muon µ − , or a tau τ − ) is µ = g 2m the lepton spin is s = 1/2, m is the lepton mass, e is the elementary charge, and g is the g-factor (gyromagnetic ratio) of the lepton. The Dirac equation predicts the g-factor as 2 for leptons, and the quantity a = (g − 2) /2, arising from quantum effects, is known as anomalous MDM (or MDM anomaly). 4 The SM-framework prediction for the muon anomalous MDM consists of three parts [52, 14]: QED Had aSM + aEW µ = aµ µ + aµ , where QED, EW, and Had denote the QED, electroweak, and hardronic contributions, respectively. The muon anomalous MDM is predicted by the SM as [14, 23, 48]    116591802 (49) × 10−11 in [23, p. 10], SM aµ =   116591828 (49) × 10−11 in [48, p. 21]. It is desirable to experimentally validate the SM prediction of the muon anomalous MDM. The Muon g-2 Experiment E821 at BNL [53], completed in 2001, measured the muon anomalous MDM as [14, p. 8][43, p. 46] aE821 = 116592089 (63) × 10−11 , µ with an experimental precision of 0.54 ppm – a significant improvement over previous muon anomalous MDM measurements (see, e.g., [19, 21, 20, 35]). The resulting discrepancy between the experimental and theoretical values was [14, 23, 48]    287 (80) × 10−11 [23, p. 10], E821 SM ∆aµ = aµ − aµ = (1.1)   −11 261 (80) × 10 [48, p. 22]. These results represent 3.6σ and 3.3σ disagreements between experiment and theory, respectively, and are not at the discovery threshold of 5σ . In 2010, the new Muon g-2 Experiment E989 [17, 43], now at FNAL, was proposed to measure the muon anomalous MDM, using the same measurement principle, to 0.14 ppm experimental precision. That should exceed the 5σ discovery threshold, assuming the discrepancy between experiment and theory remains similar to the discrepancy in eq. 1.1. The principle of anomalous MDM measurement, shared by the E821 and E989 Experiments, requires injecting muons into a magnetic ring at the magic momentum p = 3.09 GeV/c, corresponding to γ = 29.3 [53, p. 9][43, p. 73]. The magic momentum, as defined in this context, would 5 P Ss S Figure 1.2: In the E821 and E989 lattice concepts, the polar angle α between the muon’s spin vector s and momentum p is initially at α = 0. A nonzero muon anomalous MDM aµ causes α to slowly grow to a measurable value. freeze the muon’s spin vector along its momentum if aµ was zero. Thus, the spin precession in the horizontal plane relative to the momentum is proportional to aµ . This lattice concept is illustrated in Fig. 1.2. 1.3 Thomas–BMT Equation The Thomas–BMT equation describes the dynamics of spin vector s in magnetic field B and electrostatic field E, and it is generalized to account for the EDM effects as follows [79, 37]: ds = s × (ΩMDM + ΩEDM ) , dt where the MDM and EDM angular frequencies ΩMDM and ΩEDM are     q 1 E ×β ΩMDM = GB − G − 2 , m c γ −1   qη E ΩEDM = +β ×B , m2 c 6 where m, q, G are the particle mass, electric charge, and anomalous MDM, respectively; β is the ratio of particle velocity to the speed of light; and γ is the Lorentz factor. The EDM factor η is q defined by d = η 2mc s, where d is the particle EDM and s is the particle spin. The magic momentum, utilized in the anomalous MDM and the proton EDM storage ring concepts, is a momentum that causes the coefficient of the β × E term in the Thomas–BMT equation p to vanish. The magic momentum corresponds to the Lorentz factor γ = (1 + G) /G. As the deuteron has negative anomalous MDM, the magic momentum concept is not applicable. Accordingly, the deuteron EDM storage ring concept uses combined E + B fields in such proportion that the entire ΩMDM term vanishes. This is achieved by a radial electrostatic field [2, p. 10] E= BcGβ γ 2 ≈ BcGβ γ 2 , 2 2 1 − Gβ γ where B is the vertical magnetic field and G is the deuteron’s anomalous MDM. 1.4 Lattice Tracking Requirements Lattice simulation and tracking is an essential part of lattice concept feasibility studies, design, and post-commissioning operation. To validate the feasibility of a lattice for EDM or anomalous MDM, it is necessary to perform spin coherence time (SCT) and systematic errors analysis studies, as well as to simulate measurement of an EDM or an anomalous MDM signal. EDM and anomalous MDM storage rings are highprecision measurement devices and, accordingly, require highly accurate orbital and spin tracking. A broadly manifesting challenge of EDM and anomalous MDM storage rings is that they require the magic momentum or a γ-dependent proportion of E and B fields; however, generally, electrostatic fields affect particle energy. Symplecticity (see Ch. 4 or [4, 41]) is a fundamental property of Hamiltonian mechanics and results, among other things, in the conservation of phase space volume by Liouville’s theorem. For some time, there was a general notion that numerical tracking of nonintegrable systems cannot simultaneously preserve energy and symplecticity [117]. Practically all storage rings are magnetic, and tracking codes tend to have specialized control mechanisms for symplecticity of motion but not energy conservation [11, pp. 292–295]. 7 Furthermore, for accurate tracking of storage rings with electrostatic particle optical elements, it is necessary to accurately model fringe fields of electrostatic particle optical elements. However, the previous research on fringe fields tended to focus on magnetic (e.g., [82, 83, 112]) rather than electrostatic particle optical elements (e.g., the 2016 article [73]), and previous results on fringe field models of electrostatic particle optical elements are limited. 1.5 Beamline Coordinate System Particle beam lattices, such as accelerators and storage rings, are typically designed with an ideal particle trajectory called the reference orbit. In storage rings, the beam transport is periodic, and the reference orbit is closed. Beamline coordinate systems use the distance s along the reference orbit (the arc length) as a natural parametrization of motion. Let r (s) be the coordinate vector of a particle in a global Cartesian coordinate system as a function of s, and let the index 0 refer to the reference particle. Each point s on the reference orbit is the origin of a local orthonormal basis. The Frenet–Serret frame is used as the local orthonormal basis. The Frenet–Serret frame comprises tangent ez , normal ex , and binormal ey unit basis vectors [11, pp. 168–190][105, pp. 15–18] r0 (s) ez (s) = 00 , r0 (s) e0 (s) ex (s) = z0 , ez (s) ey (s) = ez (s) × ex (s) . The Frenet–Serret unit vectors ex , ey , and ez are related to the reference orbit curvature κ and torsion τ by the Frenet–Serret formulas e0x (s) = −κ (s) ex (s) + τ (s) ez (s) , e0y (s) = −τ (s) ex (s) , e0z (s) = κ (s) ey (s) . 8 We will primarily perform beam physics computations in COSY INFINITY [68]. Accordingly, we will use COSY INFINITY’s beamline coordinate system with phase space coordinates [12, p. 9] r1 = x, r2 = a = px /p0 , r3 = y, r4 = b = py /p0 , γ r5 = l = − (t − t0 ) v0 1+γ , r6 = δK = K−K0 K . Coordinates x and y are the transversal Frenet–Serret position coordinates in meters, p is the momentum, K is the kinetic energy, v is the velocity, t is the time of flight, and γ is the Lorentz factor. The index 0 refers to the reference particle. The six phase space coordinates form three canonically conjugate pairs (x, a), (y, b), and (l, δK ). In some instances, we will use a global Cartesian coordinate system (x, y, z) based on the local Frenet–Serret coordinate system (x (s) , y (s) , z (s)) at a fixed point s. This is mostly useful for individual particle optical elements with a straight reference orbit. In that case, the s defining the coordinate system, and its origin, are typically at the physical exit edge or the exit effective field boundary (EFB) of the element. 1.6 Thesis Outline First, we will address the issue of accurate description of main and fringe fields of particle optical elements used in spin lattices. In Chapter 2, we will calculate the fringe fields of several semi-infinite electrostatic deflectors using conformal mapping methods, compare the results with the fringe fields of several finite rectangular electrostatic deflectors obtained using a boundary element method (BEM) field solver, and propose a function to model field falloffs of electrostatic deflectors. In Chapter 3, we will use conformal mapping methods to obtain the main field of the Muon g-2 storage ring high voltage quadrupole, and we will calculate its fringe field and EFB using Fourier analysis. Next, we will study tracking of storage rings with electrostatic elements using map methods. In Chapter 4, we will review symplecticity and symplectification methods, discuss the feasibility of simultaneous symplectification and energy correction, and conclude that it is only necessary to 9 enforce symplecticity in COSY INFINITY, as energy conservation was foundational in the tracking code design. In Chapter 5, we will model and track several benchmark lattices – an electrostatic spherical deflector, a homogeneous magnetic dipole, and a Proton EDM lattice – in COSY INFINITY and MSURK89, our in-house 8th order Runge–Kutta–Verner tracking code. Finally, we will investigate spin decoherence and systematic errors in FS and quasi-frozen spin (QFS) lattices in Chapter 6. We will find that the spin decoherence effects are similar in FS and QFS lattices, and spin decoherence often remains in the same range over time, indicating the possible feasibility of EDM measurement using FS and QFS lattices. 10 CHAPTER 2 FRINGE FIELDS OF ELECTROSTATIC DEFLECTORS 2.1 Introduction The electrostatic deflector is a core particle optical element type in a lattice for EDM measurement. Electrostatic deflectors used in beam physics generally comprise two plates of different voltages V1 and V2 . In the approximation of an electrostatic deflector as a capacitor with parallel flat plates and the reference orbit with zero curvature, nominally, plate voltages have the same magnitude but opposite signs: V1 = V and V2 = −V . The distance D between the plates – the full aperture – is usually small compared to plate widths and lengths and the deflector’s radius R of curvature. This leads to the idea that fringe fields of realistic electrostatic deflectors can be effectively modeled by fringe fields of semi-infinite capacitors. We studied the fringe fields of semi-infinite electrostatic capacitors. In many cases, a semiinfinite electrostatic capacitor can be modeled by a generalized polygon with two vertices at the infinity separating two groups of sides characterized by two different constant voltages. The electrostatic field of this capacitor may then be obtained by finding a conformal mapping from a bi-infinite strip to this polygon. We compared the field falloffs obtained using conformal mapping methods for several semiinfinite electrostatic capacitors to the field falloffs of two finite electrostatic capacitors obtained using a BEM field solver. Field falloffs of semi-infinite electrostatic capacitors are slower than exponential. We think that this applies to electrostatic deflectors in general, as substantiated by the example of a finite cylindrical electrostatic deflector in Ch. 5. Thus, whereas Enge functions are useful for modeling falloffs of magnetic particle optical elements, they are not generally suitable for electrostatic 11 2 1 0 -1 -2 -2 -1 0 1 2 Figure 2.1: The polygonal model of the semi-infinite capacitor with infinitely thin plates. deflectors. We propose an alternative function to model field falloffs of electrostatic deflectors, and we demonstrate its use in the example of a semi-infinite electrostatic capacitor. 2.2 Semi-Infinite Capacitor with Uniform Charge Distribution The simplest model of a semi-infinite capacitor comprises infinitely thin semi-planes and assumes uniform charge distribution in the plates. We consider such a model with plates at horizontal offsets x = ±d and longitudinal coordinates z ≤ 0, shown in Fig. 2.1. The z axis is a reference orbit in the approximation of no fringe fields and the radius-of-curvature limit of R → +∞. The full aperture is D = 2d. Without limiting the generality, we set the surface charge densities as σ = 1 for the x = d plate and σ = −1 for the x = −d plate. The electrostatic potential ϕ (x, y, z) between the plates can be obtained as the sum of integrals of the Coulomb potential over the two plates ˆ +∞ ϕ (x, y, z) = −∞ ˆ 0 dt1 −∞ dt2 |σ | j q . j=±1 (x − jd)2 + t 2 + (z − t2 )2 1 ∑ Performing integration over t1 within eq. 2.1, we have 12 (2.1) ˆ +∞ |σ | j q = 2 2 2 −∞ j=±1 (x − jd) + t + (z − t2 ) 1 q   t1 + (x − jd)2 + t12 + (z − t2 )2 = q = lim ∑ j ln  t1 →+∞ 2 j=±1 −t1 + (x − jd)2 + t1 + (z − t2 )2  q  q  2 2 2 2 ξ + t1 + 4dx − t1 ξ + t1 + t1   = lim ln  q  q  = t1 →+∞ 2 2 2 2 ξ + t1 + 4dx + t1 ξ + t1 − t1  q   q 2 2 2 2 ξ + t1 + 4dx − ξ + t1 2t1   = lim ln 1 + q  q  = t1 →+∞ ξ 2 + t12 + 4dx + t1 ξ 2 + t12 − t1      1   2 2dx   t1 + O t 3   ! 1 = lim ln 1 + s =    t1 →+∞  2 2 ξ ξ +4dx   +1+1 +O 1 dt1 ∑ 2t1 t12  = ln 1 + (2.2) t13  4dx , (x − d)2 + (z − t2 )2 assuming x 6= d or t2 6= z, and where we denoted ξ 2 = (x − d)2 + (z − t2 )2 . Let   f (x, z) = (t2 − z) ln 1 + 4dx 2 (x − d) + (z − t2 )2 0 . Evaluating the right-hand side in eq. 2.3, we obtain   4dx f (x, z) = −z ln 1 + = (x − d)2 + (z − t2 )2 # " (x − d)2 + (z − t2 )2 = = z ln (d + x)2 + (z − t2 )2   4dx = z ln 1 − . (d + x)2 + (z − t2 )2 13 (2.3) t2 =−∞ (2.4) Considering eqns. 2.2, 2.3, and 2.4, we complete the integration in eq. 2.1: ˆ +∞ ˆ 0 |σ | j q = −∞ −∞ j=±1 (x − jd)2 + t 2 + (z − t2 )2 1   ˆ 0 4dx = = dt2 ln 1 + 2 (x − d) + (z − t2 )2 −∞ ˆ 0 (t2 − z)2 8dx = f (x, z) + dt2   = 4dx 2 + (z − t )2 2 1+ −∞ (x − d) 2 (x−d)2 +(z−t2 )2 ˆ 0 8dx (t2 − z)2  = = f (x, z) + dt2  (x − d)2 + (z − t2 )2 (x + d)2 + (z − t2 )2 −∞ # " ˆ 0 2 (d + x)2 2 (d − x)2 + = = f (x, z) + dt2 − (d − x)2 + (t2 − z)2 (d + x)2 + (t2 − z)2 −∞      t2 − z t2 − z 0 −1 −1 = f (x, z) + 2 (x − d) tan + 2 (d + x) tan = d −x d + x t =−∞   2  z z + 2 (d + x) tan−1 − + 2πx = = f (x, z) + 2 (x − d) tan−1 − d −x d +x     d −x d +x −1 −1 = f (x, z) + 2 (x − d) tan + 2 (d + x) tan + 4πx [z < 0] z z ϕ (x, y, z) = dt1 dt2 ∑ for −d < x < d and z 6= 0, where the Iverson bracket was used, defined as [42, p. 24] [P] = 1 if P is true and [P] = 0 if P is false. Thus, we have  ϕ (x, y, z) = z ln 1 −    4dx d −x −1 + + 2(x − d) tan z (d + x)2 + z2   d +x −1 + 2(d + x) tan + 4πx [z < 0] z for z 6= 0. The singularity of the electrostatic potential ϕ and its derivatives at z = 0 is removable and has no physical meaning. We remove the singularity to make ϕ continuous and infinitely differentiable at z = 0. We obtain the x component Ex (0, y, z) of the electrostatic field in the midplane x = 0 from the 14 electrostatic potential as ∂ ϕ (x, y, z) |x=0 = ∂x " ! −1 4dx 8dxw (d + x) 4dw 1− = − lim − 2 − w→z (d + x)2 + w2 (d + x)2 + w2 (d + x)2 + w2     2w (x − d) 2w (d + x) d −x d +x −1 −1 − + 2 tan + + 2 tan + w w w2 + (d − x)2 w2 + (d + x)2 Ex (0, y, z) = − +4π [w < 0]]x=0 =     −4 cot−1 ( dz ) − 4π     = −4 cot−1 ( z ) d       −2π , z < 0, , z > 0, , z = 0. Normalizing the electrostatic field to Ex (0, y, −∞) = 1 (i.e., limz→−∞ Ex (0, y, z) = 1) and considering the translational symmetry in the y direction, we obtain    1 −1 z   π cot ( d ) + 1 , z < 0,    Ex (z) = Ex (0, y, z) = 1 cot−1 ( z ) , z > 0, π d       1/2 , z = 0, Fig. 2.2 shows the falloff of the electrostatic field Ex (z). The electrostatic field satisfies the condition Ex (z) + Ex (−z) = 1. This is due to the assumption that the surface charge densities are uniform. As a result of this assumption, the surface charge densities ±σ in the plates are symmetric to the zero surface charge density in their complementary semi-planes at x = ±d and z > 0. More generally, the equality Ex (z) + Ex (−z) = const would hold for any charge density ρ (x, y, z) such that ρ (x, y, z) + ρ (x, y, −z) = const. 2.2.1 Taylor Enge Function Coefficients To approximate the falloff of the electrostatic field Ex (z) by an n-th order Enge function Fn (z) = 1  , j−1 1 + exp ∑n+1 a (z/D) j=1 j 15 Ex (z) 1 0.75 0.5 0.25 -10 z/D -5 0 5 10 Figure 2.2: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with uniform charge distribution. one may think of performing an n-th order Taylor expansion of the function f (z) defined by 1 = Ex (z) . 1 + exp f (z) The abscissa of an Enge function is always scaled by the full aperture D of the particle optical element that it represents. This is because electrostatic and magnetic fields scale with geometry. We had obtained the 5th order Taylor series expansion of  1 −1 f (z) = ln Ex (z)  in Mathematica as f (z) = 8z π D −   32 π 2 − 4  z 3 3π 3 D +   128 48 − 20π 2 + 3π 4  z 5 15π 5 D +O    z 6 D ,   resulting in Taylor Enge function coefficients a1 = 0, a2 = 8/π, a3 = 0, a4 = 32 4 − π 2 /3π 3 ,   a5 = 0, and a6 = 128 48 − 20π 2 + 3π 4 /15π 5 . For an odd function f (z), the Enge function satisfies the symmetry condition F (z) + F (−z) = 1. Indeed, assuming that f (−z) = − f (z), F (z) + F (−z) = 1 ⇔ 1 1 + =1⇔ 1 + exp f (z) 1 + exp f (−z) 16 Figure 2.3: 5th order Taylor Enge function F5 (z) (dashed red), based on the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. ⇔ 1 = exp ( f (z) + f (−z)) ⇔ ⇔ f (−z) = − f (z) . A plot of the Taylor Enge function F5 (z) in Fig. 2.3 demonstrates that, generally, finite-order Taylor expansions do not produce the best polynomial fit of the respective order. However, Taylor function coefficients may be used as the initial guess in a least-squares fit. One may be tempted to calculate Taylor Enge function coefficients of a higher order to obtain a better approximation. The following are the 16th order Taylor Enge function coefficients of Ex (z), computed as a differential algebra (DA) value of f (z/D) at z = 0 in COSY INFINITY: I COEFFICIENT ORDER EXPONENTS 1 2.546479089470326 1 1 0 0 0 0 0 2 −2.019239983477256 3 3 0 0 0 0 0 3 −.8881784197001252E−15 4 4 0 0 0 0 0 5 5 0 0 0 0 0 4 3.982947197900324 5 −.5329070518200751E−14 6 6 0 0 0 0 0 6 −10.10612663161852 7 7 0 0 0 0 0 17 7 8 9 −.3552713678800501E−14 28.89989597659871 −.1278976924368180E−11 8 8 0 0 0 0 0 9 9 0 0 0 0 0 10 10 0 0 0 0 0 10 −88.63211876076747 11 11 0 0 0 0 0 11 0 . 1 0 5 1 6 0 3 2 4 8 9 2 4 9 4 8 E−11 12 12 0 0 0 0 0 13 13 0 0 0 0 0 12 284.5981022831754 13 −.3922195901395753E−11 14 14 0 0 0 0 0 14 −943.9943887193954 15 15 0 0 0 0 0 15 −.6893969839438796E−09 16 16 0 0 0 0 0 For comparison, the following is the 9th order Taylor series expansion of f (z), obtained by symbolic differentiation in Mathematica:   2 4 6 8 2048 80640 − 60480π + 19152π − 3272π + 315π  z 9 f (z) = − D 2835π 9   512 −2880 + 1680π 2 − 392π 4 + 45π 6  z 7 − + D 315π7      128 48 − 20π 2 + 3π 4  z 5 32 π 2 − 4  z 3 8  z  z 10 − + + O = + D D π D D 3π 3 15π 5 z  z 3  z 5 =2.546479089470325 − 2.019239983477256 + 3.982947197900328 − D D D     z 9  z 7 z 10 −10.10612663161852 + 28.89989597659899 +O . D D D The CPU times of Taylor Enge function coefficients calculations, up to the 63rd order, were 6.91 s and 0.0125 s in Mathematica and COSY INFINITY, respectively. As Fig. 2.4 illustrates, increasing the order of a Taylor Enge function tends to result in faster exponential convergence to the asymptotes, decreasing the Enge function approximation accuracy. Moreover, actual and apparent asymptotes alternate between the intended limz→−∞ F (z) = 1, limz→+∞ F (z) = 0 and the unintended limz→−∞ F (z) = 0, limz→+∞ F (z) = 1, depending on the leading polynomial terms of the Taylor expansion of f (z). 18 Ex (z) 1 0.75 0.5 0.25 -1.0 -0.5 z/D 0 0.5 1.0 Figure 2.4: 14th (dot-dashed green) and 16th (dashed red) Taylor Enge functions F14 (z) and F16 (z), based on the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. 2.2.2 Least-Squares Enge Function Coefficients We fitted a 5th order Enge function F5 (z) to the electrostatic field Ex (z) using the Levenberg–Marquardt Gauss–Newton method and the least-squares variance function in COSY INFINITY and Mathematica. The set a1 = 6.2118 × 10−17 , a2 = 1.87847, a3 = 3.35814 × 10−17 , a4 = −0.136631, a5 = 1.09036 × 10−18 , and a6 = 0.00406222, obtained in Mathematica, is a representative example. The odd Enge function coefficients were practically zero, which agrees with the symmetry condition F5 (z) + F5 (−z) = 1. Although the least-squares fits resulted in improvements over the 5th order Taylor Enge function coefficients, the representation accuracy was still not satisfactory, as Fig. 2.5 illustrates. This is because the electrostatic field falloff is slower than exponential. We concluded that although Enge functions often accurately represent field falloffs, it is not the case for the semi-infinite capacitor with infinitely thin plates and uniform charge distribution. As we will show later, Enge functions are not good representations of electrostatic deflector field 19 Figure 2.5: Least-squares Enge function F5 (z) (dashed red), fitted to the electrostatic field falloff Ex (z) (solid blue) of the semi-infinite capacitor with uniform charge distribution. falloffs in general. In this uniform charge distribution case, the field falloff Ex (z) has a quite simple symbolic form. This is the next best thing in the absence of an accurate Enge function representation. Moreover, one may attempt to model hypothetical field falloffs of similar visual appearance that satisfy Ex (z) + Ex (−z) = 1, but do not have a known symbolic form, by a function such as    1 cot−1 ( n−1 a z 2 j+1 ) + 1 , z < 0,  ∑ j=0 j D  π     Fn (z) = 1 cot−1 (∑n−1 a j z 2 j+1 ) , z > 0, π D j=0       1/2 , z = 0. 2.2.3 Asymptotic Field Falloff Behavior A Taylor series expansion of the electrostatic field along the z axis Ex (z) at point z = +∞, performed in Mathematica, yields 1 1 1 Ex (z) = − + +O 3 2π (z/D) 24π (z/D) 160π (z/D)5 20 " 7 # 1 . (z/D) However, 1. the electrostatic field of an electrostatic dipole, comprising two point-like charges at x = ±d, y = 0, and z = 0, falls off at (x, y, z) = (0, 0, +∞) as ∼ 1/z3 ; and 2. the electrostatic field of a capacitor, comprising two semi-infinite rods at x = ±d, y = 0, and z ≤ 0, falls off at (x, y, z) = (0, 0, +∞) as ∼ 1/z2 . To see that there is no contradiction, it is sufficient to note that the point-like charges electrostatic dipole consists of 0D elements, the semi-infinite rods capacitor consists of 1D elements, and, in our case, the semi-infinite plates capacitor comprises 2D elements. Consider an observation point (x, 0, z), where z > 0. In case of semi-infinite rods with linear charge densities λ = ±1, the electrostatic potential at point (x, 0, z) is ˆ 0 ϕ (x, 0, z) = dt −∞ λ q , 2 2 λ =±1 (x − λ d) + (z − t) ∑ whereas in case of semi-infinite plates the electrostatic potential at point (x, 0, z) is ˆ +∞ ϕ (x, 0, z) = −∞ ˆ 0 dt1 −∞ dt2 ∑ σ =±1 σ q . (x − σ d)2 + t12 + (z − t2 )2 The latter is equivalent to the one-dimensional integral   ˆ 0 σ  f (z,t) , ϕ (x, 0, z) = dt  ∑ q 2 2 −∞ σ =±1 (x − σ d) + (z − t) where  z f (z,t) = 2 (z + t) arccos t +z  is the length of the arcs of radius z + t, sweeping the upper and lower plates from center points (d, 0, z) and (−d, 0, z), respectively. This further illuminates why the asymptotic order of the electrostatic potential at (x, y, z) = (0, 0, +∞) is one order higher for the semi-infinite plates capacitor than for the semi-infinite rods capacitor. 21 4 4 2 2 0 f 0 -2 -2 -4 -4 -4 -2 0 2 -4 4 -2 0 2 4 Figure 2.6: The Schwarz–Christoffel map f from the bi-infinite strip −π ≤ ℑ (v) ≤ −π to the physical domain with semi-infinite infinitely thin plates at x = ±d, y ≤ 0. 2.3 Semi-Infinite Capacitor with Plates of Uniform Potential In the realistic case of plates with uniform electrostatic potentials, we expect the surface charge density in the semi-infinite capacitor’s plate to be higher near the edge. Indeed, if there were a uniform surface charge density at initial time z = 0, integration of the Coulomb electrostatic potentials would have lower total magnitude near the plate edge, which would result in charges rushing to the edge and in relaxation to an equilibrium with higher charge density near the edge. The relatively higher surface change density near the edges increases the magnitude of the electrostatic field Ex (z) near z = 0 compared to the uniform surface charge case, which also means that Ex (−z) increases in magnitude near z = 0. As a result, now we have Ex (z) + Ex (−z) ≥ 1 + a for some a > 0 in a neighborhood U (0) of z = 0. Due to the translational symmetry in the y direction, we can reduce the 3D problem to 2D. Conformal mapping methods, detailed in App. A, are often effective for computing the electrostatic potential for 2D representations of semi-infinite capacitors. 2.3.1 Infinitely Thin Plates We continue to study a semi-infinite capacitor with infinitely thin plates at x = ±d, y ≤ 0, with full aperture D = 2d, but now the plates are of uniform electrostatic potential instead of uniform charge distribution. 22 We utilize the Schwarz–Christoffel transformation f : C → C [54, pp. 103–111] z + ix = f (v) = d (1 + v + exp (v)) , π which transforms the real axis onto itself, the line v = πi to the plate at x = d, z ≤ 0, and the line v = −πi to the plate at x = −d, z ≤ 0. The transformation f is shown in Fig. 2.6. From the definition of f , we have v + exp (v) = −1 + π (z + ix) d and   π exp (v) exp (exp (v)) = exp −1 + (z + ix) . d Applying the Lambert W function defined as the solution of W (t) expW (t) = t, we obtain h  i π exp (v) = W exp −1 + (z + ix) d and, finally, v = f −1 (z + ix) = h  i π π = −1 + (z + ix) −W exp −1 + (z + ix) . d d If the voltages of the plates at x = d and x = −d are V = V0 and V = −V0 , respectively, then the electrostatic potential ϕ (v) at point v is ϕ (v) = V0 ℑ (v) /π. Without loss of generality, we set V0 = 1. Thus, we obtain the electrostatic potential as  1  −1 ϕ (x, z) = ℑ f (z + ix) = π  i x 1 h  π = − ℑ W exp −1 + (z + ix) . d π d (2.5) The branch κ (z) of the Lambert W function that produces the required range [−1, 1] of the electrostatic potential ϕ (x, z) is   1 π  1 . κ (z) = ℑ z − 2π d 2 23 The x component Ex (x, z) of the electrostatic field is then ∂ ϕ (x, z) = ∂x   1 1 W (exp (−1 + π (z + ix) /d)) = − ℜ . d d 1 +W (exp (−1 + π (z + ix) /d)) Ex (x, z) = − We normalize the electrostatic field to Ex (0, −∞) = 1. Then, along the z axis, the electrostatic field is   W (exp (−1 + πz/d)) Ex (z) = 1 − ℜ . 1 +W (exp (−1 + πz/d)) Unlike in the case of plates with uniform charge distribution, the electrostatic field falloff Ex (z) is asymmetric relative to point (z, x) = (0, 1/2). Accordingly, we offset the electrostatic field by the non-zero effective field boundary (EFB) zEFB /D = 0.920945. The EFB is computed as ˆ z ext 1 Ex (z) dz, zEFB = zint + Ex (zint ) zint (2.6) where zint and zext are points well inside and well outside the particle optical element, respectively. As a result, the area of the region defined by Ex (z) ≤ E ≤ 1, z ≤ zEFB is equal to the area of the region defined by 0 ≤ E ≤ Ex (z), z ≥ zEFB , with accuracy depending on zint and zext . We use zext /D = −5 and zext /D = 20, and we denote the EFB computed this way as EFB20 . Fig. 2.7 shows a plot of Ex (z) and its 5th order Enge function F5 (z) fitted using the Levenberg–Marquardt Gauss–Newton method and the least-squares variance function. We recognize that the Enge function is an accurate representation only up to about z/D = 4.5 due to the electrostatic field falloff being slower than exponential, and we will address this issue in sec. 2.6. 2.3.1.1 Charge Distribution in the Plates Consider the 2D representation of the upper infinitely thin plate as A = {(d,t) |t ∈ (−∞, 0]} at voltage V = 1. 24 Ex (z) 1.0 0.8 0.6 0.4 0.2 -5 z/D 0 5 10 15 Figure 2.7: Up to about z/D = 4.5, the least-squares Enge function F5 (z) (dashed red) is a good approximation of the electrostatic field falloff Ex (z) (solid blue) of a semi-infinite capacitor with infinitely thin plates. The curves are offset horizontally by the EFB20 zEFB /D = 0.920945 so that the EFB20 is at z = 0. The surface charge density σ (z) of the plate is proportional to the jump in the normal component Ex of the electrostatic field; specifically,    ε0 (Ex (d + 0, z) − Ex (d − 0, z)) in SI units, σ (z) =    1 (Ex (d + 0, z) − Ex (d − 0, z)) in Gaussian units, 4π where ε0 is the vacuum permittivity. Alternatively to obtaining σ (z) from the electrostatic field, we can obtain σ (z) by solving the Fredholm equation of the first type ˆ +∞ f (z) = σ (z) K (z,t) dt, (2.7) −∞ where 1. σ (z) is the surface charge distribution in the plate, with σ (z) = 0 for z > 0 (beyond the plate edge); 25 (z) 1.0 0.8 0.6 0.4 0.2 -4 -2 z/D 0 2 4 Figure 2.8: Electrostatic potential f (z) = ϕ (d, z) in plane of the upper plate. 2. f (z) is the electrostatic potential f (z) = ϕ (d, z) in the plane of the plate, with f (z) = 1 for z ≤ 0, shown in Fig. 2.8; 3. K (z,t) is the difference kernel K (z,t) = K (z − t) obtained from the Coulomb potential as   ˆ +∞ 1 1 q  dy, K (z,t) = −q 2 2 2 −∞ 2 2 (t − z) + y (2d) + (t − z) + y from which we obtain, similarly to eq. 2.2, " # 4d 2 K (z,t) = ln +1 . (t − z)2 From eq. 2.5, we have  1   f (z) = ϕ (d, z) = 1 − ℑ W −eπz/d−1 . π To check that eq. 2.7 indeed produces the solution for σ (z), it is sufficient to insert K (z,t) into the integral, which results in the Coulomb potential integral   ˆ 0 ˆ +∞ 1 1  dy dt f (z) = σ (z)  q −q −∞ −∞ (t − z)2 + y2 (2d)2 + (t − z)2 + y2 with integration over the two plates. 26 σ(z) -4 -2 0 2 4 z/D Figure 2.9: Surface charge distribution σ (z) in the upper plate, located at x = d, z ≤ 0. To solve this Fredholm equation of the first kind [86, sec. 10.3-1], we apply the Fourier transform to both sides of the equation, obtaining Fz (σ (z)) = Fz ( f (z)) . Fz (K (z)) Next, we take the inverse Fourier transform of the expression and obtain σ (z) = Fω−1 (Fz (σ (z))) (z) =   Fz ( f (z)) −1 = Fω (z) . Fz (K (z)) The resulting form of surface charge distribution σ (z) is shown in Fig. 2.9. 2.3.2 Solid Metal Plates We proceed to study electrostatic deflectors with solid metal plates. Using the Schwarz–Christoffel Toolbox (SC Toolbox) for MATLAB [28] (see App. A for details), we obtain derivatives of conformal maps for calculation of the electrostatic potential. We consider the cases of one capacitor and two adjacent capacitors. 27 2 1.5 1 0.5 0 -1 -0.5 0 0.5 1 Figure 2.10: The polygonal model of the semi-infinite capacitor with infinitely thick plates. 2.3.2.1 2.3.2.1.1 One Capacitor Infinitely Thick Plates Consider a solid metal semi-infinite capacitor with full aperture D = 2 and infinitely thick plates A = {(t0 ,t1 ,t2 ) |t0 ∈ [d, +∞) ∧ t1 ∈ (−∞, +∞) ∧ t2 ∈ (−∞, 0]} and B = {(t0 ,t1 ,t2 ) |t0 ∈ (−∞, −d] ∧ t1 ∈ (−∞, +∞) ∧ t2 ∈ (−∞, 0]} , at voltages V = 1 and V = −1, respectively. The geometry and the electrostatic potential are, up to the change of sign, reflection-symmetric relative the x = 0 plane. By this symmetry, the electrostatic potential at x = 0 is zero. This enables us to reduce the problem to its x ≥ 0 part. We represent the x ≥ 0 half of the electrostatic capacitor by a complex region bounded by (1) the real axis at zero potential and (2) the 2D representation of the upper plate A = {t + id|t ∈ (−∞, 0]} ∪ {it|t ∈ [d, +∞)} 28 at voltage V = 1, where d = 1. This polygonal model is shown in Fig. 2.10. We encode this polygonal physical domain in the SC Toolbox by its vertices w = z + ix = (i, ∞, 0, ∞, 2i) and interior angles απ = (3/2, 0, 1, −1/2, 1) π as p1 = p o l y g o n ( [ i , I n f , 0 , I n f , 2∗ i ] , [ 3 / 2 , 0 , 1 , −1/2 , 1 ] ) where vertices 0 and 2i were added as guiding points for the SC Toolbox’s algorithm. We obtain a conformal mapping f from the bi-infinite strip 0 ≤ ℑ (v) ≤ 1 using the command f 1 = s t r i p m a p ( p1 , [ 2 , 4 ] , o p t i o n s ) with the second and fourth prevertices +∞ and −∞ mapping to the infinite vertices of the polygon.  The resulting output lists prevertices v j = f −1 w j of the conformal mapping, corresponding to vertices w j and interior angles πα j of the polygonal model. stripmap object : vertex alpha prevertex −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− I n f + 0.00000 i −0.50000 −I n f 0.00000 + 2.00000 i 1.00000 0 . 0 0 0 0 0 0 0 0 0 0 0 0 e +00 0.00000 + 1.00000 i 1.50000 6 . 9 3 3 6 3 0 4 0 4 5 3 5 e −01 I n f + 0.00000 i 0.00000 Inf 0.00000 + 0.00000 i 1.00000 9 . 5 5 2 4 7 6 3 7 5 5 6 3 e −01 + i c = −1.7238602 − 1 . 7 2 3 8 6 0 2 i A p p a r e n t a c c u r a c y i s 2 . 4 8 e −16 The formula for a conformal mapping from the bi-infinite strip 0 ≤ ℑ (v) ≤ 1 is [30, p. 46] ˆv f (v) = f (v0 ) + c v0 i n h iα j −1 π exp (α− − α+ ) ζ ∏ sinh ζ −vj dζ , 2 2 j=1 hπ 29 2 1.5 1 0.5 0 -1 -0.5 0 0.5 1 Figure 2.11: The electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thick plates. where n = 3 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.6933630404535, 0.9552476375563 + i) are the finite prevertices; απ = (1, 1.5, 1) π are the respective interior angles of the polygon; and α− π = −0.5π, α+ π = 0 are the divergence angles at the ends of the bi-infinite strip. A prevertex v j can be used for the reference point v0 ; then f (v0 ) is the respective vertex w j . The scaling constant c = −2.4379064258967187 in this formula is different from scaling constant c in the SC Toolbox’s  output and can be obtained by matching prevertice images f v j to respective vertices w j . Fig. 2.11 shows the resulting electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thick plates. The x component Ex (z) of the electrostatic field along the z axis is shown in Fig. 2.12. The falloff Ex (z) is very slow, and the EFB as a function of an increasing zext does not appear to converge. The EFB20 is zEFB /D = 1.41566. 30 Ex (z) 1.0 0.8 0.6 0.4 0.2 z/D -2 0 2 4 Figure 2.12: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thick plates. The red vertical gridline denotes the EFB20 zEFB /D = 1.41566. 1.2 1 0.8 0.6 0.4 0.2 0 -0.2 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 Figure 2.13: The polygonal model of the semi-infinite capacitor with finitely thick plates. 31 2.3.2.1.2 Plates of Finite Thickness Consider a semi-infinite capacitor with full aperture D = 2 and plates of D/20 thickness 2r = 0.1. We model the x ≥ 0 half of this capacitor by a complex region bounded by the real axis at zero potential and the plate A = {t + id|t ∈ (−∞, 0]} ∪ {it|t ∈ [d, d + 2r]} ∪ {t + (d + 2r) i|t ∈ (−∞, 0]} at voltage V = 1, where d = 1. This polygonal model is shown in Fig. 2.13. We encode this polygonal physical domain in the SC Toolbox by its vertices w j and interior angles α j π as p2 = p o l y g o n ( [ 1 . 1 i , i , I n f , 0 , I n f , −1+1.1 i ] , [ 3 / 2 , 3 / 2 , 0 , 1 , −1, 1 ] ) where vertices 0 and −1 + 1.1i were added as guiding points for the SC Toolbox’s algorithm. Similarly to the previous case, we obtain the following conformal mapping from a bi-infinite strip to the physical domain using the SC Toolbox: ˆv f (v) = f (v0 ) + c exp hπ 2 (α− − α+ ) ζ v0 i n h iα j −1 π sinh ζ − v dζ , j ∏ 2 j=1 where n = 4 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.4475104912323, 0.7298948123684, 1.051921215239 + i) are the finite prevertices; απ = (1, 1.5, 1.5, 1) π are the respective interior angles of the polygon; and α− π = −π, α+ π = 0 are the divergence angles at the ends of the bi-infinite strip. The scaling constant is c = −5.042384793987374. Fig. 2.14 shows the resulting electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness. The falloff of the x component Ex (z) of the electrostatic field along the z axis has the EFB20 zEFB /D = 0.952043 and is shown in Fig. 2.15. 32 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 -1 -3 -2 -1 0 1 2 Figure 2.14: The electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness. Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.15: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/20 thickness. The red vertical gridline denotes the EFB20 zEFB /D = 0.952043. 33 1.2 1 0.8 0.6 0.4 0.2 0 -0.2 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 Figure 2.16: The polygonal model of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. 2.3.2.1.3 Plates of Finite Thickness with Rounded Edges Consider a semi-infinite capacitor with full aperture D = 2 and plates of D/20 thickness 2r = 0.1 with rounded edges. We model the x ≥ 0 half of this capacitor by a complex region bounded by the real axis at zero electrostatic potential and the plate n h π π io A = {t + di|t ∈ (−∞, 0]} ∪ (d + r) i + r exp (it) |t ∈ − , ∪ {t + (d + 2r) i|t ∈ (−∞, 0]} 2 2 at voltage V = 1, where d = 1. We approximate the arc by a piecewise linear curve with 42 line segments of equal lengths. This polygonal model is shown in Fig. 2.16. We encode this polygonal physical domain in the SC Toolbox as listed in App. B.3. Proceeding as in the previous cases, we obtain the following conformal mapping from a biinfinite strip to the physical domain using the SC Toolbox: ˆv f (v) = f (v0 ) + c exp hπ 2 (α− − α+ ) ζ v0 i n h iα j −1 π sinh ζ − v dζ , j ∏ 2 j=1 where n = 45 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.3805344321060, 0.3866459670307, 0.3933092616665, 34 0.4004238033105, 0.4079574599867, 0.4158853193485, 0.4241790327221, 0.4328391532257, 0.4418431833483, 0.4511799906304, 0.4608417087954, 0.4708063751390, 0.4810908733017, 0.4916343816466, 0.5024841810347, 0.5136015853200, 0.5249435318814, 0.5365474909385, 0.5483716273552, 0.5604324317077, 0.5726549790831, 0.5850879474069, 0.5976858775498, 0.6104007470804, 0.6232810803701, 0.6362432805046, 0.6492989469765, 0.6623928970331, 0.6755595399189, 0.6887381824925, 0.7018677939905, 0.7149929505145, 0.7280204245606, 0.7409539842791, 0.7537450473342, 0.7663616643523, 0.7787656435760, 0.7909001604658, 0.8027400857953, 0.8142156994585, 0.8252593198779, 0.8357891776466, 0.8456098356243, 1.088069920623 + i) are the finite prevertices;    85 43 43 85  , , 1 , , . . . , απ =  1, π  84 42 42 | {z } 84 41 times are the respective interior angles of the polygon; and α− π = −π, α+ π = 0 are the divergence angles at the ends of the bi-infinite strip. The scaling constant is c = −5.096904973741541. Fig. 2.17 shows the resulting electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. The falloff of the x component Ex (z) of the electrostatic field along the z axis has the EFB20 zEFB /D = 0.962347 and is shown in Fig. 2.18. Additionally, we performed calculations for the same case of a semi-infinite capacitor with finitely thick plates and rounded edges, but with the plate thickness increased to D/4. The resulting falloff of the electrostatic field Ex (z) has the EFB20 zEFB /D = 1.10338 and is shown in Fig. 2.19. 35 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 -1 -3 -2 -1 0 1 2 Figure 2.17: The electrostatic field and equipotential lines of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.18: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/20 thickness and rounded edges. The red vertical gridline denotes the EFB20 zEFB /D = 0.962347. 36 Ex (z) 1.0 0.8 0.6 0.4 0.2 z/D -2 0 2 4 Figure 2.19: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with plates of D/4 thickness and rounded edges. The red vertical gridline denotes the EFB20 zEFB /D = 1.10338. 1.2 1 0.8 0.6 0.4 0.2 0 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 Figure 2.20: The polygonal model of the semi-infinite capacitor with infinitely thin plates. 37 2.3.2.1.4 Infinitely Thin Plates For accuracy comparison, we return to the case of a semi-infinite capacitor with full aperture D = 2 and infinitely thin plates. We model the x ≥ 0 half of this capacitor by a complex region bounded by the real axis at zero electrostatic potential and the plate A = {t + di|t ∈ (−∞, 0]} at voltage V = 1, where d = 1. This capacitor model is shown in Fig. 2.20. We encode this polygonal physical domain in the SC Toolbox by its vertices w j and interior angles α j π as p0 = p o l y g o n ( [ i , I n f , 0 , I n f , −1+ i ] , [ 2 , 0 , 1 , −1, 1 ] ) where vertices 0 and −1 + i were added as guiding points for the SC Toolbox’s algorithm. We obtain the following conformal mapping from a bi-infinite strip to the physical domain using the SC Toolbox: ˆv f (v) = f (v0 ) + c exp hπ 2 (α− − α+ ) ζ v0 i n h iα j −1 π sinh ζ − v dζ , j ∏ 2 j=1 where n = 3 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.5660574857390, 0.9730053888353 + i) are the finite prevertices; απ = (1, 2, 1) π are the respective interior angles of the polygon; and α− π = −π, α+ π = 0 are the divergence angles at the ends of the bi-infinite strip. The scaling constant is c = −4.866174962862232. Fig. 2.21 shows the resulting electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thin plates. The falloff of the x component Ex (z) of the electrostatic field along the z axis is shown in Fig. 2.22 and agrees well with the previous result from Fig. 2.7. The EFB20 is zEFB /D = 0.920945 – same as obtained in sec. 2.3.1. 38 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 -1 -3 -2 -1 0 1 2 Figure 2.21: The electrostatic field and equipotential lines of the semi-infinite capacitor with infinitely thin plates. Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.22: Electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thin plates obtained using the SC Toolbox (dashed red) is visually coincident with the previous result from Fig. 2.7 (dashed blue). The red vertical gridline denotes the EFB20 zEFB /D = 0.920945. 39 3 2 1 0 -5 -4 -3 -2 -1 0 1 2 3 4 5 Figure 2.23: The polygonal model of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. 2.3.2.2 Two Adjacent Capacitors with Symmetric Voltages We now consider two adjacent semi-infinite capacitors with full aperture D = 2, plates of 3D/4 thickness 2r = 2.5, and rounded edges. Let the voltages of these capacitors have the same magnitude and symmetric alignment along the x axis, i.e., the upper (x > 0) plates of these capacitors have voltages of the same sign. This model straightforwardly follows from the approximation of an electrostatic deflector as a parallel plates capacitor with (1) the deflection radius as infinity and (2) plate voltages of the same magnitude and the opposite sign. We specify and model the capacitors by a complex region bounded by the real axis at zero electrostatic potential, the first capacitor’s upper plate n h π π io ∪ A = {−zoff + t + di|t ∈ (−∞, 0]} ∪ −zoff + (d + r) i + r exp (it) |t ∈ − , 2 2 ∪ {−zoff + t + (d + 2r) i|t ∈ (−∞, 0]} at voltage V = 1, and the adjacent capacitor’s upper plate n h π π io B = {zoff + t + di|t ∈ [0, +∞)} ∪ zoff + (d + r) i − r exp (it) |t ∈ − , ∪ 2 2 ∪ {zoff + t + (d + 2r) i|t ∈ [0, +∞)} at the same, symmetric voltage V = 1, where d = 1. Let the distance between the capacitors be 2zoff = 10, not including the rounded parts of their edges. We approximate each arc by a piecewise linear curve with 42 line segments of equal lengths. This polygonal model is shown in Fig. 2.23. We encode this polygonal physical domain in the SC Toolbox as listed in App. B.5. We obtain a conformal mapping f from the bi-infinite strip 0 ≤ ℑ (v) ≤ 1 using the command 40 f3b = stripmap ( p , [44 , 46] , o p t i o n s ) with the 44th and 46th prevertices +∞ and −∞ mapping to the infinite vertices of the polygon. The resulting conformal mapping f is as follows: ˆv f (v) = f (v0 ) + c exp hπ 2 (α− − α+ ) ζ v0 i n h iα j −1 π sinh ζ − v dζ , j ∏ 2 j=1 where n = 90 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.06898503648935, 0.1407073105108, 0.2134982040465, 0.2864841921843, 0.3590056630890, 0.4305569321602, 0.5007505699052, 0.5692474769696, 0.6358038856252, 0.7002087675776, 0.7623352142584, 0.8220702444247, 0.8793651508882, 0.9341719308222, 0.9864907936049, 1.036323118213, 1.083711410132, 1.128699072557, 1.171331486694, 1.211673088789, 1.249799897438, 1.285781148129, 1.319690530978, 1.351613922478, 1.381632958122, 1.409823501502, 1.436268003408, 1.461053624759, 1.484253948760, 1.505950018365, 1.526211988764, 1.545118039791, 1.562734119036, 1.579130994654, 1.594366892925, 1.608502284766, 1.621587383544, 1.633672991990, 1.644798981369, 1.654992351819, 1.664262998209, 1.672540497375, 1.752685224415, 1.973073503798, 2.193484524393, 2.273641964824, 2.281920852719, 2.291193070108, 2.301388186731, 2.312516104216, 2.324603832939, 2.337691257349, 2.351829196176, 2.367067879712, 2.383467798869, 2.401087200915, 2.419996878987, 2.440262806666, 2.461963194376, 2.485168228891, 2.509958989885, 2.536409099130, 2.564605762845, 2.594631480586, 2.626562168172, 2.660479520094, 2.696469479019, 41 5 4 3 2 1 0 -5 -4 -3 -2 -1 0 1 2 3 4 5 Figure 2.24: The electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. 2.734605805023, 2.774957809473, 2.817601596109, 2.862601691144, 2.910003568099, 2.959850729000, 3.012185784615, 3.067010211839, 3.124324320648, 3.184080193251, 3.246229204345, 3.310658424767, 3.377240981341, 3.445765832052, 3.515989160286, 3.587571751257, 3.660126008227, 3.733145992744, 3.805971730819, 3.877729193575, 3.946748819345, 1.973050207634 + i) are the finite prevertices;    85 43 43 85 85 43 43 85  , , . . . , , 1, −1, 1, , , . . . , , , , 1 απ =   84 42 π 42 84 84 42 42 84 | {z } | {z } 41 times 41 times are the respective interior angles of the polygon; and α± π = 0 are the divergence angles at the ends of the bi-infinite strip. The scaling constant is c = 4.9197519279647315 + i 1.0048276665744966. Fig. 2.24 shows the resulting electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 5D/4 thickness and rounded edges. We denote the x component of the electrostatic field along the z axis of the two adjacent capacitors as EA&B (z), of the left capacitor A in free space as EA (z), and of the right capacitor B in free space as EB (z). 42 Ex (z) 1.0 0.8 0.6 0.4 0.2 -6 -4 -2 z/D 0 2 4 6 Figure 2.25: EA&B (z) (solid blue) is the electrostatic field of two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. Fig. 2.25 shows a plot of electrostatic fields EA&B (z), EA (z), EB (z), and the difference EA&B (z) − EB (z). If the electrostatic field EA&B (z) of the two adjacent capacitors was a superposition of their individual free-space electrostatic fields EA (z) and EB (z), EA&B (z) − EB (z) would be equal to EA (z), but neither is the case. This is because of electrostatic induction effected by the capacitors onto each other. We note that EA&B (z) − EB (z) quickly falls off to zero, and we think it can be effectively represented by an Enge function. A comparison of the electrostatic field differences EA&B (z) − EB (z) for cases zoff ∈ {5, 10, 20} is shown in Fig. 2.26, and it demonstrates that the effect of electrostatic induction on the field EA&B (z) decreases as the distance 2zoff between the electrostatic capacitors increases. The absolute value of EA (z) + EB (z) − EA&B (z) is the highest near the edges of the capacitors. 43 Ex (z) 1.0 0.8 0.6 0.4 0.2 -6 -4 -2 z/D 0 2 4 6 (a) As zoff increases, the EA&B (z) − EB (z) curves approach their zoff → +∞ limit EA (z) (solid blue). Note the zoff = 5 (solid orange) curve quickly falling off to zero near z/D =5 and forming a peculiar angle. This is because the edge of the capacitor B in the zoff = 5 case is at z/D = 5. In cases zoff = 10 and zoff = 15, the edge of the capacitor B is outside the range of the plot. Ex (z) 0.4 0.3 0.2 0.1 -6 -4 -2 z/D 0 2 4 6 (b) Plots of EA (z) + EB (z) − EA&B (z) are scaled by 0.1. As zoff increases, the EA (z) + EB (z) − EA&B (z) curves decrease toward zero. In case of zoff = 5, the curve makes a second peak near the edge of the capacitor B at z/D = 5. In cases zoff = 10 and zoff = 15, the edge of the capacitor B is outside the range of the plot. Figure 2.26: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 10 (dashed green), and zoff = 15 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges. The origin of each curve is at the edge of the left capacitor A in the respective case. 44 2.3.2.3 Two Adjacent Capacitors with Antisymmetric Voltages Next, we consider two adjacent semi-infinite capacitors with full aperture D = 2, plates of 3D/4 thickness 2r = 2.5, and rounded edges. Let the voltages of these capacitors have the same magnitude and antisymmetric alignment along the x axis, i.e., the upper (x > 0) plates of these capacitors have voltages of the opposite sign. We specify and model the capacitors by a complex region bounded by the real axis at zero potential, the first capacitor’s upper plate n h π π io A = {−zoff + t + di|t ∈ (−∞, 0]} ∪ −zoff + (d + r) i + r exp (it) |t ∈ − , ∪ 2 2 ∪ {−zoff + t + (d + 2r) i|t ∈ (−∞, 0]} at voltage V = 1, and the adjacent capacitor’s upper plate n h π π io B = {zoff + t + di|t ∈ [0, +∞)} ∪ zoff + (d + r) i − r exp (it) |t ∈ − , ∪ 2 2 ∪ {zoff + t + (d + 2r) i|t ∈ [0, +∞)} at the opposite, antisymmetric voltage V = −1, where d = 1. Due to reflection symmetry, the potential at the vertical axis iR is zero. Utilizing this symmetry, we reduce the problem to solving the Laplace equation in the complex region bounded by the capacitor’s upper plate A at voltage V = 1 and the curve O = {t|t ∈ (−∞, 0]} ∪ {it|t ∈ [0, +∞)} at zero electrostatic potential. Let the distance between the capacitors be 2zoff = 10, not including the rounded parts of their edges. We approximate the arc by a piecewise linear curve with 42 line segments of equal lengths. This polygonal model is shown in Fig. 2.27. We encode this polygonal physical domain in the SC Toolbox as listed in App. B.6. We obtain a conformal mapping f from the bi-infinite strip 0 ≤ ℑ (v) ≤ 1 using the command f 6 a s 1 = s t r i p m a p ( p6as1 , [ 4 6 , 4 8 ] , o p t i o n s ) 45 5 4 3 2 1 0 -6 -5 -4 -3 -2 -1 0 Figure 2.27: The polygonal model representing the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, antisymmetric voltages, and rounded edges. with the 46th and 48th prevertices +∞ and −∞ mapping to the infinite vertices of the polygon. The resulting conformal mapping f is as follows: ˆv f (v) = f (v0 ) + c v0 i n h iα j −1 π (α− − α+ ) ζ ∏ sinh ζ −vj dζ , exp 2 2 j=1 hπ where n = 46 is the number of finite prevertices of the polygon in the canonical domain, v = (0, 0.2082710702589, 0.2268694858472, 0.2471979527171, 0.2689758999462, 0.2921056174591, 0.3165255488086, 0.3421986885406, 0.3691065983606, 0.3972266859049, 0.4265528768239, 0.4570728278723, 0.4887944128923, 0.5217160650131, 0.5558559351444, 0.5912199103837, 0.6278324936766, 0.6657097679051, 0.7048910918775, 0.7454131347512, 0.7873094700208, 0.8306281371978, 0.8754293623704, 0.9217656617397, 0.9696928619268, 1.019283409164, 1.070604438361, 1.123710114681, 1.178661078068, 1.235524415901, 1.294329412306, 1.355110639100, 1.417856827234, 1.482560341451, 1.549149509315, 1.617540278889, 46 5 4 3 2 1 0 -6 -5 -4 -3 -2 -1 0 Figure 2.28: The electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, antisymmetric voltages, and rounded edges in the z ≤ 0, x ≥ 0 quadrant. 1.687562902355, 1.759014151587, 1.831592691508, 1.904946457872, 1.978601404745, 2.051925721199, 2.124069791109, 2.193382958646, 3.233898704303, 0.6626244510635 + i) are the finite prevertices;    85 43 43 85 1  απ =  1, , , . . . , , , 1,   84 42 π 42 84 2 | {z } 41 times are the respective interior angles of the polygon; and α− π = −0.5π, α+ π = 0 are the divergence angles at the ends of the bi-infinite strip. The scaling constant is c = −2.807110433411235 + i 2.8071104400617424. Fig. 2.28 shows the resulting electrostatic field and equipotential lines of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness and rounded edges in the z ≤ 0, x ≥ 0 quadrant. 47 Ex (z) 1.0 0.5 -4 -2 z/D 0 2 4 -0.5 -1.0 Figure 2.29: EA&B (z) (solid blue) is the electrostatic field of two adjacent semi-infinite capacitors with plates of 3D/4 thickness, asymmetric voltages, and rounded edges. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. We denote the x component of the electrostatic field along the z axis of the two adjacent capacitors as EA&B (z), of the left capacitor A in free space as EA (z), and of the right capacitor B in free space as EB (z). Fig. 2.29 shows a plot of electrostatic fields EA&B (z), EA (z), EB (z), and the difference EA&B (z) − EB (z). The plot demonstrates that the electrostatic field of the two adjacent capacitors EA&B (z) is not a superposition of their individual electrostatic fields EA (z) and EB (z). A comparison of the electrostatic field differences EA&B (z) − EB (z) for cases zoff ∈ {5, 10, 20} is shown in Fig. 2.30, and it demonstrates that the effect of electrostatic induction on the field EA&B (z) decreases as the distance 2zoff between the electrostatic capacitors increases. The absolute value of EA (z) + EB (z) − EA&B (z) is the highest near the edges of the capacitors. 48 Ex (z) 1.0 0.8 0.6 0.4 0.2 -6 -4 -2 z/D 0 2 4 6 (a) As zoff increases, the EA&B (z) − EB (z) curves approach their zoff → +∞ limit EA (z) (solid blue). Note the zoff = 5 (solid orange) curve quickly falling off to zero near z/D =5 and forming a peculiar angle. This is because the edge of the capacitor B in the zoff = 5 case is at z/D = 5. In cases of zoff = 10 and zoff = 15, the edge of the capacitor B is outside the range of the plot. The origin of each curve is at the edge of the left capacitor A in the respective case. Ex (z) 0.4 0.2 -6 -4 -2 z/D 0 2 4 6 -0.2 -0.4 (b) Plots of EA (z) + EB (z) − EA&B (z) are scaled vertically by 0.1 and horizontally by zoff /5. The capacitor edges are at z = ±5 and denoted by red vertical gridlines. As zoff increases, the EA (z) + EB (z) − EA&B (z) curves decrease toward zero. Figure 2.30: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 10 (dashed green), and zoff = 15 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, asymmetric voltages, and rounded edges. 49 2.3.2.4 Two Adjacent Capacitors with Different Voltages In the case of two adjacent semi-infinite capacitors with different voltages, the total number of different plate voltages is four, counting voltages of the same magnitude but opposite signs. Therefore, the method of solving the Laplace equation by finding a conformal mapping from a bi-infinite strip no longer applies. However, the problem can be solved as follows [30, pp. 77–83]. Let V1 and V2 be the upper plate voltages of the left and the right semi-infinite capacitors, respectively. First, we obtain a conformal mapping f from the upper half-plane H + ⊂ C to the polygonal model that represents the upper half x ≥ 0 of the two capacitors. As a result, the preimages of the capacitor’s plates are intervals on the real axis, delimited by ±∞ and a set of points −∞ < v1 < · · · < vn−1 < +∞ for some n ≥ 3, to account for the three constant Dirichlet boundary condition values 0 (on the real axis), V1 , and V2 . For n Dirichlet boundary conditions φ1 , . . . φn and n − 1 points v1 , . . . vn−1 on the real axis, the conformal mapping ϕ : H + → H + ,     v − v2 i φ1 ln (v − v1 ) + φ1 ln + φ (v) = ℜ − π v − v1     v − vn−1 1 + . . . + φn−1 ln + φn ln v − vn−2 vn−1 − v satisfies [30, pp. 77–83]    φ1         φ2     φ (x) = ...        φn−1        φn −∞ < v < v1 , v1 < v < v2 , .. . vn−2 < v < vn−1 , vn−1 < v < +∞. 50 5 4 3 2 1 0 -5 -4 -3 -2 -1 0 1 2 3 4 5 Figure 2.31: The polygonal model of the two adjacent semi-infinite capacitors with plates of D/2 thickness at different voltages. It follows that the solution of the Laplace equation for the two adjacent semi-infinite capacitors with different voltages is    ϕ (w) = ℜ φ f −1 (w) . (2.8) We can find a conformal mapping f using the SC Toolbox’s command hplmap. To find the conformal mapping φ , we can use the SC Toolbox’s command lapsolve. The command lapsolve has no provisions for the crowding effect. Experimentation has shown that, in this case, modeling rounded plate edges using a high-fidelity piecewise linear curve results in no convergence or very low computational accuracy. Computational accuracy was somewhat acceptable when the rounded edges were modeled by two diagonal lines intersecting at 90◦ (“triangular edges”). Consider two adjacent semi-infinite capacitors with full aperture D = 2, plates of D/2 thickness 2r = 1, and such triangular edges. Let the voltages of these capacitors have different magnitudes V1 , V2 and symmetric alignment along the x axis, i.e., the upper (x > 0) plates of these capacitors have voltages of the same sign. We specify and model the capacitors by a complex region bounded by the real axis at zero potential, the first capacitor’s upper plate A = {−zoff + t + di|t ∈ (−∞, 0]} ∪ {−zoff + di + (r + ri)t|t ∈ [0, 1]} ∪ ∪ {−zoff + (d + 2r) i + (r − ri)t|t ∈ [0, 1]} ∪ {−zoff + t + (d + 2r) i|t ∈ (−∞, 0]} 51 at voltage V1 , and the adjacent capacitor’s upper plate B = {zoff + t + di|t ∈ [0, +∞)} ∪ {zoff + di + (ri − r)t|t ∈ [0, 1]} ∪ ∪ {zoff + (d + 2r) i − (ri − r)t|t ∈ [0, 1]} ∪ {zoff + t + (d + 2r) i|t ∈ [0, +∞)} at voltage V2 , where d = 1. For definiteness, let V1 = 1 and V2 = 3. Let the distance between the capacitors be 2zoff = 10, not including their edges. This polygonal model is shown in Fig. 2.31. We encode this polygonal physical domain in the SC Toolbox by its vertices w j and interior angles α j π as p3bm = p o l y g o n ( [ 0 , i n f , 5 . + 1 . i , 4 . 5 + 1 . 5 i , 5 . + 2 . i , 6 . + 2 . i , i n f , . . . −6.+2. i , −5.+2. i , −4.5+1.5 i , −5.+1. i , i n f ] , . . . [ 1 , 0 , 5 / 4 , 3 / 2 , 5 / 4 , 1 , −1, 1 , 5 / 4 , 3 / 2 , 5 / 4 , 0 ] ) ; where vertices 0, −6 + 2i, and 6 + 2i were added as guiding points for the SC Toolbox’s algorithm. We obtain a conformal mapping f from the upper half-plane H + using the command hplmap. f3bm = hplmap ( p3bm , o p t i o n s ) ; Next, we compute the composite conformal mapping as in eq. 2.8 using the command lapsolve bmod = [ 3 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 3 ] ; p h i = l a p s o l v e ( f3bm , bmod ) ; where its Dirichlet boundary conditions are supplied as the vector bmod. Fig. 2.32 shows a plot of electrostatic fields EA&B (z), EA (z), EB (z), and the difference EA&B (z) − EB (z). The plot demonstrates that the electrostatic field of the two adjacent capacitors EA&B (z) is not a superposition of their individual electrostatic fields EA (z) and EB (z). A comparison of the electrostatic field differences EA&B (z) − EB (z) for cases zoff ∈ {5, 7.5, 10} is shown in Fig. 2.33, and it demonstrates that the effect of electrostatic induction on the field EA&B (z) decreases as the distance 2zoff between the electrostatic capacitors increases. The absolute value of EA (z) + EB (z) − EA&B (z) is the highest near the edges of the capacitors. 52 Ex (z) 3.0 2.5 2.0 1.5 1.0 0.5 -3 -2 -1 z/D 0 1 2 3 Figure 2.32: EA&B (z) (solid blue) is the electrostatic field of the two adjacent semi-infinite capacitors with plates of D/2 thickness and different voltages. EA (z) (solid orange) and EB (z) (solid green) would be the individual electrostatic fields of the left and the right capacitor in free space, respectively. The difference EA&B (z) − EB (z) (dashed red) demonstrates that EA&B (z) is not a superposition of EA (z) and EB (z) due to electrostatic induction. The capacitor edges in this zoff = 5 case are at z/D = ±zoff /D = ±2.5, denoted by red vertical gridlines. 2.4 Finite Rectangular Electrostatic Capacitors Helmut Soltner (Forschungszentrum Jülich, Germany) had calculated the electrostatic field for several finite rectangular electrostatic capacitors with finitely thick plates. The calculations were performed in COULOMB. 2.4.1 COULOMB COULOMB is a 3D electric computer-aided design (CAD) and analysis software program [32]. COULOMB’s boundary element method (BEM) field solver is useful for calculations of field falloffs of electrostatic particle optical elements. The 3D model of a particle optical element is specified as a solid part in a STEP-formatted [55] file. Surfaces of the 3D model are assigned voltages and are discretized by meshes. A grid-point set of coordinates, listed in an input text file, specifies where the electrostatic potential or the 53 Ex (z) 1.0 0.8 0.6 0.4 0.2 z/D 0 1 2 3 4 5 (a) As zoff increases, the EA&B (z) − EB (z) curves approach their zoff → +∞ limit EA (z) (solid blue). Note the zoff = 5 (solid orange) curve quickly falling off to zero near z/D =5 and forming a peculiar angle. This is because the edge of the capacitor B in the zoff = 5 case is at z/D = 5. In cases zoff = 7.5 and zoff = 10, the edge of the capacitor B is outside the range of the plot. Ex (z) 0.12 0.10 0.08 0.06 0.04 0.02 0.00 z/D 1 2 3 4 5 (b) Plots of EA (z) + EB (z) − EA&B (z) are scaled vertically by 0.1. As zoff increases, the EA (z) + EB (z) − EA&B (z) curves decrease toward zero. The zoff = 5 curve makes a second peak near the edge of the capacitor B at z/D = 5. In cases zoff = 7.5 and zoff = 10, the edge of the capacitor B is outside the range of the plot. Some artifacts due to computation errors are visible. Figure 2.33: Electrostatic field differences EA&B (z) − EB (z) for cases zoff = 5 (solid orange), zoff = 7.5 (dashed green), and zoff = 10 (dot-dashed red), of the two adjacent semi-infinite capacitors with plates of D/2 thickness and different voltages. The origin of each curve is at the edge of the left capacitor A in the respective case. 54 Figure 2.34: Rendering of the large rectangular capacitor with plates of D/4 thickness and rounded edges. The infinite line represents the z axis. One-eighth of the capacitor geometry, denoted by purple, is stored in the STEP file. The full geometry is recovered in COULOMB by specifying the three reflection symmetries. electrostatic field is to be calculated. Next, the BEM solver performs calculations, and the results are written to a text file. Our calculations typically took several hours to complete. 2.4.2 Large Rectangular Capacitor Consider a rectangular electrostatic capacitor comprising solid plates of D/4 thickness A = f ({(x, y, z) |x ∈ [1, 1.5] cm; y, z ∈ [−1, 1] m; }) at voltage V = 1 V and B = f ({(x, y, z) |x ∈ − [1, 1.5] cm; y, z ∈ [−1, 1] m; }) at voltage V = −1 V, respectively. The function f represents adding material to the plates to form rounded edges. This rectangular capacitor is shown in Fig. 2.34. The COULOMB calculations were performed with about 85, 000 boundary elements and produced electrostatic field data at points H=   kx hx , ky hy , 40 cm + kz hz |kx , ky = 1, 2, . . . , 10; kz = 1, 2, . . . , 100 ,  where hx , hy , hz = (0.1, 5, 0.2) cm. The falloff of the x component Ex (z) of the electrostatic field along the z axis is shown in Fig. 2.35. 55 Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.35: Electrostatic field falloff Ex (z) of the large rectangular capacitor with plates of D/4 thickness and rounded edges. 2.4.3 Small Rectangular Capacitor Consider a smaller rectangular electrostatic capacitor comprising solid plates of D/4 thickness A = f ({(x, y, z) |x ∈ [1, 1.5] cm; y ∈ [−5.5, 5.5] cm; z ∈ [−1, 1] m}) at voltage V = 1 V and B = f ({(x, y, z) |x ∈ − [1, 1.5] cm; y ∈ [−5.5, 5.5] cm; z ∈ [−1, 1] m}) at voltage V = −1 V, respectively. The function f represents adding material to the plates to form rounded edges. The COULOMB calculations were performed with 70, 000 boundary elements and produced electrostatic field data at points H=   kx hx , ky hy , 40 cm + kz hz |kx , ky = 1, 2, . . . , 10; kz = 1, 2, . . . , 100 ,  where hx , hy , hz = (0.1, 0.05, 0.2) cm. The falloff of the x component Ex (z) of the electrostatic field along the z axis is shown in Fig. 2.36. 56 Ex (z) 1.0 0.8 0.6 0.4 0.2 z/D -2 0 2 4 Figure 2.36: Electrostatic field falloff Ex (z) of the small rectangular capacitor with plates of D/4 thickness and rounded edges. Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.37: Electrostatic field falloffs Ex (z) of the large (solid green) and small (solid orange) rectangular capacitors modeled by 70, 000 boundary elements, the small rectangular capacitor modeled by 150, 000 boundary elements (dashed blue), and the semi-infinite capacitor with plates of D/4 thickness and rounded edges (dot-dashed red). The Ex (z) curves of the small rectangular capacitor modeled by 70, 000 and 150, 000 boundary elements visually coincide. As expected, the Ex (z) curve of the large rectangular capacitor is only slightly lower than of the semi-infinite capacitor with finitely thick plates and rounded edges. 57 To assess the accuracy of the COULOMB calculations, the calculations were repeated with 150, 000 boundary elements instead of the initial 70, 000. Fig. 2.37 shows, inter alia, a comparison of the electrostatic field falloffs in these two cases. We are satisfied with the initial accuracy of the calculations, as the electrostatic field falloffs are visually indistinguishable. 2.5 Comparison of Single-Capacitor Results In the above, we obtained electrostatic field falloffs for the following cases of one electrostatic capacitor: 1. Semi-infinite capacitor with infinitely thin plates, manually obtained conformal mapping; 2. Semi-infinite capacitor with infinitely thin plates, SC Toolbox calculations; 3. Semi-infinite capacitor with infinitely thick plates, SC Toolbox calculations; 4. Semi-infinite capacitor with plates of D/20 thickness, SC Toolbox calculations; 5. Semi-infinite capacitor with plates of D/20 thickness and rounded edges, SC Toolbox calculations; 6. Semi-infinite capacitor with plates of D/4 thickness and rounded edges, SC Toolbox calculations; 7. Large rectangular capacitor with plates of D/4 thickness, COULOMB calculations; and 8. Small rectangular capacitor with plates of D/4 thickness, COULOMB calculations. We compare the falloffs of the electrostatic fields Ex (z) from cases 1, 3, 4, and 5 in Fig. 2.38. The electrostatic fields Ex (z) from cases 2, 3, 5, 6, 7, and 8 are compared in Fig. 2.39. In Fig. 2.22 above, we compared the electrostatic fields Ex (z) for cases 1 and 2. We observed a general pattern that the electrostatic field falloffs are in or near the region bounded by the electrostatic field falloffs of semi-infinite capacitors with infinitely thin and infinitely thick plates. Increasing the thickness of the plates – ceteris paribus – visibly increased Ex (z) for z/D ? 1. 58 Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.38: The electrostatic field falloffs Ex (z) in cases 1 (dot-dashed blue), 3 (solid brown), 4 (solid green), and 5 (dashed red). Ex (z) 1.0 0.8 0.6 0.4 0.2 -2 z/D 0 2 4 Figure 2.39: The electrostatic field falloffs Ex (z) in cases 2 (solid cyan), 3 (solid brown), 5 (solid orange), 6 (dashed blue), 7 (dashed green), and 8 (dot-dashed red). 59 Ex (0.9d,z) 1.4 1.2 1.0 0.8 0.6 0.4 0.2 -2 0 2 4 z/D Figure 2.40: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (solid green), 2 (dashed red), 3 (solid brown), and 6 (dot-dashed blue). Ex (0.9d,z) 1.4 1.2 1.0 0.8 0.6 0.4 0.2 -2 0 2 4 z/D Figure 2.41: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (dot-dashed blue), 4 (solid green), and 5 (dashed red). 60 Ex (0.9d,z) 1.4 1.2 1.0 0.8 0.6 0.4 0.2 -2 0 2 4 z/D Figure 2.42: The x component Ex (0.9d, z) of the electrostatic field along the x = 0.9d line in cases 1 (dot-dashed blue), 7 (solid green), and 8 (dashed red). As illustrated previously in Fig. 2.9, the plate surface charge density σ (z) spikes near the plate edge. Accordingly, the electrostatic field Ex (x, z) along a line x = a near the plate at x = d spikes near the plate edge at z = 0 (same applies to the lower plate at x = −d). As an example, we consider the line x = 0.9d. Falloffs of the x component Ex (0.9, z) of the electrostatic field along the line x = 0.9d in cases 1, 2, 3, 6 are shown in Fig. 2.40, in cases 1, 4, 5 in Fig. 2.41, and in cases 1, 7, 8 in Fig. 2.42. The results are consistent with the standard electrostatics result [56, pp. 75–79] that the surface charge density tends to be higher near sharp edges and not as high near blunt or rounded edges. 2.6 Accurate Fringe Fields Representation Enge functions FN (z) = 1   j−1  , z N 1 + exp ∑ j=1 a j D are effective at representing fringe fields of magnetic dipoles. As Fig. 2.43 illustrates, fringe fields of electrostatic deflectors fall off slower than fringe fields of magnetic dipoles. 61 F(z) 1.0 0.8 0.6 0.4 0.2 -5 z/D 0 5 10 15 Figure 2.43: The electrostatic field falloff Ex (z) of a semi-infinite electrostatic capacitor with infinitely thin plates (solid blue), compared to the magnetic field falloff of a homogeneous magnetic dipole (dashed red). Each curve is horizontally offset so that origin z = 0 is at its EFB (the EFB20 , computed with zext /D = 20, in the electrostatic case). Ex (z) 1.0 0.8 0.6 0.4 0.2 -5 z/D 0 5 10 15 Figure 2.44: An Enge function F5 (z) (dashed red), fitted to the electrostatic field falloff Ex (z) (solid blue) of a semi-infinite capacitor with infinitely thin plates. The electrostatic field falloff Ex (z) is scaled to 1 well inside the capacitor. The origin z = 0 is at the EFB20 . 62 Coefficient Value a1 a2 a3 a4 a5 a6 1.2769683902492515 1.4049887582360876 −0.882202957166947 0.48659244279111313 −0.1378864476786552 0.014397164677247012 Table 2.1: Coefficients of the Enge function F5 (z), fitted to the electrostatic field falloff Ex (z) of the semi-infinite capacitor with infinitely thin plates. The Enge function is accurate for z/D ≤ 4. Coefficient Value b1 b2 b3 b4 b5 b6 4.057204346021459 5.656314468345938 0.08405676267706107 −0.0074011699896916186 0.0003532805303953159 −6.893356779357708 × 10−6 Table 2.2: Fitted coefficients of the function H1 (z), approximating the electrostatic field falloff Ex (z) at z/D ≥ 3. Consider the x component Ex (z) of the electrostatic field along the z axis of a semi-infinite electrostatic capacitor with infinitely thin plates. In this section, Ex (z) is offset by the EFB20 zEFB /D = 0.920945 so that the EFB20 is at the origin z = 0. Fig. 2.44 shows a 5th order Enge function F5 (z) as a representative attempt to fit an Enge function to the electrostatic field Ex (z). The resulting Enge function coefficients are listed in Table 2.1. Unlike Ex (z), the Enge function F5 (z) quickly falls off to zero. Increasing the number of Enge function order N resulted in some erratic-looking Enge function behavior and did not resolve this issue. The same issue was observed for fringe field falloffs of other electrostatic deflectors. We concluded that this is because the field falloff of an electrostatic deflector is slower than exponential. Since the electrostatic field of a point charge falls off as ∼ 1/r2 and the electrostatic field of a semi-infinite capacitor is an integral of charge density over its plates, we supposed that the fringe field falloff of a semi-infinite capacitor is similar in form to 1/r. 63 Figure 2.45: Function H1 (z) (dashed red), fitted to the electrostatic field falloff E (z) (solid blue) over the interval 3 ≤ z/D ≤ 15. The origin z = 0 is at the EFB20 . The Enge function F5 (z) is a good approximation of Ex (z) up to about z/D = 4, as Fig 2.44 shows. We note that this Enge function is already a significant improvement over using magnetic dipole Enge function coefficients to model the fringe field of the electrostatic deflector. Complementarily, we fitted the function H1 (z) = 1  j−1 ∑Nj=1 b j Dz to Ex (z) in the interval 3 ≤ z/D ≤ 15. The results of the fit are shown in Fig. 2.45. The fitted values of coefficients b j are listed in Table 2.2. Next, we smoothly glued the Enge function F (z) and the function H1 (z) using the formula H2 (z) = F5 (z) 1 1 + exp h z D − 3.5 2 i + H1 (z) 1 h 2 i . z 1 + exp − D − 3.5 We propose the general form H (z) = 1 1 h h N i 2 i +  j−1 z z 1 1 + exp D − c 1 + exp ∑ j=1 a j D 1 1 h i. + N  j−1 z − c2 2 b z 1 + exp − ∑ j=1 j D D 64 for such an approximation of the field falloff of an electrostatic deflector, where a j , b j , and c are parameters. The function H2 (z) is plotted in Fig. 2.46 against Ex (z) and shows a good fit over at least −5 ≤ z/D ≤ 15, with sup−5≤z/D≤15 |H2 (z) − Ex (z)| of about 0.005, and with the difference |H2 (z) − Ex (z)| the most significant in the interval −2 ≤ z/D ≤ 5. Not completely satisfied with the accuracy of H2 (z), we calculated a numerical approximation H3 (z) to the Fourier exponential series of Ex (z) − H2 (z) of order 20, with Fourier parameters a = 1 and b = π/5, in the interval 1.5 − π/ |b| ≤ z/D ≤ 1.5 + π/ |b| (i.e., −3.5 ≤ z/D ≤ 6.5). The resulting Fourier expansion H3 (z) is H3 (z) = (0.000034592190696502585 + 0.000015478461970141042i) exp (−4iπ (z/D − 1.5)) − − (0.000018077924429864712 − 0.00004593257538937567i) exp (−19iπ (z/D − 1.5) /5) − − (0.00006353082276061136 + 0.000023106674840721097i) exp (−18iπ (z/D − 1.5) /5) + + (0.000028478297945671638 − 0.00008017779530694298i) exp (−17iπ (z/D − 1.5) /5) + + (0.00011030296357655544 + 0.000031545142879819836i) exp (−16iπ (z/D − 1.5) /5) − − (0.000043749144828268773 − 0.00013687173427145814i) exp (−3iπ (z/D − 1.5)) − − (0.00017389809467850326 + 0.00003741257064118089i) exp (−14iπ (z/D − 1.5) /5) + + (0.0000608358170498856 − 0.00022395108511517542i) exp (−13iπ (z/D − 1.5) /5) + + (0.00024643987127510484 + 0.00003943949222229756i) exp (−12iπ (z/D − 1.5) /5) − − (0.000051390417457536415 − 0.0003308925544755625i) exp (−11iπ (z/D − 1.5) /5) − − (0.0002991843170572326 + 0.00005038314716731468i) exp (−2iπ (z/D − 1.5)) − − (0.0000336483235441472 + 0.00041226203805249685i) exp (−9iπ (z/D − 1.5) /5) + + (0.00027288464436715397 + 0.000059492609979352665i) exp (−8iπ (z/D − 1.5) /5) + + (0.00018899136099786987 + 0.00031141333068954147i) exp (−7iπ (z/D − 1.5) /5) − − (0.0001173243748690325 + 0.00008237663640946321i) exp (−6iπ (z/D − 1.5) /5) − − (0.0002685913288988471 − 0.000227766412409432i) exp (iπ (z/D − 1.5)) − 65 Ex (z) 1.0 0.8 0.6 0.4 0.2 -5 z/D 0 5 10 15 (a) H2 (z) (dashed red) and Ex (z) (solid blue). Ex (z) 0.025 0.020 0.015 0.010 0.005 -5 z/D 0 5 10 15 -0.005 (b) H2 (z) − Ex (z) (dashed red) and sup−5≤z/D≤15 H2 (z) − Ex (z) is about 0.005. F5 (z) − Ex (z) (solid blue). Figure 2.46: The piecewise function H2 (z) is an improved approximation of electrostatic field falloff Ex (z) compared to the Enge function F5 (z). The function H2 (z) is formed by smoothly gluing F5 (z) and H1 (z) at z/D = 3.5, indicated by the vertical gridline. The origin z = 0 is at the EFB20 . 66 − (0.00012021044338404635 − 0.0006224497940703973i) exp (−4iπ (z/D − 1.5) /5) − − (0.0000367792387674523 + 0.00012020905645207353i) exp (−3iπ (z/D − 1.5) /5) − − (0.0001448084077170699 + 0.00026198489039169006i) exp (−2iπ (z/D − 1.5) /5) − − (0.00002599518346899367 − 0.0004604060654995473i) exp (−iπ (z/D − 1.5) /5) + + 0.00014791662685726133− − (0.00002599518346899378 + 0.0004604060654995472) exp (1iπ (z/D − 1.5) /5) − − (0.0001448084077170699 − 0.00026198489039169) exp (2iπ (z/D − 1.5) /5) − − (0.00003677923876745228 − 0.00012020905645207357) exp (3iπ (z/D − 1.5) /5) − − (0.00012021044338404654 + 0.0006224497940703973) exp (4iπ (z/D − 1.5) /5) − − (0.00026859132889884717 + 0.00022776641240943203) exp (iπ (z/D − 1.5)) − − (0.0001173243748690325 − 0.00008237663640946321) exp (6iπ (z/D − 1.5) /5) + + (0.0001889913609978698 − 0.00031141333068954126) exp (7iπ (z/D − 1.5) /5) + + (0.0002728846443671541 − 0.000059492609979352705) exp (8iπ (z/D − 1.5) /5) − − (0.00003364832354414726 − 0.00041226203805249685i) exp (9iπ (z/D − 1.5) /5) − − (0.0002991843170572325 − 0.00005038314716731472i) exp (2iπ (z/D − 1.5)) − − (0.000051390417457536605 + 0.0003308925544755627i) exp (11iπ (z/D − 1.5) /5) + + (0.00024643987127510484 − 0.00003943949222229763) exp (12iπ (z/D − 1.5) /5) + + (0.0000608358170498856 + 0.00022395108511517544) exp (13iπ (z/D − 1.5) /5) − − (0.0001738980946785033 − 0.00003741257064118092) exp (14iπ (z/D − 1.5) /5) − − (0.000043749144828268773 + 0.00013687173427145811) exp (3iπ (z/D − 1.5)) + + (0.00011030296357655545 − 0.00003154514287981986i) exp (16iπ (z/D − 1.5) /5) + + (0.00002847829794567166 + 0.00008017779530694296) exp (17iπ (z/D − 1.5) /5) + + (0.00006353082276061137 − 0.0000231066748407211) exp (18iπ (z/D − 1.5) /5) + + (0.000018077924429864712 + 0.00004593257538937565) exp (19iπ (z/D − 1.5) /5) + 67 Ex (z) 0.004 0.002 -2 z/D 0 2 4 6 -0.002 -0.004 Figure 2.47: Function H3 (z) (dashed red) is a Fourier expansion of Ex (z) − H2 (z) (solid blue) over the interval −3.5 ≤ z/D ≤ 6.5. The origin z = 0 is at the EFB20 . + (0.00003459219069650258 − 0.000015478461970141045i) exp (4iπ (z/D − 1.5)) . Fig. 2.47 illustrates that the function H3 (z) approximates Ex (z) − H2 (z) well. Finally, we obtained a function G (z), a sum of H2 (z) and H3 (z) with smooth boundaries of H3 (z) at z/D = −3 and z/D = 6, as G (z) = H2 (z) + F3 (z) 1 1 h i h  2 i . 2 1 + exp − Dz + 3 1 + exp Dz − 3 As Fig. 2.48 shows, G (z) is a good approximation of Ex (z) over at least the interval −5 ≤ z/D ≤ 15, with sup−5≤z/D≤15 |G (z) − Ex (z)| of about 4 × 10−4 . 2.7 Conclusion We modeled fringe fields of semi-infinite electrostatic capacitors with infinitely thin, infinitely thick, and finitely thick plates, including plates with rounded edges. Additionally, we modeled fringe fields of two adjacent semi-infinite capacitors with finitely thick plates and symmetric, antisymmetric, and different voltages. We used conformal mapping methods to perform this modeling. 68 Ex (z) 1.0 0.8 0.6 0.4 0.2 -5 z/D 0 5 10 15 (a) G (z) (dashed red) and Ex (z) (solid blue). Ex (z) 0.004 0.002 -5 z/D 0 5 10 15 -0.002 -0.004 (b) G (z)−Ex (z) (dashed red) and H2 (z)−Ex (z) (solid blue). sup−5≤z/D≤15 |G (z) − Ex (z)| is about 4 × 10−4 . Figure 2.48: The piecewise function G (z), an improved approximation of electrostatic field falloff Ex (z) over function H2 (z). Vertical gridlines at z/D = −3, 3.5, and 6 are points of smooth gluing or smooth boundaries used in construction of G (z), as described in the text. The origin z = 0 is at the EFB20 . 69 Comparison of the results for fringe fields of semi-infinite capacitors with fringe fields of several finite rectangular electrostatic capacitors obtained using a BEM field solver shows good agreement. We found that the field falloff of an electrostatic deflector is slower than exponential. Enge functions are not suitable for accurate modeling of such falloffs. We proposed an alternative function to model field falloffs of electrostatic deflectors. 70 CHAPTER 3 MAIN AND FRINGE FIELDS OF THE MUON g-2 STORAGE RING HIGH VOLTAGE QUADRUPOLE 3.1 Introduction We studied the main and fringe fields of the Muon g-2 storage ring high voltage quadrupole (or the Muon g-2 collaboration quadrupole) described in [93]. The Muon g-2 storage ring is the lattice that was used for the E821 MDM measurement experiment and will be used, with modifications, for the E989 MDM measurement experiment. In this chapter, we present a method to calculate the 2D main field of the quadrupole, accounting for geometric asymmetries and mispowered plates (e.g., for RF scraping). Conformal mapping methods provide an analytic formula for a fully Maxwellian map from a canonical domain such as a rectangle to a polygon. The cross section of the quadrupole is represented by a polygon. We obtained an accurate and fully Maxwellian approximation of the electrostatic potential for this 2D geometry using the following general method (or its adaptation): 1. Calculate the electrostatic potential using conformal mapping methods for one plate at 1 V and the other plates, the rectangular enclosure, and the trolley rails at 0 V. 2. Apply appropriate rotations to the resulting solutions for the potential, scale those solutions (e.g., by ±2.4 × 104 or with mispowered values), and use their superposition. This method allows rapid recalculations with adjustments to the geometry and the individual plate voltages. The multipole terms of the electrostatic potential may be calculated (1) using Fourier analysis or (2) by taking the DA value of the potential. We calculated the multipole terms of the Muon g-2 collaboration quadrupole using these methods and performed an error analysis. 71 Moreover, we developed a code to automatically generate a 3D model in STEP1 file format from a cross-sectional geometry represented by a polygon. We prepared a 3D model of the Muon g-2 collaboration quadrupole using this code, and the electrostatic potential data (“Soltner–Valetov data”) for a respective grid-point set was calculated using COULOMB’s BEM field solver by Helmut Soltner (Forschungszentrum Jülich). We obtained an approximation of the multipole strengths by calculating Fourier modes of the electrostatic potential at a set of radii in the transversal plane. From this data, we obtained the falloff of the quadrupole strength and the EFB. We applied the same method for calculating multipole strengths to the electrostatic field data for the Muon g-2 collaboration quadrupole obtained using Opera-3d’s finite element method (FEM) field solver [1] by Wanwei Wu (FNAL and University of Mississippi) [116]. The quadrupole strength falloffs and the EFBs obtained from Soltner–Valetov and Wu field data agree well, and so do the tunes calculated based on them. 3.2 3.2.1 Main Field Conformal Mapping Methods In this section, we use concepts and notation and refer to software introduced in App. A Conformal Mapping Methods. 3.2.2 Conformal Mappings for Main Field Calculation To calculate the electrostatic potential for the cross section of the quadrupole using the superposition method we outlined above, we consider each plate with the constant Dirichlet boundary condition 1 V and the other plates, the rectangular enclosure, and the trolley rails with the constant Dirichlet boundary condition 0 V. These two constant Dirichlet boundary conditions are interposed by two von Neumann boundary conditions, forming a logical quadrilateral. A conformal mapping from a 1 STEP is an abbreviation for STandard for the Exchange of Product model data – ISO 10303-242 [55]. 72 rectangular part of a bi-infinite strip is suitable for a physical domain as this logical quadrilateral, as App. A notes. The derivative of the conformal mapping f : C → C, v 7→ w from a rectangle is n f 0 (v) = c cn (v|m) dn (v|m) ∏ sn (v|m) − sn x j + i y j |m α −1 j , (3.1) j=1  where n is the number of polygon vertices, x j + i y j = v j are the prevertices f −1 w j of the polygon vertices w j , πα j are the interior polygon angles, m is the elliptic parameter, and c is a constant [30, p. 49]. For computational efficiency and to implicitly account for the singularity at i K 0 = i K (1 − m), a conformal mapping f from a rectangle and its derivative f 0 are often calculated using a composite map f = f2 ◦ f1 where f1 (v) = log (sn (v|m)) /π is the conformal mapping from a rectangle to the strip 0 ≤ ℑ (z) ≤ 1 and ˆz f2 (z) = A +C exp hπ 2 (α− − α+ ) ζ i n h i π αk −1 sinh (ζ − z ) dζ ∏ k 2 k=1 is the conformal mapping from the strip 0 ≤ ℑ (z) ≤ 1 to the interior of a polygon. Points zk are the prevertices of the polygon other than the complex infinity at the two sides of the infinite strip, angles παk are the respective interior angles of the polygon, and πα± are the divergence angles of the sides of the strip at the ends of the strip [30, p. 46]. We note that f10 (v) = cn (v|m) dn (v|m) . π sn (v|m) The following is an outline of a calculation process of the prevertices v j in a rectangular canonical domain, as performed in the SC Toolbox [28, 30]. 1. The side-length ratios and the prevertices z j on the sides of the infinite strip 0 ≤ ℑ (z) ≤ 1 are obtained using a quasi-Newton method, or a modular nonlinear equation solver such as Algorithm D6.1.3 NEDRIVER in [24, p. 285], from the n − 3 real side-length conditions that arise from the integrals of f 0 along the polygon side preimages between consecutive 73 prevertices: ˆ z j+1 0 f (ζ ) dζ = w j+1 − w j , j = 1, 3, . . . , n − 2, zj where the initial guess for the prevertices z j is made by placing points equidistantly on the sides of the infinite strip 0 ≤ ℑ (z) ≤ 1 matching the Dirichlet boundary conditions. 2. The corners of the rectangle are determined in the form K, K + i K 0 , −K + i K 0 , −K  from the side-length ratios. 3. The prevertices v j are obtained as preimages of z j under the conformal mapping from the rectangle to the infinite strip f1 (v) = 1 log (sn (v|m)) , π where the initial guess for the prevertices v j is made by placing points equidistantly on the sides of the rectangle matching the Dirichlet boundary conditions. 3.2.3 Multipole Terms Consider an element with the electrostatic potential ϕ (s, r, θ ), where s is the longitudinal and (r, θ ) are the polar transversal particle optical coordinates. We perform a Taylor series expansion of ϕ in r, followed by a Fourier series expansion of the result in θ [11, pp. 120–125]. The resulting Taylor–Fourier series expansion +∞ +∞ ϕ (s, r, θ ) = ∑ ∑ Mk,l (s) cos  lθ + θk,l rk k=0 l=0 is the multipole expansion of the potential2 . The term Ml,l (s) is called the multipole strength of order l, and θl,l is called the phase. 2 Whenever r is not scaled in a formula explicitly, e.g., to a radius R relative to a reference radius Rref , it is assumed to be implicitly scaled. 74 As [11, pp. 120–125] shows, the terms Mk,l (s) with (k, l) other than k = l, l + 2, l + 4, . . . vanish. For n ∈ N, (2n) M (s)  l,l . Ml+2n,l (s) = 2 n 2 ∏ν=1 l − (l + 2ν) If Ml,l (s) is independent of s, the terms Mk,l (s) vanish for k > l. For an s-independent electrostatic potential ϕ, the multipole expansion has the form [11, pp. 120–125] +∞ ϕ (r, θ ) = ∑ Ml,l cos  lθ + θl,l rl . l=0 3.2.3.1 Fourier Analysis To obtain the multipole terms for an s-independent main field, it is sufficient to obtain the Fourier coefficients of the electrostatic potential at one radius Rref , which is called the reference radius. The reference radius Rref is normally chosen as large as possible for the numerical computation to most accurately distinguish and determine the multipole terms, but less than the aperture. The numerical solution for the electrostatic potential often has inaccuracies excessively close to the aperture, e.g., because of the nearby singularities in the ODE or the approach to the convergence radius of the Taylor series expansion. If the Fourier series expansion at the reference radius Rref is  a0Rref +∞ j  ϕ (r, θ ) = + ∑ r a jRref cos ( jθ ) + b jRref sin ( jθ ) , 2 j=1 the multipole expansion is then ϕ (r, θ ) = a0Rref 2 +∞  R +∑ r Rref j=1 j   a jRref cos ( jθ ) + b jRref sin ( jθ ) , (3.2) where R is the scaling radius. Denoting  A j = a jRref R Rref j  , B j = b jRref R Rref j in eq. 3.2, we obtain +∞  A ϕ (r, θ ) = 0 + ∑ r j A j cos ( jθ ) + B j sin ( jθ ) . 2 j=1 75 (3.3) In the cross section of an element with an s-independent main field, the aperture radius3 a is also a dimensional scale (δ r) of the radius. The scaling radius R is often chosen at or near the aperture4 . 3.2.3.2 Differential Algebra Methods One of the advantages of DA computations is that Taylor series expansions can be produced automatically for a highly complex analytic function by substituting its comprising functions with their DA values. Another advantage is the DA fixed-point algorithms, e.g., for the inversion of a Taylor series expansion, that complete in finitely many steps [11, pp. 96–102]. Knowing the analytic expression for f 0 and the constant part (the scalar value) g0 = cons (g (0)) ∈ C of the DA value of g = f −1 at the origin w = 0, we can obtain the DA value5 of f 0 (v) at v = g0 . Then the DA value of f (g0 ) is f (g0 ) = 0 + ∂ −1 f 0 (g0 ) , where ∂ −1 is the antiderivation operator, which is the DA equivalent of taking the integral ´z 0 p (t) dt of a Taylor expansion p (z). The DA value of g (0) is then obtained by taking the DA inverse of ∂ −1 f 0 (g0 ) and adding the constant part:  −1 −1 0 g (0) = g0 + ∂ f (g0 ) . Now we obtain the DA value of the electrostatic potential ϕ at the origin as ϕ (0) = ψ ◦ g (0) , 3 The aperture is the radius of the largest circle with center at the origin of the local Frenet–Serret frame that can be inscribed in the cross section of the element. Thus, the aperture is also the radius of convergence of the Taylor expansion of the electrostatic potential at the origin of the complex plane. 4 The reasons for scaling are twofold: (1) scaling gives practical advantages in some calculations, such as reduction of floating-point errors; and (2) scaling applies the notions of magnitude and scale, which are universal in physics and are useful, e.g., for phenomenological and asymptotic analysis. 5 The appropriate DA algebra here is D , where n is the desired order of computation and v is n v the number of variables v ≥ 1. 76 Y.K. Semertzidis et al. / Nuclear Instruments and Methods in Physics Research A 503 (2003) 458–484 476 8.0 19 20 6.0 18 16 7 21 43 49 30 2.0 4 41 38 1 34 42 48 33 37 Y [cm] 2 UNITS Length : cm Flux density : C m Field strength : V m Potential :V Conductivity : S m Source density : C cm Power :W Force :N Energy :J Mass : kg 3 47 15 5 29 17 4.0 6 0.0 39 -2.0 35 51 40 22 45 36 24 10 32 -6.0 25 23 26 -8.0 -8.0 27 -6.0 8 44 50 -4.0 PROBLEM DATA quad_no_offset.st Linear elements XY symmetry Scalar potential Electric fields Static solution Scale factor = 1.0 6084 elements 3155 nodes 52 regions 31 52 -4.0 9 46 28 -2.0 14 2.0 0.0 Component: #POT3 -1000.0 4.0 11 13 6.0 12 8.0 10.0 0.0 12.0 14.0 16.0 X [cm] 1000.0 OPERA- Fig. 18. The plotted parameter #POT3 is the regular potential (plotted in Fig. 17) minus the quadrupole potential and is defined as 2 Figure Cross g-2ofcollaboration quadrupole. (Reprinted Nucl. Instr.visible. #POT3 ¼ POT3.1:  ðPOT Þ * ðx2  of y2 Þ:the TheMuon dominance the 20 pole, b10 =b circle with r from ¼ 4:5 cm; is clearly 2 cm =2section 2 ¼ 1:9% on the Meth. Phys. Res. A, Vol. 503, Yannis K. Semertzidis et al., The Brookhaven Muon (g-2) Storage Ring High Voltage Quadrupoles, Page No. 476, Copyright 2003, with permission from Elsevier.) Table 6 Table where 5 ψ is the solution of the Laplace equation for the electrostatic field in the canonical domain. The potential multipoles at r ¼ 4:5 cm, the edge of the muon The potential multipoles at r ¼ 4:5 cm; the edge of the muon region, forof negative storage region, for negative 724 kV onofthe We obtain the muon Taylorstorage seriesand expansion ϕ fromstorage the DA value ϕ (0) muon as storage and 724 kV on the plates plates Order of multipole 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Cosine term (Normal) [V] n Sine term ϕ (w) [V] = (skewed) Order of multipole ∑ ck wk + o (wn) . Cosine term (normal) [V] Sine term (skewed) [V] j=0 1 405 345 0.0 ð12Þ 0.0  2 19875 75 20177.8 0.1 To obtain the multipole coefficients in the trigonometric form, we take a = 2c , a = ℜ c , j j 0 3 173 0 120 0.0 ð28Þ 0.0  4 190 20 33.0 ð153Þ 0.1 and b j = ℜ i c0.0j ð10Þ , where j = 1, 2,0.0 . . .ð8Þ , N. 5 10 8 6 35 30 45:9 ð26Þ 0.1 We may now radius R relative to7 a reference radius 50Rref . If scaling was 35 not 0.0 apply a scaling0.0 8 20 10 5:5 0:2 30 0.0 to these calculations, 0.0 performed prior the reference9 radius is Rref = 150 in the units used for the 10 391.3 0 391:3 0.1 11 15 10 0.0 0.0 calculations. 12 20 4 6:5 ð18Þ 0.0 13 4 2 0.0 0.0 14 50 2 52.3 0:1 3.2.4 Calculations and Results The placement of the plates is assumed ideal and the distance of the plates from the vacuum chamber walls is equal for all plates as shown Fig.shows 17. In the parentheses we showofthe Fig.in3.1 cross section themultipoles Muon g-2 generated due to the scalloped vacuum chambers violating the four fold symmetry. The placement of the plates is assumed to be the worst possible (i.e. 70:75 mm on the side plates, and 70:5 mm on the top ones). The multipoles shown are the highest values found when collaboration quadrupole. different combinations of non ideal quad plate positioning is assumed. 77 First, we considered the case with non-mispowered plates and no geometric asymmetries. We solved the problem for one-eighth of the cross section and extended the solution to the entire cross section, utilizing the four-fold rotational symmetry and the four mirror symmetries. Next, we considered the general case of mispowered plates and geometric asymmetries. In that case, we approximated the cross-sectional geometry by a simply-connected region using connecting rods between the plates and the rectangular enclosure. Having calculated the electrostatic potential using conformal mapping methods with one plate at 1 V and the other plates and the rectangular enclosure at 0 V, we applied geometrical perturbations, rotations, and scaling to four copies of the potential and superimposed them to obtain the solution for the potential. All multipole expansions presented here are up to the order 24. The unit of length in the physical domain is centimeters. Unless otherwise specified, we used MATLAB R2016b, the SC Toolbox 2.3, COSY INFINITY 9.1 [68], and Mathematica 11 for calculations. We enumerated the quadrupole plates, as well as their voltage coefficients V j and errors D j in the distance from the origin, where j = 1, 2, 3, 4, in the counter-clockwise direction starting from the left plate on the cross section drawing. 3.2.4.1 Nominal Symmetric Case (“SM”) The four-fold rotational symmetry and the four mirror symmetries (with accounting for the alternating sign of the voltages) in the case of non-mispowered plates and symmetrical geometry allow us to reduce the problem of finding the electrostatic potential in the entire cross section of the quadrupole to obtaining it only in one-eighth of the geometry. This one-eighth part of the cross-sectional geometry is shown in Fig. 3.2. We denote this nominal symmetric case as “SM”. The MATLAB function listed in App. C.1 returns the conformal mapping object f for a conformal mapping from a rectangle to the interior of the polygon object p representing the 2D geometry. Entering [p, f] = initquad4 in the MATLAB command line yields the prevertices and the corners of the rectangular canonical domain: 78 Figure 3.2: Model of one-eighth of the cross section of the Muon g-2 collaboration quadrupole for the case of non-mispowered plates and no geometric asymmetries (“SM”). rectmap o b j e c t : cnr vertex alpha prevertex −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 1 0.00000 + 7.00000 i 0.50000 1 . 5 7 0 7 9 6 3 3 e +00 −5.59792 + 7 . 0 0 0 0 0 i 0.50000 1 . 5 7 0 7 9 6 3 3 e +00 + 5 . 6 8 5 5 7 1 2 5 e +00 i −5.59792 + 5 . 8 7 9 9 0 i 0.75000 1 . 5 7 0 7 9 6 3 3 e +00 + 5 . 7 4 7 5 5 8 2 6 e +00 i −4.49396 + 4 . 7 7 5 9 4 i 1.50000 1 . 5 7 0 7 9 6 3 3 e +00 + 6 . 2 6 9 7 6 0 3 1 e +00 i −4.63495 + 4 . 6 3 4 9 5 i 0.50000 1 . 5 7 0 7 9 6 3 3 e +00 + 6 . 3 5 3 3 4 3 3 4 e +00 i 2 0.00000 + 0.00000 i 0.25000 1 . 5 7 0 7 9 6 3 3 e +00 + 1 . 0 7 0 1 3 8 8 7 e +01 i 3 0.00000 + 5.00000 i 0.50000 −1.57079633 e +00 + 1 . 0 7 0 1 3 8 8 7 e +01 i −2.35000 + 5 . 0 0 0 0 0 i 1.50000 −1.57079633 e +00 + 6 . 9 1 8 0 9 8 9 7 e +00 i −2.35000 + 5 . 3 0 0 0 0 i 1.50000 −1.57079633 e +00 + 5 . 2 7 5 6 5 5 7 0 e +00 i 0.00000 + 5.30000 i 0.50000 −1.57079633 e +00 4 79 c = −3.9440549 e −15 − 6 4 . 4 1 1 3 0 5 i C o n f o r m a l modulus = 3 . 4 0 6 3 5 7 8 A p p a r e n t a c c u r a c y i s 6 . 4 0 e −14 A heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f is shown in Fig. 3.3. Now we apply the list of prevertices, the list of α’s, the scaling constant c, and the parameter m to the analytic formula for the derivative f 0 of the conformal mapping in eq. 3.1. Note that the scaling constant c in eq. 3.1 is different from the constant c in the MATLAB output. The constant c and the parameter m are obtained as described in App. A. The resulting derivative f 0 : C → C, v 7→ w of the conformal mapping from the rectangular canonical domain to the physical domain is n f 0 (v) = c cn (v|m) dn (v|m) ∏ sn (v|m) − sn x j + i y j |m α −1 j , j=1 where n is the number of polygon vertices. The scaling constant is c = −i 12429.568123663117, and the parameter m is m = 8.1098319813220654 × 10−9 . The other parameters are as follows: α = (0.5, 0.5, 0.75, 1.5, 0.5, 0.25, 0.5, 1.5, 1.5, 0.5) ,   x = K (m) , . . . , K (m), − K (m) , . . . , − K (m) , | {z }| {z } 4 times 6 times and y = (0, 5.6855712537881429, 5.7475582573144708, 6.2697603145320198, 6.3533433441730081, 10.701388724040664, 10.701388724040664, 6.9180989665683397, 5.2756556972892490, 0) . The preimage v0 of the origin w = 0 is v0 = g (0) = 1.570796329979620 + i 10.70138872404065. 80 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.3: “SM MATLAB”: heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f. The derivative f 0 has a branch point at v = v0 , which presents certain difficulties in the analysis. For example, it is not possible to obtain the electrostatic potential multipole terms by obtaining f via a Taylor series expansion of f 0 and then calculating the inverse series. The same applies to the calculation of DA values of f at point v = v0 . 3.2.4.1.1 Differential Equation Solution in Mathematica (“Mathematica PDE”) First, we obtained the electrostatic potential ϕ on the vertical edge of the polygon, shown in Fig. 3.4, in Mathematica by solving the restriction of the ODE dg (w) 1 = 0 , dw f (g (w)) g (w0 ) = z0 (see App. A) to the respective one-dimensional case, where a point w0 was chosen on the vertical edge. Next, we solved the Cauchy–Riemann PDE in Mathematica, with the boundary conditions as found in the previous step on the vertical edge and as zero on the diagonal edge of the polygon. The result is shown in Figs. 3.5 and 3.6. 81 Figure 3.4: “SM Mathematica PDE”: vertical boundary condition of the Laplace equation for the electrostatic potential ϕ. Figure 3.5: “SM Mathematica PDE”: 3D plot of the solution of the Cauchy–Riemann PDE for the electrostatic potential ϕ. Finally, we calculated the Fourier modes of ϕ at the reference radii Rref = 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5 cm by taking numerical integrals. For each radius, we formulated the multipole terms in accordance to 82 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.6: “SM Mathematica PDE”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. eq. 3.3. 3.2.4.1.2 Fourier Analysis in MATLAB (“MATLAB Fourier”) For the conformal mapping object f and a reference radius R, the MATLAB function listed in App. D.1 calculates the discrete Fourier transform (DFT) dn and the Fourier modes a0 , an , bn of the electrostatic potential ϕ using a fast Fourier transform (FFT). To that end, the MATLAB function performs an equidistant discretization of the circle of radius R, centered at the origin r = 0, with N = 1001 arc intervals of length 4t = 2πR/N. It computes the inverse values of the conformal mapping object f at that grid-point set:   N−1  −1 −1 u= f R cos ( j4t) , f (R sin ( j4t)) . j=0 The DFT of the electrostatic potential ϕ around the circle of reference radius R is obtained as the FFT transform of u, with Fourier parameters (a, b) = (1, −1), divided by N:   1 N−1 2πi dn = ∑ u j exp − N jn . N j=0 83 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.7: “SM MATLAB Fourier”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. The Fourier modes in trigonometric form are obtained from the DFT, utilizing the Hermitian symmetry [16, pp. 76–77], as a0 = 2d0 , an = dn + dN−n , bn = dn − dN−n . From the Fourier modes calculated for each of the reference radii Rref = 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5 cm, we formulated the multipole terms in accordance to eq. 3.3. Figs. 3.7 and 3.8 show plots of the multipole expansion with Rref = 4.5 cm starting from the zeroth and the third order, respectively. 3.2.4.2 Non-Symmetric Case (“NSM”) Regarding the general case of mispowered plates and geometric asymmetries, we cannot simplify the problem by reducing the physical domain, using the four-fold symmetry and the four mirror 84 4 2 0.00100 0.00001 1.×10-7 1.×10-9 0 -1.×10-9 -1.×10-7 -0.00001 -2 -0.00100 -4 -4 -2 0 2 4 Figure 3.8: “SM MATLAB Fourier”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. symmetries, as we did in the SM case. We denote this general non-symmetric case as “NSM”. The cross section of the quadrupole is represented by a multiply-connected region consisting of five simple polygons: the rectangular enclosure and the trolley rails as one simple polygon and each of the four plates as one simple polygon. The conformal mapping theory for physical domains as n-connected regions for n > 2 is quite challenging (see, e.g., [22]), and, in practice, various approximations and assumptions are used. Doubly connected regions require specialized methods and present certain restrictions and issues [30, pp. 64–70]. We approximated the cross-sectional geometry by a simply-connected region using connecting rods between the rectangular enclosure and the four plates, as Fig. 3.9 shows. We placed the rods in the middle of the back side of each plate to minimize their impact on the multipole terms. We consider geometric asymmetries as errors in the distances between the plates and the origin in the cross section. In principle, we could supply arbitrary plate distance errors as parameters in the polygonal model and compute the respective conformal mapping using the SC Toolbox. However, due to the 85 Figure 3.9: Model of the cross section of the Muon g-2 collaboration quadrupole for the case of mispowered plates and geometric asymmetries (“NSM”). Figure 3.10: Distances between successive prevertices zn of a conformal mapping from a rectangle to the interior of the polygon representing the cross-sectional geometry in the NSM case. 86 crowding phenomenon [30, 6, 31, 7] illustrated by the distances between successive prevertices in Fig. 3.10 reaching ∼ 10−4 , the optimization algorithm that obtains conformal mapping prevertices in the SC Toolbox is affected by numerical stability issues and often does not converge. Hence, we treat plate distance errors as perturbations and, for each plate distance error, use a two-point linear interpolation (or extrapolation, as applicable, which has the same formula in this case) based on the solution for the nominal geometry and one other solution where optimization had successfully converged. Having prepared the interpolation data, we obtain the electrostatic potential in the NSM case using the following adaptation of the general method: 1. Calculate the electrostatic potential using conformal mapping methods with one plate – the left plate on the cross section drawing (as in Fig. 3.1) – at 1 V and the other Dirichlet boundary conditions (the remaining plates, the rectangular enclosure, and the trolley rails) of 0 V. 2. Apply plate distance errors as perturbations to four copies of the potential, each copy corresponding to one plate at 1 V and the other Dirichlet boundary conditions of 0 V. 3. Apply appropriate rotations to these four copies of the potential, scale the copies (e.g., by ±2.4 × 104 or with mispowered values), and use their superposition. To test NSM results against SM results, we used the identical configuration of non-mispowered plate voltages (±2.4 × 104 V) and no geometric asymmetries. The MATLAB function listed in App. C.2 returns the conformal mapping object f for a conformal mapping from a rectangle to the interior of the polygon object p representing the 2D geometry. We note that, of MATLAB releases R2009a, R2014b, R2016b, and R2017a, this calculation successfully completes only in releases R2016b and R2017a. A heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f is shown in Fig. 3.11. Next, we apply the list of prevertices, the list of α’s, and the parameter m to the analytic formula for the derivative f 0 of the conformal mapping in eq. 3.1. The scaling constant c in eq. 3.1 differs 87 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.11: “NSM MATLAB”: heatmap plot of the electrostatic potential as the inverse of the conformal mapping object f. from the constant c in the MATLAB output. The constant c and the parameter m are obtained as described in App. A. The resulting derivative f 0 : C → C, v 7→ w of the conformal mapping from the rectangular canonical domain to the physical domain is n f 0 (v) = c cn (v|m) dn (v|m) ∏ sn (v|m) − sn x j + i y j |m α −1 j , j=1 where n is the number of polygon vertices. The scaling constant is c = 1.1819869586349204 × 107 , and the parameter m is m = 2.1776166063953954 × 10−15 . The other parameters are as follows: α = (0.5, 1.5, 1.5, 1.5, 1.5, 0.5, 0.5, 0.5, 0.75, 1.5, 1.5, 0.75, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 0.5, 0.5, 0.5, 0.75, 1.5, 1.5, 0.75, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 0.5, 0.5, 0.5, 0.75, 1.5, 1.5, 0.75, 0.5, 0.5, 0.5, 1.5, 1.5, 1.5, 1.5, 0.5, 0.5, 0.5, 0.75, 1.5, 1.5, 0.75, 0.5, 0.5) ,   x = K (m) , . . . , K (m), − K (m) , . . . , − K (m) , | {z }| {z } 6 times 50 times 88 and y = (0, 4.707844817895257, 6.1123226415433312 12.154244427584317, 13.558722251232082, 18.266567069128161, 18.266567069128161, 13.274266140422423, 12.918629029969397, 11.576281153221727, 10.948991934692465, 10.675215453051434, 10.65269458697405, 10.604072782442005, 10.6027963210765, 10.569241422270052, 10.476916632115067, 9.4896639886962486, 9.4722605135357565, 9.4665721145687325, 9.4663618193493928, 9.4586650413212396, 9.4552969316026854, 9.4223471739893334, 9.3806007759118621, 9.3504541968427848, 9.3474996905761945, 9.3408322140301419, 9.3406516641648345, 9.3358001108809781, 9.3213334522713787, 8.9452336168578217, 8.9307669582482223, 8.9259154049643676, 8.9257348550990603, 8.9190673785530059, 8.9161128722864156, 8.8859662932173382, 8.8442198951398652, 8.8112701375265097, 8.8079020278079554, 8.8002052497797987, 8.799994954560459, 8.794306555593435, 8.7769030804329375, 7.7896504370136723, 7.6973256468586344, 7.6637707480521646, 7.6624942866866617, 7.6138724821545702, 7.5913516160771657, 7.3175751344358959, 6.6902859159059922, 5.347938039156598, 4.9923009287031883, 0) . The preimage v0 of the origin w = 0 is v0 = g (0) = −0.9486801376613026 + i 9.133283534564583. 89 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.12: “NSM MATLAB Fourier”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. 3.2.4.2.1 Fourier Analysis in MATLAB (“MATLAB Fourier”) For the conformal mapping object f and a reference radius R, the MATLAB function listed in App. D.2 calculates the DFT dn and the Fourier modes a0 , an , bn of the electrostatic potential ϕ using an FFT. From the Fourier modes calculated for each of the reference radii Rref = 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5 cm, we formulated the multipole terms in accordance to eq. 3.2. Figs. 3.12 and 3.13 show plots of the multipole expansion with Rref = 4.5 cm starting from the zeroth and the third order, respectively. 3.2.4.2.2 DA Calculation in Mathematica (“Mathematica DA”) Mathematica has a DA implementation, where DA values are encoded in SeriesData objects. Mathematical operations are defined for SeriesData objects and produce results as SeriesData objects. 90 4 2 0.00100 0.00001 1.×10-7 1.×10-9 0 -1.×10-9 -1.×10-7 -0.00001 -2 -0.00100 -4 -4 -2 0 2 4 Figure 3.13: “NSM MATLAB Fourier”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. We developed a Mathematica notebook that, for the conformal mapping derivative f in the analytic form, calculates the multipole terms a0 , an , bn (trigonometric form), and cn (exponential form) of the electrostatic potential ϕ using the DA method described in sec. 3.2.3.2. This Mathematica notebook is listed in App. E. The Mathematica notebook outputs the unscaled Fourier modes a0 , an , and bn (trigonometric form) as the scalar value a0 and the lists an and bn, respectively: a0 = 0 . 3 9 6 0 5 1 4 6 6 7 1 2 4 1 6 0 3 an = { − 0 . 0 6 8 8 5 6 6 9 8 7 6 0 2 5 1 1 9 , 0 . 0 1 0 3 8 5 4 9 8 3 3 5 5 1 0 0 0 7 , −0.0012979130328780464 ,0.00011476439020259089 , −8.616661281676434∗10^ −6 , −8.001918237312118∗10^ −8 , 2.0824622994066985∗10^ −7 , −5.650565366333305∗10^ −8 , 9.49311257232955∗10^ −9 , −1.1783959917396393∗10^ −9 , 8.67 49921 8 2 6 5 7 3 0 3 ∗ 1 0 ^ −1 1 , 4 . 7 4 3 9 2 5 8 9 5 3 9 9 7 2 5 5 ∗ 1 0 ^ −1 2 , −2.0785575798462163∗10^ −12 ,4.148094011328047∗10^ −13 , −6.33695369929115∗10^ −14 ,8.492752468745464∗10^ −15 , 91 −1.873561549973473∗10^ −15 ,3.4306594232475737∗10^ −16 , −4.803243173690091∗10^ −17 ,3.624992112376469∗10^ −18 , 6.630918080108423∗10^ −19 , −3.3213814949302035∗10^ −19 , 8.966581646343429∗10^ −20 , −1.9952929970350762∗10^ −20 , 3.793742595796802∗10^ −21 , −2.8012134244396143∗10^ −22} bn ={8.336931069526638∗10^ −10 , −3.794138538379455∗10^ −10 , 9.09371800225003∗10^ −11 , −1.3418145691681178∗10^ −11 , 1.04 94507 6 5 0 3 7 2 8 2 6∗ 1 0 ^ −1 2 , 1 . 0 3 3 2 2 3 5 6 4 6 5 5 2 1 3 9 ∗ 1 0 ^ −1 3 , −6.485090438390214∗10^ −14 ,1.6930587560640178∗10^ −14 , −3.120390662980916∗10^ −15 ,4.06780222146135∗10^ −16 , −1.5013659690567033∗10^ −17 , −1.929422691566964∗10^ −17 , 1.4144128584705∗10^ −17 , −7.650940703168617∗10^ −18 , 3.0481313019656075∗10^ −18 , −5.667559487084578∗10^ −19 , −3.51094538704568∗10^ −19 ,4.6557961617641415∗10^ −19 , −3.166471479008234∗10^ −19 ,1.574207595519098∗10^ −19 , −5.787690633861256∗10^ −20 ,1.1856606658833134∗10^ −20 , 3.380342869683127∗10^ −21 , −5.488606040416573∗10^ −21 , 3.8095070621154405∗10^ −21 , −1.9698604453416265∗10^ −21} Figs. 3.14, 3.15 show plots of the multipole expansion starting from the zeroth and the third order, respectively. 3.2.4.2.3 DA Calculation in COSY INFINITY (“COSY INFINITY DA”) We implemented the calculation of the multipole terms using the DA method described in sec. 3.2.3.2 as a COSY INFINITY program called mterms. The program queries the user for optional changes to nominal plate voltage magnitude (default value 24, 000 V), plate voltage coefficients (default values V1 = 1, V2 = −1, V3 = 1, and V4 = −1), errors in distances from the origin to the plates (default values D1 = 0 cm, D2 = 0 cm, D3 = 0 cm, D4 = 0 cm), and scaling radius of the multipole coefficients (default value R = 4.5 cm). 92 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.14: “NSM Mathematica DA”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. 4 2 0.00100 0.00001 1.×10-7 1.×10-9 0 -1.×10-9 -1.×10-7 -0.00001 -2 -0.00100 -4 -4 -2 0 2 4 Figure 3.15: “NSM Mathematica DA”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. 93 Nonzero values of D j were implemented using linear interpolation. For details, see the description in the error analysis section below. The 2D geometry data is stored in mterms in the SC Toolbox format. The program generates a MATLAB M-file that uses the SC Toolbox to calculate the prevertices z j , the constant c, the strip length L, and the preimage g (0) of the origin w = 0. Next, multipole terms are calculated using DA. Alternatively, the user can select the option to use pre-calculated multipole terms stored in the program. The following is the program output with the default parameters. MULTIPOLE TERMS SCALED TO R = 4 . 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cm NOMINAL PLATE VOLTAGE PHI = 24000.00000000000 V PLATE VOLTAGE COEFFICIENTS : PLATE 1 : V1 = 1.000000000000000 PLATE 2 : V2 = −1.000000000000000 PLATE 3 : V3 = 1.000000000000000 PLATE 4 : V4 = −1.000000000000000 PLATE DISTANCE ERRORS : PLATE 1 : D1 = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 cm PLATE 2 : D2 = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 cm PLATE 3 : D3 = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 cm PLATE 4 : D4 = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 cm A0 = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 N AN BN 1 −0.1270392504150563E−11 −0.1498801083243961E−11 2 3 20189.41051825105 0 . 1 0 1 8 5 4 7 3 9 9 9 0 7 8 9 4 E−11 0 . 1 7 6 6 0 2 7 5 3 6 6 7 8 2 1 0 E−02 −0.9484600604903193E−12 94 4 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 5 5 3 2 7 3 1 2 6 7 8 1 9 5 6 2 E−12 5 −0.9367417464417151E−12 −0.2250740182608863E−12 6 −63.78872501452805 7 0 . 1 7 5 3 6 7 1 1 5 9 6 1 5 4 6 6 E−12 0 . 1 6 6 1 6 7 9 2 7 5 4 4 1 7 0 0 E−12 8 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 −0.2234113065318811E−12 9 0 . 4 8 6 2 3 0 2 4 7 6 8 8 4 5 4 4 E−12 0 . 1 8 0 2 6 2 5 2 8 5 4 1 2 2 0 1 E−12 10 −385.2021979951332 0 . 2 3 9 8 6 8 5 3 6 2 1 0 9 5 0 8 E−03 11 0 . 7 0 8 6 3 1 6 9 0 6 1 7 0 8 0 1 E−13 0 . 1 5 6 8 4 9 5 2 4 3 4 5 9 2 4 9 E−12 12 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 1 1 5 3 7 2 0 1 5 9 9 3 3 9 6 5 E−13 13 −0.7883469452910978E−13 0 . 3 0 0 7 7 6 7 8 6 7 4 2 8 9 5 8 E−13 14 55.60328952513591 −0.1248379149706613E−02 0 . 2 2 3 2 0 9 2 7 1 7 5 3 6 0 4 0 E−03 15 −0.1587524669086704E−13 −0.5139053379739946E−13 16 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 1 1 2 8 9 7 5 7 9 1 3 5 5 8 5 3 E−13 17 −0.3264494074407542E−13 0 . 8 4 3 1 2 5 9 4 5 1 1 3 5 8 4 8 E−14 18 18.83394598327191 −0.4786556212617289E−13 19 0 . 1 7 3 9 2 7 1 3 7 0 9 5 5 2 3 7 E−13 −0.1753062093467197E−13 20 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 9 7 6 5 8 2 1 2 6 8 6 5 6 3 9 4 E−14 21 −0.7524327143791555E−15 −0.7234953952318767E−15 22 −6.616981865806735 0 . 2 5 1 2 4 8 3 9 3 3 5 7 7 4 1 1 E−13 23 0 . 1 4 2 2 8 2 7 4 6 3 6 1 7 5 9 7 E−14 0 . 1 1 2 9 3 3 1 0 9 3 4 9 4 7 5 7 E−13 24 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 25 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+00 Figs. 3.16, 3.17 show plots of the multipole expansion starting from the zeroth and the third order, respectively. The calculation of multipole terms using “Mathematica DA” and “COSY INFINITY DA” completed in 14.5 min and 0.07 s on the same computer. 95 0.75 0.50 0.25 0 -0.25 -0.50 -0.75 Figure 3.16: “NSM COSY INFINITY DA”: heatmap plot of the multipole expansion of the electrostatic potential, up to order 24. 4 2 0.00100 0.00001 1.×10-7 1.×10-9 0 -1.×10-9 -1.×10-7 -0.00001 -2 -0.00100 -4 -4 -2 0 2 4 Figure 3.17: “NSM COSY INFINITY DA”: contour plot of the multipole expansion of the electrostatic potential, orders 3 to 24. 96 3.2.4.2.4 Python Version of mterms We implemented a Python version of the COSY INFINITY program mterms (see App. F for details and source code.). As Python does not have DA functionality, the Python version of mterms only use pre-calculated sets of multipole terms, with the same method and results as in the COSY INFINITY version introduced in case “COSY INFINITY DA”. The Python version does not include de novo computation of multipole terms using the SC Toolbox and DA. 3.2.4.3 Multipole Terms Table 3.1 lists multipole terms for cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM MATLAB Fourier”, and “NSM Mathematica DA”. Table 3.2 lists multipole terms for case “NSM COSY INFINITY DA”. For each plate voltage coefficient V j + 4V j and distance from the origin D j (8 cases in total), we computed multipole terms in “NSM Mathematica DA” with a perturbation 4V j or D j , respectively, the rest of these parameters remaining unperturbed. The unperturbed values are D j = 0 cm and V j + 4V j with 4V j = 0, V1 = 1, V2 = −1, V3 = 1, and V4 = −1. Multipole terms with perturbations 4V j and D j of plate voltage coefficients and plate distances are listed in Tables 3.3, 3.4 and 3.5, 3.6, respectively. We note that in “NSM COSY INFINITY DA”, multipole terms for order n = 24 are numerically calculated as zero even if the computation order in mterms is increased from the default value of 25 to 30. This is due to floating-point underflow. 3.2.4.4 Error Analysis In this a posteriori error analysis, we use methods and measures that include the following: 97 Order n SM Mathematica PDE SM MATLAB Fourier NSM MATLAB Fourier NSM Mathematica DA 1 1.9745943647419334 × 10−12 9.079982791749051 × 10−14 0. 0. 2 20214.97653712142 20232.98426780849 20189.40925816141 20189.40876423145 3 2.5046868116525192 × 10−12 −1.5984993366164723 × 10−11 0. 0. 4 −1.999071489496519 × 10−6 −1.6264478976965794 × 10−11 0. 0. 5 8.845917707820406 × 10−13 9.14806631798289 × 10−12 0. 0. 6 −99.48139575133254 −118.26614359059352 −63.788529979036376 −63.788211449330845 7 1.5853077240419715 × 10−12 8.78863940492948 × 10−12 0. 0. 8 −8.017648259522616 × 10−13 −2.7459971391853632 × 10−11 0. 0. 9 1.298726494930936 × 10−12 −2.6192553454071565 × 10−11 0. 0. 10 −259.77056186360966 −360.8978554756162 −385.20109622396365 −385.20119645612806 11 7.355032700884383 × 10−13 8.287110710130606 × 10−12 0. 0. 12 −1.1562641498237162 × 10−12 3.043766956845234 × 10−11 0. 0. 13 1.762557385977699 × 10−12 2.3045039516510903 × 10−11 0. 0. 14 27.990065388237984 49.6181080101752 55.602386906876 55.602589324698265 15 3.3925916602277514 × 10−12 4.107208903423128 × 10−12 0. 0. 16 −1.828818941841522 × 10−12 1.0954794995043528 × 10−14 0. 0. 17 1.3782403619675239 × 10−12 8.153607909284305 × 10−12 0. 0. 18 −84.09455183738272 19.954184119037713 18.8341954294158 18.85706451271575 19 0. 5.86335215814601 × 10−13 0. 0. 20 −0.000035820067317830976 −3.6922316850239525 × 10−11 0. 0. 21 1.5107634736951705 × 10−12 −4.0231745053258074 × 10−11 0. 0. 22 0.3874045390909366 −7.1158335523071745 −6.616941027862705 −7.486266749401171 23 1.013801804716496 × 10−12 6.954205882858485 × 10−12 0. 0. 24 −2.87575152448993 × 10−12 2.4426166197145148 × 10−11 0. 0. Table 3.1: Multipole terms Mn,n in cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM MATLAB Fourier”, and “NSM Mathematica DA”. 98 Order n Cosine terms A0 , An Sine terms Bn 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 N/A −1.498801083243961 × 10−12 1.766027536678210 × 10−3 −9.484600604903193 × 10−13 5.532731267819562 × 10−13 −2.250740182608863 × 10−13 −1.248379149706613 × 10−3 1.661679275441700 × 10−13 −2.234113065318811 × 10−13 1.802625285412201 × 10−13 2.398685362109508 × 10−4 1.568495243459249 × 10−13 1.153720159933965 × 10−14 3.007767867428958 × 10−14 2.232092717536040 × 10−4 −5.139053379739946 × 10−14 1.128975791355853 × 10−14 8.431259451135848 × 10−15 −4.786556212617289 × 10−14 −1.753062093467197 × 10−14 9.765821268656394 × 10−15 −7.234953952318767 × 10−16 2.512483933577411 × 10−14 1.129331093494757 × 10−14 0. 0. −1.270392504150563 × 10−12 20189.41051825105 1.018547399907894 × 10−12 0. −9.367417464417151 × 10−13 −63.78872501452805 1.753671159615466 × 10−13 0. 4.862302476884544 × 10−13 −385.2021979951332 7.086316906170801 × 10−14 0. −7.883469452910978 × 10−14 55.60328952513591 −1.587524669086704 × 10−14 0. −3.264494074407542 × 10−14 18.83394598327191 1.739271370955237 × 10−14 0. −7.524327143791555 × 10−16 −6.616981865806735 1.422827463617597 × 10−15 0. Table 3.2: Multipole terms A0 , An , and Bn in case “NSM COSY INFINITY DA”. The sine multipole terms are included for comparison with “NSM COSY INFINITY DA” multipole terms calculated with perturbed geometry and voltages in Tables 3.3, 3.4, 3.5, and 3.6. 99 Order n 4V1 = 10−5 4V2 = −10−5 4V3 = 10−5 4V4 = −10−5 0 9.505235201160260 × 10−2 −9.505235201160260 × 10−2 9.505235201160260 × 10−2 −9.505235201160260 × 10−2 1 −7.436523597891738 × 10−2 8.266246815751127 × 10−11 7.436523597637661 × 10−2 −8.515344572191423 × 10−11 2 20189.46099177735 20189.46099177735 20189.46099177735 20189.46099177735 3 −2.838536489744372 × 10−2 5.994811899668481 × 10−9 2.838536489948082 × 10−2 −5.992913734586033 × 10−9 4 1.129454381431691 × 10−2 −1.129454381431691 × 10−2 1.129454381431691 × 10−2 −1.129454381431691 × 10−2 5 −3.816042156893218 × 10−3 5.361648904967867 × 10−10 3.816042155019734 × 10−3 −5.380342277459531 × 10−10 6 −63.78888448634059 −63.78888448634059 −63.78888448634059 −63.78888448634059 7 1.867570482658803 × 10−3 −3.900047013374706 × 10−9 −1.867570482308069 × 10−3 3.900383589753429 × 10−9 8 −2.280364607148135 × 10−3 2.280364607148135 × 10−3 −2.280364607148135 × 10−3 2.280364607148135 × 10−3 9 1.723985667991497 × 10−3 1.310874637723331 × 10−9 −1.723985667019037 × 10−3 −1.309883051616690 × 10−9 10 −385.2031610006283 −385.2031610006283 −385.2031610006283 −385.2031610006283 11 3.190201723315910 × 10−4 1.851384811087571 × 10−9 −3.190201721898647 × 10−4 −1.851244694012594 × 10−9 12 7.850716940114915 × 10−5 −7.850716940114915 × 10−5 7.850716940114915 × 10−5 −7.850716940114915 × 10−5 13 −1.547902248761007 × 10−4 −1.535845107803755 × 10−9 1.547902247184313 × 10−4 1.535685413417173 × 10−9 14 55.60342853335972 55.60342853335972 55.60342853335972 55.60342853335972 15 −9.555798106664925 × 10−5 −2.717804380859608 × 10−10 9.555798103489875 × 10−5 2.717485332842149 × 10−10 16 5.761744754729378 × 10−5 −5.761744754729378 × 10−5 5.761744754729378 × 10−5 −5.761744754729378 × 10−5 17 −5.717782937401201 × 10−5 7.582411050566096 × 10−10 5.717782930872212 × 10−5 −7.583065672290997 × 10−10 18 18.83399306813687 18.83399306813687 18.83399306813687 18.83399306813687 19 −2.965993100024038 × 10−5 1.739271370955237 × 10−14 2.965993103502581 × 10−5 1.739297528979414 × 10−14 20 1.022093822923510 × 10−5 −1.022093822923510 × 10−5 1.022093822923510 × 10−5 −1.022093822923510 × 10−5 21 7.572076577709902 × 10−6 −7.524327143791555 × 10−16 −7.572076579214769 × 10−6 −7.524438561832755 × 10−16 22 −6.616998408261400 −6.616998408261400 −6.616998408261400 −6.616998408261400 23 1.787269032222077 × 10−5 1.422827463617597 × 10−15 −1.787269031937511 × 10−5 1.422783699214458 × 10−15 24 0. 0. 0. 0. Table 3.3: Cosine multipole terms A0 , An in case “NSM COSY INFINITY DA” with specified perturbations 4V j of plate voltage coefficients. 100 Order n 4V1 = 10−5 4V2 = −10−5 4V3 = 10−5 4V4 = −10−5 1 8.243405957841787 × 10−11 7.436523597614819 × 10−2 −8.543166174490580 × 10−11 −7.436523597914579 × 10−2 2 1.766031951747060 × 10−3 1.766031951747054 × 10−3 1.766031951747048 × 10−3 1.766031951747042 × 10−3 3 −5.994741812329063 × 10−9 −2.838536489941073 × 10−2 5.992844892208082 × 10−9 2.838536489751381 × 10−2 4 3.161414553920099 × 10−9 −3.160308004931769 × 10−9 3.161414548386968 × 10−9 −3.160307999398638 × 10−9 5 5.368765582249675 × 10−10 3.816042155731402 × 10−3 −5.373267062614893 × 10−10 −3.816042156181550 × 10−3 6 −1.248382270654487 × 10−3 −1.248382270654487 × 10−3 −1.248382270654487 × 10−3 −1.248382270654487 × 10−3 7 3.900364810142848 × 10−9 1.867570482649604 × 10−3 −3.900032474287760 × 10−9 −1.867570482317268 × 10−3 8 −3.117515154626748 × 10−9 3.117068330893074 × 10−9 −3.117515152436465 × 10−9 3.117068328702791 × 10−9 9 1.310568670004184 × 10−9 −1.723985667325004 × 10−3 −1.310208144947101 × 10−9 1.723985667685530 × 10−3 10 2.398691358822895 × 10−4 2.398691358822901 × 10−4 2.398691358822907 × 10−4 2.398691358822948 × 10−4 11 −1.851161851410052 × 10−9 3.190201724175774 × 10−4 1.851475550458744 × 10−9 −3.190201721038783 × 10−4 12 2.145763565102821 × 10−9 −2.145740490658827 × 10−9 2.145763565021230 × 10−9 −2.145740490536441 × 10−9 13 −1.535736195430552 × 10−9 1.547902248273437 × 10−4 1.535796350787900 × 10−9 −1.547902247671883 × 10−4 14 2.232098297767835 × 10−4 2.232098297767833 × 10−4 2.232098297767832 × 10−4 2.232098297767836 × 10−4 15 2.717131723054726 × 10−10 −9.555798110216454 × 10−5 −2.718159533730674 × 10−10 9.555798099938346 × 10−5 16 −7.035211691164543 × 10−10 7.035437486894595 × 10−10 −7.035211692308105 × 10−10 7.035437487956475 × 10−10 17 7.582821812568048 × 10−10 5.717782934979833 × 10−5 −7.582653187379024 × 10−10 −5.717782933293581 × 10−5 18 −4.786556212617289 × 10−14 −4.786561402226913 × 10−14 −4.786566591836537 × 10−14 −4.786588509350543 × 10−14 19 −1.753062093467197 × 10−14 −2.965993103516372 × 10−5 −1.753062093467197 × 10−14 2.965993100010247 × 10−5 20 9.765821268656394 × 10−15 9.765833785695678 × 10−15 9.765796234577818 × 10−15 9.765931443908367 × 10−15 21 −7.234953952318767 × 10−16 −7.572076579185831 × 10−6 −7.234953952318767 × 10−16 7.572076577738841 × 10−6 22 2.512483933577411 × 10−14 2.512492039090965 × 10−14 2.512500144604519 × 10−14 2.512484741876086 × 10−14 23 1.129331093494757 × 10−14 1.787269033209125 × 10−5 1.129331093494757 × 10−14 −1.787269030950463 × 10−5 24 0. 0. 0. 0. Table 3.4: Sine multipole terms Bn in case “NSM COSY INFINITY DA” with specified perturbations 4V j of plate voltage coefficients. 101 Order n D1 = 10−5 cm D2 = 10−5 cm D3 = 10−5 cm D4 = 10−5 cm 0 −4.424991842810755 × 10−2 4.424991842810755 × 10−2 −4.424991842810755 × 10−2 4.424991842810755 × 10−2 1 1.57876858921876 × 10−2 5.40683282654414 × 10−6 −1.578768589310954 × 10−2 −5.406834852347936 × 10−6 2 20189.38795547691 20189.38795547691 20189.38795547691 20189.38795547691 3 4.104796527084991 × 10−3 2.413725184267611 × 10−4 −4.104796525037468 × 10−3 −2.413725160359214 × 10−4 4 −2.947473221000326 × 10−3 2.947473221000326 × 10−3 −2.947473221000326 × 10−3 2.947473221000326 × 10−3 5 −1.817416554008738 × 10−3 2.062335646140603 × 10−5 1.81741655220565 × 10−3 −2.062335826776784 × 10−5 6 −63.78592414544445 −63.78592414544445 −63.78592414544445 −63.78592414544445 7 −2.467557291457782 × 10−3 −1.555384668326032 × 10−4 2.467557291799718 × 10−3 1.555384671863416 × 10−4 8 3.07300944321362 × 10−3 −3.07300944321362 × 10−3 3.07300944321362 × 10−3 −3.07300944321362 × 10−3 9 −1.556422642040572 × 10−3 5.247298500533006 × 10−5 1.556422643039743 × 10−3 −5.247298399725565 × 10−5 10 −385.2009674038089 −385.2009674038089 −385.2009674038089 −385.200967403809 11 −2.600024552646485 × 10−4 7.378270763189497 × 10−5 2.600024554055848 × 10−4 −7.378270748964422 × 10−5 12 −1.818382215511822 × 10−4 1.818382215511822 × 10−4 −1.818382215511822 × 10−4 1.818382215511822 × 10−4 13 4.506844218163286 × 10−4 −6.115724123437846 × 10−5 −4.506844219761083 × 10−4 6.115724107481854 × 10−5 14 55.60278639311861 55.60278639311861 55.60278639311861 55.60278639311861 15 3.710213603257118 × 10−4 −1.10878930476378 × 10−5 −3.710213603579178 × 10−4 1.108789301549602 × 10−5 16 −3.223080948135712 × 10−4 3.223080948135712 × 10−4 −3.223080948135712 × 10−4 3.223080948135712 × 10−4 17 1.182560483985171 × 10−4 3.004623224282604 × 10−5 −1.182560484631099 × 10−4 −3.004623230765092 × 10−5 18 18.83386356141041 18.83386356141041 18.83386356141041 18.83386356141041 19 −1.370788357518164 × 10−5 1.38000473541436 × 10−7 1.370788360996695 × 10−5 −1.380004387559051 × 10−7 20 6.371905486653597 × 10−5 −6.371905486653597 × 10−5 6.371905486653597 × 10−5 −6.371905486653597 × 10−5 21 −8.12996954732784 × 10−5 6.224477582157721 × 10−8 8.12996954717736 × 10−5 −6.224477732632099 × 10−8 22 −6.616896403654835 −6.616896403654835 −6.616896403654835 −6.616896403654835 23 −5.935334052843666 × 10−5 1.729810664202958 × 10−10 5.935334053128231 × 10−5 −1.729782206155512 × 10−10 24 0. 0. 0. 0. Table 3.5: Cosine multipole terms A0 , An in case “NSM COSY INFINITY DA” with specified perturbations D j of plate distances from the origin. 102 Order n D1 = 10−5 cm D2 = 10−5 cm D3 = 10−5 cm D4 = 10−5 cm 1 5.406833480936513 × 10−6 −1.578768589410862 × 10−2 −5.406834979737596 × 10−6 1.578768589111101 × 10−2 2 2.117816741216531 × 10−3 2.117816741216532 × 10−3 2.117816741216535 × 10−3 2.117816741216537 × 10−3 3 −2.413725186012523 × 10−4 4.104796524838491 × 10−3 2.413725162301022 × 10−4 −4.104796527209642 × 10−3 4 −6.241207228382077 × 10−7 6.241218293842069 × 10−7 −6.241207228369357 × 10−7 6.241218293831894 × 10−7 5 2.062335718565881 × 10−5 1.817416552817827 × 10−3 −2.062335763580684 × 10−5 −1.817416553342999 × 10−3 6 −1.496641666694401 × 10−3 −1.496641666694403 × 10−3 −1.496641666694403 × 10−3 −1.496641666694404 × 10−3 7 1.55538467170032 × 10−4 −2.467557291475427 × 10−3 −1.555384668614345 × 10−4 2.467557291807763 × 10−3 8 5.479028625297525 × 10−7 −5.479033093512959 × 10−7 5.479028625271038 × 10−7 −5.479033093486471 × 10−7 9 5.247298470503409 × 10−5 1.556422642722333 × 10−3 −5.247298431446527 × 10−5 −1.556422642361809 × 10−3 10 2.875084409755162 × 10−4 2.875084409755162 × 10−4 2.875084409755149 × 10−4 2.875084409755111 × 10−4 11 −7.378270740737561 × 10−5 −2.600024551827504 × 10−4 7.378270772107465 × 10−5 2.600024554916964 × 10−4 1.982877226920842 × 10−7 −1.982876996177626 × 10−7 1.982877226923698 × 10−7 −1.982876996180889 × 10−7 13 −6.115724112566527 × 10−5 −4.506844218671139 × 10−4 6.115724118582062 × 10−5 4.506844219272692 × 10−4 14 2.676013289590522 × 10−4 2.676013289590525 × 10−4 2.676013289590529 × 10−4 2.676013289590516 × 10−4 15 1.108789298159123 × 10−5 3.710213602890859 × 10−4 −1.108789308437229 × 10−5 −3.710213603918668 × 10−4 16 −1.716345429854064 × 10−7 1.716345655646772 × 10−7 −1.716345429848183 × 10−7 1.716345655641217 × 10−7 17 3.004623228456449 × 10−5 −1.18256048423242 × 10−4 −3.004623226770197 × 10−5 1.182560484401045 × 10−4 18 −4.786550271350386 × 10−14 −4.786548313818143 × 10−14 −4.786534788640852 × 10−14 −4.786507688191113 × 10−14 19 −1.380004736793519 × 10−7 −1.370788361010491 × 10−5 1.380004386181101 × 10−7 1.370788357504367 × 10−5 20 9.76581027479493 × 10−15 9.76589863347751 × 10−15 9.76565929472537 × 10−15 9.76649188717796 × 10−15 21 6.224477585051353 × 10−8 8.12996954718025 × 10−5 −6.224477729750432 × 10−8 −8.12996954732495 × 10−5 22 2.512482697969831 × 10−14 2.512441608739869 × 10−14 2.512405049788011 × 10−14 2.512476577073213 × 10−14 23 −1.72968350279657 × 10−10 −5.935334051856618 × 10−5 1.729909369015269 × 10−10 5.93533405411528 × 10−5 24 0. 0. 0. 0. · 12 Table 3.6: Sine multipole terms Bn in case “NSM COSY INFINITY DA” with specified perturbations D j of plate distances from the origin. 103 1015 1011 n=2 | Mn,n | 107 n=6 n=10 1000.0 n=14 n=18 n=22 0.1 10-5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Rref Figure 3.18: “SM Mathematica PDE”: multipole terms Mn,n versus reference radius Rref . 1. The apparent accuracy computed by the SC Toolbox. It is defined as the maximum of the differences of (1) the differences w j+1 − w j between successive finite polygon vertices and ´ v j+1 0 (2) the integrals v j f (ζ ) dζ between the respective prevertices. 2. Adaptations of C. Runge’s heuristic rule of a posteriori error estimation: “if the difference between two approximate solutions computed on a coarse mesh Th with mesh size h and refined mesh Th ref with mesh size href (e.g., href = h/2)” becomes small, then both approximated solutions uh ref and uh are probably close to the exact solution” [72, p. 31] and “also, the quantity uh − uh ref can be viewed (in terms of modern terminology) as a certain a posteriori error indicator” [91]. 3. Relative differences between the approximations of multipole terms. 4. Difference plots between the approximated multipole expansions and the approximation of the electrostatic potential in the SC Toolbox from the inverse of the conformal mapping object. 3.2.4.4.1 “SM Mathematica PDE” Fig. 3.18 shows the multipole terms Mn,n , scaled to R = 4.5 cm, versus the reference radius Rref . The relative difference between multipole terms Mn,n at Rref = 4.0 cm and Rref = 4.5 cm ranges 104 4 0.001 2 1.×10-7 1.×10-11 1.×10-15 0 -1.×10-15 -1.×10-11 -1.×10-7 -2 -0.001 -4 -4 -2 0 2 4 Figure 3.19: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “SM Mathematica PDE” as a multipole expansion up to order 24 and in (2) SM from the inverse of the conformal mapping object f. from ∼ 10−4 % for M2,2 to ∼ 102 % for M22,22 . Fig. 3.19 shows the difference between the potential ϕ obtained in (1) “SM Mathematica PDE” and in (2) SM from the inverse of the conformal mapping object f. 3.2.4.4.2 “SM MATLAB Fourier” Fig. 3.20 shows the convergence of multipole terms Mn,n , scaled to R = 4.5 cm, as a function of error tolerance ε specified by a line of the form o p t i o n s =scmapopt ( ’ Tolerance ’ , e p s i l o n ) ; in the function initquad4. The relative difference between multipole terms Mn,n at ε = 10−15 and ε = 10−16 ranges from ∼ 10−15 % for M2,2 to ∼ 10−12 % for M22,22 . Fig. 3.21 shows the multipole terms Mn,n , scaled to R = 4.5 cm, versus the reference radius Rref . The relative difference between multipole terms Mn,n at Rref = 4.0 cm and Rref = 4.5 cm ranges from ∼ 10−15 % for M2,2 to ∼ 10−10 % for M22,22 . 105 10-5 | Mn,n | 10-8 n=2 n=6 n=10 10-11 n=14 n=18 n=22 10-14 6 8 10 12 14 -log10 (ϵ ) Figure 3.20: “SM MATLAB Fourier”: convergence of multipole terms Mn,n versus error tolerance ε. 104 10-1 | Mn,n | n=2 n=6 10-6 n=10 n=14 n=18 10 -11 n=22 10-16 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Rref Figure 3.21: “SM MATLAB Fourier”: multipole terms Mn,n versus reference radius Rref . 106 12 -log10 (Ε ) 10 8 6 4 2 0 6 8 10 12 14 16 -log10 (ϵ ) Figure 3.22: “SM MATLAB Fourier”: apparent accuracy E versus error tolerance ε. 4 0.001 2 1.×10-7 1.×10-11 1.×10-15 0 -1.×10-15 -1.×10-11 -1.×10-7 -2 -0.001 -4 -4 -2 0 2 4 Figure 3.23: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “SM MATLAB Fourier” as a multipole expansion up to order 24 and (2) SM from the inverse of the conformal mapping object f. The apparent accuracy in the case of ε = 10−16 is 6.40 × 10−14 . Fig. 3.22 shows the resulting apparent accuracy E versus the specified error tolerance ε. Fig. 3.23 shows the difference between the electrostatic potential ϕ obtained in (1) “SM MATLAB Fourier” and (2) SM from the inverse of the conformal mapping object f. 107 105 1 | Mn,n | n=2 n=6 10-5 n=10 n=14 n=18 10-10 n=22 10-15 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Rref Figure 3.24: “NSM MATLAB Fourier”: multipole terms Mn,n versus reference radius Rref . 3.2.4.4.3 “NSM MATLAB Fourier” With the error tolerance of ε = 10−16 , out of MATLAB releases R2009a, R2014b, R2016b, and R2017a, the computations successfully completed only in releases R2016b and R2017a. Changing the error tolerance ε in the function initquad7 resulted in aborted computation or very low apparent accuracy. Fig. 3.24 shows the multipole terms Mn,n , scaled to R = 4.5 cm, versus the reference radius Rref . The relative difference between multipole terms Mn,n at Rref = 4.0 cm and Rref = 4.5 cm ranges from ∼ 10−13 % for M2,2 to ∼ 10−10 % for M22,22 . The apparent accuracy in the case of ε = 10−16 is 8.07 × 10−11 . Fig. 3.25 shows the difference between the electrostatic potential ϕ obtained in (1) “NSM MATLAB Fourier” and (2) NSM from the inverse of the conformal mapping object f. 3.2.4.4.4 “NSM Mathematica DA” Fig. 3.26 shows the difference between the electrostatic potential ϕ obtained in (1) “NSM Mathematica DA” and (2) NSM from the inverse of the conformal mapping object f. 108 4 0.001 2 1.×10-7 1.×10-11 1.×10-15 0 -1.×10-15 -1.×10-11 -1.×10-7 -2 -0.001 -4 -4 -2 0 2 4 Figure 3.25: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM MATLAB Fourier” as a multipole expansion up to order 24 and (2) NSM from the inverse of the conformal mapping object f. 4 0.001 2 1.×10-7 1.×10-11 1.×10-15 0 -1.×10-15 -1.×10-11 -1.×10-7 -2 -0.001 -4 -4 -2 0 2 4 Figure 3.26: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM Mathematica DA” as a multipole expansion up to order 24 and in (2) NSM from the inverse of the conformal mapping object f. 109 4 0.001 2 1.×10-7 1.×10-11 1.×10-15 0 -1.×10-15 -1.×10-11 -1.×10-7 -2 -0.001 -4 -4 -2 0 2 4 Figure 3.27: Contour plot of the difference between the electrostatic potential ϕ obtained in (1) “NSM COSY INFINITY DA” as a multipole expansion up to order 24 and in (2) NSM from the inverse of the conformal mapping object f. 3.2.4.4.5 “NSM COSY INFINITY DA” Fig. 3.27 shows the difference between the electrostatic potential ϕ obtained in (1) “NSM COSY INFINITY DA” and (2) NSM from the inverse of the conformal mapping object f. 3.2.4.4.6 Relative Differences Table 3.7 shows relative differences between (1) significant multipole terms Mn,n in the three cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM Mathematica DA”, and “NSM MATLAB Fourier” and (2) significant multipole terms Mn,n in the “NSM COSY INFINITY DA” case. The significant difference between SM and NSM results may be explained by the modeling error due to the approximation of the 2D geometry using the connecting rods in the NSM case. We note the particularly small relative differences between the “NSM COSY INFINITY DA” and “NSM MATLAB Fourier” cases. Heuristically, we suppose that the orders of the relative errors of these methods do not exceed the orders of these relative differences. 110 Order n NSM MATLAB Fourier NSM Mathematica DA SM MATLAB Fourier SM Mathematica PDE 2 6 10 14 18 22 −6.24134 × 10−6 % −0.000305752% −0.000286024% −0.00162332% 0.00132445% −0.000617169% −8.68782 × 10−6 % −0.000805103% −0.000260003% −0.00125928% 0.122749% 13.1372% 0.215825% 85.4029% −6.3095% −10.7641% 5.94797% 7.53896% 0.126631% 55.9545% −32.5625% −49.6611% −546.505% −105.855% Table 3.7: Relative differences between (1) significant multipole terms Mn,n in cases “SM Mathematica PDE”, “SM MATLAB Fourier”, “NSM Mathematica DA”, and “NSM MATLAB Fourier” and (2) significant multipole terms Mn,n in the “NSM COSY INFINITY DA” case. 111 We also note that in “SM Mathematica PDE”, the Laplace equation was solved in Mathematica with boundary conditions obtained from the conformal mapping object f. 3.2.4.4.7 Plate Distance Perturbations In the NSM case, we used linear interpolation for perturbations of plate distances from the origin, based on successful calculations in the SC Toolbox with small perturbations of plate distances. In the process of obtaining the linear interpolation, we considered the effect on multipole terms of various nonzero perturbations D j of distances of the plates from the origin. Plate distance perturbations are applied to four copies of the electrostatic potential, where plate voltage coefficients are V1 = 1, V2 = 0, V3 = 0, and V4 = 0 (i.e., V = (1, 0, 0, 0)). At this stage of the calculations, nominal plate voltage magnitude is not yet applied and is effectively 1 V. For each plate number j, we attempted calculations in the SC Toolbox with about 20–40 different values of perturbation D j , about 6–8 of which completed successfully despite the crowding phenomenon. For the linear interpolation, we selected four sets of perturbed multipole terms data, namely, calculated with perturbations D1 = −5.04 × 10−5 cm, D2 = −5 × 10−5 cm, D3 = −5.1 × 10−5 cm, and D4 = −4.8 × 10−5 cm. These perturbation values were based on proximity to −5 × 10−5 cm – one value of a suitable order of magnitude – and availability of data from successfully completed calculations. We considered finite difference approximations 4A0 /D j , 4An /D j , and 4Bn /D j of the first derivatives (FDAFDs) of multipole terms by and as functions of perturbations D j . Their behavior may be placed in two groups: 1. FDAFDs have relatively small variances, typically within one order of magnitude. Linear interpolation is mostly justified. See Fig. 3.28 for an example with 4An /D2 . This group comprises mostly the cosine sets and one sine set: 4A0 /D1 , 4An /D1 , 4A0 /D2 , 4A0 /D2 , 4An /D2 , 4A0 /D3 , 4An /D3 , 4A0 /D4 , 4An /D4 , and 4Bn /D2 . 112 | An /D2 | 10-3 D2 =-1.01×10-1 cm D2 =-1.5×10-2 cm 10-8 D2 =-5×10-3 cm D2 =-9×10-4 cm D2 =-1.4×10-4 cm 10-13 D2 =-5×10-5 cm D2 =-9.5×10-6 cm D2 =-10-6 cm 10-18 D2 =-5×10-7 cm n 5 10 15 20 Figure 3.28: Absolute values of finite difference approximations 4An /D2 of the first derivatives of cosine multipole terms An with respect to perturbations D2 in case “NSM COSY INFINITY DA”. In many cases, plot markers denoting 4An /D2 for lower magnitudes of D2 cover or are in close proximity to plot markers higher magnitudes of D2 . This indicates the validity of the linear interpolation, with limitations shown by some disagreement in 4An /D2 at orders n = 9 and n ≥ 20. | Bn /D2 | 10-2 D2 =-1.01×10-1 cm 10-5 D2 =-1.5×10-2 cm D2 =-5×10-3 cm 10-8 D2 =-9×10-4 cm D2 =-1.4×10-4 cm D2 =-5×10-5 cm 10-11 D2 =-9.5×10-6 cm D2 =-10-6 cm 10-14 D2 =-5×10-7 cm 10-17 n 5 10 15 Figure 3.29: Absolute values of finite difference approximations 4Bn /D2 of the first derivatives of sine multipole terms Bn with respect to perturbations D2 in case “NSM COSY INFINITY DA”. Some plot markers denoting 4Bn /D2 for lower magnitudes of D2 cover or are in close proximity to plot markers higher magnitudes of D2 . Overall, the dependence of multipole terms Bn on D2 does not appear to be linear. 113 2. FDAFDs have relatively high variances. The dependence of multipole terms on the D j does not appear to be linear. See Fig. 3.29 for an example with 4Bn /D2 . This group comprises three sine sets: 4Bn /D1 , 4Bn /D2 , and 4Bn /D3 . Linear interpolation results are relatively accurate for cosine multipole terms but should be considered with care for sine multipole terms. We note that the theoretical values for sine multipole terms are zero if the cross-sectional geometry has a reflection symmetry relative to the horizontal axis, that is, if D2 = D4 . However, in application of plate distance errors to the four copies of the electrostatic potential, the plate distance errors value set is rotated as {D1 , D2 , D3 , D3 }, {D2 , D3 , D4 , D1 }, {D3 , D4 , D1 , D2 }, and {D4 , D1 , D2 , D3 } to account for the subsequent rotation of the four copies of the electrostatic potential. Thus, considering the rotations of the electrostatic potential, the sine multipole terms are generally useful even if D2 = D4 in the unrotated cross-sectional geometry. 3.2.5 Main Field Discussion We presented a method to calculate the main field of the Muon g-2 collaboration quadrupole. In this context, we provided the theoretical framework; the method with several submethods; MATLAB, Python, and Mathematica source code; calculations and their results; and an a posteriori error analysis. The use of conformal mapping methods for the calculation of the main field has the advantage of an analytic, fully Maxwellian formula and allows rapid recalculations with adjustments to the geometry and mispowered plates. The submethods represent different approaches and their implementations to obtain the inverse conformal mapping in order to calculate the multipole expansion of the electrostatic potential: (1) taking the DA inverse of the conformal mapping or (2) solving an ODE (explicitly or implicitly) to obtain the inverse conformal mapping from an analytic expression for the first derivative of the conformal mapping. For the “COSY INFINITY DA” submethod, we developed a COSY INFINITY program that uses the SC Toolbox to calculate the parameters of the conformal mapping from a 114 rectangle to a polygonal representation of the cross-sectional geometry and then calculates the DA inverse of the conformal mapping to obtain the multipole terms. Apart from the geometrical approximation of the polygonal model, the error analysis indicates that “COSY INFINITY DA” and “MATLAB Fourier” submethods are the most accurate compared to the other considered submethods. In the general case of mispowered plates or geometric asymmetries, we applied the common practice of approximation of the geometry to obtain a simply-connected polygon. To minimize the impact on the multipole terms, we performed the approximation by connecting the plates with the rectangular enclosure in the middle of each plate’s back side. It may be possible to obtain a method similar to the method presented with an analytic formula for a conformal mapping from a canonical domain to a multiply-connected region. In that case, it would no longer be necessary to approximate the cross section by a simply-connected polygon for mispowered-plates calculations. See, e.g., [22] for the current state of the theory of conformal maps to multiply-connected regions. To improve the accuracy of the polygonal model, a script or a software program may be developed to automatically generate the polygonal model data from a CAD drawing of the cross section of the quadrupole. Calculations in case of geometric asymmetries often fail in the SC Toolbox due to the crowding phenomenon [6]. To expand the functionality to geometric asymmetries, we considered an adaptation the cross ratios of the Delaunay triangulation (CRDT) algorithm, as described in [30, 31, 7]. We implemented the geometric asymmetries functionality by treating plate distance errors as perturbations and using linear interpolation based on geometric asymmetries calculations that were successful in the SC Toolbox despite the crowding phenomenon. This section presented a method for calculation of 2D main field of the Muon g-2 collaboration quadrupole, including rapid recalculation capability for geometric asymmetries and mispowered plates. 115 3.3 3.3.1 Fringe Field Coordinate System To study the fringe field of the Muon g-2 collaboration quadrupole, we used a Cartesian laboratory coordinate system based on a specific local Frenet–Serret frame with a horizontal x axis and a vertical y axis in the transversal section and a z axis tangent to the curvilinear reference trajectory coordinate line s. We approximated the internal geometry of the quadrupole by a z-invariant model, considering the relatively large radius of curvature R0 = 7112 mm of the quadrupole. The reference orbit is straight in this model, and, therefore, coordinates s and z are here practically equivalent. We will use s and z interchangeably, depending on the context. The origin of coordinate lines x and y is the intersection of the cross-sectional plane with the reference trajectory. The origin of the coordinate line z is aligned with the exit edge of the quadrupole element. Coordinates z > 0 are outside the quadrupole, and coordinates in the range z < 0 are inside the quadrupole. In the x–y plane, we will alternatively use the polar coordinate system with radial coordinate r and angular coordinate θ . The following relations between (x, y, z) and (s, r, θ ) apply: x = r cos θ , y = r sin θ , and z = s. 3.3.2 Multipole Terms We begin the discussion with the Taylor–Fourier expansion of the potential ϕ [13, p. 50] +∞ +∞ ϕ (r, θ , s) = ∑ ∑ Mk,l (s) cos  lθ + θk,l rk . (3.4) k=0 l=0 Furthermore, we compare it with the Fourier expansion a (r, s) +∞ ϕ (r, θ , s) = 0 + ∑ al (r, s) cos (lθ + θl ) . 2 l=0 We can assume the constant parts in these expansions to be zero, considering the gauge invariance of the electrostatic potential. 116 Multipole terms Mk,l (s) vanish for k < l and k = l + 1, l + 3, . . . in the general case. If the field is s-independent, multipole terms Mk,l (s) vanish for all k 6= l [13, p. 52]. The fringe field is s-dependent, and, respectively, multipole terms Mk,l (s) for k > l do not entirely vanish. To obtain multiple terms Mk,l (s) using Fourier analysis, an equivalent of considering the Fourier modes at all radii r > 0 would be necessary. In practice, this approach presents challenges, and a reasonable approximation is to perform the Fourier expansion at a finite set of radii. For simplicity of notation, going forward, we omit the coordinate s, writing Mk,l and al (r) instead of Mk,l (s) and al (r, s), respectively. Thus, for a set of radii r j for j = 1, 2, . . . , N,  +∞ al r j = ∑ Ml+2m,l rl+2m . j (3.5) m=0 An approximation of the terms Mk,l , where k = l, l + 2, · · · , l + 2 (N − 1), [57] is the solution of the matrix equation   al (r1 )  ..  .   al (rN )   r1l l+2(N−1) r1 ···     . . ..  =  .. .. .     l · · · rl+2(N−1) rN N        Ml,l .. . Ml+2(N−1),l   .   The falloffs of the multipole strengths Ml,l (s) can be computed by solving this matrix equation at a grid-point set of coordinates s. Along the coordinate line s, the gradient of the electrostatic potential is the highest near the edge of the element. Accordingly, for computational efficiency, the grid-point set should have a higher density near the edge of the element than elsewhere in the set. This method, as described here, uses electrostatic potential data. However, the method can be adapted to use electrostatic field data by taking the gradient or a partial derivative of the electrostatic potential, e.g., ∂∂ϕr , in the multipole and Fourier expansions [57]. 3.3.3 STEP Files In this method, we generate 3D model data from a polygonal model of the cross-sectional geometry in the STEP file format (ISO 10303-242 [55]), and we cross-checked our resulting STEP format 117 3D model data files by importing to CATIA, Autodesk Inventor, IDA-STEP (developed by LKSoft, http://www.ida-step.net/), and STEP File Analyzer (developed by Robert Lipman, http: //go.usa.gov/yccx). We developed a software program called STEP File Generator (or stepfg). This program produces 3D STEP files from polygonal models specified by vertices. Compared to performing this process manually in CAD software, our software has workflow efficiency advantages. The resulting STEP file can be used in many general 3D, including BEM (or FEM) solver, programs. In our case, we feed the output file to COULOMB. This software was implemented as a Mathematica notebook and as a Python script. The Python script is listed in App. G. 3.3.4 STEP Model of the Quadrupole For the purposes of calculating the multipole strength falloffs and the EFB, the length L of the model representing the quadrupole is chosen to be sufficient to cover the fringe field falloff area but as short as possible for computational efficiency. The STEP File Generator effectively extruded a polygonal model of a 90◦ section of the full cross section, specified in the x–y plane, to span the z > −L/2 half of the full model along the z axis, i.e., the range −50 ≤ z ≤ 0 cm. The following STEP File Generator input produces the STEP-formatted 3D part as shown in Fig. 3.30. [[[[0 ,5.3] ,[2.35 ,5.3] ,[2.35 ,5] ,[0 ,5]] ,[[5 ,0] ,[5 ,2.35] ,[5.3 ,2.35] , [5.3 ,0]] ,[[0 ,7] ,[0 ,8] ,[8 ,8] ,[8 ,0] ,[7 ,0] ,[7 ,5.59792] , [5.879900042201571253 ,5.59792] , [4.775937526375983 ,4.493957484174412] , [4.493957484174412 ,4.775937526375983] , [5.59792 ,5.879900042201571253] ,[5.59792 ,7 ,0]]] ,[0 ,50] ,10] 118 Figure 3.30: Input for the Muon g-2 collaboration quadrupole model: rendering of the resulting STEP-formatted 3D part. 3.3.5 Grid-Point Set for Approximated Potential We discretized concentrically in the radial direction with every 0.3 cm in the range 1.8 ≤ r ≤ 4.5 cm, considering that n-th Fourier modes of the potential are asymptotically equivalent to rn as r → 0. On the z axis, we discretized the range −50 ≤ z ≤ 150 cm into a set of 605 points. As justified above and as Fig. 3.31 shows, this is relatively dense near the edge of the quadrupole. The 3D grid was obtained as combinations of the (x, y) and z coordinates from the respective discretizations. Considering the cross-sectional symmetries, it sufficed to only include points on the circles within an arc of central angle 45◦ . 119 Δz cm] 0.7   0.6 0.5 0.4  0.3  0.2   0.1  0 50 0 50 100 150 z [cm] Figure 3.31: Coordinate grid for calculation of Fourier modes of the electrostatic potential, with 605 grid points: z discretization size 4z. The discretization size 4z, as a function of z, an   was set in 2 iterative discretization process by the mesh refinement function f (z) = 1/ 1 + 9 exp −0.006z . Initially, 4z was set to 10 cm uniformly in the range −50 ≤ z ≤ 150 cm. The grid simplexes were then bisected until the condition 4z (z) ≤ f (z) was met. 3.3.6 Calculations in COULOMB The full geometry of the model was reconstructed in COULOMB (see sec. 2.4.1) by specifying the four-fold rotational symmetry in the cross section and the longitudinal reflection symmetry. Such geometrical symmetries are also utilized by COULOMB’s BEM solver. Calculations were performed as detailed above. 3.3.7 The Enge Function and the EFB Applying a fast Fourier (FFT) transform to the electrostatic potential at grid points along circles at z = −50 cm, we obtained the multipole terms of the internal electrostatic potential of the quadrupole. The multipole terms are listed in Table 3.8 (compare to multipole terms of the quadrupole calculated 120 Order n Multipole Terms 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 20214.96881114685 0 −4.894473818198626 × 10−13 0 −116.75916539917267 0 1.3760505820154435 × 10−12 0 −360.85446229120816 0 3.767315759511883 × 10−13 0 49.42528231242991 0 −3.5694866918021975 × 10−12 0 20.0146160932168 0 1.8421872795880613 × 10−11 0 −7.123965949192845 0 −4.643530388208997 × 10−12 Table 3.8: Multipole terms Mn,n obtained from the 3D electrostatic potential data calculated in COULOMB, using an FFT transform along the circle of the radius R = 3.6 cm at z = −50 cm, scaled to Rref = 4.5 cm. from the cross section using conformal maps, listed in sec. 3.2). We obtained an approximation of the multipole strengths Mn,n (z) in the discretized range −50 ≤ z ≤ 150 cm using the multipole terms method as above. Because our approximation uses the first several orders of the multipole expansions, it is necessary to minimize the effect of higher orders. Therefore, we omitted the r > 3 cm part. Fig. 3.32 shows the falloff of the multipole strength M2,2 . The EFB is zEFB = 1.2195 cm. Table 3.9 lists the Enge function coefficients fitted, using the Levenberg–Marquardt Gauss–Newton method and the least-squares variance function, to the falloff of the multipole 121 M2,2 1.0 0.8 0.6 0.4 0.2 -5 0 5 10 z [cm] Figure 3.32: Falloff of the multipole strength M2,2 , normalized to M2,2 = 1 well inside the element. The origin of the z axis is aligned with the quadrupole edge. The vertical gridline denotes the EFB zEFB = 1.2195 cm. strength M2,2 . We produced plots of the Enge function and its 2nd and 4th derivatives, shown in Fig. 3.33, using the FP command in the following COSY INFINITY [68] code. A set of such plots is useful for visual analysis of an Enge function, including the Enge function’s asymmetry relative to the intersection of the Enge function and its EFB gridline. INCLUDE ’COSY’ ; PROCEDURE RUN ; VARIABLE A1 1 ; VARIABLE A2 1 ; VARIABLE A3 1 ; VARIABLE A4 1 ; VARIABLE A5 1 ; VARIABLE A6 1 ; OV 7 2 0 ; A1 : = 0 . 1 4 3 8 9 5 2 8 6 8 9 8 0 9 1 2 2 ; A2 : = 6 . 8 5 9 3 9 8 5 0 5 8 6 5 2 8 ; A3 : = −1.8709693628345963 ; A4 : = 0 . 8 0 1 5 8 0 5 2 7 0 7 2 5 1 5 6 ; A5 : = −0.4070432571162661 ; A6 : = 0 . 0 6 5 8 8 8 8 1 3 6 7 6 4 0 2 8 1 ; 122 Coefficient Value a1 a2 a3 a4 a5 a6 0.14389528689809122 6.85939850586528 −1.8709693628345963 0.8015805270725156 −0.4070432571162661 0.06588881367640281 Table 3.9: Enge function coefficients for the falloff of the multipole strength M2,2 . FC 2 1 2 A1 A2 A3 A4 A5 A6 ; FP 2 1 2 ’Muon g−2 Quad ’ 0 −10 ; FP 2 1 2 ’Muon g−2 Quad ’ 2 −10 ; FP 2 1 2 ’Muon g−2 Quad ’ 4 −10 ; ENDPROCEDURE ; RUN ; END ; 3.3.8 Comparison with Wu Data We performed the same calculations as in sec. 3.3.7 for electrostatic field data obtained using Opera-3d’s FEM field solver [1] by Wanwei Wu (FNAL and University of Mississippi) [116]. The model, shown in Fig. 3.34, approximates the full cage, chamber, and plates geometry of the Muon g-2 collaboration quadrupole. The plates span the polar angles 0◦ through 13◦ , measured from the center of curvature of the quadrupole, whereas the cage and the chamber have a longer length and span polar angles −5◦ through 20◦ . The field data comprises three parts: 3D data at the downstream (−1◦ to 1◦ ) and upstream ends (12◦ to 14◦ ), and, considering the approximate longitudinal translational symmetry of the main field, cross-sectional 2D data for the middle (1◦ to 123 (a) Enge function. (b) Second derivative of the Enge function (c) Fourth derivative of the Enge function. Figure 3.33: Enge function and its 2nd and 4th derivatives, for the falloff of the multipole strength M2,2 , plotted using the FP command in COSY INFINITY. 124 Figure 3.34: Muon g-2 collaboration high voltage quadrupole geometry used by Wu for field data calculations using Opera-3d. (Adapted by permission from Wanwei Wu, 3D Electric Field Map From Opera 3D, G-2 Experiment Document GM2-doc-4490, Muon g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, Oct. 2016.) 12◦ ). For the end parts, electrostatic field and potential data is provided for a grid-point set with 2 mm steps from 701.4 cm to 721.0 cm in radius r, 1 mm steps from −6.4 cm to 6.4 cm in vertical coordinate z, and 0.01◦ steps in polar angle θ . For each cross section in the downstream field data set, we interpolated the field data and applied the multipole terms method as in secs. 3.3.2 and 3.3.7. Additionally, we fitted a nonlinear model defined as the multipole expansion to the raw field data in each cross section and obtained similar results.  Fig. 3.35 shows falloffs of 2nd order Fourier modes a2 r j calculated at radii r = 1.8, 2.1, 2.4, 2.7, 3.0 cm from Wu’s field data. We note that the 2nd order Fourier modes a2 (r) alone fall off more quickly than the true quadrupole strength M2,2 , as 3.36 Fig. shows. This is because the second derivative of M2,2 (s) is negative in the beginning of the fringe field and positive on the outside, impacting the additional terms based on the second derivative of M2,2 in eq. 3.5. 125  Figure 3.35: Falloffs of 2nd order Fourier modes a2 r j calculated at radii r = 1.8, 2.1, 2.4, 2.7, 3.0 cm from Wu’s field data. Curves with larger magnitudes correspond to larger radii.  Figure 3.36: Fourier modes a2 r j (dashed plot style) versus the true quadrupole strength M2,2 (solid red), all scaled to 1 well inside the quadrupole. 126 Somec omput at i onal noi s e i snot i c abl eher ei nOper a3d. Figure 3.37: The falloff of the multipole term M2,2 agrees well between calculations based on Soltner–Valetov field data (zEFB = 1.2195 cm; solid blue) and field data by Wu (zEFB = 1.1233 cm; dashed red). Although the geometric models used for Soltner–Valetov and Wu field data calculations, in COULOMB and Opera-3d, respectively, differ a little in that in Soltner–Valetov data, the exterior cage is not considered and the element is assumed to be straight, there is a remarkable agreement in the field falloffs obtained from these data sets, as Fig. 3.37 shows. The EFBs zEFB = 1.2195 cm and zEFB = 1.1233 cm obtained from Soltner–Valetov and Wu field data, respectively, agree quite well, and so do the tunes calculated based on them. The Muon g-2 ring linear tunes calculated based on Soltner–Valetov field data and the respective results of this section are listed in [71]. 3.3.9 Fringe Field Conclusion We obtained the quadrupole strength falloff and the EFB for the Muon g-2 collaboration quadrupole by calculating Fourier modes of its electrostatic potential at a set of radii in the transversal plane. The respective electrostatic potential data was obtained using COULOMB’s BEM field solver by Helmut Soltner from a 3D model of the quadrupole. 127 In the context of this study, we developed a code called stepfg to automatically generate a 3D model in STEP file format from cross-sectional geometry represented by a polygon. We used this code to produce a 3D model of the Muon g-2 collaboration quadrupole from its cross-sectional geometry. For a confirmatory comparison, we applied the same method of calculating multipole strengths to the electrostatic field data obtained for the Muon g-2 collaboration quadrupole using Opera-3d’s FEM field solver by Wanwei Wu. The field falloffs and the EFBs obtained from Soltner–Valetov and Wu field data are in good agreement, validating the Muon g-2 ring tunes calculated based on the quadrupole EFB calculated from Soltner–Valetov field data. 128 CHAPTER 4 SYMPLECTIFICATION METHODS, AND SIMULTANEOUS SYMPLECTICITY AND ENERGY CONSERVATION 4.1 Symplecticity and Symplectification of Transfer Maps In classical physical systems with coordinates ~q as the position and ~p as the conjugate momentum, if the Hamiltonian H (~q,~p) exists, the equations of motion are [11, p. 22]     d  ~q   ∂ H/∂~q    = Jˆ . dt ~p ∂ H/∂~p The matrix Jˆ is defined as [11, p. 21]    0 In  Jˆ =  , −In 0 (4.1) where In is an n × n identity matrix and n is the phase space dimension. Such systems are subject to the condition of symplecticity, which we introduce here. Deviation from symplecticity arises in calculations due to approximation and machine precision errors. In COSY INFINITY, the phase space coordinates are grouped pair-wise as   x     px   a= p   0     y   ,  z=  py   b = p0      l = − (t−t0 )vo γ    1+γ   K−K0 δK = K 0 where each canonical position q j = x, b, or l is immediately followed by the respective conjugate momentum p j = a, b, or δK . That is, the coordinates are ordered as z = (q1 , p1 . . . , qn , pn ) , 129 where q j is the j-th canonical position and p j is the j-th conjugate momentum. We call coordinates arranged in this order type I coordinates. However, for the purpose of studying symplecticity, it is useful to reorder the coordinates as z̃ = (q1 , . . . , qn , p1 , . . . , pn ) , which, for COSY INFINITY’s beamline coordinate system, yields z̃ = (x, y, l, a, b, δK ) . We call coordinates arranged in this order type II coordinates. A linear transfer matrix M is the Jacobian of the respective linear transfer map M [11, p. 37]:   ~ ~  ∂ Q/∂~q ∂ Q/∂~p  M = Jac (M ) =  , ~ ~ ∂ P/∂~q ∂ P/∂~p ~ = (Q1 , . . . , Qn ) are the initial and final canonical position coordinates where ~q = (q1 , . . . , qn ) and Q and ~p = (p1 , . . . , pn ) and ~P = (P1 , . . . , Pn ) are the initial and final conjugate momentum coordinates, respectively. Consider a linear transfer matrix M, which transforms the initial phase space coordinates vector xi into final coordinates zf = Mzi . The linear transfer matrix M is called symplectic if it satisfies the condition [11, p. 37] M · Jˆ· M T = J.ˆ (4.2) There are two possibilities: either (1) the transfer matrix M is expressed in type II coordinates, and the matrix Jˆ is as defined in eq. 4.1; or (2) the transfer matrix M is expressed in type I coordinates; and the matrix Jˆ is transformed or defined accordingly. In the general case of a nonlinear transfer map, symplecticity is defined by the same eq. 4.2, where M is the Jacobian Jac (M ) of the transfer map M . A transfer map M with a symplectic Jacobian Jac (M ) is called symplectic. 130 4.1.1 Symplecticity Norm We define the symplecticity function Ψ as Ψ (M) = M · Jˆ· Mt − J,ˆ where M is the transfer map Jacobian. Further, we consider a symplecticity norm for a transfer map Jacobian M as 2n kΨ (M)k = ∑ ABS [(Ψ (M))kl ] , k,l=1 where the summation reflects the standard matrix norm; and ABS is the max norm of the DA coefficients, as in COSY INFINITY. 4.1.1.1 Weighted Symplecticity Norm In practical applications, we are interested in performing symplectification for a relevant region E in the phase space, somewhat larger than the beam envelope. Let this region be E = ([−a1 , a1 ] , [−a2 , a2 ] , . . . , [−a2n , a2n ]) . In that case, we can use the weighted symplecticity norm 2n kΨ (M)k = ∑ ABS [(Ψ (M) ◦W )kl ] , k,l=1 where W is the linear weight function that transforms each independent variable x j as  W x j = a−1 j x j. 4.1.2 Symplectification Methods Symplectification methods render the transfer map, or the motion they represent, symplectic, while attempting to make the changes as small as possible. Thus, whereas the exact transfer map is generally not known, the result is a symplectic transfer map that is close to the exact transfer map. 131 Symplecticity preserves phase space volume and is useful for approximate long-term tracking, as it tends to preserve radial information and to produce realistic-looking tracking pictures [11, p. 295]. Commonly used symplectification methods include symplectification using generating functions (including symplectification using Lie algebra methods), Gram–Schmidt symplectification, Miguel Furman’s iterative symplectification, and Healy’s symplectification [36, pp. 5331–5352][11, 66]. Additionally, we considered symplectification by applying the method of gradient descent to the weighted symplecticity norm introduced above. 4.1.2.1 Block-Wise Symplectification If the transfer map Jacobian M is a block-diagonal matrix   a1 b1    c d  0  1 1        ·   M=    ·      0 an bn      cn dn in type I coordinates, the block-diagonal form should be preserved by symplectification. Furthermore, symplectification can be performed for the blocks independently, which is essential if the nonsymplecticity of the transfer map is mostly in one phase space dimension, while being mostly symplectic in other phase space dimensions. Thus, if high precision in some phase space dimensions is already achieved, that precision is preserved. If a transfer map represents stable motion, that is, if all tunes are real and mutually distinct, there exists a basis where the linear part of its Jacobian has a block-diagonal form [11, Ch. 7]. Block diagonalization may be performed by writing the Jacobian in its eigenvector basis, or by performing step-wise block diagonalization. 132 The symplecticity condition for a block-wise matrix is essentially that each block has a determinant equal to one. 4.1.2.2 The Gram–Schmidt Method The Gram–Schmidt symplectification method is useful for symplectification of the linear part of a nonlinear transfer map Jacobian. Let ~m j be the j-th column of the transfer map Jacobian, that is [36, p. 5350],   1 2n M = ~m , . . . ,~m , where n is the phase space dimension. The symplecticity condition can be expressed through the columns ~m j as D E i j ~m ,~m = Ji j , where h , i is the antisymmetric scalar D E ~mi ,~m j = ~miT J~m j . The symplectified transfer map Jacobian is given by the formula [36, pp. 5350–5351]   1 2 2n−1 2n ~m ~m ~m ~m  Ms =  1 , 1 ,··· , 1 , 1 ~m1 ,~m2 2 ~m1 ,~m2 2 ~m2n−1 ,~m2n 2 ~m2n−1 ,~m2n 2 (4.3) in type I coordinates. In case the transfer map Jacobian can be brought to the block-diagonal form, the Gram–Schmidt symplectification method performs symplectification independently for each block. Assuming that the original transfer map Jacobian is almost symplectic, the distance between the symplectified and the original transfer map Jacobians is almost zero. The symplectified transfer map Jacobian preserves the block-diagonal structure, if one is present, as well as any other symmetries, as the formula in eq. 4.3 only divides each element of the matrix by the respective antisymmetric scalar. For a matrix, we define a symmetry as an element or elements of the matrix being equal to zero. 133 4.1.2.3 Miguel Furman’s Iterative Method Miguel Furman’s iterative symplectification method [36, p. 5351][38] obtains an improved transfer map Jacobian   1 M j+1 = 1 − E j M j 2 in each iteration, where ˆ Tj Jˆ− 1 E j = −M j JM and M0 is the original transfer map Jacobian. In case of a block-diagonal transfer map Jacobian, each element is only multiplied by a respective expression from E j , thus preserving the block-diagonal structure. Similarly, the method preserves any other transfer map Jacobian symmetries. 4.1.2.4 The Gradient Descent Method Let M0 be an approximate transfer map Jacobian. We can use the method of gradient descent to converge to a local minimum Mlm of the weighted symplecticity norm F (M) = kΨ (M)k. Since the transfer map Jacobian M0 approximates an exact, symplectic transfer map Jacobian Mexact , there is at least one transfer map Jacobian in a small neighborhood of M0 that is symplectic and solves the equation F (M) = 0. Applying the gradient descent method to M0 , each successive approximation M j+1 is obtained from the previous approximation M j as ∂ F (M) , M j+1 = M j − ε j ∂ M M=M (4.4) j where ε j may be set using the line search algorithm or its modification. Following the approach in [67, pp. 107–109], the matrices in eq. 4.4 can be viewed as vectors, including the interpretation  ∂ F (M) = ∂M k ∂ F (vec M) = , ∂ (vec M)k ∂ F (M) = ∂M  134 where vec M is the vector representation of matrix M. Reverting back to matrix notation, we have   ∂ F (M) ∂ F (M) = = ∂M ∂M kl ∂ F (M) = . ∂ Mkl The derivative ∂ F (M) /∂ M can be found using DA differentiation or, alternatively, using numerical differentiation. 4.1.2.5 Symplectification by Generating Functions Transfer maps are often symplectified using generating functions of canonical transformations. At least one such generating function exists for a transfer map Jacobian. This method requires the transfer map Jacobian to be invertible; however, symplectic transfer maps are always invertible, and this method is generally applicable if the linear part of the transfer map Jacobian is approximately symplectic. The four generating functions F1 (~qi ,~qf ), F2 (~qi ,~pf ), F3 (~pi ,~qf ), and F4 (~pi ,~pf ) defined by [11, p. 164][10, p. 290]   (~pi ,~pf ) = ~∇~q F1 , −~∇~q F1 , i f   (~pi ,~qf ) = ~∇~q F2 , ~∇~p F2 , i f   ~ ~ (~qi ,~pf ) = −∇~p F3 , −∇~q F3 , i f   ~ ~ (~qi ,~qf ) = −∇~p F4 , ∇~p F4 , i f where (~qi ,~pi ) are the initial and (~qf ,~pf ) are the final canonical coordinates, are traditionally introduced in the theory of generating functions, and are commonly used to symplectify transfer maps. Additional generating functions can be constructed, inter alia, as combinations of the generating functions F1 –F4 . To illustrate transfer map symplectification using generating functions, consider a transfer map M , for which the generating function F2 exists. 135 Let Q and P be the position and momentum parts of the symplectified version of the transfer map M , respectively, and Iq and I p the position and momentum parts of the identity map. Then [11, p. 165][10, p. 292]    −1     ~pi   I p   P   = ◦  ~qf Q Iq   ~pf  .  ~qi At the same time,     ~  ~pi   ∇~qi F2 (~qi ,~pf )   = , ~∇ F2 (~q ,~p ) ~qf i f ~p f hence  −1     Ip   P   ◦  Q Iq    ~  ~pf   ∇~qi F2 (~qi ,~pf )   = . ~∇ F2 (~q ,~p ) ~qi i f ~p (4.5) f The symplectification of the transfer map M is obtained by solving eq. 4.5 for    −1  Ip   P  ◦   Q Iq , and further for Q and P [11, p. 165]. Alternatively to symplectifying the transfer map, a fixed-point iteration or a Newton iteration [11, p. 293] may be used to find the final canonical coordinates (~qf ,~pf ) that correspond to the initial canonical coordinates(~qi ,~pi ) and one of the generating functions, as in COSY INFINITY’s tracking procedure TR [12, pp. 41–42]. The initial coordinates (~qi ,~pi ) pushed by the non-symplectified transfer map should be used as the initial guess in the iterative method. As shown in [33], the EXPO (Extended Poincaré) generating function provides an optimal symplectification by minimizing Hofer’s metric, which is an “essentially unique intrinsic bi-invariant Finsler metric for compactly supported Hamiltonian symplectic maps” [33, p. 114302-1]. Hofer’s metric is defined as the distance ρ (M , N ) = ˆ 1 kHt k dt inf φ0 =M ,φ1 =N 136 0 between the approximate transfer map M and its symplectification N , where the Ht are the   Hamiltonians generating the smooth paths {φt }, t ∈ [0, 1] in Hamc R2n from φ0 = M to φ1 = N ; and kHt k = sup Ht (z) − inf Ht (z), z ∈ R2n is the oscillation norm [33, p. 114302-2]. EXPO symplectification is usually the preferred symplectification method in COSY INFINITY. 4.2 4.2.1 Simultaneous Symplecticity and Energy Conservation Feasibility of Simultaneous Symplecticity and Energy Conservation For some time, it was an established opinion that it is not possible for tracking codes to simultaneously enforce symplecticity and energy conservation. This may be traced to [117], which stated that approximate symplectic algorithms cannot conserve energy for nonintegrable systems: Let H be a Hamiltonian which has no other conserved quantities (in a given class K , for example analytic functions) other than functions of H. That is, if {F, H} = 0, then F (z) = F0 (H (z)) for a function F0 . Let Φ4t be an algorithm which is defined for small 4t and is smooth. If this algorithm is symplectic and conserves H exactly, then it is the time advance map for the exact Hamiltonian system up to a reparametrization of time. In other words, approximate symplectic algorithms cannot preserve energy for nonintegrable systems. Subsequently, it was shown [81, pp. 142–143][75, pp. 177–179][58] that approximate symplectic algorithms with variable time steps can preserve energy. As an alternative that can be implemented with minor changes to an existing transfer map–based tracking code, we propose that simultaneous symplectification and energy correction can be applied to an already computed one-turn transfer map. This can be done using an iterative algorithm with alternating symplectification and energy correction steps. An algorithm acting on a one-turn transfer map is defined for a specific, relatively large time ∆t = T , where T is the revolution period, and is not defined for times ∆t < T . Thus, the statement from [117] does 137 not apply to such an algorithm up to the precision to which the iterative correction schemes are executed. 4.2.2 Concept of Iterative Symplectification and Energy Correction Due to finite computation order and machine precision errors, the transfer map M computed in COSY INFINITY, while order-by-order symplectic up to machine precision, slightly differs from the respective exact transfer map Mexact and is generally not exactly symplectic. Suppose, for the sake of argument, that the computed transfer map M slightly deviates from both symplecticity and energy conservation. DA variables can be viewed as representations of Taylor expansions. Lagrange’s form of the remainder of the multivariable Taylor series gives the truncation error a DA variable of computation order n as ∑ Rβ (x) (x − y)β , |β |=n+1 with the uniform estimate 1 β max sup D f (y) ∀x ∈ B, Rβ (x) ≤ β ! |β |=n+1 y∈B where B is a closed ball, the function f approximated by the DA variable is of differentiability class αj Cn+1 in B, and β is the multi-index defined by conventions xα = ∏vj=1 x j , α! = ∏vj=1 α j !, and |α| = ∑vj=1 α j . Thus, the transfer map M is approximately symplectic and energy conserving, and it is located in a small neighborhood of the exact symplectic and energy-conserving transfer map Mexact . As the exact transfer map Mexact is generally unknown, a good symplectification or energy correction method will minimize the distance d (A, M ) or d (B, M ) between the approximate transfer map M and the set A of all symplectic maps or the set B of all energy-conserving maps, respectively. Same applies to symplectification or energy correction that acts on the final coordinates zf = M (zi ) instead of the transfer map M itself. 138  If an iterative method z j+1 = T z j in a metric space is contracting in the sense that, for all j ∈ N,      d T 2 z j+1 , T z j ≤ kd T z j+1 , z j , (4.6) where k < 1, then, utilizing parts of the classic proof [80, pp. 68–69] of the Banach fixed-point theorem, z j a Cauchy sequence and converges to a fixed point zfp . An iterative symplectification method tends to converge to a fixed point zs near the initial point z0 in steps with decreasing sizes. With some care, we can assume the iterative symplectification method to be contracting in the sense of eq. 4.6. The same applies to an iterative energy correction method.  Consider iterative symplectification and energy correction methods z j+1 = Ts z j and z j+1 =  Tec z j , respectively. Because symplectification and energy correction methods should achieve their objectives while minimizing other effects, we assume the symplectification and energy conservation methods to be effective in the sense that      2 d (Tec ◦ Ts ) z j+1 , (Tec ◦ Ts ) z j ≤ k̃d (Tec ◦ Ts ) z j+1 , z j for some k̃ < 1.  In that case, the combined iterative method z j+1 = (Tec ◦ Ts ) z j with alternating application −1 (z ) but of Ts and Tec converges to a fixed point zecs . Unless it happens that Ts (zecs ) = Tec ecs Ts (zecs ) 6= zecs , which is unlikely, we have Ts (zecs ) = zecs , and the combined iterative method performs simultaneous symplectification and energy correction. We note that, having made a number of assumptions, we only demonstrated that the simultaneous symplectification and energy correction method is likely to work and not that it would definitely work in all cases. However, as we will show below, we can achieve simultaneous symplecticity and energy conservation in COSY INFINITY without relying on these assumptions. 139 4.2.3 Energy Conservation in COSY INFINITY The Hamiltonian of a relativistic charged particle is q H = c m2 c2 + (P − qA)2 + qϕ = = E + qϕ, where m is the mass, P is the canonical momentum, q is the charge, and E is the relativistic energy of the particle. A is the magnetic vector potential, and ϕ is the electric scalar potential. In COSY INFINITY’s beamline coordinate system, the relativistic energy of a charged particle is E = mc2 + mc2 η0 (1 + δK ) − qϕ, where η0 = K0 /mc2 , δK is the particle’s relative kinetic energy offset coordinate δK = (K − K0 ) /K0 (in zero electrostatic potential), and K0 is the reference kinetic energy. Hence, the Hamiltonian is expressed simply as H = mc2 + mc2 η0 (1 + δK ) , and Φ (δK ) = δK − δK0 may be used as the energy conservation measure. To enforce energy conservation in COSY INFINITY, as well as in our in-house eighth order Runge–Kutta–Verner tracking code MSURK89 (see sec. 5.6), which uses COSY INFINITY’s beamline coordinate system, it is sufficient to perform calculations only in the x–a and y–b planes, without calculations in the l–δK plane. This conserves energy during both transfer map integration and tracking, with Φ (δK ) = 0. Tracking in the l–δK plane is not necessary if one wishes to enforce energy conservation when tracking an energy-conserving lattice. 4.3 Conclusion We introduced the concept of symplecticity, described several symplectification methods, and identified the role of symplecticity in long-term tracking. 140 Whereas there was an established opinion that approximate symplectic algorithms cannot conserve energy, we cited the possibility of that with variable time steps and suggested that enforcing symplecticity and energy conservation on a one-turn map is an alternative. In particular, an iterative algorithm with alternating symplectification and energy correction steps can be used. In COSY INFINITY and MSURK89, energy conservation is equivalent to the δK coordinate being constant. Thus, if necessary, energy conservation may be achieved by performing calculations in the x–a and y–b planes but not in the l–δK plane. This conserves energy both at transfer map integration time and during the transfer map tracking. For simultaneous energy conservation and symplecticity, it is then sufficient only to perform symplectification. In case an RF cavity is used for energy averaging, calculations in the l–δK plane are necessary to simulate the off-energy effects; however, energy errors are also subject to the RF energy averaging. 141 CHAPTER 5 ORBITAL TRACKING USING COSY INFINITY AND A CONVENTIONAL RUNGE–KUTTA INTEGRATOR 5.1 Introduction Storage rings for sub-ppm measurement of EDM and anomalous MDM present a new frontier in tracking code accuracy requirements [77, 51, 65]. In [77], considering that many tracking codes ignore or inaccurately account for nonlinear effects, Metodiev et al. proposed to benchmark tracking code accuracy by tracking a homogeneous magnetic dipole and an electrostatic cylindrical deflector. Particle orbits in electrostatic spherical deflectors and homogeneous magnetic dipoles are known in analytic form. In these cases, except for relativistic motion through electrostatic spherical deflectors, the orbital transfer map is identity, that is, particles return to the same position after each turn. Tracking particles through electrostatic spherical deflectors and homogeneous magnetic dipoles is a simple benchmark for tracking code integrators and particle optical element representations. Despite the simplicity, this benchmark is effective in assessing tracking code limitations, which already become apparent at this level of complexity. Here, we will perform this benchmark for COSY INFINITY and MSURK89. MSURK89 is an in-house eighth order Runge–Kutta–Verner tracking code we developed in the context of this study. Furthermore, we will describe and perform the direct computation of the DA transfer map of an electrostatic spherical deflector in a laboratory coordinate system (LCS) using simple ODEs and Kepler’s theory. We will compare the results with transfer maps of the electrostatic spherical deflector obtained using the built-in elements of COSY INFINITY and GIOS [114]. Finally, we will use MSURK89 and COSY INFINITY to analyze, model, and track a variant [78] of the Proton EDM Long Spin Coherence Time (LSCT) lattice [3]. 142 5.2 5.2.1 Bending Elements Homogeneous Magnetic Dipole A homogeneous magnetic dipole is defined as a particle optical element with homogeneous magnetic field By in the vertical y direction. The reference particle trajectory is in the horizontal x–s plane, and the reference particle moves along an arc of radius R0 = p , ZeBy where p is the particle momentum and Z is the particle charge in terms of the elementary charge p e. Because the magnetic rigidity χm = Ze and the curvature h = 1/R0 of the reference orbit often have a precedence as known or specified quantities in lattice design, including in COSY INFINITY, we express the magnetic field as  Bx , By , Bz = (0, hχm , 0) . 5.2.2 Electrostatic Spherical Deflector We consider an electrostatic spherical deflector with inner and outer shells of radii R1 and R2 , respectively, such that the reference particle orbit is a circular orbit of radius R0 . For the relevance of the analysis, we assume that the motion, including the reference trajectory, is inside the deflector (at R1 < r < R2 ). A particle with beamline coordinates (x, y) is at radius q r = (R0 + x)2 + y2 . By Gauss’s law, considering the spherical symmetry, the electrostatic field of the electrostatic deflector has the magnitude E (r) = Q , 4πε0 r2 where Q is the charge of the deflector’s inner shell, and is aligned with the radius vector. For the direction of particle beam deflection to agree with the electrostatic spherical deflector’s geometry, 143 charges Q and Ze must be of the opposite sign, where Ze is the charge of a particle in the particle beam. Hence, we obtain the electrostatic potential inside the spherical deflector as ϕ (r) = Q + const. 4πε0 r The voltage of the electrostatic spherical deflector is |∆V | = |ϕ (R2 ) − ϕ (R1 )| = = |Q| R2 − R1 . 4πε0 R1 R2 The electrostatic field and potential can be expressed in terms of the voltage using |Q| R R = |∆V | 1 2 . 4πε0 R2 − R1 Let E0 be the radial component Er (R0 ) of the electrostatic field at radius r = R0 , which is, by pv . Newton’s second law, E0 = −hχe , where χe is the electric rigidity χe = Ze The radial component of the electrostatic field at any radius r < RS can then be expressed as R2 Er (r) = E0 20 . r (5.1) In vector form, the electrostatic field is R2 Ex , Ey , Es = E0 20 R    R0 + x y , ,0 . R R Following the convention of electrostatic potential as zero at the reference orbit, the electrostatic potential is  1 1 − = r R0   1 1 2 − . = E0 R0 r R0 Q ϕ (r) = 4πε0 5.2.2.1  Representations in COSY INFINITY There is a specialized particle optical element ESP in COSY INFINITY to represent an electrostatic spherical deflector. For small beam envelopes, the inhomogeneous combined function electrostatic deflector element ES can be alternatively used as an approximation. 144 The inhomogeneity indices in ES are specified by a 5-vector n, defined by the following expansion of electrostatic field E (x) in the x–s plane [12, p. 19]:  k !   5 x E (x) = E0 1 − ∑ ni + O x6 , R0 k=1 (5.2) where E0 is electrostatic field at the reference orbit and R0 is the curvature radius. From eq. 5.1, we obtain for the electrostatic spherical deflector the expansion  k !   5 x E (x) = E0 1 − ∑ (−1)k+1 (k + 1) + O x6 , R0 k=1 resulting in the inhomogeneity coefficients n = (2, −3, 4, −5, 6) . For comparison, the inhomogeneity coefficients of an electric cylindrical deflector can be similarly obtained as n = (1, −1, 1, −1, 1) [12, p. 19]. Additionally, COSY INFINITY has the inhomogeneous combined function electrostatic element EC. The EC element differs from ES by taking the inhomogeneity indices as a vector of any dimension and using the resulting expansion of electrostatic field E (x) to the respective order. 5.3 Off-Midplane Terms of the Potential In many cases, the electrostatic potential ϕ is known in the midplane, e.g., as an expansion ϕ (x) |y=0 arising from eq. 5.2. Then, ϕ|y=0 may be used as a boundary condition for the Laplace equation to obtain off-midplane terms of the electrostatic potential. To that end, we assert the general Laplace equation       ∂ ∂ϕ ∂ ∂ϕ ∂ ∂ϕ 4ϕ = a1 a + b1 b + c1 c =0 ∂x 2 ∂x ∂x 2 ∂x ∂x 2 ∂x in the fixed-point form [70] as  # ˆ y " 1 ∂ ϕ ϕ = F (ϕ) = ϕ|y=0 + b2 dy− ∂ y y=0 0 b2     ˆ y ˆ y 1 a1 ∂ ∂ϕ c1 ∂ ∂ϕ − a + c dydy, b1 ∂ x 2 ∂ x b1 ∂ z 2 ∂ z 0 b2 0 145 (5.3) where ai , bi , and ci are functions of x, y, and z determined by the coordinate system.   The boundary conditions ϕ|y=0 and b2 ∂∂ϕy are set as DA values. y=0 Eq. 5.3 satisfies the DA fixed-point theorem, and the sequence ϕk+1 = F (ϕk ), for k = 0, 1, . . ., converges to a fixed point ϕ – the electrostatic potential with off-midplane terms – in a finite number of steps [70][11, pp. 96–100]. 5.4 Equations of Motion Unless otherwise stated, we use equations of motion in COSY INFINITY’s beamline coordinate system. Here, we will list the relativistic and non-relativistic equations of motion in this beamline coordinate system. The standard distribution of COSY INFINITY includes COSY.FOX, its advanced particle beam dynamics simulation package, which uses relativistic equations of motion. In the context of this study, we developed a non-relativistic version COSYNR.FOX of COSY.FOX. In MSURK89, we implemented both relativistic and non-relativistic equations of motion, and the user can switch between them by toggling the variable RELATIVISTIC. As and where applicable, we use appropriate relativistic or non-relativistic expressions for physical quantities such as kinetic energy and momentum. Quantity name Relativistic Non-relativistic Kinetic energy K = (γ − 1) mc2 p2 K = 2m Momentum p = γmv p = mv Let h be the curvature of the reference orbit, η = [K0 (1 + δK ) − ZeV ] /mc2 a relativistic measure, p the particle momentum, and ζ = ps /p0 . We denote electric and magnetic rigidities by χe = pv/Ze and χm = p/Ze, respectively. The index 0 refers to the reference particle. We use the convention of the electrostatic potential V as zero for the reference particle. Hence, η0 = K0 /mc2 . The relativistic equations of motion are as follows [69, p. 1]. 146 x0 = a (1 + hx) ζ1 , y0 = b (1 + hx) ζ1 , δK0 = 0, B 1+η 1 Ex = (1 + hx) 1+η − χ y + b ζ1 χ ζ e0 m0 0  1+η 1 Ey Bx 0 b = (1 + hx) 1+η ζ χ + χ − a ζ1 e0 m0i 0 h γ 1+η 1 0 l = − 1+γ (1 + hx) 1+η ζ − 1 . 0  a0  Bs χm0 + hζ ,  Bs χm0 , Expressing the magnitude p of momentum through the vector components and dividing by p0 , we obtain s  s   2  2  2 py p 2 px p − − = − a2 − b2 . p0 p0 p0 p0   p 2 2 2 Since E = (1 + η) mc , we have E = 1 + 2η + η m2 c4 , and, thus, p = mc η (η + 2). ps = ζ= p0 Therefore, ps = ζ= p0 s η (η + 2) − a2 − b2 . η0 (η0 + 2) (5.4) In the non-relativistic limit, we have η → 0, and η +α =1 γ→1 η0 + α lim for any constant α 6= 0. Thus, the non-relativistic limit of 5.4 is ps = ζ= p0 r η − a2 − b2 . η0 (5.5) Similarly, the non-relativistic version of the above relativistic equations of motion is as follows, with non-relativistic ζ from eq. 5.5.   B x0 = a (1 + hx) ζ1 , a0 = (1 + hx) ζ1 χEx − χ y + b ζ1 χBs + hζ , m0 m0   e0 Ey Bx Bs 1 1 1 0 0 y = b (1 + hx) ζ , b = (1 + hx) ζ χ + χ − a ζ χ , e0 m0 h im0 δK0 = 0, l 0 = − 21 (1 + hx) ζ1 − 1 . 5.5 Tracking in COSY INFINITY In COSY INFINITY, the equations of motion are integrated, once for each particle optical element comprising the lattice, in phase space represented as a vector space (n Dv )v over a differential 147 algebra n Dv [11, pp. 86–100], where n is the computation order and v is the number of phase space coordinates. The result is a transfer map M that expresses the final coordinates zf of any ray as zf = M (zi ), where zi are the initial coordinates [11, Chs. 4–5]. The phase space dimension is set by the command OV, where the phase space dimension argument N specifies that motions (x–a, y–b, l–δK ) j for 1 ≤ j ≤ N should be computed [12, p. 9]. The equation zf = M (zi ) can be viewed as a multi-variable Taylor expansion of vector zf to the order n in terms of vector zi . Respectively, the accuracy of computation depends on the computation order n. The procedure TR performs tracking, in essence, by repetitively applying the transfer map to a set of particle rays. Every specified number NR of turns up to the specified total number N of turns, TR draws projections of ray positions on the specified phase plane [12, p. 41]. There are several symplectification methods in COSY INFINITY, with a choice of the four conventional generating functions F1 , F2 , F3 , F4 [11, pp. 37–59] and the EXPO generating function [102]. Here, we will use the EXPO generating function, which results in the most accurate symplectification. 5.6 MSURK89 Tracking Code We developed an in-house tracking code, MSURK89, which integrates the equations of motion using an 8th order Runge–Kutta–Verner method (“RK89”) [111] in the phase space represented as a vector space Rv over R, where v is the number of phase space coordinates. As in COSY INFINITY, the phase space dimension in MSURK89 comprises three dimensions: namely, the x–a, y–b, and l–δK planes. In MSURK89, particle trajectories are individually integrated (as a vector, for computational efficiency) in every tracking turn. This has accuracy advantages, especially for rays far from the reference orbit, but has the disadvantage of a substantially slower tracking speed. Tracking is performed using the MITR procedure, which is analogous to COSY INFINITY’s tracking procedure TR, by repetitively applying one-turn integration of the equations of motion to a set of particle rays. Procedure MITR produces phase space plots, with particle ray coordinates drawn 148 every specified number of turns. Symplectification functionality was not implemented in MSURK89. Particle rays are set by calling the procedure SETRAY, an analogue of COSY INFINITY’s raysetting procedure SR. 5.6.1 Particle Optical Elements We implemented several particle optical elements in MSURK89, including a homogeneous magnetic dipole MIDI, an electrostatic spherical deflector MIESP, and a drift MIDL, analogous to COSY INFINITY’s elements DI, ESP, and DL, respectively. We also implemented the command MITA – a tilt of momentum, analogous to COSY INFINITY’s tilt of the optic axis TA. 5.6.1.1 Homogeneous Magnetic Dipole MIDI A homogeneous magnetic dipole in MSURK89 is computed using the command “MIDI R0 α”, where radius R0 is in meters and angle α is in degrees.   2π The path length of the reference particle through the element is 4s = 360 ◦ R0 α.  The interior electrostatic field and potential are Ex , Ey , Es = (0, 0, 0) and ϕ = 0, respectively. The interior magnetic field is  Bx , By , Bs = (0, hχm , 0) . 5.6.1.2 Electrostatic Spherical Deflector MIESP An electrostatic deflector in MSURK89 is computed using the command “MIESP R0 α”, where radius R0 is in meters and angle α is in degrees.   2π The path length of the reference particle through the element is 4s = 360 ◦ R0 α. The interior electrostatic field at point (x, y, s) is  Ex , Ey , Es =   R0 + x y E, E, 0 , R0 R0 149 where E = E0 R20 /r2 is the magnitude of the electrostatic field and q r = (R0 + x)2 + y2 is the distance from the center of the electrostatic spherical deflector. The interior electrostatic potential is ϕ = E0 R20   1 1 − , r R0  and the interior magnetic field is Bx , By , Bs = (0, 0, 0) . For any angle α (corresponding to a sector of the full geometry of an electrostatic spherical deflector), the electrostatic field within a MIESP element is the same as it would be if the angle were 360◦ (full electrostatic spherical deflector geometry). Of course, an actual standalone sector of an electrostatic sphere deflector, e.g., in free space, would have a different proper electrostatic field. In that sense, if α/360◦ is not an integer, MIESP is an artificial element, unless (1) a system of MIESP elements of the same radius and the total angle 360◦ or (2) some method of particle ray injection and extraction is assumed or implemented. 5.6.1.3 Drift MIDL A drift in MSURK89 is computed using the command “MIDL L”, where length L is in meters. The path length of the reference particle through the element is 4s = L. The interior electrostatic field, electrostatic potential, and magnetic field of the element are all zero: E = 0, ϕ = 0, and B = 0, respectively. 5.6.1.4 Momentum Tilt MITA In MSURK89, the momentum can be tilted using the command “MITA αx αy ”, by angle −αx in the x direction and angle −αy in the y direction, specified in degrees. A positive angle results in momentum tilt in the negative direction of the respective transversal axis in MITA. This is consistent with a positive angle resulting in optic axis tilt in the positive direction of the respective transversal axis by COSY INFINITY’s axis tilt procedure TA. 150 The coordinate transformation equations are   a0 = (a cos (αx ) − ζ sin (αx )) cos αy + b sin αy ,   q 0 b = b cos αy − ζ 2 + a2 sin αy , where ζ = ps /p0 , ps is the s component of momentum p, and p0 is the momentum of the reference particle. 5.6.2 5.6.2.1 Integration Step Size Automatic Step-Size Adjustment The integrator RK89 in MSURK89 has an automatic step-size adjustment functionality. In case the integration interval [s1 , s2 ] is known ab initio, RK89 trivially sets the length of the last integration sub-interval to end the integration at exactly s2 . However, when s2 is determined in the course of integration by reaching a boundary, e.g., the particle trajectory reaching an edge of the particle optical element, an iterative process is used to set the length of the last integration sub-interval to ensure the integration ends at that boundary. In a lattice consisting of 16 particle optical elements as 22.5◦ sectors of the Proton EDM LSCT lattice from [78] (see below), the reference orbit was ab initio unknown, and, therefore, the length of the integration interval was ab initio unknown. For that case, we implemented a “G-stop”1 function TF that returns the distance to the nearest edge of the element. When the TF value becomes smaller than the current integration step size, the step size is optimized to stop the integration precisely at the element boundary. 5.6.2.2 Initial Step Size Decreasing the integration step size improves numerical integration accuracy until this effect is overtaken by the loss of significance in floating-point operations when step size becomes excessively 1 The term “G-stop” for such functions traces back to JPL’s numerical integrator program DVDQ [61], written in FORTRAN IV and V. 151 0 -2 log10 (ϵ) -4 -6 -8 -10 -12 0.0 0.5 1.0 log10 (h) Figure 5.1: RK89 numerical integration error ε versus initial step size h, in a 100-turn integration of a radius R = 10.1 m circular orbit inside an electrostatic spherical deflector. Non-relativistic equations of motion were used. The dashed red line of slope 8.14 is a least-squares fit to the linear pattern. The gridlines separate the linear regime from the part dominated by the floating-point loss of significance, corresponding to initial step size h ' 1 m. small. Whether or not there is an automatic step-size adjustment, it is desirable to study the effect of fixed or initial step size on calculation accuracy, as applicable. It is good practice to optimize step size using an integrand that is reasonably typical for the category of problems to be solved. Non-relativistic Kepler orbits in a gravitational or electrostatic field, as well as circular orbits in a magnetic field, are closed and analytically known trajectories and are useful for testing integrators and calibrating integrator step sizes. To calibrate the initial step size in RK89, we integrated a circular Kepler orbit of radius R = 10.1 m (as ∼ 10 m is a quite realistic radius of curvature for a lattice; the initial particle position was (x, a, y, b, l, δK )i = (0.1 m, 0, 0, 0, 0, 0) with the reference orbit at R0 = 10 m), through a spherical electrostatic deflector for 100 full turns. The distance ε = k(x, a, y, b, l, δK )f − (x, a, y, b, l, δK )i k2 (5.6) between the initial and final positions in the six phase space coordinates was used as the error function. Calculation results for a range of initial step sizes are shown in Fig. 5.1 and indicate a 152 0 -2 log10 (ϵ) -4 -6 -8 -10 -12 -14 -2.0 -1.5 -1.0 -0.5 0.0 log10 (h) Figure 5.2: RK4 numerical integration error ε versus initial step size h, in a 100-turn integration of a radius R = 10.1 m circular orbit inside an electrostatic spherical deflector. Non-relativistic equations of motion were used. The dashed red line of slope 4.07 is a least-squares fit to the linear pattern. The gridlines separate the linear regime from the part dominated by the floating-point loss of significance, corresponding to step size h ' 10−2 m. reasonable initial step size of h ' 1 m. For comparison, see the results in Fig. 5.2 for the same procedure applied to a 4th order Runge–Kutta integrator (“RK4”) with fixed step size, with a resulting reasonable step size of h ' 10−2 m. The particle tracked for the initial step size calibration had the kinetic energy 1 MeV, mass 1 amu, and charge 1 e (in COSY INFINITY, this may be set by the command RP 1 1 1). However, changing the kinetic energy to, e.g., 500 MeV, did not substantially affect the calibration results. This makes sense, as (1) the element MIESP is specified by the reference orbit geometry and (2) the equations of motion are expressed in terms of arc length s as the independent variable. Thus, changing the kinetic energy did not affect the non-relativistic Kepler orbit in the beamline coordinate system. Replacing the electrostatic deflector by a magnetic dipole in the step size calibration procedure yielded practically identical results. This illustrates that the initial step size of h ' 1 m is suitable for integration of both electrostatic and magnetic elements. At the initial step size h = 1 m in RK89 and the step size h = 0.01 m in RK4, respectively, the 153 log10 (ϵ) -8.5 -9.0 -9.5 -10.0 3.0 3.5 4.0 4.5 5.0 log10 (n) Figure 5.3: RK89 numerical integration error measure ε versus the number of turns n, in the integration of a radius R = 10.1 m circular orbit inside an electrostatic spherical deflector, using non-relativistic equations of motion, with initial step size h = 1.1 m, up to 105 turns. error function values were both at ∼ 10−12 . However, the calculation CPU times were 0.651 s and 14.7 s, respectively, which illustrates the computational speed advantage of a higher-order integrator. The numerical integration error ε is related to step size h and integrator order n as ε = ahn , where a is a constant, except for the nonlinear effects at extreme values of h, including the floating-point loss of significance. This is illustrated by Fig. 5.1, where the line slope of the linear pattern is 8.14. 5.6.2.3 Growth of Integrator Errors Numerical integration errors tend to grow as functions of the number of turns through a lattice. To illustrate this, we tracked for 105 turns the same RP 1 1 1 particle as in the initial step size calibration of RK89, using non-relativistic equation of motion, through the same spherical electrostatic deflector, with a circular Kepler orbit of radius R = 10.1 m and initial step size h = 1.1 m. The growth of the error measure ε defined in eq. 5.6 as a function of the number of turns n is shown in Fig. 5.3. As expected, the growth of ε is linear. The energy error ∆E was zero in the tracking run, which illustrates that the equations of motion and the beamline coordinate system used in COSY INFINITY and MSURK89 are fundamentally 154 energy conserving for energy conserving lattices by design. 5.7 Magnetic Dipole and Spherical Deflector Tracking Test Cases 5.7.1 Homogeneous Magnetic Dipole We analyzed particle motion inside a homogeneous magnetic dipole, and we performed particle tracking through the element in COSY INFINITY and MSURK89. 5.7.1.1 Analytic Representation of Motion We consider a particle of mass m in a magnetic field B that is perpendicular to the particle’s initial velocity. The Lorenz force F acting on the particle, transversal to the particle velocity v, is F = ZevB, resulting in circular motion. We denote the radius of the particle’s circular trajectory as R. Newton’s second law yields, for the centrifugal force counterbalancing the Lorenz force, γmv2 = ZevB. R Simplifying the equation, we obtain R= p . ZeB This relation is valid as both relativistic and non-relativistic. If the homogeneous magnetic dipole is specified by the curvature radius R of the reference orbit, the magnetic field is set as B = p/ZeR. In that case, the trajectory is identical for relativistic equations of motion and their non-relativistic limit. A particle launched in a homogeneous magnetic dipole with a horizontal transversal offset x relative to the reference particle (that is, with an initial beamline coordinate x) has, by translational symmetry, a circular orbit of the same radius as the reference particle, as Fig. 5.4(a) illustrates. 155 -1 -0.6 1 -1 1.4 (a) Homogeneous magnetic deflector, comprising sixteen 22.5◦ sectors. 1 1.4 (b) Electrostatic spherical deflector, comprising sixteen 22.5◦ sectors. Figure 5.4: The reference orbit (dashed red) and an orbit with initial horizontal offset xi = 0.4 m (solid blue), in a system of sixteen 22.5◦ sectors. (Images source: Kyoko Makino, Eremey Valetov, & Martin Berz, Computation of Nonlinear Fields and Orbit and Spin Transfer Maps of Electrostatic Elements Using Differential Algebras, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) 5.7.1.2 Tracking results We tracked a set of particles with kinetic energy 1 MeV, mass 1 amu, and charge 1 e (in COSY INFINITY script, set by RP 1 1 1) through a homogeneous magnetic dipole specified by radius R0 = 1 m and angle α = 22.5◦ , in COSY INFINITY and MSURK89, for 160, 000 turns. The phase space position projection to the x–a plane was drawn every 111 turns. The turn step of 111 was chosen to be ∼ 100 and a coprime of 16, the number of 22.5◦ sectors in the full physical lattice, thereby moderating the number of data points but still drawing the system state at each of the 16 sectors. The initial particle ray coordinates were (x, a, b, y, l, δK ) = (k · 0.07 m, 0, 0, 0, 0, 0) for k = 1, 2, . . . , 10. 156 In COSY INFINITY, the computation order was 19, the highest possible for this system without exhaustion of COSY INFINITY’s internal variables. Fig. 5.5 shows the tracking pictures produced in COSY INFINITY, with and without symplectification. Fig. 5.6 shows a tracking picture produced in MSURK89. As expected, there was no visual difference in tracking pictures between relativistic and nonrelativistic equations of motion. The tracking pictures are in accord with the particles having circular orbits in the midplane. For example, the tracking pictures demonstrate that, after passing through eight 22.5◦ sectors (a total angle of 180◦ ) from the initial position, the x particle ray coordinates change sign but are of the same magnitude as the initial x coordinates. There is no visible distortion in the MSURK89 tracking pictures, except for slight smearing of the outer orbits. The smearing was significant in the outer orbit in COSY INFINITY without symplectification, with particles flying off to infinity. There was some visible smearing in the second outermost orbit. Turning on symplectification in COSY INFINITY decreased the smearing effect. The CPU times are specified in the respective figure captions. As expected, calculations take significantly longer in MSURK89, as the integration of ODEs in MSURK89 is performed in each tracking turn, whereas DA integration of ODEs in COSY INFINITY is performed for one turn to obtain the transfer map prior to tracking. Symplectification in COSY INFINITY increased the CPU time compared to no symplectification by an order of magnitude, but the CPU time was still an order of magnitude lower than in MSURK89. 5.7.2 Electrostatic Spherical Deflector We analyzed particle motion inside an electrostatic spherical deflector, and we performed particle tracking through the element in COSY INFINITY and MSURK89. 157 (a) Tracking without symplectification. Calculation CPU time: 2.7 s. (b) Tracking with EXPO symplectification. Calculation CPU time: 36.5 s. Figure 5.5: Homogeneous magnetic dipole: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns. Particles were launched horizontally, with initial x offsets up to 0.7 m, through a homogeneous magnetic dipole of angle 22.5◦ and radius R0 = 1 m. 158 Figure 5.6: Homogeneous magnetic dipole: the x–a projections of particles tracked in MSURK89 for 160, 000 turns. Particles were launched horizontally, with initial x offsets up to 0.7 m, through a homogeneous magnetic dipole of angle 22.5◦ and radius R0 = 1 m. Calculation CPU time: 314.5 s. 5.7.2.1 Analytic Representation of Non-Relativistic Motion Following [62, pp. 30–39], we will show that the non-relativistic motion of a particle inside an electrostatic spherical deflector forms an ellipse. In a central field, the Lagrangian of a particle of mass m is  1  L = m ṙ2 + r2 θ̈ 2 −U (r) , 2 (5.7) where (r, θ ) are the polar coordinates of the particle in the plane of its motion and U (r) is the particle’s potential energy in the central field. Because the Lagrangian L in eq. 5.7 does not depend on θ (i.e., ∂∂ θL = 0), by Euler–Lagrange’s equation for coordinate θ , the angular momentum is conserved: M = mr2 θ̇ = const. Substituting eq. 5.8 into the expression for full energy E , we obtain 1 E = mṙ2 +Ueff (r) , 2 159 (5.8) where Ueff is the effective potential energy Ueff (r) = U (r) + M2 . 2mr2 Consider the electrostatic potential U (r) inside an electrostatic sphere: α U (r) = − , α > 0. r Now, therefore, 1 α M2 E = mṙ2 − + . 2 r 2mr2 Expressing ṙ through r, we obtain dr = dt s 2 α  M2 E+ − 2. m r mr However, from conservation of the angular momentum, M dθ = 2, dt mr so, applying the chain rule, we obtain θ as a function of r: ˆ θ= Mdr r .  M2 α 2 r 2m E + r − 2 r Performing analytic integration yields   M − mα   r M  + const. r θ = arccos    2 2 m α 2mE + 2 M We rotate the coordinate system so that the integration constant is zero. The result is the equation of an ellipse in polar form, with a focus as the origin [62, p. 36]: p = 1 + e cos θ , r where p is the focal parameter p= M2 mα 160 and e is the eccentricity s e= 1+ 2E M 2 . mα 2 We will now demonstrate that the origin is indeed a focus of the ellipse. In Cartesian coordinates, a parametric form of the ellipse equation is [62, pp. 36–38]      x   a (cos θ − e)   = p , 2 y a 1 − e sin θ   2 where a = p/ e − 1 is the major semi-axis of the ellipse. The leftmost point of the ellipse is (x, y) = (−a − ae, 0), and the rightmost point is (a − ae, 0). If the origin is a focus of the ellipse, then the other focus is, by symmetry, at point (−2ae, 0). The sum of distances from each supposed focus point to a point on the ellipse is L = l1 + l2 = p p = a 1 − 2e cos θ + e2 − e2 sin2 θ + a 1 + 2e cos θ + e2 − e2 sin2 θ = = a (1 − e cos θ ) + a (1 + e cos θ ) = = 2a = const, which satisfies the two-center bipolar coordinate equation l1 + l2 = 2a and the definition of the foci of an ellipse. 5.7.2.2 Analytic Representation of Relativistic Motion In the relativistic case, the angular momentum of a particle is M = pr = γmrv, where p and v are the particle’s momentum and velocity components perpendicular to the radiusvector, respectively. The angular momentum M can be expressed in polar coordinates (r, θ ) as mr2 θ̇ M=r . 2 +r2 θ̇ 2 ṙ 1− 2 c 161 The total energy E of the particle in Coulomb field U (r) = −α/r is E = q p2 c2 + m2 c4 − α . r As shown in [63, pp. 100–102][15], there are three cases: 1. Mc > |α|. The particle trajectory equation is   s q 1  2  α c2 M 2 − α 2 = c (ME )2 − m2 c2 M 2 c2 − α 2 cos θ 1 − 2 2  + E α r M c and has the visual appearance of “rosettes”. Whereas in the non-relativistic case the trajectory is a closed elliptical orbit, the trajectory in the relativistic case with Mc > |α| is an elliptical trajectory with relativistic precession, which is no longer closed. 2. Mc < |α|. The particle trajectory equation is  s  q  1  α2 = ±c (ME )2 − m2 c2 M 2 c2 − α 2 cosh θ α 2 − c2 M 2 − 1 − E α, r M 2 c2 where the sign at the beginning of the right-hand side is the same as the sign of α. Trajectories in this case spiral into the center, out of the center, or both. 3. Mc = |α|. The particle trajectory equation is [63, pp. 100–102]   2E α Eα 2 2 2 4 2 = E −m c −θ . r Mc Only the Mc > |α| case has a qualitatively similar correspondence in the non-relativistic limit. The other cases Mc ≤ |α| degenerate into a straight-line orbit [15]. For particles such as the proton and the deuteron, Mc > |α|, which, inter alia, makes their use in electrostatic storage rings possible. 5.7.2.3 Reference and Non-Reference Trajectories In an electrostatic spherical deflector, we choose the reference trajectory as a circular orbit. We obtain the voltages of the inner and outer spherical shells of the deflector corresponding to the 162 particle kinetic energy and the orbit radius by solving Newton’s second law equation for zero radial acceleration. Alternatively, this can be done by solving for zero orbital eccentricity. A particle launched in an electrostatic spherical deflector has an elliptic orbit, as Fig. 5.4(b) illustrates. Particle orbits are subject to the physical aperture limitation. 5.7.2.4 Tracking Results We tracked a set of particles with kinetic energy 1 MeV, mass 1 amu, and charge 1 e (in COSY INFINITY script, set by RP 1 1 1) through an electrostatic spherical deflector sector specified by radius R0 = 1 m and angle α = 22.5◦ , in COSY INFINITY and MSURK89, for 160, 000 turns. The phase space position projection to the x–a plane was drawn every 111 turns. The turn step of 111 was chosen to be ∼ 100 and a coprime of 16, the number of 22.5◦ sectors in the full physical lattice, thereby moderating the number of data points but still drawing the system state at each of the 16 sectors. The initial particle ray coordinates were (x, a, b, y, l, δK ) = (k · 0.04 m, 0, 0, 0, 0, 0) for k = 1, 2, . . . , 10. In COSY INFINITY, the computation order was 19, the highest possible for this system without exhaustion of COSY INFINITY’s internal variables. Tracking pictures produced in COSY INFINITY, using non-relativistic and relativistic equations of motion, are shown in Figs. 5.7 and 5.9, respectively. Each set of COSY INFINITY tracking pictures comprises versions with and without symplectification. Tracking pictures produced in MSURK89, using non-relativistic and relativistic equations of motion, are shown in Figs. 5.8 and 5.10, respectively. The tracking pictures illustrate that Kepler orbits are (1) closed with one-turn periodicity under non-relativistic equations of motion and (2) are not closed and perform relativistic orbital precession under relativistic equations of motion. 163 (a) Tracking without symplectification. Calculation CPU time: 3.4 s. (b) Tracking with EXPO symplectification. Calculation CPU time: 39.2 s. Figure 5.7: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns, with non-relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. 164 Figure 5.8: Electrostatic spherical deflector: the x–a projections of particles tracked in MSURK89 for 160, 000 turns, with non-relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ . Calculation CPU time: 1579.9 s. There was no visible distortion in MSURK89 or COSY INFINITY with symplectification on, except for slight smearing in the outer orbits in Fig. 5.7(b). Distortion was somewhat significant in the outer orbit in COSY INFINITY with non-relativistic equations of motion and no symplectification. Turning on symplectification in COSY INFINITY decreased the distortion. Calculation CPU times were similar for the electrostatic spherical deflector and the homogeneous magnetic dipole. 5.7.2.4.1 Effect of the Computation Order on Accuracy Figs. 5.11 and 5.12 illustrate the effect of the computation order on accuracy with and without symplectification, respectively. The motion is linear and consists of ellipses in the x–a plane for computation order 1. Comparison with higher orders up to 19 illustrates how accuracy increases with computation order. Whereas accuracy varies strongly between orders without symplectification, 165 (a) Tracking without symplectification. Calculation CPU time: 3.6 s. (b) Tracking with EXPO symplectification. Calculation CPU time: 39.4 s. Figure 5.9: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY for 160, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. 166 Figure 5.10: Electrostatic spherical deflector: the x–a projections of particles tracked in MSURK89 for 160, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU time: 416.0 s. with symplectification the visual difference between orders is generally insignificant, demonstrating how effective symplectification can be for the generation of realistic tracking pictures. Computation CPU times, listed in the figure captions, illustrate their monotonous increase with computation order due to the increasing complexity of the underlying basic DA operations. 5.7.2.4.2 An Additional Benchmark Example We performed particle tracking through the same electrostatic spherical deflector configuration as detailed above and illustrated in Figs. 5.7–5.10, but with particles launched with initial y offsets up to 0.4 m instead of initial x offsets up to 0.4 m. Again, computation order 19 was used. Figs. 5.13 and 5.14 show tracking results in y–b and x–a planes, respectively. In both figures, tracking pictures produced in COSY INFINITY and MSURK89 are visually indistinguishable. In COSY INFINITY, computations in the 2D phase space (x–a and y–b canonical coordinate pairs) are more computation-intensive than in the 1D phase space (x–a only). Accordingly, without 167 Figure 5.11: For odd computation orders 1 to 19 (computation order specified in the pictures), the x–a projections of particles tracked in COSY INFINITY, for 160, 000 turns, without symplectification, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU times: 0.4 s, 0.5 s, 0.6 s, 0.9 s, 1.2 s, 1.5 s, 1.9 s, 2.4 s, 2.9 s, and 3.6 s, respectively. 168 Figure 5.12: For odd computation orders 1 to 19 (computation order specified in the pictures), the x–a projections of particles tracked in COSY INFINITY, for 160, 000 turns, with EXPO symplectification, with relativistic equations of motion. Particles were launched horizontally with initial x offset up to 0.4 m through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. Calculation CPU times: 1.0 s, 7.6 s, 9.8 s, 12.9 s, 16.2 s, 19.9 s, 25.1 s, 30.5 s, 34.9 s, 39.4 s, respectively. 169 Figure 5.13: Electrostatic spherical deflector: the y–b projections of particles tracked in COSY INFINITY (left) and MSURK89 (right), for 160, 000 turns, with non-relativistic (top) and relativistic (bottom) equations of motion. Particles were launched horizontally, with initial y offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. symplectification, tracking with y offset particles completed in ∼ 140 s, whereas tracking with x offset particles completed in ∼ 7 s. With symplectification, tracking with y offset particles completed in ∼ 950 s, whereas tracking with x offset particles completed in ∼ 40 s. 5.8 Spherical Deflector Transfer Map Test Cases In this section, we will describe and perform computation of the non-relativistic DA transfer map of an electrostatic spherical deflector in a laboratory coordinate system using two conventional methods: (1) by integrating the ODEs of motion using an 8th order Runge–Kutta–Verner integrator and (2) by computing analytically and in closed form the properties of the respective elliptical orbits from Kepler theory. We will compare the resulting transfer maps with (3) the DA transfer map of the non-relativistic version of COSY INFINITY’s built-in electrostatic spherical deflector element ESP and (4) the transfer map of the electrostatic spherical deflector computed using the program GIOS [114]. 170 Figure 5.14: Electrostatic spherical deflector: the x–a projections of particles tracked in COSY INFINITY (left) and MSURK89 (right), for 160, 000 turns, with non-relativistic (top) and relativistic (bottom) equations of motion. Particles were launched horizontally, with initial y offsets up to 0.4 m, through an electrostatic spherical deflector sector of angle 22.5◦ and radius R0 = 1 m. 5.8.1 Integration of the ODEs in Polar Laboratory Coordinates Consider a bunch of non-relativistic charged particles launched with kinetic energy K0 = mv20 /2 and zero potential energy, where m is the particle mass and v0 is the reference velocity. Suppose that a circular reference orbit of radius r0 is defined for the particle bunch in an electrostatic spherical deflector. Now, for concreteness, consider one particle in this bunch. Following the convention of the potential energy as zero at the reference orbit, we calibrate the potential energy of the charged particle to U (r) = − α α + . r r0 By energy conservation, an off-reference particle at initial radius ri would upon entering the deflector have an initial velocity magnitude vi such that K0 = mv2i mv2 α α +U (r) = i − + , 2 2 ri r0 171 from where we obtain s 2α v20 − m vi =   1 1 − , r0 ri (5.9) or, expressing α in terms of the particle charge q = Ze, the reference orbit radius r0 , and the electric pv rigidity χe = Ze as α = Zeχe r0 , s vi =   2 r 0 v20 − Zeχe 1 − . m ri (5.10) COSY INFINITY’s horizontal transversal coordinate x is defined relative to the circular reference orbit as x = r − r0 , where r is the length of the projection of a particle’s radius vector on the plane of the reference particle’s orbital motion. COSY INFINITY’s horizontal momentum component a = px /p0 can be, in the non-relativistic case, expressed as a = vx /v0 , where vx is the x component of a particle’s velocity and v0 is the reference velocity. Now, let (xi , ai ) be the initial beamline coordinates of the particle in the electrostatic spherical deflector. In reality, the deflector would have a fringe field; in this model, we approximate the fringe field by an instant jump in the electrostatic potential from zero to the electrostatic potential of the electrostatic spherical deflector at radius ri = r0 + xi . Thus, all particles in a bunch experience a “step down” from kinetic energy K0 to a kinetic energy K = K0 −U (r) at time t = 0. Similarly, at the end of the element, the particle will experience a "step up" due to the change of the potential energy back to zero. Note that these changes of energy are essential even in the absence of a true fringe field treatment to preserve the actual beam energy. For calculations, we will use the polar laboratory coordinate system (r, θ ), with particles launched at polar angle θ = 0. Additionally, we will use the Cartesian laboratory coordinate system (x̃, ỹ) = r (cos θ , sin θ ) . In this Cartesian laboratory coordinate system, the particle has the initial position ~ri = (r0 + xi , 0) (5.11)   q 2 2 ~vi = ai v0 , vi − (ai v0 ) , (5.12) and the initial velocity 172 where vi is the initial particle velocity magnitude at the initial radius ri obtained using eq. 5.10. From Newton’s second law, the radial acceleration of the particle in the electrostatic spherical deflector is d2 µ r = − + ω 2 r, 2 2 dt r where µ = α/m and ω is the particle’s angular velocity. Considering eqns. 5.11 and 5.12, the conservation of the angular momentum can be expressed in terms of massless angular momentum h = ωr2 = |~r ×~v| as h = |~ri ×~vi | = |(~ri )1 (~vi )2 − (~ri )2 (~vi )1 | = q 2 2 = (r0 + xi ) vi − (ai v0 ) − 0 · ai v0 = q = (r0 + xi ) v2i − (ai v0 )2 . (5.13) Taking the time derivative of ω = h/r2 , we obtain d2 h θ = −2 3 vr . 2 dt r The final position~rf and velocity ~vf can be obtained by integrating the ODEs of motion in the polar coordinates    vr  r      µ 2   d   vr   − r2 + ω r =    dt  θ   ω       ω −2 h3 vr      ,    r with the initial condition    (~ri )1  r       vr   (~vi )1      =  θ   0       ω (~vi )2 / (~ri )1 0 173      .    (5.14) Considering that dθ /dt = ω, applying the chain rule, this system of ODEs can be expressed in terms of polar angle θ as the independent variable as    vr ω  r      µ 1   d   vr   − r2 ω + ωr  = dθ  θ   1       ω −2 h3 vωr          (5.15) r with the same initial condition. Having obtained the final position ~rf = rf (cos θf , sin θf ) and velocity ~vf , the final (x, a) coordinates are   ~vf ·~rf . (xf , af ) = rf − r0 , v0 rf We calculated the DA transfer map of the electrostatic spherical deflector, in (x, a) beamline coordinates, with reference orbit radius r0 = 1 m, by integration of the ODEs of motion in polar laboratory coordinates using an 8th order Runge–Kutta–Verner integrator. This transfer map is listed in sec. 5.8.3. To obtain a DA-valued transfer map, we set the initial phase space coordinates as (xi , ai ) = (d1 , d2 ) = (DA (1), DA (2)) , the respective DA generators [11, pp. 86–96]. We performed the calculations with the computation order 3. A version of the COSY INFINITY program that uses a 4th order Runge–Kutta integrator to obtain the transfer map by solving the ODEs of motion in polar laboratory coordinates is listed in App. H.1. Additionally, App. H.2 lists a Mathematica program that integrates the ODEs in polar laboratory coordinates for an individual orbit, plots one turn of the orbit, and outputs the final (x, a) coordinates. 174  ip 1.5 1.0 0.5 -2.0 -1.5 -1.0 -0.5 0 0.5 1.0  ie -0.5 -1.0 -1.5 Figure 5.15: Orbit of a particle launched counter-clockwise at polar angle fi = 0 with initial beamline coordinates (xi , ai ) = (0.3, 0) through an electrostatic spherical deflector  (blue).  The ~ ~ reference orbit (red) has the radius r0 = 1 m. The plot illustrates the basis vectors ie , i p of the heliocentric coordinate system in relation to the orbit geometry. The plot was generated by the Mathematica notebook for integration of the ODEs for individual orbits in the polar laboratory coordinate system listed in App. H.2. 5.8.2 Kepler Theory Transition Matrix and Lagrange Coefficients Motion in a central field with a potential energy of the form U (r) = −α/r + const is described by conventional Kepler theory; in particular, by the equation of orbit r= p , 1 + e cos f (5.16) where p is the focal parameter, e is the orbit eccentricity, and polar angle f is called the true anomaly [9, p. 117]. True anomaly f = 0 corresponds to the direction of the perihelion, that is, the point of the orbit nearest to the orbital focus at the origin of the polar coordinate system (r, f ). The particle position~r is expressed as ~r =~ie r cos f +~i p r sin f , 175 (5.17)   in terms of polar coordinates (r, f ) and the basis vectors ~ie ,~i p of the heliocentric coordinate system, where ~ie is a unit vector in the direction of perihelion and unit vector ~i p is chosen so that ~ie ×~i p is codirectional with the vector of the angular velocity of the particle, as Fig. 5.15 illustrates. According to Newton’s second law, zero radial acceleration at the reference orbit requires mv20 α = 2. r0 r0 Thus, the parameter µ = α/m can be expressed as µ= α = v20 r0 m (5.18) in terms of the reference velocity v0 and the reference orbit radius r0 . The focal parameter p can be expressed in terms of µ and the massless angular momentum h = |~r ×~v| as p= h2 , µ (5.19) which is obtained in course of a standard derivation of the equation of orbit, eq. 5.16, as in [9, pp. 114–116]. We note that taking the time derivative of both sides of eq. 5.16 gives e sin f ṙ = f˙r . 1 + e cos f (5.20) Considering eqns. 5.20 and 5.19 and conservation of massless angular momentum h = f˙r2 , taking the time derivative of the position vector~r in eq. 5.17 yields for the particle velocity   ~v =~ie ṙ cos f − r f˙ sin f +~i p ṙ sin f + r f˙ cos f =     e sin f h e sin f h =~ie cos f − sin f +~i p sin f + cos f = r 1 + e cos f r 1 + e cos f     sin f h e + cos f h =~ie − +~i p = r 1 + e cos f r 1 + e cos f µ µ = −~ie sin f +~i p (e + cos f ) . h h Rewriting eqns. 5.17 and 5.21 in matrix form, we have       ~ r sin f  r cos f  ~r   ie   = A  , where A =     . µ µ ~ − h sin f h (e + cos f ) ~v ip 176 (5.21) (5.22) We note that the determinant of the matrix A is, considering eq. 5.19, µ µ (e + cos f ) cos f + r sin2 f = h h µ µp = r (1 + e cos f ) = r = h. h hr det A = r (5.23) Let fi be the initial true anomaly of a particle in the spherical electrostatic deflector. Then, from the equation of orbit in eq. 5.16, p − 1, ri e cos fi = (5.24) where ri is the initial radius. Taking the scalar product of initial position~ri and initial velocity ~vi , we obtain from eq. 5.22 that ~ri ·~vi = −ri µ µ sin fi cos fi + ri sin fi (e + cos fi ) = h h µ = ri e sin fi . h Hence, √ e sin fi = pσ0 , ri (5.25) where σ0 is defined as [9, p. 130] ~ri ·~vi σ0 = √ . µ Let θ = ff − fi be the true anomaly difference between the final and initial positions. Applying eqns. 5.24 and 5.25 to the equation of orbit in eq. 5.16 yields the final radius p p = = 1 + e cos ff 1 + e cos ( fi + θ ) p = = 1 + cos θ cos fi − sin θ sin fi p √   = = pσ 1 + rp − 1 cos θ − r 0 sin θ rf = i (5.26) i p = ri . √ ri + (p − ri ) cos θ − pσ0 sin θ   Solving eq. 5.22 for the basis vectors ~ie ,~i p of the heliocentric coordinate system in terms of the initial position~ri , velocity ~vi , and true anomaly fi , considering that det A = h according to eq. 177 5.23, we have        µ ~ ~r (e + cos fi ) −ri sin fi   ~ri   ie  −1  i  = 1  h   = Ai     = µ det A ~i p ~vi ri cos fi ~vi h sin fi    ri µ  h2 (e + cos fi ) − h sin fi   ~ri  =  . ri µ sin f cos f ~ v i i i 2 h (5.27) h An analytic expression of the final position~rf and velocity ~vf in terms of the initial position~ri and velocity ~vi is obtained by inserting eq. 5.27 in eq. 5.22, which gives       ~r r cos ff rf sin ff  ~rf   −1  i  =  f   = Af Ai    · µ µ ~vf ~vi − h sin ff h (e + cos ff )    ri µ  2 (e + cos fi ) − h sin fi   ~ri  · h =  ri µ ~vi 2 sin fi h cos f i  h    F G   ~ri  =  . Ft Gt ~vi (5.28) The matrix on the left is usually referred to as the transition matrix. Note that this is not the same as the so-called transfer matrix of beam physics, because the transition matrix contains all nonlinear effects by virtue of its elements on orbit parameters. Specifically, we obtain for the transition matrix elements: the transition matrix element F is µ F = 2 rf [cos ff (e + cos fi ) + sin ff sin fi ] = h µ = 2 rf (e cos ff + cos θ ) = h    µ p = 2 rf − 1 + cos θ = rf h r = 1 − f (1 − cos θ ) , p the transition matrix element Ft is µ2 Ft = 3 [− sin ff (e + cos fi ) + (e + cos ff ) sin fi ] = h 178 µ2 = 3 [e (sin fi − sin ff ) − sin θ ] = h µ2 = 3 [e (sin fi − sin fi cos θ − sin θ cos fi ) − sin θ ] = h µ2 = 3 [e sin fi (1 − cos θ ) − sin θ (1 + e cos fi )] = h  √ pσ0 µ2 p = 3 (1 − cos θ ) − sin θ = ri ri h √ µ √ = [σ0 (1 − cos θ ) − p sin θ ] , ri p the transition matrix element G is 1 G = rf ri (− cos ff sin fi + sin ff cos fi ) = h rf ri rr = sin θ = √f i sin θ , h µp and the transition matrix element Gt is µ Gt = 2 ri [sin ff sin fi + (e + cos ff ) cos fi ] = h µ = 2 ri (e cos fi + cos θ ) = h    p µ = 2 ri − 1 + cos θ = ri h r = 1 − i (1 − cos θ ) . p Thus, we obtained a transition matrix    F G  Φ=  Ft Gt that expresses the final coordinates (~rf ,~vf ) as a function of the initial coordinates (~ri ,~vi ) as      ~rf   ~ri  (5.29)  = Φ   ~vf ~vi and comprises elements [9, pp. 128–131] r F (θ ) = 1 − f (1 − cos θ ) , p 179 √ µ √ [σ0 (1 − cos θ ) − p sin θ ] , ri p rr G (θ ) = √f i sin θ , µp r Gt (θ ) = 1 − i (1 − cos θ ) . p Ft (θ ) = The elements F, Ft , G, and Gt of the transition matrix Φ are called Lagrange coefficients. The Lagrange coefficients Ft and Gt are simply time derivatives of F and G, respectively. Applying the transfer matrix from eq. 5.29 to the initial position ~vi and velocity ~pi from eqns. 5.11 and 5.12, we obtain the final position~rf and velocity ~vf . The final (x, a) coordinates are obtained from the final position ~rf = rf (cos θf , sin θf ) and velocity ~vf as   ~vf ·~rf (xf , af ) = rf − r0 , . v0 rf We calculated the DA transfer map of the electrostatic spherical deflector, in (x, a) beamline coordinates, with reference orbit radius r0 = 1 m, using the transition matrix with elements as the Lagrange coefficients in terms of the true anomaly difference. This transfer map is listed in sec. 5.8.3. The transfer map only depends on reference orbit radius r0 and the central angle of the tracked sector of the electrostatic spherical deflector. As long as the reference orbit radius r0 is kept the same by adjusting the voltages of the inner and outer shells of the deflector, the transfer map does not depend on the charged particle’s kinetic energy, mass, or charge. Indeed, considering eqns. 5.19, 5.13, 5.11, and 5.18, the focal parameter p is p= = h2 |~ri ×~vi |2 = = µ v20 r0 h i (r0 + xi )2 v2i − (ai v0 )2 = v20 r0 h   i 2 1 − 1 − (a v ) (r0 + xi )2 v20 − 2α i 0 m r0 r0 +xi = = v20 r0 180   i h 1 − (ai v0 )2 (r0 + xi )2 v20 − 2v20 r0 r1 − r +x 0 0 i = = v20 r0  i h  (r0 + xi ) 2r0 − 1 + a2i (r0 + xi ) , = r0 and the eccentricity e is [9, p. 116] such that, considering eqns. 5.11, 5.9, and 5.18, ! ! 2 2 v v 2 2 1 − e2 = p − =p − i = r µ r0 + xi µ    1 − 1 2 − 2v2 r v r0 +xi 0 0 r0 0 2 = = p − r0 + xi v20 r0    1 − 1 1 − 2r 0 r0 r0 +xi 2 = − = p r0 + xi r0   2r0 − (r0 + xi ) p 2 − = =p r0 + xi r0 (r0 + xi ) r0 . Thus, the focal parameter p and the eccentricity e depend only on reference orbit radius r0 and initial beamline coordinates (xi , ai ). To obtain a DA-valued transfer map, we set the initial phase space coordinates as (xi , ai ) = (d1 , d2 ) = (DA (1), DA (2)) , the respective DA generators [11, pp. 86–96]. We performed the calculations with the computation order 3. 5.8.3 Transfer Maps of the Spherical Deflector and Comparison Here, we list and compare the DA transfer maps for particles passing through a 45◦ sector of the electrostatic spherical deflector, calculated 1. by integration of the ODEs of motion in polar laboratory coordinates using an 8th order Runge–Kutta–Verner integrator; 2. using the Kepler theory transition matrix with Lagrange-coefficients elements in terms of the true anomaly difference; 181 3. for COSY INFINITY’s built-in electrostatic spherical deflector element ESP; and 4. using the code sequence E S in the program GIOS. In all cases, the reference orbit radius is r0 = 1 m, and non-relativistic equations of motion were used. For definiteness, the particles in the bunch were set to kinetic energy 1 MeV, mass 1 amu, and charge 1 e; however, as noted above, this setting has no impact on the orbit geometry as long as the reference orbit radius is kept the same by adjusting the voltages of the inner and outer spherical shells of the electrostatic spherical deflector. For visual transfer map comparison purposes, the computation order 3 was used in all cases, except for GIOS, where the computation order 2 was used. For each transfer map calculation case, we computed deviations from the conditions of symplecticity [11, pp. 155–159][115] for the first and second order aberration coefficients and motion in the x–a plane. These conditions of symplecticity are as follows: g1 = (x|x) (a|a) − (a|x) (x|a) − 1 = 0, g2 = (x|x) (a|xa) − (a|x) (x|xa) + (x|xx) (a|a) − (a|xx) (x|a) = 0, (5.30) g3 = (x|x) (a|aa) − (a|x) (x|aa) + (x|xa) (a|a) − (a|xa) (x|a) = 0,   where an aberration coefficient zi |z j1 · · · z jn is the partial derivative   zi |z j1 · · · z jn = ∂ n (M (z))i ∂ z j1 · · · ∂ z jn ! z=0 of the i-th component of the respective transfer map M applied to a coordinate vector z = (z1 · · · z2m ), and 2m is the number of phase space coordinates. 5.8.3.1 Integration of the ODEs in Polar Laboratory Coordinates The transfer map from the integration of the ODEs of motion in polar laboratory coordinates using an 8th order Runge–Kutta–Verner integrator is as follows. 182 TRANSFER MAP OBTAINED IN LAB COORDINATES BY INTEGRATION OF THE ODEs OF MOTION X_f I COEFFICIENT ORDER EXPONENTS 1 0.7071067811878048 1 1 0 0 2 0.7071067811853606 1 0 1 0 3 −.4999999999982248 2 2 0 0 4 0.9999999999999907 2 1 1 0 5 0.2071067811860403 2 0 2 0 6 −.3535533905925685 3 3 0 0 7 0 . 6 0 6 6 0 1 7 1 7 8 1 4 8 2 5 8 E−01 3 1 2 0 8 0.2928932188134486 3 0 3 0 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− A_f I COEFFICIENT ORDER EXPONENTS 1 −.7071067811852640 1 1 0 0 2 0.7071067811878422 1 0 1 0 3 −.7071067811852740 2 0 2 0 4 −.3535533905924618 3 3 0 0 5 −1.060660171777971 3 1 2 0 DA coefficients with absolute values less than 10−11 are omitted. The deviations g1 , g2 , and g3 from the conditions of symplecticity listed in eq. 5.30 in this case were as follows: g1 = 0.8881784197001252 × 10−15 , g2 = −0.2120476675655668 × 10−14 , g3 = 0.1217396563490169 × 10−14 . A 4th order Runge–Kutta integrator version of the COSY INFINITY code for calculation of this transfer map by integration of the ODEs in the polar laboratory coordinates is listed in App. H.1. 183 5.8.3.2 Kepler Theory Transition Matrix The transfer map obtained in laboratory coordinates using the Kepler theory transition matrix with Lagrange-coefficients elements is as follows. TRANSFER MAP OBTAINED IN LAB COORDINATES USING LAGRANGE COEFFICIENTS X_f I COEFFICIENT ORDER EXPONENTS 1 0.7071067811865475 1 1 0 0 2 0.7071067811865475 1 0 1 0 3 −.5000000000000000 2 2 0 0 4 1.000000000000000 2 1 1 0 5 0.2071067811865475 2 0 2 0 6 −.3535533905932737 3 3 0 0 7 0 . 6 0 6 6 0 1 7 1 7 7 9 8 2 1 2 2 E−01 3 1 2 0 8 0.2928932188134523 3 0 3 0 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− A_f I COEFFICIENT ORDER EXPONENTS 1 −.7071067811865475 1 1 0 0 2 0.7071067811865476 1 0 1 0 3 −.7071067811865475 2 0 2 0 4 −.3535533905932737 3 3 0 0 5 −1.060660171779821 3 1 2 0 DA coefficients with absolute values less than 10−11 are omitted. The deviations g1 , g2 , and g3 from the conditions of symplecticity listed in eq. 5.30 in this case 184 were as follows: g1 = −0.1110223024625157 × 10−15 , g2 = 0.3119771259853192 × 10−16 , g3 = 0.1110223024625157 × 10−15 . 5.8.3.3 COSY INFINITY’s Spherical Deflector Element The transfer map of COSY INFINITY’s built-in electrostatic spherical deflector element ESP, obtained using non-relativistic equations of motion, is as follows. TRANSFER MAP OF COSY INFINITY ’ S ESP ELEMENT X_f I COEFFICIENT ORDER EXPONENTS 1 0.7071067811865475 1 1 0 0 2 0.7071067811865475 1 0 1 0 3 −.4999999999999999 2 2 0 0 4 1.000000000000000 2 1 1 0 5 0.2071067811865475 2 0 2 0 6 −.3535533905932738 3 3 0 0 7 0 . 6 0 6 6 0 1 7 1 7 7 9 8 2 1 2 3 E−01 3 1 2 0 8 0.2928932188134525 3 0 3 0 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− A_f I COEFFICIENT ORDER EXPONENTS 1 −.7071067811865475 1 1 0 0 2 0.7071067811865475 1 0 1 0 3 −.7071067811865475 2 0 2 0 4 −.3535533905932737 3 3 0 0 5 −1.060660171779821 3 1 2 0 185 The deviations g1 , g2 , and g3 from the conditions of symplecticity listed in eq. 5.30 were as follows: g1 = −0.2220446049250313 × 10−15 , g2 = 0.2220446049250313 × 10−15 , g3 = 0.3330669073875470 × 10−15 . The COSY INFINITY code for calculation of this transfer map of the ESP element is listed in App. H.4. 5.8.3.4 GIOS’s Spherical Deflector Element The transfer map of the electrostatic spherical deflector computed using the code sequence E S in the program GIOS is as follows. TRANSFER MAP COMPUTED USING THE PROGRAM GIOS X_f I COEFFICIENT ORDER EXPONENTS 1 0.7071067812 1 1 0 0 2 0.7071067812 1 0 1 0 3 −.5000000000 2 2 0 0 4 0.2928932188 2 1 1 0 5 0.2071067812 2 0 2 0 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− A_f I COEFFICIENT ORDER EXPONENTS 1 −.7071067812 1 1 0 0 2 0.7071067812 1 0 1 0 3 −.5000000000 2 2 0 0 4 −.7071067812 2 1 1 0 5 −.2071067812 2 0 2 0 186 The deviations g1 , g2 , and g3 from the conditions of symplecticity listed in eq. 5.30 were as follows: g1 = 0.3804934145534844 × 10−10 , g2 = −0.2928932188380493, g3 = 0.7071067812000000. We note that the deviations g2 and g3 are significant in magnitude and indicate error(s) in the program GIOS. We also note that these differences are not due to the fact that GIOS uses momentum-like coordinates that differ from those of COSY INFINITY. The respective effects manifest themselves only in order three in x and a terms, which we are not comparing here. 5.8.4 Calculation Results, Comparison, and Conclusion The electrostatic spherical deflector transfer maps calculated in laboratory coordinates by integration of the ODEs and using the Kepler theory transition matrix are in good agreement with the transfer map of COSY INFINITY’s built-in electrostatic spherical deflector element ESP. The deviations from the conditions of symplecticity g1 , g2 , and g3 were ∼ 10−17 to ∼ 10−16 in case of calculation using the Kepler theory transition matrix, ∼ 10−16 in case of COSY INFINITY’s built-in electrostatic spherical deflector element ESP, and ∼ 10−15 in case of integration of the ODEs in polar laboratory coordinates. The transfer map of the electrostatic spherical deflector computed using the program GIOS significantly disagrees with the other three transfer maps. However, the deviations g2 and g3 in the GIOS case were also significant in magnitude and indicate that the disagreement is due to error(s) in the program GIOS. 187 Figure 5.16: The Metodiev variant of the Proton EDM LSCT lattice. The lattice comprises 16 sections. Each section contains an electrostatic cylindrical deflector, denoted by the continuous wide lines. Geometrical parameters: R1 = 39.985 m, R2 = 40.015 m, α = π/8 − 2θ , and L = 2 m. 5.9 5.9.1 Proton EDM Lattice Lattice Geometry A Proton EDM Long Spin Coherence Time (LSCT) was proposed by the Storage Ring EDM collaboration in [3, incl. App. RingLat and LattParams]. Here, we consider a variant of this Proton EDM LSCT lattice that was defined and studied by Eric Metodiev et al. [78]. The lattice uses protons at the magic momentum p0 = 0.7 GeV/c, at which, without an EDM signal, the proton’s spin vector would be aligned with its momentum, and an EDM would rotate the spin vector out of the midplane. The lattice, shown in Fig. 5.16, consists of 16 cylindrical electrostatic deflectors with radial electrostatic field 10.5 MV/m, curvature radius R0 = 40 m, and arc angle α = π/8 − 2θ , separated by drifts. Each drift is defined as two arcs of radius R0 = 40 m and small angle θ , separated by a standard straight drift of length L = 2 m. The gap D between the plates of the electrostatic cylindrical deflector, that is, the full aperture, is D = 3 cm, with the plates 188 at radii R1 = 39.985 m and R2 = 40.015 m. The arc-shaped drifts of small parametric angle θ were optimized to θ = 1 mrad in [78] to account for the curvature of the reference orbit due to the fringe fields of the cylindrical electrostatic deflectors. This is an alternative approach to the standard practice of delimiting particle optical elements by their EFBs and not by their physical edges. COSY INFINITY conforms to this standard practice and encapsulates the treatment of each element’s fringe field within that element. 5.9.2 5.9.2.1 Electrostatic Cylindrical Deflector Semi-Circular Geometry First, we consider an electrostatic cylindrical deflector with inner radius ρ = R1 and outer radius ρ = R2 , spanning the arc −π ≤ ψ ≤ 0 [78] in a polar coordinate system (ρ, ψ). Let −V0 and V0 be the voltages of the inner and outer plates of this deflector, respectively. To solve the Laplace equation and to obtain the electrostatic potential of the electrostatic cylindrical deflector, we use the conformal mapping (ρ, ψ) = f (u, v) , [78, p. 2] p R1 R2 exp ρ = ψ =   1 R2 u ln (e sin v + v) , 2π R1 R 1 ln 2 (1 + eu cos v + u) 2π R1 (5.31) from the canonical domain as the semi-infinite strip −∞ < u < ∞, −π ≤ v ≤ π to the physical domain with the deflector geometry. This can be equivalently rewritten as   1 R2 w= ln (1 + z + ez ) , 2π R1 (5.32) √ where w = ψ + i ln (ρ/ R1 R2 ) and z = u + iv. Mapping the boundary conditions from the physical domain to the canonical domain, the voltage at v = −π is −V0 , and the voltage at v = π is V0 . The solution of the Laplace equation in the canonical domain is trivial: ϕ0 (v) = V0 v/π. 189 The inverse conformal mapping z = f −1 (w) is expressed, using the Lambert W function (defined by z = W (z) exp (W (z))), as [78, p. 2]  z = g (w) = −1 +   2πw 2πw   −Wκ(w) exp −1 +    , R2 R ln R ln R2 1 (5.33) 1 where κ (w) is the branch of the Lambert W function     w  − 1  . κ (w) =  ℑ R 2    ln R2 1 We obtain the electrostatic potential in the physical domain as ϕ0 (w) = V0 ℑ (g (w)) /π, √ with g from eq. 5.33 and with w = ψ + i ln (ρ/ R1 R2 ). 5.9.2.2 Generalized Geometry We now consider an electrostatic cylindrical deflector with inner radius ρ = R1 and outer radius ρ = R2 (|R1 − R2 |  R1 ), spanning the arc −α ≤ ψ ≤ 0. Well inside the deflector, the potential is practically s-independent, and the fringe field near the edge of the deflector is mostly formed, due to the ∼ 1/r shape of the potential, by the nearby parts of the deflector. Hence, the electrostatic potential ϕ (ρ, ψ) of the electrostatic cylindrical deflector, near the reference orbit and the deflector, can be approximated by taking out a middle section of the semi-circular electrostatic cylindrical deflector and gluing together the remaining parts as ϕ (ρ, ψ) =    ϕ0 (ρ, ψ) , −α/2 ≤ ψ ≤ δ ,   ϕ0 (ρ, ψ + α − π) , −α − δ ≤ ψ ≤ −α/2, where ϕ0 is the electrostatic potential of a semi-circular electrostatic cylindrical deflector and δ ∼ |R1 − R2 |. However, for δ ∼ |R1 − R2 |, we would then have a significant, unphysical discontinuity at ψ = δ and ψ = −α − δ of the potential ϕ or the electrostatic field E = −∇ϕ, depending on the adjacent 190 elements. Because ϕ quickly falls off as the distance from the electrostatic cylindrical deflector increases and becomes relatively insignificant well inside the adjacent deflector, we cut the potential at δ = π − α/2. 5.9.2.3 Computation of the Scalar Value In [78, p. 5], to avoid floating-point overflow or underflow, the value of W ◦ exp in eq. 5.33 was obtained by 1. computing the Lambert W function using Haley’s method for ψ < 0 and R1 ≤ ρ ≤ R2 ; and 2. computing the Wright function ω = W ◦ exp using Newton’s method otherwise. We had attempted this approach; however, we encountered same the type of floating-point issues it is intended to address. As a solution, we reverted from eq. 5.33 to solving eq. 5.32 directly using COSY INFINITY’s optimization commands FIT, ENDFIT. We used the objective function   1 R 2 z ln (1 + z + e ) OBJ (w, z) = w − 2π R1 (5.34) in the optimization. The calculation of the electrostatic potential is thus performed for plate voltages ±1 V, and then scaled to satisfy the radial electrostatic field of 10.5 MV/m well inside the electrostatic deflector. We tested the computation accuracy of the scalar (non-DA) value of ϕ, for α = π/8, using this method in COSY INFINITY against evaluation of ϕ using Mathematica’s built-in implementation LambertW of the Lambert W function. In this accuracy test, the largest apparent error was of the order of 10−13 %. 5.9.2.4 Computation of the DA Value For DA integration of the equations of motion or computation of the electrostatic field, it is useful to compute the DA value of the electrostatic potential. 191 To that end, we note that, from eq. 5.32, 1 + z + ez = 2π   w, R ln R2 1 thus   2π ∇ (1 + z + ez ) = (1 + ez ) ∇z = ∇   R  w . ln R2 1 Further, we express z in fixed-point form as follows:    2π 1 ∇   R  w , z = G (z) = cons (z) + ∇−1  1 + exp (z) ln 2 (5.35) R1 where z and w are DA values; cons (z) is the scalar value of z calculated using FIT, ENDFIT as detailed above; and ∇−1 is the DA inverse gradient, which computes a potential of its argument. Eq. 5.35 satisfies the DA fixed-point theorem, and the sequence zk+1 = G (zk ), for k = 0, 1, . . ., converges to a fixed point z – the DA value of z from eq. 5.33 – in a finite number of steps [11, pp. 96–100]. With computation order n, this calculation completes in n + 1 steps. We implemented this method of computing the DA value of the electrostatic potential of the cylindrical electrostatic deflector in MSURK89 as the following COSY INFINITY–script function: FUNCTION YLVDA PSI RHO F0 ; VARIABLE LHS NM ; VARIABLE DVAR 1 ; VARIABLE J 1 ; VARIABLE F NM ; VARIABLE FD NM 2 ; VARIABLE LHS1 NM ; VARIABLE LHS2 NM ; F : = F0 ; DVAR : = LOG( R2 / R1 ) ; LHS : = 2∗ P I ∗ ( PSI + I ∗LOG(RHO/ SQRT ( R2∗R1 ) ) ) / DVAR ; LHS1 : = DER( 1 , LHS ) ; LHS2 : = DER( 2 , LHS ) ; LOOP J 1 ORDER+1 ; CO J ; 192 FD ( 1 ) : = LHS1 / ( 1 + EXP1 ( F ) ) ; FD ( 2 ) : = LHS2 / ( 1 + EXP1 ( F ) ) ; POTI FD 2 F ; CO ORDER ; F : = F0 + F ; ENDLOOP ; ENDFUNCTION ; 5.9.3 Lattice Potential Model Considering the ∼ 1/r falloff shape of the electrostatic potential, we modeled the Proton EDM LSCT lattice by superposition of the electrostatic potentials of two nearest electrostatic cylindrical deflectors at every point of the lattice. For that purpose, we utilized a subsystem of two adjacent electrostatic cylindrical deflectors, and implemented its representation in Mathematica and, as a COSY INFINITY script, in MSURK89. The plates of one deflector (“primary deflector”) are placed at ρ ∈ {R1 , R2 }, and −π/8 ≤ ψ ≤ 0. The other deflector (“adjacent deflector”) and its potential are obtained using appropriate coordinate transformations, namely, a rotation, a translation, and a reflection. The subsystem comprising the primary and the adjacent deflector is shown in Fig. 5.17, and a plot of this subsystem’s electrostatic potential is shown in Fig. 5.18. 5.9.4 Tracking in MSURK89 We implemented tracking of the Proton EDM LSCT lattice in MSURK89. Fig. 5.19 shows a 16-turn tracking picture for one sector of the lattice. Tracking begins and ends at the central cross section of an electrostatic cylindrical deflector (points A and F in Fig. 5.17). The largest value of the objective function ε = OBJ (w, z) from eq. 5.34 encountered in this tracking was ∼ 10−13 , as Fig. 5.20 shows. 193 Figure 5.17: The subsystem of two adjacent electrostatic cylindrical deflectors in the Proton EDM LSCT lattice. The subsystem is bounded by the central cross sections of the deflectors. Geometrical parameters: R1 = 39.985 m, R2 = 40.015 m, α = π/8 − 2θ , and L = 2 m. 194 Figure 5.18: Electrostatic potential ϕ of the two-deflector subsystem, shown in Fig. 5.17. The electrostatic potential is scaled to ±1 at the plates. The x–z coordinate system is the same as in Fig. 5.17. 0.0005 0.0000 x [m] -0.0005 -0.0010 -0.0015 -0.0020 -0.0025 0 5 10 15 s [m] Figure 5.19: A particle launched with initial offset xi = 7.43682 × 10−4 m and momentum direction angle θx = 5.67880 × 10−4 rad through 16 sectors (16 one-sector turns, or one full turn) of the Proton EDM LSCT lattice. The s coordinate is the distance along the path ABCDEF, and x is the horizontal local transversal coordinate. The two vertical gridlines indicate element edges between the arc-shaped drifts and the straight drift (approximately, the electrostatic cylindrical deflector edges). The asymmetry of the x minima may be explained by the formal use of arc-shaped drifts in the lattice model, whereas particles in drifts actually have straight-line trajectories. 195 ϵ 10-14 10-17 10-20 0 5 10 15 s [m] Figure 5.20: Values of the objective function ε = OBJ (w, z) from eq. 5.34 encountered in the particle tracking shown in Fig. 5.19. The s coordinate is the distance along the path ABCDEF. The objective function ε values are indicative of the electrostatic potential calculation accuracy. The objective function values are indicative of the electrostatic potential calculation accuracy and are ideally zero. 5.9.5 Lattice Implementation in COSY INFINITY To implement the Proton EDM LSCT lattice in COSY INFINITY, we could consider specifying its particle optical elements, that is, the cylindrical electrostatic deflectors and the drifts, in one-to-one correspondence to the lattice specification from [78]. However, the issue with that approach is that there are no arc-shaped drift elements in COSY INFINITY. Furthermore, particle optical elements in COSY INFINITY are specified in Frenet–Serret beamline coordinates relative to the reference orbit, and, in this representation, an arc-shaped drift would be unphysical. A particle in a drift has a straight-line trajectory, and formally setting the reference trajectory in a drift as a circular arc would not satisfy the definition of reference trajectory that is foundational in COSY INFINITY, thus invalidating COSY INFINITY calculations for that element. However, we can construct a custom particle optical element in COSY INFINITY by its specifying 196 its fields and using a valid reference orbit. We would need to specify the entry point of the reference trajectory for this element, which could be calculated in COSY INFINITY or otherwise. Following this approach, we could make a particle optical element spanning the space between the central cross sections of two adjacent electrostatic cylindrical deflectors. This would implicitly include the curved drifts while abstracting from their problematic details. Continuing to analyze our problem statement, we recall that the arc-shaped drifts in [78] are used to account for fringe fields of the electrostatic cylindrical deflectors. However, COSY INFINITY already has rigorous and fully Maxwellian fringe field–modeling functionality (fringe field calculations mode FR 3) that takes into account the impact of fringe fields on the reference orbit. Element lengths in COSY INFINITY are from EFB to EFB, not from physical edge to physical edge. It is a good idea to replace, not augment the arc-shaped drifts by COSY INFINITY’s built-in fringe fields treatment. Thus, we removed the arc-shaped elements from the model of the Proton EDM LSCT lattice, leaving 16 electrostatic cylindrical deflectors of (EFB-to-EFB) angle α = π/8 separated by standard straight-line drifts of length L = 2 m. This is in good agreement with the Storage Ring EDM collaboration’s Proton EDM LSCT lattice description [3, app. RingLat and LattParams]. 5.9.5.1 Fringe Field of Electrostatic Cylindrical Deflector Whereas the path ABCDEF in Fig. 5.17 is not a true reference orbit, it is within ∼ 10−3 m of the reference orbit, as Fig. 5.19 indicates, and provides a reasonable approximation of the fringe field along the reference orbit. Fig. 5.21 shows the Ex component of the electrostatic field along the BCDE part of the path ABCDEF (“path BCDE”). As we intended to use separate particle optical elements for each of the electrostatic cylindrical deflectors and for the drift, we modeled the fringe field of one electrostatic cylindrical deflector, shown in Fig. 5.22. The EFB20 was sEFB /D = 0.920939 (see sec. 2.3.1 for definition of EFB denoted as EFB20 ). We note that this fringe field falloff is practically identical to the fringe field falloff of the 197 E(s) 1.0 0.8 0.6 0.4 0.2 0 20 40 60 s/d Figure 5.21: Blue color denotes the horizontal transversal component Ex of the electrostatic field of two adjacent electrostatic cylindrical deflectors along the path BCDE. The abscissa s/D is the distance s along the path ABCDEF, scaled by the distance D between the plates, and with the origin at point B (a deflector edge). The dashed-red curve is a reflection of the solid-blue curve relative to the midpoint between the deflectors at s/D ≈ 34.7, demonstrating that the field satisfies the reflection symmetry. Figure 5.22: Fringe field of one electrostatic cylindrical deflector. The red vertical gridline at sEFB /D = 0.920939 denotes the EFB20 . The electrostatic field Ex is scaled to 1 well inside the deflector. The abscissa s/D is the distance s along the path ABCDEF, scaled by the full aperture d, and with the origin at point B (the deflector edge). 198 (a) Fringe field falloffs of the electrostatic cylindrical deflector (solid blue) and a semi-infinite capacitor with infinitely thin plates (dashed red). (b) Difference between fringe field falloffs of (1) the electrostatic cylindrical deflector and (2) a semi-infinite capacitor with infinitely thin plates. Figure 5.23: Fringe field falloffs of (1) the electrostatic cylindrical deflector and (2) a semi-infinite capacitor with infinitely thin plates. The electrostatic fields Ex (s) are scaled to 1 well inside the deflectors. The falloffs are horizontally offset by the EFB20 . 199 Coefficient Value a1 a2 a3 a4 a5 a6 1.0614024399605924 1.6135741290714967 −0.9401447081042862 0.4781500036872176 −0.14379986967718494 0.017831089071215347 Table 5.1: Enge function coefficients of a semi-infinite capacitor with rounded edges of D/20 plate thickness. Here, we used these Enge function coefficients to model the fringe field of the electrostatic cylindrical deflector in the Proton EDM LSCT lattice. semi-infinite capacitor with parallel, infinitely thin plates, as Fig. 5.23 shows. Therefore, we can use the results for fringe fields of semi-infinite capacitors to model the fringe field of the electrostatic cylindrical deflector. In [78], the electrostatic cylindrical deflectors were modeled by infinitely thin plates at radii ρ = R1 and ρ = R2 in order to apply the conformal mapping specified in eq. 5.31. However, we had already obtained, using conformal mapping methods, fringe field falloffs of semi-infinite capacitors with plates of arbitrary thickness. The plate thickness of D/20 is quite realistic. We used Enge function coefficients of a semi-infinite capacitor with rounded edges of D/20 plate thickness, listed in Table 5.1. 5.9.6 Tracking in COSY INFINITY We encoded the Proton EDM LSCT lattice in COSY INFINITY as follows. R : = 40 ; PHI : = 2 2 . 5 ; A : = 0 . 0 1 5 ; N1 : = 1 ; N2 : = −1 ; N3 : = 1 ; N4 : = −1 ; N5 : = 1 ; A1 : = 1 . 0 6 1 4 0 2 4 3 9 9 6 0 5 9 2 4 ; A2 : = 1 . 6 1 3 5 7 4 1 2 9 0 7 1 4 9 6 7 ; A3 : = −0.9401447081042862 ; A4 : = 0 . 4 7 8 1 5 0 0 0 3 6 8 7 2 1 7 6 ; 200 A5 : = −0.14379986967718494 ; A6 : = 0 . 0 1 7 8 3 1 0 8 9 0 7 1 2 1 5 3 4 7 ; FC 1 1 2 A1 A2 A3 A4 A5 A6 ; FC 1 2 2 A1 A2 A3 A4 A5 A6 ; UM ; LOOP J 1 16 ; DL L / 2 ; ES R PHI A N1 N2 N3 N4 N5 ; DL L / 2 ; ENDLOOP ; Variables N1–N5 and A1–A6 are the electrostatic cylindrical deflector’s (1) inhomogeneity coefficients and (2) Enge function coefficients listed in Table 5.1 and derived in sec. 2.6, respectively. COSY INFINITY’s most accurate fringe field computations mode FR 3 was used. The lattice begins and ends at the midpoint of one of the drift elements. We tracked protons at the magic momentum p0 = 0.7 GeV/c through this lattice for 16, 000 turns, with computation order 7. Phase space position projections to the x–a plane were drawn every 11 turns (co-prime with the 16-fold rotational symmetry). Relativistic equations of motion were used. First, we tracked particle rays with initial x offsets within the physical aperture. The motion was highly linear, and there was practically no visible difference between tracking picture without symplectification and with EXPO symplectification. To observe the nonlinear motion and the formal dynamic aperture, we eventually set the initial particle ray coordinates as (x, a, b, y, l, δK ) = (k · 0.7 m, 0, 0, 0, 0, 0) , for k = 1, 2, . . . , 10. The resulting tracking pictures are shown in Fig. 5.24. In sub-figure (a), without symplectification, the outer particles gently fly off to infinity. In sub-figure (b), EXPO symplectification results 201 (a) Tracking without symplectification. Calculation CPU time: 14.7 s. (b) Tracking with EXPO symplectification. Calculation CPU time: 13.2 s. Figure 5.24: Proton EDM LSCT lattice: the x–a projections of particles tracked in COSY INFINITY, for 16, 000 turns, with relativistic equations of motion. Particles were launched horizontally, with initial x offsets up to 7 m. 202 in the outer particles having quite a linear motion and apparently closed orbits in the x–a projection. 5.10 Conclusion We benchmarked COSY INFINITY and MSURK89 by tracking particles through an electrostatic spherical deflector and a homogeneous magnetic dipole for 160, 000 turns. MSURK89 is our inhouse eighth order Runge–Kutta–Verner tracking code that integrates individual orbits in each tracking turn, and we developed MSURK89 in the context of this study. We studied integrator errors in MSURK89 and optimized the initial integrator step size. Tracking was performed with relativistic and non-relativistic equations of motion, as well as with EXPO symplectification and without symplectification. The test-cases results are in good agreement with analytical solutions, especially for COSY INFINITY with EXPO symplectification and for MSURK89. We described and performed the direct computation of the DA transfer map of an electrostatic spherical deflector LCS using simple ODEs and Kepler’s theory. The results agree well with transfer maps of the electrostatic spherical deflector obtained using the built-in element of COSY INFINITY. The deviations from the conditions of symplecticity g1 , g2 , and g3 were ∼ 10−17 to ∼ 10−16 in case of calculation using the Kepler theory transition matrix, ∼ 10−16 in case of COSY INFINITY’s built-in electrostatic spherical deflector element ESP, and ∼ 10−15 in case of integration of the ODEs in polar laboratory coordinates. However, the transfer map of the electrostatic spherical deflector computed using the program GIOS significantly disagrees with the other three transfer maps. The deviations g2 and g3 in GIOS were also significant in magnitude and indicated that the disagreement is due to error(s) in the program GIOS. Finally, we modeled and tracked a variant [78] of the Proton EDM LSCT lattice [3]. In MSURK89, we implemented a particle optical element representing a 22.5◦ sector of this lattice that calculates the DA-valued electrostatic potential inside the element, and we tracked the lattice. The lattice, as defined in [78], uses short arc-shaped drifts to account for fringe fields of its electrostatic cylindrical deflectors. We replaced this construct by COSY INFINITY’s rigorous and fully Maxwellian fringe field treatment, and we tracked the lattice for 16, 000 turns. 203 CHAPTER 6 INVESTIGATION OF SPIN DECOHERENCE AND SYSTEMATIC ERRORS IN FROZEN SPIN AND QUASI-FROZEN SPIN LATTICES 6.1 Introduction The quasi-frozen spin (QFS) method for measurement of the deuteron EDM was proposed by Yurij Senichev [98] as a modification of the frozen spin (FS) method. Whereas the FS method requires spin to be constantly aligned with momentum, the QFS method requires spin to be aligned with momentum only on average. Another advantage of the QFS method is that existing storage rings, such as the Cooler Synchrotron COSY at Forschungszentrum Jülich, can be adapted to satisfy the QFS method conditions. We considered one FS and two QFS lattices in COSY INFINITY. For the FS and QFS methods to be feasible, the spin coherence time in the respective lattices must exceed the required EDM signal measurement time of 103 s. Our spin decoherence study shows that, with an RF cavity and optimized sextupole family strengths, the spin decoherence in these lattices often remains in the same range for at least 4.2 × 105 turns. This range is of the same order in the FS and QFS lattices. Systematic errors are a fundamental limiting factor for EDM signal detection and measurement. Rotational magnet misalignments are especially relevant to EDM measurement, as Bx and Bz magnetic field components that arise from them rotate the spin vector out of the midplane, creating a fake EDM signal. To address systematic errors due to rotational magnet misalignments, the following modification can be added to the FS and QFS methods: (1) particle bunches are tracked through the lattice in forward and reverse directions, using the horizontal plane to calibrate the magnetic field when switching the tracking direction; and (2) the EDM signal is extracted by taking the half-sum of the spin precessions in the vertical plane. This approach requires suppression of the Bz error field component using additional trim coils. Additionally, it is necessary that the vertical spin 204 decoherence due to systematic errors and the transversal and longitudinal beam emittance remain sufficiently low for EDM signal extraction from vertical spin precession. To simulate rotational magnet misalignments in the FS and QFS lattices, we applied normally distributed spin kicks to the magnetic dipoles or the combined E+B field elements, as appropriate. The spin kick values were generated from uniformly distributed random numbers1 . Vertical spin decoherence in the resulting lattices often remains in the same range (or grows within the range of a related spin decoherence curve) for at least 4.2 × 105 turns, and it is comparable in the FS and QFS structures. 6.2 Spin Coherence in Lattices for EDM In beam physics, spin coherence refers to a measure or quality of preservation of polarization in an initially fully polarized beam. Methods for EDM or MDM signal measurement using storage rings, such as those introduced in Ch. 1, are based on the alignment of a particle’s spin vector with its momentum if the measured quantity was zero, and they focus on spin dynamics relative to that condition. Ideally, all particles in a bunch would have the same orientation; however, in reality, there is always a spin decoherence effect. Consequently, it is necessary to minimize spin decoherence and to ensure that it is small enough for a meaningful measurement to be made. For definiteness, we generally consider spin polarization to be measurable if the spin decoherence is below 1 rad. The time during which spin coherence meets the requirements is called the spin coherence time (SCT). 6.2.1 Spin Coherence Requirements Consider the reference particle in a storage ring. Its spin has an s-dependent invariant spin axis n̄ (s) [90, p. 15][11, pp. 274–279], around which the spin precesses, and which is the stable direction in terms of polarization. Storage ring experiments with polarized beams typically align the spin vectors with n̄ (s). In these cases, although the spin vectors relatively quickly decohere in terms of 1A random variable is called a random variate if it (1) satisfies a specific probability distribution and (2) is generated from uniformly distributed random numbers [8, Ch. 5]. 205 phase in precessive motion around n̄ (s), this does not affect the polarization along the n̄ (s) vector, which has a larger polarization lifetime [90, p. 15]. However, EDM and MDM storage ring methods require spin polarization along the momentum vector, which is horizontal, whereas n̄ (s) is vertical. Furthermore, not only spin coherence in terms of the phase of polar coordinate θ in the horizontal plane is crucial for the experiment, but alignment with the momentum vector needs to be maintained. This presents new challenges regarding spin coherence and SCT [90, p. 16][45]. In an FS lattice for EDM, the spin vectors would be rotated out of the horizontal plane due to EDM and a horizontal component Ex of the electrostatic field. According to the Thomas–BMT equation (introduced in sec. 1.3), the horizontal component Ex of the electrostatic field would result in a horizontal component ΩEDM,x of the spin vector’s EDM angular frequency, ΩEDM,x = η qEx , 2mc (6.1) where η is the EDM factor defined by d=η q s, 2mc which proportionally relates EDM d and spin s. Considering that the target search region for neutron EDM has been narrowed down to 10−31 e·cm > |dn | > 10−26 e·cm [89][84, p. 21] and the order-wise approximate equivalency of the deuteron EDM dD and neutron EDM dn according to dimensional analysis and SUSY considerations [3, pp. 7–9], suppose that dD ' 10−29 e·cm. We remark that, likewise, the so-called nominal EDM is defined as 10−29 e·cm in [106, Ch. 8, p. 9] for protons and electrons. This yields ηD = 2mD cdD ' 10−15 , h̄sD qD where mD = 2.01 u is the deuteron mass, sD = 1 is the deuteron spin, and qD = 1 e is the deuteron electric charge. 206 According to Newton’s second law, for zero radial acceleration at the reference orbit, a cylindrical electrostatic deflector with a realistic bending radius R0 = 42.17 m must have an electrostatic field Ex = γmD v20 V = 1.2 × 107 , qD R0 m where v0 = 1.46 × 108 m/s is the velocity of a deuteron at kinetic energy of 270 MeV. The kinetic energy of 270 MeV results in the maximal figure of merit (FOM; in this case, the product of the cross section by the analyzing power) for deuteron scattering on a carbon target [94][104, Ch. 5]. The resulting x component ΩEDM,x of the spin vector’s angular velocity due to EDM is, applying eq. 6.1, q Ex ΩEDM,x = ηD D ' 10−9 rad/s. 2mD c Therefore, the required SCT for deuteron spin to reach a measurable azimuthal angle ϕ = 1 µrad would be T ' 1000 s. In contrast, the observation time in muon MDM experiments is limited by the muon lifetime τµ = 2.2 × 10−6 s [43, p. 36], which is relativistically dilated to τµ γ = 64.4 × 10−6 s in the E989 Experiment [43, p. 515]. 6.2.2 Spin Decoherence Optimization Integration of the orbital equations of motion through one turn around the lattice in phase space as a vector space (n Dv )v over differential algebra n Dv [11, pp. 84–117] results in an orbital transfer map M ∈ (n Dv )v . The orbital transfer map M expresses the orbital motion as zn = M (zn−1 ) , where zn−1 are the orbital coordinates at the beginning of the n-th turn around the lattice and zn are the orbital coordinates at the end of said turn. Similarly, integration of the Thomas–BMT equation results in a spin transfer map S ∈ SO3 (n Dv ), a 3 × 3 special orthogonal matrix with n Dv -valued elements, which expresses the spin motion as sn = S (zn−1 ) sn−1 , 207 where sn−1 is the spin vector at the beginning of the n-th turn around the lattice and sn is the spin vector at the end of said turn. Spin decoherence can be diminished by minimizing the injection-time beam size ∆z0 and spin decoherence ∆s0 , as well as by optimizing the transfer maps M and S via the lattice composition and particle optical element parameters. The latter is achieved by first optimizing the first-order DA (or Taylor series expansion) effects, then optimizing the second-order effects, and sequentially proceeding to higher orders as necessary. The sequential order of optimizing spin decoherence by effects of different orders is essential, as electrostatic and magnetic multipoles of an order k typically have significant higher-order components of orders k + 1, k + 2, and so on. On the other hand, lower-order components are insignificant and ideally zero, except under the presence of alignment errors, in which case their magnitude is typically still small in practice. Therefore, optimization of the k-th order of the orbital transfer map generally affects the higher orders while not disrupting the already completed optimization of the lower orders. 6.2.3 Suppression of Longitudinal Effects Using an RF Cavity Radio-frequency (RF) cavities are particle optical elements, in which the electromagnetic field oscillates as a function of time. Most RF cavities are variations of the cylindrical pillbox cavity, with TMmnp (transverse magnetic, conventionally enumerated by m, n, and p) modes specifying the electric field E and the transverse magnetic field B [13, pp. 241–242]. For example, in the fundamental mode TM010 [13, p. 242],     x01 r (Er , Eθ , Ez ) = 0, 0, E0 J0 cos (ωt) , Rc     E0 x01 r (Br , Bθ , Bz ) = 0, − J1 sin (ωt) , 0 c Rc (6.2) in the cylindrical coordinates (r, θ , z), where z is the longitudinal coordinate, the Frenet–Serret coordinates are (x, y) = r (cos θ , sin θ ), Jm is the Bessel function of the first kind of order m, Rc is the RF cavity radius, x01 = 2.405, and ω is the angular frequency of the RF cavity. 208 Conventionally, RF cavities are used for beam acceleration or deceleration. However, RF cavities are also instrumental in the suppression and averaging of longitudinal effects such as momentum deviation. This is accomplished by synchronizing the particle beam and the RF cavity so that the reference particle passes through the RF cavity when its electric field is zero, particles with a positive longitudinal offset are decelerated by the electric field, and particles with a negative longitudinal offset are accelerated by the electric field. Hence, the RF cavity’s angular frequency is ω = hω0 , where h is a natural number called the harmonic number and ω0 is the beam angular frequency. For example, consider a reference particle that passes through an RF cavity in the fundamental mode TM010 , with E and B fields as in eq. 6.2, at times t = π (2k − 1/2) /ω, where k ∈ Z. An off-reference particle of charge q and longitudinal offset l = −γv0 ∆t/ (1 + γ), where v0 is the reference velocity and ∆t = t − t0 is the time-of-flight offset, is acted upon by longitudinal electric field    (1 + γ) ωl x01 r sin . Ez (l) = −E0 J0 Rc γv0  Provided that qE0 > 0, the particle is accelerated (decelerated) in case of a small negative (positive, respectively) longitudinal offset l. This results in elliptic dynamics of particles in the longitudinal l–δK plane in the time-of-flight range −π < ω∆t < π , where l is the longitudinal offset and δK = (K − K0 ) /K0 is the relative kinetic energy offset, for particles sufficiently close to the reference particle. By translational symmetry of period T = 2π/ω, elliptic dynamics also occur in the time-of-flight ranges −π + 2πk < ω∆t < π + 2πk for k ∈ Z other than k = 0. Another, qualitatively distinct regime is that if the relative kinetic energy offset δK of a particle is too large, the particle has an unstable motion and eventually slips away to |l| = ∞. The boundary separating stable, elliptic dynamics of particles in the l–δK plane from other modes of behavior is called the separatrix. An example of a separatrix is shown in Fig. 6.1 (see also Figs. 9.5–7 in [113, pp. 269–271]). The length of an RF cavity can be estimated [94] by the quarter wavelength L = c/4νRF . This 209 Figure 6.1: The separatrix (blue) of the Senichev BNL FS lattice (introduced in sec. 6.3) with the RF cavity voltage V = 100 kV, the RF cavity harmonic number h = 5, and fringe field calculations off. Particles are launched with initial l offsets up to 12.45 m and tracked in the l–δK plane. Particles within the separatrix (black) have ellipsoidal orbits centered at (l, δK ) = (0, 0), whereas the five particles outside the separatrix (green), by translational symmetry in l, should have elliptic dynamics centered at approximately (l, δK ) = (17 m, 0). However, these five particles appear to have unstable motion because of the decreasing accuracy of a DA representation excessively far from the reference orbit. The blue separatrix graph was obtained by tracking a particle very near the separatrix. gives practical constraints on the harmonic number h determining the RF cavity revolution frequency νRF , due to engineering and lattice configuration considerations. 6.2.4 Spin Decoherence Minimization In this subsection, we will describe the theory of first- and second-order spin decoherence minimization using an RF cavity and sextupoles. 6.2.4.1 Synchronous Acceleration Principle A lattice using an RF cavity to suppress the longitudinal effects, as outlined above, satisfies the synchronous acceleration principle (which is also called the phase stability principle [113, pp. 266–270]) independently proposed in 1945 by Veksler [110] and McMillan [76]. The longitudinal 210 dynamics in such a system are described by the equations [100, p. 2579] dϕ = −ωRF ηδ , dt qV ω dδ = RF 2RF sin ϕ, dt 2πhβ E where ϕ is the phase offset relative to the synchronous (reference) phase ϕ = 0; δ = ∆p/p0 is the relative momentum deviation from the reference momentum; η is the slip factor; q is the particle charge; VRF is the voltage gap of the RF cavity; ωRF is the angular frequency of the RF cavity; and h is the harmonic number. 6.2.4.2 Orbit Lengthening Due to the Betatron Motion and Momentum Deviation Let Trev be the revolution period of a particle in a system that utilizes the synchronous acceleration principle to suppress the longitudinal effects. Senichev et al. demonstrated in [100, p. 2579] that ∆Trev ∆ (L/v) = = Trev L/v         ∆L 1 α0 1 2 = + α0 − 2 δ + α1 − 2 + 4 δ + O δ 3 , L β γ γ γ where L is the particle orbit length, v is the particle velocity, (∆L/L)β is orbit lengthening due to   the betatron motion, δ = ∆p/p0 is the relative momentum deviation, and α = α0 + α1 δ + O δ 2 is the first-order Taylor expansion of the momentum compaction factor. Thus, every particle in the system has its own equilibrium-level momentum shift [100, p. 2580] " !   # 2 γ02 δm α 1 ∆L ∆δeq = 2 α1 − 20 + 4 + , L β γ0 α0 − 1 2 γ0 γ0 where δm is the particle’s amplitude of relative momentum deviation. In a particle bunch, the maximal orbit lengthening due to the betatron motion can be expressed as [100, p. 2580]    ∆L π  = εx vx + εy vy , L β 2L where εx and εy are horizontal and vertical beam emittances, respectively; and vx and vy are horizontal and vertical tunes, respectively. 211 Therefore, the beam has the following equilibrium momentum spread due to momentum deviation and the betatron motion [100, p. 2581]: " ! # 2  γ02 α0 1 π δ̃m α1 − 2 + 4 + εx νx + εy νy , ∆δ̃eq = 2 2L γ 0 α0 − 1 2 γ0 γ0 where δ̃m is the amplitude of relative momentum deviation of the entire particle beam. 6.2.4.3 Orbit Lengthening Correction Using Sextupoles The equilibrium momentum spread ∆δeq results in an equilibrium energy spread expressed as ∆γeq . Since the spin tune is ν = γG, this results in a spin tune spread [100, p. 2581] 2π h∆νi N = 2πG ∆γeq N after N turns, which signifies spin decoherence growth. To minimize the spin decoherence growth due to momentum deviation and the betatron motion, sextupoles or octupoles may be used. A sextupole of length lsext and strength Ssext = q ∂ 2 By , p ∂ x2 where B is the magnetic field and χm is the magnetic rigidity, affects the second-order momentum compaction factor as [100, p. 2581] ∆α1,sext = − Ssext lsext D30 , L where D0 is the momentum deviation–independent part of dispersion D (s, δ ) = D0 (s) + D1 (s) δ +   O δ 2 . At the same time, it directly affects the orbit lengthening as [100, p. 2581][97, p. 3019]   Ssext lsext D0 βx,y εx,y ∆L =∓ , L sext L where βx and βy are the horizontal and vertical beta functions, respectively; and minus and plus refer to orbit lengthening due to horizontal and vertical plane effects, respectively. 212 To minimize the spin decoherence by compensating the orbit lengthening, we can use three or more families of sextupoles to solve the following system of equations [97, p. 3019]: − εx εx Si lsi Dxi βxi = πνx , ∑ 2L i 2L εy εy Si lsi Dxi βyi = πνy , ∑ 2L i 2L −δ 2 1 Si lsi D3xi = δ 2 α1 , L∑ i where lsi is the length and Dxi is the horizontal dispersion function of the i-th sextupole, respectively. The sextupole strengths that solve this system of equations should be the smallest possible to minimize other effects of the sextupoles, which in turn may have to be corrected if they become too significant. To this end, sextupoles may be placed in the lattice at minima/maxima of Dx , βx , and βy [100, p. 2581]. 6.2.4.4 Chromaticity Correction Using Sextupoles To minimize spin decoherence, in addition to correcting the orbit lengthening, it is necessary to perform chromaticity correction. Chromaticity can be compensated by sextupole family strengths that solve the system of equations [46][97, p. 3019][64, pp. 160–170] ∑ SilsiDxiβxi = ξx , i − ∑ Si lsi Dxi βyi = ξy , i where horizontal and vertical chromaticities are defined as the derivatives ∂ vx,y ξx,y = ∂ δ δ =0 of the betatron tunes νx and νy by the relative momentum deviation δ , respectively. We remark that chromaticity is also often defined as derivatives of the betatron tunes νx and νy by the relative offset of the particle’s kinetic energy δK = (K − K0 ) /K0 . The conversion between chromaticities defined through momentum and through kinetic energy can be obtained using the 213 chain rule and the relativistic formula for the kinetic energy K= q p2 c2 + m2 c4 − mc2 or the non-relativistic formula K = p2 /2m, as suitable. The two chromaticity definitions are essentially equivalent (modulo this conversion), including for the purposes of chromaticity compensation. 6.2.4.5 Calculation of Chromaticity Working with beamline coordinate systems that use the relative offset of the particle’s kinetic energy δK , as in COSY INFINITY, it is convenient to define the horizontal and vertical chromaticities as the derivatives of the betatron tunes νx and νy by δK , respectively. To derive expressions for the chromaticities ∂ vx,y , ξx,y = ∂ δK δ =0 K consider a transfer map M that acts on coordinate vector z: M (z) = ∑ j ∑ i≥1 i1 +···+i6 =i i i Mi ···i z11 · · · z66 , 1 6 j where Mi ···i are the transfer map’s DA coefficients. 1 6 A particle with a sufficiently small energy offset δK = δ and zero longitudinal offset l = 0 will have a closed orbit with a fixed point z̊ = (z̊1 , z̊2 , z̊3 , z̊4 , 0, δ ) . Let M˜ be the re-expansion of the original transfer map M around the fixed point z̊ in coordinates j z̃ = z − z̊, and let M̃i ···i be its DA coefficients: 1 6 M˜ (z̃) = ∑ ∑ i≥1 i1 +···+i6 =i = j i i M̃i ···i z̃11 · · · z̃66 = 1 6 i j Mi ···i (z̃1 + z̊1 )i1 · · · (z̃4 + z̊4 )i4 z̃55 (z̃6 + δ )i6 − z̊. 1 6 i≥1 i1 +···+i6 =i ∑ ∑ 214 For the reference particle, the horizontal and vertical betatron tunes are " # tr Mx,y 1 νx,y = arccos , 2π 2 where Mx and My are the 2 × 2 x and y submatrices of the linear part M of the transfer map M , respectively. Let νx,y (δ ) be the betatron turns corresponding to the closed orbit for the energy offset δ . We have the Taylor expansions νx,y (δ ) = νx,y (0) +   ∂ νx,y (0) δ + O δ 2 , ∂δ where ξx,y = ∂ νx,y (0) ∂δ are the chromaticities. Expressing νx,y (δ ) in terms of the re-expanded transfer map, " # tr M̃ 1 x,y arccos , νx,y = 2π 2 (6.3) where the 2 × 2 x and y submatrices M̃x,y of the linear part M̃ of the transfer map M˜ can be obtained from the equation M (z) − z̊ = M˜ (z̃). Because z̊ = 0 in case δ = 0, we have for z̊ that   ∂ z̊ z̊ = δ +O δ2 . ∂δ In a lattice satisfying the midplane symmetry, it is sufficient to consider the coordinates (z1 , z2 , z6 ) = (x, a, δK ) , as the coefficients (y|δK ) and (b|δK ) vanish. To obtain ∂ z̊/∂ δ , we solve the equation     λ1 δ       λ δ  = M   2     δ 215  λ1 δ   λ2 δ  ,  δ where  M11 M21 M61      2 M2 M2  M= M  1 2 6    0 0 1 is the linear part of the transfer map M in (x, a, δK ) coordinates. This can be rewritten as   λ1  IH   λ2  1     M11 M21 M61     0     λ1         +  0  =  M2 M2 M2   λ  ,     1    2 2 6       1 0 0 1 1 where    1 0 0    . IH =  0 1 0     0 0 0 This yields ∂ z̊ = (λ1 , λ2 , 1) , ∂δ where    (6.4)   λ1   0       λ  = (M − IH )−1  0  .    2      1 1 We note that  ∂ (M (z)) ∂ M˜ (z̃) ∂ z̊ = + = ∂δ ∂δ ∂δ ∂ M˜ ∂ M˜ ∂ z̃ ∂ z̊ = (δ , z̃) + (δ , z̃) + = 0; ∂δ ∂ z̃ ∂δ ∂δ thus, considering eq. 6.4, we have ∂ M˜X ∂ M˜X ∂ z̃ ∂ z̊ (z̃) = − (z̃) − = ∂δ ∂ z̃ ∂ δ ∂ δ   λ1   λ1 ˜    ∂ MX   = (z̃)  λ  2  −  λ2 ∂ z̃    1 1 216    ,   (6.5) where ∂ M˜X (z̃) = ∂ z̃ !  ∂ M˜X i (z̃) ∂ z̃ j 1≤i, j≤3 and M˜X is the (x, a, δK ) part of the transfer map M˜. Further, writing out the transfer map coefficients for the 2 × 2 x submatrices M̃x and Mx of M̃ and M, respectively, we obtain   1 1  2M11 λ1 2M22 λ2  M̃x = Mx +  δ+ 2 2 2M11 λ1 2M22 λ2     1 1 1 1    M12 λ2 M21 λ1   M16 M26  2 + δ +O δ δ + 2 2 2 2 M12 λ2 M21 λ1 M16 M26 (6.6) in terms of the first and second order DA coefficients of the transfer map M . From eq. 6.3 the formula for the horizontal chromaticity is    1 1 ∂ ξx = arccos tr M̃x (δ ) . 2π ∂ δ 2 δ =0 Using eq. 6.6 to write out the transfer map coefficients, we have for the horizontal chromaticity      q 2 −1 1 2 1 2 2 1 2 ξx = 2π M2 M1 − M1 M2 − 1 + M2 − 1 4 − M1 + M2 · "         1 2 1 2 2 1 2 2 · M6 −M1 M12 + 2M22 + 2 M2 − 1 M11 + M2 − 1 M12 +      1 + M 2 − M 2 2M 1 + M 2 + M21 M12 M16 + 11 12 26 6 #        1 + 2M 2 − M 2 − 1 1 + M2 + M11 − 1 M62 M12 M16 . 22 2 26 Using K ∗ PARA(1) to define the reference particle of kinetic energy K in COSY INFINITY, essentially, solves the same problem, and gives the correct result for chromaticity as the first derivative of the betatron tune by the parameter PARA(1). Calculating the chromaticity manually using formulas above, we obtained the same numerical results as in COSY INFINITY. 217 Figure 6.2: The Senichev BNL FS lattice layout, a plot of its beta and dispersion functions, and a diagram of the BNL E+B bending element used in its bending sections. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) 6.3 6.3.1 Frozen Spin and Quasi-Frozen Spin Lattices Senichev BNL Frozen Spin Lattice The frozen spin (FS) lattice concept was introduced in Ch. 1. We implemented and studied an FS lattice for deuteron EDM with combined E+B bending elements, where the entire MDM angular velocity ΩMDM term in the Thomas–BMT equation vanishes, which is achieved by a radial electrostatic field [2, p. 10] E= BcGβ γ 2 ≈ BcGβ γ 2 , 2 2 1 − Gβ γ 218 where B is the vertical magnetic field and G is the deuteron’s anomalous MDM. We call such E+B bending elements “BNL elements”, as they were first proposed at BNL, and we codenamed this lattice in our work as the Senichev BNL lattice. The lattice, proposed by Senichev [96], is 145.85 m in length and uses deuterons at the kinetic energy of 270 MeV. It comprises two E+B bending sections interposed by two straight sections. The lattice is shown in Fig. 6.2. An RF cavity is used to suppress first-order and, partially, second-order spin decoherence by mixing the particles relatively to their equilibrium energies, averaging out the 4γG for each particle. The RF cavity is at voltage V = 100 kV, in the realistic range of ∼ 0.1 MV to ∼ 0.5 MV [94]. For good energy averaging, the RF cavity frequency must be one to two orders higher than ∆γG [94]. The RF frequency is νRF = 5ν0 , where v0 = 1.00 MHz is the beam revolution frequency, providing synchronicity and good energy averaging. The remaining second-order component of spin decoherence, due to the average of 4γG being different for each particle, is suppressed by two families of sextupoles with optimized strengths. 6.3.2 6.3.2.1 Quasi-Frozen Spin Lattices The QFS Concept The quasi-frozen spin (QFS) lattice concept is based on the FS concept, but the requirement that spin needs to be aligned with momentum is relaxed: in QFS, spin is aligned with momentum on average during each turn. The QFS condition to maintain an average alignment of spin with momentum is θB + θE =0 [98, pp. 213–214], where θB and θE are the polar rotation angles of spin relative to momentum in the magnetic field and electrostatic field, respectively. According to the Thomas–BMT equation, the MDM angular frequency is     q 1 E ×β GB − G − 2 . ΩMDM = m c γ −1 (6.7) At the same time, the momentum precession of a particle in magnetic field B is ωB = qB , mγ 219 (6.8) 6.6 6.4 k 6.2 6.0 5.8 5.6 5.4 100 150 200 250 300 K [MeV] Figure 6.3: The ratio k of spin tune νsE in the electrostatic field to spin tune νsB in the magnetic field as a function of kinetic energy K, from 75 MeV to 300 MeV, for the deuteron. and the momentum precession of a particle in electrostatic field E is ωE = q E ×β . m cβ 2 γ (6.9) Scaling spin precessions due to magnetic and electric fields in eq. 6.7 by momentum precessions in eqns. 6.8 and 6.9, respectively, we obtain θB = γGΦB (6.10) and θE = β 2γ   1 − G ΦE , γ2 − 1 (6.11) where ΦB and ΦE are the total amplitudes of momentum rotation due to magnetic and electric fields, respectively. This yields the QFS condition in terms of momentum rotation as [98, pp. 213–214] γGΦB + β 2γ   1 − G ΦE = 0. γ2 − 1 220 (6.12) Moreover, we obtain from eqns. 6.11 and 6.10 that the ratio k of spin tune νsE = θE /ΦE in the electrostatic field to spin tune νsB = θB /ΦB in the magnetic field is νE k = sB = νs   1 β2 G− 2 , = G γ −1 which decreases from k = 6.5 at kinetic energy of K = 75 MeV to k = 5.5 at kinetic energy of K = 300 MeV for the deuteron [98, p. 214], as Fig. 6.3 shows. Considering that the total momentum rotation in one turn around the lattice is ΦB + ΦE = 360◦ , eq. 6.12 uniquely defines the total amplitudes of momentum rotation ΦB and ΦE at a kinetic energy K. Because θE = −θB and spin is aligned with momentum on average, the maximum deviation of spin relative to momentum is, at most, by angle θ /2 in the horizontal plane, where θ = |θE | = |θB | is the total amplitude of spin rotation relative to momentum in the magnetic or electrostatic field. With radial electrostatic field, the torque due to EDM rotating spin out of the horizontal plane is proportional to the projection of spin on the momentum vector. Thus, the EDM signal growth in the QFS concept is, at most, smaller than in the FS concept proportionally to the factor [98, pp. 213–215][96, p. 18] J0 (θ ) ' 1 − θ2 , 4 where spin is aligned with momentum. Considering that the deuteron’s anomalous MDM is G = −0.143, we expect the EDM signal to be reduced by, at most, only two percent [98, p. 215] in a QFS lattice compared to an FS lattice. 6.3.2.2 Senichev 6.3 QFS Lattice First, we considered a QFS lattice proposed by Senichev [98] and codenamed Senichev 6.3 QFS lattice. The lattice uses separate electrostatic and magnetic bending elements with curvatures in opposite directions to satisfy the QFS condition, and it has a characteristic “hourglass” shape. A 221 Figure 6.4: The Senichev 6.3 QFS lattice layout, a plot of its beta and dispersion functions, and a diagram of the curved electrostatic deflector used in this lattice. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) variation of this lattice can be implemented with relatively minor changes to a number of existing lattices, including the Cooler Synchrotron COSY at Forschungszentrum Jülich. The lattice is 166.67 m in length and uses deuterons at the kinetic energy of 270 MeV. It comprises four magnetic bending sections, four electrostatic bending sections, and four straight sections. The lattice is shown in Fig. 6.4. An RF cavity is used to suppress first-order and, partially, second-order spin decoherence by mixing the particles relatively to their equilibrium energies, averaging out the 4γG for each particle. The RF cavity is at voltage V = 100 kV or V = 200 kV, which are two cases in the realistic range of ∼ 0.1 MV to ∼ 0.5 MV [94]. Good energy averaging by an RF cavity is achieved if the resulting longitudinal tune is one to two orders higher than the spin tune spread ∆γG [94]. The RF frequency 222 Figure 6.5: The Senichev E+B QFS lattice layout, a plot of its beta and dispersion functions, and a diagram of the straight E+B Wien filter element used in this lattice. (Image source: Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, & Eremey Valetov, Investigation of Lattice for Deuteron EDM Ring, In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, JACoW, Geneva, Switzerland, 2016; use permitted under the Creative Commons Attribution License CC BY 3.0.) is, for synchronicity and good energy averaging, νRF = 5ν0 or vRF = 6ν0 , where v0 = 0.87 MHz is the beam revolution frequency. The remaining second-order component of spin decoherence, due to the average of 4γG being different for each particle, is suppressed by six families of sextupoles with optimized strengths. 6.3.2.3 Senichev E+B QFS Lattice Next, we considered a QFS lattice by Senichev [96] codenamed Senichev E+B QFS lattice. This lattice uses straight E+B static Wien filter elements instead of curved electrostatic deflectors to (1) remove the nonlinear electrostatic field components due to curvature and (2) to simplify lattice from 223 the engineering perspective. The lattice is 149.21 m in length and uses deuterons at the kinetic energy of 270 MeV. It comprises four magnetic bending sections, two E+B combined field sections, and two straight sections. The lattice is shown in Fig. 6.5. An RF cavity is used to suppress first-order and, partially, second-order spin decoherence by mixing the particles relatively to their equilibrium energies, averaging out the 4γG for each particle. The RF cavity is at voltage V = 100 kV or V = 200 kV, two cases in the realistic range of ∼ 0.1 MV to ∼ 0.5 MV [94]. The RF frequency is, for synchronicity and good energy averaging, νRF = 5ν0 or vRF = 6ν0 , where v0 = 0.98 MHz is the beam revolution frequency. The remaining second-order component of spin decoherence, due to the average of 4γG being different for each particle, is suppressed by four families of sextupoles with optimized strengths. 6.3.3 Sextupole Family Nomenclature In the Senichev FS and QFS lattices, the sextupole families are named SFPn, SDPn, SFNn, and SDNn. The first letter S means sextupole; the second letter is either F or P, denoting focusing or defocusing sextupoles, respectively; and the third letter is P or N, denoting positive or negative dispersion, respectively. The optional number n distinguishes between different sextupole families of the same type. 6.4 Spin Decoherence Study We studied spin decoherence in the three FS and QFS lattices presented above, with optimization of the spin decoherence by sextupole strengths and as a function of the number of tracking turns N. In this study, we were concerned with the decoherence of polar angles of the spin vectors, which is key to the feasibility of EDM signal measurement using these lattices and the FS and QFS methods. 224 6.4.1 Computational Software In the context of this chapter, we used COSY INFINITY [68] for various spin tracking calculations, including: 1. the manual and automatic spin decoherence optimization by sextupole family strengths; 2. the investigation of spin decoherence growth as a function of the number of turns; and 3. the study of the effects of systematic errors on spin decoherence. We used Wolfram Mathematica notebooks for: 1. the automated preparation of COSY INFINITY input files from templates using the specified parameters, patterns, and markers in the template files; and 2. the storage, processing, quality assurance, and report generation using data from the COSY INFINITY output files. All optimization and tracking plots in the remainder of this chapter were generated using the report-generating Mathematica notebook. 6.4.2 Fringe Fields of Electrostatic Deflectors For the fringe fields of the electrostatic deflectors (electrostatic dipoles) in the Senichev FS and QFS lattices, we used the Enge function coefficients that we calculated in sec. 2.3 for a semi-infinite electrostatic deflector with rounded edges and a realistic D/20 plate thickness, where D is the full aperture of the electrostatic deflector. These Enge function coefficients are listed in Table 6.1. 6.4.3 Manual Optimization of Sextupole Strengths As the first step in the optimization of the sextupole family strengths, we performed their manual optimization. We tracked the three lattices for 2.5 × 104 turns with equidistant grid-point sets of initial particle offsets in x–a, y–b, and l–δK planes, with the RF cavity off an on, and with the various RF cavity frequencies and voltages as listed for each of the lattices. 225 Coefficient Value h0 h1 h2 h3 h4 h5 1.0614024399605924 1.6135741290714967 −0.9401447081042862 0.4781500036872176 −0.14379986967718494 0.017831089071215347 Table 6.1: Enge function coefficients of a semi-infinite capacitor with rounded edges of D/20 plate thickness. Here, we used these Enge function coefficients to model the fringe fields of the electrostatic deflectors in the Senichev FS and QFS lattices. As the spin decoherence objective function, we used the maximum spin vector’s polar angle θ deviation from that of the reference particle: OBJ = max |θi − θ0 | , i where θi is the spin vector’s polar angle of the i-th particle in the particle bunch and index i = 0 denotes the reference particle. In each manual-optimization tracking run, we obtained a set of objective function values OBJ for a grid-point set of sextupole strengths assigned to a sextupole family. We performed manual optimization with two iterations per sextupole family: the first iteration used a grid-point set of the sextupole family strength with a large range to observe the general pattern of spin decoherence as a function of the sextupole family strength, and the second iteration decreased the range of the grid-point set to a neighborhood of the apparent spin decoherence minimum. For the example of the Senichev 6.3 QFS lattice, with the RF cavity on and initial particle offsets in the x–a plane, Fig. 6.6 shows a plot of objective function values OBJ (ordinate) as a function of sextupole strengths (abscissa). Each plot marker color corresponds to a sextupole family – SFP1, SFP2, SDP1, SDP2, SFN1, SDN1, or SDN2 – and the wide-range or a narrow-range set of sextupole strengths, as denoted in the plot legend. Compared with the x–a plane, in case of initial particle offsets in the y–b plane, the objective function curves are more parabolic and lower in magnitude. 226 Figure 6.6: Objective function OBJ as a function of sextupole family strengths in the Senichev 6.3 QFS lattice. Each plot marker color corresponds to a sextupole family – SFP1, SFP2, SDP1, SDP2, SFN1, SDN1, or SDN2 – and the wide-range (‘a’) or a narrow-range (‘b’) set of sextupole strengths, as specified within the plot legend codes. Tracking was performed for 2.5 × 104 turns with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. 6.4.4 Automatic Optimization of Sextupole Strengths Having obtained the approximate global minima for the spin decoherence objective function OBJ as a function of each of the sextupole family strengths, we further optimized the spin decoherence using COSY INFINITY’s built-in Levenberg–Marquardt optimizer. For the example of the Senichev 6.3 QFS lattice, with the RF cavity on and initial particle offsets in the x–a plane, Fig. 6.7 shows the spin vector’s polar angle θ as a function of the initial x offset of a tracked particle after 2.5 × 104 turns. Each plot marker color corresponds to a sextupole family – SFP1, SFP2, SDP1, SDP2, SFN1, SDN1, or SDN2 – as denoted in the plot legend. We note that, 227 `RF`x`SFP1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDP1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDP2`S6p3FR3f4p4MHz100kVbn` `RF`x`SFN1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDN1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDN2`S6p3FR3f4p4MHz100kVbn` θ 0.0010 0.0005 -0.004 0.002 -0.002 0.004 x -0.0005 -0.0010 Figure 6.7: Spin vector’s polar angle θ after 2.5 × 104 turns as a function of the initial x offset of the tracked particle, after manual and automatic spin decoherence optimization by a sextupole family strength in the Senichev 6.3 QFS lattice. Each solid curve color corresponds to a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as specified within the plot legend codes. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = 5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. The curves appear to be bounded by two symmetric lines (dashed red). with the RF cavity on, the polar angle θ vs. initial particle offset curves often appear to be bounded by two symmetric slanted lines. For implementation feasibility, it is necessary for the optimized sextupole strengths to have sufficiently large neighborhoods, within which the objective function OBJ does not increase excessively. Fig. 6.8 shows, on a log – log scale, the objective function OBJ versus deviation from the optimal sextupole strengths. Considering that physical sextupoles strengths can be realistically set with the accuracy of ∼ 0.1%, the thickness of the sextupole strength optimums is quite acceptable. 6.4.5 Spin Decoherence Analysis At 2.5 × 104 turns, the spin decoherence in the FS and QFS lattices was sufficiently large for x = 5 × 10−3 m or δK = 5 × 10−3 beam apertures to require the study of its longer-term behavior 228 `RF`x`SFP1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDP1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDP2`S6p3FR3f4p4MHz100kVbn` `RF`x`SFN1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDN1`S6p3FR3f4p4MHz100kVbn` `RF`x`SDN2`S6p3FR3f4p4MHz100kVbn` log10 (OBJ) -2.0 -2.5 -3.0 -14 -12 -10 -8 log10 (|ΔB -6 ″ -4 -2 T [ m2 ]|) Figure 6.8: Objective function OBJ as a function of sextupole family strengths in the Senichev 6.3 QFS lattice, in the neighborhoods of the respective optimal sextupole family strengths obtained in the automatic optimization. The absolute value ∆B00 = 0 of sextupole family strength offset corresponds to its optimal value. Each plot marker color corresponds to a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as specified within the plot legend codes. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. [109]. With optimized sextupole strengths and the RF cavity on, we tracked the FS and QFS lattices for 4.2 × 105 and, in some cases, for 106 turns. Normally, we tracked the lattices using COSY INFINITY’s most accurate fringe field calculation mode FR 3. For comparison, we additionally performed tracking with the RF cavity off, as well as without fringe field calculations (fringe field mode FR 0). Spin decoherence objective function OBJ as a function of the number of tracked turns N is shown in Figs. 6.9, 6.10, and 6.11 for the Senichev BNL, 6.3, and E+B lattices, respectively. We found that spin decoherence suppression using an RF cavity and sextupole strengths often results in the spin decoherence remaining in approximately the same range for at least 4.2 × 105 turns. Spin decoherence effects were similar in the three FS and QFS lattices. The calculation results 229 Figure 6.9: Horizontal spin decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev BNL FS lattice, up to 4.2 × 105 turns. The spin decoherence remains approximately in the same range below 7 × 10−4 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP or SDP – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 3.5 MHz, and RF cavity voltage V = 100 kV. indicate that spin decoherence suppression using an RF cavity and sextupoles may be sufficient to optimize spin decoherence to less than 1 rad in one billion turns, achieving the spin coherence time (SCT) of 103 s required for the EDM signal measurement [109]. 6.5 Systematic Errors Study Systematic errors due to imperfections in the physical lattice, including particle optical element misalignments [18, pp. 448–451] and geometric errors [60, ch. 13, pp. 73–76], are causative to a fake EDM signal. Considering the Thomas–BMT equation, rotational magnet misalignments are particularly problematic in this respect. We note that (1) the electrostatic deflector field strengths are interdependent with the strengths of magnetic dipoles via the lattice structure and the QFS or FS condition, as applicable, and that (2) the magnetic field direction needs to be accurately reversed for reverse lattice traversal, whereas the electrostatic field remains unchanged. 230 Figure 6.10: Horizontal decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev 6.3 QFS lattice, up to 4.2 × 105 turns. For three of the sextupole families, the spin decoherence remains approximately in the same range below 2 × 10−3 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP1, SDP1, SDP2, SFN1, SDN1, or SDN2 – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.4 MHz, and RF cavity voltage V = 100 kV. To extract the EDM signal in the presence of rotational magnet misalignments, Senichev proposed a modification of the QFS and FS methods, where polarized particle bunches are tracked in both clockwise (CW) and counterclockwise (CCW) directions [99]. Horizontal magnetic error field components Bx and Bz rotate spin in the vertical plane, causing a fake EDM signal. On the other hand, a vertical magnetic error field component By results in rotation in the horizontal plane, which has an impact on the satisfaction of the QFS or FS condition and on spin decoherence but does not result in a fake EDM signal. We studied spin dynamics in the QFS and FS lattices in the presence of rotational magnet misalignments causing horizontal magnetic error field components Bx and Bz . In particular, we studied spin decoherence and precession frequencies in the vertical plane. 231 Figure 6.11: Horizontal decoherence objective function OBJ as a function of the number N of tracked turns in the Senichev E+B QFS lattice, up to 4.2 × 105 turns. The spin decoherence remains approximately in the same range below 1.5 × 10−3 during the tracking. Each curve color corresponds to spin decoherence optimization by a sextupole family – SFP, SDP, SFN, or SDN – as denoted in the plot legend. Optimization and tracking were performed with the RF cavity on, particles launched with initial x offsets up to xi = ±5 × 10−3 m, fringe field mode FR 3, RF cavity frequency ν = 4.9 MHz, and RF cavity voltage V = 100 kV. 6.5.1 EDM Signal Extraction by Tracking in Opposite Directions Considering the Lorentz force, the reversal of an orbital transfer map reverses the direction of the magnetic field but does not affect the electrostatic field. At the same time, traversal of a lattice in the reverse direction reverses the direction of the reference particle’s momentum. As a result, the MDM angular velocity of the reference particle,     q 1 E ×β ΩMDM = GB − G − 2 , m c γ −1 in the Thomas–BMT equation reverses direction if the lattice is traversed in the reverse direction. On the other hand, the EDM angular velocity of the reference particle,   qη E ΩEDM = +β ×B , m2 c 232 remains the same due to reverse traversal of the lattice. This can be seen by substituting −E for E and −β for β in the ΩMDM and ΩEDM equations. Therefore, with a sufficiently small transversal and longitudinal beam emittance, it is possible to extract the EDM signal by tracking the lattice in CW and CCW directions and canceling out the fake EDM signal due to magnet misalignments. 6.5.2 Reverse Spin Transfer Map To perform spin tracking in a lattice traversed in the CCW direction, it is necessary to compute the reverse orbital and spin transfer maps. COSY INFINITY’s built-in procedure MR computes the reverse orbital transfer map for a given orbital transfer map. Additionally, if each particle optical element in a lattice is symmetric relative to its central cross section, the reverse transfer map can be obtained by merely reversing the order of the particle optical elements in the lattice model. To complement the procedure MR, we developed a procedure called SMR that calculates the reverse spin transfer map. The procedure SMR is as follows. PROCEDURE SMR NAP LAP ; {REVERSES SPIN MAP NAP TO LAP} VARIABLE COD 1 NV ; VARIABLE NUM 1 ; VARIABLE I 1 ; VARIABLE J 1 ; VARIABLE MM NM1 3 3 ; VARIABLE T1 NM1 1 ; VARIABLE T2 NM1 1 ; VARIABLE FLG 1 ; NUM : = MIN(TWOND, 4 ) ; MATINV NAP MM ; MM( 1 , 3 ) : = −MM( 1 , 3 ) ; MM( 2 , 3 ) : = −MM( 2 , 3 ) ; MM( 3 , 1 ) : = −MM( 3 , 1 ) ; MM( 3 , 2 ) : = −MM( 3 , 2 ) ; LOOP I 2 NUM 2 ; COD( I −1) : = DD( I −1) ; COD( I ) : = −DD( I ) ; ENDLOOP ; LOOP I NUM+1 NV ; COD( I ) : = DD( I ) ; ENDLOOP ; I F ND>2 ; COD( 5 ) : = −DD( 5 ) ; ENDIF ; 233 LOOP I 1 3 ; LOOP J 1 3 ; T1 ( 1 ) : = MM( I , J ) ; POLVAL 1 T1 1 COD NV T2 1 ; LAP ( I , J ) : = T2 ( 1 ) ; ENDLOOP ; ENDLOOP ; ENDPROCEDURE ; Consider a spin transfer map S : (Xi , Zi ) → Xi+1 , where Xi is the spin vector space and Zi is the orbital phase space after the i-th turn around the lattice in the forward direction. For each turn i, Xi is the 3D sphere S3 and Zi = R2v , where v is the phase space dimension. To take into account the nonlinear terms, the elements of the 3 × 3 matrix S can be specified as DA values, which we assert as S ∈ SO3 (n Dv ). In contrast, in the linear case or approximation, S is an element of SO3 (R).   The inverse spin transfer map S −1 : Xi+1 , R2v → Xi is the inverse matrix of the matrix S . Time reversal changes signs of momentum coordinates a and b, the longitudinal offset l [11, p. 147], and the longitudinal component sz of the spin vector. The reverse spin transfer map S R is obtained by applying the respective transformation to the inverse spin transfer map: S R = R̂S · (S −1 ◦ R̂) · R̂S , (6.13) where          R̂ =          1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 234 0 0 0    0 0 0    0 0 0     −1 0 0    0 −1 0    0 0 −1 acts on the phase space coordinates (x, y, δK , a, b, l) and   1   R̂S =  0   0 0 1 0  0    0    −1  acts on the spin vector coordinates sx , sy , sz . To obtain eq. 6.13, we made use of the property R̂−1 S = R̂S . 6.5.3 Error Field Implementation Considering the Thomas–BMT equation, a small perturbation of the magnetic field acts with a firstorder perturbation correction as a small proportional rotation on the spin vector. In the systematic errors study, we implemented rotational magnet misalignments as augmentation of the magnetic dipoles or combined E+B elements, as appropriate, with small, normally distributed rotational spin kicks. For calculation of the spin kicks, we noted that magnetic error field components Bx and Bz in a homogeneous magnetic dipole result in the following change to the MDM angular velocity: 4ΩMDM = qG (Bx , 0, Bz ) . m The total spin kick for a homogeneous magnetic dipole of angle α and radius R is then αR 4ΩMDM = v0 αGqR = (Bx , 0, Bz ) , mv0 t0 4ΩMDM = where t0 is the time of flight of the reference particle with velocity v0 through the magnetic dipole. We implemented the spin kicks in COSY INFINITY as elements RSX, RSY, and RSZ. The spin kick elements rotate the spin vector by a specified angle ANG around the x, y, and z axes, respectively. As a representative example, the RSX spin kick element is as follows. 235 PROCEDURE RSX ANG ; VARIABLE I 1 ; VARIABLE J 1 ; { Set r o t a t i o n matrix } UMS ; LOOP I 1 3 ; LOOP J 1 3 ; SSCR ( I , J ) : = 0∗DD( 1 ) ; ENDLOOP ; ENDLOOP ; SSCR ( 1 , 1 ) : = 1 + 0∗DD( 1 ) ; SSCR ( 2 , 2 ) : = COS(ANG) + 0∗DD( 1 ) ; SSCR ( 3 , 2 ) : = −SIN (ANG) + 0∗DD( 1 ) ; SSCR ( 2 , 3 ) : = SIN (ANG) + 0∗DD( 1 ) ; SSCR ( 3 , 3 ) : = COS(ANG) + 0∗DD( 1 ) ; LOCSET 0 0 0 0 0 0 ; CE : = ’RSX’ ; DR : = 0 ; UPDATE 1 1 1 ; { Apply e l e m e n t } ENDPROCEDURE ; Our Mathematica notebook for automated preparation of COSY INFINITY input files from templates based on specified settings (1) calculated the spin kick parameters and (2) inserted the spin kick elements into the generated COSY INFINITY code. 6.5.4 Bx Magnetic Field Component Due to Systematic Errors Consider the spin dynamics of the reference particle in an FS or a QFS lattice. Let the effective EDM angular velocity be ΩEDM , aligned with the x axis and rotating the spin vector out of the midplane. Traversing the lattice in the CW direction, a nonzero Bx magnetic field component arising from systematic errors would add an effective MDM angular velocity ΩBx , for the total effective angular velocity in the vertical plane [99, p. 3395–3396] CW + Ω ΩCW EDM . x = ΩBx (6.14) Traversal of the lattice in the CCW direction would change the sign of the MDM angular 236 velocity, leaving the angular velocity ΩEDM due to EDM unchanged: ΩCCW = ΩBx CCW + ΩEDM ≈ x (6.15) ≈ −ΩBx CW + ΩEDM . In the horizontal plane, for the particle bunch, the average spin angular velocity can be expressed as Ωy = 0 + hδ Ωdecoh i, where hδ Ωdecoh i accounts for spin decoherence in the horizontal plane. Considering eqns. 6.14 and 6.15, with Bx magnetic field components due to systematic errors, angular velocity due to EDM can be extracted as [99, p. 3395–3396] ΩEDM = CCW ΩBx CCW + ΩBx CW ΩCW x + Ωx − . 2 2 (6.16) Accordingly, to apply this EDM measurement method, it is necessary (1) to minimize the MDM  angular velocity decoherence σ ΩBx in the vertical plane using the same method as for spin decoherence minimization in the horizontal plane, that is, using the RF cavity and by optimizing CW CCW the sextupole family strengths; (2) to minimize ΩBx + ΩBx by calibrating the magnetic fields, which can be achieved by matching the spin precession frequencies in the horizontal plane [99, p. 3395–3396]; and (3) to minimize the transversal and longitudinal emittance. 6.5.5 Bz Magnetic Field Component Due to Systematic Errors Now consider the Bz magnetic field component in a homogeneous magnetic dipole due to a rotational misalignment. We denote the z component of the MDM angular velocity due to the Bz magnetic error field component as Ωz = ΩBz , whereas the x and y components of the MDM angular velocity are Ωx = 0 and Ωy = 0 + δ Ωdecoh , where δ Ωdecoh accounts for spin decoherence in the horizontal plane [99, p. 3396]. Hence, the MDM angular velocity is  ΩMDM = 0, δ Ωdecoh , ΩBz . Let the initial condition for the spin vector be s0 = (0, 0, 1). In this case, ΩMDM is tilted at an  angle α = arctan ΩBz /δ Ωdecoh from the vertical axis, and spin precesses in a circle of the unit   sphere centered at 0, sin α cos α, sin2 α . The radius of the circle is cos α. 237 We note that tan α = sin α = p 1 + tan2 α ΩBz =q Ω2Bz + δ Ω2decoh and 1 = cos α = p 1 + tan2 α δ Ωdecoh =q . Ω2Bz + δ Ω2decoh The solution of the Thomas–BMT equation in this case is   s (t) = 0, sin α cos α, sin2 α + + cos α (sin (|ΩMDM |t) , − sin α cos (|ΩMDM |t) , cos α cos (|ΩMDM |t)) =  1 = δ Ωdecoh |ΩMDM | sin (|ΩMDM |t) , |ΩMDM |2  ΩBz δ Ωdecoh (1 − cos (|ΩMDM |t)) , Ω2Bz + δ Ω2decoh cos (|ΩMDM |t) , where |ΩMDM | = (6.17) q Ω2Bz + δ Ω2decoh (see also [99, p. 3396]). Changing the lattice traversal direction from CW to CCW reverses the direction of spin vector’s MDM angular velocity; however, it also reverses the direction of the z axis, which is why the same eq. 6.17 applies to both CW and CCW traversal modulo the difference between the inverse and the reverse spin transfer maps. Thus, the method of Bx magnetic error field component mitigation described above is not applicable to the Bz case, and the solution is to minimize ΩBz using additional trim coils [99, p. 3396]. 6.5.6 EDM Measurement Accuracy with Rotational Magnet Misalignments D. Eversmann et al. [34, 95, p. 3] presented a new method of spin tune measurement, which enables measurement of spin angular frequency Ω with standard deviation r 6 1 σΩ = 2δ εA , NT 238 where N is the total number of recorded events, δ εA is the relative error of polarization asymmetry measurement, and T is the measurement duration. The FS and QFS methods require the measurement duration to be at least ∼ 1000 s. We assume realistic values of measurement duration T1 ' 1000 s and the number of particles per fill N0 = 1011 . Detector count events are aggregated into groups of 2000, resulting in δ εA ≈ 0.03. With beam exhaustion at measurement of 75% and polarimeter efficiency of R = 1%, the x components 1 ' and ΩCCW of spin angular frequencies may be measured with standard deviation σΩ ΩCW x x 2.4 × 10−7 rad/s [95, p. 2277]. With a realistic annual accelerator beamtime of Tann ' 6000 h, the standard deviation of 1 ann = p σΩ σΩ ' 1.6 × 10−9 rad/s Tann /T1 may be achieved. Considering that an EDM of ∼ 10−30 e · cm would, by eq. 6.1, result in an EDM ann ' 1.6 × 10−9 rad/s would angular velocity of ΩEDM,x ' 10−8 rad/s, the standard deviation σΩ enable EDM signal measurement using eq. 6.16 with an accuracy of 10−30 e · cm [95, p. 2277]. To maintain the EDM signal measurement accuracy of 10−30 e · cm, it is necessary, considering eq. 6.17, to minimize the z component ΩBz of the MDM angular frequency due to rotational ann ' 10−9 rad/s, such magnet misalignment using trim coils to a substantially lower level than σΩ as ΩBz ' 10−10 rad/s [99, p. 3396]. Similarly, when changing the direction of the lattice traversal, the magnetic field must be CCW to be at a substantially lower level than reversed with a sufficient accuracy for ΩCW + Ω Bx Bx ann ' 10−9 rad/s, such as ΩCW + ΩCCW ' 10−10 rad/s. σΩ Bx Bx 6.5.7 Spin-Tracking Datasets To assess the feasibility of EDM signal measurement by tracking the lattice in CW and CCW directions and applying eq. 6.16, it is necessary to study spin dynamics and decoherence in the vertical plane in the presence of rotational magnet misalignments. 239 In the context of our systematic errors study, we produced more than 46 spin-tracking datasets. These datasets include combinations of the following: (1) Senichev 6.3, E+B, and BNL lattices; (2) optimization by the SFP, SDP, SFP1, and SDP2 sextupole families, as appropriate, as well as no optimization; (3) −0.5x, 0x, 0.05x, 0.5x, 1x, and 2x corrective horizontal spin kicks, where 1x is exactly satisfies the QFS/FS condition and 0x is the lack of a spin kick; and (4) normally distributed random-variate rotational magnet misalignments with standard deviation σ (α) = 10−4 rad and, to ensure that vertical spin decoherence is proportional to rotational magnet misalignments, σ (α) = 5 × 10−5 rad. As expected, the vertical spin decoherence was proportional to the rotational magnet misalignments. Each spin-tracking dataset comprises 24 COSY INFINITY output files, one for each combination of the following: (1) Bx and Bz error fields and no error field; (2) CW and CCW lattice traversal directions; (3) spin tracking in the horizontal and the vertical plane; and (4) particles launched with equidistant initial x and δK offsets. 6.5.8 Spikes in the Horizontal Spin Decoherence Measure at the Poles We often observed apparent horizontal spin decoherence spikes when the spin vectors of the particle bunch passed through the poles of the spherical coordinate system at azimuthal angles φ = ±π/2 , as illustrated in Fig. 6.12. These spikes are due to the use of spin decoherence measures σθ and σφ , where θ is the polar angle, and do not have a physical meaning. To confirm that this interpretation is correct, we considered a minimal test case of three particles with initial spin spherical coordinates (r, θ , φ ) = (1, −ε, 0), (1, 0, 0), and (1, ε, 0). We rotated the three spins around the x axis in Mathematica, and observed the same pattern of spikes in the horizontal spin decoherence σθ at azimuthal angles φ = ±π/2. The spikes were not a hindrance to our systematic errors study; however, we note that this spikes effect can be avoided by using a different horizontal spin decoherence measure, such as σsxy , where q  sx , sy , sz are the spin vector components in Cartesian coordinates (x, y, z) and sxy = s2x + s2y . 240 (a) Azimuthal angle φref of the reference particle’s spin as a function of the number N of tracked turns. (b) RMS of the spin polar angles Θ of the particle bunch as a function of the number N of tracked turns. Figure 6.12: In this example, the RMS of the spin polar angles Θ of the particle bunch (sub-figure b) spikes when the azimuthal angle φref of the reference particle’s spin (sub-figure a) passes through the poles φref = ±π/2. Particles were launched through the Senichev E+B lattice with initial x offsets up to xi = ±5 × 10−3 m. 1x corrective spin kicks were used. Tracking was performed in the CCW direction, with a Bx magnetic error field component, in fringe field mode FR 3, with the RF cavity on. The RF cavity frequency was ν = 4.9 MHz, and the RF cavity voltage was V = 100 kV. The horizontal spin decoherence objective function OBJ was pre-optimized by the SDP sextupole family strength. 241 6.5.9 Vertical Spin Decoherence Analysis The plots in Fig. 6.13 show typical vertical spin decoherence as a function of the number of turns in the Senichev E+B and Senichev BNL lattices in case of no corrective spin kicks. The plots in Fig. 6.14 show typical vertical spin decoherence as a function of the number of turns in the Senichev E+B and Senichev BNL lattices in case of 1x corrective spin kicks. Vertical spin decoherence often remains in the same range, or grows in case of CW lattice traversal within the range bounding vertical spin decoherence for the CCW lattice traversal, for at least 4.2 × 105 turns. This indicates that suppression of spin decoherence using an RF cavity and optimized sextupole family strengths may be sufficient for a 103 s SCT in the vertical plane for the EDM signal measurement via vertical spin precession frequencies and tracking particles through the FS or QFS lattice in the opposite directions to be feasible. 6.6 Conclusion Our spin decoherence study of FS and QFS lattices shows that, with an optimized sextupole family strength, the spin decoherence often remained in the same range for at least 4.2 × 105 turns. This is promising with respect to the requirement of maintaining a spin coherence time of 103 seconds to possibly build a measurable EDM signal. The QFS structure decoherence is similar to that of the FS structure. Furthermore, the systematic errors study shows that, for at least 4.2 × 105 turns, the vertical spin decoherence due to rotational magnet misalignments often remained in the same range (or grew within the range of the spin decoherence curve for tracking in the opposite direction) in both FS (Senichev BNL) and QFS (Senichev E+B) lattices. The vertical spin decoherences in the FS and QFS lattices were qualitatively very similar and quantitatively within about 1–2 orders between each other. As the sextupole family strengths were optimized for the CW lattice traversal, vertical spin decoherence is somewhat higher when tracking in the CCW direction than when tracking in the CW direction. We estimate for the QFS and FS lattices that one year of measurement statistics will result in an 242 `RF`x`FWD`BNLFR3f5MHz100kVSDPBx0RANT1k420kSy` `RF`x`REV`BNLFR3f5MHz100kVSDPBx0RANT1k420kSy` `RF`x`FWD`BNLFR3f5MHz100kVSDPBd0RANT1k420kSy` `RF`x`REV`BNLFR3f5MHz100kVSDPBd0RANT1k420kSy` log10 [RMS] -6.0 10 20 30 40 N 2 × 104 -6.5 -7.0 -7.5 -8.0 -8.5 (a) Senichev BNL FS lattice. `RF`x`FWD`EBFR3f5MHz100kVSDPBx0RANT1k420kSy` `RF`x`REV`EBFR3f5MHz100kVSDPBx0RANT1k420kSy` `RF`x`FWD`EBFR3f5MHz100kVSDPBd0RANT1k420kSy` `RF`x`REV`EBFR3f5MHz100kVSDPBd0RANT1k420kSy` log10 [RMS] 10 20 30 40 N 2 × 104 -5.5 -6.0 -6.5 -7.0 -7.5 (b) Senichev E+B QFS lattice. Figure 6.13: RMS of the vertical spin decoherence as a function of the number N of tracked turns in the Senichev BNL and E+B lattices, up to 4.2 × 105 turns. No corrective spin kicks were used. The vertical spin decoherence remains in approximately in the same range during the tracking for the CCW lattice traversal and grows below the respective upper bound for the CW lattices. For the CW direction, tracking with a Bx and Bz magnetic error field component is denoted by blue and green curve colors, respectively. For the CCW direction, tracking with a Bx and Bz magnetic error field component is denoted by orange and red curve colors, respectively. Particles were launched with initial x offsets up to xi = ±5 × 10−3 m. Tracking was performed with the RF cavity on, with the spin decoherence function OBJ pre-optimized by the SDP sextupole family strength, and in fringe field mode FR 3. The RF cavity harmonic number was h = 5, and the RF cavity voltage was V = 100 kV. 243 `RF`x`FWD`BNLFR3f5MHz100kVSDPBx1RANT1k420kSy` `RF`x`REV`BNLFR3f5MHz100kVSDPBx1RANT1k420kSy` `RF`x`FWD`BNLFR3f5MHz100kVSDPBd1RANT1k420kSy` `RF`x`REV`BNLFR3f5MHz100kVSDPBd1RANT1k420kSy` log10 [RMS] 10 20 30 40 N 2 × 104 -2 -4 -6 -8 (a) Senichev BNL FS lattice. `RF`x`FWD`EBFR3f5MHz100kVSDPBx1RANT1k420kSy` `RF`x`REV`EBFR3f5MHz100kVSDPBx1RANT1k420kSy` `RF`x`FWD`EBFR3f5MHz100kVSDPBd1RANT1k420kSy` `RF`x`REV`EBFR3f5MHz100kVSDPBd1RANT1k420kSy` log10 [RMS] 10 20 30 40 N 2 × 104 -3.5 -4.0 -4.5 -5.0 -5.5 -6.0 -6.5 (b) Senichev E+B QFS lattice. Figure 6.14: RMS of the vertical spin decoherence as a function of the number N of tracked turns in the Senichev BNL and E+B lattices, up to 4.2 × 105 turns. 1x corrective spin kicks were used. The vertical spin decoherence remains in approximately the same range. For the CW direction, tracking with a Bx and Bz magnetic error field component is denoted by blue and green curve colors, respectively. For the CCW direction, tracking with a Bx and Bz magnetic error field component is denoted by orange and red curve colors, respectively. Particles were launched with initial x offsets up to xi = ±5 × 10−3 m. Tracking was performed with the RF cavity on, with the spin decoherence function OBJ pre-optimized by the SDP sextupole family strength, and in fringe field mode FR 3. The RF cavity harmonic number was h = 5, and the RF cavity voltage was V = 100 kV. 244 EDM signal measurement accuracy of ∼ 10−30 e · cm. Possible further research directions include (1) optimizing lattice parameters to more precisely satisfy the FS and QFS conditions; (2) optimizing spin decoherence for both CW and CCW lattice traversals simultaneously; (3) performing spin tracking of the lattices for larger numbers of turns; (4) using DA normal form methods to minimize spin decoherence in the FS and QFS lattices simultaneously by all sextupole families, which is otherwise nontrivial to perform automatically due to convergence to local minima; (5) performing spin tracking with 3D distribution of the launched particles in phase space for spin decoherence and systematic errors analysis. 245 APPENDICES 246 APPENDIX A CONFORMAL MAPPING METHODS A.1 Elliptic Functions and Integrals In Legendre’s notation, the incomplete integral of the first kind (or Legendre elliptic integral of the first kind) is defined as ˆ ϕ u = F (ϕ, k) = 0 dt p 1 − k2 sin2 t , where the parameter ϕ is called the Jacobi amplitude1 . Carlson’s elliptic integral of the first kind RF (x, y, z) is defined as ˆ 1 +∞ dt p , RF (x, y, z) = 2 0 (t + x) (t + y) (t + z) where x, y, z ≥ 0. The function F is equivalently expressed in terms of RF (x, y, z) as   F (ϕ, k) = sin (ϕ) RF cos2 (ϕ) , 1 − k2 sin2 (ϕ) , 1 . The DA value of RF is calculated as the sum of the scalar value (i.e., the value in R) of RF and the antiderivative of the DA value of the first derivative of RF . A numerical method to approximate the scalar value of RF is described in [87, pp. 309–316]. The Jacobi elliptic functions sn, cn, and dn2 are defined as   sn (u|k) = sin F−1 (u, k) ,   cn (u|k) = cos F−1 (u, k) , q  dn (u|k) = 1 − k2 sin2 F−1 (u, k) , 1 We (A.1) use ϕ to denote the Jacobi amplitude only in the context of definitions of elliptic functions and integrals. Otherwise, ϕ usually denotes an electrostatic potential (or voltage). 2 Additional information on the Jacobi elliptic functions can be found at http://mathworld. wolfram.com/JacobiEllipticFunctions.html. 247 where 0 < k2 < 1 and k = mod u is the elliptic modulus. A numerical method to approximate scalar values of sn, cn, dn, and ϕ as functions of u and k is described in [26, sec. 22.20]. The DA values of sn, cn, and dn can be obtained by applying eqns. A.1 to the DA value of ϕ. The DA value of ϕ can be calculated as follows: 1. Calculate the DA value of M = F (ϕ (cons (u) , k) , k), where cons takes the constant part of a DA value3 . 2. Calculate the inverse DA value of N = M − cons (M ). 3. The DA value of the Jacobi amplitude is the sum of the DA inverse of N and the constant part cons (ϕ (cons (u) , k)) of the Jacobi amplitude. The complete elliptic integral of the first kind K (k) is defined as4   1 K (k) = F π, k , 2 where F (ϕ, k) is the incomplete elliptic integral of the first kind. Note that the incomplete elliptic integral F can be also written as   π +∞ (2π − 1)!! 2 2n K (k) = ∑ k . 2 n=0 (2n)!! The parameter m = k2 is often used in lieu of the elliptic modulus k as an argument of the Jacobi elliptic functions and the elliptic integrals; for example, sn (u|m) is equivalent to sn (u|k). In effect, there are two versions of each elliptic function and integral: one takes the parameter m, the other takes the elliptic modulus k as an argument, and whether m or k is supplied as that argument determines the version to be used. 3 In terms of [11, ch. 2], cons (a) has the same meaning as [a]0 for any DA value a. information on the elliptic integral of the first kind can be found at http://mathworld.wolfram.com/CompleteEllipticIntegraloftheFirstKind.html. 4 Additional 248 A.2 Laplace Equation and Conformal Mappings The electrostatic potential inside a beam physics element can be obtained by solving the Laplace equation 4ϕ = 0 for electrostatic potential ϕ with Dirichlet boundary conditions as the voltages at the boundaries, e.g., the plates and the rectangular enclosure of an electrostatic quadrupole. In many cases, for the main field of a particle optical element, the problem may be accurately modeled by 2D geometry. This also holds for the fringe field of a semi-infinite electrostatic capacitor. The Laplace equation then has the 2D form ∂ 2ϕ ∂ 2ϕ + 2 = 0. ∂ x2 ∂y The isomorphism (x, y) ↔ z = x + i y gives an equivalent representation of the 2D geometry in R2 on the complex plane C. If a complex function f (x + iy) = u (x, y) + i v (x, y) is complex-differentiable at every point of a region R ⊆ C, it is called holomorphic (or analytic) in the region R. In turn, a complex function f is complex-differentiable at point z0 = x0 + i y0 if there exists a neighborhood U (z0 ) of z0 such that (1) f ∈ C1 (U (z0 )), i.e., f has continuous first partial derivatives in U (z0 ); and (2) f satisfies the Cauchy–Riemann equations ∂u ∂v = , ∂x ∂y ∂v ∂u =− ∂x ∂y in U (z0 ). Holomorphic functions satisfy the 2D Laplace equation, i.e., ∂ 2u ∂ 2u + = 0, ∂ x2 ∂ y2 ∂ 2v ∂ 2v + = 0. ∂ x2 ∂ y2 A conformal mapping (or conformal map) is a transformation w = f (z) that is locally angle preserving. A holomorphic function is conformal at point z if f 0 (z) 6= 0. Conformal maps are also called biholomoprhic, which reflects that both a conformal mapping and its inverse are holomorphic. The domain of a conformal mapping is called the canonical domain, and the image of a conformal mapping is called the physical domain. 249 A Schwarz–Christoffel mapping is a conformal mapping from the upper half-plane as the canonical domain to the interior of a polygon as the physical domain. The polygon is generalized in the sense that it may have vertices at the complex infinity ∞ [29, 30].  Consider an n-sided polygon as the physical domain. The preimages z j = f −1 w j of the polygon’s vertices w j , where j = 1, 2, . . . , n, are called prevertices. We use the notation πα j , j = 1, 2, . . . , n, for the interior angles of the polygon. For finite vertices w j , the trivial condition 0 < α j ≤ 2 applies. For vertices at the complex infinity, i.e., w j = ∞, the respective α’s are in the interval −2 ≤ α j ≤ 0 [30, pp. 1–3]. Variants of the Schwarz–Christoffel mapping include using a unit disk, a bi-infinite strip, or a rectangle as the canonical domain. We will use the general term “conformal mapping” for variants of the Schwarz–Christoffel mapping. For canonical domains as the upper half-plane, a unit disk, a bi-infinite strip, or a rectangle, the analytic expressions for the respective conformal maps f or their derivatives f 0 can be found in [30]. Those formulas contain prevertices z j as parameters, which can be obtained using optimization methods. The electrostatic potential for a cross section or a longitudinal section modeled by a generalized polygon may be found by obtaining a conformal mapping from a suitable canonical domain to the polygon. A bi-infinite strip is a suitable canonical domain if the polygon comprises two groups of consecutive sides characterized by the same constant Dirichlet boundary condition, with two constant values in total. A rectangular part of a bi-infinite strip is a suitable canonical domain when the physical domain is a logical (or generalized) quadrilateral. In this context, a generalized quadrilateral is a polygon comprising four groups of sides, where the groups are defined as follows: 1. the groups are sets of consecutive sides; 2. two consecutive sides are in different groups if and only if one has a Dirichlet boundary condition and the other one has a von Neumann boundary condition; and 3. each Dirichlet boundary condition group is characterized by one constant value as the Dirichlet 250 boundary condition. If the solution of the Laplace equation in the canonical domain is φ , the solution of the Laplace equation in the physical domain is ϕ = φ ◦ f −1 . In practice, the electrostatic potential is usually the appropriately selected, shifted, and scaled real or imaginary part of f −1 . The solution for the electrostatic potential obtained this way is fully Maxwellian in the sense that the analytic formula for f 0 results in the solution for the potential satisfying the Laplace equation. As described in [30, 108], inverse conformal mapping g = f −1 may be obtained by 1. solving the equation f (g (w)) − w = 0 (A.2) using the Newton–Raphson or another numerical method; or 2. solving the ODE dg (w) 1 = 0 , dw f (g (w)) A.3 g (w0 ) = z0 . (A.3) Schwarz–Christoffel Toolbox There is a number of specialized software packages for Schwarz–Christoffel and conformal mapping computations, including the FORTRAN packages SCPACK, DSCPACK, and CONFPACK, as well as the MATLAB package Schwarz–Christoffel Toolbox (SC Toolbox) [28]. The SC Toolbox may be downloaded from http://www.math.udel.edu/~driscoll/SC/. See its User’s Guide [29] for usage details. As described on the SC Toolbox’s website [27], “the SC Toolbox is a problem-solving environment for computation and interaction with conformal maps to regions bounded by polygons, including unbounded regions, logical quadrilaterals, and channels”. The interactive features of the SC Toolbox include the optional interactive selection of polygon points and Dirichlet boundary conditions (e.g., voltages). 251 We use the SC Toolbox to obtain prevertices, strip length of the canonical domain, and other information, as applicable, for conformal maps specified by vertices and interior angles of polygonal models. The function polygon (W, ALPHA) constructs a polygon object, which is the SC Toolbox representation of a polygon in the physical domain. The parameter W is a complex vector W = [w1 , · · · , wn ] that specifies the polygon vertices w j , j = 1, 2, . . . , n, in consecutive order; and the optional parameter ALPHA is a real vector ALPHA = [alpha1 , · · · , alphan ] that specifies the respective values α j , j = 1, 2, . . . , n, defined above, i.e., the interior angles at the vertices divided by π. If the polygon has vertices at the complex infinity ∞, (1) the parameter ALPHA is required, and (2) polygon vertices must be specified in the clockwise order5 [29]. Once a polygon object is created, e.g., by p= p o l y g o n ( [ 0 , 1 , 2 + i / 2 , 1 + i , i ] ) a conformal mapping can be computed from a canonical domain to the interior of that polygon. For example, f=rectmap ( p , [ 1 , 2 , 4 , 5 ] ) returns a conformal mapping f from the interior of a rectangle to the interior of the polygon p. Here, the second parameter of the function rectmap specifies the indices j of the prevertices z j that are the corners of the rectangle [29]. When called without a parameter from the MATLAB command line, the object f returns a list of vertices, prevertices, α values, and other information. 5 Sometimes, it may be necessary to rotate (shift) the order of the vertices of the polygon in the W vector or insert a “guiding” degenerate vertex between a vertex at the infinity and another vertex. A degenerate vertex has the internal angle of π and does not change the function graph of the polygon. 252 By default, the parameter m is not in this list. Internally, the SC Toolbox calculates and uses the strip length L instead of the parameter m. This serves to address the floating-point error in 1 − m for small values of the parameter m. Mathematica and similar software use highly accurate real number representations similar to Unum [47], where this is not an issue. The parameter m is related to L as m = exp (−2πL) . The strip length L can be displayed for the object f, e.g., by the commands z = parameters ( f ) ; d is p ( num2str ( z . s t r i p L , ’%22.16 e ’ ) ) The constant c may be obtained as the quotient of (1) the values of evaldiff (f, z), which returns f 0 (z) in the SC Toolbox; and (2) the respective values of the analytic expression of f 0 (z) without the constant c. To evaluate the inverse of a conformal mapping f, by default, the SC Toolbox solves the ODE from eq. A.3 and then uses Newton iterations to improve the solution. Optionally, the SC Toolbox can either only use the ODE solution or only solve eq. A.2 using Newton iterations. 253 APPENDIX B SC TOOLBOX POLYGONAL MODELS OF SEMI-INFINITE CAPACITORS B.1 One Capacitor with Infinitely Thick Plates The following is a polygonal model code representation of the semi-infinite capacitor with infinitely thick plates in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0 and 2i were added as guiding points for the SC Toolbox’s algorithm. p1 = p o l y g o n ( [ i , I n f , 0 , I n f , 2∗ i ] , [ 3 / 2 , 0 , 1 , −1/2 , 1 ] ) B.2 One Capacitor with Plates of D/20 Thickness The following is a polygonal model code representation of the semi-infinite capacitor with plates of D/20 thickness in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0 and −1 + 1.1i were added as guiding points for the SC Toolbox’s algorithm. p2 = p o l y g o n ( [ 1 . 1 i , i , I n f , 0 , I n f , −1+1.1 i ] , [ 3 / 2 , 3 / 2 , 0 , 1 , −1, 1 ] ) B.3 One Capacitor with Plates of D/20 Thickness and Rounded Edges The following is a polygonal model code representation of the semi-infinite capacitor with plates of D/20 thickness and rounded edges in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0 and −1 + 1.1i were added as guiding points for the SC Toolbox’s algorithm. p2a = p o l y g o n ( [ 1 . 1 i , 0 . 0 0 3 7 3 6 5 + 1 . 0 9 9 8 6 i , 0 . 0 0 7 4 5 2 1 1 + 1 . 0 9 9 4 4 i , . . . 0.011126+1.09875 i , 0.0147378+1.09778 i , 0.0182671+1.09654 i , . . . 0.0216942+ 1.09505 i , 0.025+1.0933 i , 0.028166+1.09131 i , . . . 0.0311745+ 1.08909 i , 0.0340086+1.08665 i , 0.0366526+1.08401 i , . . . 0.0390916+ 1.08117 i , 0.0413119+1.07817 i , 0.0433013+1.075 i , . . . 0.0450484+ 1.07169 i , 0.0465437+1.06827 i , 0.0477786+1.06474 i , . . . 254 0.0487464+ 1.06113 i , 0.0494415+1.05745 i , 0.0498602+1.05374 i , . . . 0.05+ 1.05 i , 0.0498602+1.04626 i , 0.0494415+1.04255 i , . . . 0.0487464+ 1.03887 i , 0.0477786+1.03526 i , 0.0465437+1.03173 i , . . . 0.0450484+ 1.02831 i , 0.0433013+1.025 i , 0.0413119+1.02183 i , . . . 0.0390916+ 1.01883 i , 0.0366526+1.01599 i , 0.0340086+1.01335 i , . . . 0.0311745+ 1.01091 i , 0.028166+1.00869 i , 0.025+1.0067 i , . . . 0.0216942+ 1.00495 i , 0.0182671+1.00346 i , 0.0147378+1.00222 i , . . . 0.011126+ 1.00125 i , 0.00745211+1.00056 i , 0.0037365+1.00014 i , . . . 0 . + 1 . i , i n f , 0 , i n f , −1+1.1 i ] , . . . [85/84 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 8 5 / 8 4 , 0 , 1 , −1, 1 ] ) ; B.4 One Capacitor with Infinitely Thin Plates The following is a polygonal model code representation of the semi-infinite capacitor with infinitely thin plates in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0 and −1 + i were added as guiding points for the SC Toolbox’s algorithm. p0 = p o l y g o n ( [ i , I n f , 0 , I n f , −1+ i ] , [ 2 , 0 , 1 , −1, 1 ] ) B.5 Adjacent Capacitors with Plates of 3D/4 Thickness, Symmetric Voltages, and Rounded Edges The following is a polygonal model code representation of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, symmetric voltages, and rounded edges in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0, 6 + 2.5i, and −6 + 2.5i were added as guiding points for the SC Toolbox’s algorithm. 255 p3b = p o l y g o n ( [ − 5 . + 2 . 5 i , −4.94395+2.4979 i , −4.88822+2.49162 i , . . . −4.83311+2.4812 i , −4.77893+2.46668 i , −4.72599+2.44816 i , . . . −4.67459+2.42573 i , −4.625+2.39952 i , −4.57751+2.36968 i , . . . −4.53238+2.33637 i , −4.48987+2.29979 i , −4.45021+2.26013 i , . . . −4.41363+2.21762 i , −4.38032+2.17249 i , −4.35048+2.125 i , . . . −4.32427+2.07541 i , −4.30184+2.02401 i , −4.28332+1.97107 i , . . . −4.2688+1.91689 i , −4.25838+1.86178 i , −4.2521+1.80605 i , . . . −4.25+1.75 i , −4.2521+1.69395 i , −4.25838+1.63822 i , . . . −4.2688+1.58311 i , −4.28332+1.52893 i , −4.30184+1.47599 i , . . . −4.32427+1.42459 i , −4.35048+1.375 i , −4.38032+1.32751 i , . . . −4.41363+1.28238 i , −4.45021+1.23987 i , −4.48987+1.20021 i , . . . −4.53238+1.16363 i , −4.57751+1.13032 i , −4.625+1.10048 i , . . . −4.67459+1.07427 i , −4.72599+1.05184 i , −4.77893+1.03332 i , . . . −4.83311+1.0188 i , −4.88822+1.00838 i , −4.94395+1.0021 i , −5.+1. i , . . . inf , 0 , inf , 5.+1. i , 4.94395+1.0021 i , 4.88822+1.00838 i , . . . 4.83311+1.0188 i , 4.77893+1.03332 i , 4.72599+1.05184 i , . . . 4.67459+1.07427 i , 4.625+1.10048 i , 4.57751+1.13032 i , . . . 4.53238+1.16363 i , 4.48987+1.20021 i , 4.45021+1.23987 i , . . . 4.41363+1.28238 i , 4.38032+1.32751 i , 4.35048+1.375 i , . . . 4.32427+1.42459 i , 4.30184+1.47599 i , 4.28332+1.52893 i , . . . 4.2688+1.58311 i , 4.25838+1.63822 i , 4.2521+1.69395 i , 4.25+1.75 i , . . . 4.2521+1.80605 i , 4.25838+1.86178 i , 4.2688+1.91689 i , . . . 4.28332+1.97107 i , 4.30184+2.02401 i , 4.32427+2.07541 i , . . . 4.35048+2.125 i , 4.38032+2.17249 i , 4.41363+2.21762 i , . . . 4.45021+2.26013 i , 4.48987+2.29979 i , 4.53238+2.33637 i , . . . 4.57751+2.36968 i , 4.625+2.39952 i , 4.67459+2.42573 i , . . . 4.72599+2.44816 i , 4.77893+2.46668 i , 4.83311+2.4812 i , . . . 4.88822+2.49162 i , 4.94395+2.4979 i , 5.+2.5 i , 6.+2.5 i , inf , . . . 256 −6.+2.5 i ] , . . . [85/84 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 85/84 , 0 , 1 , 0 , 8 5 / 8 4 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 4 3 / 4 2 , 8 5 / 8 4 , 1 , −1, 1 ] ) ; B.6 Adjacent Capacitors with Plates of 3D/4 Thickness, Antisymmetric Voltages, and Rounded Edges The following is a polygonal model code representation of the two adjacent semi-infinite capacitors with plates of 3D/4 thickness, antisymmetric voltages, and rounded edges in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0 and −6 + i were added as guiding points for the SC Toolbox’s algorithm. p 6 a s 1 = p o l y g o n ( [ − 6 . + 2 . 5 i , −5.+2.5 i , −4.94395+2.4979 i , . . . −4.88822+2.49162 i , −4.83311+2.4812 i , −4.77893+2.46668 i , . . . −4.72599+2.44816 i , −4.67459+2.42573 i , −4.625+2.39952 i , . . . −4.57751+2.36968 i , −4.53238+2.33637 i , −4.48987+2.29979 i , . . . −4.45021+2.26013 i , −4.41363+2.21762 i , −4.38032+2.17249 i , . . . −4.35048+2.125 i , −4.32427+2.07541 i , −4.30184+2.02401 i , . . . −4.28332+1.97107 i , −4.2688+1.91689 i , −4.25838+1.86178 i , . . . −4.2521+1.80605 i , −4.25+1.75 i , −4.2521+1.69395 i , . . . −4.25838+1.63822 i , −4.2688+1.58311 i , −4.28332+1.52893 i , . . . −4.30184+1.47599 i , −4.32427+1.42459 i , −4.35048+1.375 i , . . . 257 −4.38032+1.32751 i , −4.41363+1.28238 i , −4.45021+1.23987 i , . . . −4.48987+1.20021 i , −4.53238+1.16363 i , −4.57751+1.13032 i , . . . −4.625+1.10048 i , −4.67459+1.07427 i , −4.72599+1.05184 i , . . . −4.77893+1.03332 i , −4.83311+1.0188 i , −4.88822+1.00838 i , . . . −4.94395+1.0021 i , −5.+1. i , −6+i , i n f , 0 , i n f ] , . . . [1 , 85/84 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 4 3 / 4 2 , . . . 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 43/42 , 85/84 , 1 , 0 , . . . 1/2 , B.7 −1/2]); Adjacent Capacitors with Plates of D/2 Thickness at Different Voltages The following is a polygonal model code representation of the two adjacent semi-infinite capacitors with plates of D/2 thickness at different voltages in the SC Toolbox in terms of vertices w j and interior angles α j π. Vertices 0, −6 + 2i, and 6 + 2i were added as guiding points for the SC Toolbox’s algorithm. p3bm = p o l y g o n ( [ 0 , i n f , 5 . + 1 . i , 4 . 5 + 1 . 5 i , 5 . + 2 . i , 6 . + 2 . i , i n f , . . . −6.+2. i , −5.+2. i , −4.5+1.5 i , −5.+1. i , i n f ] , . . . [ 1 , 0 , 5 / 4 , 3 / 2 , 5 / 4 , 1 , −1, 1 , 5 / 4 , 3 / 2 , 5 / 4 , 0 ] ) ; 258 APPENDIX C SC TOOLBOX POLYGONAL MODELS OF THE MUON g-2 QUADRUPOLE C.1 Nominal Symmetric Case (“SM”) This material pertains to the calculation of the multipole terms the Muon g-2 quadrupole in the SM case (sec. 3.2.4.1). The following MATLAB function returns the conformal mapping object f for a conformal mapping from a rectangle to the interior of the polygon object p representing the 2D geometry. function [p , f ] = initquad4 o p t i o n s = scmapopt ( ’ T o l e r a n c e ’ , 1e −16); p = p o l y g o n ( [ 0 + 0 i , 0+5 i , −2.35+5 i , −2.35+5.3 i , 0 + 5 . 3 i , 0+7 i , . . . −5.59792+7 i , −5.59792+5.879900042201571253 i , . . . −4.493957484174412+4.775937526375983 i , . . . −4.634947 505275196722+ 4.634947505275 196722 i ] ) ; f = rectmap ( p , [6 , 1 , 2 , 5] , options ) ; C.2 Non-Symmetric Case (“NSM”) This material pertains to the calculation of the multipole terms the Muon g-2 quadrupole in the NSM case (sec. 3.2.4.2). The following MATLAB function returns the conformal mapping object f for a conformal mapping from a rectangle to the interior of the polygon object p representing the 2D geometry. 259 function [p , f ] = initquad7 o p t i o n s = scmapopt ( ’ T o l e r a n c e ’ , 1e −16); p = p o l y g o n ([−7−5 i , −5.25−5 i , −4.125 −3.875 i , −3.875 −4.125 i , −5−5.25 i , . . . −5−7i , −0.25−7 i , −0.25 −5.25 i , −2.35 −5.25 i , −2.35−5 i , 2.35 −5 i , . . . 2 . 3 5 − 5 . 2 5 i , 0 . 2 5 − 5 . 2 5 i , 0.25 −7 i , 5−7 i , 5 −5.25 i , 3 . 8 7 5 − 4 . 1 2 5 i , . . . 4 . 1 2 5 − 3 . 8 7 5 i , 5.25 −5 i , 7−5 i , 7 −0.25 i , 5 . 2 5 − 0 . 2 5 i , 5 . 2 5 − 2 . 3 5 i , . . . 5 −2.35 i , 5 + 2 . 3 5 i , 5 . 2 5 + 2 . 3 5 i , 5 . 2 5 + 0 . 2 5 i , 7 + 0 . 2 5 i , 7+5 i , 5 . 2 5 + 5 i , . . . 4 . 1 2 5 + 3 . 8 7 5 i , 3 . 8 7 5 + 4 . 1 2 5 i , 5 + 5 . 2 5 i , 5+7 i , 0 . 2 5 + 7 i , 0 . 2 5 + 5 . 2 5 i , . . . 2 . 3 5 + 5 . 2 5 i , 2 . 3 5 + 5 i , −2.35+5 i , −2.35+5.25 i , −0.25+5.25 i , −0.25+7 i , . . . −5+7 i , −5+5.25 i , −3.875+4.125 i , −4.125+3.875 i , −5.25+5 i , −7+5 i , . . . −7+0.25 i , −5.25+0.25 i , −5.25+2.35 i , −5+2.35 i , −5−2.35 i , −5.25 −2.35 i , . . . −5.25 −0.25 i , −7−0.25 i ] , . . . [0.5 , 0.75 , 1.5 , 1.5 , 0.75 , 0.5 , 0.5 , 0.5 , 1.5 , 1.5 , 1.5 , 1 . 5 , . . . 0.5 , 0.5 , 0.5 , 0.75 , 1.5 , 1.5 , 0.75 , 0.5 , 0.5 , 0.5 , 1.5 , 1 . 5 , . . . 1.5 , 1.5 , 0.5 , 0.5 , 0.5 , 0.75 , 1.5 , 1.5 , 0.75 , 0.5 , 0.5 , 0 . 5 , . . . 1.5 , 1.5 , 1.5 , 1.5 , 0.5 , 0.5 , 0.5 , 0.75 , 1.5 , 1.5 , 0.75 , 0 . 5 , . . . 0.5 , 0.5 , 1.5 , 1.5 , 1.5 , 1.5 , 0.5 , 0 . 5 ] ) ; f = rectmap ( p , [50 , 55 , 56 , 49] , o p t i o n s ) ; 260 APPENDIX D MATLAB CODES FOR MUON g-2 QUADRUPOLE FOURIER MODES CALCULATION D.1 Nominal Symmetric Case (“SM”) This material pertains to the calculation of the multipole terms the Muon g-2 quadrupole in the SM case (sec. 3.2.4.1). For the conformal mapping object f and a reference radius R, the following MATLAB function calculates the discrete Fourier transform (DFT) dn and the Fourier modes a0 , an , bn of the electrostatic potential ϕ using a fast Fourier transform (FFT). The function returns the DFT as the array dn, and it returns the Fourier modes as the scalar a0 and the arrays an, bn, respectively. The function also returns the set of equidistant grid points discretizing the interval [0, 2π] as the array t, the values of the electrostatic potential ϕ at these grid points as the array inseries, and, for quality assurance purposes, the inverse FFT transform of the forward FFT transform of inseries as the array checkseries. f u n c t i o n [ a0 , an , bn , cn , t , i n s e r i e s , c h e c k s e r i e s ] = f o u r i e r a n _ v 4 ( f , R ) Fs = 1 0 0 1 ; T=2∗ p i / Fs ; i f nargin <2 % By d e f a u l t , t h e r e f e r e n c e r a d i u s i s 4 . 5 cm R=4.5; end t = 0 : T : 2 ∗ pi−T ; z= p a r a m e t e r s ( f ) ; f u n c t i o n f20= func2 ( xin , yin ) % Apply symmetries f 2 0 =−(1− r e a l ( e v a l i n v ( f ,− abs ( x i n ) + abs ( y i n ) ∗ 1 i ) + . . . z . p r e v e r t e x ( 1 ) ) / 2 / z . p r e v e r t e x ( 1 ) ) . ∗ ( abs ( y i n ) >= abs ( x i n ) ) . . . +(1− r e a l ( e v a l i n v ( f ,− abs ( y i n ) + abs ( x i n ) ∗ 1 i ) + . . . 261 z . p r e v e r t e x ( 1 ) ) / 2 / z . p r e v e r t e x ( 1 ) ) . ∗ ( abs ( y i n ) < abs ( x i n ) ) ; end i n s e r i e s = f u n c 2 ( R∗ c o s ( t ) , R∗ s i n ( t ) ) ; % plot ( inseries ) o u t s e r i e s = f f t ( i n s e r i e s ) / length ( t ) ; a0 =2∗ o u t s e r i e s ( 1 ) ; an = ( o u t s e r i e s ( 2 : 1 : ( Fs / 2 ) ) + o u t s e r i e s ( Fs : − 1 : ( Fs / 2 + 2 ) ) ) ; bn =1 i ∗ ( o u t s e r i e s ( 2 : 1 : ( Fs / 2 ) ) − o u t s e r i e s ( Fs : − 1 : ( Fs / 2 + 2 ) ) ) ; cn = o u t s e r i e s ; c h e c k s e r i e s = t r a n s p o s e ( a0 / 2 + c o s ( t r a n s p o s e ( t ) . ∗ ( 1 : l e n g t h ( an ) ) ) ∗ . . . t r a n s p o s e ( an ) + s i n ( t r a n s p o s e ( t ) . ∗ ( 1 : l e n g t h ( 1 : l e n g t h ( bn ) ) ) ) ∗ . . . t r a n s p o s e ( bn ) ) ; % plot ( checkseries ) end D.2 Non-Symmetric Case (“NSM”) This material pertains to the calculation of the multipole terms the Muon g-2 quadrupole in the NSM case (sec. 3.2.4.2). For the conformal mapping object f and a reference radius R, the following MATLAB function calculates the discrete Fourier transform (DFT) dn and the Fourier modes a0 , an , bn of the electrostatic potential ϕ using a fast Fourier transform (FFT). The function returns the DFT as the array dn, and it returns the Fourier modes as the scalar a0 and the arrays an, bn, respectively. The function also returns the set of equidistant grid points discretizing the interval [0, 2π] as the array t, the values of the electrostatic potential ϕ at these grid points as the array inseries, and, for quality assurance purposes, the inverse FFT transform of the forward FFT transform of inseries as the array checkseries. 262 f u n c t i o n [ a0 , an , bn , cn , t , i n s e r i e s , c h e c k s e r i e s ] = f o u r i e r a n _ v 5 ( f , R ) Fs = 1 0 0 1 ; T=2∗ p i / Fs ; i f nargin <2 R=4.5; end t = 0 : T : 2 ∗ pi−T ; i n s e r i e s = e v a l i n v ( f , R∗ c o s ( t ) +R∗ s i n ( t ) ∗ 1 i ) ; z= p a r a m e t e r s ( f ) ; i n s e r i e s = r e a l ( ( i n s e r i e s +z . p r e v e r t e x ( 1 ) ) / 2 / z . p r e v e r t e x ( 1 ) ) ; % plot ( inseries ) o u t s e r i e s = f f t ( i n s e r i e s ) / length ( t ) ; a0 =2∗ o u t s e r i e s ( 1 ) ; an = ( o u t s e r i e s ( 2 : 1 : ( Fs / 2 ) ) + o u t s e r i e s ( Fs : − 1 : ( Fs / 2 + 2 ) ) ) ; bn =1 i ∗ ( o u t s e r i e s ( 2 : 1 : ( Fs / 2 ) ) − o u t s e r i e s ( Fs : − 1 : ( Fs / 2 + 2 ) ) ) ; cn = o u t s e r i e s ; c h e c k s e r i e s = t r a n s p o s e ( a0 / 2 + c o s ( t r a n s p o s e ( t ) . ∗ ( 1 : l e n g t h ( an ) ) ) ∗ . . . t r a n s p o s e ( an ) + s i n ( t r a n s p o s e ( t ) . ∗ ( 1 : l e n g t h ( 1 : l e n g t h ( bn ) ) ) ) ∗ . . . t r a n s p o s e ( bn ) ) ; 263 APPENDIX E MATHEMATICA NOTEBOOK FOR MUON g-2 QUADRUPOLE MULTIPOLE TERMS CALCULATION This material pertains to the calculation of the multipole terms the Muon g-2 quadrupole in the NSM case (sec. 3.2.4.2). For the conformal mapping derivative f in the analytic form, the following Mathematica notebook calculates the multipole terms a0 , an , bn (trigonometric form), and cn (exponential form) of the electrostatic potential ϕ using the DA method described in sec. 3.2.3.2. The effective reference radius is Rref = 1 cm. S e t O p t i o n s [ E v a l u a t i o n N o t e b o o k [ ] , P r i n t P r e c i s i o n −> 3 2 ] ; V = 24 1 0 ^ 3 ; \ [ Alpha ] = { 0 . 5 ‘ , 1 . 5 ‘ , 1 . 5 ‘ , 1 . 5 ‘ , 1 . 5 ‘ , 0 . 5 ‘ , 0 . 5 ‘ , 0 . 5 ‘ , 0 . 7 5 ‘ , 1.5 ‘ , 1.5 ‘ , 0.75 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.75 ‘ , 1.5 ‘ , 1.5 ‘ , 0.75 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.75 ‘ , 1.5 ‘ , 1.5 ‘ , 0.75 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 1.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.5 ‘ , 0.75 ‘ , 1.5 ‘ , 1.5 ‘ , 0.75 ‘ , 0.5 ‘ , 0.5 ‘}; zxm = 1 . 5 7 0 7 9 6 3 2 6 7 9 4 8 9 7 4 ; zx = J o i n [ Array [ zxm &, 6 ] , Array[−zxm &, 5 0 ] ] ; zy = { 0 , 4 . 7 0 7 8 4 4 8 1 7 8 9 5 2 5 7 , 6 . 1 1 2 3 2 2 6 4 1 5 4 3 3 3 1 2 , 12.154244427584317 , 13.558722251232082 , 18.266567069128161 , 18.266567069128161 , 13.274266140422423 , 12.918629029969397 , 11.576281153221727 , 10.948991934692465 , 10.675215453051434 , 10.65269458697405 , 10.604072782442005 , 10.6027963210765 , 10.569241422270052 , 10.476916632115067 , 9.4896639886962486 , 9.4722605135357565 , 9.4665721145687325 , 9.4663618193493928 , 9.4586650413212396 , 9.4552969316026854 , 9.4223471739893334 , 9.3806007759118621 , 9.3504541968427848 , 9.3474996905761945 , 264 9.3408322140301419 , 9.3406516641648345 , 9.3358001108809781 , 9.3213334522713787 , 8.9452336168578217 , 8.9307669582482223 , 8.9259154049643676 , 8.9257348550990603 , 8.9190673785530059 , 8.9161128722864156 , 8.8859662932173382 , 8.8442198951398652 , 8.8112701375265097 , 8.8079020278079554 , 8.8002052497797987 , 8.799994954560459 , 8.794306555593435 , 8.7769030804329375 , 7.7896504370136723 , 7.6973256468586344 , 7.6637707480521646 , 7.6624942866866617 , 7.6138724821545702 , 7.5913516160771657 , 7.3175751344358959 , 6.6902859159059922 , 5.347938039156598 , 4.9923009287031883 , 0}; c = −1.1819869586349204 ‘∗^7 ; n = 56; i0 = 1; m = 2 . 1 7 7 6 1 6 6 0 6 3 9 5 3 9 5 4 10^ −15; z p o i n t 0 = −9.486801376613026∗10^ −1 + 9 . 1 3 3 2 8 3 5 3 4 5 6 4 5 8 3 I ; J a c o b i S N S e r [ z_ , o r d e r _ ?NumberQ , mpar_ : m] : = S e r i e s [ JacobiSN [ z + t , mpar ] , { t , 0 , o r d e r } ] ; J a c o b i C N S e r [ z_ , o r d e r _ ?NumberQ , mpar_ : m] : = S e r i e s [ JacobiCN [ z + t , mpar ] , { t , 0 , o r d e r } ] ; J a c o b i D N S e r [ z_ , o r d e r _ ?NumberQ , mpar_ : m] : = S e r i e s [ JacobiDN [ z + t , mpar ] , { t , 0 , o r d e r } ] ; f p r i m e [ z_ , o r d e r _ ?NumberQ , mpar_ : m] : = c J a c o b i C N S e r [ z , o r d e r , mpar ] J a c o b i D N S e r [ z , o r d e r , mpar ] Product [ ( J a c o b i S N S e r [ z , o r d e r , mpar ] − JacobiSN [ zx [ [ j ] ] + I zy [ [ j ] ] , mpar ] ) ^ ( \ [ Alpha ] [ [ j ] ] − 1 ) , {j , 1 , n }]; fprimeexpansion = fprime [ zpoint0 , 2 5 ] ; fexpansion = Integrate [ fprimeexpansion , t ] ; gexpansion = 265 InverseSeries [ fexpansion ] + ( −9.486801376613026 10^−1 + 9 . 1 3 3 2 8 3 5 3 4 5 6 4 5 8 3 I ) ; g e x p a n s i o n = ( g e x p a n s i o n + zxm ) / 2 / zxm ; c o e f f l i s t = C o e f f i c i e n t L i s t [ Normal [ g e x p a n s i o n ] , t ] ; a0 = 2 Re [ c o e f f l i s t ] [ [ 1 ] ] ; an = Re [ c o e f f l i s t ] [ [ 2 ;;]]; bn = Re [ c o e f f l i s t I ] [ [ 2 ;;]]; P r i n t [ " a0 = " , a0 ] ; P r i n t [ " an = " , an ] ; P r i n t [ " bn= " , bn ] ; 266 APPENDIX F PYTHON VERSION OF MTERMS The program mterms computes multipole terms of the Muon g-2 collaboration quadrupole with optional geometrical asymmetries and/or mispowered plates specified by the user as plate distance errors and plate voltages. mterms was implemented in COSY INFINITY and Python versions. As Python does not have DA functionality, the Python version only uses a set of pre-calculated multipole terms. The COSY INFINITY version, in addition to pre-calculated multipole terms, can use the SC Toolbox and a DA method to calculate multiple terms de novo. Below, we describe the Python version of the program and its package. F.1 Package Contents The program package includes mterms as a Python 3 script and as Linux and Windows standalone executables. 1. readme.txt: the readme file. 2. mterms.fox: Python 3 source code. 3. mterms: Linux version (prepared and tested in Ubuntu 16). 4. mterms.exe: Windows version (prepared and tested in Windows 7). 5. quad.pdf: Plot of the quadrupole’s cross-sectional geometry with default distances. F.2 Interactive Mode Run the program and follow the prompts to enter calculation parameters. Resulting multipole terms will be displayed on-screen and written to a file, which is named "mterms.txt" by default. 267 F.3 Command-Line Arguments mterms’s optional command-line arguments are mterms [− i f i l e n a m e I n ] [−o f i l e n a m e O u t ] [−h ] [ / h ] where 1. filenameIn is an input file with calculation parameters, detailed below; 2. filenameOut is an output file with calculation results (default: "mterms.txt"); and 3. −h or /h displays the help screen. F.4 Input File Format Optionally, the program accepts an input file specifying the calculation parameters. The file format is ten lines of numbers as follows. 1. Scaling radius R for multipole terms [cm]. 2. Nominal plate voltage magnitude ϕ [V]. 3. 1st plate voltage coefficient V1 . 4. 2nd plate voltage coefficient V2 . 5. 3rd plate voltage coefficient V3 . 6. 4th plate voltage coefficient V4 . 7. 1st plate distance error D1 in centimeters. 8. 2nd plate distance error D2 in centimeters. 9. 3rd plate distance error D3 in centimeters. 10. 4th plate distance error D4 in centimeters. 268 Plates are numbered counter-clockwise, starting from the left plate. Plate voltages are products of the nominal plate voltage magnitude and the respective plate voltage coefficients. Plate distance errors are errors in distances from the origin to the plates. F.5 Program Listing # ! / usr / bin / python helpstr = ’’’ T h i s P y t h o n program c o m p u t e s m u l t i p o l e t e r m s o f t h e Muon ( g −2) c o l l a b o r a t i o n q u a d r u p o l e w i t h o p t i o n a l g e o m e t r i c a l a s y m m e t r i e s and / o r m i s p o w e r e d p l a t e s s p e c i f i e d by t h e u s e r a s p l a t e d i s t a n c e e r r o r s and p l a t e v o l t a g e s . INTERACTIVE MODE Run t h e program and f o l l o w t h e p r o m p t s t o e n t e r c a l c u l a t i o n p a r a m e t e r s . R e s u l t i n g m u l t i p o l e t e r m s w i l l be d i s p l a y e d on−s c r e e n and w r i t t e n t o a f i l e , w h i c h i s " mterms . t x t " by d e f a u l t . OPTIONAL COMMAND−LINE ARGUMENTS mterms [− i f i l e n a m e I n ] [−o f i l e n a m e O u t ] [ / h ] [−h ] filenameIn I n p u t f i l e w i t h c a l c u l a t i o n parameters , d e t a i l e d below filenameOut Output f i l e with c a l c u l a t i o n r e s u l t s ( d e f a u l t : " mterms . t x t " ) −h o r / h Help i n f o r m a t i o n INPUT FILE FORMAT O p t i o n a l l y , t h e program a c c e p t s an i n p u t f i l e specifying the calculation p a r a m e t e r s . The f i l e f o r m a t i s 10 l i n e s o f numbers a s f o l l o w s : ( 1 ) S c a l i n g r a d i u s R f o r m u l t i p o l e t e r m s [ cm ] ( 2 ) Nominal p l a t e v o l t a g e m a g n i t u d e PHI [V] ( 3 ) 1 s t p l a t e v o l t a g e c o e f f i c i e n t V1 ( 4 ) 2 nd p l a t e v o l t a g e c o e f f i c i e n t V2 ( 5 ) 3 r d p l a t e v o l t a g e c o e f f i c i e n t V3 ( 6 ) 4 t h p l a t e v o l t a g e c o e f f i c i e n t V4 ( 7 ) 1 s t p l a t e d i s t a n c e e r r o r D1 [ cm ] 269 ( 8 ) 2 nd p l a t e d i s t a n c e e r r o r D2 [ cm ] ( 9 ) 3 r d p l a t e d i s t a n c e e r r o r D3 [ cm ] ( 1 0 ) 4 t h p l a t e d i s t a n c e e r r o r D4 [ cm ] P l a t e s a r e numbered c o u n t e r −c l o c k w i s e , s t a r t i n g f r o m t h e l e f t p l a t e . P l a t e v o l t a g e s a r e p r o d u c t s o f t h e n o m i n a l p l a t e v o l t a g e m a g n i t u d e and t h e r e s p e c t i v e p l a t e v o l t a g e c o e f f i c i e n t s . Plate d i s t a n c e e r r o r s are e r r o r s in d i s t a n c e s from t h e o r i g i n t o t h e p l a t e s . ’’’ _ _ a u t h o r _ _ = "E . V a l e t o v and M. B e r z " __version__ = " 1.0.2 " _ _ m a i n t a i n e r _ _ = "E . V a l e t o v " _ _ e m a i l _ _ = " valetove@msu . edu " __status__ = " Production " import s y s from math import p i , cos , s i n , pow from p a t h l i b import P a t h def i s F l o a t ( value ) : try : float ( value ) return True except : return False def nominalcoeff ( ) : AN = [ ] BN = [ ] A0 = 0 . 3 9 6 0 5 1 4 6 6 7 1 2 4 1 6 2 0 0 2 6 6 4 8 8 9 AN. a p p e n d ( −0.6885669997872999326116172E−01) AN. a p p e n d ( 0 . 1 0 3 8 5 4 9 9 2 3 7 7 8 3 4 6 4 2 1 8 6 5 4 0 4 E−01) AN. a p p e n d ( −0.1297913346966461569514939E−02) AN. a p p e n d ( 0 . 1 1 4 7 6 4 4 5 4 7 5 0 1 4 5 4 1 8 5 5 7 9 8 8 3 E−03) AN. a p p e n d ( −0.8616667865527831779307380E−05) AN. a p p e n d ( −0.8001982661547007625552443E−07) 270 AN. a p p e n d ( 0 . 2 0 8 2 4 6 7 1 6 7 6 8 5 0 0 8 4 4 0 8 4 7 1 5 1 E−06) AN. a p p e n d ( −0.5650578854280667308819636E−07) AN. a p p e n d ( 0 . 9 4 9 3 1 3 7 8 0 5 2 9 9 0 5 1 6 4 1 2 7 9 4 4 3 E−08) AN. a p p e n d ( −0.1178399055617841478965939E−08) AN. a p p e n d ( 0 . 8 6 7 4 9 9 5 3 7 5 7 1 4 3 6 8 5 3 3 2 6 4 6 4 1 E−10) AN. a p p e n d ( 0 . 4 7 4 4 0 3 5 3 0 0 9 6 3 7 1 4 8 5 2 1 6 9 6 9 0 E−11) AN. a p p e n d ( −0.2078593716783584744931825E−11) AN. a p p e n d ( 0 . 4 1 4 8 1 4 6 2 4 8 0 5 4 3 8 2 4 4 9 3 0 0 8 9 8 E−12) AN. a p p e n d ( −0.6336771062740538231062328E−13) AN. a p p e n d ( 0 . 8 4 9 0 6 8 1 5 5 7 6 3 9 7 7 1 4 2 4 2 4 0 0 7 0 E−14) AN. a p p e n d ( −0.1872421797230359291328962E−14) AN. a p p e n d ( 0 . 3 4 2 6 4 5 3 4 7 6 9 3 8 4 5 1 6 9 0 6 3 3 0 8 1 E−15) AN. a p p e n d ( −0.4796463381145525802394053E−16) AN. a p p e n d ( 0 . 3 6 7 3 0 7 0 3 4 9 6 6 8 4 5 1 1 9 7 6 8 4 0 3 3 E−17) AN. a p p e n d ( 0 . 6 0 4 7 0 1 3 8 9 3 8 1 4 3 4 0 3 2 3 9 6 7 7 2 4 E−18) AN. a p p e n d ( −0.2935711731503183201970729E−18) AN. a p p e n d ( 0 . 7 0 4 8 4 0 5 3 4 5 5 1 3 4 6 3 6 7 4 5 6 4 3 0 2 E−19) AN. a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+ 00 ) AN. a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+ 00 ) BN . a p p e n d ( 0 . 7 7 6 6 9 4 8 1 0 7 1 2 1 0 7 5 6 8 7 3 0 3 5 8 7 E−10) BN . a p p e n d ( 0 . 9 0 8 4 5 0 3 8 0 8 5 7 4 8 1 5 1 8 6 0 0 9 8 1 1 E−09) BN . a p p e n d ( −0.2740709784014760385675795E−09) BN . a p p e n d ( 0 . 3 2 1 1 7 6 7 8 0 0 4 1 5 6 4 1 9 5 8 4 1 0 9 0 2 E−10) BN . a p p e n d ( 0 . 1 2 1 2 7 7 2 3 8 8 3 7 8 8 9 7 8 3 4 8 2 0 2 2 3 E−11) BN . a p p e n d ( −0.1566030408821507397282051E−11) BN . a p p e n d ( 0 . 4 3 4 8 9 9 5 4 7 0 3 1 3 6 2 3 6 4 8 8 9 6 9 8 2 E−12) BN . a p p e n d ( −0.7724423871624272621235177E−13) BN . a p p e n d ( 0 . 7 2 1 5 5 5 6 6 3 6 6 9 4 7 7 3 6 4 4 5 2 1 2 8 0 E−14) BN . a p p e n d ( 0 . 7 3 3 7 9 8 6 5 7 4 1 8 1 1 1 2 6 5 5 1 6 2 0 7 8 E−15) BN . a p p e n d ( −0.5034212659015152446443716E−15) BN . a p p e n d ( 0 . 1 2 9 6 6 3 6 1 4 7 4 0 4 9 7 3 1 3 1 4 9 1 2 5 8 E−15) BN . a p p e n d ( −0.2062294257995577350069950E−16) BN . a p p e n d ( 0 . 1 6 6 5 1 9 7 7 0 8 9 0 3 2 3 1 2 5 2 4 8 2 6 1 2 E−17) BN . a p p e n d ( 0 . 1 8 0 2 1 6 1 1 8 0 3 9 7 5 7 5 3 9 4 1 1 0 5 3 5 E−18) BN . a p p e n d ( −0.1036746736978828970543980E−18) BN . a p p e n d ( 0 . 2 4 8 3 1 4 5 3 6 6 2 9 8 5 4 6 0 8 7 4 7 1 4 2 2 E−19) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) 271 BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) BN . a p p e n d ( 0 . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E+0 0 ) r e t u r n [ A0 , AN, BN] d e f p e r t u r b c o e f f 1 ( D1 , A0 , AN, BN ) : DAN = [ ] DBN = [ ] DA0 = −0.1444884897365176 DAN. a p p e n d ( 0 . 0 2 4 8 4 8 4 0 3 4 1 5 0 7 0 4 6 2 ) DAN. a p p e n d ( − 0 . 0 0 3 5 9 6 4 3 1 4 5 6 5 5 8 7 5 2 4 ) DAN. a p p e n d ( 0 . 0 0 0 3 9 7 5 1 6 7 4 2 5 5 8 9 6 9 7 ) DAN. a p p e n d ( − 0 . 0 0 0 0 1 9 0 2 7 8 3 7 4 4 0 4 2 5 7 5 7 ) DAN. a p p e n d ( −2.6389842208771386 e −6) DAN. a p p e n d ( 1 . 3 2 0 0 4 2 9 4 4 6 8 3 1 7 7 6 e −6) DAN. a p p e n d ( −3.336076829265742 e −7) DAN. a p p e n d ( 6 . 6 2 3 3 3 9 4 3 1 1 4 3 4 2 1 e −8) DAN. a p p e n d ( −1.041062666661125 e −8) DAN. a p p e n d ( 1 . 2 6 1 7 5 6 6 8 7 8 1 5 1 9 9 8 e −9) DAN. a p p e n d ( −8.210887578907022 e −11) DAN. a p p e n d ( −1.1765160099419854 e −11) DAN. a p p e n d ( 5 . 5 9 6 4 1 1 6 0 7 7 4 2 2 7 9 e −12) DAN. a p p e n d ( −1.3920004680873368 e −12) DAN. a p p e n d ( 2 . 6 9 2 0 0 2 1 3 5 0 5 4 4 5 9 4 e −13) DAN. a p p e n d ( −4.29932669278841 e −14) DAN. a p p e n d ( 5 . 7 4 5 1 5 4 9 9 2 8 8 0 3 3 7 e −15) DAN. a p p e n d ( −4.983850750279471 e −16) DAN. a p p e n d ( −2.0577218923151605 e −17) DAN. a p p e n d ( 2 . 2 2 8 3 0 4 6 9 1 2 6 4 1 9 9 7 e −17) DAN. a p p e n d ( −6.547768415309331 e −18) DAN. a p p e n d ( 1 . 3 8 8 4 3 2 1 3 7 1 8 0 6 0 0 1 e −18) DAN. a p p e n d ( −2.376780998696832 e −19) DAN. a p p e n d ( 0 . ) DAN. a p p e n d ( 0 . ) DBN. a p p e n d ( 3 . 5 4 8 4 2 1 3 7 2 5 7 2 1 4 4 3 e −6) DBN. a p p e n d ( 0 . 0 0 0 0 3 6 0 1 4 3 6 0 1 8 2 9 3 6 2 1 5 ) 272 DBN. a p p e n d ( − 0 . 0 0 0 0 1 0 8 8 1 0 3 5 4 1 1 6 3 0 9 2 5 ) DBN. a p p e n d ( 1 . 2 7 5 3 3 1 8 4 3 0 0 3 0 7 9 7 e −6) DBN. a p p e n d ( 4 . 8 1 9 4 1 0 3 8 6 2 0 4 0 9 9 e −8) DBN. a p p e n d ( −6.220211484910526 e −8) DBN. a p p e n d ( 1 . 7 2 7 2 6 4 5 5 6 5 9 7 4 4 9 e −8) DBN. a p p e n d ( −3.0676944205138244 e −9) DBN. a p p e n d ( 2 . 8 6 4 6 1 6 7 2 4 2 5 4 5 4 2 4 e −10) DBN. a p p e n d ( 2 . 9 1 8 6 3 6 8 3 9 2 8 5 4 6 5 4 e −11) DBN. a p p e n d ( −2.000518511207103 e −11) DBN. a p p e n d ( 5 . 1 5 2 2 4 3 2 3 6 3 7 0 1 4 3 e −12) DBN. a p p e n d ( −8.194149177053863 e −13) DBN. a p p e n d ( 6 . 6 1 4 9 2 6 6 3 7 5 3 0 0 6 2 e −14) DBN. a p p e n d ( 7 . 1 6 6 1 2 9 7 6 7 4 6 9 8 3 e −15) DBN. a p p e n d ( −4.121119580780476 e −15) DBN. a p p e n d ( 9 . 8 7 2 2 4 2 5 7 0 8 4 6 6 4 e −16) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) A0 += D1 ∗ DA0 AN = l i s t ( map ( lambda x1 , x2 : x1 + D1 ∗ x2 , AN, DAN) ) BN = l i s t ( map ( lambda x1 , x2 : x1 + D1 ∗ x2 , BN, DBN) ) r e t u r n [ A0 , AN, BN] d e f p e r t u r b c o e f f 2 ( D2 , A0 , AN, BN ) : DAN = [ ] DBN = [ ] DA0 = 0 . 0 2 4 6 3 1 5 8 0 8 1 3 8 9 4 1 6 DAN. a p p e n d ( − 0 . 0 0 0 6 5 3 1 5 1 4 5 3 2 0 0 4 4 0 1 ) DAN. a p p e n d ( − 0 . 0 0 0 6 5 1 9 0 1 6 5 7 7 9 4 3 8 4 8 ) DAN. a p p e n d ( 0 . 0 0 0 0 5 0 2 1 9 8 5 5 2 7 9 5 1 8 ) DAN. a p p e n d ( 7 . 3 0 8 7 5 2 7 6 2 0 7 4 1 6 9 e −6) DAN. a p p e n d ( −1.4847818318198809 e −6) DAN. a p p e n d ( 2 . 7 3 7 3 1 9 4 9 8 3 6 8 2 9 7 8 e −8) 273 DAN. a p p e n d ( 2 . 5 7 5 9 2 1 9 4 1 2 2 9 3 5 1 e −8) DAN. a p p e n d ( −5.371460655667032 e −9) DAN. a p p e n d ( −2.0187850804427197 e −11) DAN. a p p e n d ( 1 . 3 6 9 9 3 4 9 7 0 9 7 1 1 1 6 3 e −10) DAN. a p p e n d ( −1.4367069594248677 e −11) DAN. a p p e n d ( −4.480616938928591 e −13) DAN. a p p e n d ( 4 . 3 8 9 6 2 2 5 4 5 3 9 9 6 2 3 e −13) DAN. a p p e n d ( −6.026734883546398 e −14) DAN. a p p e n d ( −5.3789105734122435 e −15) DAN. a p p e n d ( 2 . 5 2 8 7 0 2 5 5 2 0 6 1 9 6 0 7 e −15) DAN. a p p e n d ( −1.440333425607398 e −16) DAN. a p p e n d ( −5.852426774904934 e −17) DAN. a p p e n d ( 1 . 0 7 3 2 6 5 7 1 9 0 2 1 4 1 1 9 e −17) DAN. a p p e n d ( −3.371932262158921 e −19) DAN. a p p e n d ( −2.696899131755618 e −19) DAN. a p p e n d ( 7 . 2 9 0 9 6 0 4 5 6 9 8 4 0 6 3 e −20) DAN. a p p e n d ( 1 . 5 4 6 5 7 1 8 6 2 8 5 4 9 2 8 2 e −22) DAN. a p p e n d ( 0 . ) DAN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . 0 0 4 2 9 1 1 4 1 5 5 7 9 6 8 9 7 2 ) DBN. a p p e n d ( − 0 . 0 0 0 1 8 1 2 1 7 0 9 3 6 8 2 9 9 2 3 4 ) DBN. a p p e n d ( − 0 . 0 0 0 0 9 3 0 7 7 9 3 5 7 5 4 0 5 6 2 4 ) DBN. a p p e n d ( 0 . 0 0 0 0 1 0 5 7 5 9 7 0 2 3 0 8 5 0 7 4 2 ) DBN. a p p e n d ( 5 . 5 6 4 3 5 1 0 0 6 3 0 6 1 8 e −7) DBN. a p p e n d ( −2.7373406889299316 e −7) DBN. a p p e n d ( 3 . 7 7 2 9 2 7 8 2 1 2 6 8 4 9 6 6 e −8) DBN. a p p e n d ( −7.810016388882003 e −10) DBN. a p p e n d ( −6.805548960513614 e −10) DBN. a p p e n d ( 7 . 8 6 0 9 6 4 1 8 5 6 1 3 5 0 6 e −11) DBN. a p p e n d ( −5.91594881675488 e −12) DBN. a p p e n d ( 2 . 3 3 3 7 0 0 7 2 1 5 8 2 4 6 5 4 e −12) DBN. a p p e n d ( −6.514714236739883 e −13) DBN. a p p e n d ( 1 . 2 3 0 2 3 6 0 4 0 1 3 3 8 8 4 2 e −13) DBN. a p p e n d ( −6.670448858970904 e −15) DBN. a p p e n d ( −4.141239834729562 e −15) DBN. a p p e n d ( 1 . 3 7 9 3 2 5 9 7 4 2 9 1 6 6 6 4 e −15) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) 274 DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) A0 += D2 ∗ DA0 AN = l i s t ( map ( lambda x1 , x2 : x1 + D2 ∗ x2 , AN, DAN) ) BN = l i s t ( map ( lambda x1 , x2 : x1 + D2 ∗ x2 , BN, DBN) ) r e t u r n [ A0 , AN, BN] d e f p e r t u r b c o e f f 3 ( D3 , A0 , AN, BN ) : DAN = [ ] DBN = [ ] DA0 = 0 . 0 0 9 3 7 6 9 7 4 3 3 0 9 9 7 0 8 5 DAN. a p p e n d ( 0 . 0 0 1 6 4 6 6 9 0 3 3 5 5 5 8 8 9 7 4 ) DAN. a p p e n d ( 0 . 0 0 0 2 5 6 7 3 8 7 6 5 0 8 5 5 4 7 5 5 ) DAN. a p p e n d ( 0 . 0 0 0 0 3 4 6 3 3 0 6 8 1 7 8 5 1 8 8 0 5 ) DAN. a p p e n d ( 3 . 6 9 9 1 1 9 9 9 8 0 4 9 5 3 7 e −6) DAN. a p p e n d ( 4 . 0 0 3 5 1 0 8 0 6 9 6 7 0 1 7 6 e −7) DAN. a p p e n d ( 3 . 1 1 3 5 0 7 5 3 7 8 0 3 7 1 8 5 e −8) DAN. a p p e n d ( −3.4013761560371777 e −10) DAN. a p p e n d ( −8.329064640595302 e −10) DAN. a p p e n d ( −1.9072194257427367 e −10) DAN. a p p e n d ( −3.0553601098349 e −11) DAN. a p p e n d ( −3.256616872039333 e −12) DAN. a p p e n d ( −1.1364648285565948 e −13) DAN. a p p e n d ( 2 . 8 1 6 8 7 3 6 3 1 4 0 3 4 7 4 3 e −14) DAN. a p p e n d ( 1 . 2 2 5 8 3 4 6 7 9 9 5 6 5 1 1 3 e −14) DAN. a p p e n d ( 2 . 6 9 7 5 7 6 0 2 8 7 4 5 0 9 2 6 e −15) DAN. a p p e n d ( 5 . 2 9 5 8 8 5 8 5 4 3 1 3 5 6 8 e −16) DAN. a p p e n d ( 9 . 9 9 2 6 5 4 2 0 8 2 0 3 2 2 5 e −17) DAN. a p p e n d ( 1 . 4 8 3 2 9 3 7 1 2 6 8 1 9 8 6 e −17) DAN. a p p e n d ( 1 . 5 9 0 5 2 0 3 2 3 2 4 1 7 4 7 e −18) DAN. a p p e n d ( −2.018229056940692 e −20) DAN. a p p e n d ( −5.522461977746537 e −20) DAN. a p p e n d ( −1.7833523207981785 e −20) DAN. a p p e n d ( −3.607909453318381 e −21) DAN. a p p e n d ( 0 . ) 275 DAN. a p p e n d ( 0 . ) DBN. a p p e n d ( 2 . 6 0 1 2 5 6 1 3 9 6 6 2 8 9 3 7 e −6) DBN. a p p e n d ( −3.264427228831575 e −7) DBN. a p p e n d ( 1 . 6 2 1 9 0 2 4 4 7 9 8 5 3 6 9 6 e −8) DBN. a p p e n d ( −9.301485458960886 e −11) DBN. a p p e n d ( 4 . 8 7 5 6 0 9 1 8 9 5 1 7 3 5 4 e −11) DBN. a p p e n d ( −3.020687618033502 e −11) DBN. a p p e n d ( −2.008207049699983 e −12) DBN. a p p e n d ( 8 . 6 1 8 3 7 3 8 5 2 5 9 3 4 5 6 e −13) DBN. a p p e n d ( −5.025368408773574 e −13) DBN. a p p e n d ( 1 . 7 9 2 9 8 3 1 5 9 8 4 5 7 7 0 3 e −13) DBN. a p p e n d ( −4.6486252361772815 e −14) DBN. a p p e n d ( 9 . 8 2 1 3 2 1 4 8 0 5 9 2 0 0 8 e −15) DBN. a p p e n d ( −1.6317932526659849 e −15) DBN. a p p e n d ( 8 . 6 2 1 5 9 6 6 5 1 5 0 2 5 3 1 e −17) DBN. a p p e n d ( 3 . 3 1 5 7 8 9 8 4 1 2 4 8 3 9 4 7 e −17) DBN. a p p e n d ( −1.2810764392090319 e −17) DBN. a p p e n d ( 3 . 8 2 1 2 3 7 3 5 5 6 4 0 5 5 7 e −18) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) A0 += D3 ∗ DA0 AN = l i s t ( map ( lambda x1 , x2 : x1 + D3 ∗ x2 , AN, DAN) ) BN = l i s t ( map ( lambda x1 , x2 : x1 + D3 ∗ x2 , BN, DBN) ) r e t u r n [ A0 , AN, BN] d e f p e r t u r b c o e f f 4 ( D4 , A0 , AN, BN ) : DAN = [ ] DBN = [ ] DA0 = 0 . 0 2 4 6 3 1 5 6 3 8 9 9 6 4 6 3 8 DAN. a p p e n d ( − 0 . 0 0 0 6 5 7 2 1 0 6 1 6 3 6 8 0 6 8 3 ) DAN. a p p e n d ( − 0 . 0 0 0 6 5 0 9 5 1 7 7 0 4 2 3 6 5 6 8 ) DAN. a p p e n d ( 0 . 0 0 0 0 5 0 0 8 0 4 1 4 8 1 3 3 2 7 5 8 ) 276 DAN. a p p e n d ( 7 . 3 1 1 9 6 0 4 8 1 0 9 7 0 2 5 e −6) DAN. a p p e n d ( −1.4832042664218915 e −6) DAN. a p p e n d ( 2 . 6 8 6 9 9 3 6 6 7 9 5 6 2 5 4 e −8) DAN. a p p e n d ( 2 . 5 8 2 8 1 5 4 7 5 2 5 2 7 9 5 e −8) DAN. a p p e n d ( −5.375006788041004 e −9) DAN. a p p e n d ( −2.216645711303911 e −11) DAN. a p p e n d ( 1 . 3 7 6 3 8 7 0 1 5 4 2 4 6 4 0 3 e −10) DAN. a p p e n d ( −1.447182447679387 e −11) DAN. a p p e n d ( −4.4261541328000695 e −13) DAN. a p p e n d ( 4 . 4 2 4 2 6 4 4 9 6 0 6 0 8 6 4 e −13) DAN. a p p e n d ( −6.138744911938371 e −14) DAN. a p p e n d ( −5.159127712706641 e −15) DAN. a p p e n d ( 2 . 5 0 3 9 1 6 0 2 6 4 3 6 5 1 6 3 e −15) DAN. a p p e n d ( −1.4456449599913898 e −16) DAN. a p p e n d ( −5.772285926076793 e −17) DAN. a p p e n d ( 1 . 0 5 0 9 4 8 9 3 9 6 9 6 5 0 4 1 e −17) DAN. a p p e n d ( −2.984829601057637 e −19) DAN. a p p e n d ( −2.7466074284149757 e −19) DAN. a p p e n d ( 7 . 3 1 4 8 4 5 0 7 2 5 0 2 7 5 1 e −20) DAN. a p p e n d ( 1 . 5 3 9 7 5 0 1 1 7 9 8 0 8 9 5 2 e −22) DAN. a p p e n d ( 0 . ) DAN. a p p e n d ( 0 . ) DBN. a p p e n d ( − 0 . 0 0 4 2 9 2 3 4 3 8 4 3 5 7 3 5 ) DBN. a p p e n d ( 0 . 0 0 0 2 1 7 9 1 3 7 8 6 2 1 0 2 4 7 9 5 ) DBN. a p p e n d ( 0 . 0 0 0 0 8 2 1 1 4 9 9 6 7 1 2 7 2 0 2 7 ) DBN. a p p e n d ( −9.294389673533813 e −6) DBN. a p p e n d ( −5.079774526104112 e −7) DBN. a p p e n d ( 2 . 1 1 3 9 3 1 3 0 6 2 6 2 7 5 2 6 e −7) DBN. a p p e n d ( −2.0388970595219676 e −8) DBN. a p p e n d ( −2.29940758712421 e −9) DBN. a p p e n d ( 9 . 6 8 8 9 8 8 6 2 2 1 2 4 2 e −10) DBN. a p p e n d ( −4.9679879227888535 e −11) DBN. a p p e n d ( −1.406671943084948 e −11) DBN. a p p e n d ( 2 . 8 1 6 3 8 1 6 9 6 1 8 2 8 4 5 3 e −12) DBN. a p p e n d ( −1.677183835725091 e −13) DBN. a p p e n d ( −5.678868964822446 e −14) DBN. a p p e n d ( 1 . 3 7 9 5 4 4 7 9 8 7 5 8 8 0 3 5 e −14) DBN. a p p e n d ( 3 . 2 6 0 2 0 7 7 2 4 8 5 4 9 9 0 6 e −17) DBN. a p p e n d ( −3.9333149423065704 e −16) 277 DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) DBN. a p p e n d ( 0 . ) A0 += D4 ∗ DA0 AN = l i s t ( map ( lambda x1 , x2 : x1 + D4 ∗ x2 , AN, DAN) ) BN = l i s t ( map ( lambda x1 , x2 : x1 + D4 ∗ x2 , BN, DBN) ) r e t u r n [ A0 , AN, BN] d e f c a l c S e t ( D1 , D2 , D3 , D4 ) : [ A0 , AN, BN] = n o m i n a l c o e f f ( ) [ A0 , AN, BN] = p e r t u r b c o e f f 1 ( D1 , A0 , AN, BN) [ A0 , AN, BN] = p e r t u r b c o e f f 2 ( D2 , A0 , AN, BN) [ A0 , AN, BN] = p e r t u r b c o e f f 3 ( D3 , A0 , AN, BN) [ A0 , AN, BN] = p e r t u r b c o e f f 4 ( D4 , A0 , AN, BN) r e t u r n [ A0 , AN, BN] d e f r o t a t e F o u r i e r A N (AN, BN, PHI , J ) : r e t u r n AN ∗ c o s ( J ∗ PHI ) − BN ∗ s i n ( J ∗ PHI ) d e f r o t a t e F o u r i e r B N (AN, BN, PHI , J ) : r e t u r n AN ∗ s i n ( J ∗ PHI ) + BN ∗ c o s ( J ∗ PHI ) d e f s u p e r I m p o s e F o r i e r A 0 ( A01 , A02 , A03 , A04 , V1 , V2 , V3 , V4 ) : r e t u r n V1 ∗ A01 + V2 ∗ A02 + V3 ∗ A03 + V4 ∗ A04 d e f s u p e r I m p o s e F o u r i e r A N ( AN1 , BN1 , AN2 , BN2 , AN3 , BN3 , AN4 , BN4 , V1 , V2 , V3 , V4 , J ) : r e t u r n V1 ∗ AN1 + V2 ∗ r o t a t e F o u r i e r A N ( AN2 , BN2 , p i / 2 , J ) + \ V3 ∗ r o t a t e F o u r i e r A N ( AN3 , BN3 , p i , J ) + \ 278 V4 ∗ r o t a t e F o u r i e r A N ( AN4 , BN4 , 3 ∗ p i / 2 , J ) d e f s u p e r I m p o s e F o u r i e r B N ( AN1 , BN1 , AN2 , BN2 , AN3 , BN3 , AN4 , BN4 , V1 , V2 , V3 , V4 , J ) : r e t u r n V1 ∗ BN1 + V2 ∗ r o t a t e F o u r i e r B N ( AN2 , BN2 , p i / 2 , J ) + \ V3 ∗ r o t a t e F o u r i e r B N ( AN3 , BN3 , p i , J ) + \ V4 ∗ r o t a t e F o u r i e r B N ( AN4 , BN4 , 3 ∗ p i / 2 , J ) def m u l t i p o l e T e r m s (R, Rref , fileOutName ) : outputArray = [] o u t p u t S t r i n g = ’ \ nCALCULATION RESULTS \ n ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ M u l t i p o l e t e r m s , s c a l e d t o R = ’ + s t r (R) + ’ cm ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ Nominal p l a t e v o l t a g e PHI = ’ + s t r (V) + ’ V ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) outputString = ’ Plate voltage coefficients : ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 1 : V1 = ’ + s t r ( V1 ) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 2 : V2 = ’ + s t r ( V2 ) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 3 : V3 = ’ + s t r ( V3 ) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 4 : V4 = ’ + s t r ( V4 ) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) outputString = ’ Plate distance errors : ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) 279 o u t p u t S t r i n g = ’ P l a t e 1 : D1 = ’ + s t r ( D10 ) + ’ cm ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 2 : D2 = ’ + s t r ( D20 ) + ’ cm ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 3 : D3 = ’ + s t r ( D30 ) + ’ cm ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ P l a t e 4 : D4 = ’ + s t r ( D40 ) + ’ cm ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) outputString = ’ ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’A0 = ’ + s t r ( V ∗ s u p e r I m p o s e F o r i e r A 0 ( A01 , A02 , A03 , A04 , V1 , V2 , V3 , V4 ) ) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ \ nAN = ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) f o r J , i t e m i n enumerate (AN1 ) : outputString = str ( V ∗ pow ( ( R / R r e f ) , ( J + 1 ) ) ∗ s u p e r I m p o s e F o u r i e r A N (AN1[ J ] , BN1 [ J ] , AN2[ J ] , BN2 [ J ] , AN3[ J ] , BN3 [ J ] , AN4[ J ] , BN4 [ J ] , V1 , V2 , V3 , V4 , J + 1)) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) o u t p u t S t r i n g = ’ \ nBN = ’ print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) f o r J , i t e m i n enumerate (AN1 ) : outputString = str ( V ∗ pow ( ( R / R r e f ) , ( J + 1 ) ) ∗ s u p e r I m p o s e F o u r i e r B N (AN1[ J ] , BN1 [ J ] , AN2[ J ] , BN2 [ J ] , 280 AN3[ J ] , BN3 [ J ] , AN4[ J ] , BN4 [ J ] , V1 , V2 , V3 , V4 , J + 1)) print ( outputString ) o u t p u t A r r a y . append ( o u t p u t S t r i n g ) outputArray = [ i + " \ n" for i in outputArray ] w i t h open ( f i l e O u t N a m e , ’w+ ’ ) a s f i l e _ o u t : for item in outputArray : f i l e _ o u t . w r i t e ( "%s " % i t e m ) V = 24000 R = 4.5 Rref = 1.0 ( V1 , V2 , V3 , V4 ) = 1 , −1, 1 , −1 ( D10 , D20 , D30 , D40 ) = 0 , 0 , 0 , 0 f i l e O u t N a m e = ’ mterms . t x t ’ useInputFile = False inputArray = [] p r i n t ( ’−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−’ ) print ( ’ Muon ( g −2) C o l l a b o r a t i o n High V o l t a g e Q u a d r u p o l e ’) print ( ’ M u l t i p o l e Terms C a l c u l a t i o n ( " mterms " ) ’) print ( ’ E . V a l e t o v & M. B e r z ’) print ( ’ Muon ( g −2) C o l l a b o r a t i o n ’) print ( ’ C r e a t e d 16−Apr −2017 ’) print ( ’ E m a i l : valetove@msu . edu ’) p r i n t ( ’−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−\n ’ ) i f len ( sys . argv ) > 1: sysArgv = sys . argv [ 1 : ] while len ( sysArgv ) > 0 : s y s A r g v N e x t = s y s A r g v . pop ( 0 ) . l o w e r ( ) i f ( s y s A r g v N e x t == ’−h ’ ) or ( s y s A r g v N e x t == ’ / h ’ ) : print ( h e l p s t r ) sys . e x i t ( ) e l i f s y s A r g v N e x t == ’−o ’ : i f l e n ( s y s A r g v ) == 0 : 281 p r i n t ( " [ERROR] O u t p u t f i l e name e x p e c t e d , n o t f o u n d . " ) sys . e x i t ( ) f i l e O u t N a m e = s y s A r g v . pop ( 0 ) e l i f s y s A r g v N e x t == ’− i ’ : i f l e n ( s y s A r g v ) == 0 : p r i n t ( " [ERROR] I n p u t f i l e name e x p e c t e d , n o t f o u n d . " ) sys . e x i t ( ) f i l e I n N a m e = s y s A r g v . pop ( 0 ) i f not Path ( fileInName ) . i s _ f i l e ( ) : p r i n t ( " [ERROR] I n p u t f i l e ’ " + f i l e I n N a m e + " ’ d o e s n ’ t e x i s t . " ) sys . e x i t ( ) u s e I n p u t F i l e = True w i t h open ( f i l e I n N a m e ) a s f i l e I n : for l i n e in f i l e I n : i f not ( i s F l o a t ( l i n e ) ) : p r i n t ( " [ERROR] NaN i n i n p u t f i l e . " ) sys . e x i t ( ) i n p u t A r r a y . append ( f l o a t ( l i n e ) ) i f len ( i n p u t A r r a y ) != 10: print ( " [ERROR] I n p u t f i l e l e n g t h i s n o t 10 l i n e s o f numbers . " ) p r i n t ( " \ n [ INFO ] Help s c r e e n . " ) print ( h e l p s t r ) sys . e x i t ( ) R = i n p u t A r r a y . pop ( 0 ) V = i n p u t A r r a y . pop ( 0 ) V1 = i n p u t A r r a y . pop ( 0 ) V2 = i n p u t A r r a y . pop ( 0 ) V3 = i n p u t A r r a y . pop ( 0 ) V4 = i n p u t A r r a y . pop ( 0 ) D10 = i n p u t A r r a y . pop ( 0 ) D20 = i n p u t A r r a y . pop ( 0 ) D30 = i n p u t A r r a y . pop ( 0 ) D40 = i n p u t A r r a y . pop ( 0 ) else : print ( " [ERROR] I n v a l i d command−l i n e p a r a m e t e r ’ " + sysArgvNext + " ’ . " ) p r i n t ( " \ n [ INFO ] Help s c r e e n . " ) 282 print ( h e l p s t r ) sys . e x i t ( ) i f not ( u s e I n p u t F i l e ) : print ( ’ D e f a u l t e r r o r s i n d i s t a n c e s from t h e o r i g i n t o t h e p l a t e s ’ + ’ a r e 0 , 0 , 0 , 0 [ cm ] . ’ ) print ( ’ P l a t e s a r e numbered c o u n t e r −c l o c k w i s e , s t a r t i n g from t h e l e f t p l a t e . ’ ) p r i n t ( " E n t e r ’Y ’ t o c h a n g e t h e v a l u e s o f t h e p l a t e d i s t a n c e e r r o r s . " ) p r i n t ( " E n t e r ’N ’ o r t o k e e p t h e d e f a u l t v a l u e . " ) u s e r I n p u t = ’− ’ while not ( u s e r I n p u t [ : 1 ] . lower ( ) in [ ’ y ’ , ’ n ’ , ’ ’ ] ) : u s e r I n p u t = i n p u t ( ’ [ y /N] > ’ ) i f u s e r I n p u t [ : 1 ] . l o w e r ( ) == ’ y ’ : userInput = ’ ’ p r i n t ( ’ E n t e r t h e 1 s t p l a t e d i s t a n c e e r r o r D1 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) D10 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 2 nd p l a t e d i s t a n c e e r r o r D2 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) D20 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 3 r d p l a t e d i s t a n c e e r r o r D3 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) D30 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 4 t h p l a t e d i s t a n c e e r r o r D4 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) D40 = f l o a t ( u s e r I n p u t ) u s e r I n p u t = ’− ’ p r i n t ( ’ D e f a u l t n o m i n a l p l a t e v o l t a g e m a g n i t u d e i s PHI = 24000 V . ’ ) p r i n t ( ’ E n t e r a new v a l u e o f PHI . ’ ) p r i n t ( " To k e e p t h e d e f a u l t v a l u e o f PHI , e n t e r ’D ’ o r . " ) 283 w h i l e n o t ( ( u s e r I n p u t [ : 1 ] . l o w e r ( ) i n [ ’ d ’ , ’ ’ ] ) or ( i s F l o a t ( u s e r I n p u t ) ) ) : u s e r I n p u t = i n p u t ( ’ [D / ( R e a l number ) ] > ’ ) if isFloat ( userInput ): V = float ( userInput ) u s e r I n p u t = ’− ’ p r i n t ( ’ D e f a u l t p l a t e v o l t a g e c o e f f i c i e n t s a r e 1 , −1, 1 , −1. ’ ) print ( ’ P l a t e v o l t a g e s are p r o d u c t s of the nominal p l a t e v o l t a g e magnitude ’ ) p r i n t ( ’ and r e s p e c t i v e p l a t e v o l t a g e c o e f f i c i e n t s . ’ ) print ( ’ P l a t e s a r e numbered c o u n t e r −c l o c k w i s e , s t a r t i n g from t h e l e f t p l a t e . ’ ) p r i n t ( " E n t e r ’Y ’ t o c h a n g e t h e v a l u e s o f t h e p l a t e v o l t a g e c o e f f i c i e n t s . " ) p r i n t ( " E n t e r ’N ’ o r t o k e e p t h e d e f a u l t v a l u e . " ) while not ( u s e r I n p u t [ : 1 ] . lower ( ) in [ ’ y ’ , ’ n ’ , ’ ’ ] ) : u s e r I n p u t = i n p u t ( ’ [ y /N] > ’ ) i f u s e r I n p u t [ : 1 ] . l o w e r ( ) == ’ y ’ : userInput = ’ ’ p r i n t ( ’ E n t e r t h e 1 s t p l a t e v o l t a g e c o e f f i c i e n t V1 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) V1 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 2 nd p l a t e v o l t a g e c o e f f i c i e n t V2 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) V2 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 3 r d p l a t e v o l t a g e c o e f f i c i e n t V3 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) V3 = f l o a t ( u s e r I n p u t ) userInput = ’ ’ p r i n t ( ’ E n t e r t h e 4 t h p l a t e v o l t a g e c o e f f i c i e n t V4 . ’ ) while not i s F l o a t ( u s e r I n p u t ) : u s e r I n p u t = input ( ’> ’ ) V4 = f l o a t ( u s e r I n p u t ) u s e r I n p u t = ’− ’ p r i n t ( ’ D e f a u l t s c a l i n g o f m u l t i p o l e c o e f f i c i e n t s i s t o R = 4 . 5 cm . ’ ) p r i n t ( ’ E n t e r a new v a l u e o f R . ’ ) 284 p r i n t ( " To k e e p t h e d e f a u l t v a l u e o f R , e n t e r o r ’D ’ o r . " ) w h i l e n o t ( ( u s e r I n p u t [ : 1 ] . l o w e r ( ) i n [ ’ d ’ , ’ ’ ] ) or ( i s F l o a t ( u s e r I n p u t ) ) ) : u s e r I n p u t = i n p u t ( ’ [D / ( R e a l number ) ] > ’ ) if isFloat ( userInput ): R = float ( userInput ) [ A01 , AN1 , BN1 ] = c a l c S e t ( D10 , D20 , D30 , D40 ) [ A02 , AN2 , BN2 ] = c a l c S e t ( D20 , D30 , D40 , D10 ) [ A03 , AN3 , BN3 ] = c a l c S e t ( D30 , D40 , D10 , D20 ) [ A04 , AN4 , BN4 ] = c a l c S e t ( D40 , D10 , D20 , D30 ) m u l t i p o l e T e r m s (R, Rref , fileOutName ) 285 APPENDIX G STEP FILE GENERATOR STEP File Generator (stepfg) converts a list of polygons in the x–y plane specified by vertices into a STEP file1 containing a 3D part obtained by extrusion of the interior regions of these polygons along the z axis. G.1 Package Contents The program package includes STEP File Generator as a Python script and as Linux and Windows standalone executables. 1. readme.txt: the readme file. 2. stepfg.py: Python source code. 3. stepfg: Linux version (prepared and tested in Ubuntu 16). 4. stepfg.exe: Windows version (prepared and tested in Windows 7). 5. part_geometry.txt: input file containing the representation of the Muon g-2 collaboration quadrupole detailed in sec. 3.3.4. G.2 Command-Line Arguments STEP File Generator’s command-line arguments are s t e p f g [ f i l e n a m e _ i n [ f i l e n a m e _ o u t ] ] [−h ] [ / h ] where 1. filename_in is the input file containing 2D geometry "part_geometry.txt"); 1 For syntax and rules for STEP files, please refer to ISO 10303-242 [55]. 286 data (default: 2. filename_out is the output STEP file with resulting 3D part (default: "part_out.stp"); and 3. −h or /h displays the help screen. G.3 Input File Format The input file format is three parameters as follows: [ First_argument , Second_argument , Third_argument ] First_argument: List of polygon specifications [p1 , p2 , . . . , pn ]. Each polygon specification is a sequential list [v1 , v2 , . . . , vm ] of the polygon’s vertices in the x–y plane. Each vertex is specified as a list [x, y] or [x, y, 0]. Second_argument: z coordinate interval [z1 , z2 ] that the resulting 3D part should span. Third_argument: Geometric proportionality coefficient. The output unit of length in the STEP file is mm, so use 10 if the 2D geometry is specified in cm. G.4 Program Listing The following is a program listing of STEP File Generator as a Python 3 script. # ! / usr / bin / python helpstr = ’’’ T h i s program c o n v e r t s a l i s t o f p o l y g o n s i n t h e x−y p l a n e s p e c i f i e d by v e r t i c e s i n t o a STEP f i l e c o n t a i n i n g a 3D p a r t o b t a i n e d by e x t r u s i o n o f i n t e r i o r s r e g i o n s o f t h e s e p o l y g o n s a l o n g t h e z−a x i s . s t e p f g [ f i l e n a m e _ i n [ f i l e n a m e _ o u t ] ] [−h ] [ / h ] filename_in I n p u t f i l e c o n t a i n i n g 2D g e o m e t r y d a t a ( d e f a u l t : " part_geometry . t x t ") filename_out O u t p u t STEP f i l e w i t h r e s u l t i n g 3D p a r t ( default : " part_out . stp ") −h o r / h This information 287 The i n p u t f i l e f o r m a t i s t h r e e p a r a m e t e r s a s f o l l o w s : [ First_argument , Second_argument , Third_argument ] F i r s t _ a r g u m e n t : L i s t o f p o l y g o n s p e c i f i c a t i o n s [ p o l 1 , p o l 2 , . . . , p o l n ] . Each polygon s p e c i f i c a t i o n i s a s e q u e n t i a l l i s t [ vert1 , vert2 , . . . , vertm ] of the p o l y g o n ’ s v e r t i c e s i n t h e x−y p l a n e . Each v e r t e x i s s p e c i f i e d a s a l i s t [ x , y ] or [ x , y , 0 ] . S e c o n d _ a r g u m e n t : z−c o o r d i n a t e i n t e r v a l [ z1 , z 2 ] t h a t t h e r e s u l t i n g 3D p a r t s h o u l d span . T h i r d _ a r g u m e n t : G e o m e t r i c p r o p o r t i o n a l i t y c o e f f i c i e n t . The o u t p u t u n i t o f l e n g t h i n t h e STEP f i l e i s mm, s o u s e 10 i f t h e 2D g e o m e t r y i s s p e c i f i e d i n cm . A sample i n p u t f i l e , " part_geometry . t x t " c o n t a i n i n g a r e p r e s e n t a t i o n of t h e Muon g−2 C o l l a b o r a t i o n q u a d r u p o l e , i s s u p p l i e d w i t h t h i s program . ’’’ _ _ a u t h o r _ _ = "E . V a l e t o v and M. B e r z " __version__ = " 1.0.1 " _ _ m a i n t a i n e r _ _ = "E . V a l e t o v " _ _ e m a i l _ _ = " valetove@msu . edu " __status__ = " Production " import r e import math import o p e r a t o r import a s t import s y s import d a t e t i m e from numbers import Number from p a t h l i b import P a t h def l i n e _ i n d e x ( l i n e ) : search_result = re . search ( ’ #(.+?)= ’ , line ) 288 r e t u r n 0 i f s e a r c h _ r e s u l t i s None e l s e i n t ( s e a r c h _ r e s u l t . g r o u p ( 1 ) ) def r o t a t e ( l i s t _ i n , x ) : r e t u r n l i s t _ i n [−x : ] + l i s t _ i n [: − x ] def i t e m _ e x i s t s _ q ( s t r i n g _ i n ) : i f not work_array : return False s e a r c h _ r e s u l t = [ i f o r i , i t e m i n enumerate ( w o r k _ a r r a y ) i f item . endswith ( s t r i n g _ i n ) ] return F a l s e i f not s e a r c h _ r e s u l t e l s e True def e x i s t i n g _ i t e m _ l n ( s t r i n g _ i n ) : i f not work_array : return False i f not i t e m _ e x i s t s _ q ( s t r i n g _ i n ) : return False s e a r c h _ r e s u l t = [ item for item in work_array i f item . endswith ( s t r i n g _ i n ) ] return l i n e _ i n d e x ( s e a r c h _ r e s u l t [ 0 ] ) d e f new_item ( s t r i n g _ i n ) : global current_index global work_array if item_exists_q ( string_in ): return_index = existing_item_ln ( string_in ) else : work_array . append ( ’ # ’ + s t r ( c u r r e n t _ i n d e x ) + ’= ’ + s t r i n g _ i n ) return_index = current_index c u r r e n t _ i n d e x += 1 return r e t u r n _ i n d e x def to_coord ( c l i s t ) : i f len ( c l i s t ) != 3 : p r i n t ( ’ t o _ c o o r d : E r r o r . C o o r d i n a t e s n o t 3D . ’ ) 289 sys . e x i t ( ) return s t r ( c l i s t [ 0 ] ) + ’ , ’ + s t r ( c l i s t [ 1 ] ) + ’ , ’ + s t r ( c l i s t [ 2 ] ) def t o _ s t e p _ l i s t ( s l i s t ) : i f not i s i n s t a n c e ( s l i s t , l i s t ) : s l i s t 1 = ’# ’ + str ( s l i s t ) else : slist1 = ’’ f o r j i n range ( 0 , l e n ( s l i s t ) − 1 ) : s l i s t 1 += ’ # ’ + s t r ( s l i s t [ j ] ) + ’ , ’ s l i s t 1 += ’ # ’ + s t r ( s l i s t [ − 1 ] ) return s l i s t 1 def f o r t _ b o o l ( bool_in ) : r e t u r n ’ . T . ’ i f ( b o o l _ i n == T r u e ) or ( b o o l _ i n == ’ . T . ’ ) e l s e ’ . F . ’ def normalize ( v e c t o r _ i n ) : i f len ( v e c t o r _ i n ) != 3 : p r i n t ( ’ n o r m a l i z e : E r r o r . C o o r d i n a t e s n o t 3D . ’ ) sys . e x i t ( ) m a g n i t u d e = math . s q r t ( sum ( [ i ∗∗ 2 f o r i i n v e c t o r _ i n ] ) ) return [ x / magnitude for x in v e c t o r _ i n ] def c r o s s _ p r o d u c t ( x , y ) : r e t u r n [−x [ 2 ] ∗ y [ 1 ] + x [ 1 ] ∗ y [ 2 ] , x [ 2 ] ∗ y [ 0 ] − x [ 0 ] ∗ y [ 2 ] , −x [ 1 ] ∗ y [ 0 ] + x [ 0 ] ∗ y [ 1 ] ] def p o i n t ( coord_in ) : r e t u r n new_item ( "CARTESIAN_POINT ( ’ ’ , ( " + t o _ c o o r d ( c o o r d _ i n ) + " ) ) ; \ n " ) def l i n e ( o r i g i n , d i r e c t i o n ) : c o o r d _ l n = new_item ( "CARTESIAN_POINT ( ’ O r i g i n L i n e ’ , ( " + t o _ c o o r d ( o r i g i n ) + " ) ) ; \ n " ) 290 d i r _ l n = new_item ( "DIRECTION ( ’ V e c t o r D i r e c t i o n ’ , ( " + t o _ c o o r d ( normalize ( d i r e c t i o n )) + " )) ; \ n" ) v e c _ l n = new_item ( "VECTOR( ’ L i n e D i r e c t i o n ’ , # " + s t r ( d i r _ l n ) + " , 1 . ) ; \ n " ) r e t u r n new_item ( " LINE ( ’ L i n e ’ , # " + s t r ( c o o r d _ l n ) + " , # " + s t r ( v e c _ l n ) + " ) ; \ n " ) def v e r t e x ( coord_in ) : c o o r d _ l n = new_item ( "CARTESIAN_POINT ( ’ V e r t e x ’ , ( " + t o _ c o o r d ( c o o r d _ i n ) + " ) ) ; \ n " ) r e t u r n new_item ( "VERTEX_POINT ( ’ ’ , # " + s t r ( c o o r d _ l n ) + " ) ; \ n " ) def edge_curve ( v e r t e x 1 _ l n , v e r t e x 2 _ l n , l i n e _ c o o r d _ l n , same_sense =True ) : r e t u r n new_item ( "EDGE_CURVE( ’ ’ , # " + s t r ( v e r t e x 1 _ l n ) + " , # " + s t r ( v e r t e x 2 _ l n ) + " ,# " + s t r ( l i n e _ c o o r d _ l n ) + " , " + f o r t _ b o o l ( same_sense ) + " ) ; \ n" ) def edge_curve_0 ( v e r t e x 1 , v e r t e x 2 , same_sense =True ) : return edge_curve ( v e r t e x ( vertex1 ) , v e r t e x ( vertex2 ) , l i n e ( [ x / 2 f o r x i n l i s t ( map ( o p e r a t o r . add , v e r t e x 1 , v e r t e x 2 ) ) ] , l i s t ( map ( o p e r a t o r . sub , v e r t e x 2 , v e r t e x 1 ) ) ) , f o r t _ b o o l ( same_sense ) ) def o r i e n t e d _ e d g e ( edge_curve_ln , same_sense =True ) : r e t u r n new_item ( "ORIENTED_EDGE ( ’ ’ , ∗ , ∗ , # " + s t r ( e d g e _ c u r v e _ l n ) + " , " + f o r t _ b o o l ( same_sense ) + " ) ; \ n" ) def edge_loop ( l i n e s ) : r e t u r n new_item ( "EDGE_LOOP ( ’ ’ , ( " + t o _ s t e p _ l i s t ( l i n e s ) + " ) ) ; \ n " ) def edge_loop_0 ( v e r t i c e s ) : return edge_loop ( l i s t ( 291 map ( lambda x1 , x2 : o r i e n t e d _ e d g e ( e d g e _ c u r v e _ 0 ( x1 , x2 ) ) , v e r t i c e s , rotate ( vertices , −1)))) def f a c e _ o u t e r _ b o u n d ( edge_loop_ln , same_sense : True ) : r e t u r n new_item ( "FACE_OUTER_BOUND( ’ ’ , # " + s t r ( e d g e _ l o o p _ l n ) + " , " + f o r t _ b o o l ( same_sense ) + " ) ; \ n" ) def edge_loop_1 ( v e r t i c e s , same_sense : True ) : return face_outer_bound ( edge_loop_0 ( v e r t i c e s ) , same_sense ) def axis2_placement_3d ( origin_coord , d i r e c t i o n 1 , d i r e c t i o n 2 ) : o r i g i n _ l n = new_item ( "CARTESIAN_POINT ( ’ Axis2P3D L o c a t i o n ’ , ( " + t o _ c o o r d ( origin_coord ) + " )) ; \ n" ) d i r e c t i o n 1 _ l n = new_item ( "DIRECTION ( ’ Axis2P3D Z D i r e c t i o n ’ , ( " + t o _ c o o r d ( d i r e c t i o n 1 ) + " ) ) ; \ n " ) d i r e c t i o n 2 _ l n = new_item ( "DIRECTION ( ’ Axis2P3D X D i r e c t i o n ’ , ( " + t o _ c o o r d ( d i r e c t i o n 2 ) + " ) ) ; \ n " ) r e t u r n new_item ( "AXIS2_PLACEMENT_3D ( ’ P l a n e Axis2P3D ’ , # " + s t r ( o r i g i n _ l n ) + " , # " + s t r ( d i r e c t i o n 1 _ l n ) + " ,# " + s t r ( direction2_ln ) + " ) ; \ n" ) def plane ( axis2_placement_3d_ln ) : r e t u r n new_item ( "PLANE ( ’ ’ , # " + s t r ( a x i s 2 _ p l a c e m e n t _ 3 d _ l n ) + " ) ; \ n " ) def plane_0 ( origin_coord , d i r e c t i o n 1 , d i r e c t i o n 2 ) : return plane ( axis2_placement_3d ( origin_coord , d i r e c t i o n 1 , d i r e c t i o n 2 ) ) def a d va n c e d_ f a c e ( f a c e _ o u t e r _ b o u n d _ l n , p l a n e _ l n , same_sense_plane =True ) : r e t u r n new_item ( "ADVANCED_FACE( ’ P a r t B o d y ’ , ( " + t o _ s t e p _ l i s t ( face_outer_bound_ln ) + " ) ,# " + str ( plane_ln ) + " , " + fort_bool ( 292 same_sense_plane ) + " ) ; \ n" ) d e f a d v a n c e d _ f a c e _ 0 ( v e r t i c e s , z a x i s , s a m e _ s e n s e _ 1 = True , s a m e _ s e n s e _ 2 = T r u e ) : if l i s t ( map ( o p e r a t o r . add , n o r m a l i z e ( z a x i s ) , n o r m a l i z e ( c r o s s _ p r o d u c t ( l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 2 ] , v e r t i c e s [ 1 ] ) ) , l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 2 ] , v e r t i c e s [ 0 ] ) ) ) ) ) ) == [ 0 , 0 , 0 ] : a f _ l n = advanced_face ( edge_loop_1 ( v e r t i c e s , same_sense_1 ) , plane ( axis2_placement_3d ( v e r t i c e s [0] , normalize ( zaxis ) , n o r m a l i z e ( l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 1 ] , vertices [0]))))) , same_sense_2 ) else : af_ln = advanced_face ( edge_loop_1 ( l i s t ( reversed ( v e r t i c e s ) ) , same_sense_1 ) , plane ( axis2_placement_3d ( v e r t i c e s [0] , normalize ( zaxis ) , normalize ( l i s t ( map ( o p e r a t o r . sub , l i s t ( r e v e r s e d ( v e r t i c e s ) ) [ 1 ] , l i s t ( reversed ( v e r t i c e s ) ) [ 0 ] ) ) ) ) ) , same_sense_2 ) return a f _ l n d e f a d v a n c e d _ f a c e _ 1 ( v e r t i c e s , s a m e _ s e n s e _ 1 = True , s a m e _ s e n s e _ 2 = T r u e ) : return advanced_face ( edge_loop_1 ( v e r t i c e s , same_sense_1 ) , plane ( axis2_placement_3d ( v e r t i c e s [0] , normalize ( cross_product ( l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 2 ] , v e r t i c e s [ 1 ] ) ) , l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 1 ] , v e r t i c e s [ 0 ] ) ) ) ) , normalize ( l i s t ( map ( o p e r a t o r . sub , v e r t i c e s [ 1 ] , v e r t i c e s [ 0 ] ) ) ) ) ) , same_sense_1 ) def c l o s e d _ s h e l l ( a d v a n c e d _ f a c e _ l n _ l i s t ) : r e t u r n new_item ( "CLOSED_SHELL ( ’ C l o s e d S h e l l ’ , ( " + t o _ s t e p _ l i s t ( advanced_face_ln_list ) + " )) ; \ n" ) def m a n i f o l d _ s o l i d _ b r e p ( c l o s e d _ s h e l l _ l n ) : 293 global part_body_index msb = new_item ( "MANIFOLD_SOLID_BREP ( ’ P a r t B o d y . " + s t r ( p a r t _ b o d y _ i n d e x ) + " ’ , # " + s t r ( closed_shell_ln ) + " ) ; \ n" ) p a r t _ b o d y _ i n d e x += 1 r e t u r n msb def a d v a n c e d _ b r e p _ s h a p e _ r e p r e s e n t a t i o n ( m a n i f o l d _ s o l i d _ b r e p _ l i s t , i n i t _ l n =45): r e t u r n new_item ( "ADVANCED_BREP_SHAPE_REPRESENTATION ( ’NONE ’ , ( " + t o _ s t e p _ l i s t ( manifold_solid_brep_list ) + " ) ,# " + str ( i n i t _ l n ) + " ) ; \ n" ) def s h a p e _ r e p r e s e n t a t i o n _ r e l a t i o n s h i p ( a d v a n c e d _ b r e p _ s h a p e _ r e p r e s e n t a t i o n _ l n , shape_representation_ln =48): r e t u r n new_item ( "SHAPE_REPRESENTATION_RELATIONSHIP ( ’ ’ , ’ ’ , # " + s t r ( s h a p e _ r e p r e s e n t a t i o n _ l n ) + " ,# " + s t r ( advanced_brep_shape_representation_ln ) + " ) ; \ n" ) def zface ( vertex1 , vertex2 , geom_depth_list ) : z_neg = g e o m _ d e p t h _ l i s t [ 0 ] z_pos = g e o m _ d e p t h _ l i s t [ 1 ] return advanced_face_0 ( [ l i s t ( map ( o p e r a t o r . add , v e r t e x 1 , [ 0 , 0 , z _ n e g ] ) ) , l i s t ( map ( o p e r a t o r . add , v e r t e x 2 , [ 0 , 0 , z _ n e g ] ) ) , l i s t ( map ( o p e r a t o r . add , v e r t e x 2 , [ 0 , 0 , z _ p o s ] ) ) , l i s t ( map ( o p e r a t o r . add , v e r t e x 1 , [ 0 , 0 , z _ p o s ] ) ) ] , n o r m a l i z e ( c r o s s _ p r o d u c t ( l i s t ( map ( o p e r a t o r . sub , v e r t e x 2 , v e r t e x 1 ) ) , [ 0 , 0 , −( z _ p o s − z _ n e g ) ] ) ) ) def xyface ( v e r t e x _ l i s t , depth , z d i r ) : return advanced_face_0 ( l i s t ( map ( lambda x : l i s t ( map ( o p e r a t o r . add , x , [ 0 , 0 , d e p t h ] ) ) , v e r t e x _ l i s t ) ) , zdir ) 294 def af2d3d ( v e r t e x _ l i s t , geom_depth_list ) : t a f l i s t = [] z_neg = g e o m _ d e p t h _ l i s t [ 0 ] z_pos = g e o m _ d e p t h _ l i s t [ 1 ] t a f l i s t . a p p e n d ( x y f a c e ( v e r t e x _ l i s t , z_pos , [ 0 , 0 , 1 ] ) ) t a f l i s t . a p p e n d ( x y f a c e ( v e r t e x _ l i s t , z_neg , [ 0 , 0 , − 1 ] ) ) t a f l i s t += l i s t ( map ( lambda x1 , x2 : z f a c e ( x1 , x2 , g e o m _ d e p t h _ l i s t ) , v e r t e x _ l i s t , r o t a t e ( v e r t e x _ l i s t , −1))) return t a f l i s t def a f _ l i s t _ 2 _ a s s e m b l y ( a f _ l i s t ) : return s h a p e _ r e p r e s e n t a t i o n _ r e l a t i o n s h i p ( manifold_solid_brep ( closed_shell ( a f _ l i s t ) ) ) def a f _ l i s t _ 2 _ p a r t ( a f _ l i s t ) : return m a n i f o l d _ s o l i d _ b r e p ( c l o s e d _ s h e l l ( a f _ l i s t ) ) def part_2_assembly ( p a r t _ l i s t ) : return s h a p e _ r e p r e s e n t a t i o n _ r e l a t i o n s h i p ( advanced_brep_shape_representation ( p a r t _ l i s t )) d e f g e n e r a t e _ p a r t ( v e r t _ l i s t , geom_depth , c l o c k w i s e _ p = T r u e ) : return a f _ l i s t _ 2 _ p a r t ( a f 2 d 3 d ( v e r t _ l i s t , geom_depth ) ) i f c l o c k w i s e _ p e l s e a f _ l i s t _ 2 _ p a r t ( a f 2 d 3 d ( r e v e r s e d ( v e r t _ l i s t ) , geom_depth ) ) def convert_3d ( element_in ) : i f ( i s i n s t a n c e ( e l e m e n t _ i n , l i s t ) ) and ( l e n ( e l e m e n t _ i n ) ) == 2 and ( i s i n s t a n c e ( e l e m e n t _ i n [ 0 ] , Number ) ) and ( i s i n s t a n c e ( e l e m e n t _ i n [ 1 ] , Number ) ) : return [ element_in [ 0 ] , element_in [ 1 ] , 0] else : 295 return element_in def c o n v e r t _ t o _ c l o c k w i s e ( p a r t _ l i s t ) : pol_sum = sum ( l i s t ( map ( lambda x1 , x2 : ( x2 [ 0 ] − x1 [ 0 ] ) ∗ ( x2 [ 1 ] + x1 [ 1 ] ) , p a r t _ l i s t , rotate ( part_list , 1)))) i f pol_sum == 0 : print ( " [ FAILED ] \ n c o n v e r t _ t o _ c l o c k w i s e : E r r o r . P o l y g o n i s " + " n e i t h e r c l o c k w i s e n o r c o u n t e r −c l o c k w i s e . " ) sys . e x i t ( ) e l i f pol_sum > 0 : return reversed ( p a r t _ l i s t ) else : return p a r t _ l i s t def generate_assembly ( l i s t _ v e r t _ l i s t , geom_depth_list , p_coeff =1): p r i n t ( " G e n e r a t i n g a s s e m b l y . . . " , end = " " ) i f n o t i s i n s t a n c e ( p _ c o e f f , Number ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . NaN s u p p l i e d f o r " + " proportionality coefficient . ") sys . e x i t ( ) i f p _ c o e f f == 0 : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . Z e r o s u p p l i e d a s " + " the pr op or ti on al it y c o e f f i c i e n t . " ) sys . e x i t ( ) i f not i s i n s t a n c e ( g e o m _ d e p t h _ l i s t , l i s t ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . z−c o o r d i n a t e i n t e r v a l " + " [ z1 , z2 ] e x p e c t e d , s c a l a r s u p p l i e d . " ) sys . e x i t ( ) i f not g e o m _ d e p t h _ l i s t : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . z−c o o r d i n a t e i n t e r v a l " + " [ z1 , z2 ] e x p e c t e d , empty l i s t s u p p l i e d . " ) 296 sys . e x i t ( ) for depth_element in geom_depth_list : i f n o t i s i n s t a n c e ( d e p t h _ e l e m e n t , Number ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . NaN f o u n d i n t h e " + " z−c o o d i n a t e i n t e r v a l . " ) sys . e x i t ( ) i f g e o m _ d e p t h _ l i s t [ 0 ] == g e o m _ d e p t h _ l i s t [ 1 ] : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . z2 must be d i f f e r e n t " + " from z1 i n t h e z−c o o r d i n a t e i n t e r v a l [ z1 , z2 ] . " ) sys . e x i t ( ) i f geom_depth_list [0] > geom_depth_list [ 1 ] : tvar = geom_depth_list [0] geom_depth_list [0] = geom_depth_list [1] geom_depth_list [1] = tvar i f not i s i n s t a n c e ( l i s t _ v e r t _ l i s t , l i s t ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . L i s t o f v e r t i c e s lists " + " expected , s c a l a r supplied . " ) sys . e x i t ( ) i f not l i s t _ v e r t _ l i s t : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . Empty l i s t o f v e r t i c e s " + " lists .") sys . e x i t ( ) for part_element in l i s t _ v e r t _ l i s t : i f not p a r t _ e l e m e n t : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . Empty l i s t o f " + " vertices . ") sys . e x i t ( ) i f not i s i n s t a n c e ( p a r t _ e l e m e n t , l i s t ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . L i s t o f v e r t i c e s " + " expected , s c a l a r supplied " ) sys . e x i t ( ) for vertex_element in part_element : i f not v e r t e x _ e l e m e n t : 297 print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . Empty l i s t o f " + " vertex coordinates . " ) sys . e x i t ( ) i f not i s i n s t a n c e ( p a r t _ e l e m e n t , l i s t ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . L i s t o f v e r t e x " + " c o o r d i n a t e s expected , s c a l a r supplied " ) sys . e x i t ( ) i f ( l e n ( v e r t e x _ e l e m e n t ) < 2 ) or ( l e n ( v e r t e x _ e l e m e n t ) > 3 ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . Number o f v e r t e x " + " c o o r d i n a t e s s h o u l d be 2 o r 3 , " + s t r ( len ( vertex_element ) ) + " coordinates supplied . " ) sys . e x i t ( ) for coordinate_element in vertex_element : i f n o t i s i n s t a n c e ( c o o r d i n a t e _ e l e m e n t , Number ) : print ( " [ FAILED ] \ n g e n e r a t e _ a s s e m b l y : E r r o r . NaN i s s u p p l i e d " + " for a vertex coordinate . " ) sys . e x i t ( ) list_vert_list = [ [ convert_3d ( vertex_element ) for vertex_element in part_element ] for part_element in list_vert_list ] l i s t _ v e r t _ l i s t = [ convert_to_clockwise ( x ) for x in l i s t _ v e r t _ l i s t ] list_vert_list = [ [ [ p_coeff ∗ 1.0 ∗ coordinate_element for coordinate_element in vertex_element ] for vertex_element in part_element ] for part_element in l i s t _ v e r t _ l i s t ] geom_depth_list = [ p_coeff ∗ 1.0 ∗ i for i in geom_depth_list ] p a r t _ l i s t = [ g e n e r a t e _ p a r t ( x , geom_depth_list ) for x in l i s t _ v e r t _ l i s t ] part_2_assembly ( p a r t _ l i s t ) r e s u l t i n g _ a r r a y = f i l e _ a r r a y [ : index1 ] + work_array + f i l e _ a r r a y [ index1 + 1 : ] p r i n t ( " [DONE] " ) p r i n t ( " W r i t i n g STEP f i l e . . . " , end = " " ) w i t h open ( f i l e _ o u t _ n a m e , ’w+ ’ ) a s f i l e _ o u t : for item in r e s u l t i n g _ a r r a y : 298 f i l e _ o u t . w r i t e ( "%s " % i t e m ) p r i n t ( " [DONE] " ) file_in2_name = ’ part_geometry . t x t ’ file_out_name = ’ part_out . stp ’ p r i n t ( "−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−" ) print ( " STEP F i l e G e n e r a t o r ( ’ s t e p f g ’ ) print ( " E . V a l e t o v and M. B e r z ") ") print ( " Michigan S t a t e U n i v e r s i t y ") print ( " C r e a t e d 03−Feb −2017 ") print ( " E m a i l : valetove@msu . edu ") p r i n t ( "−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−" ) i f ( len ( sys . argv ) > 1 ) : i f ( ( s t r ( s y s . a r g v [ 1 ] ) == ’−h ’ ) or ( s t r ( s y s . a r g v [ 1 ] ) == ’ / h ’ ) ) : print ( h e l p s t r ) sys . e x i t ( ) file_in2_name = str ( sys . argv [ 1 ] ) i f ( len ( sys . argv ) > 2 ) : i f ( ( s t r ( s y s . a r g v [ 2 ] ) == ’−h ’ ) or ( s t r ( s y s . a r g v [ 2 ] ) == ’ / h ’ ) ) : print ( h e l p s t r ) sys . e x i t ( ) file_out_name = str ( sys . argv [ 2 ] ) p r i n t ( " Use command−l i n e o p t i o n −h o r / h f o r h e l p . \ n " ) p r i n t ( " R e a d i n g 2D g e o m e t r y f i l e " + f i l e _ i n 2 _ n a m e + " . . . " , end = " " ) i f not Path ( f i l e _ i n 2 _ n a m e ) . i s _ f i l e ( ) : print ( " [ FAILED ] \ n E r r o r . 2D g e o m e t r y f i l e " + f i l e _ i n 2 _ n a m e + " doesn ’ t e x i s t . " ) sys . e x i t ( ) w i t h open ( f i l e _ i n 2 _ n a m e , ’ r ’ ) a s f i l e _ i n : data = ast . l i t e r a l _ e v a l ( f i l e _ i n . read ( ) ) i f not i s i n s t a n c e ( data , l i s t ) : p r i n t ( " [ FAILED ] \ n E r r o r . I n p u t d a t a i s n o t a l i s t . " ) sys . e x i t ( ) 299 i f len ( d a t a ) != 3 : print ( " [ FAILED ] \ n E r r o r . The t o p −l e v e l l e n g t h o f t h e i n p u t d a t a l i s t i s not " + " 3. " ) sys . e x i t ( ) in_array = data [0] in_depth = data [1] in_coeff = data [2] p r i n t ( " [DONE] " ) p r i n t ( " I n i t i a l i z i n g STEP f i l e d a t a . . . " , end = " " ) d = d a t e t i m e . d a t e t i m e . now ( ) f i l e _ a r r a y = [ " ISO −10303 −21; " , "HEADER; " , " FILE_DESCRIPTION ( ( ’ none ’ ) , ’ 2 ; 1 ’ ) ; " , "" , "FILE_NAME ( ’ " + f i l e _ o u t _ n a m e + " ’ , ’ none ’ , ( ’ none ’ ) , ( ’ none ’ ) , " + " ’ none ’ , ’ none ’ , ’ none ’ ) ; " , "" , "FILE_SCHEMA ( ( ’ CONFIG_CONTROL_DESIGN ’ ) ) ; " , "" , "ENDSEC ; " , "DATA; " , " #1=APPLICATION_CONTEXT ( ’ c o n f i g u r a t i o n c o n t r o l l e d 3D d e s i g n o f " + " m e c h a n i c a l p a r t s and a s s e m b l i e s ’ ) ; " , " #2=MECHANICAL_CONTEXT( ’ ’ , # 1 , ’ m e c h a n i c a l ’ ) ; " , " #3=DESIGN_CONTEXT ( ’ ’ , # 1 , ’ d e s i g n ’ ) ; " , " #4=APPLICATION_PROTOCOL_DEFINITION ( ’ i n t e r n a t i o n a l s t a n d a r d ’ , " + " ’ config_control_design ’ ,1994 ,#1) ; " , " #5=PRODUCT( ’ P a r t 1 ’ , ’ ’ , ’ ’ , ( # 2 ) ) ; " , " #6=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE ( ’ ’ , ’ ’ " + " , # 5 , .NOT_KNOWN . ) ; " , " #7=PRODUCT_CATEGORY( ’ p a r t ’ , $ ) ; " , " #8=PRODUCT_RELATED_PRODUCT_CATEGORY( ’ d e t a i l ’ , $ , ( # 5 ) ) ; " , " #9=PRODUCT_CATEGORY_RELATIONSHIP ( ’ ’ , ’ ’ , # 7 , # 8 ) ; " , " #10=COORDINATED_UNIVERSAL_TIME_OFFSET ( 0 , 0 , .AHEAD . ) ; " , " #11=CALENDAR_DATE( " + s t r ( g e t a t t r ( d , ’ y e a r ’ ) ) + " , " + s t r ( g e t a t t r ( d , ’ month ’ ) ) + " , " + s t r ( g e t a t t r ( d , ’ day ’ ) ) + " ) ; " , 300 " #12=LOCAL_TIME ( " + s t r ( g e t a t t r ( d , ’ h o u r ’ ) ) + " , " + s t r ( g e t a t t r ( d , ’ minute ’ ) ) + " , " + s t r ( g e t a t t r ( d , ’ second ’ ) ) + " . , # 1 0 ) ; " , " #13=DATE_AND_TIME ( # 1 1 , # 1 2 ) ; " , " #14=PRODUCT_DEFINITION ( ’ ’ , ’ ’ ,#6 ,#3) ; " , " #15=SECURITY_CLASSIFICATION_LEVEL ( ’ u n c l a s s i f i e d ’ ) ; " , " #16=SECURITY_CLASSIFICATION ( ’ ’ , ’ ’ , # 1 5 ) ; " , " #17=DATE_TIME_ROLE ( ’ c l a s s i f i c a t i o n _ d a t e ’ ) ; " , " #18=CC_DESIGN_DATE_AND_TIME_ASSIGNMENT ( # 1 3 , # 1 7 , ( # 1 6 ) ) ; " , " #19=APPROVAL_ROLE( ’APPROVER ’ ) ; " , " #20=APPROVAL_STATUS( ’ n o t _ y e t _ a p p r o v e d ’ ) ; " , " #21=APPROVAL( # 2 0 , ’ ’ ) ; " , " #22=PERSON ( ’ ’ , ’ ’ , ’ ’ , $ , $ , $ ) ; " , " #23=ORGANIZATION ( ’ ’ , ’ ’ , ’ ’ ) ; " , " #24=PERSONAL_ADDRESS( ’ ’ , ’ ’ , ’ ’ , ’ ’ , ’ ’ , ’ ’ , ’ ’ , ’ ’ , ’ ’ , " + "’ ’,’ ’,’ ’ ,(#22) , ’ ’) ; " , " #25=PERSON_AND_ORGANIZATION ( # 2 2 , # 2 3 ) ; " , " #26=PERSON_AND_ORGANIZATION_ROLE ( ’ c l a s s i f i c a t i o n _ o f f i c e r ’ ) ; " , " #27=CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( # 2 5 , # 2 6 , " + " (#16)) ; " , " #28=DATE_TIME_ROLE ( ’ c r e a t i o n _ d a t e ’ ) ; " , " #29=CC_DESIGN_DATE_AND_TIME_ASSIGNMENT ( # 1 3 , # 2 8 , ( # 1 4 ) ) ; " , " #30=CC_DESIGN_APPROVAL ( # 2 1 , ( # 1 6 , # 6 , # 1 4 ) ) ; " , " #31=APPROVAL_PERSON_ORGANIZATION ( # 2 5 , # 2 1 , # 1 9 ) ; " , " #32=APPROVAL_DATE_TIME ( # 1 3 , # 2 1 ) ; " , " #33=CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( # 2 5 , # 3 4 , " + " (#6)) ; " , " #34=PERSON_AND_ORGANIZATION_ROLE ( ’ d e s i g n _ s u p p l i e r ’ ) ; " , " #35=CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( # 2 5 , # 3 6 , " + " (#6 ,#14)) ; " , " #36=PERSON_AND_ORGANIZATION_ROLE ( ’ c r e a t o r ’ ) ; " , " #37=CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( # 2 5 , # 3 8 , " + " (#5)) ; " , " #38=PERSON_AND_ORGANIZATION_ROLE ( ’ d e s i g n _ o w n e r ’ ) ; " , " #39=CC_DESIGN_SECURITY_CLASSIFICATION ( # 1 6 , ( # 6 ) ) ; " , "" , " #40=PRODUCT_DEFINITION_SHAPE ( ’ ’ , ’ ’ , # 1 4 ) ; " , " #4 1= (LENGTH_UNIT ( ) NAMED_UNIT ( ∗ ) SI_UNIT ( . MILLI . , . METRE . ) ) ; " , " #4 2= (NAMED_UNIT ( ∗ ) PLANE_ANGLE_UNIT ( ) SI_UNIT ( $ , . RADIAN . ) ) ; " , 301 " #4 3= (NAMED_UNIT ( ∗ ) SI_UNIT ( $ , . STERADIAN . ) SOLID_ANGLE_UNIT ( ) ) ; " , " #44=UNCERTAINTY_MEASURE_WITH_UNIT (LENGTH_MEASURE( 0 . 0 0 5 ) , # 4 1 , " + " ’ d i s t a n c e _ a c c u r a c y _ v a l u e ’ , ’CONFUSED CURVE" + " UNCERTAINTY ’ ) ; " , " #4 5= (GEOMETRIC_REPRESENTATION_CONTEXT ( 3 ) " + "GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT ( ( # 4 4 ) ) " + "GLOBAL_UNIT_ASSIGNED_CONTEXT ( ( # 4 1 , # 4 2 , # 4 3 ) ) " + "REPRESENTATION_CONTEXT ( ’ ’ , ’ ’)) ; " , "" , " #46=CARTESIAN_POINT ( ’ ’ ,(0. ,0. ,0.)) ; " , " #47=AXIS2_PLACEMENT_3D ( ’ ’ , # 4 6 , $ , $ ) ; " , " #48=SHAPE_REPRESENTATION ( ’ ’ ,(#47) ,#45) ; " , " #49=SHAPE_DEFINITION_REPRESENTATION ( # 4 0 , # 4 8 ) ; " , "" , " /∗ Part S p e c i f i c a t i o n ∗/ " , "" , "ENDSEC ; " , "END−ISO −10303 −21; " ] f i l e _ a r r a y = [ i + " \ n" for i in f i l e _ a r r a y ] index1 = f i l e _ a r r a y . index ( " /∗ Part S p e c i f i c a t i o n ∗ / \ n" ) i n i t i a l _ w o r k _ a r r a y = l i s t ( f i l t e r ( lambda k : k . s t a r t s w i t h ( ’ # ’ ) , f i l e _ a r r a y ) ) h i g h e s t _ i n d e x = l i n e _ i n d e x ( s o r t e d ( i n i t i a l _ w o r k _ a r r a y , key = l i n e _ i n d e x ) [ − 1 ] ) current_index = highest_index + 1 part_body_index = 1 work_array = [ ] p r i n t ( " [DONE] " ) generate_assembly ( in_array , in_depth , in_coeff ) 302 APPENDIX H CODES FOR SPHERICAL DEFLECTOR TRANSFER MAP AND ORBIT CALCULATIONS H.1 COSY INFINITY Code for Transfer Map Calculation Using ODEs in Laboratory Coordinates The following is a COSY INFINITY code that calculates the transfer map of a 45◦ sector of the electrostatic spherical deflector in (x, a) beamline coordinates by integrating the ODEs of motion in polar laboratory coordinates. This version of the code uses a 4th order Runge–Kutta integrator with fixed step size. The voltages of the inner and outer spherical shells of the electrostatic spherical deflector are set to result in a circular reference orbit of radius r0 = 1 m. The DA computation order 3 is used. INCLUDE ’COSY’ ; PROCEDURE RUN ; VARIABLE Y1 4000 8 ; VARIABLE YT 4000 8 ; VARIABLE XX0 4000 ; { I n i t i a l DA−v a l u e d x c o o r d i n a t e } VARIABLE XX1 4000 ; { F i n a l DA−v a l u e d x c o o r d i n a t e } VARIABLE AA0 4000 ; { I n i t i a l DA−v a l u e d a c o o r d i n a t e } VARIABLE AA1 4000 ; { F i n a l DA−v a l u e d a c o o r d i n a t e } VARIABLE NM 1 ; {DA v a r i a b l e s i z e } VARIABLE MU 1 ; {mu} VARIABLE HPAR 4000 ; { h } PROCEDURE FNC F X T ; {FUNCTION F (X, T ) DEFINING THE ODEs OF MOTION X COORDINATES VECTOR T TIME (OR ARC LENGTH) } 303 F ( 1 ) : = X ( 2 ) / X( 4 ) ; { r ’ } F ( 2 ) : = −MU/ X ( 1 ) / X ( 1 ) / X( 4 ) + X( 1 ) ∗X( 4 ) ; { v_r ’ } F ( 3 ) := 1 ; { theta ’} F ( 4 ) : = −2∗HPAR / X ( 1 ) / X ( 1 ) / X( 1 ) ∗ X ( 2 ) / X( 4 ) ; { omega ’ } ENDPROCEDURE ; PROCEDURE RK4A N X0 X1 Y0 NS Y1 ; {FOURTH ORDER RUNGE KUTTA INTEGRATOR} VARIABLE I 1 ; VARIABLE J 1 ; VARIABLE T 1 ; VARIABLE Z1 NM 8 ; VARIABLE Z2 NM 8 ; VARIABLE Z3 NM 8 ; VARIABLE Z4 NM 8 ; VARIABLE Z5 NM 8 ; VARIABLE F NM 8 ; VARIABLE HS1 1 ; T : = X0 ; HS1 : = ( X1−X0 ) / NS ; LOOP J 1 N ; Y1 ( J ) : = Y0 ( J ) ; ENDLOOP ; LOOP I 1 NS ; FNC F Y1 T ; LOOP J 1 N ; Z1 ( J ) : = HS1∗F ( J ) ; ENDLOOP ; LOOP J 1 N ; Z5 ( J ) : = Y1 ( J ) + Z1 ( J ) / 2 ; ENDLOOP ; FNC F Z5 T+HS1 / 2 ; LOOP J 1 N ; Z2 ( J ) : = HS1∗F ( J ) ; ENDLOOP ; LOOP J 1 N ; Z5 ( J ) : = Y1 ( J ) + Z2 ( J ) / 2 ; ENDLOOP ; FNC F Z5 T+HS1 / 2 ; LOOP J 1 N ; Z3 ( J ) : = HS1∗F ( J ) ; ENDLOOP ; LOOP J 1 N ; Z5 ( J ) : = Y1 ( J ) + Z3 ( J ) ; ENDLOOP ; FNC F Z5 T+HS1 ; LOOP J 1 N ; Z4 ( J ) : = HS1∗F ( J ) ; ENDLOOP ; LOOP J 1 N ; Y1 ( J ) : = Y1 ( J ) + ( 1 / 6 ) ∗ ( Z1 ( J ) + 2 ∗ Z2 ( J ) + 2 ∗ Z3 ( J ) + Z4 ( J ) ) ; ENDLOOP ; T : = T + HS1 ; ENDLOOP ; 304 ENDPROCEDURE ; PROCEDURE KEPLERODEPOLAR R00 PHI X0 A0 X1 A1 ; { T h i s p r o c e d u r e c a l c u l a t e s t h e t r a n s f e r map o f t h e e l e c t r o s t a t i c s p h e r i c a l d e f l e c t o r i n ( x , a ) c o o r d i n a t e s by i n t e g r a t i n g t h e ODEs o f m o t i o n i n l a b o r a t o r y c o o r d i n a t e s u s i n g a Runge−K u t t a integrator . Input parameters : R00 Radius of the c i r c u l a r r e f e r e n c e o r b i t PHI Central angle of tracked s e c t o r of the d e f l e c t o r X0 I n i t i a l x coordinate A0 I n i t i a l a coordinate X1 Final x coordinate A1 Final a coordinate } VARIABLE R0 NM 2 ; { I n i t i a l r a d i u s v e c t o r } VARIABLE W0 NM 2 ; { I n i t i a l velocity vector } VARIABLE R1 NM 2 ; { F i n a l r a d i u s v e c t o r } VARIABLE W1 NM 2 ; { F i n a l v e l o c i t y v e c t o r } VARIABLE DOT NM ; {A s c a l a r p r o d u c t } VARIABLE R0S NM ; { I n i t i a l r a d i u s m a g n i t u d e } VARIABLE RS NM ; { F i n a l r a d i u s m a g n i t u d e } VARIABLE SIGMA0 NM ; { s i g m a _ 0 } VARIABLE P NM ; { F o c a l p a r a m e t e r } VARIABLE F NM ; VARIABLE G NM ; { L a g r a n g e c o e f f i c i e n t s F , G} VARIABLE FT NM ; VARIABLE GT NM ; { L a g r a n g e c o e f f i c i e n t s FT , GT} VARIABLE V0 NM ; { R e f e r e n c e v e l o c i t y } VARIABLE V1 NM ; { I n i t i a l v e l o c i t y magnitude } VARIABLE V2 NM ; { F i n a l v e l o c i t y m a g n i t u d e } VARIABLE CHIE 1 ; { E l e c t r i c r i g i d i t y } PHI : = PHI∗DEGRAD ; V0 : = CONS( SQRT( 2 ∗ETA) ∗ CLIGHT ) ; R0 ( 1 ) : = X0 + R00 ; R0 ( 2 ) : = 0 ; CHIE : = AMU∗RE (M0) ∗ V0∗V0 / Z0 / EZERO ; {R00∗CHIE} 305 V1 : = SQRT ( V0^2−2∗Z0∗EZERO∗CHIE∗(1−R00 / ( R0 ( 1 ) ) ) /AMU/ RE (M0 ) ) ; W0( 1 ) : = A0∗V0 ; W0( 2 ) : = SQRT ( V1∗V1−W0( 1 ) ∗W0( 1 ) ) ; MU : = R00∗CONS( V1 ) ^ 2 ; HPAR : = R0 ( 1 ) ∗W0( 2 ) ; YT ( 1 ) : = R0 ( 1 ) ; YT ( 2 ) : = W0( 1 ) ; YT ( 3 ) : = 0 ; YT ( 4 ) : = W0 ( 2 ) / YT ( 1 ) ; {RK8A 4 0 PHI YT HS Y1 1 e−5 RESCODE ; } RK4A 4 0 PHI YT 1 e6 Y1 ; X1 : = Y1 ( 1 ) − R00 ; V2 : = SQRT ( Y1 ( 2 ) ∗ Y1 ( 2 ) + Y1 ( 1 ) ∗ Y1 ( 1 ) ∗ Y1 ( 4 ) ∗ Y1 ( 4 ) ) ; A1 : = Y1 ( 2 ) / CONS( V2 ) ; ENDPROCEDURE ; OV 3 1 0 ; RP 1 1 1 ; NM : = 4000 ; XX0 : = DA( 1 ) ; AA0 : = DA( 2 ) ; KEPLERODEPOLAR 1 45 XX0 AA0 XX1 AA1 ; WRITE 6 ’TRANSFER MAP OBTAINED IN LAB COORDINATES’ ; WRITE 6 ’BY INTEGRATION OF THE ODEs ’ ; WRITE 6 ’ X_f ’ XX1 ’ A_f ’ AA1 ; ENDPROCEDURE ; RUN ; END ; 306 H.2 Mathematica Code for Integration of the ODEs in Laboratory Coordinates The following is a Mathematica notebook that integrates the ODEs of motion of a particle with specified initial beamline coordinates (x, a) through the electrostatic spherical deflector in polar laboratory coordinates, plots one turn of the orbit, and outputs the final beamline coordinates at true anomaly difference θ = 45◦ . The voltages of the inner and outer spherical shells of the electrostatic spherical deflector are set to result in a circular reference orbit of radius r0 = 1 m. ( ∗ I n t e g r a t i o n o f t h e ODEs o f m o t i o n f o r a c h a r g e d \ p a r t i c l e o f k i n e t i c e n e r g y 1 MeV, mass 1 amu , and \ c h a r g e 1 e i n an e l e c t r o s t a t i c s p h e r i c a l d e f l e c t o r \ with the i n n e r sphere charge such t h a t the p a r t i c l e \ would h a v e a c i r c u l a r r e f e r e n c e o r b i t o f r a d i u s 1 m. ∗ ) v00 = 1 3 8 9 1 3 8 8 . 7 9 7 1 4 0 2 8 ; ( ∗ R e f e r e n c e v e l o c i t y ∗ ) r00 = 1; (∗ Reference o r b i t r a d i u s ∗) x = −0. 5; ( ∗ I n i t i a l x b e a m l i n e c o o r d i n a t e ∗ ) a = 0 . 5 ; (∗ I n i t i a l a beamline c o o r d i n a t e ∗) r 0 = { x + r00 , 0 , 0 } ; ( ∗ I n i t i a l r a d i u s v e c t o r ∗ ) v0 = { a v00 , v00 S q r t [ 1 − a ^ 2 ] , 0 } ; ( ∗ I n i t i a l mu = r 0 0 v e l o c i t y vector ∗) v00 ^ 2 ; ( ∗ mu ∗ ) v r 0 = v0 [ [ 1 ] ] ; r r0 = r0 [ [ 1 ] ] ; omega0 = v0 [ [ 2 ] ] / r r 0 ; ( ∗ omega_0 ∗ ) t h e t a 0 = 0; (∗ I n i t i a l polar angle ∗) s y s t e m = { ( ∗ ODEs and t h e i n i t i a l c o n d i t i o n ∗ ) vr ’ [ t ] == −mu / ( omega [ t ] ( r r [ t ] ) ^ 2 ) + r r [ t ] omega [ t ] , r r ’ [ t ] == v r [ t ] / omega [ t ] , omega ’ [ t ] == −2 r r 0 v0 [ [ 2 ] ] v r [ t ] / ( omega [ t ] ( r r [ t ] ) ^ 3 ) , t h e t a ’ [ t ] == 1 , v r [ 0 ] == vr0 , r r [ 0 ] == r r 0 , omega [ 0 ] == omega0 , 307 t h e t a [ 0 ] == t h e t a 0 }; s o l = NDSolve [ s y s t e m , { vr , r r , omega , t h e t a } , { t , 0 , 2 \ [ P i ] } ] ; rsol [ t_ ] = F i r s t [ Evaluate [ rr [ t ] / . sol ] ] ; (∗ Radius magnitude as a f u n c t i o n of p o l a r angle t h e t a ∗) vsol [ t_ ] = F i r s t [ Evaluate [ vr [ t ] / . sol ] ] ; (∗ Velocity magnitude as a f u n c t i o n of p o l a r angle t h e t a ∗) Print [ PolarPlot [ r s o l [ t ] , { t , 0 , 2 \ [ P i ] } ] ] ; ( ∗ P l o t one t u r n o f t h e o r b i t ∗ ) x1 [ t _ ] = r s o l [ t ] − r 0 0 ; ( ∗ x c o o r d i n a t e a t p o l a r a n g l e t h e t a ∗ ) a1 [ t _ ] = v s o l [ t ] / v00 ; ( ∗ a c o o r d i n a t e a t p o l a r a n g l e t h e t a ∗ ) P r i n t [ " x _ f = " , x1 [ P i / 4 ] ] ; P r i n t [ " a _ f = " , a1 [ P i / 4 ] ] ; H.3 COSY INFINITY Code for Transfer Map Calculation Using the Kepler Theory Transition Matrix The following is a COSY INFINITY code that calculates the transfer map of a 45◦ sector of the electrostatic spherical deflector in (x, a) beamline coordinates using the Kepler theory transition matrix with Lagrange-coefficients elements. This version of the code uses a 4th order Runge–Kutta integrator with fixed step size. The voltages of the inner and outer spherical shells of the electrostatic spherical deflector are set to result in a circular reference orbit of radius r0 = 1 m. The DA computation order 3 is used. INCLUDE ’COSY’ ; PROCEDURE RUN ; VARIABLE XX0 4000 ; { I n i t i a l DA−v a l u e d x c o o r d i n a t e } VARIABLE XX1 4000 ; { F i n a l DA−v a l u e d x c o o r d i n a t e } VARIABLE AA0 4000 ; { I n i t i a l DA−v a l u e d a c o o r d i n a t e } VARIABLE AA1 4000 ; { F i n a l DA−v a l u e d a c o o r d i n a t e } 308 VARIABLE NM 1 ; {DA v a r i a b l e s i z e } PROCEDURE KEPLERANALYTICPOLAR R00 PHI X0 A0 X1 A1 ; VARIABLE R0 NM 2 ; { I n i t i a l r a d i u s v e c t o r } VARIABLE W0 NM 2 ; { I n i t i a l velocity vector } VARIABLE R1 NM 2 ; { F i n a l r a d i u s v e c t o r } VARIABLE W1 NM 2 ; { F i n a l v e l o c i t y v e c t o r } VARIABLE MU NM ; {mu} VARIABLE DOT NM ; {A s c a l a r p r o d u c t } VARIABLE R0S NM ; { I n i t i a l r a d i u s } VARIABLE RS NM ; { F i n a l r a d i u s } VARIABLE SIGMA0 NM ; { s i g m a _ 0 } VARIABLE P NM ; { F o c a l p a r a m e t e r p } VARIABLE F NM ; VARIABLE G NM ; { L a g r a n g e c o e f f i c i e n t s F and G} VARIABLE FT NM ; VARIABLE GT NM ; { L a g r a n g e c o e f f i c i e n t s F _ t and G_t } VARIABLE V0 NM ; { I n i t i a l velocity at zero p o t e n t i a l } VARIABLE V1 NM ; { I n i t i a l velocity } VARIABLE V2 NM ; { F i n a l v e l o c i t y } VARIABLE CHIE 1 ; { E l e c t r i c r i g i d i t y } PHI : = PHI∗DEGRAD ; V0 : = CONS( SQRT( 2 ∗ETA) ∗ CLIGHT ) ; R0 ( 1 ) : = X0 + R00 ; R0 ( 2 ) : = 0 ; CHIE : = AMU∗RE (M0) ∗ V0∗V0 / Z0 / EZERO ; {R00∗CHIE} V1 : = SQRT ( V0^2 − 2∗Z0∗EZERO∗CHIE∗(1−R00 / ( R0 ( 1 ) ) ) /AMU/ RE (M0 ) ) ; W0( 1 ) : = A0∗V0 ; W0( 2 ) : = SQRT ( V1∗V1−W0( 1 ) ∗W0( 1 ) ) ; MU : = R00∗CONS( V1 ) ^ 2 ; DOT : = R0 ( 1 ) ∗W0( 1 ) + R0 ( 2 ) ∗W0( 2 ) ; SIGMA0 : = DOT/ SQRT (MU) ; P : = ( ( R0 ( 1 ) ∗ R0 ( 1 ) + R0 ( 2 ) ∗ R0 ( 2 ) ) ∗ ( W0( 1 ) ∗W0( 1 ) +W0( 2 ) ∗W0( 2 ) ) −DOT∗DOT) / MU ; R0S : = R0 ( 1 ) ; RS : = P∗R0S / ( R0S + ( P−R0S ) ∗COS( PHI)−SQRT ( P ) ∗ SIGMA0∗SIN ( PHI ) ) ; F : = 1 − ( RS / P )∗(1 −COS( PHI ) ) ; 309 G : = ( RS∗R0S / SQRT (MU∗P ) ) ∗ SIN ( PHI ) ; FT : = ( SQRT (MU) / R0S / P ) ∗ ( SIGMA0∗(1−COS( PHI )) −SQRT ( P ) ∗ SIN ( PHI ) ) ; GT : = 1 − ( R0S / P )∗(1 −COS( PHI ) ) ; R1 ( 1 ) : = F∗R0 ( 1 ) + G∗W0( 1 ) ; R1 ( 2 ) : = F∗R0 ( 2 ) + G∗W0( 2 ) ; W1( 1 ) : = FT∗R0 ( 1 ) + GT∗W0( 1 ) ; W1( 2 ) : = FT∗R0 ( 2 ) + GT∗W0( 2 ) ; X1 : = (COS( PHI ) ∗ R1 ( 1 ) + SIN ( PHI ) ∗ R1 ( 2 ) ) − R00 ; V2 : = SQRT (W1( 1 ) ∗W1( 1 ) +W1( 2 ) ∗W1( 2 ) ) ; A1 : = (COS( PHI ) ∗W1( 1 ) + SIN ( PHI ) ∗W1( 2 ) ) / CONS( V2 ) ; ENDPROCEDURE ; OV 3 1 0 ; RP 1 1 1 ; NM : = 4000 ; XX0 : = DA( 1 ) ; AA0 : = DA( 2 ) ; KEPLERANALYTICPOLAR 1 45 XX0 AA0 XX1 AA1 ; WRITE 6 ’TRANSFER MAP OBTAINED IN LAB COORDINATES’ ; WRITE 6 ’USING LAGRANGE COEFFICIENTS ’ ; WRITE 6 ’ X_f ’ XX1 ’ A_f ’ AA1 ; ENDPROCEDURE ; RUN ; END ; H.4 COSY INFINITY Code for Transfer Map Calculation of the Built-in Spherical Deflector Element The following is a COSY INFINITY code that uses our non-relativistic version COSYNR.FOX of its beam physics macro package COSY.FOX to compute the transfer map of a 45◦ sector of the electrostatic spherical deflector. The voltages of the inner and outer spherical shells of the electrostatic spherical deflector are set to result in a circular reference orbit of radius r0 = 1 m. The DA computation order 3 is used. 310 INCLUDE ’COSYNR’ ; {Non− r e l a t i v i s t i c v e r s i o n o f COSY . FOX} PROCEDURE RUN ; OV 3 1 0 ; RP 1 1 1 ; UM ; ESP 1 45 10 ; { E l e c t r o s t a t i c s p h e r i c d e f l e c t o r } WRITE 6 ’TRANSFER MAP OF COSY INFINITY ’ ’ S ESP ELEMENT’ ; WRITE 6 ’ X_f ’ MAP( 1 ) ’ A_f ’ MAP( 2 ) ; ENDPROCEDURE ; RUN ; END ; 311 BIBLIOGRAPHY 312 BIBLIOGRAPHY [1] OPERA-3d User Guide. Vector Fields Limited, Oxford, England, 2004. 3.1, 3.3.8 [2] D. Anastassopoulos et al. AGS Proposal: Search for a Permanent Electric Dipole Moment of the Deuteron Nucleus at the 10−29 e · cm Level. BNL Report, Brookhaven National Laboratory, Upton, NY, April 2008. goo.gl/1K1TNq. 1.1, 1.3, 6.3.1 [3] V. Anastassopoulos et al. A Storage Ring Experiment to Detect a Proton Electric Dipole Moment. Rev. Sci. Instrum., 87(11):115116, 2016. 1.1, 1.1, 5.1, 5.9.1, 5.9.5, 5.10, 6.2.1 [4] V. I. Arnold and S. P. Novikov, editors. Dynamical Systems IV: Symplectic Geometry and its Applications, volume 4 of Encyclopaedia of Mathematical Sciences. Springer-Verlag Berlin Heidelberg, Berlin, Heidelberg, 2nd edition, 2001. 1.4 [5] Roger Balian, Wolf Beiglböck, and Harald Grosse. CP Violation Without Strangeness: Electric Dipole Moments of Particles, Atoms, and Molecules. Springer, Berlin/Heidelberg, 1997. 1.1 [6] L. Banjai. Private communication. 3.2.4.2, 3.2.5 [7] L. Banjai. Revisiting the crowding phenomenon in Schwarz–Christoffel mapping. SIAM J. Sci. Comput., 30(2):618–636, 2008. 3.2.4.2, 3.2.5 [8] Jerry Banks, editor. Handbook of Simulation: Principles, Methodology, Advances, Applications, and Practice. John Wiley & Sons, Inc., New York, NY, 1998. 1 [9] Richard H. Battin. An Introduction to the Mathematics and Methods of Astrodynamics, Revised Edition. American Institute of Aeronautics and Astronautics, Reston, VA, rev. edition, 1999. 5.8.2, 5.8.2, 5.8.2, 5.8.2 [10] Martin Berz. Symplectic Tracking Through Circular Accelerators with High Order Maps, pages pp. 288–296. World Scientific Publishing, Singapore, 1991. 4.1.2.5 [11] Martin Berz. Modern Map Methods in Particle Beam Physics. Advances in Imaging and Electron Physics. Academic Press, San Diego, CA, 1999. 1.4, 1.5, 3.2.3, 3.2.3.2, 4.1, 4.1, 4.1.2, 4.1.2.1, 4.1.2.5, 4.1.2.5, 5.3, 5.5, 5.8.1, 5.8.2, 5.8.3, 5.9.2.4, 6.2.1, 6.2.2, 6.5.2, 3 [12] Martin Berz and Kyoko Makino. COSY INFINITY 10.0 Beam Physics Manual. MSU Report MSUHEP 151103-rev, Department of Physics and Astronomy, Michigan State University, East Lansing, MI 48824, 2017. See also http://cosyinfinity.org. 1.5, 4.1.2.5, 5.2.2.1, 5.2.2.1, 5.5 [13] Martin Berz, Kyoko Makino, and Weishi Wan. An Introduction to Beam Physics. CRC Press, London, 2014. 3.3.2, 3.3.2, 6.2.3 [14] Thomas Blum et al. The Muon (g-2) Theory Value: Present and Future, 2013. arXiv:1311.2198. 1.2 313 [15] Timothy H. Boyer. Unfamiliar Trajectories for a Relativistic Particle in a Kepler or Coulomb Potential. Am. J. Phys., 72(8):992–997, 2004. 5.7.2.2, 5.7.2.2 [16] William L. Briggs and Van Emden Henson. The DFT: An Owner’s Manual for the Discrete Fourier Transform. Society for Industrial and Applied Mathematics, Philadelphia, PA, 1995. 3.2.4.1.2 [17] R. M. Carey et al. The New (g-2) Experiment: A Proposal to Measure the Muon Anomalous Magnetic Moment to ±0.14 ppm Precision. Technical report, New g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, Feb. 2009. 1.2 [18] Alexander W. Chao, Karl H. Mess, and Maury Tigner. Handbook of Accelerator Physics and Engineering (2nd Edition). World Scientific Publishing, Singapore, 2nd edition, 2013. 6.5 [19] G. Charpak et al. The Anomalous Magnetic Moment of the Muon. Nuovo Cim., 37(4):1241–1363, 1965. 1.2 [20] F. Combley, F. J. M. Farley, and E. Picasso. The CERN Muon (g-2) Experiments. Phys. Rep., 68(2):93–119, 1981. 1.2 [21] F. Combley and E. Picasso. The Muon (g-2) Precession Experiments: Past, Present and Future. Phys. Rep., 14(1):1–58, 1974. 1.2 [22] Darren Crowdy. The Schwarz–Christoffel Mapping to Bounded Multiply Connected Polygonal Domains. Proc. R. Soc. A, 461(2061):2653–2678, 2005. 3.2.4.2, 3.2.5 [23] Michel Davier, Andreas Hoecker, Bogdan Malaescu, and Zhiqing Zhang. Reevaluation of the Hadronic Contributions to the Muon g-2 and to α(m2Z ). Eur. Phys. J. C, 71(1):1–13, 2011. 1.2, 1.1 [24] J. E. Dennis and Robert B. Schnabel. Numerical Methods for Unconstrained Optimization and Nonlinear Equations. Prentice Hall, Englewood Cliffs, NJ, 1983. 1 [25] Michael Dine and Alexander Kusenko. Origin of the Matter-Antimatter Asymmetry. Rev. Mod. Phys., 76(1):1–30, 2003. 1.1 [26] NIST Digital Library of Mathematical Functions. http://dlmf.nist.gov/, Release 1.0.14 of 2016-12-21. F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller and B. V. Saunders, eds. A.1 [27] Tobin A. Driscoll. The Schwarz-Christoffel Toolbox for MATLAB. http://www.math.udel.edu/ driscoll/SC/. A.3 [28] Tobin A. Driscoll. Algorithm 756: A MATLAB Toolbox for Schwarz-Christoffel Mapping. ACM Trans. Math. Softw., 22(2):168–186, June 1996. 2.3.2, 3.2.2, A.3 [29] Tobin A. Driscoll. Schwarz-Christoffel Toolbox User’s Guide. Version 2.3, October 2002. http://www.math.udel.edu/ driscoll/SC/guide.pdf. A.2, A.3, A.3 314 [30] Tobin A. Driscoll and Lloyd N. Trefethen. Schwarz-Christoffel Mapping. Cambridge Monographs on Applied and Computational Mathematics. Cambridge University Press, Cambridge, UK, 2002. 2.3.2.1.1, 2.3.2.4, 3.2.2, 3.2.4.2, 3.2.4.2, 3.2.5, A.2, A.2 [31] Tobin A. Driscoll and Stephen A. Vavasis. Numerical Conformal Mapping Using Cross-Ratios and Delaunay Triangulation. SIAM J. Sci. Comput., 19(6):1783–1803, 1998. 3.2.4.2, 3.2.5 [32] INTEGRATED Engineering Software. COULOMB. https://www.integratedsoft.com/product/coulomb/. 2.4.1 [33] B. Erdélyi and M. Berz. Optimal Symplectic Approximation of Hamiltonian Flows. Phys. Rev. Lett., 87(11):114302, 2001. 4.1.2.5 [34] D. Eversmann et al. New Method for a Continuous Determination of the Spin Tune in Storage Rings and Implications for Precision Experiments. Phys. Rev. Lett., 115(9):094801, 2015. 6.5.6 [35] F. J. M. Farley. The 46 Years of Muon g-2. Nucl. Phys. B (Proc. Suppl.), 131:235–243, 2004. 1.2 [36] Étienne Forest. Geometric Integration for Particle Accelerators. J. Phys. A: Math. Gen., 39(19):5321–5377, 2006. 4.1.2, 4.1.2.2, 4.1.2.3 [37] Takeshi Fukuyama and Alexander J. Silenko. Derivation of Generalized Thomas-Bargmann-Michel-Telegdi Equation for a Particle with Electric Dipole Moment. Int. J. Mod. Phys. A, 28(29):1350147, 2013. 1.3 [38] Miguel Furman. Simple Method to Symplectify Matrices. Technical Report SSC-006, SSC Central Design Group/URA, Lawrence Berkeley Lab., Berkeley, CA, 1985. 4.1.2.3 [39] M. Gatchell et al. Commissioning of the DESIREE Storage Rings – a New Facility for Cold Ion-Ion Collisions. J. Phys. Conf. Ser., 488(1):012040, 2014. 1 [40] R. Golub, D. Richardson, and S. K. Lamoreaux. Ultra-Cold Neutrons. CRC Press, New York, NY, 1991. 1.1 [41] Mark J. Gotay and James A. Isenberg. The Symplectization of Science: Symplectic Geometry Lies at the Very Foundations of Physics and Mathematics. Gazette des mathématiciens, 54:59–79, 1992. 1.4 [42] Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, Reading, MA, 1989. 2.2 [43] J. Grange et al. Muon (g-2) Technical Design Report. Design Report FERMILAB-FN-0992-E, Muon g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, January 2015. 1.2, 1.2, 1.2, 6.2.1 315 [44] W. C. Griffith, M. D. Swallows, T. H. Loftus, M. V. Romalis, B. R. Heckel, and E. N. Fortson. Improved Limit on the Permanent Electric Dipole Moment of 199 Hg. Phys. Rev. Lett., 116(16):161601, 2016. 1.1 [45] Greta Guidoboni. Spin Coherence Time Studies for the Storage Ring EDM Search. Ph.D. thesis, Università degli Studi di Ferrara, Ferrara, Italy, 2012. 6.2.1 [46] S. Guiducci. Chromaticity. In CERN Accelerator School: Course on General Accelerator Physics Jyvaskyla, Finland, September 7-18, 1992, pages 191–206, 1992. http://inspirehep.net/record/347563/files/p191.pdf. 6.2.4.4 [47] John L. Gustafson. The End of Error: Unum Computing, volume 24 of Chapman & Hall/CRC Computational Science. Chapman and Hall/CRC, Boca Raton, FL, USA, 2015. A.3 [48] Kaoru Hagiwara, Ruofan Liao, Alan D. Martin, Daisuke Nomura, and Thomas Teubner. (g-2)µ and α(m2z ) Re-evaluated Using New Precise Data. J. Phys. G: Nucl. Part. Phys., 38:085003, 2011. 1.2, 1.1 [49] Thomas Hambye. CP Violation and the Matter–Antimatter Asymmetry of the Universe. C. R. Phys., 13(2):193–203, 2012. 1.1 [50] Mark P. Hertzberg and Johanna Karouby. Generating the Observed Baryon Asymmetry From the Inflaton Field. Phys. Rev. D, 89(6):063523, 2014. 1.1 [51] Robert Hipple and Martin Berz. Implementation of Benchmarks for Precision Tracking in Storage Rings. In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 13–16, Geneva, Switzerland, 2016. JACoW. https://doi.org/10.18429/JACoW-ICAP2015-MODBC3. 5.1 [52] A. Hoecker and W. J. Marciano. The Muon Anomalous Magnetic Moment. Chin. Phys. C, (10):635–638, 2016. 1.2 [53] V. W. Hughes et al. BNL AGS E821: A New Precision Measurement of the Muon (g-2) Value at the Level of 0.35 ppm. Design Report, Brookhaven National Laboratory, Upton, NY, 2nd (revised) printing, Sep. 1995. 1.2, 1.2 [54] N. Ida. Numerical Modeling for Electromagnetic Non-Destructive Evaluation. Chapman & Hall, London, 1995. 2.3.1 [55] ISO/IEC. IS 10303-242:2014 Industrial Automation Systems and Integration – Product Data Representation and Exchange – Part 242: Application Protocol: Managed Model-Based 3D Engineering. International Organization for Standardization, Geneva, Switzerland, 2014. 2.4.1, 1, 3.3.3, 1 [56] John D. Jackson. Classical Electrodynamics. John Wiley & Sons, New York, 3rd edition, 1999. 2.5 [57] Ravi Jagasia. Private communication. 3.3.2 316 [58] C. Kane, J. E. Marsden, and M. Ortiz. Symplectic-Energy-Momentum Preserving Variational Integrators. J. Math. Phys., 40(7):3353–3371, 1999. 4.2.1 [59] D. M. Kara, I. J. Smallman, J. J. Hudson, B. E. Sauer, M. R. Tarbutt, and E. A. Hinds. Measurement of the Electron’s Electric Dipole Moment Using YbF Molecules: Methods and Data Analysis. New J. Phys., 14(10):103051, 2012. 1.1 [60] Frank Kreith and D. Yogi Goswami, editors. The CRC Handbook of Mechanical Engineering, Second Edition. CRC Press, Boca Raton, FL, 2nd edition, 2004. 6.5 [61] F. T. Krogh. Variable Order Integrators for the Numerical Solution of Ordinary Differential Equations. NASA Tech Brief 71-10248, Jet Propulsion Lab., Pasadena, CA, 1971. 1 [62] L. D. Landau and E. M. Lifshitz. Mechanics. Elsevier Butterworth-Heinemann, Oxford, 3rd English edition, 2005. 5.7.2.1, 5.7.2.1 [63] L. D. Landau and E. M. Lifshitz. The Classical Theory of Fields. Elsevier Butterworth-Heinemann, Oxford, 4th English edition, 2010. 5.7.2.2, 3 [64] S. Y. Lee. Accelerator Physics. World Scientific Publishing, Singapore, 3rd edition, 2012. 6.2.4.4 [65] Andreas Lehrach. Searching Electric Dipole Moments in Storage Rings – Challenges, Status and Computational Needs. In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 128–131, Geneva, Switzerland, 2016. JACoW. https://doi.org/10.18429/JACoW-ICAP2015-THAJI1. 1.1, 5.1 [66] W. W. Mackay. Comment on the Healy’s Symplectification Algorithm. Technical Report BNL-75461-2006-CP, Collider-Accelerator Department, Brookhaven National Laboratory, Upton, NY, June 2006. Presented at the 10th Biennial European Particle Accelerator Conference (EPAC), Edinburgh, UK, June 26–30, 2006. 4.1.2 [67] Jan R. Magnus and Heinz Neudecker. Matrix Differential Calculus with Applications in Statistics and Econometrics. John Wiley & Sons, New York, 2nd edition, 1999. 4.1.2.4 [68] Kyoko Makino and Martin Berz. COSY INFINITY Version 9. Nucl. Instr. Meth. Phys. Res. A, 558(1):346–350, 2006. 1.5, 3.2.4, 3.3.7, 6.4.1 [69] Kyoko Makino and Martin Berz. Dynamics in Electrostatic Repetitive Systems via High-Order Transfer Maps. Microsc. Microanal., 21:36, 2015. 5.4 [70] Kyoko Makino, Eremey Valetov, and Martin Berz. Computation of Nonlinear Fields and Orbit and Spin Transfer Maps of Electrostatic Elements Using Differential Algebras. In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12-16 October 2015, number 12 in International Computational Accelerator Physics Conference, pages 168–171, Geneva, Switzerland, Feb. 2016. JACoW. doi:10.18429/JACoW-ICAP2015-THDBC1. 5.3, 5.3 317 [71] Kyoko Makino, Eremey Valetov, and Martin Berz. E989 Note 104: Detailed Linear Optics and Tunes of the g-2 Ring. G-2 Experiment Document GM2-doc-5715, Muon g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, Mar. 2017. 3.3.8 [72] Olli Mali, Pekka Neittaanmaeki, and Sergey Repin. Accuracy Verification Methods : Theory and Algorithms, volume 32 of Computational Methods in Applied Sciences. Springer, Dordrecht, Netherlands, 1st edition, 2014. 2 [73] J. A. Maloney, R. Baartman, T. Planche, and S. Saminathan. Electrostatic Potential Map Modelling with COSY INFINITY. Nucl. Instr. Meth. Phys. Res. B, 376:171–174, 2016. 1.4 [74] Thomas Mannel and Nikolai Uraltsev. Loop-Less Electric Dipole Moment of the Nucleon in the Standard Model. Phys. Rev. D, 85(9):096002, 2012. 1.1 [75] Jerrold E. Marsden. Lectures on Mechanics. Cambridge University Press, Cambridge, 2009. 4.2.1 [76] Edwin M. McMillan. The Synchrotron–A Proposed High Energy Particle Accelerator. Phys. Rev., 68(5-6):143–144, 1945. 6.2.4.1 [77] E. M. Metodiev et al. Analytical Benchmarks for Precision Particle Tracking in Electric and Magnetic Rings. Nucl. Instrum. Methods Phys. Res. A, 797:311–318, 2015. 5.1 [78] E. M. Metodiev, K. L. Huang, Y. K. Semertzidis, and W. M. Morse. Fringe Electric Fields of Flat and Cylindrical Deflectors in Electrostatic Charged Particle Storage Rings. Phys. Rev. ST Accel. Beams, 17(7):074002, 2014. 5.1, 5.6.2.1, 5.9.1, 5.9.2.1, 5.9.2.1, 5.9.2.3, 5.9.5, 5.9.5.1, 5.10 [79] Eric M. Metodiev. Thomas–BMT Equation Generalized to Electric Dipole Moments and Field Gradients, 2015. arXiv:1507.04440. 1.3 [80] Piotr Mikusiínski and Michael D. Taylor. Introduction to Multivariable Analysis from Vector to Manifold. Birkhäuser Basel, Basel, Switzerland, 1 edition, 2002. 4.2.2 [81] Jorge Cortés Monforte. Geometric, Control and Numerical Aspects of Nonholonomic Systems. Springer-Verlag Berlin Heidelberg, Berlin, Heidelberg, 2002. 4.2.1 [82] B. D. Muratori, J. K. Jones, and A. Wolski. Analytical Expressions for Fringe Fields in Multipole Magnets. Phys. Rev. ST Accel. Beams, 18(6):064001, 2015. 1.4 [83] Marcin Patecki and Rogelio Tomás. Effects of Quadrupole Fringe Fields in Final Focus Systems for Linear Colliders. Phys. Rev. ST Accel. Beams, 17(10):101002, 2014. 1.4 [84] J. M. Pendlebury et al. A Revised Experimental Upper Limit on the Electric Dipole Moment of the Neutron. Phys. Rev. D, 82:092003, 2015. 1.1, 6.2.1 [85] Martin Plotkin. The Brookhaven Electron Analogue, 1953–1957. Internal Report BNL-45058, AGS Department, Brookhaven National Laboratory, Upton, NY, Dec. 1991. 1 318 [86] A. D. Polyaanin and A. V. Manzhirov. Handbook of Integral Equations. CRC Press, Boca Raton, Florida, 1998. 2.3.1.1 [87] William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. Numerical Recipes 3rd Edition: The Art of Scientific Computing. Cambridge University Press, New York, NY, 3rd edition, 2007. A.1 [88] N. F. Ramsey. Electric-Dipole Moments of Elementary Particles. Rep. Prog. Phys., 45(1):95–113, 1982. 1.1 [89] Frank Rathmann. Private communication. 1.1, 6.2.1 [90] Frank Rathmann. Spin Physics and Deuteron EDMs in Storage Rings. Presentation, KITP Conference: Symmetry Tests in Nuclei and Atoms, Kavli Institute for Theoretical Physics, University of California, Santa Barbara, CA, Sep. 2016. 6.2.1 [91] Sergey Repin. Lectures on a Posteriori Error Analysis. Lecture notes, University of Saarbrüucken, Saarbrüucken, Germany, 2008. https://www.math.uni-sb.de/ag/fuchs/Menupkte/SB01.pdf. 2 [92] A. D. Sakharov. Violation of CP Invariance, C Asymmetry, and Baryon Asymmetry of the Universe. Pisma Zh. Eksp. Teor. Fiz., 5:32–35, 1967. [Usp. Fiz. Nauk 161, 61–64 (1991)]. 1.1 [93] Yannis K. Semertzidis et al. The Brookhaven Muon (g-2) Storage Ring High Voltage Quadrupoles. Nucl. Instr. Meth. Phys. Res. A, 503(3):458–484, 2003. 3.1 [94] Yurij Senichev. Private communication. 6.2.1, 6.2.3, 6.3.1, 6.3.2.2, 6.3.2.3 [95] Yurij Senichev, Alexander Aksentyev, Stanislav Chekmenev, Jörg Pretz, Serge Andrianov, Andrei Ivanov, Martin Berz, and Eremey Valetov. Quasi-Frozen Spin Concept of Deuteron Storage Ring as an Instrument to Search for the Electric Dipole Moment. In Proc. of International Particle Accelerator Conference (IPAC’17), Copenhagen, Denmark, 14–19 May, 2017, number 8 in International Particle Accelerator Conference, pages 2275–2277, Geneva, Switzerland, May 2017. JACoW. https://doi.org/10.18429/JACoW-IPAC2017-TUPVA084. 6.5.6 [96] Yurij Senichev, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, and Eremey Valetov. Investigation of Lattice for Deuteron EDM Ring. In Proc. of International Computational Accelerator Physics Conference (ICAP’15), Shanghai, China, 12–16 October 2015, pages 17–19, Geneva, Switzerland, 2016. JACoW. https://doi.org/10.18429/JACoW-ICAP2015-MODBC4. 6.3.1, 6.3.2.1, 6.3.2.3 [97] Yurij Senichev, Andrei Ivanov, Andreas Lehrach, Rudolf Maier, Denis Zyuzin, and Serge Andrianov. Spin Tune Decoherence in Multipole Fields. In Proceedings, 5th International Particle Accelerator Conference (IPAC’2014): Dresden, Germany, June 15–20, 2014, pages 3017–3019, Geneva, Switzerland, 2014. JACoW. https://doi.org/10.18429/JACoW-IPAC2014-THPRO062. 6.2.4.3, 6.2.4.4 319 [98] Yurij Senichev, Andreas Lehrach, Bernd Lorentz, Rudolf Maier, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Martin Berz, and Eremey Valetov. Quasi-Frozen Spin Method for EDM Deuteron Search. In Proceedings, 6th International Particle Accelerator Conference (IPAC’2015): Richmond, Virginia, USA, May 3–8, 2015, pages 213–215, Geneva, Switzerland, 2015. JACoW. https://doi.org/10.18429/JACOW-IPAC2015-MOPWA044. 1.1, 6.1, 6.3.2.1, 6.3.2.1, 6.3.2.1, 6.3.2.2 [99] Yurij Senichev, Bernd Lorentz, Serge Andrianov, Andrei Ivanov, Stanislav Chekmenev, Jörg Pretz, Martin Berz, and Eremey Valetov. Systematic Errors Investigation in Frozen and Quasi-Frozen Spin Lattices of Deuteron EDM Ring. In Proceedings, 7th International Particle Accelerator Conference (IPAC’2016): Busan, Korea, May 8–13, 2016, pages 3394–3396, Geneva, Switzerland, 2016. JACoW. https://doi.org/10.18429/JACoW-IPAC2016-THPMR005. 6.5, 6.5.4, 6.5.4, 6.5.4, 6.5.5, 6.5.5, 6.5.6 [100] Yurij Senichev, Rudolf Maier, Denis Zyuzin, and Natalia Kulabukhova. Spin Tune Decoherence Effects in Electro- and Magnetostatic Structures. In Proceedings, 4th International Particle Accelerator Conference (IPAC’2013): Shanghai, China, May 12–17, 2013, pages 2579–2581, Geneva, Switzerland, 2013. JACoW. Program code WEPEA036. 6.2.4.1, 6.2.4.2, 6.2.4.3 [101] Andrei Seryi. Unifying Physics of Accelerators, Lasers and Plasma. CRC Press, London, 2015. 1 [102] M. L. Shashikant, Martin Berz, and Bela Erdélyi. COSY INFINITY’s EXPO Symplectic Tracking for LHC. Inst. Phys. Conf. Ser., 175:299–306, 2005. 5.5 [103] Jing Shu, Tim M. P. Tait, and Carlos E. M. Wagner. Baryogenesis From an Earlier Phase Transition. Phys. Rev. D, 75(6):063510, 2007. 1.1 [104] Mariléne da Silva e Silva. Sensitive Polarimetry in a Search for the Deuteron Electric Dipole Moment. Ph.D. thesis, University of Groningen, Groningen, the Netherlands, 2010. 6.2.1 [105] Orestes N. Stavroudis. The Mathematics of Geometrical and Physical Optics: The k-Function and its Ramifications. Wiley-VCH, Weinheim, Germany, 1st edition, 2006. 1.5 [106] Richard Talman. The Electric Dipole Moment Challenge. Morgan & Claypool Publishers, San Rafael, CA, 2017. 6.2.1 [107] Richard M. Talman and John D. Talman. EDM Planning Using ETEAPOT with a Resurrected AGS Electron Analogue Ring, 2015. arXiv:1503.08494. 1 [108] Lloyd N. Trefethen. Numerical Computation of the Schwarz-Christoffel Transformation. SIAM J. Sci. and Stat. Comput., 1(1):82, 1980. A.2 [109] Eremey Valetov, Martin Berz, and Yurij Senichev. Search for the Optimal Spin Decoherence Effect in a QFS Lattice. In Proceedings, 12th International Computational Accelerator Physics Conference, ICAP2015, page THDBC2, 2016. 6.4.5, 6.4.5 320 [110] V. Veksler. A New Method of Acceleration of Relativistic Particles. J. Phys., 9(3):153–158, 1945. USSR. 6.2.4.1 [111] J. H. Verner. Explicit Runge–Kutta Methods with Estimates of the Local Truncation Error. SIAM J. Numer. Anal., 15(4):772–790, 1978. 5.6 [112] Weishi Wan, Carol Johnstone, Jim Holt, et al. The Influence of Fringe Fields on Particle Dynamics in the Large Hadron Collider. Nucl. Instr. Meth. Phys. Res. A, 427(1):74–78, 1999. 1.4 [113] Helmut Wiedemann. Particle Accelerator Physics. Springer International Publishing, Cham, Switzerland, 2015. 6.2.3, 6.2.4.1 [114] H. Wollnik, J. Brezina, and M. Berz. GIOS-BEAMTRACE – A Program Package to Determine Optical Properties of Intense Ion Beams. Nucl. Instr. Meth. Phys. Res. A, 258(3):408–411, 1987. 5.1, 5.8 [115] Hermann Wollnik and Martin Berz. Relations Between Elements of Transfer Matrices Due to the Condition of Symplecticity. Nucl. Instr. Meth. Phys. Res. A, 238(1):127–140, 1985. 5.8.3 [116] Wanwei Wu. 3D Electric Field Map From Opera 3D. G-2 Experiment Document GM2-doc-4490, Muon g-2 Collaboration, Fermi National Accelerator Laboratory, Batavia, IL, Oct. 2016. VC/BD/Ring Meeting held on 27 Oct 2016. 3.1, 3.3.8 [117] Ge Zhong and Jerrold E. Marsden. Lie–Poisson Hamilton–Jacobi Theory and Lie–Poisson Integrators. Phys. Lett. A, 133(3):134–139, 1988. 1.4, 4.2.1 321