Beam losses along the ESS LINAC due to nonlinear e ects ...

107
Beam losses along the ESS LINAC due to nonlinear effects - A Statistical review Alexander Lauge Pedersen A thesis presented for the degree of Master of Science in Engineering - Engineering Physics Centre for Mathematical Sciences Lund University, LTH, in collaboration with the European Spallation Source Sweden 2016-12-21

Transcript of Beam losses along the ESS LINAC due to nonlinear e ects ...

Page 1: Beam losses along the ESS LINAC due to nonlinear e ects ...

Beam losses along the ESS LINAC due to nonlinear effects

- A Statistical review

Alexander Lauge Pedersen

A thesis presented for the degree ofMaster of Science in Engineering - Engineering Physics

Centre for Mathematical SciencesLund University, LTH, in collaboration with the European Spallation

SourceSweden

2016-12-21

Page 2: Beam losses along the ESS LINAC due to nonlinear e ects ...

Abstract

In this project, a comprehensive statistical review is done regarding beamdistribution evolution and losses of protons in the ESS LINAC. It aims toclarify some unanswered questions regarding the change in the distribution asit evolves through the LINAC and how sudden changes can effect the lossesof protons downstream. The correlation between the sub phase-spaces wereremoved to be able to study the nonlinear forces acting on the distribution.Several statistical tools were used to analyse these distributions and visualizethem in a comprehensive manner. Furthermore, this report aims to give anoverview of the maximum losses that one may expect in the current latticeconfiguration in the ESS LINAC. An EVT (Extreme Value Theory) approachwas used to model these extreme losses to highlight extreme scenarios in theLINAC. Many interesting features arise regarding the distribution evolutionwhich can be confirmed in theory and the maximum losses could be regardedas within the limit set by the ESS design report. The results illustrates thatchanges in the distribution can be found with the KS-test and can act com-plementary to the tools used by the physicists today, with a little refinements.Furthermore, the GMM may indicate that the distributions are multimodal,thus opening the questions around the interpretation of the moments of thedistributions and their relation to the tools used for analysis. The EVT ap-proach showed that no concern is needed regarding the exceedances of theproposed highest limit of losses, 1 W/m. In conclusion, the report highlightsstatistical tools for beam monitoring and further research in this subject maybe of scientific interest.

Keywords: ESS, Beam Physics, linac, Linear Accelerator, High in-tensity lincas, particle distributions, statistics, Kolmogorov-Smirnovtests, mathematics, Monte Carlo, EVT, GEV, TraceWin, ParticleSimulation

Page 3: Beam losses along the ESS LINAC due to nonlinear e ects ...

Contents

1 Acknowledgements 1

2 Introduction 22.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2 Project specification . . . . . . . . . . . . . . . . . . . . . . . 32.3 Thesis outline . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 European Spallation Source 53.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.2 The Accelerator . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.2.1 The LINAC configuration . . . . . . . . . . . . . . . . 63.3 Lattice in simulation . . . . . . . . . . . . . . . . . . . . . . . 9

3.3.1 The FODO - lattice . . . . . . . . . . . . . . . . . . . . 93.3.2 The realistic lattice - periodic approach . . . . . . . . . 103.3.3 The realistic approach . . . . . . . . . . . . . . . . . . 11

4 Theory 124.1 Basic Accelerator Physics . . . . . . . . . . . . . . . . . . . . 12

4.1.1 The equation of motion - single particle . . . . . . . . . 124.1.2 The coordinate system and Hill’s equation - Transverse

dynamics . . . . . . . . . . . . . . . . . . . . . . . . . 154.1.3 Longitudinal dynamics . . . . . . . . . . . . . . . . . . 234.1.4 Multiparticle view - the beam . . . . . . . . . . . . . . 23

4.2 Fundamental statistics . . . . . . . . . . . . . . . . . . . . . . 314.2.1 Hypothesis testing . . . . . . . . . . . . . . . . . . . . 324.2.2 Parametric tests . . . . . . . . . . . . . . . . . . . . . . 334.2.3 Non-parametric tests . . . . . . . . . . . . . . . . . . . 344.2.4 Parameter estimation - Maximum likelihood . . . . . . 37

i

Page 4: Beam losses along the ESS LINAC due to nonlinear e ects ...

4.2.5 Finite Mixture Models - the Gaussian fit . . . . . . . . 374.2.6 The EM-algorithm . . . . . . . . . . . . . . . . . . . . 414.2.7 The randomness . . . . . . . . . . . . . . . . . . . . . . 424.2.8 Extreme Value Theory . . . . . . . . . . . . . . . . . . 424.2.9 Profile likelihood . . . . . . . . . . . . . . . . . . . . . 454.2.10 Empirical bootstrapping . . . . . . . . . . . . . . . . . 46

5 Method 505.1 Design of the lattice . . . . . . . . . . . . . . . . . . . . . . . 505.2 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.2.1 TraceWin . . . . . . . . . . . . . . . . . . . . . . . . . 515.2.2 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . 525.2.3 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.3 The scientific approach . . . . . . . . . . . . . . . . . . . . . . 52

6 Results 546.1 Courant-Snyder parameter calculations . . . . . . . . . . . . . 54

6.1.1 FODO lattice . . . . . . . . . . . . . . . . . . . . . . . 546.1.2 The “real” lattice . . . . . . . . . . . . . . . . . . . . . 57

6.2 Kolmogorov-Smirnov tests . . . . . . . . . . . . . . . . . . . . 586.2.1 The periodic FODO-lattice . . . . . . . . . . . . . . . . 586.2.2 The “real” lattice . . . . . . . . . . . . . . . . . . . . . 60

6.3 Statistical model . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1 The Gaussian Mixture Model . . . . . . . . . . . . . . 71

6.4 EVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726.4.1 General statistics of the sections in the ESS LINAC . . 726.4.2 The GEV model . . . . . . . . . . . . . . . . . . . . . 74

7 Discussion 787.1 Distribution analysis . . . . . . . . . . . . . . . . . . . . . . . 787.2 The Gaussian input . . . . . . . . . . . . . . . . . . . . . . . . 797.3 Gaussian mixture model . . . . . . . . . . . . . . . . . . . . . 807.4 Extreme Value Theory . . . . . . . . . . . . . . . . . . . . . . 817.5 Further research . . . . . . . . . . . . . . . . . . . . . . . . . . 82

8 Appendix A - TraceWin 848.1 Elements and error options . . . . . . . . . . . . . . . . . . . . 858.2 User interface for analysis . . . . . . . . . . . . . . . . . . . . 85

ii

Page 5: Beam losses along the ESS LINAC due to nonlinear e ects ...

8.3 Computation routine - PARTRAN . . . . . . . . . . . . . . . 86

9 Apendix B - matLab 879.1 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879.2 The statistical toolbox . . . . . . . . . . . . . . . . . . . . . . 87

10 Appendix C - Code 8910.1 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

10.1.1 Twiss (Courant-Snyder) calculations . . . . . . . . . . 8910.1.2 Distribution analysis . . . . . . . . . . . . . . . . . . . 9310.1.3 EVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

iii

Page 6: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 1

Acknowledgements

I would first like to thank my thesis advisors Dragi Anevski (LTH), Moham-mad Eshraqi (ESS) and Ryoichi Miyamoto (ESS). The office and all of theoffice supplies provided by ESS gave me a privileged situation to work from.The presence of my supervisors has been very comforting throughout theproject and I am very grateful for the huge amount of space I was given topursue the subjects I found interesting.

Finally, I can not enough emphasize the gratitude I hold for Emilia, mybethrothed, and her unfailing support and continuous encouragement through-out my years at LTH. The patience and understanding, when I spent daysand nights studying, has been invaluable to me and for that, I will be evergrateful. Thank you!

The author

Alexander Lauge Pedersen

1

Page 7: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 2

Introduction

2.1 Motivation

The European Spallation Source, ESS, is the future leader in Neutron-scienceand the most intense neutron source in the world with its 2.0 GeV protonsproducing 5 MW of power. These protons can be lost along the LINAC dueto non-linear forces and may cause damage on electrical components and/orcause radiation. The radiation caused by the loss of protons complicateshands-on maintenance and the mitigation of lost protons becomes a priority[22]. The beam physics group within the accelerator division simulates theaccelerator using TraceWin [25] and studies the impact of unknown errorsthat might occur as a result of the sensitivity of the system to internal andexternal factors. This is done by introducing static (mostly caused by internalfactors) and dynamic (mostly external factors) errors like miss-alignments inthe location of the quadrupoles (QPs) and/or degradation in the electricalfields within the accelerating cavities. This problem is highly prioritised andthus simulations before commissioning are important in order to understandhow, why and where losses are concentrated and how to mitigate them inan effective manner. Many scientists and engineers are currently workingon how to identify these losses and many simulations are made in order tounderstand the physics behind the deviating protons and the requirementsfor keeping them at a controllable level. Much research is done in this areaand specially in-house research at ESS and other accelerator facilities [19,

2

Page 8: Beam losses along the ESS LINAC due to nonlinear e ects ...

22]. These simulations constitutes the foundation for the specifications whichare sent to the in-kind partners and manufacturers for development of thedifferent elements in the LINAC.

2.2 Project specification

One objective of the project is to adopt statistical methods to analyse theparticle distributions and losses along the LINAC. The aim is to analyse sta-tistical properties of the particle distributions that can be connected to lossesof protons in the accelerator. The delimitations are formulated to keep theproject within a reasonable time frame. The study of the evolution of theparticles are done on a simple FODO-lattice first, to provide an understand-ing of the dynamics of the beam propagation. Next, a more realistic latticeare considered from the MEBT-HB to illustrate the part of the acceleratorwhere the majority of the acceleration is done. For the EVT approach, theproject is delimited to study the losses in the whole LINAC and the lossesin the MEBT. The distortion of the particle distribution affects the numberof particles located in critical areas of the distribution subjected to the riskof getting lost. Starting from a simple lattice, where the outcome is known,statistical tests are used to determine whether a distribution at certain loca-tions are what would be expected to a certain degree of certainty. Differentlattices and different input distributions are used to create a full picture ofthe evolution of the particle distributions. Furthermore, a Gaussian MixtureModel (GMM) approach is adopted to study if it is possible to parametrisethe distribution evolution and to identify critical parts of the acceleratorand couple them to the behavior of the parameters (and compare to theCourant-Snyder parameters) but also to see if one can find multiple modesis the distribution. Another objective is to model the extreme losses to beable to say something about the ´´worst case scenario” in terms of losses andcompare the results with the limits set by ESS. With the help from the BeamPhysics Group, a data set containing information of 20000 different simula-tions where errors are introduced to create a more lifelike machine are usedto study the amount of losses along the LINAC. These errors are randomlyintroduced under certain restrictions which produces stochastic variabilityin the outcome. This allows for a parametric Generalised Extreme Value(GEV) approach where information of the extreme values of the losses are

3

Page 9: Beam losses along the ESS LINAC due to nonlinear e ects ...

given. An empirical approach is also done and fundamental statistical toolsare used to extract information of the losses in the LINAC.

2.3 Thesis outline

Chapter 3 gives an introduction to the ESS project and puts weight on theLINAC (LINear ACcelerator) configuration with the purpose of introducingthe reader to the structure and layout of the accelerator. Each part of theLINAC is explained to provide an overall view of the LINAC structure. Fur-thermore, the FODO-lattice (FOcus and DefOcus) is introduced along whatthe author means with the “realistic lattice”.Chapter 4 presents the relevanttheory and because the sheer size of the project spans over a huge area,much information and many methods are presented to enfold the spread ofthe problem. First, the relevant physics are presented to introduce the readerto the concepts often used in the accelerator community. Next, the statis-tics relevant for the project is presented to knit the theory section together.In chapter 5, the method which the author assumes is presented with thepurpose of spreading light on the approach which has been taken during theproject. Explanation of how the experiments are conducted and analysed forreplicating studies. The author describes the lattice design which is used inthe project and which demarcations that are done. The software utilities areintroduced and explained and lastly, a schematic over the scientific approachis presented. Chapter 6 contains the results from the simulations and calcu-lations and shall serve as an apparent and visual end product of the projectto ease the comprehension and connection to the latter discussion in chapter7. In this chapter, the results are discussed with the support from theory andthe reader is guided through the arguments and conclusions of the author.The appendices presents a brief introduction to TraceWin and MATLAB toensure the reader the best possible comprehension of the project and the ap-proach it takes. Also some code, subjectively regarded as the most importantcode by the author, will be presented. The whole set of scripts produced inthis project, apart from the TraceWin-code, will be available if asked for.

4

Page 10: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 3

European Spallation Source

3.1 Overview

The European Spallation Source (ESS) is to be the leading research facilityfor frontier neutron science and is currently under construction in Lund,Sweden. The planned construction completion year is 2018 when the actualcommissioning of the beam will start. By 2019 the facility shall be able toproduce a 570 MeV proton beam on target. The site will hold a 600 meterlong linear accelerator producing a bunched 62.5 mA proton beam of 2.0 GeVreleasing 5 MW onto a Tungsten target. In this process, called spallation (seeFigure 3.1), neutrons will be extracted for researchpurposes [22]. The machine will work complementary to X-rays and thereforeto MAX IV. Both will form a strong and steadfast stronghold for a vastvariety of scientific disciplines.

3.2 The Accelerator

The accelerator, seen in Figure 3.2, consists of different sections with theinstrumentation to accelerate the protons in a controlled manner. The accel-erator is divided into a “warm” and a “cold” section. The “cold” sections areimmersed in liquid helium and hold a temperature of 2 K. These supercon-

5

Page 11: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 3.1: A schematic of the spallation process

ductive cavities, with low electrical resistance allow for high fields withoutloosing energy in the cavity walls. The cavities can store energy with verylow loss and with a narrow bandwidth.

Figure 3.2: The schematic figure of the linear accelerator at ESS [22].

3.2.1 The LINAC configuration

The parts of the ESS LINAC seen in Figure 3.2 are explained shortly below.

The Ion source

This is where the protons are produced by a pulsed microwave-discharge ionsource. It is capable of producing at least a 70 mA proton current and injectthem into the low energy beam transport (LEBT).

6

Page 12: Beam losses along the ESS LINAC due to nonlinear e ects ...

LEBT

The Low Energy Beam Transport serves as the transport between the ionsource and the radio frequenc quarupole (RFQ). The beam must be sharplyfocused to the entrance of the RFQ for good transmission. To avoid therepelling force of the proton space-charge, some neutralization is done byionisation of the residual gas in the LEBT. This is to prevent beam “blow-up” and consequently emittance blow-up (which is dealt with later in thereport). The focusing elements in this section are two solenoid magnets.The beam is also given its appropriate pulse length by the chopper.

RFQ

The Radio Frequency Quadrupole is a multifunctional element that bunches,focuses and accelerates the proton beam. Certain requirements must hold toachieve a high quality beam in the rest of the accelerator. These requirementsare the model parameter for the construction of a four-vane RFQ1.

MEBT

In the MEBT (Medium Energy Beam Transport) the beam is focused andmatched to the downstream DTL (Drift Tube LINAC), also the MEBT iscollimating the transverse beam distribution for better beam quality and ithas faster choppers than the LEBT to further assure that the beam bunchis “clean” 2on both sides. The number, strength and the location of thedifferent buncher-cavities also assures that the bunch length is long enoughto avoid high space charge forces. It is an optimization between differentfactors affecting the beam quality and to guide the beam through the physicalapertures present in the MEBT. But, the ESS MEBT shall work fine withlow losses as a result of a fairly low emittance growth and beam halo. In theLEBT there is need for space charge compensation but this is not necessaryin the MEBT as the energy of the particles itself generates a magnetic fieldthat reduces the space-charge effect, due to relativistic effects

1The four-vane RFQ is a combined accelerating and focusing device [27].

7

Page 13: Beam losses along the ESS LINAC due to nonlinear e ects ...

(see equation 4.55).

DTL

The drift tube LINAC (DTL) has a FODO configuration with acceleratingcavities in between the focusing elements accelerating the proton beam from3.62 - 90 MeV while having transverse focusing to prevent high emittancegrowth as seen in Figure 3.3.

Figure 3.3: Emittance evolution in the MEBT and DTL [22].

Superconducting linac

The acceleration to the design energy value of 2.0 GeV is done in the super-conducting section consisting of double spoke-cavities, medium-β ellipticalcavities and high-β elliptical cavities. This high-energy beam is transportedto the High energy beam transport (HEBT).

HEBT

The High Energy Beam Transport has a variety of purposes. Its main purposeis to guide the beam to the rotating tungsten target for the spallation process,

2With “clean” the author means that the proton pulse is near that of a step-functionin time. As short rise time as possible is desirable.

8

Page 14: Beam losses along the ESS LINAC due to nonlinear e ects ...

but also to preserve the transverse size of the beam, instrumentation formonitoring and room for an eventual energy upgrade. Two bending dipolemagnets guide the beam up a slope to the target level (see figure 3.4) of theconstruction and the quadrupole (QP) magnets expand the beam and 4 pairsof AC dipoles (raster magnets), paint the surface of the target.

Figure 3.4: The slope of the linac before the target [22].

3.3 Lattice in simulation

The lattice considered in this report is the MEBT to Target section (seeFigure 3.2) because it is only at these energies the losses of protons willcause radiation. Therefore, the losses at the section mentioned are morecrucial as they affect the hands-on maintenance of the machine and thereforemay reduce the availability of the machine [22].

3.3.1 The FODO - lattice

A focusing - defocusing lattice (FODO - lattice) is a periodic structure builtup by consecutive focusing and de-focusing elements (like QPs). These struc-tures are used in, for example the DTL, to reduce the beam size of the protonbeam [26]. To get an understanding of the impact of the accelerating and

9

Page 15: Beam losses along the ESS LINAC due to nonlinear e ects ...

focusing elements in the LINAC, the first lattice to be studied is the FODO-lattice consisting of 100 periods of FODO-cells [26](as seen in Figure 3.5).When the beam travels through the elements of the FODO-lattice, the ori-entation and correlation of the proton beam varies as they are focused in thedifferent transverse planes, as shown in Figure 3.5.

Figure 3.5: The FODO structure. The top picture represents several particletrajectories and the bottom picture illustrates how the beam, confining alltrajectories evolves.

Using TraceWin, the travel of 60000 particles is simulated in two scenarios:with the space-charge effect and without the space charge effect (the spacecharge-effect is explained in section 4.1.4). This is to see the effect of the non-linear forces on critical beam parameters along the LINAC that are correlatedwith losses [27].

3.3.2 The realistic lattice - periodic approach

The next step is to look at a more realistic lattice that is used at ESS tosimulate the ESS LINAC. With knowledge of the effects of the space chargeand other beam parameters one can transfer this to a more complicated case.The lattice now resembles the actual lattice that ESS is using for simulation.A first step is to look at how the distributions change for every period. In theideal case, the statistical distributions at each period shall be the same, butdue to the circumstances told in the previous section this is not always thecase, at least not in a statistical sense. These changes in the distribution tail

10

Page 16: Beam losses along the ESS LINAC due to nonlinear e ects ...

or halo can cause losses in the long run and they are therefore interesting.

3.3.3 The realistic approach

The last step is to view the whole lattice at each element to resemble thereality as good as possible. The change of distribution at the periodic in-stances can be caused by displacements and inefficiencies in the acceleratorelements or the effect of the non-linear parts of the space charge effects thatis not completely corrected for. This approach gives an opportunity to followthe beam parameters, both physical and statistical, and might help identifythe parameters changes that may cause losses.

11

Page 17: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 4

Theory

4.1 Basic Accelerator Physics

To better understand the properties of the proton beam along the linearaccelerator, the author gives an overview of some fundamental acceleratorphysics. The beam physics needed to comprehend the mechanics of beamtransportation is dealt with in this section and the different effects that mayaffect the beam motion through the LINAC.

4.1.1 The equation of motion - single particle

Two basic elements that are used to guide the protons from point A to Bin a straight path are the quadrupole (QP) magnets and the acceleratingradio-frequency (RF) cavities (as illustrated in Figure 4.1 and 4.2). Theseelements are essential in the guidance of the protons along the accelerator.In the RF-cavities the protons are exposed to an altering electric field thataccelerates the protons. A challenge is to synchronize the phase of the electricfield in time to the arrival of the protons, as described in Figure 4.2. Thegoal is to keep the protons accelerating, but depending on the arrival of thedifferent protons in the proton bunch they “see” different fields. This willcause oscillations in the longitudinal motion around the synchronous particle

12

Page 18: Beam losses along the ESS LINAC due to nonlinear e ects ...

1. The magnetic field in Figure 4.1b is responsible for the focusing of theproton beam in the transverse planes. Because of the nature of the QP 2,one can assume the field in the longitudinal plane, therefore the center ofthe magnet to be zero. With the “right-hand rule” one can convince oneselfthat the QP acts as a focusing magnet in one of the transverse planes andde-focusing in the other. A rotation of 90 degrees changes the focusing to thealternative transverse plane. The overall focusing of the beam in a FODO-structure comes from the thin lens approximation of the QP. If we considerone concave (with focal length f1) and one convex (with focal length f2) lensthen the basic optics states that

1

fT=

1

f1

+1

f2

(4.1)

and if

f1 = −(f2 + const) (4.2)

where 0 ≤ const < epsilon for some small epsilon. Then

1

fT= − 1

f2 + const+

1

f2

=f2 + c− f2

f2(f2 + const)=

c

f2(f2 + const)(4.3)

and fT > 0, meaning a net focusing effect of the structure. The acceleratingforce on the proton in an electrical field is given by the well known equation(4.8). Of course, these elements can take many appearances but to derivethe general equation of motion for the particles, there is need for a generalapproach. The equations of motion will be derived using Newton’s secondlaw together with the Lorentz force equation, i.e equations (4.4) and (4.5)below, cf. [27]. These equations build a foundation for the derivation of themotion of the particle along the accelerator.

13

Page 19: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The time altering RF-field.

(b) The field lines of the QPs.

Figure 4.1: Two of the main elements of an accelerator

F = m · a (4.4)

F =dP

dt= q · (E + v ×B) (4.5)

The components of the magnetic of the magnetic field in the transverse planesare given by

Bx = K · y +B0y (4.6)

By = K · x+B0x (4.7)

where K is the field gradient representing the strength of the magnetic fieldat different displacements in different directions (eg. Kx = dBz

dx) and the B0n

- terms are residual fields from the magnetic pole expansion. The force on acharge particle in an electric field is given by

2The synchonous particle is the particle that arrives at the point which provides thedesired acceleration and is located on the ideal trajectory around the accelerator. It is tobe noted that this particle may not exist as a physical particle but still provides a referenceto the particles in the beam [26].

2In a perfect magnet the field will not produce a gradient in the longitudinal directionif perfectly aligned in the transverse directions. Of course, in reality, there might be aslight tilt of the quadrupole or some imperfections in the field that causes field gradientsin the longitudinal directions, causing undesired focusing.

14

Page 20: Beam losses along the ESS LINAC due to nonlinear e ects ...

F = q · E (4.8)

(a) An example of a QP.(b) An example of a RF-cavity.

Figure 4.2: Two of the main elements of an accelerator.

4.1.2 The coordinate system and Hill’s equation - Trans-verse dynamics

Assuming that all motions are on a curved trajectory (with the special caseof a straight path when the radius, ρ → ∞) a local coordinate system canbe introduced3, as seen in Figure 4.3. The local coordinate system alwaysfollows the trajectory of the ideal particle. As the angle, θ, varies the coordi-nate system transforms, as Figure 4.3 and equations (4.9) ,(4.10) and (4.11)illustrate.

Figure 4.3: Local coordinate system.

3Note that the reference trajectory doesn’t have to be on a plane, but can very well belocated in 3D-space as well.

15

Page 21: Beam losses along the ESS LINAC due to nonlinear e ects ...

One can convince oneself that if some coordinates varies, the following con-ditions and relations hold

∆ux = ∆θ · us (4.9)

∆us = −∆θ · ux (4.10)

∆uy = 0 (4.11)

This explains how the local coordinate system changes and how they areexpressed in terms of each other. But, to fully express the characteristicsof the moving particle there is need to explain the time changing propertieswith the time derivatives [27]

duxdt

=dusdθ· dθdt

= θus (4.12)

dusdt

=dusdθ· dθdt

= −θux (4.13)

duydt

=duydθ· dθdt

= 0 (4.14)

The velocity of the particle can be expressed as the time derivative of itsposition R, as

R = rux + yuy (4.15)

dR

dt= rux + rux + yuy + yuy = rux + rθus + yuy (4.16)

d2R

dt2= rux+ rux+ rθus+rθus+rθus+ yuy = ux(r−rθ2)+us(2rθ+rθ)+ yuy

(4.17)

The acceleration can be inserted into equation (4.5) and the Lorentz force iscalculated as follows ( the magnetic force, when E = 0)

qv×B = q

∣∣∣∣∣∣1 2 3vx vs vyBx Bs By

∣∣∣∣∣∣ = q[−rθBy+yBs,−yBx+rBy,−rBs+rθBx] (4.18)

16

Page 22: Beam losses along the ESS LINAC due to nonlinear e ects ...

Assuming the magnetic field in s-direction zero, Bs = 0 implies

ux : m(r − rθ2) = qrθBy (4.19)

us : m(2rθ + rθ) = q(yBx − rBy) (4.20)

uy : my = q(−rθBx) (4.21)

Now, introduce r = ρ + x where x is the deviation from the ideal path andconsider only the horizontal, x-plane, and look at the so called Betatron, ortransverse motion [26, 27]. For a general approach we can look at the motionof the particle in a general magnetic field, composed of both a dipole and aquadrupole field

By = B0 − kx (4.22)

Bx = −kz (4.23)

and as one of the conventions within the accelerator business, and the oneused in the simulation program TraceWin, the equations of motion are con-verted into describing the behaviour in space, i.e, s = v·t. This leads to achange in coordinates as follows:

r = x = dx

dt= dx

dsdsdt

= x′v

r = x = x′′v2

y = y′′v2

(4.24)

Introduce rθ = rω ≈ v and insert this into equation (4.19), the equations ofmotion are transformed into

{m(x′′v2 − v2

r) = qv(B0 − kx)

mz′′v2 = qvKy⇒

{x′′ = 1

r+ qB0

mv− ek

mvx

y′′ = qkmvy

(4.25)

As the deviations from the ideal path is small in relation to the radius, ρ, i.eρ >> x, we can use the Taylor-series expansion of 1

r= 1

ρ+xaround x = 0 as

17

Page 23: Beam losses along the ESS LINAC due to nonlinear e ects ...

f(x) =1

ρ+ x≈ f(0) +

f ′(0)

1!+O(x2) =

1

ρ(1− x

ρ) (4.26)

As mv = p and p = p0 +∆ p,

f(∆p) =1

p0 + ∆p≈ f(0) +

f ′(0)

1!+O(∆p2) =

1

p0

(1− ∆p

p0

) (4.27)

The equations of motion can be written, defining the normalized magnetstrength k = - qk

mv {x′′ − (k − 1

ρ2)x = 1

ρ∆pp0

y′′ + ky = 0(4.28)

Or more general if we consider the x-plane

x′′ +K(s)x =1

ρ

∆p

p0

(4.29)

This is considered the general case because if the particle is entering a dipole,k = 0, and if the particle is entering a quadrupole, then ρ = ∞ as it is forthe linear accelerator in general since it is a straight path. In general, K(s) isconstant within each element. This is approximately true for the transverse,Betatron, motion. But since Maxwells equations [9] show focusing and de-focusing effects on the particles within the accelerating cavities (see equation(4.30)) K(s) can not be entirely constant within each elements [28, 9].

∇ · E = 0⇒ ∂Ex∂x

+∂Ey∂y

+∂Ez∂z

= 0 (4.30)

18

Page 24: Beam losses along the ESS LINAC due to nonlinear e ects ...

Because the acceleration can be controlled, the ∂E∂z

> 0 is advantageousforcing the other components to be negative, and therefore de-focusing theparticles in the transverse motion, as equation (4.30) show. So, solving thehomogeneous part of the differential equation should serve as enough forthis application. Since K(s) is changing within the accelerator (discretelydependent on the element in which it is moving) there are many solutions tothe Hill’s equation. To make an example, the solution to Hill’s equation willbe one for the drift spaces and the QPs with regard to the transverse motionof the particle, but naturally, the equation can be solved for every element inthe LINAC. So, if the particle is moving in a drift space, no external forcesare acting on it (i.e K(S)=0) and thus the equation to be solved for is

d2x

ds2= 0 (4.31)

since K(s) is dependent on the magnetic gradient. Intuitively, one can solvethe problem like this (for a small inclination angle of x′1)

{x2 = x1 + lx′1x′2 = x′1

(4.32)

and form a matrix representation

[x2

x′2

]=

[1 l0 1

] [x1

x′1

]. (4.33)

If, on the other hand, the particle is moving within a quadrupole there isan external force acting on the particle described as the Lorentz force. Theequation to be solved is now (if one considers the homogeneous part)

x′′ +K(s)x = 0 (4.34)

which resembles that of a harmonic oscillator if it is assumed that the latticeis periodic in nature (i.e. K(s)=K(s+L)) [26]. The solution to this equationis well known and with initial values [x0,x′0]’ = [A,B]’, the solution looks like

19

Page 25: Beam losses along the ESS LINAC due to nonlinear e ects ...

x1(s) = Acos(√K(s)s) +B(

1√K(s)

)sin(√Ks) (4.35)

defining the size of the envelope in which the particle has its Betatron motion(see multiparticle section) [27, 26, 28].

This is true if K(s) = K > 0. If K < 0, then the solution contains thehyperbolic functions instead of the trigonometric ones for this specific case.Now, it is possible to track a single particle through the accelerator (if one canobtain knowledge of the parameters of each element within the accelerator)with the so called tracking matrix, M. This is true only for the linear part ofthe forces [27].

[x2

x′2

]=

[cos(√Ks) ( 1√

k)sin(

√Ks)

−√Ksin(

√Ks) cos(

√Ks)

][x1

x′1

]⇒ X2 = MX1 (4.36)

If√|K|l → 0 when

√|K|l is finite, one can consider the thin lens approx-

imation as a reasonably good approximation of the quadrupole magnet, asstated below

[x2

x′2

]=

[1 0± 1f

1

] [x1

x′1

](4.37)

where f = 1|K|l ≈

1B

denotes the focal length of the thin lens, reminiscent ofthe basic optics seen in Figure 4.4.

As noted, dependent on the element in which the particle travels, this matrixchanges. Since the operations are all linear (in this case) one can track theparticle along the accelerator by just multiplying the tracking matrices asfollows [26, 27].

Xn = Mquad ·Mdip ·Mdrift · ..... ·X0 (4.38)

But if the RF-defocusing effect is included in the model there must be anotherterm

20

Page 26: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 4.4: A illustrative picture of the convex and the concave lenses as ananalogue to the focusing and defocusing quadrupoles.

x′′ +K(s)− ql02x = 0 (4.39)

Now, as the solution to equation (4.34) suggests, the solution can be writtenin the form

{x(s) = A(s)cos(φ(s)− φ0)

x′(s) = A′(s)cos(φ(s)− φ0)− A(s)φ′ssin(φs − φ0)(4.40)

A convenient convention in the field of accelerator physics is to introduce A(s)=√εβ(s) and equation (4.40) is one way to represent an ellipse 4. With the

defined mathematical relations [28]

4A normalization can be done to remove the correlation between the two phase-spaceplanes by the simple variable change:{

x = x√βtwiss·βrel

p = αx+βx′√βtwiss·βrel

(4.41)

Along with the definitions in equation (4.42) one can show that the two planes are effi-ciently de-correlated which leads to a circular distribution instead of the altering ellipse

21

Page 27: Beam losses along the ESS LINAC due to nonlinear e ects ...

φ′ = 1

β

α = −β′

2

γ = 1+α2

β

(4.42)

These parameters are called the Courant-Snyder parameters (or Twiss pa-rameters). The following, well known as an ellipse can be established

γx2 + 2αxx′ + βx′2 = ε (4.43)

where ε is called the emittance.

Figure 4.5: The figure is a graphic representation of equation 4.43.

As seen in equation (4.40)√εβ(s) represents the amplitude of the motion

and if there are no non-linear forces acting on the particle the emittance staysconstant throughout the machine [27, 26, 28]. The correlation, described byα is visualized by the tilt of the ellipse in Figure 4.43.

see in Figure 4.5. Deviding with βtwiss and βrel eliminates the effect of the increasingor decreasing beam envelope and the change in the distributions due to the relativisticincrease in velocity.

22

Page 28: Beam losses along the ESS LINAC due to nonlinear e ects ...

4.1.3 Longitudinal dynamics

Now, how about the movement in the longitudinal, s-direction? Well, asmentioned before, the ESS facility intend to use different forms of accelerat-ing cavities to accelerate the proton beam in a straight path. An RF-fieldsupplies the cavities with an oscillating electrical field, which intends to ac-celerate the protons. This oscillating field has an oscillating frequency which,dependent on orientation at the arrival time of the proton, will accelerate orde-accelerate the particle. So, the acceleration is dependent on the phase, φ,of the particle in relation to the orientation of the field. The ESS LINACwill facilitate protons of velocities as high as 96 % of speed of light, meaningthere will be relativistic effects at the high energetic areas of the LINAC(HEBT-Target) affecting the beam.

4.1.4 Multiparticle view - the beam

What happens if more particles are introduced? Now, the simple trajectoryof the single particle is not enough to describe the motion of millions ofparticles. There is need for a conceptualization to model the travel of theparticle beam.

Particle distribution

As explained in the single-particle section of this report, the motion of theparticles in the different phase-spaces can be characterized as elliptical. Now,consider a bunch of 109 (see equation (4.58) and Figure 4.7) particles confinedin a small spatial area, all moving in their individual ellipses. These particlesform a distribution in 6D phase-space that evolves through the accelerator.The form of the distribution is crucial for prediction of losses and the particlesthat fall far out in the outer region of the distribution, either in the tail or thehalo, explained in a later section, risk getting lost along the way producingradiation in the accelerator wall which complicates hands-on maintenance[26, 29].

23

Page 29: Beam losses along the ESS LINAC due to nonlinear e ects ...

Envelope function

A way to represent the size of the beam is to look at the RMS (root meansquare) size of the beam envelope confining the particle trajectories. This canbe done for all the subphase-spaces and indicates the actual beam size andforms an important visual representation of the beam. For example, if weassume/consider a Gaussian profile of the transverse beam, then the varianceof the locations of all particles in relation to its ideal orbit corresponds tothe variance [27, 29].

V ar[X] = E[X2]− E[X]2 ≈ E[X2] (4.44)

where it is assumed that E[X] is small and therefore E[X]2 is neglected wherethe second moment E[X2] is estimated by the population version of it, calledthe RMS (Root Mean Square)

xRMS =

√√√√ 1

N(N∑n=1

x2n) (4.45)

and the corresponding for the y and s - coordinates.

The distribution Matrix

Assuming Gaussian distributed particles one can parametrise the beam us-ing the variance of the position and angle from the ideal one and the meanvalue of the same. With equation (4.43) the Courant-Snyder equation canbe reformulated as a matrix equation [29]

XTT−1X = ε where T =

[β −α−α γ

](4.46)

where the Courant-Snyder parameters are defined as

24

Page 30: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 4.6: The figure is a representation of the calculated RMS size(beam envelope) for 106 particles within the MEBT section simulated withTraceWin.

XTΣ−1X =[x x′

] [σ11 σ21

σ12 σ22

]−1 [xx′

]= 1 (4.47)

which means that

XTΣX = det(Σ) = ε2 (4.48)

where σ11, σ12, σ21 and σ22 correspond to the variance and covariances incase of Gaussian distributed particles. The sigma-matrix, Σ, is then thecovariance matrix, but this matrix is used even for non-Gaussian distributedparticles and is called the distribution matrix (most particle distributionsin the phase-space are Gaussian bell like [29]). Of course, then it servesas a way to characterize the beam and it does not fully reflect the realityof the beam distribution. But one can define the distribution matrix bycalculating the quantity in equation (4.45), i.e both the variance terms andthe correlation terms of the x − x′ phase-space. This suggests that one cancalculate the Courant-Snyder parameters simply by comparison, as equation

25

Page 31: Beam losses along the ESS LINAC due to nonlinear e ects ...

(4.46) and (4.47) show. But this is not really the case. Remember Liouville’stheorem which stated that the area within the contour of the beam (the outerlimit which is set by the particle whose Betatron motion is at its maximumand minimum) is conserved throughout an accelerating structure if there areno other forces acting on the beam other than external forces which don’tdepend on velocity. But does this apply to accelerated protons? Actually, theemittance appears to shrink when the momentum of the particles increases,cf. [29, 28, 26]. This is due to the fact that the coordinates which has beenused here are not canonical in the sense defined by Hamilton mechanics. Inthis report, Hamiltonian mechanics will not be presented. The Hamiltoniancanonical5coordinates are

p =m0x√1− v2

c2

(4.49)

where v and c are the velocity in x-direction and the speed of light respectivelyand m0 the rest mass of the proton. Here x is a general transverse coordinateand p its conjugate momentum and β

β =v

c(4.50)

and γ defined as

γ =1√

1− β2(4.51)

We note that the parameters β and γ are not to be confused with the Courant-Snyder parameters. Further, it is possible to find the relationship between pand x′ through

p = m0dx

dtγ = m0

ds

dt

dx

dsγ = m0c(βγ)x′. (4.52)

5The Hamiltonian mechanics is sprung from the Newtonian mechanics but can beapplied to a more general case. The Hamiltonian mechanics starts from the Lagrangian,which states the potential of the system at hand, to form the Hamiltonian. The generalview of the Hamiltonian mechanics is to divide a physical system due to the nature ofconservation of energy in an enclosed system.

26

Page 32: Beam losses along the ESS LINAC due to nonlinear e ects ...

Now, Liouville’s theorem says

∫pdx = m0c(βγ)

∫x′dx = p0

∫x′dx (4.53)

which suggests that this area is proportional to βγ and physicists define thenormalized emittance as ε∗ = (βγ)ε [28, 29, 15].

Space charge

The interaction between the protons is commonly known as the space chargeeffect. Instead of treating each individual particles charge as a point charge,the space charge effect is treating the charge effects as a continuum. Theidea is that the multiparticle system produces a self-field that is close to zeroin the center of the beam (because the net space charge that the particleclose to the distribution center “sees”, is zero ) and increases closer to theedge of the distribution. To be able to cope with that, there is a need towiden the concept [21]. Thus let us think of the single-particle case above.Since all particles can not be confined to a single point in space, phase andenergy at the same time, this leads to the assumption that the motion ofeach individual particle differs from that of the other. This generates yetanother term in the equation of motion (4.39), leading to

x′′i +K(s)xi −q0l

2xi − f(x−i) = 0 (4.54)

where x−i = (x1, ..., xi−1, xi+1, ..., xn) ∈ <n−1, and f : <n−1 → <

The aim is to keep all these particle-trajectories as close to each other in the6D phase-space as possible because the intensity, and therefore the neutronbrightness6due to higher impact-concentration of the proton beam on thetarget [26], will then increase. In the transverse planes this means that theparticles will spread out to find an equilibrium state if no external forces areacting on them. This effect can cause an increase of the particles locatedin the outer regions of the phase-space and thus increasing the emittanceand halo parameters of the propagating beam eventually resulting in losses[1]. These effects on the longitudinal plane is more complex. Because of the

27

Page 33: Beam losses along the ESS LINAC due to nonlinear e ects ...

space-charge interaction the particles will be spread out in relation to eachother causing the difference in energy and location in the s-direction. Thesedifferences will end up causing some particles to arrive “early” and other toarrive “late” in the accelerating cavities. This causes oscillation around thesynchronous particle. A particle with a higher energy will be bent less in thefocusing QPs and particles which has a lower energy will be bent more, asseen in equation (4.55). This can cause an increase in their Betatron motionwhich eventually means losses when they hit the inner walls or aperture in theaccelerator. Therefore, one wants the phase and the energy of the particlesto be as close to the synchronous particle as possible. But, this space-chargeeffect will have a lower impact on high energy particles approaching the speedof light. The relativistic effects “counteract” the space-charge effect becausethe particles “perceive” a different surrounding than the non-relativistic par-ticles causing the forces of the particles to approach zero. Let

Er =ρ

2ε0r (4.55)

andBφ =

ρ

2ε0

v

c2r (4.56)

whereδFr = e(Er + v ·Bφ) =

2ε0(1− β2)r (4.57)

where Er, Bφ and δFr denotes the electrical field, the magnetic field andthe deflecting force a particle in the transverse plane at distance r from thecenter of the particle distribution. As v → c, Fr → 0. Many factors areimportant when studying the particle distribution along the LINAC, and tobe able to properly describing the beam the distribution of consideration is6 dimensional.

Ξ(ri) = Ξ(xi, x′i, yi, y

′i, zi, pi) ∈ <6 (4.58)

However, as it is hard to visualize this 6D phase-space, the distribution isoften broken down to 3 2D phase-spaces [21]. It is often visualised in 3separate 2D cases, i.e x-x’, y-y’ and z-dp/p7space (see Figure 4.7).

6Brilliance is a measure of the flux per source size and angel of radiation [27].7The z-dp/p plane can be converted to the φ-E plane as suggested in the TraceWin

28

Page 34: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 4.7: The figure illustrates the phase-space at the entrance of theMEBT, simulated with TraceWin for 106 generated particles.

Now, it is not clear that a two-dimensional Gaussian distribution is an appro-priate model for each part of the LINAC. The distribution evolves throughthe LINAC due to the many forces acting on the particles along the way.Therefore, there is a need to develop a suitable model to explain this evolu-tion.

Beam tail/Halo and emittance effects on the beam loss for highenergy particles

The beam Halo, or similarly, the kurtosis of the distribution is derived fromthe 4:th momemnt (see section 5.2.7) of an arbitrary distribution and indi-cates that the “peakedness” increases and the tail shape of the distributionbecomes fatter. As the kurtosis increases, one might expect the tails of adistribution to get fatter. These distributions with a kurtosis bigger then aset value (the Gaussian distribution is often used as a reference in statisticsand the uniform distribution in physics) are called leptokurtic. This means

documentation [25].

29

Page 35: Beam losses along the ESS LINAC due to nonlinear e ects ...

that the higher the kurtosis, the higher probability of finding a particle inthe tails of the distribution (see Figure 4.8), exposing them for the risk ofgetting lost. These particles are often subject to getting lost by hitting thepipe aperture in the LINAC.

Figure 4.8: The figure illustrates the tail of the normal distribution but isapplicable to an arbitrary distribution.

30

Page 36: Beam losses along the ESS LINAC due to nonlinear e ects ...

A more sophisticated way of defining the beam Halo is (for continuous beamsin 2D phase-space but is also applicable for bunched beams.)

Hi =

√3〈q4

i 〉〈p4i 〉) + 9〈q2

i p2i 〉2 − 12〈qip3

i 〉〈q3i pi〉

2〈q2i 〉〈p2

i 〉 − 2〈qipi〉2− 2 (4.59)

which essentially is the extension of the kinematic motion invariants fromHamiltonian mechanics8[1]. The increase in beam Halo is often a good in-dicator of beam losses. Also, emittance growth is used to indicate the riskof beam loss. Naturally, when the emittance grows it is an indicator of thatsome of the particles trajectories have bigger Betatron motion (as explainedin section 4.1.4), i.e they vary more around their equilibrium, and thus therisk of hitting the aperture is increased.

4.2 Fundamental statistics

Mathematical statistics is a useful tool when working with data and wherethe goal is to be able to find structure in environments where it is sensible tomodel parts of that environment as random. The randomness in this case,however, is mainly related to the errors that can occur when constructing themachine. The model itself (the tracking of the protons) is fully deterministicin the sense that the individual particles are tracked using the linear ma-trix model described above, and a space-charge term. The randomness canbe applied when random errors in the location of the QPs and the strengthof the electrical field cannot fully be determined because of errors in theconstruction. So, in this report empirical hypothesis testing will be used todetermine whether distributions at different locations are the same or not.This could help the physicists to highlight critical parts of the accelerator tomitigate losses. If one can determine a point from which the distributionsdo not change one can try to mitigate losses on other locations, confident ofthe robustness of the first part. So, when the distributions varies betweendifferent locations in the lattice, there are close to zero randomness. But, if

8The kinematic invariant is a property of the physical system derived from the Hamilto-nian mechanics. One invariant is the one mentioned before, the emittance. The invariantused in this section is of a higher order [1, 15].

31

Page 37: Beam losses along the ESS LINAC due to nonlinear e ects ...

one takes a look at one position, the different data-points appear stochasti-cally distributed. Therefore, it seems feasible to use statistical tools to tryto model each point in the accelerator.

4.2.1 Hypothesis testing

The premise of the hypothesis testing is to test a, so called, null-hypothesis,in this case, regarding the distributions, X = (X1, X2, X3, ....., Xk), fromwhich the samples x =(x1k, x2k, x3k, ....., xnk) are supposedly drawn from. Inthis report, the outset is to look at distributions and the possibility thatthe different distributions of particles (protons) are drawn from the samedistribution or not. This defines the outline of the hypothesis testing:

{H0k : FX1(x1) = FX2(x2) = .... = FXn(xn)

H1k : FXk(xnk) 6= FX1(xnk)(4.60)

To test H0 there is need for a test variable, t(x) as an observation of thesample variable t(X) and a critical area, denoted C, as a subset of the totalarea in which t varies. Then, if t(x) is within this critical area, the null-hypothesis is rejected in favor for the alternative hypothesis. This creates asignificance test as follows

{if t(x) ∈ C → reject H0

else t(x) /∈ C → do not reject H0

(4.61)

There is still need for some description of the critical area C and this iscommonly done such that

P (t(X) ∈ C) = α if H0 is true (4.62)

where α is chosen beforehand and is commonly called the significance level.Sometimes, though, it is more convenient to use the P-value method. Thistest is basically the same test as the one above, but instead one poses the

32

Page 38: Beam losses along the ESS LINAC due to nonlinear e ects ...

question a bit differently. Instead of saying that the null-hypothesis is re-jected if the observed test statistic is not within an area C, the statementbecomes: the null-hypothesis is rejected if the test statistic is “large”. Ifone can assume that the sample variable t(X) has a given, known distribu-tion under the null-hypothesis, then the observed significance level (or theP-value) is

P = P (t(X) ≤ t(x)) ≤ α (4.63)

given that H0 is true. This basically means that the null-hypothesis is dis-trusted if the test result is ”unlikely” given that H0 is true [3].

4.2.2 Parametric tests

A first approach may be to look at distributions well known in theory to studythe distribution variation from the pre-defined, well known distribution tosomething else. This has applications in accelerator physics in the sense thatthey do not want the system to dramatically change the distribution becausethat can indicate a resonant or mismatched system [25]. By modifying theinput distribution in TraceWin in the MEBT to be for example Gaussian,one can carry out multivariate normal hypothesis9tests of the form

{H0 : Fobs(x) = Fgauss(x)

H1 : Fobs(x) 6= Fgauss(x)(4.64)

In some sense, this test can tell whether the input distribution changes andat what point the change occurs. This can give a statistical insight and bringhighlight to presumably critical points in the accelerator.

9For the multivariate normal test, the Henze-Zirkler test [23] is used in this report.

33

Page 39: Beam losses along the ESS LINAC due to nonlinear e ects ...

4.2.3 Non-parametric tests

Nonparametric tests are tests where no primarily assumption is drawn re-garding the distribution. For example, if the data is assumed to be drawnfrom a Gaussian distribution, then the test is considered parametric. Moreformally it means that parametric tests has a finite number of parametersincluded in the parameter space, i.e,

θ ∈ Θ (4.65)

wheredim(Θ) <∞ (4.66)

whereas nonparametric tests have an inventively large parameter space, i.e,

dim(Θ) =∞ (4.67)

.

Kolmogorov-Smirnov test

We treat two types of Kolmogorov-Smirnov (KS) tests, the one-sample KSand the two-sample KS test. The one-sample KS test is set to determinewhether a sample distribution from Y is likely to be drawn from a specifieddistribution (say the Normal distribution X) or not, at a certain significancelevel α. The rejection criterion is the Chebyshev norm, or the supremumnorm10.

The empirical distribution function is created by

FY (y) =1

n

n∑i=1

1{Yi ≤ y} (4.68)

and the distance between the two distributions of comparison is

10The Chebyshev norm is a measure assigning a non-negative number describing sizecharacteristic of a certain set of functions [8]

34

Page 40: Beam losses along the ESS LINAC due to nonlinear e ects ...

Dn = sup(x,y)∈<

{|FY (y)− F (x)|} (4.69)

Furthermore, the hypotheses are

{H0 : FY (y) = F (x)

H1 : FY (y) 6= F (x)(4.70)

In fact, define the random variable

K = supt∈[0,1]

{|B(t)|}. (4.71)

where B(t) is a Brownian bridge [17].

Under the null-hypothesis it can be shown that√nDn

d−→ supt{|B(F (t))|} if

F(t) is continuous. Further-more, the null-hypothesis is rejected if√nDn >

Kα where Kα is the α-quantile in the distribution of K, i.e,

P (K ≤ Kα) = 1− α. (4.72)

The two-sample KS test is similar to the one mentioned above, only insteadof comparing one sample distribution with a specified one, the sample distri-butions, from X and Y, are compared with each other [18]

Dn,n′ = sup(x,y)∈<

{|FY (y, n)− FX(x, n′)|} (4.73)

Theory states that the null-hypothesis is rejected if

Dn,n′ > c(α)√

(nn′

n+ n′) (4.74)

35

Page 41: Beam losses along the ESS LINAC due to nonlinear e ects ...

where (n,n’) is the observations realized from the different distributions andc(α) function (α-quantile) of the significance level11. The distance of interestis visualized in Figure 4.9 below.

Figure 4.9: The figure shows the Kolmogorov distance.

Holm-Bonferroni test

In this project many comparisons (many hypothesis to be tested) are tobe made and thus, with a simple hypothesis test the probability of Type1 error12rises with the number of tests. The Holm-Bonferroni method [12]takes that into account by scaling the rejection criterion along the way. LetH1, H2, H3, ....., Hm be a family of hypotheses and let P1, P2, P3, ....., Pm betheir corresponding p-values

By ordering the P-values in ascending order, P(1) ≤ P(2) ≤ .... ≤ P(m), it isdefined that if

11The values of c(α) are usually extracted from a table but are derived computing theinverse of the Kolmogorov distribution in equation (??)

12Type 1 error (or error of the first kind) is the incorrect rejection of the null-hypothesis[3].

36

Page 42: Beam losses along the ESS LINAC due to nonlinear e ects ...

Pj >α

m+ 1− j(4.75)

for j = 1, ...., k, then H1,....,Hk−1 are rejected at a global α-level.

4.2.4 Parameter estimation - Maximum likelihood

The most frequently used method for parameter estimation is the maximumlikelihood method [3]. It is used to estimate parameters when trying to de-scribe data with certain models. The idea is to create the likelihood function,

L(Θ|x1, ...., xn) =N∏n=1

fn(xn|θ) (4.76)

where Θ holds all the parameters one may want to estimate. Often one wantsto further simplify the expression since addition is easier than multiplication

lnL(Θ|x1, ...., xn) =N∑n=1

lnfn(xn) (4.77)

The most likely estimate is then the argument which maximizes the likelihoodfunction [3]

θ∗ = argmaxΘ{L(θ|x)} (4.78)

4.2.5 Finite Mixture Models - the Gaussian fit

In basic mathematical statistics one often relies on predefined distributionsfor which one does the inference. These distributions do not always re-flect reality more then to serve as plausible cases and mere approximations.Sometimes more complex models are needed to explain and analyse empir-ical, unknown distributions. Finite Mixture Models can provide a thorough

37

Page 43: Beam losses along the ESS LINAC due to nonlinear e ects ...

foundation for this. Using this framework one can reproduce arbitrary distri-butions (univariate and/or multivariate) from an iterating algorithm, calledthe EM-algorithm [20, 2]. In this report, Gaussian mixture models are usedto parametrize the unknown distributions at hand. A multivariate Gaussianr.v

X ∈ Nk(µ,Σ), (4.79)

of dimension k with (1,k) mean-vector, µ, and a (k,k) covariance matrix, Σ,has a probability density function (p.d.f)

fX(x) =1√

(2π)k|Σ|exp(−1

2(x− µ)TΣ−1(x− µ)). (4.80)

The data points in x are often denoted as an observation of the r.v X. TheGaussian distributing is defined by its moments and, for this application(and for most applications), only the four first moments 13are taken intoconsideration (see equation (4.81)) [10, 16].

b1,N = E[X] = µ

b2,N = E[(X − µ)2]

b3,N = E[{(X − µ)TΣ−1(X − µ)}3]

b4,N = E[{(X − µ)TΣ−1(X − µ)}2]

(4.81)

13The sample moments are shown belowX = 1

N

∑Nn=1Xi

S = 1N

∑Nn=1(Xi −X)(Xi −X)T

Skew(X) = 1N2

∑Nn=1{(Xi −X)TS−1(Xi −X)}3

Kurt(X) = 1N

∑Nn=1{(Xi −X)TS−1(Xi −X)}2

(4.82)

where the kurtosis for a multivariate Gaussian distribution is p(p+2), where p is thedimensions of the variables, and the skewness of the multivariate Gaussian is zero.

38

Page 44: Beam losses along the ESS LINAC due to nonlinear e ects ...

Then, the probability density function for the Gaussian mixture model canbe defined as a convex14combination of components

p(X|Θ) =K∑k=1

αkpk(xk|θk) (4.83)

whereK∑k=1

αk = 1 and represents the proportion of observations from the k:th

random process. In the one-dimensional case, for example in the case of k =3, one can compose a mixture

Fobs(x) = α1F1(x) + α2F2(x) + α3F3(x) whereK∑k=1

αk = 1 and α ∈ [0, 1]

(4.84)

where F1(x), F2(x) and F3(x) are called the distribution functions [3] of Xand related to the probability density function (p.d.f) by

FX(x) =

∫ x

−∞fX(x)dx (4.85)

This means that the observed p.d.f of Xobs can be modelled by a weightedsum of other distinct distributions, each of them weighted by the proportionof the observations that might come from each distribution[20, 3], as seen inFigure 4.10 below.

These mixture distributions initially have unknown parameters, Θ, whichmust be estimated in a good manner. Usually, one confer the ML-estimator,which in the multivariate mixture model case is defined as

fX(x|Θ) = L(Θ|x) =N∏n=1

K∑k=1

αkfk(xn|θk) (4.86)

14A convex combination of components is a linear combination of (for example pointsin space) non negative components [4]

39

Page 45: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 4.10: An example of a Gaussian mixture model for the univariatecase.

if it is assumed that xi are independently distributed. The MLE is thusdefined as

Θ∗ = argmaxΘ{L(Θ|x)}. (4.87)

We note that the summation inside the product of equation (4.86) usuallycan not be solved analytically, thus a numerical algorithm is needed for thecalculation of this problem.

How to choose number of components - the Akaike informationcriterion

For a given data set, the Akaike information criterion (AIC) tells us some-thing about the quality of the statistical model fitted. This provides informa-tion crucial for model selection. Suppose that the maximum of the likelihoodfunction, as shown in equation (4.86), is found and call it L. Then the AICis defined as

AIC = 2k − 2ln(L) (4.88)

where k is the number of estimated parameters. The presumably best fit is

40

Page 46: Beam losses along the ESS LINAC due to nonlinear e ects ...

the model with the smallest AIC-value. As seen in equation (4.88) the AICis determined by the number of parameters included in the model and thevalue increases as the number of parameters increases, penalizing a modelwith many parameters [13].

4.2.6 The EM-algorithm

The Expectation-Maximization algorithm is a method for solving parameterestimation problems by introducing a, so called, latent variable Z15from othervariables that are directly observed, i.e. measured. Latent variables aresometimes also referred to as hidden variables (and within the EM literaturethey are sometimes called the missing data or the “incomplete data”) that areassumed to be present even if they are not directly measured. The observeddata, drawn from the r.v X, and the “whole” data drawn from the r.v Yserves as the variables at hand. Since X is a subset of Y it can be viewedas a mapping from Y, X = M(Y). Given the set of unknown parameters,Θ, fX(x|Θ) and fY(y|Θ) denotes their respective log-likeihood functions.Note that the conditional density of the missing data given the observeddata follows the relation fZ|X(z|x,Θ) = fY(y|Θ)

fX(x|Θ). The EM-algorithm seeks

to maximize the L(Θ|x) with respect to θ iteratively [2]. As many timesbefore, it is useful to use the log-likelihood because of the second logarithmrule converts multiplication into an additive process with allows the definitionof

Q(Θ|θ(t)) = E[logL(Θ|Y)|x,Θ(t)] (4.89)

where

E[logfY(y|Θ)|x,Θ(t)] =

∫[logfY(y|Θ)]fZ|X(z|x,Θ(t))dz (4.90)

where the last step is a consequence of Bayes’ theorem. The iteration basi-cally follows the following three steps

15The term latent variable is taken from statistics and denotes a variable that is notdirectly observed [20].

41

Page 47: Beam losses along the ESS LINAC due to nonlinear e ects ...

1. The E-step : Compute Q(Θ|Θ(t))

2. The M-step : Maximize Q(Θ|Θ(t)) with respect to Θ. Set the newly

estimated parameters, θ(t+1) equal to the maximizer of Q.

3. The Last step : Return to the E-step unless a stopping criterion hasbeen met (that the fit converge).

4.2.7 The randomness

Since each position for each particle in the accelerator, is deterministicallydefined from its former position, as discussed in section 5.1.2, one mightwonder where the randomness comes from? The lattice defined in TraceWinis characterized by the implemented physics. But, in reality there is no wayto beforehand fully determine everything. There must be somethings thatis random in nature. In the design of the lattice, the Beam Physics groupin the Accelerator division have imposed errors in the lattice such as thelocation of the QPs with respect to the design values, the strength of theQPs in relation to their nominal values etc. These things affect the outcomesof their simulations. These errors are introduced to be able to study theeffect of them on the proton beam in the linear accelerator and to study theeffect of losses as a result of these errors.

4.2.8 Extreme Value Theory

The area of Extreme value theory (EVT) has developed into becoming animportant statistical discipline for applied science where extremal events isto be modeled. It can be used in a wide range of areas such as finance andenvironmental studies. It is also applicable in accelerator physics [7]. Thepurpose of EVT is to analyze the behaviour of extreme events. To draw aanalogy to accelerator physics, one might see that losses of protons in manysimulations of different accelerators has a certain distribution. But someof the observations stand out as unusual. These events are interesting toanalyze in order to calculate the probability of the occurrence of such events.

42

Page 48: Beam losses along the ESS LINAC due to nonlinear e ects ...

The Extreme value paradigm

If X1, ......, Xn denotes r.v’s which correspond to the occurrence of, for exam-ple, the losses in accelerator 1 to n one can construct the r.v

Mn = max(X1, ....., Xn) (4.91)

which is the maximum observation over a n-observation period [5]. Now, ifthe distribution functions of X1.......Xn are known the distribution functionof Mn can be determined, for instance if X1, ...., Xn are independent thenFMn(t) = F1(t) · ..... · FXn(t). But, often is this not the case. But, thanksto the theoretical framework of EVT this can be remedied. Under certainassumptions, one can show that when n → ∞, Mn converges in distributionto a family of models called the generalize extreme value distributions (GEVdistribution). This is called the Extreme Value paradigm.

The Extreme Value approach

As mentioned above, the extreme value approach focuses on the statisticalproperties of Mn where X1......Xn are independent identically distributed(iid) r.v. From a theoretical perspective one can derive the distribution ofMn exactly [5]:

P (Mn ≤ z) = P (X1 ≤ z, ....., Xn ≤ z) = P (X1 ≤ z)·.....·P (Xn ≤ z) = [F (z)]n

(4.92)

But since, in reality, F is unknown the penalty of doing approximations canemerge costly due to the magnitude of n. A better approach is to acceptthat F is unknown and to look at approximations to F n instead, to avoid themultiplicative error evolution by doing the approximation of the individualr.v [5]. This can be done using extreme value data only. The approximationis done in the same manner as for sampled mean by the normal distribution,which is justified by the Central limit theorem:

√n((

1

n

n∑i=1

Xi)− µ)d−→ N (0, σ2) as n→∞ (4.93)

43

Page 49: Beam losses along the ESS LINAC due to nonlinear e ects ...

if Xi is i.i.d r.v. More commonly, a scaled version of Mn is used to avoid thedegeneration of Mn at the upper end-point (of the distribution) z+ :

M∗n =

Mn − bnan

(4.94)

where an > 0 and bn∈ R. A well known theorem, called the Extremal Typestheorem, states that the limit of M∗

n converges into one of the following threedistribution families. If

P (Mn − bnan

≤ z)→ G(z) (4.95)

then G belongs to one of the following classes of distributions:

I : G(z) = exp{−exp[−( z−ba

)]},−∞ ≤ z ≤ ∞ if ξ = 0

II : G(z) =

{0, z ≤ b

exp{−( z−ba

)−α}, z > bif ξ¿0

III : G(z) =

{exp{−[−( z−b

a)α]}, z < b

1, z ≥ bif ξ¡0

(4.96)

These can all be seen as special cases of the general extreme value distribu-tion, dependent of the limit of a certain variable ξ :

G(z) = exp{−[1 + ξ(z − µσ

)]−1ξ } (4.97)

where - ∞ < µ < ∞, σ > 0 and −∞ < ξ < ∞ denoting the location, scaleand shape parameters respectively.

In this project, the data comes from simulations of many lattices with ran-domly distributed errors in the displacements of the QPs and in the amplitudeand phase in the field-gradients in the accelerating cavities. The losses canbe used along the whole LINAC and the GEV, based on the Block-Maximamethod [7], can be used in multiple ways: Either one can divide the blocksto extract the maximum loss from each simulation, or one can isolate one

44

Page 50: Beam losses along the ESS LINAC due to nonlinear e ects ...

element of interest and calculate the maximum loss for that particular ele-ment. One statistic of special interest is the return-value, which is definedas G(zp) = 1 − 1

m, where 1

m=p and means that zp is the observation which

is expected to return within m observations. If one is, for example, mod-elling wave-level maxima and consider the maximum wave level each year tobe the observations over m years, then zp is to be considered the wave-levelthat one can expect will occur within the next m years. The statistic can becalculated from equation (4.97)

zp = µ− σ

ξ(1− (−log(p))−ξ) (4.98)

where ξ, σ and µ are the ML-estimates of the shape, scale and location pa-rameter respectively.

4.2.9 Profile likelihood

As stated above, the return-value can be calculated but since the calculationof the same uses estimated parameters with uncertainties, this also imposesuncertainty into the return level. One, very powerful, approach to create aconfidence interval16for the statistic is to use profile likelihood. This methodwrites a function that depends on the interesting statistic and by varyingthe parameters one can obtain a maximum value of the statistic. Then onecan create the confidence level by looking at the likelihood ratio test. So,consider a model, where the statistic/s of interest is/are called δ where θ isthe vector of additional parameter/s included in the model. Then, the profilelikelihood function can be written like

L(θ) = maxθ{L(θ, δ)} (4.99)

The idea is this; When the statistic of interest is chosen, the profile likelihoodis maximized over the remaining set of parameters. Thus, this is not to be

16A confidence interval is a interval that can be estimated to state that with a certainprobability, 100(1-α)%, the calculated interval will contain the desired value [3].

45

Page 51: Beam losses along the ESS LINAC due to nonlinear e ects ...

confused with the likelihood function because as opposed to that, the profilelikelihood is, at each point, the maximum value of the likelihood function.With this method it is possible to create a confidence interval of the statisticof interest by inverting the likelihood ratio test 17. One can construct a100(1-α) % confidence interval for a chosen δ such that the hypothesis testH0 : θ = θ0 would not be rejected for a given significance level, α. Thelikelihood ratio test statistic is the the difference between 2logL for the “full”model and 2logL for the model where the θ has been reduced to and fixedat θ0 [5]. This means

2[logL(θ0, δ)− logL(θ0, δ0)], (4.100)

where θ and δ are the MLE estimates of the full model and δ0 is the MLEestimate of the statistic for the reduced model with θ = θ0.To be even morespecific, the null-hypothesis will not be rejected at the significance level α ifand only if

2[logL(θ0, δ)− logL(θ0, δ0)] < χ21−α(1) (4.101)

or if

logL(θ0, δ0) > logL(θ0, δ)− χ21−α(1)/2 (4.102)

where χ21−α(1) 18is the quantile of the χ2 -distribution with 1 degree of free-

dom [5, 3].

4.2.10 Empirical bootstrapping

The empirical Bootstrap-method is a method of forming new samples froma set of measured observations. These new samples, in the limit, resembles

17The likelihood ratio test is a simple hypothesis test where the ratio of the likelihoodfunctions are examined. If the ratio is less that a constant c, the null-hypothesis is rejectedat a 100(1-α)% level. This is generally the sam test as described in equation 6.79 to 6.81.

18The χ21−α(f) is a distribution built up by the sum of f squared standard normally

distributed random variables [3, 5].

46

Page 52: Beam losses along the ESS LINAC due to nonlinear e ects ...

in distribution that of the original set of observations. In other words, Boot-strapping is used to simulate the distribution of a statistic of interest. Thisis done by re-sampling observed data which each time produces an empiricaldistribution of the data. For each simulated distribution a new value of thestatistic can be computed which gives the possibility to get an estimate of thesampling distribution of said statistic, suitable for inference [8]. For example,let Θ = T (F ) be the interesting feature of a distribution F. This could bethe mean, variance, percentile or some other statistic of interest for a givenproblem. Consider x1, ....., xn to be the observations of a set of random iidvariables X1, ...., Xn ∈ F which can be unknown. The empirical distributioncan be formed from the observed data as

1

n

n∑i=1

1{xi ≤ x} = Fn (4.103)

.

Then the plug-in estimator of Θ is defined as T (Fn).

An example of re-sampling

Consider throwing a dice 6 times. The distribution of the random variablethat reproduces the observed value of the dice when thrown is known to beuniform, i.e, X ∈ U(1, 6) with known probability distribution and distribu-tion function. Say, that the outcomes of the 6 tries are {1, 2, 4, 4, 4, 5} ={x1, x2, x3, x4, x5, x6} ∈ F in increasing order. If one wants to re-sample us-ing these 6 samples one could put the values in a box and blindly pick outsix new samples with re-placement. This is also a uniform process, so letsthrow the dice 6 times again and draw the value corresponding to the value ofthe dice outcome. Say, if the values are {1,3,6,4,3,3}, the drawn samples are{1, 4, 5, 4, 4, 4} = {x∗1, x∗2, x∗3, x∗4, x∗5, x∗6} ∈ F ∗. The bootstrap principle thenstates that F* ≈ F. A more thorough, mathematical explanation is madebelow.

In resemblance of the Central limit theorem in equation (6.67), Donsker’stheorem [6] explains the convergence in distribution of the scaled difference

47

Page 53: Beam losses along the ESS LINAC due to nonlinear e ects ...

between the empirical distribution and the actual distribution

√n(Fn(x)− F (x))

L−→ B(F (x)) (4.104)

where B is a Brownian bridge [14]. This result can be used, together withthe so called functional delta method [funcdelta], which says that if thefunctions T is nice enough, meaning that they are Hadamard differentiable,so if there is a linear and continuous functional T ′F , such that

sup |h∈K

T (F + th)− F (t)

t− T ′F (n)| → 0 (4.105)

when t → 0, where K is an arbitrary compact set in the space of Calleyfunctions, then

√n(T (Fn)− T (F )) =

√n(Θn −Θ)

L−→ T ′F (B(F )) (4.106)

which actually implies, since T ′F is linear and B(F) is a Gaussian process,that T ′F (B(F )) is a Gaussian r.v. However, it depends on the unknownd.f F, and therefore the result can not be used directly to derive confidenceintervals or perform tests. A way out of this is to use bootstrap techniques.The next step is to look at the distribution of the re-sampled values as theBickel-Freedman theorem states.

Bickel-Freedmans theorem

LetX1, ...., Xn be i.i.d r.vs and that the variance is less than infinity (E{X2} <∞) and let Fn be the empirical distribution ofX1, ...., Xn. Now, letX∗1 , ...., X

∗m

be the conditionally independent, re-sampled r.vs from the same empiricaldistribution, Fn, then the conditional distribution of F ∗n in relation to Fnconverges as [11]

√(m)(

1

m

m∑i=1

X∗i −1

n

n∑j=1

Xj)L∗−→ B(F (x)) (4.107)

48

Page 54: Beam losses along the ESS LINAC due to nonlinear e ects ...

This explains the relation between equation (4.104) and (4.107). This Brow-nian motion [14] is mathematically defined as having the following properties

1.W0 = 0

2.Wt is almost surely continous

3.Wt has independent increments

4.Wt −Ws ∈ N (0, t− s)

(4.108)

which means that it is a stationary stochastic process and therefore haspreserved statistics if time/space-dilated.

Figure 4.11: Visual representation of the profile likelihood of the parameterβ.

49

Page 55: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 5

Method

5.1 Design of the lattice

Since the project is a part of the error studies which is done at the ESS, thelattice of concern is the one used for simulations at ESS. The objective isto look at the losses along the LINAC due to failures to exactly reproducethe nominal lattice in practice. By introducing errors in the displacementof the QPs, the amplitude and phase of the accelerating field in the cavitiesand errors in the input beam a more realistic representation of the acceleratorcan be investigated. The simulation tool, TraceWin [25], provides a thoroughframework for designing a lattice, with mathematical models of the differentelements of the accelerator [25] (see Appendix A). The errors are set toprovide the realistic notion that the nominal lattice, or design lattice, maynot be identical to the realistic lattice. Therefore, errors need to be imposedinto the lattice in order to simulate a more realistic accelerator. The errorsused in this project are delimited to errors in the QPs, cavities and thecharacteristics of the beam. These errors can be either static or dynamicin nature. The static errors are errors that can be tuned away, like thedisplacement of the QPs. By adjusting the other elements, like the strengthof the magnetic gradient in the QPs or the RF (Radio frequency)-feed inthe cavities, one can compensate for the occurring errors along the LINAC.The Beam Physics group tries to tune these errors away, but there may besome static errors left that can not be distinguished from the dynamic ones.

50

Page 56: Beam losses along the ESS LINAC due to nonlinear e ects ...

The dynamic errors are used to simulate distortions that cannot be entirelypredicted and that can, for instance, depend on the dynamics of the protonbeam. These errors may come from the beam itself or from external sources,like the vibration of components or the flaws of a voltmeter. [25].

5.2 Programming

To succeed in this project, tools for generation of data, data analysis and filemanagement are fundamental. The tools used for this project are; MATLAB,python and TraceWin. An overview of the tools are given below.

5.2.1 TraceWin

The programming is done in TraceWin, which is a software tool especially de-signed to fit the purpose of designing an accelerator lattice. The program useshigh level programming language to create a simple interface for the usersas well as graphical outputs for analysis. The language is object-orientedand has a framework suitable for fast and comprehensive learning. By defin-ing the input parameters as suggested in the TraceWin documentation (seeAppendix A - TraceWin), the lattice can successfully be defined and usedfor simulation. For fast simulations, one can use the envelope calculationto produce results suitable for an overview. The envelope calculation is afast calculation, where the Courant-Snyder parameters are calculated fromthe distribution at each intersection (as defined by the user) to produce theellipse evolution through the accelerator. For a more comprehensive anal-ysis, the PARTRAN calculation is used. The PARTRAN option uses anadvanced algorithm where each particle in the beam is taken into considera-tion. This approach enables the user to make a detailed analysis of the beam,by studying the beam density, track individual particles, etc. The design ofthe interface is shown in Appendix A - TraceWin. The simulations can easilyget huge and therefore the user can define which and how many calculationpoints that is taken into consideration. The more calculation points, theheavier calculations, but the better resolution. The default option is to per-form calculations at each element, but as the energy of the particles increase

51

Page 57: Beam losses along the ESS LINAC due to nonlinear e ects ...

fewer calculation points are considered to lighted the computation [25].

5.2.2 MATLAB

MATLAB is a computation interface allowing the user to program his orher own scripts for mathematical computations [24]. There are several use-ful standard tools to ease the mathematical programming. The author usesMATLAB to create functions to perform the distribution analysis and sta-tistical computations. Also, the user structures his own Courant-Snydercalculation program for easy accessible parameter values used in calculation.For comparison, the user uses TraceWin to compare these values for confir-mation. The statistical analysis is performed using the statistical toolboxprovided in MATLAB, but some of the programs are done for the specificpurpose of this project (see Appendix B - MATLAB).

5.2.3 Python

Python is an object oriented, fairly high level language for mathematicalprogramming (for example). Since ESS provide useful Python libraries forextraction of .plt-files (data-files from TraceWin) the author creates a simpleextraction script to organize the data as serves his purpose.

5.3 The scientific approach

The first part of the project the author studies fundamental acceleratorphysics and learns about key issues and current research in the subject mat-ter. This step involves creating a Courant-Snyder calculation program tofully grasp the physics behind the results from TraceWin. An iterative pe-riod of simulation in TraceWin and comparison with theory to widen thecomprehension of the subject and meetings with supervisors forms a crucialpart in the progression. Naturally, when the subject of interest is formed astrategy is important to distribute the work load evenly across the monthscovering the Master’s Thesis. Iterative planning with supervisors for model

52

Page 58: Beam losses along the ESS LINAC due to nonlinear e ects ...

acquisition occupies great amount of time in this step. The next step con-tains developing the tools for analysis. This is the heaviest part of the projectin terms of intensive programming. The tools for analysis is created in thisstep and as the project moves along more questions arise and a slight changeof approach might be unavoidable. The author works more or less inde-pendently with the goals set up for the thesis. After this the first resultsare produced, and the author begins to wrap up the work and prepares forpresentation. The supervisors give their final inputs on the project.

53

Page 59: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 6

Results

6.1 Courant-Snyder parameter calculations

The results of the obtained Courant-Snyder parameters are shown below forthe different cases examined in this project. First, the calculations are donefor the simple FODO-lattice and then for the “real” lattice.

6.1.1 FODO lattice

As equation (4.45) suggests, the Σ matrix is calculated and by comparisonusing equation (4.46) and (4.47) the Courant-Snyder parameters can be ob-tained. The emittance is obtained by calculating the determinant of the Σmatrix and scale with (βγ) as stated in equation (4.52). These calculationsare carried out in a MATLAB script “twissCalc.m” (see Appendix C). Also,the Halo parameters are calculated in this script by computing (somethingthat resembles) the kurtosis as suggested by equation (4.59).

54

Page 60: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The distribution of 6000 particlesat an arbitrary period in the FODOlattice.

(b) The distribution of 6000 particles atan arbitrary point in between periods pe-riod in the FODO lattice.

(c) The calculated emittances and Haloparameters for the FODO lattice with nospace charge.

Figure 6.1: Beam characteristics for the FODO lattice with no space charge.

55

Page 61: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The distribution of 6000 particlesat an arbitrary period in the FODOlattice.

(b) The distribution of 6000 particles atan arbitrary point in between periods inthe FODO lattice.

(c) The calculated emittances and Haloparameters for the FODO lattice withspace charge.

Figure 6.2: Beam characteristics for the FODO lattice with space charge.

56

Page 62: Beam losses along the ESS LINAC due to nonlinear e ects ...

There is a noticeable difference between the simulations, shown in Figure6.1 and 6.2, as the outer regions in the phase-space plot are more populatedwith particles. The emittance plots show noticeable oscillations for the xand y components as well as a continuous growth of the z component for thespace-charge case whereas the emittance and Halo parameters for the nonspace-charge case are approximately constant.

6.1.2 The “real” lattice

The calculations for the “real” lattice are done in the similar way as describedabove.

(a) The distribution of 60000particles at element 151 in thereal lattice.

(b) The distribution of 60000particles at element 151 in thereal lattice.

(c) The distribution of 60000particles at element 151 inthe real lattice.

(d) The calculated emittancesand Halo parameters for the reallattice.

Figure 6.3: Beam characteristics for the real lattice.

57

Page 63: Beam losses along the ESS LINAC due to nonlinear e ects ...

As seen in Figure 6.3, the characteristics are seemingly a bit different fromthat of the results in Figure 6.1 and 6.2. It seems like the distribution ismore dispersed and it is clearly shown in the emittance and Halo plots thatthe dynamics in the real lattice differs a lot from that of a simple FODOlattice.

6.2 Kolmogorov-Smirnov tests

The results from the 2D KS tests will be presented for the different simula-tions in this project. First, the periodic FODO-lattice will be considered andthe test outcomes presented. Then, the test outcomes for the “real” latticewill be presented. In this part the distributions will be normalized accordingto equation (4.41) to be able to study the effects of the space-charge moreclearly. For all tests a Holm-Bonferroni correction is applied. Lastly, theGaussian input distribtion will be considered and a parametric HZ test willbe presented aswell as the evolution of the third and fourth moment of thedistribution along the LINAC.

6.2.1 The periodic FODO-lattice

The 2D KS tests are shown below for the two cases of FODO configura-tions treated in this project. The first case to be examined is the FODOconfiguration without the space-charge effect activated. The objective is toexamine whether a distribution at a certain location in the lattice is equalin distribution to a another n periods later. To see the evolution of the dis-tributions, tests comparing the input distribution to an arbitrary locationdownstream the LINAC are conducted as well as tests where the n:th loca-tion is compared with the n+1:th location in the LINAC. An example of twodistributions compared for the non space-charge case are shown below.

58

Page 64: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) Input distribution.(b) The distribution in element 3 in theFODO lattice.

Figure 6.4: The input distribution and the distribution in element 3 forcomparison without space charge.

As seen in Figure 6.4a and 6.4b they look the same and the tests also confirmsthis visual analysis as seen in Figure 6.6. For the case with the space-chargeturned on the results are shown below.

(a) Input distribution.(b) The distribution in element 3 in theFODO lattice.

Figure 6.5: The input distribution and the distribution in element 3 forcomparison with space charge.

As seen in Figure 6.5 a few deviations can be seen in the outer regions of thedistribution where the space charge have distorted the distribution to kick afew particles out of the core of the beam. These tests are run for all elementsand the KS-tests for both cases are shown below.

59

Page 65: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) Kolmogorov-Smirnov outcomes withno space charge where the inputdistribution is compared with the otherlocations in the lattice.

(b) Kolmogorov-Smirnov outcomes withspace charge where the inputdistribution is compared with the otherlocations in the lattice

Figure 6.6: Kolmogorov-Smirnov tests done for space charge effects includedand excluded.

These tests confirm the differences when the space charge was turned on.Figure 6.6a always return 0 which means that one can not reject the null-hypothesis that the distribution at each periodic calculation point are drawnfrom the same distribution with 100(1-α)% certainty. As opposed to this,Figure 6.6b shows that when the space charge is turned on, one can no longerstate that the distributions at each periodic point are drawn from the samedistribution with 100(1-α)% certainty.

6.2.2 The “real” lattice

The more realistic lattice used by ESS for simulation is used and the resultsare shown below.

60

Page 66: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The chaotic input distribution for thereal lattice.

(b) The histogram for the input distribu-tion for the real lattice.

Figure 6.7: The input distribution visualized in the phase space plane andas a histogram.

As before, the distributions used are the ones in figure 6.3. But to be able tosee the effects from the nonlinear forces, a normalization procedure is done, asequation (4.41) shows to remove the correlation between the different planesof interest. The normalized distributions at element 151 are shown below.

61

Page 67: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The normalized distribution of 60000particlesat element 151 in the real lattice.

(b) The normalized distribution of 60000particles at element 151 in the real lat-tice.

(c) The normalized distribution of 60000particles at element 151 inthe real lattice.

Figure 6.8: Normalized distributions at element 151 for the real lattice.

62

Page 68: Beam losses along the ESS LINAC due to nonlinear e ects ...

In the “real” lattice, there is always an active space charge and there areerrors in the machine to distort the distributions. Thus, as opposed to theFODO-lattice, the distributions evolve through the LINAC, as Figure 6.8and 6.7 illustrates. The KS tests on the non-normalized beams in Figure 6.3did reject the null-hypothesis for all comparisons, as shown below.

Figure 6.9: The figure shows the outcome of the KS-tests for the real lattice.

For the “real” lattice KS statistic is computed along the LINAC as the dis-tributions evolve as equation (4.73) states. The KS statistic is illustratedbelow. The c.d.f’s are also illustrated below.

63

Page 69: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows thecumulative distribution functions foreach of the distributions in comparison.

(b) The figure shows the KS-statisticwhen comparing the input distribution toall the other distributions.

(c) The figure shows the KS-statisticwhen comparing the n:th distributionwith the n+1:th distribution.

Figure 6.10: The figures shows the evolution of the normalized distributionin the real lattice for the x-x’ plane.

64

Page 70: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows the KS test outcomefor the comparison with the input distri-bution.

(b) The figure shows the KS test outcomefor the comparison with n:th and n+1:thdistribution.

Figure 6.11: The figure shows the test outcome for the normalized distribu-tion in the real lattice for the x-x’ plane.

As seen in Figure 6.11 the tests now return results that indicate that the dis-tributions don’t change (statistically) in certain locations in the accelerator.As seen in Figure 6.10b the major changes happens in around element 180,400 and 600 which is the intersection of the MEBT-DTL, DTL-SPOKESand SPOKES-HB. This is also seen in Figure 6.10c where the difference froma reference distribution (in this case the input distribution) first slowly in-creases in the MEBT until reaching the intersection between the MEBT andthe DTL where the first ´´jump” is. These deviations between distributionscome from the nonlinear forces that the beam experiences at different pointsin the LINAC. The same is done for the y-y’ and φ-E plane as seen below.

65

Page 71: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows the KS test outcomefor the comparison with the input distri-bution.

(b) The figure shows the KS test outcomefor the comparison with n:th and n+1:thdistribution.

Figure 6.12: The figure shows the test outcome for the normalized distribu-tion in the real lattice for the E-φ plane.

(a) The figure shows the KS test outcomefor the comparison with the input distri-bution.

(b) The figure shows the KS test outcomefor the comparison with n:th and n+1:thdistribution.

Figure 6.13: The figure shows the test outcome for the normalized distribu-tion in the real lattice.

66

Page 72: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows thecumulative distribution functions foreach of the distributions in comparison.

(b) The figure shows the KS-statisticwhen comparing the input distribution toall the other distributions.

(c) The figure shows the KS-statisticwhen comparing the n:th distributionwith the n+1:th distribution.

Figure 6.14: The figures shows the evolution of the normalized distributionin the real lattice for the y-y’ plane.

67

Page 73: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows thecumulative distribution functions foreach of the distributions in comparison.

(b) The figure shows the KS-statisticwhen comparing the input distribution toall the other distributions.

(c) The figure shows the KS-statisticwhen comparing the n:th distributionwith the n+1:th distribution.

Figure 6.15: The figures shows the evolution of the normalized distributionin the real lattice.

68

Page 74: Beam losses along the ESS LINAC due to nonlinear e ects ...

The Gaussian input

The result of the Gaussian input in the real lattice is shown below. TheHenze-Zirkler test (HZ) is used to determine normality. From the tests inMATLAB the function returns the outcome of the test. In this test for therealistic lattice it was seen that the distribution was considered a Gaussiandistribution in six calculation points after the input location. The test re-turns looks like this:

Henze-Zirkler’s Multivariate Normality Test——————————————————————-Number of variables: 1Sample size: 6000——————————————————————-Henze-Zirkler lognormal mean: -0.5312161Henze-Zirkler lognormal variance: 0.4959018Henze-Zirkler statistic: 0.4427592P-value associated to the Henze-Zirkler statistic: 0.7162415With a given significance = 0.050——————————————————————-Data analyzed have a normal distribution.——————————————————————-

and the input distribution looks like this

69

Page 75: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 6.16: The figure shows the Gaussian input to the realistic lattice.

For this particular case, the moments of the bi-variate Gaussian are known asseen in (4.81) and the evolution of the skewness and kurtosis are calculatedand shown below.

(a) The figure shows the evolution ofthe skewness of the distributionsalong the accelerator for the x-x’ plane.

(b) The figure shows the evolution ofthe kurtosis of the distributionsalong the accelerator for the x-x’ plane.

Figure 6.17: The figure shows the 3:rd and 4:th moment of the distributionsalong the accelerator.

Both the skewness and the kurtosis are deviations from the known valuesassigned the Gaussian distribution and strong correlation is found betweenthe Halo-parameters and the kurtosis for the 3 differnt 2D-planes

70

Page 76: Beam losses along the ESS LINAC due to nonlinear e ects ...

corr(kurt(X),Hx) = 0.969419924926389

corr(kurt(Y ),Hy) = 0.992234382157353

corr(kurt(Z),Hz) = 0.949491417816321

(6.1)

6.3 Statistical model

The results from the GMM are presented below and the accompanying codeare to be found in Appendix A.

6.3.1 The Gaussian Mixture Model

The GMM-model is presented below for 2 components. The determinationof the number of components is done using the AIC criterion (see section4.2.5) and the visual confirmation.

(a) AIC criterion for each modelledintersection.

(b) AIC criterion for each modelledintersection, zoomed in.

Figure 6.18: The figure shows the AIC calculation for model selection.

As seen in Figure 6.18 the 2-component choice is better than the 1-componentchoice. The 3,4 and 5-component are better than the 2-component choicebut only in a few intervals, otherwise approximately the same.

71

Page 77: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) 1-component GMM at a arbitrarylocation.

(b) 2-component GMM at the samelocation as figure 6.19a

Figure 6.19: The figure shows the AIC calculation for model selection.

Visually, this result seems plausible due to the better fit of the GMM modelin Figure 6.19a than 6.19b.

6.4 EVT

The losses considered in the project is the maximum loss from each simula-tion, making each simulation a block in the “Block Maxima” method. Thesecond approach is to extract the maximum losses gathered from a section(for example the MEBT) of the accelerator. These losses are extracted froma file containing all 20 000 simulations done with the introduced errors de-scribed earlier introduced. A GEV model (as described in section 4.2.8) isfitted to the distributions at hand and the return value calculated as de-scribed in equation (4.98).

6.4.1 General statistics of the sections in the ESS LINAC

To determine which section/s which will be presented some general empiricalstatistics is done. The accelerator is divided into the MEBT,DTL,SPOKE,MB,HB-sections, as described in section 3.2. The mean losses in each section is cal-culated along with the maximum registered loss in that particular section.These two statistical measures are used to determine whether the section is

72

Page 78: Beam losses along the ESS LINAC due to nonlinear e ects ...

“worth” including in the project or not. The function “percentile” in MAT-LAB is used to determine the 95% interval in which the mean and max lossof the particular section will be. From this study, the MEBT has the highestmean and the highest max loss of all sections and will therefore be the sectionof interest. The results of the mean and max loss of the MEBT is presentedbelow.

(a) The figure shows the distributionof mean losses for the simulations donefor the MEBT.

(b) The figure shows the distributionof max losses for the simulations donefor the MEBT.

Figure 6.20: Statistics of the MEBT section.

As Figure 6.20 shows and what can be calculated with the matLab function“percentile” is that the 95% confidence interval for the mean losses and themax losses are [0.0045 0.0342] W and [0.2903 3.4597] W respectively. Forthe whole lattice the mean and max losses for each simulation are shown inFigure 6.21 and the 95 % confidence interval for the mean and the max lossesin the whole LINAC are [0.000076 0.00057] W and [0.32 3.68] W respectively.

73

Page 79: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows the distribution ofmean losses for the simulations donefor the whole LINAC

(b) The figure shows the distribution ofmax losses for the simulations donefor the whole LINAC

Figure 6.21: Statistics of the MEBT section.

6.4.2 The GEV model

First, the GEV model is fitted to the maximum losses from each simulation.

74

Page 80: Beam losses along the ESS LINAC due to nonlinear e ects ...

(a) The figure shows theempirical probability densityfunction and the theoreticalprobability function.

(b) The figure shows the empir-ical cumulative probability func-tion and the theoretical cumula-tive probability function.

(c) The figure shows the profilelikelihood estimation of thereturn value.

(d) The figure shows the esti-mated return values using empir-ical Bootstrapping techniques.

Figure 6.22: EVT for the whole lattice.

75

Page 81: Beam losses along the ESS LINAC due to nonlinear e ects ...

The built-in function in MATLAB, “percentile”, is used to obtain the 95%confidence interval for the return value obtained from the Bootstrappingtechnique, and R100B = [11.6386 12.92316] W which is similar to what Fig-ure 6.22 shows, R100PL = [11.6644 12.9018] W. This means that with 95%certainty one can expect the maximum losses within the next 100 simulationsto obtain a value within these limits.The same procedure is done for the MEBT section and the choice of theMEBT is due to that losses in this section are there, throughout the section,for each simulation and is not a rare event. For the later part of the accel-erator there are losses, but only in approximately 1/1000 simulations. Thelosses in the MEBT are more consistent.

(a) The figure shows theempirical probability densityfunction and the theoreticalprobability function.

(b) The figure shows the empir-ical cumulative probability func-tion and the theoretical cumula-tive probability function.

(c) The figure shows the profilelikelihood estimation of thereturn value.

(d) The figure shows the esti-mated return values using empir-ical Bootstrapping techniques.

Figure 6.23: EVT for the MEBT.

Once again, the built-in function, “percentile”, in MATLAB calculates the

76

Page 82: Beam losses along the ESS LINAC due to nonlinear e ects ...

95% confidence interval for the return value to R100B = [2.6396 2,7229] Wto be compared with the return value calculated with the profile likelihoodmethod R100PL = [2,6191 2,7359] W and the interpretation is the same asfor the max losses for each simulation.

77

Page 83: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 7

Discussion

The approach of this thesis was to study the different factors that may havean impact on the amount of losses one can expect in the current lattice con-figuration of the ESS LINAC. But also investigating the statistical propertiesof the distributions, which are crucial in the understanding of the losses andtheir occurrence. The well known reasons behind the losses lie in the effectsof multiparticle interaction through the space-charge, the input distribution,phase and amplitude errors in the accelerating cavities and the displacementof the quadrupole magnets which forms a rigorous task to grapple with. Butthis thesis aims to highlight some of the aspects that might be of importancewhen monitoring the beam, from a statistical perspective, and when estimat-ing a highest possible loss in the ESS LINAC based on multiple simulations.

7.1 Distribution analysis

The Kolmogorov-Smirnov tests takes on a pure “yes-no” approach in thesense that the fundamental result of the analysis is to say whether a par-ticle distribution at a certain location is the same as the input distribu-tion. But the interest does not only lie there, because it is important forthe physicists to be able to say something about the distance (in infimumnorm speaking) from the input distribution and to monitor sudden changesand their amplitude. As mentioned in equation (4.73) one can calculate the

78

Page 84: Beam losses along the ESS LINAC due to nonlinear e ects ...

Kolmogorov-distance as visualized in Figure 4.9 which does tell somethingabout the distance from the initial distribution but also that in some partsof the accelerator, the distribution seems constant (it does not change muchin certain parts of the accelerator). One may say that the distribution israpidly changing through the MEBT and into the DTL where it stabilizes.When reaching the “cold” sections of the LINAC, the mere increase in energyforces the distribution to change (the phase space occupied by the particlesdecreases) but as the energy increases the effects of the space-charge decrease,as described in equation (4.55). Correlation to the beam size/envelope can bedrawn since the intra-beam interaction decreases. The normalized distribu-tions, seen in Figure 6.8 give information about the nonlinear effects acting onthe beam distribution as it evolves through the LINAC since the correlationbetween the two planes is extracted and the energy compensated for in thenormalization process, the changes in the distribution come from effects ofthe nonlinear forces. Either the space-charge, the errors in the lattice or someother non-linearity affecting the beam distribution. As the energy increasesalong the LINAC, also the oscillations around the synchronous particle sta-bilizes, this due to relativistic effects described in (4.55). These relativisticeffects also decrease the impact of the space-charge and thus the spread ofparticles in the beam tail. This can be seen when comparing the distributionat position n and n+1, the conclusion to be drawn is that the nonlinear forcesare changing the shape and character of the distribution as it moves along(see Figure 6.11 and 6.10). At certain locations, the change is more dramaticthan in other locations. These rapid changes may ´´kick” the protons outin the halo of the distribution and thus exposing them for the risk of gettinglost. In the MEBT, the distribution seems to rapidly change from the inputdistribution, and after the DTL the change goes even faster. As the Halo issteadily increasing, this suggests that the change in distribution can causethe particles to be kicked out in the tail of the distribution.

7.2 The Gaussian input

When using the Gaussian input distribution in the ESS LINAC, on couldsee using the HZ-test, that the distribution kept its parametric normalityshape for about 6 periods (as stated in the results) and this result coincideswith the notion that the distributions are rapidly changing, as discussed

79

Page 85: Beam losses along the ESS LINAC due to nonlinear e ects ...

in the section above. This is shown in Figure 6.17 and shows the sametendencies as discussed in the section above. One can see that the kurtosismeasure correlates a lot with the Halo-parameter suggesting implying thatthe population of protons in the tail of the distribution is steadily increasingalong the LINAC.

7.3 Gaussian mixture model

As the distributions change along the LINAC Accelerator physicists use theCourant-Snyder parameters to track the properties of the beam through theaccelerator. If there is an increase in the emittance or Halo this can be anindicator of losses at that point or further downstream. It is noted in thesection above that the Gaussian input distribution changes rapidly from thestructure of a Gaussian into something else, but this change is mostly due tothe change in the tails. If there are no external forces, the space-charge willdominate and try to expand the beam to find equilibrium which will end up insome sort of uniform distribution. But since there are external forces actingon the beam it will act reminiscent of a Gaussian distribution. The core of thebeam stays somewhat consistent with the input distribution. As seen in figure6.19, the distribution of the particles can take a rather complex form, butdue to Gaussian Mixture Models, one can approximate the distributions withthe superposition of multiple Gaussian distributions, as if the distribution ofthe particles comes from different Gaussian distributions. The AIC criterionhelps with model selection, as seen in figure 6.18, and maybe using the ellipse,in analogy with using 1-component Gaussian model, could be insufficientwhen gathering information of the beam distribution? Figure 6.18 indicatesthat it might be interesting to introduced more parameters if the distributionis to fully determined. How do we understand the kurtosis for bi-modaldistributions? There might be bi-modalities in the distributions which theGMM can catch, and how do they affect the measurements? How shouldone interpret the Halo-expression since it is based on the 4:th moment of thedistribution? Maybe in some cases one can use the parameters in a Gaussianmixture model to characterize the beam?

80

Page 86: Beam losses along the ESS LINAC due to nonlinear e ects ...

7.4 Extreme Value Theory

Losses in the MEBT

From Figure 6.20 and with the use of the “percentile” function in matLab itcan be stated that the section where there is most consistently losses is theMEBT section. As, in statistics, the amount of observed data is somewhatproportional to the accuracy of the statements, the section where the mostamount of data can be gathered is the section where the statistics is themost accurate. For all 20 000 simulations the maximum losses are found tobe in the interval [0.2903 3.4597] W, which means that no max loss observedin simulation exceed the loss limit of 1 W/m and the mean losses in theMEBT falls within the interval [0.0045 0.0342] W which means that themean loss in the MEBT is much lower that the 1 W/m boundary. But,EVT can give an estimate on what one can expect if an additional 100 or1000 or 10000 simulations were done. The GEV model was fitted to themaximum losses in the MEBT, as seen in Figure 6.22 a) and b), From sucha fit, the return value can be calculated from the estimated parameters assuggested in equation (4.98) when p is defined as the probability to observelosses lower than zp (the return value). As Figure 6.23 c) and d) show,the return value is estimated (for p = 1-0.01 = 0.99, interpreted as themaximum value that is expected to occur within the next 100 simulations)form the MATLAB “percentile” function to [2.6396 2.7229] W and [2.61912.7353] W with the 95 % probability from the profile likelihood and bootstrapestimation respectively. This means that one can expect a maximum loss ofthe given magnitude to occur within the next 100 simulations. In reality,these imposed errors causing the observed losses to occur can be divided intothe static and dynamic losses. The static losses can be dealt with by tuningthe LINAC, but the dynamic ones are harder to detect and foresee. Whatdoes this mean for the LINAC losses in reality? Well, it means that there isa slight chance (1%) that ESS will end up with a LINAC producing a maxpowerdump in the MEBT within the mentioned boundaries. It might causeproblems in the MEBT but is highly unlikely to produce a problem for theoverall powerdump limit of 1 W/m along the whole LINAC.

81

Page 87: Beam losses along the ESS LINAC due to nonlinear e ects ...

Losses in the whole lattice

Looking at the whole LINAC one can conclude that the losses observed, canin single cases turn higher than the threshold of 1 W/m lost along the LINAC.But, in the absolute majority of the simulations, the maximum losses are verymodest. For example when observing the mean losses, the 95 % confidenceinterval returns ca [0.000076 0.00057] W. As seen the return levels calculatedwith the bootstrapping method and with the profile likelihood method areapproximately the same, [11.6386 12.92316] for the bootstrap method and[11.6644 12.9018] for the profile likelihood method (see Figure 6.22).

7.5 Further research

To find the tools to detect changes in the beam that might produce losses,either in the same spot or further up stream, is fundamental when trying tomitigate losses in teh ESS LINAC. Therefore, more research is needed in thissubject. The distribution analysis provides a good framework for this detec-tion system and could serve as an indicator system in real time to monitorchanges that can be prevented by active tuning of the LINAC. Say, is theelectric field of the cavities are slowly degrading when running the machine,one might spot that certain changes in the distribution evolution plot thatcan highlight how the distribution changes as an effect of the degradation.Also, the degradation of the field in the quadrupoles might weaken allowingthe space-charge effect to act more freely producing halo-particles produc-ing losses in the apertures further down stream. This model could be usedtogether with the halo and emittance plots to see if distribution changesproduce emittance and halo growth. Further research in this area might beuseful for Beam control and loss control.

The Gaussian mixture model serves the purpose of detecting multiple su-perposing distributions from a set of observations. This can be useful whenmonitoring the beam to locate the actual pattern in which the particles aremoving. As the interpretation of the kurtosis, and therefore, Halo parameterof the distribution often assumes unimodal distributions, one may say thatthe interpretation of the Halo-parameter becomes a bit unclear.

82

Page 88: Beam losses along the ESS LINAC due to nonlinear e ects ...

Extreme value theory is useful in the simulation step to further confirm thatthe design of the lattice is robust in its configuration. If the losses producedin the LINAC is small even when very extreme cases are considered thenone can be confident of ones design. A possible next step is to refine thestrategy trying POT-models (peaks over threshold) instead of the simplerGEV-model and to include every section of the LINAC in the analysis. Butin this project, only the MEBT was considered because its higher mean lossvalue.

83

Page 89: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 8

Appendix A - TraceWin

TraceWin is used to design the lattice in the ESS LINAC and uses a simpleinterface and high level programming language to ease the usage of it. TheTraceWin code calculates the beam dynamics in a particle accelerator whichone designs as one see fit. The code has an interactive interface where manyvisualizations of the beam at different positions in the accelerator can bestudied and creates data-files (.plt) for data analysis [25]. The known physicsin the subject is implemented and forms a good foundation for design con-struction and analysis. Below, some definitions of the elements, parametersand calculation routine options used will be presented.

84

Page 90: Beam losses along the ESS LINAC due to nonlinear e ects ...

8.1 Elements and error options

In the project, mathematical elements pre-defined by TraceWin is used tobuild the accelerator design [25]. The imposed errors is implemented in thebeginning of each section (MEBT, DTL, SPOKE, MB, HEBT, etc..) in theedit window as seen in figure 8.1

Figure 8.1: The figure shows the Edit Window in the TraceWin interface forthe start of the DTL section.

The numbers after each element or error-setting represents different proper-ties of said element or error. The code is read chronologically and appliesone information row at the time and calculates the effects on the beam ateach location. The description of each element, error or other is formulatedin the TraceWin documentation [25].

8.2 User interface for analysis

When the calculation is done the TraceWin interface provides a set of analysistools to study the travel of the beam in the accelerator. Functions suchas emittance plot, halo plot and beam density plots amongst many othersare available to visualize the different parameters and their evolution in theaccelerator (see figure 8.2).

85

Page 91: Beam losses along the ESS LINAC due to nonlinear e ects ...

Figure 8.2: The figure shows the different analysis options available inTraceWin.

8.3 Computation routine - PARTRAN

When simulating the travel of the proton beam through the accelerator, theelements provides new locations (in 6D phase-space) of the particles. In someelements there is only one calculation point that assigns a new location andother elements there is multiple calculation points doing the same. Whenthe space-charge force is applied, the elements are split to add a calculationpoint that shall resemble the kick of the space charge [25]. This can bedone for a hug number of particles and allows for a comprehensive analysisenvironment with the TraceWin interface. If one only is interested in theevolution of the envelope and rms emittance, one can choose the envelope-option for faster computation. The result is then more scarce but one getsan overall view of the simulation. Only the rms emittance and rms beamsize is then considered.

86

Page 92: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 9

Apendix B - matLab

MATLAB is used to perform the computation of the statistics in this report.Many of the functions are written by the author, but some functions aregathered from MathWorks and the built-in ´´statistical toolbox”. A briefintroduction to MATLAB and the statistical toolbox is made below.

9.1 MATLAB

The MATLAB platform is a world leading and has a logical setup (a matrixbased structure) for convenient computational mathematics. Is is speciallydesigned to aid scientists and engineers in their problem solving and haseasy tools for visualization and graph creation. The platform provides aset of different toolboxes suitable for different scientific disciplines with pre-defined functions for easy accessible computation [24]. Most of the graphsshown in the report comes from MATLAB.

9.2 The statistical toolbox

The Statistics and Machine Learning Toolbox provides apps and functionswhich is needed for a statistical analysis. The vast variety of different func-

87

Page 93: Beam losses along the ESS LINAC due to nonlinear e ects ...

tions covers an immense part of the computational field in question [24].

88

Page 94: Beam losses along the ESS LINAC due to nonlinear e ects ...

Chapter 10

Appendix C - Code

The author uses functions to calculate the results and uses MATLAB as acalculation platform (see Appendix B). The code necessary to the reader ispresented below.

10.1 MATLAB

10.1.1 Twiss (Courant-Snyder) calculations

%% get twiss for each distribution

for w = 1:length(X) % depends on the number of elements/distributions[epsilonx(w), epsilony(w), epsilonz(w), betax(w),...

betay(w), betaz(w), alphax(w),...alphay(w), alphaz(w), gammax(w), gammay(w)..., gammaz(w), Hx(w), Hy(w), Hz(w)]...= firstCalcTwiss(X(w).data);

epsilonx(w) = epsilonx(w)*10ˆ6;epsilony(w) = epsilony(w)*10ˆ6;epsilonz(w) = epsilonz(w);betaz(w) = betaz(w)*10ˆ-3;

end

89

Page 95: Beam losses along the ESS LINAC due to nonlinear e ects ...

for q = 1:length(X) %element qgamma(q) = 1+(X(q).data(1,8)/(938.2720813));beta(q) = sqrt(1-1/(gamma(q)ˆ2));

end

alphax = alphax';alphay = alphay';alphaz = alphaz';betax = betax';betay = betay';betaz = betaz';gammax = gammax';gammay = gammay';gammaz = gammaz';epsilonx = epsilonx';epsilony = epsilony';epsilonz = epsilonz';Hx = Hx';Hy = Hy';Hz = Hz';%%clfsubplot(211)plot(Hx,'b')hold onplot(Hy,'g')hold onplot(Hz,'r')legend('Hx','Hy','Hz')title('Halo parameters')xlabel('nbr of elements')ylabel('Halo')subplot(212)plot(epsilonx,'b')hold onplot(epsilony,'g')hold onylabel('Norm.rms emittances (\pi.mm.mrad) for \epsilonx & \epsilony')yyaxis rightplot(epsilonz,'r')legend('\epsilonx','\epsilony','\epsilonz')title('Emittances')xlabel('nbr of elements')ylabel('Norm.rms emittance (\pi.dag.MeV) for \epsilonz')

90

Page 96: Beam losses along the ESS LINAC due to nonlinear e ects ...

function [epsxxp, epsyyp, epszzp, betaxxp, betayyp, betazzp,...alphaxxp, alphayyp, alphazzp, gammaxxp, gammayyp, gammazzp,...Hx, Hy, Hz ] = firstCalcTwiss(M)

format longmp0 = 938.2720813; %MEV/cˆ2c = 299792458; %m/s

%% Phase-space spread%Compensate for the displacement in phase-space

%get x and xprimex = M(:,1)-mean(M(:,1));xp = M(:,2)-mean(M(:,2));y = M(:,3)-mean(M(:,3));yp = M(:,4)-mean(M(:,4));

%Get the parameters

[alphaxxp,betaxxp,gammaxxp,epspxxp,betagamma] = getTwiss(x,xp,M);

%make the emittance constant by compensating for relativistic effectsepsxxp = epspxxp*betagamma;

[alphayyp,betayyp,gammayyp,epspyyp,betagamma] = getTwiss(y,yp,M);

epsyyp = epspyyp*betagamma;

%% momentum spread in longitudinal direction%getdp/p and z

dphi = M(:,5)*180/pi-mean(M(:,5)*180/pi);dW = M(:,6) - mean(M(:,6)); %MeV

%get the parameters[alphazzp,betazzp,gammazzp,epspzzp] = getTwissPhiW(dphi,dW,M);

epszzp=epspzzp; %*betagamma;%epspzzp*betagamma;

%% Halo

qx = M(:,1) - mean(M(:,1));px = M(:,2) - mean(M(:,2));

91

Page 97: Beam losses along the ESS LINAC due to nonlinear e ects ...

qy = M(:,3) - mean(M(:,3));py = M(:,4) - mean(M(:,4));qz = M(:,5) - mean(M(:,5));pz = M(:,6) - mean(M(:,6));qx2 = qx.ˆ2;qx3 = qx.ˆ3;qx4 = qx.ˆ4;qy2 = qy.ˆ2;qy3 = qy.ˆ3;qy4 = qy.ˆ4;qz2 = qz.ˆ2;qz3 = qz.ˆ3;qz4 = qz.ˆ4;

% calculate the 2D halo parameter. Convert into general case when get the% data from several locations along the linac.Hx = sqrt(3*mean(qx4)*mean(px.ˆ4)+9*(mean((qx2).*px.ˆ2)ˆ2)...

-12*mean(qx.*px.ˆ3)*mean((qx3).*px))/(2*mean(qx2)*mean(px.ˆ2)...-2*mean(qx.*px)ˆ2)-2;

Hy = sqrt(3*mean(qy4)*mean(py.ˆ4)+9*(mean((qy2).*py.ˆ2)ˆ2)...-12*mean(qy.*py.ˆ3)*mean((qy3).*py))/(2*mean(qy2)*mean(py.ˆ2)...-2*mean(qy.*py)ˆ2)-2;

Hz = sqrt(3*mean(qz4)*mean(pz.ˆ4)+9*(mean((qz2).*pz.ˆ2)ˆ2)...-12*mean(qz.*pz.ˆ3)*mean((qz3).*pz))/(2*mean(qz2)*mean(pz.ˆ2)...-2*mean(qz.*pz)ˆ2)-2;

function [ alphax,betax,gammax,epsphyscx,betagamma ] = getTwiss( xnew,xprimenew,M )

% beamchar; Nbr of particles Mass(MeV) Beam energy(MeV)%Beam frequency(MHz)% Beam courant(A) Beam charge%%1000 938.272 3.62179 352.21 0.0625 1%input data; x(mm) x'(mrad) y(mm) y'(mrad) z(mm)%z'(mrad) Phase(DEG) Time(s) Energy(MeV) Loss

%calculate xx,xxprime,xprimex,xprimexprime

for i = 1:length(xnew(:))xx(i) = xnew(i)*xnew(i);xxprime(i)=xnew(i)*xprimenew(i);xprimex(i) = xprimenew(i)*xnew(i);

92

Page 98: Beam losses along the ESS LINAC due to nonlinear e ects ...

xprimexprime(i) = xprimenew(i)*xprimenew(i);gamma(i) = 1+M(i,6)/(938.2720813);%gamma(i) = 1+M(i,9)/(938.2720813);beta(i) = sqrt(1-1/((gamma(i)ˆ2)));

end

%calc <xx> and so on

sigmaxsquare=mean(xx);sigmaxxprimesquare=mean(xxprime);sigmaxprimexsquare=mean(xprimex);sigmaxprimexprimesquare=mean(xprimexprime);

%relativistic betagamma compensationgammaav = mean(gamma);betaav = mean(beta);

betagamma = gammaav*betaav;

%Creating the sigma matrix

sigma = [sigmaxsquare sigmaxxprimesquare;sigmaxprimexsquare...sigmaxprimexprimesquare];

%claculating the physical epsylonepsphyscx = sqrt(det(sigma));

%calculating beta,gamma and alpha

betax = sigma(1,1)/epsphyscx;alphax = -sigma(2,1)/epsphyscx;gammax = sigma(2,2)/epsphyscx;end

General comments on the code

To be able to calculate the Twiss parameters, built in functions as the “mean”and standard mathematical operations are used [24].

10.1.2 Distribution analysis

93

Page 99: Beam losses along the ESS LINAC due to nonlinear e ects ...

%% normalizing beam physics stylexnew = [];p = [];for u = 1:length(X) %%MEBT 1:106xnew{u} = X(u).data(:,1)/(sqrt(betax(u))*beta(u));p{u} = (alphax(u).*X(u).data(:,1) + betax(u).*X(u).data(:,2)).../(sqrt(betax(u))*beta(u));end

for t = 1:length(X)w = waitforbuttonpresstprobplot(p{t})%axis([-0.1 0.1 -3.8 3.8])

end

%%% radius thing

for t = 1:length(xnew)xx = xnew{t};pp = p{t};r{t} = sqrt(xx.ˆ2+pp.ˆ2);%/sqrt(betax(t));

end

%% ecdffor t = 1:length(X)

w = waitforbuttonpressstairs(sort(r{1}),(1:length(r{1}))/length(r{1}),'r')grid onhold onstairs(sort(r{t}),(1:length(r{t}))/length(r{t}),'b')hold off

end

%% x and pfor t = 1:length(xnew)

[hx(t) px(t) ksx(t)] = kstest2(xnew{1},xnew{t});[hp(t) pp(t) ksp(t)] = kstest2(p{1},p{t});

end

94

Page 100: Beam losses along the ESS LINAC due to nonlinear e ects ...

figureplot(ksx,'-o')title('KS-statistic')hold onplot(ksp,'-.')xlabel('comparisons')ylabel('KS-statistic')legend(' normalized x','normalized xprime')

%% r%%r{1},r{i} to compare with imput distributionfor i = 1:length(xnew)-1

[hr(i) pr(i) ksr(i)] = kstest2(r{i},r{i+1},0.95);end

figureplot(ksr,'-o')title('KS-statistic of the raduis')xlabel('comparisons')ylabel('KS-statistic')legend(' the raduis difference evolution')

General comments on the code

In this section, bulit-in functions as “probplot”, “stairs” and “kstest2” areused. These functions are all taken from the statistical toolbox package forvisualization and easy computation [24].

10.1.3 EVT

%%clearvars -except lossDataclose all%%lossData = [];numSimulations = 20000;

for k = 1:numSimulationsmyfilename = sprintf...

('/final/calc 0.4 0.2 forIrenaHugeSim/%d/powlost',k-1);lossData(:,k) = hdf5read('Density huge.h5',myfilename);

95

Page 101: Beam losses along the ESS LINAC due to nonlinear e ects ...

end

myfilename2 = sprintf('/final/calc 0.4 0.2 forIrenaHugeSim/1/nelp');nelp = hdf5read('Density huge.h5',myfilename2);

%% get data for gev fitfor i = 1:length(lossData(1,:))

sumLosses(i) = 1/length(1:9146)*sum(lossData(1:9146,i));lossMax(i) = max(lossData(1:9146,i));sumL(i) = sum(lossData(1:9164,i));

end%lossMax = sumLosses;figurehist(lossMax,1000)

[paramhat,paramci] = gevfit(lossMax);

kMLE = paramhat(1); %Shape parametersigmaMLE = paramhat(2); % Scale parametermuMLE = paramhat(3); % Location parameter

kCI = paramci(:,1);sigmaCI = paramci(:,2);muCI = paramci(:,3);

lowerBnd = muMLE-sigmaMLE./kMLE;%% visual representation

figureymax = 1.1*max(lossMax);%bins = floor(lowerBnd):ceil(ymax);bins = 1000000;h = bar(bins,histc(lossMax,bins)...

/length(lossMax),'histc');h.FaceColor = [.9 .9 .9];ygrid = linspace(lowerBnd,ymax,20000);line(ygrid,gevpdf(ygrid,kMLE,sigmaMLE,muMLE));xlabel('Block Maximum');ylabel('Probability Density');xlim([lowerBnd ymax]);

%%figure[F,yi] = ecdf(lossMax);

96

Page 102: Beam losses along the ESS LINAC due to nonlinear e ects ...

plot(ygrid,gevcdf(ygrid,kMLE,sigmaMLE,muMLE),'-');hold on;stairs(yi,F,'r');hold off;xlabel('losses (W)');ylabel('Cumulative Probability');legend('Fitted Generalized Extreme Value CDF',...

'Empirical CDF','location','southeast');xlim([lowerBnd ymax]);

%% return value

R10MLE = gevinv(1-1./100,kMLE,sigmaMLE,muMLE)nllCritVal = gevlike...

([kMLE,sigmaMLE,muMLE],lossMax) + 0.5*chi2inv(0.95,1)

%%figureCIobjfun = @(params) gevinv(1-1./100,...

params(1),params(2),params(3));CIconfun = @(params) deal(gevlike(params...

,lossMax) - nllCritVal, []);

opts = optimset('Algorithm','active-set', 'Display','notify', 'MaxFunEvals',...500,'RelLineSrchBnd',.1, 'RelLineSrchBndDuration',Inf);

[params,R10Lower,flag,output] = ...fmincon(CIobjfun,paramhat,[],[],...[],[],[-inf;0;-inf],[inf;inf;inf],CIconfun,opts);

CIobjfun = @(params) -gevinv(1-1./100,params(1)...,params(2),params(3));

[params,R10Upper,flag,output] = ...fmincon(CIobjfun,paramhat,[],[],[],[],...[-inf;0;-inf],[inf;inf;inf],CIconfun,opts);

R10Upper = -R10Upper;

R10CI = [R10Lower, R10Upper]

plot(ygrid,gevcdf(ygrid,kMLE,sigmaMLE,muMLE),'-');hold on;stairs(yi,F,'r');plot(R10CI([1 1 1 1 2 2 2 2]), [.88 .92 NaN .9...

.9 NaN .88 .92],'k-')hold off;xlabel('Block Maximum');

97

Page 103: Beam losses along the ESS LINAC due to nonlinear e ects ...

ylabel('Cumulative Probability');legend('Fitted Generalized Extreme Value CDF','Empirical CDF', ...

'R {10} 95% CI','location','southeast');xlim([lowerBnd ymax]);

R10grid = linspace(R10CI(1)-.01*diff(R10CI),...R10CI(2)+.05*diff(R10CI), 51);

PLobjfun = @(params) gevlike(params,lossMax);

Lprof = nan(size(R10grid));params = paramhat;[dum,peak] = min(abs(R10grid-R10MLE));

for i = peak:1:length(R10grid)PLconfun = ...

@(params) deal([], gevinv(1-1./100 ...,params(1),params(2),params(3)) - R10grid(i));

[params,Lprof(i),flag,output] = ...fmincon(PLobjfun,params,[],[],[],[],[-inf;0;-inf]...,[Inf;inf;inf],PLconfun,opts);

end

params = paramhat;

for i = peak-1:-1:1PLconfun = ...

@(params) deal([], gevinv(1-1./100,...params(1),params(2),params(3)) - R10grid(i));

[params,Lprof(i),flag,output] = ...fmincon(PLobjfun,params,[],[],[],[],[-inf;0;-inf]...,[inf;inf;inf],PLconfun,opts);

end

plot(R10grid,-Lprof,'-', R10MLE,-gevlike(paramhat,lossMax),'ro', ...[R10grid(1), R10grid(end)],[-nllCritVal,-nllCritVal],'k--');

xlabel('R {100}');ylabel('Log-Likelihood');legend('Profile likelihood','MLE','95% Conf. Limit');

General comments on the code

Several file-extracting routines (such as “sprintf” and “hdf5read”) are usedto extract the data from the huge HDF5-file where the reults from the 20000simulation were stored. Functions as “hist”, “gevfit”, “gevpdf”, “gevcdf”,

98

Page 104: Beam losses along the ESS LINAC due to nonlinear e ects ...

“gevinv”, “gevlike”, “chi2inv” and “ecdf” are taken from the statistical tool-box to be able to do the EVT application in a good manner. Also, routinesfrom the optimization toolbox are used to maximize the log-likelihood func-tion [24].

99

Page 105: Beam losses along the ESS LINAC due to nonlinear e ects ...

Bibliography

[1] C.K Allen and T.P. Wangler. “Beam halo definitions based upon mo-ments of the particle distribution”. In: Physical Review - Acceleratorsand beams 5.124202 (2002).

[2] Jeff A. Bilmes. “A Gentle Tutorial of the EM Algorithm and its Ap-plication to Parameter Estimation for Gaussian Mixture and HiddenMarkov Models”. In: Computer Science Division, U.C Berkley (1998).

[3] G Blom and Jan et al. Enger. Sannolikhetsteori och statistikteori medtillampningar. Studentlund AB, Lund, 2005. isbn: 978-91-44-02442-4.

[4] S Boyd and L. Vandenberghe. Convex Optimization. Cambridge Uni-versity Press, New York, 2004. isbn: 78-0-521-83378-3.

[5] S Coles. An Introduction to Statistical Modeling of Extreme Values.Springer-Verdlag, London, 2001. isbn: 9781852334598.

[6] A. DasGupta. Asymptotic Statistics of Statistics and Probability. SpringerScience+Business Media, LLC, 233 Spring Street, New York, NY, 10013,USA, 2008. isbn: 978-0-387-75970-8.

[7] R Duperrier and D. Uriot. “Application of the extreme value theory tobeam loss estimates in the SPIRAL2 linac based on large scale MonteCarlo computations”. In: Physical Review Special Topics - Acceleratorsand Beams 9.044202 (2006).

[8] G.H Givens and J.A Hoeting. Computational Statistics. John Wiley &Sons, Inc. Hoboken, New Jersey, 2013. isbn: 978-0-470-53331-4.

[9] D.J Griffith. Introduction to Electrodynamics. CRC Press, Taylor andFrancis Group, 2014. isbn: 978-1-4665-8618-5.

100

Page 106: Beam losses along the ESS LINAC due to nonlinear e ects ...

[10] A. Gut. An Intermediate Course in Probability. Springer Science+BusinessMedia, LLC, 233 Spring Street, New York, NY 10013, USA), 2009.isbn: 978-1-4419-0161-3.

[11] U.J.S Hjort. Computer Intensive Statistical Methods. Chap. & H, 1993.isbn: 9780412491603.

[12] S. Holm. “A Simple Sequentially Rejective Multiple Test Procedure”.In: Scandinavian Journal of Statistics 6.2 (1979), pp. 65–70.

[13] A Jakobsson. An introduction to Time Series Analysis. Studentlitter-atur AB, Lund, 2015. isbn: 978-91-44-10836-0.

[14] G et al. Lindgreen. Stationary Stochastic Processes for Scientists andEngineers. CRC Press, Taylor and Francis Group, 2014. isbn: 978-1-4665-8618-5.

[15] Simon J.A Malham. “An Introduction to Hamiltonian Mechanics”. In:(2016).

[16] K.V. Mardia. “Measures of Multivariate Skewness and Kurtosis withapplications”. In: Biometrica 57.3 (), pp. 519–530.

[17] G et al. Marsaglia. “Evaluating Kolmogorov’s Distribution”. In: ().

[18] Jr Massey Frank J. “The Kolmogorov-Smirnov test for Goodness ofFit”. In: Journal of the American Statistical Association 46.253 (1951).

[19] R Miyamoto and M et.al Eshraqi. “Beam loss and collimation in theESS linac”. In: ().

[20] S Ray and B.G Lindsay. “A Topography of Multivariate Normal Mix-tures”. In: The Annals of Statistics 33.5 (2005), pp. 2042–2065.

[21] K. Schindl. “SPACE CHARGE”. In: CERN,CH-1211 Geneva 23 ().

[22] Editor S.Peggs. Technical Design Report. ESS, 2013. isbn: 978-91-980173-2-8.

[23] J.W Svantesson T. Wallace. “Tests for assessing Multivariate Normal-ity and the Covariance Structure of MIMO Data”. In: Department ofElectrical Engineering UT-84602-4099 ().

[24] The Language of Technical Computing. https://se.mathworks.com/.Accessed: 2016-10-31.

[25] D Uriot and N. Pinchoff. TraceWin. Released under CEA licence. 2016.

101

Page 107: Beam losses along the ESS LINAC due to nonlinear e ects ...

[26] Thomas. P Wangler. RF Linear Accelerators. WILEY-VHC VerlagGmbH & Co., 2008. isbn: 978-3-527-40680-7.

[27] Sverker Werin. Accelerator technique. Max-lab, Lund, 2006.

[28] Helmut Wiedemann. Particle Accelerator Physics. Stanford University,2007. isbn: 978-3-540-49043-2.

[29] E.J.N Wilson. An Introduction to Particle Accelerators. Oxford Uni-versity Press Inc., New York, 2001. isbn: 0-19-850829-8.

102