Je

tiens tout d'abord à remercier Frank Zimermann et Riccardo Bartolini d'avoir accepté d'être rapporteurs pour cette thèse. Tout comme je remercie aussi Ryutaro Nagaoka, Achille Stocchi, Alexandre Loulergue et Clément Evain pour leur participation au jury. Merci également à Pierre Lepercq et à Angeles Faus-Golfe pour leur relecture de ma thèse.

Mes plus grands remerciements vont à Christelle Bruni, qui m'a fait confiance et grâce à qui j'ai pu passer ces trois dernières années à apprendre dans le meilleur des cadres. Merci beaucoup pour tout nos échanges, scientifiques ou non, qui m'ont beaucoup apporté, pour la passion dont tu fais preuve pour ton métier et surtout pour ta grande humanité. Tu as fait bien plus que ne l'exigeait ta fonction, merci encore.

Merci également à Pierre Lepercq pour m'avoir aidé à démarrer sur les champs de sillages et sur les simulations. Pour m'avoir énormément aidé avec les mesures d'impédance, pour ta disponibilité et aussi pour ton humour impayable ! Le travail que j'ai effectué durant ces trois années aurait été impossible sans le soutien de nombreuses personnes au sein du LAL, en particulier au sien du Depacc, mais aussi en dehors du laboratoire. Merci à l'ensemble des membres du Depacc pour leur accueil. Merci à Marica Biagini pour m'avoir invité au workshop LER et pour avoir relu mes écrits. Merci à Jacques Haïssinski pour ces discussions passionnantes sur la physique et pour avoir bien voulu me relire. Je tiens aussi à remercier Damien Le Guidec pour son indispensable contribution au banc de mesure d'impédance, son optimisme bienvenu et sa bonne humeur. Merci à Bruno Mercier pour nos échanges. Merci à Alexandre Loulergue pour ses conseils avisés sur la dynamique faisceau. Merci à Ryutaro Nagaoka pour sa disponibilité et sa gentillesse. Merci à Philip Bambade et à Jean-Marie De Conto pour m'avoir fait découvrir un domaine qui aujourd'hui me passionne. Et merci à tous les autres doctorants et post-doctorants pour les bon moments que nous avons partagé.

Je souhaite aussi remercier chaleureusement tous les professeurs et les enseignants qui ont m'ont beaucoup appris tout au long de mes études. Ma réussite est aussi la leur.

Enfin, je souhaite remercier toute ma famille et mes amis pour leur soutien et leurs encouragements pendant cette période. Merci d'avoir compris que l'espacement croissant de mes retours n'atténue en rien l'attachement que je vous porte. Je continuerai à essayer de vous expliquer "ce que je fais exactement dans mon labo". Merci à mes amis pour les moments d'évasion en leur compagnie. Merci à mes grand-parents pour leur gentillesse. Une pensée pour Manou qui aurait été fière et heureuse. Merci à mes soeurs, sans lesquelles rien n'eut été pareil. Merci à mon père, pour tout ce qu'il a fait et pour être toujours prêt à m'aider quand j'en ai besoin. Merci à ma mère, qui a tout donné pour me donner ma chance. Merci à Élodie, pour m'avoir dit oui, pour sa présence et son amour.

If there is full longitudinal coherence, |ρ(ω)| ≈ 1, then the total radiation intensity is proportional to N 2 .

Table of contents

Problem statement and scope of the thesis 1.1 Introduction X-rays are an electromagnetic radiation constituted of photons which ranges from 100 eV to 100 keV. The discovery of X-rays is usually attributed to Wilhelm Röntgen in 1895 as he was the first to systematically study them. During his experiment, he used a Crookes tube, an in-vacuum device with two electrodes at each tube extremities, to accelerate electrons to high enough energy to produce X-rays when hitting the anode or the glass tube.

As this radiation has a very low wavelength, from 10 nm to 10 pm, it allows to probe the matter at the atomic scale. X-rays are absorbed by dense matter and heavy elements but can pass through sparse matter and light elements. The X-ray discovery was a veritable breakthrough and led to extensive and quick developments in many fields such as radiography, crystallography, tomography and radiotherapy.

Nowadays X-rays are widely used in many applications. They are used in the medical field in all sort of medical diagnostics and imagery [START_REF] Villafana | Generators, x-ray tubes, and exposure geometry in mammography[END_REF] [2] [3] [START_REF] Alwmark | A 3-d study of mineral inclusions in chromite from ordinary chondrites using synchrotron radiation x-ray tomographic microscopy-method and applications[END_REF]. They are also used in radiotherapy to treat cancerous cells and used in synergy with usual methods to greatly improve their efficiency [START_REF] Biston | Cure of fisher rats bearing radioresistant f98 glioma treated with cis-platinum and irradiated with monochromatic synchrotron x-rays[END_REF]. Among others, X-rays are also used in art history, in astronomy, in geology and in palaeontology [START_REF] Cotte | Synchrotron-based x-ray absorption spectroscopy for art conservation: looking back and looking forward[END_REF] [START_REF] Echard | In situ multi-element analyses by energy-dispersive x-ray fluorescence on varnishes of historical violins[END_REF] [8] [START_REF] Schleede | Multimodal hard x-ray imaging of a mammography phantom at a compact synchrotron light source[END_REF].

Because of the large usage range, there is a high demand for X-ray sources. The easiest way to produce X-rays is to use tubes similar to the one used by Röntgen for the X-ray discovery. But this method does not produce the high brilliance needed to do most of the experiments. The brilliance is the quantity which characterises the photon flux at a given wavelength per spot size on the sample. To produce these high brilliance photons, accelerator-based methods, such as a synchrotron or a free electron laser (FEL), are needed.

Synchrotron light sources are circular electron accelerator designed to optimise the synchrotron radiation produced by the curvature of the electron trajectory. X-ray free electron lasers (FEL) are linac based sources. The electrons produce synchrotron radiation in the undulators, a periodic structure of dipole magnets. The radiation emitted interacts with the electrons which lead to a micro-bunching regime where the photons are emitted coherently and are amplified. This Chapter 1. Problem statement and scope of the thesis effect is called the self-amplified spontaneous emission (SASE) regime. These sources are able to produce extremely brilliant X-rays but it is at the cost of an heavy infrastructure as synchrotron are usually several hundred metres long and FELs several kilometres long.

The other method which allows to produce brilliant X-rays with smaller sized sources use Compton backscattering (CBS) [START_REF] Huang | Laser-electron storage ring[END_REF]. Compton scattering is the interaction between a photon and a charged particle which results in an energy transfer from the photon to the particle. Compton backscattering, or inverse Compton scattering, can occur when an accelerated electron beam is scattered with photons, it is then the photons which gain energy from the interaction. This effect is the most efficient way to boost photon energy as the energy gain is proportional to square of the Lorentz factor γ of the electrons. For 50 MeV electrons, the photons gain a factor 4γ 2 ≈ 40000 in energy. It is then possible to produce X-rays from photons with wavelength ranging in the visible and with relatively low energy electrons. This allows the possibility to build a relatively compact X-ray source with high brilliance. There are many Compton sources, with different type of architectures, in operation or in design phase around the world [START_REF] Eggl | The munich compact light source: initial performance measures[END_REF] [START_REF] Chaleil | Inverse compton scattering x-ray source yield optimization with a laser path folding system inserted in a pre-existent RF linac[END_REF] [START_REF] Bacci | Status of the STAR project[END_REF] [13] [START_REF] Xu | Design of a 4.8-m ring for inverse compton scattering x-ray source[END_REF] [15] [START_REF] Bulyak | Compact x-ray source based on compton backscattering[END_REF].

ThomX is a compact Compton backscattering (CBS) X-ray source which is under construction at the Laboratoire de l'Accélérateur Linéaire (LAL), Orsay, France [START_REF] Variola | ThomX technical design report[END_REF] [START_REF] Bruni | [END_REF]. In this machine, electrons are accelerated and injected into a storage ring where they interact with a laser to produce X-rays via CBS. The global aim of the machine is then to maximise the X-ray flux produced. The electron storage ring has been designed with this intent which makes the electron beam dynamics very different from the beam dynamics in usual storage rings dedicated to synchrotron radiation production [START_REF] Bruni | Electron beam dynamics in the 50 MeV ThomX compact storage ring[END_REF] [START_REF] Loulergue | Compact ring for the ThomX-ray source[END_REF] [START_REF] Drebot | Electron beam dynamics with and without compton back scattering[END_REF]. The difference results from damping times long compared to the storage time and from the injection of a bunch without longitudinal matching. The outcome is a beam dynamics in a transient regime far from the equilibrium state usually reached in electron storage rings. Besides, the electron bunch injected has a low energy, 50 MeV, a relatively high charge, 1 nC, and a short duration, a few ps, which implies very strong collective effects inducing a microbunching instability during the transient regime. Table 1.1 shows a comparison of the storage ring parameters for ThomX and a typical 3rd generation synchrotron light source. In this chapter, the particularities of ThomX storage ring are highlighted to explain the new difficulties of its beam dynamics and the scope of this thesis.

A storage ring without damping

From the point of view of the storage ring, there are two main ways to increase the X-ray flux: either by decreasing the electron beam size, and taking care of a good overlap between the electrons and the photons, or by increasing the bunch charge. As the beam energy in the storage ring is only 50 MeV, compared to several GeV in usual electron synchrotrons, the beam is very sensible to an important range of collective effects which can degrade the beam quality. To maintain a high X-ray flux it is necessary to manage both the collective effects which increase the transverse emittances, thus increasing the beam size, and the collective effects which cause beam losses.

The Touschek effect and the intra beam scattering (IBS) are two collective effects which can explain some of the design choices for ThomX. Within a bunch, there is a probability for elastic collisions between particles. During this collision process, there is a momentum transfer between the 1.2. A storage ring without damping two particles. If the collision transfers some transverse momentum from the betatron oscillations to the longitudinal momentum, the particles can be lead out of the momentum acceptance and be lost. This effect, corresponding to beam losses due to elastic scattering, is called Touschek effect and is characterised by the Touschek lifetime τ T for which the bunch charge will have decrease by 66%. The Touschek lifetime is τ T = 10 s in ThomX case [START_REF] Bruni | [END_REF]. This value is very small compared to most electron synchrotrons because ThomX is a low energy machine and the Touschek lifetime scales as γ 2 [START_REF] Wiedemann | Particle accelerator physics[END_REF].

The IBS corresponds to the elastic scattering not provoking beam losses. Apart from the collisions leading to direct particle losses, there are multiple collisions which bring only small changes on momentum. These collisions lead to a coupling of the transverse emittances which increase the beam size. The emittance grow time for ThomX are τ IBS,s = 58.1 ms, τ IBS,x,y = 12.0 ms. The IBS is much stronger in ThomX than in typical 3rd generation light sources as the grow time is proportional to γ 3 (in the high energy approximation [START_REF] Bane | A simplified model of intrabeam scattering[END_REF]). After 20 ms, the IBS results in an increase of the energy spread of 5 % and a factor 5 of increase for the transverse emittances as shown in a) and b) of Fig. 1.1 [START_REF] Bruni | Electron beam dynamics in the 50 MeV ThomX compact storage ring[END_REF].

Usually, in electron machines, this effect is counterbalanced by an effect called the synchrotron radiation damping. Synchrotron radiation is radiated by the beam in the bent sections of the accelerator. As the synchrotron radiation power is energy dependent, a particle with a higher energy radiates more than a particle with a lower energy. Therefore it causes a reduction, a damping, of the energy spread within the bunch. The global energy loss is compensated by the RF cavities via an increase of the longitudinal momentum. The photons emitted by the synchrotron radiation are mainly radiated in the particle direction of propagation. Since the particles are oscillating transversally (betatron oscillations) some of the energy loss during synchrotron radiation is correlated to a loss of transverse momentum. This transverse momentum loss is not compensated as the accelerating fields only provide longitudinal momentum, which induces a reduction of the transverse oscillations called damping. The characteristic times for this phenomenon are called damping times, for ThomX they are τ RS,x,y = 5.1 s for the transverse damping time and τ RS,s = Chapter 1. Problem statement and scope of the thesis Each quantity is normalised to its value at injection. Parameters: geometric emittance x,0 = 5 • 10 -8 m rad, energy spread σ e,0 = 0.3 %, charge Q = 1 nC. Figure from [START_REF] Bruni | Electron beam dynamics in the 50 MeV ThomX compact storage ring[END_REF].

1.2. A storage ring without damping 2.6 s for the longitudinal damping time.

In addition to the synchrotron radiation damping, there is another source of damping in ThomX due to the Compton backscattering (CBS). The principle is similar to the damping via synchrotron radiation with slightly shorter damping times: τ CBS,x,y = 1.6 s and τ CBS,s = 0.8 s. The global damping times considering both effects are τ x,y = 1.2 s and τ s = 0.6 s, obtained using [START_REF] Bruni | [END_REF]:

1 τ = 1 τ RS + 1 τ CBS . (1.1)
There is also a quantum excitation linked to both effects, due to the random nature of both radiation processes. The amplitude of this excitation is tied to the energy of the photon emitted. In usual electron storage rings, it is this quantum excitation which limits the synchrotron radiation damping and sets the equilibrium. In ThomX, as the electron energy is low, the synchrotron radiation energy is very low and the quantum excitations due to the synchrotron radiation can be neglected. But the X-rays produced by the CBS have a mean energy of < E X >≈ 22 keV, bringing important energy fluctuations for the electrons of the bunch doing Thomson scattering. The overall effect of these fluctuations due to CBS is to heat the beam in the longitudinal phasespace. At each interaction with the laser beam, the relative energy spread of the bunch is increased by:

δ CBS = 1 2 < E X > E 0 N X N e ≈ 2.5 × 10 -6 , (1.2)
where N X is the number of photons emitted at each interaction, N e is the number of electrons within a bunch and E 0 the electron energy. In 20 ms, the energy spread is increased by about 20 % because of this CBS induced heating as shown in a) of Fig. 1.1.

In usual electron synchrotrons, an equilibrium is reached between the synchrotron radiation damping, which tends to shrink the emittances, and the adversarial effects like the synchrotron radiation quantum excitation and the IBS, which tend to increase them. In ThomX, the damping is only effective in the transverse plane as the longitudinal damping is much weaker than the heating due to CBS. The beam is damped in the transverse plane in about 5τ x,y ≈ 6 s. At this time, nearly 50 % of the bunch charge is lost due to Touschek effect and the longitudinal bunch phasespace is much degraded by the CBS heating. So, in order to maintain both the beam charge and the transverse emittances to produce an important X-ray flux, the choice has been made during the machine design to work in pulsed mode: a new bunch injected every 20 ms while the older one is extracted. This choice solves the matter of the low Touschek lifetime but brings additional complications as the beam dynamics considered in ThomX corresponds to a transient regime where the radiation damping has next to no effect. A direct consequence of the absence of radiation damping is that the beam is very sensible to every perturbation as once the beam is disturbed it will not recover within the storage time. In this aspect, the electron beam dynamics in ThomX can be compared to the usual beam dynamics in hadron synchrotrons where the damping time is very long compared to the storage time. But in ThomX the bunch length is very short, a few ps at injection, compared to the usual bunch length in hadron machines, some ns. Consequently, some effects which are not relevant for hadron machines play an important role in ThomX beam dynamics, for example the Chapter 1. Problem statement and scope of the thesis coherent synchrotron radiation (CSR).

Injection without longitudinal matching

An other reason why ThomX beam dynamics is very different from beam dynamics in usual electron storage rings is that the beam from the transfer line (TL) is injected without longitudinal matching. When transferring a beam from one accelerator to another, some conditions are needed to adapt the injected bunch to the accelerator, these conditions are referred as matching. The absence of matching or a mismatch may lead to a phase space dilution and beam losses. In the particular case of longitudinal matching, the injected bunch must have dimensions corresponding to the RF bucket. If the RF bucket is too small compared to the bunch dimensions in the phase space, then the part of the bunch which is outside of the bucket will be lost. If the injected bunch phase space fits inside the RF bucket but its form is not matched to one of the RF bucket then a longitudinal emittance dilution will occur by a process called filamentation. Such a case is shown in Fig. 1.2, where a Gaussian bunch is injected into ThomX ring nominal lattice without matching. The filamentation observed in Fig. 1.2 is due to the fact that the synchrotron motion is not perfectly linear. The synchrotron frequency Ω s changes with the oscillation amplitude so the body of the bunch and its tails do not rotate at the same speed on the longitudinal phase space. For small oscillation amplitudes and a relativistic beam, the synchrotron angular frequency Ω s is given by [START_REF] Wiedemann | Particle accelerator physics[END_REF]:

Ω s = f 0 2πhη c eV RF cos(φ s ) E 0 , (1.3)
where f 0 is the ring revolution frequency, h is the harmonic number defined by h = f RF f 0 , e is the elementary charge, φ s is the synchronous phase, E 0 is the beam energy and η c is the momentum compaction defined by:

η c = 1 γ 2 -α 1 , (1.4)
where γ is the relativistic Lorentz factor and α 1 is the first order of the momentum compaction factor. The different order of the momentum compaction factor, α i being defined by the path length variation ∆L with respect to the lattice length L 0 for off-momentum particles:

∆L L 0 = + α 1 δ + α 2 δ 2 + α 3 δ 3 + α 4 δ 4 + O(5) , (1.5)
where is the momentum independent term and δ is the particle relative energy difference to the reference energy. Then, at first order, longitudinal matching condition is given by [START_REF] Wiedemann | Particle accelerator physics[END_REF]:

σ δ = Ω s |η c | σ s , (1.6)
where σ δ is the rms energy spread of the bunch, σ s is the rms bunch duration. In ThomX, the bunch is injected from the TL without longitudinal matching to save, both the space and the cost, of an harmonic cavity, which would have been needed to match the bunch before injection. The injected bunch undergoes filamentation and fills the RF bucket after several 1.4. Scope of the thesis Figure 1.2: Longitudinal phase space (longitudinal position s versus the relative energy deviation δ) of a Gaussian bunch injected in ThomX nominal lattice with a mismatch. The four plots show the longitudinal phase space at different times, at injection (turn number T = 0) and after 50, 300 and 3000 turns. Parameters of the input bunch: σ s = 1 mm, σ δ = 3 • 10 -3 . Simulation done without collective effects using 50 000 macro-particles with CODAL, see section 6.2. tens of thousand turns, the resulting bunch is a much longer bunch with a more important energy spread. The filamentation process is also strongly affected by collective effects, in particular the CSR, which seeds a micro-bunching instability and speeds up the phase-space mixing.

Scope of the thesis

This results in a transient micro-bunching regime which lasts from the injection to the full filling of the RF bucket. This very quick process, about 1 ms, determines the shape of the beam for the dynamics following this transient regime in the storage ring. As there is no damping within the storage time, it is crucial to manage the transient regime in order to keep both a high charge and low beam emittances to deliver the expected X-ray flux. The transient regime is studied in the part I of this thesis.

Part I deals with the design and the measurement of a longitudinal impedance model (including geometric, resistive wall and CSR wakefields) for ThomX storage ring in order to study the beam dynamics in the transient micro-bunching regime. The goal of this part being both to obtain the impedance model to support beam dynamics studies and to optimise the maximum bunch charge in the transient micro-bunching regime. The ThomX Compton source is briefly presented in chapter 2. Then in chapter 3, the collective effects which are relevant for this thesis are qualitatively introduced and the formalism used to deal with them is explained. In chapter 4, the geometric impedance model is obtained using simulation or analytical modelling Chapter 1. Problem statement and scope of the thesis of the individual elements and is checked using wire measurements on prototypes when available. Afterwards, the coherent synchrotron radiation (CSR) is simulated in a rectangular vacuum chamber to take into account transient effects and resonances in chapter 5. Finally, as the transient micro-bunching regime is very sensible to the injected bunch phase space, the beam dynamics is evaluated using start to end simulations, from the photocathode to the storage ring. The results of the beam dynamics studies in the transient micro-bunching regime are shown in chapter 6.

After the transient regime dominated by the CSR wakefields, the matched beam is still sensible to a large range of collective effects, which can degrade beam quality or lead to beam instabilities, during the rest of its storage time. Among them, the Touscheck effect, the IBS and the effect of the CBS are impacting the beam dynamics in a long time scale compared to the transient regime duration and are out of the scope of this thesis. Another collective effect, the ion cloud produced by the ionisation of the residual vacuum molecules, is studied after the transient regime in part II. The ions produced can be trapped by the negative beam potential of the electron beam and accumulate enough to impact the electron beam dynamics and drive coupled instabilities between ions and electrons. Using mitigation techniques, like clearing electrodes or clearing gaps, it is possible to limit the ion accumulation and prevent any instabilities. To design effective mitigation strategies, it is crucial to understand the ion cloud dynamics and the mechanisms leading to ion accumulation. Particularly, a study of the ion cloud longitudinal dynamics is necessary for an optimal positioning of the clearing electrodes. The ion cloud dynamics and the mitigations designed to prevent ion induced effect on the electron beam in ThomX are studied in part II of this thesis. As mitigations are used to prevent high ion accumulation, ThomX is well outside of the range of ion induced instabilities and thus the coupled dynamics between ions and electrons is outside of the scope of this thesis. So the ion cloud dynamics is studied in the case of a "rigid" electron beam which do not feel the effect of the ion cloud.

Part II starts off with an historical picture of the matter of ion trapping in electron accelerators and some insight is given for future machines. In chapter 7, the various effects impacting the ion cloud dynamics are discussed. Starting from the interaction between an electron of a beam and an ion from residual vacuum, the model we use to describe the 3D beam-ion interaction is explained and its limitations are highlighted. The ion accumulation conditions from the longitudinal component of the beam-ion are discussed. The motion of ions in dipole magnets is presented and illustrated by simulations. The magnetic mirror effect and the condition to have an ion trapped in a dipole are also explained. Then, in chapter 8, simulations of the longitudinal and transverse ion cloud dynamics in ThomX are presented. The simulation code NUAGE for ion cloud tracking is presented and the effect of mitigations on ion dynamics is illustrated by simulations. Finally, in chapter 9, the matter of the multi-ionisation and of the ion dissociation is tackled and the ion cloud effect on the electron bunch is discussed.

Chapter 2

A Compton X-ray source: ThomX "We publish in concrete and steel" -Sir John B. Adams, accelerator physicist and former CERN DG ThomX is a Compton backscattering (CBS) X-ray source which will soon be commissioned at the Laboratoire de l'Accélérateur Linéaire (LAL), Orsay, France [START_REF] Variola | ThomX technical design report[END_REF]. The collaboration supporting ThomX is composed of French laboratories gathering expertise in accelerator physics (LAL, SOLEIL), in optic resonators and lasers (LAL, CELIA) and in X-ray instrumentation and usage (Neel Insitute, ESRF, INSERM). ThomX aims to demonstrate the possibility to build compact and cost effective X-ray sources, opening the possibility to build CBS in laboratories, hospitals and museums. The goal is to obtain a flux between 10 11 ph s -1 and 10 13 ph s -1 in the hard X-ray range. The X-ray energy is tunable between 50 keV and 90 keV by changing the electron energy. Chapter 2. A Compton X-ray source: ThomX are produced at 50 Hz by a photo-injector (A). These electron bunches are accelerated to [START_REF] Venturini | Models of longitudinal space-charge impedance for microbunching instability[END_REF] MeV by a warm linac (B). The electrons are then transported in the transfer line (C) to be injected in the storage ring (D). At each turn of the electrons into the storage ring, the electrons interact with the laser stored into the Fabry-Perot cavity (F). The Compton interaction between the electrons and the photons produces X-rays in direction of the X-ray beam-line (G). Every 20 ms, the electron bunch is extracted from the storage ring into the extraction line (E) and a new one is injected. The electron beam production takes place in the photoinjector [START_REF] Villafana | Generators, x-ray tubes, and exposure geometry in mammography[END_REF]. The photoinjector is composed of a normal conducting 2.5 cell 3 GHz standing-wave RF gun, a magnesium photocathode, a laser system and by solenoid magnets. The electrons are extracted from the photocathode using a combination of photoelectric and field emission. The laser hits the photo-cathode to extract electrons (photoelectric effect), the energy needed to extract electrons from the metallic cathode is lowered by the external RF field applied (Schottky effect), when this energy is low enough the electrons can also be emitted via quantum tunnelling (field emission). Then these electrons are accelerated up to 5 MeV by the 80 MV m -1 RF field of the gun and guided by the combination of the RF fields and the solenoids to the linac.

The magnetic field of the solenoids is designed to focus the divergent beam at the linac entrance while maintaining a magnetic field near zero at the cathode and compensate emittance increase due to space charge [START_REF] Garolfi | High-gradient s-band electron linac for ThomX[END_REF]. The temporal structure of the output electron bunches is mostly given by the one of the laser. In this way, the photoinjector can deliver 1 nC bunches with variable bunch length, between 2 ps and 6 ps, by changing the laser pulse duration.

An important parameter is the phase φ Gun between the laser pulse and the RF pulse, as it 2.1. Photoinjector, linac, transfer and extraction lines impacts the charge Q extracted via photo-emission, the relative energy spread σ , the bunch length σ s but also the energy-position correlation of the electrons inside the bunch (i.e. the longitudinal phase space). By tweaking φ Gun , it is possible to choose the trade off between an improvement of the relative energy spread σ δ and the degradation of the transverse emittances x,y . The electron bunches are then introduced into the linac [START_REF] Schleede | Multimodal hard x-ray imaging of a mammography phantom at a compact synchrotron light source[END_REF]. The accelerating section is a 4.5 m LIL (LEP Injector Linac) section which was designed at LAL in the years 1980 and used as injector for the LEP. The LIL section is planed to be used with a 12.5 MV m -1 gradient to reach a total electron energy of 50 MeV. In theory the maximum gradient achievable with a LIL section is about 18 MV m -1 , so a higher electron energy may be possible but this case will not be considered in this thesis.

As for the photoinjector, the phase φ Linac between the RF wave and the electron beam arrival is one of the most important parameter for the beam dynamics in the linac. A 5°phase change in φ Linac can lead to the doubling of σ δ . At the end of the LIL section, by tuning φ Gun and φ Linac , it is possible to get 1 nC bunches with normalised transverse emittances x,y about 5 π.mm.mrad with variable bunch length σ s and relative energy spread σ .

In a second stage of the ThomX project, a new acceleration section with a 25 MV m -1 gradient will be introduced in order to reach an electron energy of 70 MeV with a more compact machine [START_REF] Garolfi | High-gradient s-band electron linac for ThomX[END_REF]. This will allow to increase the X-ray energy up to 90 keV. 3-6 ps Emittance x,y (rms, normalised) at exit (@ 1 nC) 5 π.mm.mrad Relative energy spread σ at exit (@ 1 nC) 0.2% -0.7%

After the linac (2), the beam reaches the transfer line (TL). The TL optics have to be flexible as it has to match the output beams from the linac, which can change according to the user needs, to the storage ring optic functions. An example of the TL optics is given in Fig. 2.3 for a 1 nC bunch. The TL starts with a quadrupole triplet in order to focus back the diverging beam. The beam can then go in a straight line to a beam dump [START_REF] Meinel | Diagnosing and mapping pulmonary emphysema on x-ray projection images: incremental value of grating-based x-ray dark-field imaging[END_REF] with diagnostics or follow the TL if the first dipole doublet is switched on. In that case the beam is bent by 90°and enters a dispersive straight section toward a diagnostic station (4) and a beam scraper [START_REF] Biston | Cure of fisher rats bearing radioresistant f98 glioma treated with cis-platinum and irradiated with monochromatic synchrotron x-rays[END_REF]. The beam scraper ( 5) is a movable mechanical device which can cut beam tails, taking advantage of energy-position correlation induced by the dispersion it is possible to remove off-momentum particles. A second dipole doublet bends the beam by another 90°toward a quadrupole doublet which gives the final focusing to match the storage ring. In the straight section before injection, the beam heads toward another diagnostic station [START_REF] Cotte | Synchrotron-based x-ray absorption spectroscopy for art conservation: looking back and looking forward[END_REF] and the injection dipole [START_REF] Echard | In situ multi-element analyses by energy-dispersive x-ray fluorescence on varnishes of historical violins[END_REF]. If the injection dipole [START_REF] Echard | In situ multi-element analyses by energy-dispersive x-ray fluorescence on varnishes of historical violins[END_REF] is switched on, the beam is slightly bent toward the septum and injected into the ring, if it is switched off the beam keeps going on toward the extraction line (EL). The beam dynamics in the TL is detailed in chapter 6. The extraction line (EL) starts with the extraction dipole [START_REF] Cunningham | A virtual world of paleontology[END_REF], which is used to recover the beam from the storage ring kicker after extraction. It is then composed by a dipole magnet followed by a quadrupole triplet, leading to a final dipole and two quadrupole doublets before reaching the beam dump [START_REF] Huang | Laser-electron storage ring[END_REF].

Storage ring

The storage ring is shown in detail in Fig. 2.4. Every T store = 20 ms, a bunch from the TL is injected in the ring by a system of fast kickers [START_REF] Villafana | Generators, x-ray tubes, and exposure geometry in mammography[END_REF] and septum magnet [START_REF] Schleede | Multimodal hard x-ray imaging of a mammography phantom at a compact synchrotron light source[END_REF]. The septum is composed of a pulsed magnet which produce a strong, slowly varying (130 µs of pulse length), magnetic field to bend the incoming beam from the TL toward the ring orbit. Then the kicker (1) provide a weak, fast (100 ns of pulse length), magnetic impulse to set the bunch straight along the ring orbit. The magnetic field produced by the septum (2) is shielded by a mu-metal plate in order to provide a magnetic field free region that the beam can cross without being extracted during the fall down 2.3. Fabry-Perot cavity and X-ray line of the septum magnet pulse. The bunch extraction to the EL is handled similarly but it is the other kicker (1) which sends the bunch out of the field free region of the septum to be extracted. 4): Fabry-Perot cavity, (5): RF cavity, (6): transverse feedback kicker, [START_REF] Echard | In situ multi-element analyses by energy-dispersive x-ray fluorescence on varnishes of historical violins[END_REF]: virtual interaction point (IP bis). This compact, 18 m long, storage ring is composed of 8 dipoles (D), 24 quadupoles (Q) and 12 sextupoles (S). Figure 2.5 shows the optics of the nominal lattice of ThomX storage ring. The bottom plot of Fig. 2.5 is a synopsis of ThomX elements. The ring has a four-fold symmetry and is based on the double bend achromat (DBA) lattice where two of the four archomat lines have been transformed to minimise the beta function at the interaction point (IP -3), s = 4.5 m, and at the virtual interaction point (IP bis -7), s = 13.5 m. Dispersion function η x is zero in the straight sections and at the IP and IP bis. The Compton interaction takes place at the IP [START_REF] Meinel | Diagnosing and mapping pulmonary emphysema on x-ray projection images: incremental value of grating-based x-ray dark-field imaging[END_REF] where the laser, stored in the Fabry-Perot cavity (4), meet the electron beam at the point where its beam size is minimum. The IP bis [START_REF] Echard | In situ multi-element analyses by energy-dispersive x-ray fluorescence on varnishes of historical violins[END_REF] is the symmetric of the IP but no Compton interaction occurs at this point.

The injection/extraction system (1,2) is located in the first straight section, the RF cavity (5) and the transverse feedback system [START_REF] Cotte | Synchrotron-based x-ray absorption spectroscopy for art conservation: looking back and looking forward[END_REF] is located in the second one. The RF cavity ( 5) is a single cell cavity (type "ELETTRA") providing up to 500 kV at 500 MHz. This cavity is mainly used to keep the beam bunched and to act as longitudinal feedback to damp longitudinal oscillations. The transverse feedback ( 6) is a fast stripline kicker which will be used to damp transverse oscillations and correct injection jitter. Table 2.3 resumes the main design parameter for the ThomX storage ring.

Fabry-Perot cavity and X-ray line

The Fabry-Perot cavity is an optic resonator composed of four mirrors, see Fig. 2.6 [START_REF] Favier | Etude et conception d'une cavité fabry-perot de haute finesse pour la source compacte de rayons x ThomX[END_REF]. The laser pulse injected into the cavity will be reflected between the four mirrors, the injection is timed such as new laser pulses stack on top of the stored laser to increase the laser power in the cavity. At the interaction point, the laser pulse stored in the cavity is expected to have a transverse size of 100 µm and a duration of 10 ps. In order to be able to bring the laser pulse to the electrons, Chapter 2. A Compton X-ray source: ThomX The X-rays are produced at the interaction point in the Fabry-Perot cavity, then the transport to the users is done by the X-ray line. The X-ray line is divided in two parts: a first part, which is inside ThomX casemate, is used to focus the beam and to do the main characterisation of the X-rays. The second part, which is outside the shielding, will be used for other diagnostics and user Figure 2.6: Schematics of the Fabry-Perot cavity. The electrons beam, the broken red line, interacts with the laser beam, in blue, to produce X-rays, the green cone, via Compton backscattering. Figure from [START_REF] Favier | Etude et conception d'une cavité fabry-perot de haute finesse pour la source compacte de rayons x ThomX[END_REF].

experiments. The X-rays will also be used as a electron beam diagnostic. The nominal parameters of the X-rays produced are reported in Tab. 2.4.

Part I Impedance models and beam dynamics during the transient microbunching regime in ThomX

Chapter 3

An introduction to collective effects "The whole is greater than the sum of its parts." -Aristotle

The term "collective effects" refers to the interaction of beam particles with each other. It is defined in opposition to the "single particle dynamics" which focuses on the behaviour of a single particle of a beam in an accelerator. To study the collective effects is then to study the phenomenons which arise when taking into account the interactions of the numerous particles of a beam with the beam itself or its environment.

Where the single particle dynamics will define the most part of the accelerator design (the optics and the lattice, the dynamic aperture, the resonances, ...), the collective effects will mostly determine the machine maximum performances. Contrary to the case of single particle dynamics, the collective effects intensity increases with the number of particle in a beam (beam charge). At low charge a relativistic beam can be described as a sum of non-interacting particles, each particle of the beam following independently its own path depending on its initial conditions. At medium or high charge, a collective perturbation arises due to the fields generated by the beam or its interaction with the beam surroundings. The perturbation on the particle path can lead to a degradation of the beam properties and to several type of instabilities, called "collective instabilities".

Since the subject came up in the years 1960, many papers, lectures and books have been written to explain the physics of such effects. The aim of this chapter is to introduce qualitatively the effects which are relevant on ThomX case before going more in detail in the next chapters: For a beam travelling in a smooth perfectly conducting beam pipe, the action of the field created by the beam on itself is called direct space charge while the effect of the image charges is the indirect space charge [START_REF] Ferrario | Space charge effects[END_REF] [START_REF] Schindl | CAS -CERN accelerator school: intermediate course on accelerator physics[END_REF].

The change in cross section of the beam pipe leading to a radiation of the image charges is called geometric wakefield while the same type of perturbation produced by the beam pipe finite resistivity is the resistive wall wakefield [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF] [29] [START_REF] Biancacci | Improved techniques of impedance calculation and localization in particle accelerators[END_REF] [31] [32] [33] [34] [START_REF] Salvant | Impedance model of the CERN SPS and aspects of LHC single-bunch stability[END_REF] [START_REF] Zannini | Electromagnetic simulation of CERN accelerator components and experimental applications[END_REF].

The radiation produced by the beam in curved section, synchrotron radiation, is emitted in Chapter 3. An introduction to collective effects phase when a bunch is short enough, in that case it is called coherent synchrotron radiation [37] [38] [39] [40] [START_REF] Novokhatski | Coherent synchrotron radiation: theory and simulations[END_REF].

The interaction of the beam with the ions created from the ionisation of residual vacuum gas is called ion cloud, and is covered independently in the Part II of this thesis.

All of these effects can play a role in ThomX beam dynamics. In section 3.1 of this introduction chapter, these effects will be presented in order to give the reader an intuitive understanding of the physics behind the effect. Then in section 3.2, the wake functions and impedances, the formalism developed to describe geometric wakefields and now used for many other collective effects will be briefly introduced.

Collective effects

Space charge

Consider a particle of charge q and mass m moving with a speed v, in free space. The electromagnetic field created by such a particle depends on its velocity v. If, as shown in (a) of Fig. 3.1, the particle is non-relativistic, but v = 0, then its electric field lines radiates in every directions (Coulomb law). Its magnetic field lines are azimuthal, with a maximum amplitude perpendicular with respect to the direction of motion and null on that direction (Biot-Savart law). If the particle moves with a velocity close to the speed of light c, v ≈ c, then the field lines get contracted perpendicularly to the direction of motion, as in (b) of Now consider another particle with the same charge q moving in the same direction (with the same γ) separated by a distance d in the direction of propagation. As the azimuthal magnetic field is zero on axis, the two particles can only interact with their electric fields. The Coulomb 3.1. Collective effects force tends to repel the two charges from each other and increases the distance d between the two particles. A direct consequence of the Lorentz contraction of the electromagnetic field is that the interaction between two particles via their electric field lines decreases as their speed increases, so the Coulomb force goes down as 1 γ 2 . If the two charged particles are travelling in the same direction, but are now separated by a distance d in the same transverse plane as in Fig. 3.2. The two particles repel each other because of the Coulomb interaction as they have the same charge q, but at the same time, they attract each other because of the magnetic field created by a moving charge. As shown in the graph of Fig. 3.2, the magnetic attraction force between the two particle increases as the velocity v of the two particles increases while the Coulomb force (normalised by γ) is independent of v. The total force is still repulsive but its amplitude decreases as 1 γ . For ultra-relativistic particles, β = v c = 1, the two forces cancel out. The graph shows the evolution of the Lorentz force normalised by the Lorentz factor γ in pink (Total) and its two components the Coulomb force in purple and the magnetic force in green (both normalised by γ) versus β. Figure from [START_REF] Schindl | CAS -CERN accelerator school: intermediate course on accelerator physics[END_REF] The effect is the same in case of a beam with many particles. In the longitudinal direction, the Coulomb force has an effect if the beam is bunched or if the beam distribution is non-uniform. In that case, this force which tends to spread beams, and to lengthen bunched beams, is called (longitudinal) direct space charge. In the transverse plane, the Coulomb force is zero in the beam center and increases toward the beam edges which has the overall effect of pushing the particles away from the beam center. The magnetic force counteracts partially the Coulomb force as it brings particles toward the beam center. Globally, this force, which tends to reduce the effective focusing of the beam and spread the beam, is called (transverse) direct space charge.

In particle accelerators, particles travel in metallic vacuum tubes which perturbs the electromagnetic field emitted. Let us consider now a relativistic particle of charge q moving along the axis of a perfectly conducting vacuum chamber as in (a) of Fig. 3.3. The particle electric field lines are terminated by the conductive material and an image charge of opposite charge -q is induced on the wall by electric polarisation and moves with the same speed and direction as the particle. In the case of a beam, as shown in (b) of Fig. 3.3, an image current (composed of the moving image charges) is formed and follow the motion of the beam on the beam pipe walls. The Chapter 3. An introduction to collective effects beam image charges create an electric field which affect the beam, the effect is called indirect space charge. The magnetic field created by the image current can cancel the electric one, like for the direct space charge, in the case of time varying current. For constant or slowly varying currents, there is no cancellation of the indirect space charge. The indirect space charge also depends on the beam pipe geometry: for a circular vacuum chamber the force is null due to the symmetry if the beam is on center, but for an elliptical vacuum chamber the force is focusing in the larger dimension and defocusing in the smaller one. The reduced focusing induced by the direct (and indirect on one plane) space charge impacts the transverse beam dynamics by producing a tune shift. The space charge (direct and indirect) force also depends on the transverse beam profile, but for realistic beam profile (i.e. non-uniform) the force is non-linear. This non-linear force leads the detuning to depend on the betatron amplitude which means that the space charge also provide tune spread. The longitudinal direct space charge leads to a shift of the synchrotron phase and tune.

Space charge effects depend strongly on the beam energy (proportional to 1 γ 3 for the direct space charge) and are directly proportional to the beam charge. So space charge mainly matters for low γ accelerators with high intensity. In ThomX, it is the dominant effect in the photoinjector, where γ = 9.8, and an important effect in the accelerating section. In the TL and in the storage ring, where γ = 98, the space charge effects are less important.

Geometric and resistive wall wakefields

Consider an ultra-relativistic beam travelling on the axis of a perfectly conducting vacuum chamber as depicted in (b) of Fig. 3.3. As the beam is ultra-relativistic, the electromagnetic field lines of all the particles are perpendicular to the direction of motion. So unless two particles travel in parallel at exactly the same longitudinal position, the particles do not feel the field created by the others. If it is the case, then the two charges travelling at the same longitudinal position will experience 3.1. Collective effects the field created by the other one, but as they move ultra-relativistic speed, the magnetic force will exactly cancel the Coulomb force. So the total force which applies on an ultra-relativistic beam travelling in a perfectly conducting vacuum chamber without discontinuities is zero (neglecting the gravity).

Nevertheless, particle accelerators are far from being smooth perfectly conducting vacuum chamber. They usually feature lots of discontinuities as many elements (beam position monitors, kickers, cavities, ...) are needed to run properly the accelerator. Figure 3.4 shows an electromagnetic simulation of a Gaussian ultra-relativistic bunch going trough a step-out transition. The bunch is going trough a circular beam pipe of diameter a to enter a circular beam pipe of bigger diameter b. The colour scale shows the amplitude of the electric field in logarithmic scale, the area of very intense electric field (in red) corresponds to the bunch position in the beam pipe. In (a) of Fig. 3.4, the bunch is in the smaller beam pipe and the electric field is terminated by the perfectly conducting walls as in the scheme (b) of Fig. 3.3. In (b) of Fig. 3.4, the bunch goes trough the interface between the two pipes, the electric field has to adapt to the boundary condition change and expand in order to reach the walls of the bigger beam pipe. The boundary condition perturbation leads to the emission of electromagnetic fields trailing behind, because of causality, the radiating particle which are called geometric wakefields. The wakefields can be defined as the difference between the electromagnetic fields created because of the perturbation and the fields that would still be present without the perturbation. Such wakefields start to form in (b) of Fig. The physical reason as to why electromagnetic fields are emitted by the beam lies in the resolution of Maxwell equations. However, it is possible to give physical pictures to have a qualitative understanding of the phenomena. The image charges propagating on the pipe wall have to follow the discontinuity, so in the case of this example, go around the corner to follow the beam. As any charge with a bent trajectory radiates, electromagnetic fields (i.e. wakefields) are generated by the images charges. One can also see wakefields as the result of the scattering of the beam electromagnetic wave on the boundary discontinuity.

Wakefields can also be emitted by a beam pipe without discontinuities if it is not perfectly conducting, i.e. the vacuum chamber has a finite conductivity, such wakefields are called resistive wall (RW) wakefields. If the beam pipe is not perfectly conducting, then the skin depth δ skin is non zero and electromagnetic fields can penetrate into the vacuum chamber. In that case, the cancellation of the electric field and of the magnetic field is not perfect any more as a part of the image current will be flowing inside the metal conductor [START_REF] Frasciello | Wake fields and impedance calculations of LHC collimators real structures[END_REF].

For an ultra-relativistic particle, the wakefield is radiated behind that particle but it is still impacted by its own wakefield. In a bunched beam, all the particles are producing their own wakefield so the particles in the middle and in the tail of a bunch will feel the wakefield emitted by the head of the bunch. The effect of the wakefield on the beam depends on the type (geometric or RW) and of the structure which is responsible for the emission. Usually smooth geometric transitions creates short range wakefields while cavity-like structures, where electromagnetic waves resonate, creates long range wakefields. Whereas short range wakefields only affect the bunch which emitted it, long range wakefields lead to multi-bunch and multi-turns effects. In general, the wakefield impact is divided in its longitudinal and transverse components. Longitudinal wakefields 3.1. Collective effects change the energy distribution in the bunch and lengthen the bunch. Transverse wakefields increase the beam emittance, shift the betatron tune and decrease beam life time. As the emitted wakefield is proportional to the beam charge, its impact increases at higher intensity and beam instabilities can develop after some threshold current. The beam can start to perform coherent oscillations leading to partial or full beam loss. In order to estimate the impact of these effects in ThomX, the geometric and resistive wall wakefields are investigated in chapter 4 using simulations, measurements and an analytic model.

Coherent synchrotron radiation

A well known result of the electromagnetic theory is that when a charged particle undergoes acceleration, it radiates. When a dipole magnet bends the trajectory of a relativistic beam in an accelerator, the beam feels an acceleration transverse to its propagation direction and emits a radiation known as the synchrotron radiation (SR). This radiation is mostly emitted in a narrow cone in the beam direction of propagation, the opening angle of this cone is inversely proportional to γ. In a dipole magnet, a broad band spectrum of wavelength λ is emitted. As the synchrotron radiation emitted power decreases with the fourth power of the particle mass, the synchrotron radiation is mostly a concern (or a wanted effect) for electron machines even if it is not negligible for high energy proton synchrotrons. From now on, I will consider bunched electron beams.

If the bunch length σ s is long compared to the radiated wavelength λ, each of the electrons have different longitudinal positions along the bunch so the individual radiation emitted by each electrons E i is out of phase with respect to the other radiations, see (a) of Fig. 3.5. Then the total radiation E T is the sum of the radiation emitted by each electron taken individually E i , therefore the total radiation intensity I is proportional to the electron number N [START_REF] Evain | Dynamique de sources sur accélérateur: contrôle de structures turbulentes dans les lasers à électrons libres et étude du rayonnement synchrotron cohérent induit par laser[END_REF]:

E T = N i=1 E i (λ) = N i=1 E(λ)e jφ i , = 0 + fluctuations ∝ √ N , (3.1)
E 2 T = I = N I 0 + fluctuations ∝ √ N . (3.2)
Where E i = E(λ)e iφ i is the electric field emitted by a single electron, which can be decomposed in a modulus E identical for all electrons and an random phase φ. The intensity of the radiation of a single electron is given by

I 0 = E 2 .
If the bunch length σ s is short compared to the radiated wavelength λ, the electrons have the same longitudinal position leading to their individual radiation E i to be emitted in phase, as in (b) of Fig. 3.5. The total radiation E T depends on the degree of coherence of the electrons within the bunch and is called coherent synchrotron radiation (CSR). Assuming full transverse coherence, its intensity I can be approximated by [START_REF] Nodvick | Suppression of coherent radiation by electrons in a synchrotron[END_REF]:

I = N (N -1)|ρ(ω)| 2 I 0 .
(3.3) Figure 3.5: The synchrotron radiation radiated by an electron beam is (a) incoherent if the (RMS) bunch length σ s is larger than the emitted wavelength λ. It is (b) coherent if the (RMS) bunch length σ s is smaller than the emitted wavelength λ, modified figure from [START_REF] Wüstefeld | Coherent synchrotron radiation and short bunches in electron storage rings[END_REF].

Where ω = 2πf = 2πc λ is the angular frequency, ρ is the longitudinal charge density and ρ its Fourier transform:

ρ(ω) = +∞ -∞ e -jωz c ρ(z)dz . (3.4)
Taking into account incoherent (SR) and coherent (CSR) radiations, the total synchrotron radiation power emitted by a bunch can be expressed as [START_REF] Roussel | Spatio-temporal dynamics of relativistic electron bunches during the microbunching instability: study of the synchrotron SOLEIL and UVSOR storage rings[END_REF]:

P T (ω) = P incoherent (ω) + P coherent (ω) , = P 0 (ω) N + N (N -1)|ρ(ω)| 2 , (3.5)
where P 0 is the power emitted by a single electron. The CSR is very dependant on the longitudinal charge density Fourier transform ρ but, as the number of electrons in a bunch N is of the order of 10 8 -10 10 , even a weak spectral component in ρ can bring a CSR emission much stronger than the SR one. So typically, the total synchrotron radiation spectrum is divided in two parts, the incoherent low intensity part for short wavelength λ and the coherent high intensity part for the long wavelength λ.

As for the geometric or resistive wall wakefields, the electromagnetic CSR field emitted by the beam can act back on the beam. The CSR field is radiated ahead of the bunch so, in free space, the head and the body of the bunch are affected by the tail CSR emission. But the CSR can also be reflected on the beam pipe walls and impact the bunch tail (see chapter 5). The overall effect of the CSR on the bunch is to increase the particle energy, thus accelerating, of some parts of the bunch while decreasing it, thus decelerating, in other parts of the bunch. As the bunch feels a variable CSR field along its longitudinal position, it induces a coherent energy spread along the bunch. In this aspect, the effect of the CSR is quite similar to the longitudinal geometric/RW wakefields. But where the effect of the geometric/RW wakefields is distributed all around the accelerator, the CSR effect is concentrated in the dipoles. This difference brings important additional effects compared to the longitudinal geometric/RW wakefields which mainly cause bunch lengthening and change in the bunch shape. From the induced coherent energy spread in dipoles, the CSR introduces chromatic effects not corrected in traditional achromat lattices which increase the transverse emittance [START_REF] Bohn | Coherent synchrotron radiation: theory and experiments[END_REF] [46] [START_REF] Emma | Emittance dilution through coherent energy spread generation in bending systems[END_REF]. We will see that this phenomenon is important in ThomX in the chapter 6 dedicated to 3.2. Formalism for collective effects beam dynamics.

To explain this effect, it is possible to cut the bunch longitudinally in several slices as in Fig. 3.6. The emittance of the bunch transverse cross section at a given longitudinal position is called slice emittance. As the CSR field depends on the position along the bunch, all the particles corresponding to the same slice feel approximately the same CSR kick. It leads to a translation of the slice centroid in the horizontal direction depending on the CSR amplitude. But also to a different betatron oscillation for each bunch slice. The overall effect is an increase of the projected emittance, although the individual slice may have kept the same slice emittance. When the bunch is very short, the particles can also change slice which lead to an increase of the slice emittance. Both of these effects which increase the horizontal emittance are often observed in bunch compressor chicanes [START_REF] Mitri | Transverse emittance preservation during bunch compression in the fermi free electron laser[END_REF]. Above a threshold current, the CSR also leads to the creation of a longitudinal modulation in the beam profile (increase of coherence), which induces an increased CSR, bringing in turn a stronger longitudinal modulation and so on [START_REF] Stupakov | Microbunch instability theory and simulations[END_REF]. This effect which induces the formation of micro-structures in the bunch is called micro-bunching instability (MBI) and is detailed in section 6.1 for ThomX case.

Formalism for collective effects

In the previous section, several collective effects have been introduced qualitatively. In this section, the formalism of wake functions and impedances, historically used to describe geometric wakefields, is shorty introduced here. In this thesis, this formalism is used to deal with geometric wakefields, RW wakefields and CSR. But it is also used for other collective effects like space charge [START_REF] Venturini | Models of longitudinal space-charge impedance for microbunching instability[END_REF] and ion cloud [START_REF] Wang | Beam ion instability: measurement, analysis, and simulation[END_REF]. Many documents, which the author used for reference and inspiration to write this section, introduce this formalism in more detail [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF] [29] [30] [START_REF] Persichelli | The beam coupling impedance model of CERN proton synchrotron[END_REF].

Chapter 3. An introduction to collective effects

Wake function and impedance

Now consider two charged particles, a source particle (S) of charge q S and a test particle (T) of charge q T , which are travelling parallel to the longitudinal axis s with constant velocity v, as in Fig. 3.7. The chosen coordinate system decomposes the space in the transverse plane with a corresponding coordinate u = u u 0 and a longitudinal coordinate s = s s 0 . That is to say that in a Cartesian coordinate system, u = (x, y) and u = x x 0 + y y 0 , and in a cylindrical one, u = (r, θ) and u = r r 0 . So the source particle (S) is at position ( u S , z S ) and the test particle (T) at ( u T , z T ). In that coordinate system, vector quantities are decomposed in their longitudinal component, denoted by the sign , and their transverse one, denoted by the sign ⊥. Due to a discontinuity of the beam pipe, for example, the source particle (S) radiates a wakefield which can impact the test particle (T). The electromagnetic field emitted depends on the position of the source particle and on the position of the test particle where it is evaluated. So the field can be written as E( u T , u S , s T , s S ) for the electric field and B( u T , u S , s T , s S ) for the magnetic field. It is possible to compute the effect of this field emitted by the source particle on the test particle by considering the momentum change ∆ p that the test particle undergoes:

∆ p( u T , u S , z) = +∞ -∞ F L ( u T , u S , s T = s S -z, s S = vt)dt . (3.6)
where F L is the Lorentz force, F L = q E + v × B . Now with the longitudinal and transverse components decomposed:

∆p ( u T , u S , z) = +∞ -∞ q T E ( u T , u S , s T = s S -z, s S = vt)dt , (3.7) ∆p ⊥ ( u T , u S , z) = +∞ -∞ u 0 • (q T E ⊥ ( u T , u S , s T = s S -z, s S ) + q T v × B ⊥ ( u T , u S , s T , s S ))dt . (3.8)

Formalism for collective effects

From there, the longitudinal W and transverse W ⊥ wake functions can be defined as:

W ( u T , u S , z) = v q S q T ∆p ( u T , u S , z) , (3.9)
W ⊥ ( u T , u S , z) = v q S q T ∆p ⊥ ( u T , u S , z) . (3.10)
A wake function usually characterises a specific physical phenomena, for example the interaction of a particle with a given geometry or the CSR emitted for a given bending radius. It can be defined as the integrated response to a impulse excitation (i.e. a Dirac delta distribution), which, in the case of geometric wakefields, correspond to the Green function of a particular structure. In this convention, the wake functions are negative for a decelerating electric field longitudinal component.

When the longitudinal wake function W is considered, most of the time the transverse position of the source and test particles are neglected so: .11) This approximation corresponds to the constant (w.r.t. the transverse positions) term of the longitudinal wake function W Taylor development along the source and test positions:

W (z) = W ( 0, 0, z) . ( 3
W ( u T , u S , z) ≈ W ( 0, 0, z) + ∇ W ( 0, u S , z) u S + ∇ W ( u T , 0, z) u T + ... . (3.12)
The same Taylor development is often done to characterise the transverse wakefield W ⊥ , where the transverse displacement of the source and test can not be neglected:

W ⊥ ( u T , u S , z) ≈ W ⊥ ( 0, 0, z) + ∇ ⊥ W ⊥ ( 0, u S , z) u S + ∇ ⊥ W ⊥ ( u T , 0, z) u T + ... , ≈ W 0 (z) + W D ( u S , z) u S + W Q ( u T , z) u T + ... . (3.13)
Where W 0 is a constant term which does not depend on the transverse positions, W D is the driving, or dipolar, wake function and W Q is the detuning, or quadrupolar, wake function. The constant term W 0 is zero when the beam propagation axis (the longitudinal axis s here) corresponds to the geometrical symmetry axis of the structure. The driving term W D is proportional to the source particle displacement so the test particle feels a transverse force which is independent from its own position, provoking a global offset. Whereas the detuning term W Q is proportional to the test particle displacement so it feels a force linearly proportional to its offset which acts as a quadrupole error leading to a detuning.

The concept of wake function represents wakefields in the time domain. It is also possible to represent these fields in the frequency domain by introducing the beam coupling impedance, usually referred as impedance. Compared to wake functions, impedances are sometime more appropriate for analytical studies or to study frequency dependent materials. The longitudinal Z and transverse Z ⊥ impedance are defined as the Fourier transform (F T ) of the longitudinal W and transverse W ⊥ wake functions:

Z ( u T , u S , ω) = - +∞ -∞ W ( u T , u S , z)e -jωz v dz v . (3.14)
Chapter 3. An introduction to collective effects

Z ⊥ ( u T , u S , ω) = j +∞ -∞ W ⊥ ( u T , u S , z)e -jωz v dz v . (3.15)
Usually the impedance refers to a spectrum of values but sometime, especially in early literature, the term impedance may refer to a single value. In that case, the statement refers to the lowfrequency limit of Im Z n ≈ Z n , where n = ω ω 0 and ω 0 is the revolution frequency [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF]. This value was used to estimate the instability threshold in early accelerators (Keil-Schnell-Boussard criterion [START_REF] Keil | Concerning longitudinal stability in the ISR[END_REF] [START_REF] Boussard | Observation of microwave longitudinal instabilities in the CPS[END_REF]) and can be still used to get a crude estimate of it. Nowadays, the full impedance spectrum is used to get a better estimate as this value only corresponds to the low frequency behaviour which is not significant for machines with short bunches. Note that some authors use a different sign convention for the computation of the impedance [START_REF] Chao | Physics of collective beam instabilities in high energy accelerators[END_REF] [55], using jωz v instead of -jωz v , in that case the longitudinal impedance is the complex conjugate to the one defined in Eq. (3.14).

Here I follow the definition given in [START_REF]CST particule studio[END_REF], [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF] and [START_REF] Wiedemann | Particle accelerator physics[END_REF].

Using inverse Fourier transform (F T -1 ), it is possible to get the wake function in term of the impedance:

W ( u T , u S , z) = -1 2π +∞ -∞ Z ( u T , u S , ω)e jωz v dω . (3.16) W ⊥ ( u T , u S , z) = j 2π +∞ -∞ Z ⊥ ( u T , u S , ω)e jωz v dω .
(3.17)

Wake potential and loss factor

Whereas the wake function corresponds to the action of a single source particle on the test particle, the effect of a particle distribution on the test particle is called wake potential W p . The wake potential W p is given by the convolution ( * ) of the wake function with the longitudinal charge density ρ:

W p (z) = (W * ρ)(z) = +∞ -∞ ρ(z -z )W (z )dz . (3.18)
The longitudinal charge density ρ can be defined as the total current flowing through the plane orthogonal to the bunch propagation I divided by the total bunch charge Q:

ρ(z) = I(z) Q (3.19)
Where the total bunch charge Q is given by:

Q = +∞ -∞ I(z)dz (3.20)
The wake potential can also be obtained in terms of the impedance by using properties of the Fourier transform and convolution operators:

F T [W p ](ω) = F T [W * ρ](ω) , = F T [W ](ω)F T [ρ](ω) , = -Z (ω)ρ(ω) , (3.21)
3.2. Formalism for collective effects

W p (z) = -F T -1 [Z (ω)ρ(ω)] , = -1 2π +∞ -∞ Z (ω)ρ(ω)e jωz v dω . (3.22)
The expression of the wake potential in terms of impedance can be further simplified:

W p (z) = -1 2π +∞ -∞ Z (ω)ρ(ω)e jωz v dω , = -1 2π +∞ -∞ Re[Z (ω)] + jIm[Z (ω)] ρ(ω) cos( ωz v ) + jsin( ωz v ) dω , = -1 2π +∞ -∞ ρ(ω) Re[Z (ω)]cos( ωz v ) -Im[Z (ω)]sin( ωz v ) dω - j 2π +∞ -∞ ρ(ω) Re[Z (ω)]sin( ωz v ) + Im[Z (ω)]cos( ωz v ) dω . (3.23)
Where the first integral is even and the second is odd as:

Re[Z(-ω)] = Re[Z(ω)] , Im[Z(-ω)] = -Im[Z(ω)] . (3.24)
Which gives an expression for the wake potential in terms of the real and imaginary part of the impedance:

W p (z) = -1 π +∞ 0 ρ(ω) Re[Z (ω)]cos( ωz v ) -Im[Z (ω)]sin( ωz v dω (3.25)
The sign before Im[Z (ω)] depends on the convention chosen for Eq. (3.14). This expression highlights the fact that choosing the opposite convention, which gives a plus sign for Eq. (3.25), revert the sign of the imaginary impedance. Similarly, the impedance can be expressed in terms of the wake potential. Starting from Eq. (3.21), the impedance Z is given by:

Z (ω) = - F T [W p ](ω) F T [ρ](ω) . (3.26)
To estimate the energy loss ∆E of a bunch of total charge Q it is interesting to introduce the loss factor k :

k = - +∞ -∞ W (z)ρ(z)dz . (3.27)
The loss factor can also be expressed in term of the impedance:

k = 1 2π +∞ -∞ Z (ω)|ρ(ω)| 2 dω , = 1 π +∞ 0 Re Z (ω) |ρ(ω)| 2 dω .
(3.28)

As ρ(ω) is an even function and Im[Z(ω)] is odd, the integral of the product over the full frequency spectrum is zero and the loss factor k can be expressed as a function of the real part of the Chapter 3. An introduction to collective effects impedance only. The fact that Im[Z(ω)] does not contribute to k translate the fact that only Re[Z(ω)] is linked to the bunch energy loss. Then the energy loss ∆E is given by [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF]:

∆E = k Q 2 .
(3.29)

Resonator model

Impedances can be sorted in different types. Cavity-like structures usually show many peaks in their impedance spectrum, which correspond to trapped modes resonating in the cavity. The wake potentials created by such a structure present many oscillations (corresponding to the resonant peaks) with can take a long time to damp down. Each of these resonances can be modelled by an RLC resonator circuit with an impedance given by [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF]:

Z (ω) = R s 1 + jQ r (ω/ω r -ω r /ω) (3.30)
where R s is the shunt impedance, i.e. the maximum of the real part of the impedance, ω r = 1/ √ LC is the resonance angular frequency and Q r = R s C/L is the quality factor. The quality factor characterises the width of the resonance as Q r = ω r /∆ω where ∆ω is the width at half maximum. These types of impedance spectrum with many resonant peaks are generally referred as narrow-band impedance.

Other types of structures, like tapers or bellows, may have a smooth impedance spectrum, corresponding to quickly decaying wake potentials. These impedances can also be fitted by the Eq. 3.30, but with Q r ≈ 1, and are called broad-band impedance. The impedance spectrum of these two types of impedance is shown in Fig. 3.8. The wake potentials created by a given impedance depend on the beam spectrum, see Eq. (3.22), thus they depend on the frequency range to consider. The impedances can be sorted with respect to the beam cut-off angular frequency ω b = c/σ s , where σ s is the bunch length [START_REF] Frasciello | Wake fields and impedance calculations of LHC collimators real structures[END_REF]. For ω b << ω r , then the RLC resonator can be approximated by Z (ω) ≈ jωL and is said to be 3.2. Formalism for collective effects inductive. For ω b ≈ ω r , the resonator is said to be resistive as Z (ω) ≈ R s . And for ω b >> ω r , then Z (ω) ≈ 1 jωC and is said to be capacitive. For a pure resistive impedance, Z (ω) = R, then its wake function is given by:

W (z) = -F T -1 [Z ](z) = -Rδ(z) , (3.31)
where δ is the Dirac delta distribution. For any longitudinal charge density ρ, the wake potential produced by such an impedance is:

W p (z) = W * ρ (z) = -Rρ(z) , (3.32)
as δ is the convolution neutral element. So the wake potential has the same shape as the bunch creating the potential. For a pure inductive impedance, Z (ω) = jωL, then its wake function is given by:

W (z) = -F T -1 [Z ](z) = -Lδ (z) , (3.33)
where δ is the derivative, in the sense of distributions, of the Dirac delta distribution. The wake potential produced by such an impedance with a longitudinal charge density ρ is:

W p (z) = W * ρ (z) = -L dρ dz (z) , (3.34)
as (δ * f ) (a) = f (a). For an inductive impedance, the wake potential is proportional to the derivative of the bunch profile. For a pure capacitive impedance,

Z (ω) = 1 jωC + δ(ω) 2C
1 , then its wake function is given by:

W (z) = -F T -1 [Z ](z) = - sgn(z) + 1 2C = - θ(z) C , (3.35)
where sgn is the sign function which is equal to 1 for positive values, -1 for negative values and 0 for zero and θ is the Heaviside step function which is equal to to 1 for positive values, 0 for negative values and 1 2 for zero. The wake potential produced by such an impedance with a longitudinal charge density ρ is:

W p (z) = W * ρ (z) = -1 C +∞ -∞ θ(u)ρ(z -u)du , = -1 C +∞ 0 ρ(z -u)du = -1 C z -∞ ρ(u)du . (3.36)
For a capacitive impedance, the wake potential is proportional to the integral of the bunch profile.

Figure 3.9 shows the impedances and wake potentials produced by an inductive, a resistive, 1 The δ term in this expression originates in the Fourier transform of 1 C t -∞ i(u)du which is the voltage output of a capacitance fed by an i(t) current input. This δ term takes into account the fact that +∞ -∞ i(t)dt does not vanish. The formula for the Fourier transform of an integral of a distribution g is given by:

F T [ t -∞ g(z)dz] = F T [g(z)] jω + +∞ -∞ g(z)dz 2
δ(ω). The term in +∞ -∞ g(z)dz corresponds to the "average value" of g. Most of the time in physics, it is set to zero or neglected but it is important here to get the correct value for the wake function. 3.2. Formalism for collective effects and a capacitive RLC resonator. In the inductive case, the resonance peak is far from the beam spectrum so the impedance is dominated by its positive imaginary part. The inductive wake potential transfers energy from the head to the tail of the bunch so the total energy loss can be neglected. For a resistive broad band, the impedance is dominated by its quasi-constant real part while the contribution of the positive imaginary impedance is partially compensated by its negative counterpart. The resistive wake potential leads to an energy loss in the head and body of the bunch with a small energy gain in the tail. For the capacitive case, the resonance peak is within the bunch spectrum so the impedance is dominated its negative imaginary part which is only partially compensated by the positive part. The capacitive wake potential provides a global energy loss which is stronger in the bunch tail.

The loss factor k of a Gaussian bunch with rms length σ in a resonator, Eq. (3.30) is given by:

k = ω r 2 R s Q r exp(-ω r 2 σ 2 ) (3.37)
The formalism developed here is used to deal with the geometric and resistive wakefields in chapter 4 and with the coherent synchrotron radiation is chapter 5.

Chapter 4

ThomX geometric and resistive wall impedance model: simulations and measurements

In chapter 3, the collective effects coming into play in ThomX were quantitatively explained and the formalism of wake functions and impedances was introduced. An important source of instability in accelerators is the geometric and resistive wakefields. The terms wakefield and impedance (presented in section 3.2) will refer only to these effects in this chapter.

In the design phase of an accelerator, impedances are evaluated for critical elements in order to be able to modify them to reduce their impedance. In the starting and running phases, impedance estimations are also important to feed beam dynamics studies aiming to understand the encountered instabilities and limitations due to collective effects. In this chapter, the impedance model, taking into account geometric and resistive wakefields, built for ThomX storage ring is presented. As this thesis aims to study the longitudinal dynamics in the transient microbunching regime, the model developed here mainly focuses on the longitudinal impedance. In a first part, the methods and the tools used to develop this model are presented in section 4.1. Then the impedance model is presented for each component of ThomX storage ring in section 4.2. Finally, the method to extract wake functions from the model is presented in section 4.3 in order to implement geometric and resistive wall wakefield effects in CODAL simulation code (see section 6.2).

Methods and tools to determine the impedance of an accelerator component

Since the concept of impedance was introduced to tackle the problem of geometric wakefields by Vaccaro in 1966 [START_REF] Vaccaro | Longitudinal instability of a coasting beam above transition[END_REF], several methods to determine the impedance of an accelerator element have been designed. These methods can be divided in four types: Analytical models: Maxwell's equations can be solved analytically for simple geometries in order to find the impedance. One example of such a model is shown in section 4.1.2 Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements Simulations: using 2D or 3D electromagnetic solvers, it is possible to simulate the wake potential for time domain solvers or the impedance for frequency domain solvers. This method allows to study complex structures which are close to the geometry of the real elements. Simulations in the time domain are presented in section 4.1.1 RF measurements: for some elements, it is possible to measure the impedance on a bench using specific RF equipment like a vector network analyser (VNA). This type of measurement is detailed in section 4.1.3.

Beam measurements: by using the beam as a probe it is possible to estimate the total accelerator impedance or the impedance of a specific accelerator component [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF]. This type of accelerator based measurement is not detailed in this thesis.

As it will be shown in this thesis, no matter the method, the impedance evaluation is not always a straightforward affair. Using analytical models provide an exact solution but the model seldom corresponds to the real object one wants to evaluate. Nowadays, electromagnetic simulations are very powerful and perfected tools but this often come with an increased difficulty to set the numerous parameters of these "black boxes" like solvers. Because of this difficulty to parameter, it is possible to get a simulation result far from reality if the simulation is incorrectly set. RF measurements have the advantage to allow the component direct measurement, contrary to analytical models and simulations where a model has to be set. But the measurement is difficult, not always easy to interpret and is not possible for every elements. Furthermore, as I have experienced during this thesis work, more and more effort is spent lowering the element impedance during design which sometimes prevent the measurement. Finally, beam measurements of the impedance allow to check the accuracy of an existing impedance model but, in most cases, come too late in the process to allow for the element modification if too big an impedance is detected.

For these reasons, when building an impedance model for a machine, common wisdom says that one should use at least two different methods for each element one wants to evaluate. In order to constitute ThomX impedance model, the main method which was chosen is time domain simulation using the commercial software CST Particle Studio (CST PS) [START_REF]CST particule studio[END_REF]. After benchmarking, this code was used to simulate ThomX individual elements and build the impedance model. Then, when possible, RF measurements were done in order to cross check the simulation results. For a particular case where simulation was not possible, an analytic model, the multi-layered cylindrical chamber model [START_REF] Mounet | Electromagnetic field created by a macroparticle in an infinitel long and axisymmetric multilayer beam pipe[END_REF], was used.

Time domain simulation using CST PS

In this section, the software, CST Particle Studio (CST PS), used to evaluate the impedance of most of the component of ThomX storage ring is presented. The main steps to simulate an element are described and the choice of the most important parameters which impact the simulation results are explained. [START_REF]CST particule studio[END_REF] (CST PS) is a commercial software dedicated to the simulation of charged particle dynamics in 3D electromagnetic fields. Its wakefield solver can be used to compute the fields generated by a beam when said beam is going trough 3D structures. It takes into account 4.1. Methods and tools to determine the impedance of an accelerator component both of the geometric and the resistive wall wakefields and has been benchmarked multiple time against theory and other codes [START_REF] Biancacci | Improved techniques of impedance calculation and localization in particle accelerators[END_REF]. The beam is point like in the dimension transverse to its displacement and has an arbitrary distribution in the longitudinal direction (usually Gaussian). The 3D space is discretised in a hexahedral mesh where Maxwell's equations are solved at each time step. The standard output of this time domain simulation is the wake potential created by the source beam as a function of the distance z between the source beam and a test charged particle. In the simulation as in the formalism developed in section 3.2, the source beam and the test particle are not impacted by the fields emitted so they both travel in straight lines. The path of the test particle is then called integration path as it is where the fields by the source beam are integrated to compute the wake potential. The source path and the integration path can be set anywhere in the structure allowing to simulate also the different terms of the transverse wake potentials. The code then computes the impedance of the structure using the Fourier transform of the wake potential and of the source beam charge density.

CST Particle Studio

A wakefield simulation using CST PS usually starts by defining the 3D structure one wants to evaluate. If a 3D model of the structure already exists then it is possible to import it directly, else the structure has to be created using the modelling tools. In both cases, only the main features of the object with respect to the beam should be modelled. Keeping the structure details (such as holes for screw, ...), which are not "seen" by the beam will only slow down the simulation and needlessly increase the mesh density. Then the material characteristics of each of the pieces composing the structure should be defined using the appropriate material class. The source particle beam and the integration path are then defined and the current injection scheme and the integration method are chosen. These parameters are important as they correspond respectively to different ways of simulating the beam and of computing the wake potential. After this, the boundary conditions, the background and the eventual symmetry planes have to be set. Finally, the solver settings must be input and the mesh checked by the user before running the simulation.

Ultimately, the simulation efficiency in terms of result accuracy and simulation time depends on the good choice of solver settings. As the simulation settings can considerably change the simulation results, it is important to describe the most important parameters:

The wakelength W L set the limit distance z between the source beam and the test particle which is computed by the simulation. The longer the wakelength, the longer the simulation takes. If possible, the wakelength should be big enough to allow the wake to vanish in order to get a good enough precision on the impedance spectrum.

If the longitudinal charge density is chosen to be Gaussian, then the standard deviation σ B of this distribution is an important parameter. In general, the wake potential result from CST PS is rarely used as such, one want to get general quantities characterising the structure such as the impedance or the wake function. σ B allows to control the frequencies excited by the simulated beam and the "convergence" of the wake potential to a wake function. The smaller σ B is, the higher the maximum frequency of the impedance spectrum f max will be. In CST PS, f max is defined as

f max = c √ |log(0.01)| 2πσ B
which is the frequency corresponding to -20 dB of the maximum of the beam spectrum. However, lowering σ B implies a proportional increase of the number of mesh cells. Finally, the value of σ B is chosen to have a good trade-off Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements between f max and the computational cost. CST PS computes the impedance spectrum up to the frequency f max using Eq. (3.26).

The current injection scheme describes the way the beam is modelled in the simulation. Two schemes are available, the analytic (A) one integrate the Gaussian charge distribution to compute the resulting current. But numerical dispersion effects can lead to the production of non-physical electric fields if the mesh grid is not dense enough. For transmission line (TL) scheme, the current is travelling on a perfectly conducting wire and no non-physical electric fields are created. However, to use this scheme the mesh should be very homogeneous in the longitudinal direction to avoid creating non-physical current reflections.

The integration method defines the way the wake potential is computed. The direct (D) method corresponds to the integration of the Lorentz force along the integration path. This method is the least precise method so the indirect methods should be preferred if usable.

The indirect testbeams (IT) method can be only used for convex structures which entry and exit cross section are similar. The indirect interface (II) method can be used if be beam is ultra relativistic.

The boundary condition definition depends on the structure simulated. In general, open boundaries (with the ConvPML setting) are used for the boundaries orthogonal to the beam direction. This type of boundary is a perfect matching layer (PML) [START_REF] Berenger | A perfectly matched layer for the absorption of electromagnetic waves[END_REF] which allows to absorb incoming wave while suppressing any reflection at the boundary. The other boundaries can be set either as electric boundaries, which keeps the tangential component of the electric field zero at the boundary, or as open add space boundaries, which adds some mesh cells in the plane before a open boundary.

The background setting corresponds to the definition of the space not occupied by objects defined in the simulation. Basically there are two possibilities, the first is to define the structure by a volume of vacuum crossed by the beam with the background set as a particular material. The second possibility, which is used here, is to define the structure by hollow volumes with material properties and set the background as vacuum.

If the problem is symmetric, it is possible to add symmetry planes which allow only to simulate parts of the 3D space.

In additions to these settings, there are numerous parameters which change the meshing. The mesh cell per wavelength ratio is the main lever to control the mesh density and the simulation accuracy. Depending on the size of the object to simulate this parameter ranges from 15 to 30 in the simulation shown in this thesis. Most of the time, the TL injection scheme with II integration are used to reach good precision without the constraints imposed by the IT method. To be able to use the TL injection scheme, the mesh as to be homogeneous in the longitudinal direction. This can be achieved using the smooth mesh equilibrate ratio which controls the maximum size change between two adjacent cells of the mesh, typically a value as low as 1.05 is used for the TL injection scheme. Removing the default "snapping" of the mesh planes to the structure can also help in this endeavour. In this section the analytic model of the multi-layered cylindrical chamber [START_REF] Mounet | Electromagnetic field created by a macroparticle in an infinitel long and axisymmetric multilayer beam pipe[END_REF] which is used for the kicker impedance evaluation, section 4.2.5, is introduced. This model allows to derive the impedance of a 2D (i.e. infinite in the longitudinal direction) axisymmetric structure composed of different circular layers as shown in Fig. 4.1. This model has been first developed by B. Zotter [START_REF] Zotter | New results on the impedance of resistive metal walls of finite thickness[END_REF] and then improved by N. Mounet and E. Metral [START_REF] Mounet | Electromagnetic field created by a macroparticle in an infinitel long and axisymmetric multilayer beam pipe[END_REF]. It uses the field matching technique to compute the electromagnetic fields created by a point-charge beam travelling in the structure. The impedance computed by this formalism is the "wall impedance" which includes the resistive wall impedance and the indirect space charge impedance. The code ImpedanceWake2D (IW2D), by N. Mounet [START_REF] Mounet | [END_REF], is used to compute the impedance and the wake functions from this model. This set of parameter allows to define the material composing the layer with its complex permittivity c and permeability µ given by:

c = 0 b + 1 (1 + jρ DC 2πf (1 + 2πf τ )) , (4.1)
Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements

µ = µ 0 1 + χ m 1 + j f fm , (4.2)
where 0 is the vacuum permittivity, µ 0 its permeability and f is the frequency. Usually parameters like ρ DC , b and χ m for materials used in accelerator components can be obtained from the supplier data-sheet. For the cut-off frequency for the frequency-dependent complex permeability f m can usually be set to infinity [START_REF] Mounet | [END_REF]. If no tabulated value for the resistivity relaxation time τ is found, it can be estimated using the formula [START_REF] Mounet | The LHC transverse coupled-bunch instability[END_REF]:

τ = m e ρ DC ne 2 , (4.3)
where m e is the electron mass, e is the elementary charge and n is the charge carrier density given by:

n = N A Zρ m A , (4.4)
where N A ≈ 6.022 • 10 23 mol -1 is the Avogadro number, Z is the number of charge carrier provided by each atom, ρ m is the mass density in g m -3 and A is the atomic mass in g mol -1 . The model is completed by the beam relativistic Lorentz factor γ, the length L of the structure (for normalisation as it is considered infinite in the computation) and the Yokoya factor of the structure. The impedance ratio between a circular geometry and any given geometry can be considered quasi constant and used in order to find the impedance for this geometry from the circular impedance. The Yokoya factors of a given structure allows to correct the circular geometry impedance for non-circular geometries (but still uniform in the longitudinal direction) [START_REF] Yokoya | Resistive wall impedance of beam pipes of general cross section[END_REF].

For an elliptic geometry, the Yokoya factors depends on the ratio:

R = a -b a + b , (4.5)
where a is the large semi-axis of the ellipse and b is the small semi-axis of the ellipse. For ThomX kicker cross section, R ≈ 0.1765, which gives the following Yokoya factors [START_REF] Yokoya | Resistive wall impedance of beam pipes of general cross section[END_REF] [61]: Impedance measurements using the classical coaxial wire method use the fact that electromagnetic field produced by an ultrarelativistic beam is close to the one produced by a TEM transmission line.

It is then possible to measure the impedance using a Vector Network Analyser (VNA) matched to the TEM transmission line created by the Device Under Test (DUT) and the wire inserted inside the DUT. The VNA measures the transmission parameter S21, which corresponds to the ratio of the output power wave to the input power wave. By comparing the DUT to an ideal reference 4.1. Methods and tools to determine the impedance of an accelerator component line the impedance can be deduced using Eq. (4.6) with Z L the line impedance of the DUT. The principle of the measurement is described in more detail in [START_REF] Caspers | Longitudinal and transverse wire measurements for the evaluation of impedance reduction measures on the MKE extraction kickers[END_REF].

Z = 2Z L ln S21 DU T S21 REF (4.6)
The measurement setup is presented in Fig. 4.2. A half shell flange is used to support the measurement setup, an RF bulkhead going trough the half shell link the cable going to the VNA (Vector Network Analyser) to the RF connector. A coaxial cable brazed on the RF connector and stripped on the end tip is used as an antenna. A resistor is brazed on the stripped tip of this coaxial cable in order to match the two coaxial lines. Then the CuBe (Copper Beryllium) wire is brazed on the other end of the resistor. A metallic plate is used to separate the RF connector part from the measurement part. If there is no separation then the TEM modes created between the external conductor of the coaxial conductor can propagate and disrupt the measurement. In order to damp reflections on this plate, RF absorbing foam has been glued to it. In the aim of improving repeatability the plate and the foam have been glued to a metallic support which can be removed to screw the RF connector and tauten the wire. to determine an equivalent diameter D eq for ThomX cross section which is not cylindrical. The value of this equivalent diameter D eq = 30.9 mm is chosen so that the analytical results match the simulations. Table 4.2 shows the comparison of the line impedance values for the two methods with the relative error between both for different wire diameter. Line impedance for different wire diameters. An equivalent diameter D eq = 30.9 mm is used the for analytic calculations.

Z L = Z v 2π ln D d (4.7)
In order to be able to measure high impedance component it is important to have the highest line impedance Z L possible [START_REF] Caspers | Longitudinal and transverse wire measurements for the evaluation of impedance reduction measures on the MKE extraction kickers[END_REF]. Ideally the line impedance should be much higher than the DUT impedance. But for practical reasons it is difficult to do this measurement with very small wires. Such wires, for example 0.2 mm diameter wires, will break very easily when handled, during the brazing or when tautening the wire to reduce the sag.

4.1. Methods and tools to determine the impedance of an accelerator component A compromise had to be reached, a wire of d = 1 mm of diameter for a line impedance of Z L = 205.7 ± 6.0 Ω was chosen to do the measurements. In this case the matching is done using a resistor of R s = Z L -Z 0 ≈ 150 Ω. The material of the wire is chosen to be copper beryllium (CuBe) in order to be able to tauten the wire without stretching it. The half shell flanges have been designed to have a diameter of D eq = 30.9 mm to have the same line impedance Z L than the vacuum pipe one.

Measurement limitations

The coaxial wire measurement of the impedance has many limitations which can prevent a good measurement. Some limitations come from the setup and other come from the method used to do the measurement.

A first limitation is fixed by the calibration done on the VNA before doing the measurement. Using a calibration kit valid down to -40 dB it is not possible to accurately measure below -40 dB. This means that, using Eq. (4.6), the maximum impedance value which can be precisely measured using this setup is Z max = -2Z L ln(-40dB) ≈ 1900 Ω. This limit is further reduced because the measurement of the reference has to be taken into account.

A second limitation would be due to the repeatability of the measurements. When doing coaxial wire measurements many aspects change from measurement to measurement and may increase the uncertainty of the measurement: the brazing and the tautening of the wire, the positioning of the RF absorbing foam, the screwing of the half shell flanges on the DUT, ... In order to decrease the errors and increase the repeatability of the measurement several measurements have been taken. A support to fix the positioning of the RF foam is used and the measurement is done in a clean room with fixed temperature and pressure (except for the RF cavity measurement). A precise error quantification has been done to estimate this limitation.

Lastly the coaxial wire method has been shown to be inaccurate below the beam pipe cut-off frequency [START_REF] Masullo | The stretched wire method: a comparative analysis performed by means of the mode matching technique[END_REF]. The stretched wire perturb the behaviour of the electromagnetic field by allowing TEM waves with zero cut-off frequencies whereas, in realistic situation with a beam, these modes would not be able to propagate. The cut-off frequency (T E 11 ) for a round pipe is given by f c = j 1,1 c 2πR with j 1,1 the first root of the Bessel function J 1 , c the speed of light and R the radius of the beam pipe. For ThomX cross section, if the value R eq = Deq 2 is used then, f c = 5.7 GHz. The method is known to give good results above 30 % of the cut-off [START_REF] Masullo | The stretched wire method: a comparative analysis performed by means of the mode matching technique[END_REF], for ThomX this would mean above 1.3f c ≈ 7.4 GHz.

As the limitations are severe, in our case the coaxial wire method is only used to validate the simulation tools and methods.

Measurement of the reference section

In order to measure impedance by the wire method, it is necessary to measure an "ideal reference line" corresponding to S21 REF in Eq. (4.6). This measurement is used as the reference to take into account the defaults of the setup and the particular geometry of the beam pipe cross section. The reference section used here is a plain vacuum pipe using ThomX cross section, Fig. 4.4. Ideally the reference section should be of the same length that the DUT. But in our case there are many Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements objects of different length to measure and it does not seem justified to make a new reference section for each object to measure. Two length of reference section were measured, 100 mm and 500 mm, results are shown in Fig. 4.5. The two S21 measurements have a very similar curves but the longer section shows small oscillations on top of the general behaviour shown by both sections. These small oscillations are especially visible at high frequency, above 7 GHz. As the difference between two sections of very different length is small enough, it is legitimate to use one of these two measurement as reference for a DUT no matter its length. For smaller DUT, which size is around 100 mm, the smaller one will be used and for bigger DUT the other will be used.

Errors estimate

The main source of error in the impedance measurement is through the S21 measurements, especially the error on the repeatability of the measurements. A bunch of 5 different measurements of each pieces measured have been done to test these bias. After each measurement, the brazing and the tautening of the wire were changed. The standard deviation for a set of measurement of the 100 mm reference section is shown in Fig. 4.6. The typical value for the standard deviation is about σ S21 = 0.4 dB but it seems to increase with frequency. Note that this value can change according to pieces and frequencies.

As the error is inferred from a small set of repeated measurements, type A uncertainty, a Student t-distribution for the error is assumed [START_REF] Bipm | Guide pour l'expression de l'incertitude de mesure[END_REF]. So the standard uncertainty is given by u S21 M = ν ν-2 σ, with ν = N -1 degrees of freedom, N the number of measurement in a set and σ the standard deviation of the measurement set.

Other sources of errors, type B uncertainty, for the S21 measurement are the VNA resolution limit and calibration. The VNA used to do the measurement is an Anritsu MS4624B, last calibration check in a meteorology laboratory shown a maximum error of e = 0.2 dB (at -50 dB) when compared to a reference. A triangular distribution of the errors is assumed as this value e is the maximum error and not the most probable error. The resolution limit of the VNA is r = 0.02 dB at maximum. In this case a rectangular distribution of the errors is assumed as all values v are equally likely in v -r 2 , v + r 2 . In addition to the error on the S21 measurement there is also an error on the determination of the line impedance Z L , Eq.(4.7). The error on the wire diameter d is given by the manufacturer u d = 0.1 mm. The error for ThomX equivalent diameter D eq is the fitting error which is about u D = 0.1 mm. Table 4.3 shows the summary of the different error components, their sources and their respective probability distributions. [START_REF] Bipm | Guide pour l'expression de l'incertitude de mesure[END_REF]. The standard uncertainty on the S21 measurement u S is given by: u S = u S M + u S C + u S R . With u S C the standard uncertainty on the calibration, u S R the standard uncertainty on the resolution. The standard uncertainty on the repeatability of the measurement u S M depends on the object measured and on the frequency considered.

u Z = Z v π ln 2 S21 DU T S21 REF u D 2 D 2 + u d 2 d 2 + ln 2 D d u S DU T 2 S21 DU T 2 + u S REF 2 S21 REF 2 (4.8)
But Eq.(4.8) is not usable in this state as when using uncertainty propagation formulas the standard uncertainties u S should be absolute uncertainty. As it is shown in Eq.(4.9) to Eq.(4.11), the absolute uncertainties in dB (with index dB) change into relative uncertainties when changed back in linear scale (with index L). Furthermore the transformation from dB scale to linear scale leads to an asymmetry of the uncertainty boundaries.

Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements

S21 dB -u S dB < S21 dB < S21 dB + u S dB (4.9) S21 L u S L < S21 L < S21 L u S L (4.10) S21 L + S21 L ( 1 u S L -1) < S21 L < S21 L + S21 L (u S L -1) (4.11)
Finally Eq.(4.12) is obtained, in which all the quantities are in linear scale, and gives the upper and lower composed standard uncertainties. For example if the transmission parameter S21 for the reference is measured at -10 dB, for the DUT at -15 dB and that both measurements have a standard deviation of σ S21 = 0.4 dB at this frequency point then the impedance measured is Z = 237 +49 -46 Ω. In that case, 98 % of the uncertainty on the impedance is due to the uncertainty on S21 measurements and 2 % on the line impedance Z L .

u ± Z = Z v π ln 2 S21 DU T S21 REF u D 2 D 2 + u d 2 d 2 + ln 2 D d u ± DU T 2 + u ± REF 2 (4.12) u + = u S L -1 (4.13) u -= 1 u S L -1 (4.14)
All measurement results are shown with their 95 % confidence interval (CI) corresponding to the extended uncertainty using Student coefficient k = 2.78 (N = 5). In the case of the previous example, the extended uncertainties to 95 % CI gives Z = 237 +137 -127 Ω. The important uncertainty found comfort us in the idea that this measurement should only be used to validate the simulation tools and methods.

ThomX impedance model: simulations and measurements

In this section, the simulations and the measurements used to design ThomX impedance model are presented. The parameters used in the CST PS simulations of the individual elements of the storage rings are shown in Table 4.4. For the wake potentials presented in this section, the convention used is to have the head of the bunch in the region z < 0 and its tail in the region z > 0.

Bellows

In accelerators and storage rings, bellows are often needed to connect adjacent beam pipes, they provide the necessary flexibility to account for thermal expansion and contraction or for misalignment tolerances. Nevertheless, bellows are known to have been an important source of impedance in first generation storage rings [START_REF] Collier | Reducing the SPS machine impedance[END_REF]. If they are not shielded, bellows excite high order modes 4.2. ThomX impedance model: simulations and measurements (HOM) which generate heating and beam instabilities. To avoid that, bellows are now shielded, usually using what is called RF fingers.

The bellows produced for ThomX have removable RF fingers which are used to shield the beam from the irregular surface of the bellows. The CST simulation result is shown in Fig. 4.8. The wake potential and the impedance are of the broad band type with a very small amplitude. The wake decays very quickly after the source which shows that the HOMs are well suppressed by the RF fingers.

RF measurements of the bellows have been done with and without the RF fingers to test the effectiveness of the RF fingers in suppressing the HOMs. The transmission parameter S21 for these measurements is shown in Fig. 4.9. The measurement of bellows with RF fingers is very close to the reference measurement which indicates that the shielding works as intended. The measurement without RF fingers shows strong resonance peaks which clearly stand out of the Figure 4.10 shows the real part of the impedance obtained using the log formula, Eq.(4.6). It is compared with CST simulations of the impedance for both cases, in dotted lines with RF fingers for the top plot and without RF fingers for the bottom plot. For the bellows with RF fingers, the measurement agrees very well with the simulation which gives a very low impedance. For the bellows without RF fingers, simulation agrees relatively well with the measurement as the four peaks found in simulation also appears in the measurement. The two strong peaks at 2.1 GHz and 3.5 GHz in the simulation are shifted respectively at 2.2 GHz and 3.6 GHz in the measurement and have a lower amplitude value by a factor 8 to 10. The two smaller peaks at 4.4 GHz and 4.8 GHz are shifted respectively at 4.3 GHz and 4.6 GHz but have comparable amplitude. The differences in amplitude and the shifts in frequency can be explained by the variable geometry of a real bellows compared to the fixed bellows modelled in CST simulation. In the measurement, the peaks are broader than in the simulations as all the components of the real bellows do not resonate at the same frequency (due to the variable geometry). Also the measurement is not expected to be accurate above Z max ≈ 1900 Ω as explained in section 4.1.3.3. It is important to note the effectiveness of the RF fingers in suppressing the high impedances measured without the RF fingers, at the respective peaks frequency no sign of impedance are shown in the top plot impedance spectrum.

Pumping port

In ThomX, the pumping ports consist of a circular opening in the vertical plane behind a grid which continues ThomX typical cross section. There are several types of pumping ports in the storage ring, some of them in bent regions. As simulations with CST and measurements with the coaxial wire method are not possible in bent regions, the bent pumping port impedance is assumed to be the same as the ones in straight sections. This assumption seems reasonable as the pumping port grids are very similar in both geometries. The CST model and a picture of the straight pumping port is shown in Fig. 4.11. The CST simulation result for the pumping port is shown in Fig. 4.12. As for the bellows, it corresponds to a resistive broad band type with very small amplitude. The measurement of the transmission parameter S21 is shown in the top plot of Fig. 4.13. Overall the signal is very close to the reference signal with only a small peak at 4.1 GHz which stand out a bit from the reference level. Some oscillations between 7.8 GHz and 9 GHz are observed but are within the 95 % confidence interval. The bottom plot of Fig. 4.13 shows the impedance measurement compared with the expected result from the simulations. From the simulations no measurable effect is expected on the measurement. The oscillations seen on the measurement from 500 MHz to 1.8 GHz and from 5.7 GHZ to 9 GHz are within the CI, not totally significant, and might be due to some phase difference between the reference and the DUT because of the difference in length. The peak at 4.1 GHz is at the limit of the CI and is not expected from the simulations.

Beam position monitor

ThomX storage ring has several type of button Beam Position Monitors (BPMs), which are based on the SOLEIL design [START_REF] Hubert | The SOLEIL bpm and orbit feedback systems[END_REF] [START_REF] Nagaoka | Recent studies of geometric and resistive wall impedance at SOLEIL[END_REF]. There is the BPM4, which is a classic button BPM bloc with four electrodes but also the BPM6 and BPM8 which are double BPM blocs with respectively six and eight electrodes. In the BPM6 and BPM8, only four of the electrodes are actually used for beam measurements, the others are used as ion clearing electrodes, see section 8.3. The 3D mechanical drawing of the BPM4 is represented in the left of Fig. 4.14 and the CST model, done by Moussa El Ajjouri from SOLEIL, is shown on the right. The buttons and the feed-trough are made of molybdenum, a bloc of alumina is used as vacuum insulator and the BPM bloc is made from stainless steel (316 LN). The radius of the molybdenum feed-trough varies inside the electrode in order to keep the electric impedance of the structure at 50 Ω to insure a good transmission. A good modelling of the electrodes and of the 50 Ω matching is crucial for the wakefield simulation. Without proper matching, the electromagnetic field is reflected and produce strong oscillations in the wake potential [START_REF] Salvant | Impedance model of the CERN SPS and aspects of LHC single-bunch stability[END_REF]. CST PS wakefield simulations allow two possible ways to do the matching, with waveguide ports or with lumped ports. In this case, the two ways give very similar results. The electrodes used in the BPMs are bought from a private company, so the detailed inner design of the electrodes was kept secret and I did not have access to it. The CST model used to do the simulation correspond to a simplified geometry of the BPMs but should still provide a good approximation of the BPM impedance. Simulations have shown that the amplitude of the wake potential and thus of the impedance is directly proportional to the number of electrodes. So the simulations and measurements shown here for the BPM4 are also valid for the BPM6 and BPM8 with an amplitude multiplied respectively by 1.5 and 2.

In a button BPM, the electromagnetic fields excited by the beam can be trapped in the structure. The modes created between the BPM button and the BPM bloc housing the button 4.2. ThomX impedance model: simulations and measurements are of the H m1 type with characteristic frequencies f Hm1 given by [START_REF] Duarte | Design and impedance optimization of the SIRIUS BPM button[END_REF]:

f Hm1 = c π m r h + r b , (4.15)
where r h is the housing radius, r b is the button radius and m is an integer. The fields can also propagate and resonate in the dielectric material composing the vacuum insulator and act back on the beam. The resonant modes excited inside the dielectric are of the H m1p type with characteristic frequencies f Hm1p given by [START_REF] Duarte | Design and impedance optimization of the SIRIUS BPM button[END_REF]:

f Hm1p = c 2π √ r 2m r p + r h 2 + πp t c 2 , (4.16)
where r is the relative dielectric permittivity, r p is the pin radius within the dielectric and t c is the dielectric thickness. The two integer m and p are respectively the azimuthal index and the longitudinal mode number. Simulation results for the BPM4 are shown in Fig. 4.15. The wake potential shows oscillations which are damped after a few meters which allows to compute properly the impedance spectrum. The impedance spectrum presents many narrow band, cavity-like, peaks. The most important three correspond to modes trapped by the button, using Eq. (4.15) for the first three modes gives: f H11 = 8.642 GHz, f H21 = 17.284 GHz and f H31 = 25.926 GHz. Compared to the frequencies for these three peaks in the impedance spectrum: f 1 = 8.601 GHz, f 2 = 17.981 GHz and f 3 = 24.830 GHz. The others peaks around 14 GHz are likely to come from the alumina ceramic even if they do not correspond clearly to modes computed with Eq. (4.16). Compared to what is assumed in Eq. (4.16), the resonant modes have to enter and exit through the small gap between the button and the BPM bloc which can explain the mode frequency shift [START_REF] Duarte | Design and impedance optimization of the SIRIUS BPM button[END_REF]. Also the first dielectric modes are below the frequency cutoff of this small opening so they can not be excited.

The measurement of the transmission parameter S21 for a BPM4 prototype is shown in the top plot of Fig. 4.16. Again the measurement is very close to the reference measurement but there are small oscillations of the S21 below 2 GHz and above 6 GHz compared to the reference.

The bottom plot of Fig. 4.16 shows the impedance measurement for the BPM4 compared with the expected result from the simulations. As expected from the simulations no measurable effect is observed. The same kind of oscillations, below 2 GHz and above 6 GHz, were observed on the measurement of the pumping port in Fig. 4.13, it indicates that these oscillations are probably a bias in the measurement setup and not a real physical phenomena.

RF Cavity and its tapers

ThomX RF cavity is a 500 MHz single cell copper cavity of the ELETTRA type [START_REF] Massarotti | Status report on the ELETTRA RF system[END_REF]. The cavity fundamental mode can be tuned using an axial mechanical tuner while the higher order modes (HOMs) can be shifted from the beam spectral lines by the combined used of a plunger and temperature tuning. Indeed, it is crucial to insure that the HOMs are not resonating with any beam harmonics to avoid instabilities. The cavity comes with tapers to adapt its cross section to ThomX cross section. There is two versions of these tapers, an older one with unshielded bellows, and another one without bellows which will be used in ThomX. Figure 4.17 shows the CST model of the RF cavity with the tapers (without bellows) on the left and a picture of the RF cavity with the older tapers on the right.

To properly compute the impedance from a wake potential simulation such as CST PS, the amplitude of the wake potential need to damp down to zero within the simulated wakelength. If, as it is the case for the RF cavity, the structure simulated has a very important quality factor then the wake potential will oscillate for a long time, see (b) of Fig. 4.18. The impedance computed from such a wake potential can only give the HOM frequencies but not their amplitudes as the "full" wake potential is unknown. It is much more efficient to simulate a resonant structure in the frequency domain to get the HOMs frequencies, amplitudes and quality factor. The longitudinal and transverse modes of the cavity have been simulated with eigenmode solvers (CST and HFSS [71]) and measured using a vector network analyser (VNA) in transmission mode [START_REF] Khaldi | Simulations and RF measurements of the fundamental and higher order modes of the ThomX 500 MHz cavity[END_REF]. The parameters of the modes simulated with HFSS have been gathered in Table 4.5. The impedance of the RF cavity can be built using this table and the resonator model impedance, Eq. (3.30).

ThomX RF cavity have been simulated in wakefield mode with and without tapers (without bellows) in order to be included in the wake function model. The simulations results are shown in Fig. 4.18. The plots (a) and (b) of Fig. 4.18 show the wake potentials made by the RF cavity. The plot (b) shows the very strong oscillations of the wake potential which do not seem to decrease even after 20 m or more. In (a), the wake potential is of the capacitive type with a loss factor of k ,RF,wake = 1.10 V pC -1 which is much more than k ,RF,HOM s = 0.36 V pC -1 , the sum of the loss factor of all the individual mode loss factor computed using Table 4.5 and Eq. (3.37). The time domain wakefield simulation takes into account all the HOMs excited by a given bunch, so also the HOMs above 2 GHz not in Table 4.5.

The plots (d) and (e) of Fig. 4.18 show the wake potential and the impedance generated by the two tapers mounted directly on each other. In this configuration they form a smooth symmetric "step out" -"step in" transition. The wake potential and the impedance are of the resistive broad band type. The wake potential loss factor is k ,tapers = 1.87 V pC -1 . As expected the low frequency real impedance is close to zero as, for large bunches, the transition step out/step in should happen without energy loss [START_REF] Palumbo | Wake fields and impedance[END_REF]. The oscillations in the real and imaginary part of the impedance (with negative real impedance at some frequencies) between 3 GHz and 8 GHz may result from numerical noise. A step-in transition is known to have a negative real impedance below the beam pipe frequency cut-off [START_REF] Palumbo | Wake fields and impedance[END_REF]. It is probable that this negative real impedance is not totally compensated by the positive real impedance of the step out in the simulation.

The plot (c) of Fig. 4.18 show the wake potential created by the RF cavity mounted with its tapers. The wake potential is resistive and has a long range behaviour similar to the one of plot (b). Its loss factor k ,RF +tapers = 3.14 V pC -1 is superior to the sum of the loss factor of its two component taken individually k ,RF,wake + k ,tapers ≈ 2.97 V pC -1 .

The older version of the tapers, with unshielded bellows in the bigger pipe part, have been mounted together in "step out" -"step in" and measured with the coaxial wire method. In reality and in simulation, the impedance of a taper depends on the direction the beam is going which tells if the taper is a "step out" or a "step in". But when measuring a single taper with the wire method there was no difference between the forward transmission parameter S21 and the backward transmission parameter S12. So in order to have a point of comparison with the simulation, two tapers have been mounted together to form a symmetric piece.

The S21 for this measurement is shown in the top plot of Fig. 4.19. As the length of the two tapers together is L = 700 mm, the 500 mm straight section was chosen as reference. The final cross section of the old tapers is not exactly the same as the ThomX one, see Fig. 4.4, they have an elliptical cross section of the same dimensions as the ThomX cross section. Apart from the peaks around 2.7 GHz and the group of peaks from 3.5 GHz to 4.7 GHz, the signal is close to the one of the reference. This indicates that most of the effect measured here is due to the bellows and 4.2. ThomX impedance model: simulations and measurements not to the tapers. The effect of tapers is expected to be very broad band in frequency whereas the effect of bellows is expected to be localised in the form of peaks. In high frequency, above 7.3 GHz, the same kind of oscillations seen for the 500 mm reference section is present with a phase shift. The impedance measured is plotted in bottom of Fig. 4.19 and is compared to the simulation result. The group of impedance peaks measured is shifted by some GHz in the simulations but it has the same amplitude. This confirms that the effect measured is due to the bellows as no broad band effect is seen in this frequency range. The tapers broad band effect is expected to arise from 10 GHz and increase with frequency. The bellows move a bit between each measurement of the set and decrease the repeatability which is the reason behind the high uncertainty shown in Fig. 4. [START_REF] Bruni | Electron beam dynamics in the 50 MeV ThomX compact storage ring[END_REF]. The frequency shift of some GHz compared to the simulation is due to the fact that the bellows were not in the same state of mechanical compression in the measurement and in the simulations.

RF cavity has also been measured with its tapers (old version with bellows). The measurement has been done on a cavity of the same type as ThomX but without its cooling system. As a consequence the measurement was done at ambient room temperature and not at the working temperature of the cavity. This implies that the cavity was not tuned as it would be in operation and the modes are expected to be shifted in frequency. The top plot of Fig. The peaks measured in the bottom plot of Fig. 4.20 can be compared with the simulations and the measurements done in [START_REF] Khaldi | Simulations and RF measurements of the fundamental and higher order modes of the ThomX 500 MHz cavity[END_REF] shown in Table 4.5. All the peaks measured below 2.2 GHz are clearly identifiable but have a shift in frequency of the order of 40 MHz. The mode L2 is not found back in this experiment but it could be inside the broad peak of the L1 mode. There seems to be an correlation, which is expected from theory, in the amplitude of the impedance peak measured and the measured R Q . The peak at 2.7 GHz might be a HOM of high amplitude which could be important to investigate with frequency domain simulation as it was not documented in [START_REF] Khaldi | Simulations and RF measurements of the fundamental and higher order modes of the ThomX 500 MHz cavity[END_REF].

Kicker

Kickers are often complex pieces to handle with respect to impedance estimation, as shown by the high number of publications focusing on kicker impedance evaluation [START_REF] Davino | Improved analytical model of the transverse coupling impedance of ferrite kicker magnets[END_REF] [75] [START_REF] Tsutsui | Some simplified models of ferrite kicker magnet for calculation of longitudinal coupling impedance[END_REF] [63] [START_REF]Kicker impedance measurements for the future multiturn extraction of the CERN proton synchrotron[END_REF]. ThomX kickers are composed of an elliptic ceramic chamber which is coated by a thin (≈ 100 nm) layer of titanium which is partially oxidised on surface due to the air contact during the manufacturing process. The chamber has to allows the magnetic field, produced by the fast kicker magnets, to go inside the chamber for the kicker to be effective which is why the ceramic is used as the body of the chamber. In the same time, the chamber is coated by a conductor in order to allow the image current to flow along the coating and limit heating and wakefield emission.

But having a ceramic chamber also mean than the beam electromagnetic field can reach outside of the chamber and can interact with outside materials. A cutting view of the 3D mechanical design is shown in Fig. 4.21. On the kicker extremities there is no material in the vicinity of the chamber, but on the centre there is the magnet system composed of rectangular ferrite yokes, a copper conductor and an aluminium body. The interaction of the beam electromagnetic field with the ferrite is a concern as it is known to produce high impedance for past kickers [START_REF] Davino | Improved analytical model of the transverse coupling impedance of ferrite kicker magnets[END_REF] [75] [START_REF] Tsutsui | Some simplified models of ferrite kicker magnet for calculation of longitudinal coupling impedance[END_REF]. Overall, in order to evaluate this element impedance, the coated ceramic chamber and the interaction with the ferrite should be investigated. At the time this thesis is written, this is hardly feasible using classic electromagnetic simulation tools like CST PS. In CST PS, the behaviour of the lossy metal material type is to keep the electromagnetic field out of this material and compute the 4.2. ThomX impedance model: simulations and measurements boundaries conditions such as the field is terminated taking into account the skin depth effect [START_REF]CST particule studio[END_REF]. The problem might be solved by using normal material type, which is usually used for dielectrics, which allows the fields to enter the material but then a scale problem appears. The titanium coating and its oxidised part width range between 10 nm and 100 nm whereas the other element width range between 1.5 mm and 15 mm. Even with adaptive mesh cells, the 3D model would still need more than 10 9 mesh cells in order to correctly model both scales. An eventual simulation this way would take much more memory and computation time than what is affordable.

So to evaluate the kicker impedance, an analytical model close to the kicker geometry and allowing to tackle the issues raised was used: the multi-layered cylindrical chamber model [START_REF] Mounet | Electromagnetic field created by a macroparticle in an infinitel long and axisymmetric multilayer beam pipe[END_REF] computed using IW2D [START_REF] Mounet | [END_REF], which is introduced in section 4.1.2. This model is very well adapted to the ceramic chamber, as the ceramic and the coatings have uniform width (supposedly for the Ti and its oxidised part) corresponding well to a layered model. For the magnet system part, which is further from the beam, its geometry is neither axisymmetric nor uniform but it will be approximated as so in this study. Compared to simulation, the advantage of using an analytical model is that it is very easy to get the impedance up to very high frequency, up to 1 THz for this study.

Several toy models based on the kicker geometry are presented in Fig. 4.22. For each of these models, the point like beam travels in a vacuum cylinder of radius r min = 14 mm, then successive layers of materials, defined in Table 4.6, constitute the environment of the beam. Every model ends by a vacuum layer of infinite width. The impedances and the wake functions obtained for the model 1 to 4 correspond to length of 1 m of beam pipe. The elliptic geometry of ThomX kickers has been taken into account to correct the results given by these models using the Yokoya factors computed in section 4.1.2. 4.6: Parameter used in IW2D for ThomX kicker materials: ρ DC is the DC resistivity of the layer, τ is the resistivity relaxation time, b is the real part of the dielectric constant, χ m is the magnetic susceptibility, f m is the permeability relaxation frequency and h is the layer thickness. characterises the diminution of the current density in a given material, is given by the equation:

Material ρ DC ρ DC ρ DC (Ω m) τ τ τ (s) b b b χ m χ m χ m f m f m f m (Hz) h h h (m) Titanium oxide T iO 2 10 13 (10 11 to 10 15 ) 0 1 0 ∞ 10 • 10 -9 Titanium T i 5.5 • 10 -7 5.7 • 10 -16 ≈ 0 1 0 ∞ 90 • 10 -9 Aluminium oxide Al 2 O 3 10 12 0 9.8 0 ∞ 5 • 10 -3 Ferrite 10 6 0 1 2000 ∞ 15 • 10 -3 Copper Cu 1.7 • 10 -8 2.5 • 10 -14 1 0 ∞ 4 • 10 -3 Aluminium Al 2.82 • 10 -8 2.1 • 10 -14 1 0 ∞ 15 • 10 -3
δ skin = 2ρ DC ωµ 1 + (ρ DC ω b ) 2 + ρ DC ω b , (4.17)
where ω = 2πf is the angular frequency. The skin depth δ skin has been plotted for the different materials of ThomX kicker in Fig. 4.26. In the same figure, the thickness of the materials has been plotted in dotted lines. When a plain line meets a dotted line of the same colour, it means that the material is thick enough not to allow the electric field for frequencies bigger than the frequency corresponding to the two lines intersection. This confirms that the thin titanium coating is not enough to shield the other materials from the beam as it only stop frequencies higher than 30 THz. But the copper layer stops all the frequencies higher than 200 Hz, which is why the oscillations and the resonance generated by the ferrite layer are not seen in model 4.

From these toy models, a more realistic kicker model is built using model 2 to cover the two kicker extremities (corresponding to two pieces of 63 mm of model 2) and model 3 for the central part where the magnet system is (corresponding to 204 mm of model 3). Choosing model 3 to represent the central part of the kicker is an overestimation of the impedance as part of the ferrite will be shielded by the copper structure (as in model 4). But the copper structure only covers the ferrite in the horizontal direction and not in the vertical one, so the kicker real impedance is probably between the one of model 3 and the one of model 4. The longitudinal impedance produced by this realistic kicker model is shown in Fig. 4.27 and the transverse impedance is shown in Fig. 4.28. Several approximations were made to obtain the kicker impedance. The 4.2. ThomX impedance model: simulations and measurements actual geometry of the magnet system is neglected, some physical parameters of the materials (i.g. χ m ) are known to be frequency dependent but not considered as such in this model and the value of most of the parameters is subject to large uncertainties. The value of χ m for the ferrite layer which has been used is the DC value, which should lead to overestimate the impedance (χ m is supposed to decrease with f ). In order to estimate the error due to large parameter uncertainties, the models 2 and 3 composing the final kicker model has been computed for different parameters within their probable range. Overall, the error ∆Z due to the lack of knowledge about material parameter should be ∆Z ≈ ±5W. Ideally this analytic model should be benchmarked against RF measurements, but it was not possible as the kickers were not yet manufactured at the time of this thesis.

Septum

The septum chamber is designed to allow the beam injection and extraction while shielding the stored beam from the septum DC magnet. The CST 3D model of the septum chamber is shown in full and in cutting view in Fig. 4.29. The main body of the chamber is shielded from the constant magnetic field produced by the septum magnet with a thin layer of mu-metal. Mu-metal is metal with an high relative magnetic permeability µ r which prevent the DC component of the magnetic field to go through it. Thanks to this mu-metal layer, the stored beam is not affected by the septum magnet magnetic field. For injection, the incoming bunch is bent by the magnet and is injected into the septum chamber, via the elliptic holes in the chamber, with an slight angle with respect to the longitudinal axis. The angle is then corrected with the fast kickers. For extraction, the fast kickers give the bunch an angle to send it outside of the septum chamber via the elliptic windows, then the bunch is sent to the extraction line by the septum magnet. The septum chamber is a complex piece with respect to impedance estimation because it presents many different features impacting the impedance. Firstly, the septum chamber begins with a taper transition from the ThomX cross section to a rectangular cross section. Then, this rectangular cross section is reduced in the horizontal plane to allow for the injection/extraction windows, this transition corresponds to a step in and then to a step out in the horizontal plane. Finally, the central part shows both a pumping grid on one side and the mu-metal shield all around this central region. The mu-metal magnetic permeability is highly frequency dependant, from the supplier data-sheet µ r = 520 • 10 3 at DC and µ r = 80 • 10 3 at 60 Hz but no values are known for higher frequencies. In theory it is possible to use frequency dependant materials in CST PS wakefield solver, but in practice the computational cost explodes when trying to use it to model thin layers for a high frequency range. So, as it is known that the magnetic permeability of the mu-metal decreases very quickly with frequency [START_REF] Thiel | Demagnetization of layered ferromagnetic structures for magnetically shielding: frequency considerations[END_REF], the relative magnetic permeability of the mu-metal has been set to 1 in the wakefield simulations. The impedance and the wake potential generated by the septum chamber for a Gaussian bunch of σ = 2 mm are plotted in Fig. 4.30. As the septum chamber is asymmetric with respect to the S -Y plane, an horizontal wakefield is also produced even if the bunch travels in the chamber centre. The horizontal wake potential computed here corresponds to the constant term of Eq. 3.13, independent of the transverse position, convoluted with the Gaussian longitudinal charge density. It is created by the horizontal step in/step out and tends to push the bunch toward the pumping 4.2. ThomX impedance model: simulations and measurements grid direction. The wake potentials in both directions are dominated by the effect of the tapers, so the wake potentials are of the resistive type. The impedance is broad band and very characteristic of a step transition with a frequency cut-off around 5.5 GHz.

The same simulation has been done with a constant mu-metal relative magnetic permeability µ r = 400 • 10 3 , in that case the impedance is totally dominated by the effect of the mu-metal. The longitudinal impedance is a broad band centred in 12 GHz with a maximum amplitude of 800 Ω which correspond to a loss factor of k ,mur=400•10 3 = 17.1 V pC -1 . This value is much higher than the one corresponding to µ r = 1, k ,mur=1 = 1.14 V pC -1 . Of course, this situation is highly unrealistic as µ r converges to 1 very quickly with the frequency but it shows that the impedance obtained in Fig. 4.30 is surely a bit underestimated.

Transverse feedback kicker

The stripline kicker for the transverse feedback aims to damp the injection jitter and to suppress transverse instabilities. The 3D CST model of the transverse feedback kicker is presented in Fig. 4.31. It is composed of four electrodes, which reproduce ThomX cross section, connected to electrical feed-through at both ends. The electrodes are supported by ceramic (marcor) holders and are connected to the feed-through via coper foils. In order to minimise the impedance, 0.5 mm capacitive gaps have been added on each side of the electrodes. This capacitive gap, combined with the inductance of the feedthroughs and copper foils, and the 50 Ω electric impedance of the electrodes, creates a low pass filter [START_REF] Ajjouri | Design of the transverse feedback kicker for ThomX[END_REF]. The cut-off frequency of this filter depends on the height h, see Fig. 4.31, of the capacitive section.

CST PS wakefield simulations have been done for several values of the height of the capacitive section h in order to find the value that would minimise the impedance. The simulations are shown in Fig. 4.32 for three values of the capacitive section, h = 0 mm, h = 5 mm and h = 10 mm. In plots (a) and (b), the impedance spectrum shows resonant peaks in between 1 GHz and 7 GHz. Increasing h allows to reduce the amplitudes of these resonances and shift them toward lower frequencies. In plot (c), the transition from a wake potential almost resistive (h = 0 mm) to an inductive wake potential (h = 10 mm) is visible. It corresponds to the frequency shift toward lower frequencies of the resonances due to the capacitive gap. The design with h = 10 mm is chosen as it allows to reduce to loss factor from k ,h=0mm = 0.098 V pC -1 to from k ,h=10mm = 0.038 V pC -1 for a σ = 7 mm bunch length.

IP chamber

The interaction point (IP) chamber is the location where the Compton backscattering between the electron beam and the laser takes place. The Fabry-Perot optical cavity in which laser is stored and amplified is located at the sides of the chamber, see Fig. 2.6. Windows have been cut into the electron beam vacuum chamber so that the laser pulse can enter and interact with the electron beam. The 3D mechanical drawing of the IP chamber is shown in top of Fig. 4.33. As the geometry of this chamber is curved, it is not possible to simulate it using CST PS or measure it with the coaxial wire method. So in order to estimate the wakefield generated by these windows in CST PS, the same windows have been adapted to a straight line geometry similar to the one The impedance spectrum corresponds to a low amplitude broadband one. The simulated wake potential is of short range resistive type.

Total

The number of each of the ThomX storage ring elements is detailed in Table 4.7. The loss factor k of each element is indicated and the total contribution of this element type to the total loss factor k ,T is given in percentage. For a Gaussian distribution of σ = 2 mm, most of the effect on the bunch is given by the RF cavity and its tapers, 46.7 % of k ,T . The kickers and the septum weight respectively 12.2 % and 17.0 % of k ,T and the rest is distributed among the other components.

The total impedance spectrum is shown in Fig. 4.35 for the real part and Fig. 4.36 for the imaginary part. The RF Cavity contribution is not shown in these plots as its impedance only corresponds to the very high amplitude, narrow resonances described in Table 4.5. The real part of the total impedance is mostly broadband with some peaks mainly due to the BPMs. The broadband part has an amplitude about 75 Ω from DC to 10 GHz which is mainly due to the kickers. After 10 GHz the broadband amplitude increases up to 250 Ω mostly because of the tapers, and also due to the pumping ports and bellows for high frequencies. The imaginary part of the total impedance is mainly positive up to 45 GHz and is negative for higher frequencies. The sharp transitions at 8.6 GHz and at 18 GHz corresponds to the main resonances of the BPMs. Figure 4.37 shows the total wake potential created by a Gaussian bunch of σ = 2 mm, in the top plot, and of σ = 6 mm, in the bottom plot. For short bunches, σ = 2 mm, the wake potential is resistive with a maximum amplitude about -10 V pC -1 while for longer bunches, σ = 6 mm, the wake potential is capacitive with a lower maximum amplitude, about -1 V pC -1 .

The measurements, despite the important uncertainty of the measurements using the coaxial 4.3. Linking wakefield simulations to beam dynamics simulations wire method, show good agreement with the simulations. They show that, for the prototypes that have been measured, the elements were correctly represented in CST, and that the element design and manufacture is suited to produce low impedance elements. Even if, for now, not all the elements has been measured, the measurements have allowed to validate the CST simulation procedure which is used for most of the elements of the impedance model.

Linking wakefield simulations to beam dynamics simulations

By looking at the wake potential created by a given bunch, by computing the wake loss factor or by superimposing the impedance and the beam spectrum one can have a rough idea of the effect on the beam. However, to really understand the overall impact, it is often necessary to simulate these effects directly on the beam dynamics. As it is hardly possible to simulate the wake potential for every bunch shape or bunch size needed in beam dynamics studies, one needs a method to use the results of the wakefield simulations as an input to the beam dynamics studies. It is possible to compute the wake potential created by any longitudinal charge density either in the time domain by convolution with the wake function or in the frequency domain using Eq. 3.25. For macro-particle tracking codes working in the time domain, it is possible to use the frequency domain solution but with the added cost of computing the Fourier transform of the bunch longitudinal charge density each time a wake potential is needed. So usually, macro-particle codes use the time domain approach as the longitudinal profile is directly available. The method to get the wake function is usually what differs between studies. Several methods are used: Fit the total impedance or the impedance of the individual elements with a resonator, Eq.

(3.30), or with another model, and use the analytic wake function associated with this model [START_REF] Zotter | Impedances and wakes in high energy particle accelerators[END_REF]. This is the most commonly used method as it is used in many studies [START_REF] Nagaoka | Instability studies using evaluated wake fields and comparison with observations at SOLEIL[END_REF] or beam dynamics codes such as Bmad [START_REF] Sagan | Bmad: a relativistic charged particle simulation library[END_REF], elegant [START_REF] Borland | Elegant: a flexible SDDS-compliant code for accelerator simulation[END_REF] [83], OCELOT [START_REF] Agapov | OCELOT: a software framework for synchrotron light source and FEL studies[END_REF].

Use the wake potential simulated with a much smaller bunch length than the real bunch length as a wake function [START_REF] Frasciello | Wake fields and impedance calculations of LHC collimators real structures[END_REF]. Typically, fourth to a tenth of the real beam length is used. This method has the disadvantage of being computationally heavy and can not be used easily for short bunches as wakefield simulation of short bunches is already a challenge. Extract a pseudo wake function from the wake potential data via deconvolution or equivalently compute a pseudo wake function from an impedance spectrum [START_REF] Salvant | Impedance model of the CERN SPS and aspects of LHC single-bunch stability[END_REF] [START_REF] Mounet | The LHC transverse coupled-bunch instability[END_REF].

The last two solutions are useful for beam dynamics codes that use the wake function as an input such as elegant [START_REF] Borland | Elegant: a flexible SDDS-compliant code for accelerator simulation[END_REF] [START_REF] Wang | PELEGANT: a parallel accelerator simulation code for electron generation and tracking[END_REF] and PyHEADTAIL [START_REF] Pyheadtail | Bibliography[END_REF]. This section describes a method to extract a pseudo wake function from the wake potential by deconvolution. This method has been tested for several accelerator components, both with short range wakefields and long range wakefields, and allowed us to compute the wake potential for a large range of beam longitudinal distributions. Compared to other methods, I believe it allows for a better wake potential reconstruction, meaning that the convolution of the wake function with a longitudinal distribution gives a wake potential Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements closer to the one obtained in simulations. But as every other methods, it has its own limitations which will also be highlighted. Longitudinal wakefields are considered but this method is also usable in the case of transverse wakefields.

The method proposed here consists in a simple application of the wakefield formalism. From Eq. (3.21) and using the inverse Fourier transform F T -1 gives the wake potential W in terms of the simulated wake potential W p and of the source longitudinal charge density ρ:

W (z) = F T -1 F T [W p (z)] F T [ρ(z)] . (4.18)
This corresponds to compute the impedance spectrum (to a factor -1 with the convention used here) from the wake potential and then to compute the wake function via the inverse Fourier transform. If the impedance is obtained using an analytical model, it is also possible to compute the wake function directly from the impedance, Eq. (3.16). In both cases, as the wake potentials are obtained numerically and as analytical expressions of the impedance are often very complex, it is necessary to numerically compute these Fourier transforms.

When an impedance spectrum is computed numerically from a simulated wake potential, using Eq. (3.26), it has a finite frequency range where it is valid. The range depends on the source bunch frequency spectrum, for a Gaussian distributed bunch the amplitude of the spectrum decreases with the frequency. The maximum frequency of the impedance spectrum is chosen in order to avoid dividing by too small values which can lead to numerical errors. In the same way, the wake functions computed numerically with this formula will only be valid for the frequency interval associated to its impedance spectrum. When this pseudo wake function is computed numerically, the Fourier integrals are truncated and approximated by a discrete Fourier transform (DFT). The most common algorithm to compute DFTs is the fast Fourier transform (FFT) algorithm. Some authors have demonstrated that the FFT is not the most appropriate DFT algorithm to compute wake functions in terms of accuracy, in particular to compute the wakes over very long ranges [START_REF] Mounet | The LHC transverse coupled-bunch instability[END_REF]. As in that case, we are only interested in the wake potential effect over its source bunch, so very short range, the FFT can be used. In practice, the application of these formulas can be very tricky and numerical tips are needed to obtain satisfying results in most case.

Care should be taken to keep the same origin µ for both signals before using the F F T algorithm. Both F F T [W p (z)] and F F T [ρ(z)] shows oscillations in their spectrum. These oscillations in the real and imaginary parts are due to the fact that the centre of the Gaussian distribution µ is not zero in the FFT, which brings a phase drift in exp (iωµ) as seen in Eq. (4.19). By keeping the same origin µ for both signals, the phase will cancel out after the division.

F T 1 σ √ 2π exp - 1 2 z -µ σ 2 (ω) = exp jωµ - 1 2 ω 2 σ 2 (4.19)
The bunch spectrum F F T [ρ(z)] has to have a good resolution in order to be able to compute the impedance, and the wake function, properly for the whole frequency range. It can be computed using the discrete-time Fourier transform (DTFT) of the beam distribution input which can be done by zero-padding before the F F T computation.

Linking wakefield simulations to beam dynamics simulations

The zero padding technique is useful to artificially increase the frequency resolution of a DFT where the time signal is not long enough, or contains insufficient information, to have sufficient resolution. The method consists in adding points (of zero value) at the end of a signal to increase its length and thus increase the frequency resolution of the DFT. Another reason for using zero padding is to obtain a signal which sample number is a power of two, which greatly increases the speed of the FFT.

To fully understand the effect of zero padding, it is important to distinguish two aspects of the resolution on a DFT. The resolution of the FFT, which can be defined as : R F F T = f 0 N with f 0 the sampling frequency and N the number of samples of the signal. And the frequency resolution of the signal which is given by : R signal = 1/T with T the real length of the signal (without zero padding). Zero padding will only increase the FFT resolution R F T T and not the signal frequency resolution R signal . This implies that it is not possible to resolve more signal with zero padding, but only to get a better resolution on resolved peaks.

Zero padding a signal before using the FFT makes the DFT tend to the discrete-time Fourier transform (DTFT). It is possible to view the DTFT as the DFT of the convolution of the original signal (of finite dimension) with a gate function, taking as value 1 during the signal and 0 outside. The FT of such a gate function being a cardinal sine function, the visual effect on the DFT of a zero padded signal will be the appearance of corrugations reminiscent of those of the cardinal sinus function. Different gating techniques can also be used to improve the result of an FFT. A pseudo wake function wf has been computed using this method based on the wake potential Chapter 4. ThomX geometric and resistive wall impedance model: simulations and measurements W p,CST obtained by the CST PS simulation of a Gaussian bunch going through a step out transition. A way to test and check if the wake function wf computed is correct, is to convolute it with different bunch charge densities ρ and to compare the resulting wake potential W p,wf with the simulated wake potential W p,CST corresponding to that ρ. Figure 4.38 shows two cases: on the top plot with the Gaussian bunch charge density ρ used to compute the wake function wf , and on the bottom one with a "real" bunch charge density ρ obtained from beam dynamics simulation. The top plot shows that the wake potential reconstruction works as it should when the convoluted distribution is the one used to get the wake function wp. The bottom plot shows that the wake reconstruction also works when the convoluted distribution is far from the one used to get the wake function wp. Indeed, the wake potential W p,wf obtained via convolution is very close to the one obtained via simulation W p,CST even if the wake function wf is obtained from the Gaussian wake potential of the top plot. This process has been used on every element of ThomX storage ring to extract a pseudo wake function from the results presented in section 4.2. Figure 4.37 shows the total wake potential obtained using this method for Gaussian longitudinal distributions. More details on the implementation of this method in the tracking code CODAL are given in section 6.2.

Chapter 5 ThomX coherent synchrotron radiation impedance model

In chapter 3, the coherent synchrotron radiation (CSR) is quantitatively introduced. In this chapter, a CSR impedance model for ThomX storage ring is developed following the same idea as for the geometric and resistive wall impedance model presented in chapter 4. Foremost analytical models often used to estimate the CSR impedance are presented in section 5.1. Then CSR impedance is simulated for rectangular vacuum chamber using the CSRZ code [START_REF] Zhou | Calculation of coherent synchrotron radiation impedance for a beam moving in a curved trajectory[END_REF] in section 5.2. This chapter is mostly based on the work of Demin Zhou [START_REF] Zhou | Coherent synchrotron radiation and microwave instability in electron storage rings[END_REF] with input from other sources [START_REF] Kheifets | Coherent synchrotron radiation, wake field and impedance[END_REF] [START_REF] Murphy | Longitudinal wake field for an electron moving on a circular orbit[END_REF].

The CSR community usually uses a different convention for the impedance and the wake functions compared to the one presented in section 3.2 and used in the literature for the geometric and resistive wall wakefields. In this convention, a positive wake function corresponds to an energy loss and the impedance spectrum is the complex conjugate of the one defined in section 3.2. This chapter keeps using the convention used in section 3.2 but plots -Im[Z] in the impedance spectrum in order to keep the usual display of the impedance for the CSR. For the wake potentials presented in this section, the convention used is to have the head of the bunch in the region z < 0 and its tail in the region z > 0.

Analytical models

The most simple model one can consider, is an electron (point like charge) moving in free space on a circle of radius R. In that case, the steady-state longitudinal CSR impedance Z F S per unit path length is given by [START_REF] Fattens | Longitudinal coupling impedance of a stationary electron ring in a cylindrical geometry[END_REF]:

Z F S L (ω) = Z 0 2π Γ( 2 3 )( -jω 3cR 2 ) 1/3 . (5.1)
Where Z 0 = 376.73 Ω is the free space impedance, Γ is the Euler gamma function, c is the velocity of light in vacuum and L is the path length. The above formula is valid for ω << 3γ 3 c 2R , it is also possible to derive a formula for the free space impedance valid for all frequencies [START_REF] Murphy | Longitudinal wake field for an electron moving on a circular orbit[END_REF].

In practice, the particles are surrounded by the vacuum pipes which can modify the radiation emitted. The conducting walls near the charge tends to decrease the amplitude of the fields created due to the effect of the induced charges on the walls [START_REF] Kheifets | Coherent synchrotron radiation, wake field and impedance[END_REF]. The same thing can happens with the induced currents on magnet poles. This effect is called shielding and depends strongly on the Chapter 5. ThomX coherent synchrotron radiation impedance model distance of the charge to the vacuum chamber. The shielding effects can be described using the parallel plates model [START_REF] Murphy | Longitudinal wake field for an electron moving on a circular orbit[END_REF] [START_REF] Fattens | Longitudinal coupling impedance of a stationary electron ring in a cylindrical geometry[END_REF]. In this model, an electron (point like charge) moves in between two perfectly conducting plates separated by a distance h on the horizontal direction. The electron moves in between these two plates on a circle of radius R. The steady-state longitudinal CSR impedance Z P P per unit path length for this model is given by [START_REF] Agoh | Calculation of coherent synchrotron radiation using mesh[END_REF]:

Z P P (ω) = 2πZ 0 L h 2c ωR 1/3 ∞ p=0 A i (X 2 p ) A i (X 2 p ) + jB i (X 2 p ) + X 2 p A i (X 2 p ) A i (X 2 p ) + jB i (X 2 p ) ,
(5.2) where A i and B i are the Airy function of the first and second kind and A i and B i their derivative. X p is given, for p a positive (or zero) integer, by:

X p = (2p + 1)π h Rc 2 2ω 2 1/3 . (5.
3)

The impedance given by these two models have been plotted in Fig. 5.1 for a ThomX ring dipole. Compared to the free space impedance Z F S which increases as ω 1/3 , the parallel plate impedance Z P P presents a threshold f sh below which the impedance is zero. For high frequencies, the parallel plate impedance Z P P tends to the free space impedance Z F S . The threshold is due to the shielding effect of the parallel plates and f sh can be estimated by [START_REF] Murphy | Longitudinal wake field for an electron moving on a circular orbit[END_REF]:

f sh ≈ 3c 2π R h 3 (5.4)
In order to shield the CSR for the typical bunch injected into ThomX storage ring, rms length σ ≈ 2 mm, the threshold f sh must be increased up to approximately 75 GHz. This corresponds to a maximum distance h of 11 mm (several definitions of the Eq. (5.4) are found in the literature [START_REF] Agoh | Steady fields of coherent synchrotron radiation in a rectangular pipe[END_REF]). To make a vacuum chamber this small would be challenging but not impossible, but it would 5.1. Analytical models not solve the CSR issue for ThomX. As the bunches are injected into the storage ring without longitudinal matching, the filamentation process in the longitudinal phasespace brings modulations in the longitudinal bunch profile, see chapter 1. These modulations have a longitudinal size much smaller than the injection bunch length so even with a very small beam pipe the CSR effects would still be important.

The wake potentials radiated by a σ s = 0.5 mm Gaussian bunch for these two models are obtained using Eq. (3.25) and shown in Fig. 5.2. The CSR field is radiated in the direction of propagation of the beam, so the particles at the tail of a bunch will affect the particles of the bunch head as shown in (a) of Fig. 5.3. The wake potential in free space W p,F S is negative for the tail of the bunch (energy loss due to the radiation), while it is positive for the head (radiation emitted from the tail). In the parallel plate model, the radiated CSR at the bunch head can be reflected on the conducting plates and can reach the tail of the bunch like in (b) of Fig. 5.3 (but with horizontal walls instead of transverse walls). The wake potential W p,P P has a slightly lower amplitude and reach less far in the forward direction (z < 0) than W p,F S due to the shielding effect. The reflections on the conducting plates bring a head-tail interaction which was absent in the free space case. These simple models correspond to a steady-state situation where the electron bunch trajectory is perfectly circular. In most real machines, the dipoles are interleaved with drift spaces which introduce transient effects at dipole entrance and exit. The CSR fields emitted in the dipoles are guided by the vacuum chamber, acting as a waveguide, and propagate along the beam in the straight sections, see (c) of Fig. 5.3. This effect, also called "drift CSR", is more important if the Chapter 5. ThomX coherent synchrotron radiation impedance model machine contains short dipole magnets. It is characterised by [START_REF] Zhou | Coherent synchrotron radiation and microwave instability in electron storage rings[END_REF]:

L th1 = 24R 2 σ s 1/3 , (5.5)
where σ s is the rms bunch length. If the magnet length L b is much longer than L th1 , then the transient effects can be neglected. For ThomX, with σ s = 2 mm, L th1 = 180 mm which is of the same magnitude as L b = 296 mm, so this effect is expected to contribute to the CSR. Some more complicated analytical models take into account transient effects [START_REF] Mayes | Exact 1d model for coherent synchrotron radiation with shielding and bunch compression[END_REF] [93]. In addition to transient effects, the CSR fields can also be reflected, sometimes multiple times, on the transverse beam pipe walls, as in (b) of Fig. 5.3. The reflections on the outer walls lead to head-tail effects while the reflections on the inner walls lead to tail-head effects. When the magnet is long compared to the vacuum chamber width a, the CSR fields can resonate within the vacuum chamber and excite the eigenmodes of the vacuum chamber [START_REF] Zhou | Coherent synchrotron radiation and microwave instability in electron storage rings[END_REF]. This effect is important if the magnet length L b is much longer than L th2 :

L th21 = 2 √ Ra . (5.6)
In ThomX ring dipoles, L th1 = 246 mm, which is slightly smaller than L b so a small effect is expected. Furthermore, the CSR fields radiated in a dipole can propagate until the next dipole and interfere with the new CSR fields produced in this second dipole [START_REF] Zhou | Coherent synchrotron radiation and microwave instability in electron storage rings[END_REF].

ThomX CSR model using CSRZ

The simple analytical models presented in section 5.1 do not take into account the transient effects, the transverse shielding, the CSR field resonances and interferences along a series of bending magnets. For now, the only way to consider all these effects is to use numerical methods which allow to simulate the CSR wakefield or CSR impedance for a given beam-line and vacuum chamber geometry.

The CSRZ code, by Demin Zhou, is a FORTRAN 90 code which allows to compute the CSR 5.2. ThomX CSR model using CSRZ impedance of a beam by numerical integration of Maxwell's equations in the paraxial approximation [86] [37]. The code considers a beam pipe of constant rectangular cross section with a curvature defined by an arbitrary function of the longitudinal coordinate s, see Fig. 5.4. Its brings the possibility to simulate CSR with the real disposition of the dipole magnets in a lattice. The code assumes a constant Gaussian bunch in every dimensions. After the geometry defined by the user, an infinite straight section can be added to integrate the CSR fields produced in bends and take into account additional transient effects. A ThomX storage ring dipole has been simulated using CSRZ, approximating ThomX vacuum chamber, Fig. 4.4, with a beam pipe of rectangular cross section with an horizontal dimension of a = 40 mm and a vertical one of h = 28 mm. In figure 5.5, the CSR impedance computed with CSRZ for a single bend in ThomX, Z CSRZ,1B , is compared to the CSR impedance computed using the parallel plate model Z P P . Both the analytic model and the numerical calculation agree on the frequency value for the CSR threshold, around 11 GHz. Compared to the very smooth impedance of the parallel plate model, the impedance computed using CSRZ shows oscillations corresponding to the resonances of the CSR fields within the rectangular vacuum chamber both in the real and in the imaginary part. The amplitude difference between the curves is due to the transient effects which increase the amplitude of the real part and decrease the one of the imaginary part. The wake potential W p,CSRZ,1B generated by the Z CSRZ,1B impedance spectrum for a Gaussian bunch of σ = 0.5 mm is shown in the left plot of Fig. 5.6. Compared to the wake potential of the parallel plate model W p,P P , right of Fig. 5.2, the amplitude of W p,CSRZ,1B is slightly more important due to the transient effects. The z < 0 zone is similar for the two wake potentials, which means that the tail-head interaction is not affected by the inner walls of the vacuum chamber in this case. The z > 0 zone is modified compared to the parallel plate case, with a longer wake trailing behind the bunch. This change is brought by the effect of the outer walls, bringing a head-tail interaction, and the resonances within the vacuum chamber.

The CSRZ simulation has also been performed for multiple bends in order to estimate the effect of the CSR field interference. Figure 5.7 shows the CSR impedance Z CSRZ,2B computed for two dipoles at the IP and the drift in between. The impedance for two dipoles Z CSRZ,2B is normalised (divided by 2) to allow comparison with Z CSRZ,1B . The interference between the CSR emitted in each bend produces additional oscillations on the real part and imaginary part of the impedance Z CSRZ,2B . The wake potential W p,CSRZ,2B generated by Z CSRZ,2B for a Gaussian bunch of σ = 0.5 mm is shown in the right plot of Fig. 5.6. The wake potential W p,CSRZ,2B is similar to 5.2. ThomX CSR model using CSRZ W p,CSRZ,1B on most of the length of the source bunch. Only the tail of the bunch feels a slightly more intense CSR wake potential due to the interference. However, the trail of the wake potential is enhanced by the interferences. For a Gaussian bunch at equilibrium, if considering only single bunch instabilities then the modification of the wake potential trail is of no consequence. But for ThomX dynamics, it can be important as the bunch is divided in small beamlets during the filamentation process, see section 6.4. The head beamlet can produce CSR fields which can be felt by the others. CSRZ simulations have also been done taking into account more bends, up to the 8 dipoles of ThomX storage ring and the respective drift between each of them. The effect shown in Fig. 5.7 with Z CSRZ,2B is amplified as more and more dipoles are added. For the full ring, the impedance spectrum is full of resonant peaks but keeps the same mean amplitude as Z CSRZ,1B . As this computation is very long, several weeks of calculation for the full ring, it is not possible to do it with a frequency step thin enough to resolve properly these peaks in the impedance spectrum. Because of that, the wake potential computed from the impedance spectrum using Eq. (3.25) shows non-physical effects (non zero wake potential before the source charge not due to the tail-head effect). As a consequence, only the impedances corresponding to a single dipole Z CSRZ,1B or with two Z CSRZ,2B or three dipoles (not shown here) are used in beam dynamics simulation. Like for the geometric impedance, a wake function is extracted from the results following the method described in section 4.3. More details on the implementation of the CSR in the tracking code CODAL are given in section 6.2.

Chapter 6

Beam dynamics in the transient microbunching regime

"No one believes the simulation results except the one who performed the calculation, and everyone believes the experimental results except the one who performed the experiment."

-Martin Greenwald, Massachusetts Institute of Technology

This chapter describes the beam dynamics in ThomX storage ring in the transient microbunching regime and ways to optimise the stored charge. The ThomX Compton source has been presented in chapter 2 with an introduction to the particular beam dynamics of ThomX in chapter 1. In chapter 4 and 5, the geometric and resistive wall (RW) wakefields and the coherent synchrotron radiation (CSR), presented qualitatively in chapter 3, have been studied and a model to describe these effects in ThomX storage ring has been established. These different impedance models are now used in this chapter to study the beam dynamics in ThomX.

This chapter starts with an introduction of the microbunching instability in section 6.1, then the simulation code, CODAL, used to study the beam dynamics is presented in section 6.2. The beam dynamics in the transfer line (TL) is studied in section 6.3. Then the beam dynamics in the transient microbunching regime in the storage ring is presented at low charge in section 6.4 and at medium to high charge in section 6.5. Finally the simulation results are discussed in section 6.6.

The microbunching instability

The microbunching instability (MBI), also called CSR instability, can be defined as the emergence of density modulations within an electron bunch leading to coherent synchrotron radiation (CSR) emission at wavelengths shorter than the bunch duration. The MBI is also sometimes called microwave instability, which is a generic name to indicate an instability generated by a high frequency impedance of variable nature (RW, CSR, geometric, combined, ...) [START_REF] Shaposhnikova | Signatures of microwave instability[END_REF]. The MBI have been studied for many years in storage rings [START_REF] Cai | Theory of microwave instability and coherent synchrotron radiation in electron storage rings[END_REF] [96] [START_REF] Stupakov | Microbunch instability theory and simulations[END_REF], but also in linac using magnetic compression chicanes [START_REF] Hüning | Observation of longitudinal phase space fragmentation at the TESLA test facility free-electron laser[END_REF] [START_REF] Huang | Microbunching instability due to bunch compression[END_REF] and now in energy recovery linac (ERL) [START_REF] Tsai | Linear microbunching analysis for recirculation machines[END_REF] [START_REF] Borland | Evaluation of the possibility of upgrading the advanced photon source to an energy recovery linac[END_REF]. In most cases, the microbunching instability is driven by the CSR but the instability can also be driven by longitudinal space charge and by geometric wakefields in linac [START_REF] Saldin | An analytical description of longitudinal phase space distortions in magnetic bunch compressors[END_REF] [START_REF] Saldin | Longitudinal space charge-driven microbunching instability in the TESLA test facility linac[END_REF]. In storage rings, there have been many observations of quasi-periodic burst of CSR in the THz range, which intensity scales approximately with the square of the number of electron in the bunch, corresponding to clear evidence of MBI [START_REF] Roussel | Microbunching instability in storage rings: link between phase-space structure and terahertz coherent synchrotron radiation radio-frequency spectra[END_REF] [40] [START_REF] Evain | Dynamique de sources sur accélérateur: contrôle de structures turbulentes dans les lasers à électrons libres et étude du rayonnement synchrotron cohérent induit par laser[END_REF].

The MBI mechanism is the following: an electron bunch which has a density modulation which characteristic length is much shorter than the shielding threshold of the beam pipe walls, see chapter 5, radiates coherently. The CSR radiated produces an energy modulation, which is then converted in additional density modulations due to the path length dependence on energy in dipoles. If the CSR emitted by the density modulation is such that it leads to a stronger modulation of the electron bunch then micro-structures will form in the bunch longitudinal density and THz radiation will be emitted. In addition to the microbunching, the MBI can also degrade the horizontal emittance if the energy modulations produced in dispersive regions are important enough, see section 3.1.3. The initial density modulation which triggers the MBI can be driven by different effects. Above a threshold current, the MBI can start from shot noise, random fluctuation in the longitudinal density. The MBI can also be seeded by an initial density modulation due to other effects such as the longitudinal space charge or the geometric wakefields.

In ThomX, the MBI is mostly seeded by the filamentation in the longitudinal phase space due to the longitudinal mismatch between the injected bunch and the storage ring, see chapter 1. A short, a few ps, mismatched bunch is injected into the ring and fills the RF bucket after about 1 µs leading to a much longer bunch with a higher energy spread. As this transient regime determines the beam properties for the dynamics that follows, where most of the X-ray production happens, and as there is no damping within the storage time, it is crucial to be able to control this transient regime.

The MBI threshold for a bunched beam considering the steady-state parallel plate model, Eq. 5.2, is given by [START_REF] Cai | Theory of microwave instability and coherent synchrotron radiation in electron storage rings[END_REF] [START_REF] Zhou | Coherent synchrotron radiation and microwave instability in electron storage rings[END_REF]:

N th = L 0 I A ce α c γσ 2 δ σ s 1/3 R 1/3 ξ th , (6.1)
where L 0 is the ring circumference, α 1 is the first order of the momentum compaction factor, σ δ is the relative energy spread, σ s is the rms bunch length, R is the dipole bending radius, γ is the relativistic Lorentz factor and I A is the Alfvén current defined by:

I A = 4π 0 m e c 3 e (6. 2
)
where 0 is the dielectric permittivity, m e is the electron mass, c is the velocity of light in vacuum and e is the elementary charge. The quantity ξ th in Eq. (6.1) is an empirical function given by [START_REF] Cai | Theory of microwave instability and coherent synchrotron radiation in electron storage rings[END_REF]:

ξ th = 0.5 + 0.34χ (6.3)
where χ is the shielding parameter depending on h the vertical distance between the conducting plates in the steady-state parallel plate model:

χ = σ s R h 3 (6.4)
Using Eq. ( 6.1) to compute the MBI charge threshold for the nominal lattice of ThomX ring 6.1. The microbunching instability (α 1 = 0.0124) with the beam parameters at injection (about σ s = 2 mm = 6.6 ps and σ δ = 2 • 10 -3 ) gives Q th = 510 pC. This value has to be compared to the MBI charge threshold with the beam parameters after the transient regime (about σ s = 12 mm = 40 ps and σ δ = 8 • 10 -3 ) which gives Q th = 26 nC. These very different figures confirm that the beam dynamics will be very different during and after the transient regime. These values must be put into perspective as Eq. (6.1) is relevant for a MBI starting without an outside seeding effect and that bunches are considered near their Haïssinski equilibrium distributions [START_REF] Cai | Theory of microwave instability and coherent synchrotron radiation in electron storage rings[END_REF]. As stated before, in ThomX the effect is seeded by filamentation and as the microbunching regime considered is transient, the bunches are far from their Haïssinski equilibrium distributions [START_REF] Haissinski | Exact longitudinal equilibrium distribution of stored electrons in the presence of self-fields[END_REF]. For these reasons, to study the dynamics, simulations including non linear dynamics and collective effects are necessary.

In the following sections, the transient microbunching regime at injection in ThomX is studied using macroparticle simulations. The geometric and CSR impedance models presented in chapter 4 and 5 are used as an input to these simulations. The quantity Re[Z]|ρ| is related to the total energy loss of a bunch of spectrum ρ due to the impedance Z, Eq. (3.28). This quantity is shown for both impedance models for a short bunch, σ s = 2 mm = 6.6 ps, and for a longer bunch, σ s = 6 mm = 20 ps, in Fig. 6.1. At injection, corresponding to the short bunch case, the beam dynamics is dominated by the effect of the CSR whereas after the transient regime, corresponding to the long bunch case, the effect of the CSR is small compared to the geometric and resistive wall (RW) wakefields.

Upgrade of CODAL tracking code

The beam dynamics simulations presented in this chapter are realised using an upgraded version of the CODAL Matlab program. CODAL is a 6D (full phase space) symplectic tracking code made by Alexandre Loulergue from SOLEIL. This tracking code is based on the direct integration of the local Hamiltonian of every element of the lattice, either the exact Hamiltonian (drift spaces, dipoles) or an approximation of the Hamiltonian (quadrupoles, sextupoles) [START_REF] Nadolski | Application of the frequency map analysis to the study of the beam dynamics of light sources[END_REF]. CODAL includes several modules to deal with collective effects, among others: CSR using the parallel plate model, resistive wall (RW) wakefields, geometric impedance using the resonator model and 3D space charge (SC). CODAL has been benchmarked and used in multiple studies [START_REF] André | Control of laser plasma accelerated electrons for light sources[END_REF] [107] [START_REF] Loulergue | Compact ring for the ThomX-ray source[END_REF].

There are several reasons why I choose to use this code and make my own version of it to study the beam dynamics in ThomX. The most fundamental one is linked to one of the particularities of ThomX ring. The ThomX has both a small circumference, L 0 = 18 m, and a small dipole bending radius, ρ = 0.352 m. The very small dipole bending radius leads to strong non-linear effects due to the second order dipole fringe field in particle tracking [START_REF] Zhang | Dipole fringe field effects in the thomx ring[END_REF]. Such difficulties are not seen in most accelerators as the bending radius is usually much bigger, so a careful analysis of the tracking routine has to be done before using a code designed for another accelerator to study ThomX beam dynamics. The CODAL tracking code has been checked when Alexandre Loulergue used it to study the dynamics for ThomX Technical Design Report [START_REF] Variola | ThomX technical design report[END_REF] and correctly takes into account the non-linear effects induced by the short bending radius of ThomX dipoles. Aside from this, the CODAL code is well adapted to simulate the beam dynamics of a single bunch in both the transfer line and in the storage ring which makes it easier to do start to end simulations. Finally, from its modular structure, CODAL is very easy to modify to implement new features or collective effect modules.

The beam dynamics simulations presented in this chapter are "start to end" simulations. Meaning that the same 6D phase space is tracked from the photoinjector to the storage ring using different software. The generation of the 6D phase space and the tracking in the photoinjector and linac are done with the ASTRA code [START_REF] Flöttmann | ASTRA particle tracking code[END_REF], which is particularly adapted to simulate photoinjector. Then the tracking in the transfer line (TL) and in the ring are done using CODAL. As many parameters are investigated with the simulations, the bunch exiting the linac, output of ASTRA, has often very different Twiss function from one parameter set to another (especially when the bunch charge is changed). So a matching routine (least square method) which takes the Twiss parameters of the output bunch from the linac as input has been designed. It changes the TL optics to insure proper matching to the ring Twiss parameter at the end of TL.

The tracking in the TL includes the CSR, using the parallel plate model, see section 5.1, and the 3D space charge, both of which were already implemented in CODAL. The 3D space charge is based on the Poisson3D solver for Matlab [110], which solves the Poisson equation in a 3D cubic space. The space is divided in a 3D grid where the electric field generated by the bunch is computed, then a kick is applied to each particle corresponding to the electric field at its position. The 3D space charge routine of CODAL has been benchmarked with good agreement against ASTRA for a drift space with a converging bunch of 50 MeV for different charge (from 500 pC up to 4 nC). Figure 6.2 shows the benchmark results for 1 nC. There is no geometric wakefields for the tracking 6.2. Upgrade of CODAL tracking code in the TL as, for now, there is no impedance model for the TL. In CODAL, most of the collective effects (all but the 3D space charge) are obtained using the longitudinal charge density ρ. The longitudinal charge density ρ is the projection of the phase space on the longitudinal direction. It is computed by meshing the longitudinal direction on a grid with N bin bins. If the beam longitudinal distribution has an rms standard deviation σ s , then the grid extension is determined by the parameter N rms which corresponds to the number σ s that the grid covers on each side of the distribution mean. Such as the grid extends from -N rms σ s to +N rms σ s with the mean of the longitudinal distribution centred on 0. A slight smoothing is done on the longitudinal charge density ρ to remove some of the noise coming from the finite amount of macro-particles used in the tracking. The smoothing corresponds to a moving-average filter, which slides a window along the data and computes the average of the data contained in each window, and is controlled by window size N wind . This filtering is needed in order not to seed the microbunching instability from numerical noise but adds an arbitrary parameter set by the user. The influence of N wind can be observed in Fig. 6.3, for N wind = 20, the data is over-smoothed and the longitudinal profile is not representative of the longitudinal phase space. For N wind = 2, the longitudinal profile is noisy and will certainly induce additional microbunching. For N wind = 5, the longitudinal profile is smooth enough but still representative of the longitudinal phase space. Also, in this chapter, the CODAL convention is used and the bunch head corresponds to positive s while the bunch tail corresponds to negative s. New modules have been added to CODAL in order to be able to compute wake potentials directly from a wake function given as an external input, following the approach presented in section 4.3. The implementation is slightly different for the geometric and resistive wall wakefield model presented in chapter 4 and for the coherent synchrotron radiation (CSR) model presented in chapter 5.

For the geometric and resistive wall wakefields, ThomX storage ring has been divided in six sectors where the wake potential computation takes place, the position of the sectors is shown in Fig. 6.4. To each sector, a wake function, corresponding to the sum of all the pseudo wake functions of the elements in the sector, has been attributed. When the beam dynamics simulation reaches the middle of a given sector, the longitudinal bunch profile ρ is computed and convoluted numerically with the sector wake function to give the wake potential applied to the bunch at this point. The ring is split in six parts to take into account the fact that the effect of the wakefields on the beam dynamics is different in the straight sections, sectors C and D, and in the arcs, sectors A, B, E and F, due to the difference in the dispersion function η x . Figure 4.37 shows the wake potential obtained using this method, for the sum of all sectors, for Gaussian longitudinal distributions.

For the CSR, the dipole elements are split in the code (usually in sections of 5 cm or shorter) to consider the fact that the radiation is continuously emitted during the bent trajectory. At each step within a dipole, the longitudinal bunch profile ρ is computed and convoluted numerically with the CSR wake function for the total ring divided by the number of dipole elements. This division is especially important at high charge, when the CSR effect on the energy spread is important, to correctly take into account the CSR effect on the transverse dynamics. The CSR model used for the simulation presented in this chapter for the CSR in the storage ring corresponds to 8 × Z CSRZ,1B , see Fig. 5.5, the value 8 corresponding to the number of dipoles in the storage ring. In ThomX, the longitudinal feedback is done by adjusting the RF cavity phase Φ RF to damp longitudinal oscillations. Only dipole oscillations, corresponding to oscillation of the mean of the longitudinal distribution, can be damped using this feedback. A simple model of longitudinal feedback has also been implemented in CODAL to estimate this effect. In this simple model, the RF cavity phase Φ RF is given by:

Φ RF = π 2 + Φ s + G F B s mean 2πf RF c , (6.5)
where Φ s ≈ 0 is the synchronous phase, G F B is the feedback gain, s mean is the mean of the longitudinal distribution computed a turn before, f RF is the RF frequency and c is the velocity of light. The feedback gain G F B is a parameter set by the user corresponding to the feedback strength. There is also a transverse feedback in ThomX but it is not implemented in CODAL for now.

Simulations of the microbunching instability are, by nature, very sensible to numerical noise. The only way to be less sensible to this noise is to increase the statistic, to increase the number of macro-particles N p used to run the simulations. For this reason, all the simulations shown in this chapter are done with N p = 10 6 macro-particles. But increasing N p can be very costly computationally speaking, not only because of the collective effects but also due to the element by element tracking, especially for the simulation in a ring where thousands of pass are needed. In order to be able to run simulation with a high number of macro-particles within a reasonable time, a parallel version of CODAL has been designed, making use of the built-in parallel computing tools provided by Matlab.

The process used for the parallel computing of the collective effects is described in Fig. 6.5. The phasespace data is split equally among the N cores of the computer and the tracking happens on each dataset independently. When collective effects need to be computed, the core 1 computes the longitudinal grid with its phase space data following the same rules than in the single core 6.3. Beam dynamics in the transfer line approach. The core 1 then sends the longitudinal grid to the other cores and all the cores compute the longitudinal charge density ρ local associated with its dataset. Then all the ρ local are gathered to compute the global longitudinal charge density ρ which is used to compute the wake potential by core 1. Then the core 1 sends the wake potential to the other cores and the wake potential is applied by each core on its dataset. At the end of each turn in the ring, the dataset are gathered to compute global values like the rms beam size, the emittance, ... The only difference compared to the single core approach is that the longitudinal grid is computed only from 1 N of the total dataset, which has no impact on the beam dynamics simulated. There is an execution time gain, compared to the single core program, if the data splitting/gathering at each turn (and transmission/reception during collective effect) takes less time than the tracking time in the single core program. On a desktop computer with 16 cores, with N p = 10 6 macroparticles, a factor 10 to 12 on the running time is gained.

Unfortunately, this parallel approach can only be used with the CSR and the geometric/RW wakefields and not with the 3D space charge. Not only because the transmission between each core of a 3D grid would be much more complicated and computationally expensive. But also because the space charge needs to be computed a each step of the tracking compared to the CSR which is only computed in dipoles and the geometric/RW wakefields which are computed at fixed points. It would considerably slow down the simulation as it would require transmission/reception between cores at each step.

So, unless explicitly stated, the space charge effect is neglected in the storage ring simulations. The effect of the longitudinal space charge can be important as it can produce initial density modulations which can seed the MBI. But in ThomX case, the space charge effect is mostly important for the transverse dynamics as the longitudinal dynamics is totally dominated by the CSR in the transient regime. The longitudinal space charge acts as a perturbation on the longitudinal dynamics dominated by the CSR during the transient regime. By neglecting the longitudinal space charge, the effect of the CSR is also slightly overestimated as the longitudinal space charge acts as an additional diffusion process and tends to smooth high amplitude density modulations.

Beam dynamics in the transfer line

In this section, the beam dynamics and the impact of collective effect in the transfer line (TL) is presented. The photoinjector, the linac and the TL are presented in section 2.1 and the optic functions of the TL are shown in Fig. 2.3. The simulations in the TL presented in this section rely on simulations of the beam dynamics in the photoinjector and in the linac done by Harsh Purwar and Christelle Bruni using ASTRA [START_REF] Flöttmann | ASTRA particle tracking code[END_REF].

The ASTRA simulation results are summed up in Table 6.1 where several beam parameters are presented for different values of the charge extracted from the photo-cathode Q 0 and for different values of the laser pulse length σ Laser . From this table, the impact of the extracted charge Q 0 on the emittance is very clear as x,y ≈ 1 mm.mrad at Q 0 = 100 pC which increases to x,y ≈ 5 mm.mrad at Q 0 = 1 nC. This increase is mostly due to the space charge forces which are very important at 5 MeV in the photoinjector and in the linac where the beam energy is brought to Chapter 6. Beam dynamics in the transient microbunching regime [START_REF] Venturini | Models of longitudinal space-charge impedance for microbunching instability[END_REF] MeV. The effect of the space charge is also visible on the rms bunch length σ s which increases with Q 0 . The laser pulse length σ Laser impacts σ s but also the relative energy spread σ δ . The relative energy spread σ δ increases with σ Laser due to the fact that the extracted electrons are divided along a broader length of the RF wave as σ Laser goes up. Thus they have different energies and the bunch energy spread increases. Table 6.1: Beam parameters at the exit of the linac for different charge Q 0 at the cathode and for different laser pulse length σ Laser (rms). x and y are respectively the horizontal and the vertical normalised emittance, σ s is the bunch length and σ δ is the relative energy spread. Results from ASTRA simulation [START_REF] Flöttmann | ASTRA particle tracking code[END_REF], from the photo-cathode to the linac, done by Harsh Purwar and Christelle Bruni. The 6D phase space obtained from the ASTRA simulations are used as an input for the tracking in the TL using CODAL. The aim of this parametric study is to optimise the beam parameters to reduce the collective effect strength at injection and maximise the remaining charge after the transient microbunching regime. As the transient regime is dominated by CSR, the main lever is to reduce the bunch coherence which corresponds, in first approximation (but it is not enough), to increase the rms bunch length σ s at the end of the TL. For this purpose, increasing the laser pulse length σ Laser helps in two ways. As seen in Table 6.1, σ s at the linac exit is increased due to the longer bunches generated at the cathode. And due to the increase of relative energy spread σ δ with σ Laser , σ s also increases further with σ Laser in the TL due to the dispersion η x . The simulation results at the end of the TL, so at injection into the ring, are shown in Table 6.2. For σ Laser = 2 ps, at the end of the TL, σ s is increased from about 3 ps to about 7 ps. For σ Laser = 4 ps and σ Laser = 6 ps, σ s increases up to 12 ps and 16 ps respectively. The relative energy deviation δ distribution is very peaked at the linac exit. This δ distribution asymmetry brings an "artificial" lengthening of the rms bunch length σ s due to the dispersion η x . The core of the bunch keeps roughly the same size but the long tails produced increase the rms bunch length σ s .

Q 0 Q 0 Q 0 = 100 pC Q 0 Q 0 Q 0 = 500 pC Q 0 Q 0 Q 0 =
From Table 6.2, it is clear that there is also an important impact of the extracted charge Q 0 on the transverse emittance, especially on the horizontal emittance x . To better understand where the emittance increase comes from, the case Q 0 = 1 nC and σ Laser = 4 ps is studied in detail in Fig. 6.6 and in Fig. 6.7. Figure 6.6 shows the evolution of the transverse normalised emittance x,y in the TL with the space charge (SC) and the coherent synchrotron radiation (CSR) switched on and 6.3. Beam dynamics in the transfer line Table 6.2: Beam parameters at the injection into the ring for different initial charge at the cathode Q 0 and for different laser pulse length σ Laser (rms). x and y are respectively the horizontal and the vertical normalised emittance, σ s is the bunch length, σ δ is the relative energy spread and Q is the remaining charge at injection. Results from CODAL simulation from the linac to the storage ring. Overall the effect of space charge is small in the TL. The CSR brings a very important increase of the horizontal emittance x in dipoles, especially in the second dipole doublet between s = 6.9 m and s = 7.7 m. The horizontal emittance x increase due to CSR can be explained using the concept of slice emittance introduced in section 3.1.3. Figure 6.7 shows different plots at the exit of the linac, plots (a), (b) and (c), and at the end of the TL, plots (d), (e) and (f). Plots (a) and (d) show horizontal position x versus the longitudinal position s with the macroparticle density in colour scale. At the linac exit, plot (a), the bunch horizontal distribution is not correlated with the longitudinal position. The CSR has induced a position dependant energy spread along the bunch in the dipoles which translates into an position dependant horizontal translation due to the dispersion η x . This effect can be seen even after the dispersive section, at the TL exit in plot (d), where the dispersion η x = 0. The horizontal phase space is shown at both location in plots (b), (c), (e) and (f). The plots (c) and (f) show different longitudinal slices of the bunch in different colours. From plot (d), some of the CSR induced horizontal emittance x growth can be attributed to the increase of the projected emittance due to the slice emittance translation. The plot (f) shows that the different bunch slices also have different betatron motions due to the position dependant energy spread induced by the CSR. The horizontal phase space shown in plot (e), where the bunch has some attached lobes, results from different bunch slices which are translated and rotated differently in the phase space which lead to an increase of the projected horizontal emittance. There is also a slight increase of the slice emittance of the tail slices (the orange and the blue ones) which Chapter 6. Beam dynamics in the transient microbunching regime also contribute to the global emittance increase. There is special optics schemes which allow to minimise the projected emittance increase due to CSR in transfer lines and rings [START_REF] Tsai | Linear microbunching analysis for recirculation machines[END_REF] [111] [START_REF] Huang | Suppression of the emittance growth induced by coherent synchrotron radiation in triple-bend achromats[END_REF].

Q 0 Q 0 Q 0 = 100 pC Q 0 Q 0 Q 0 = 500 pC Q 0 Q 0 Q 0 =
The longitudinal phase space at injection of the bunches corresponding to all the cases covered in Table 6.2 are shown in Fig. 6.8 for Q 0 = 1 nC, in Fig. 6.9 for Q 0 = 500 pC and in Fig. 6.10 Q 0 = 100 pC. The injected bunches are not Gaussian at all, they have a tilted "banana" shape with long tails. The corresponding longitudinal and energy deviation distributions are quite peaked around the maximum density with long tails. The tails increase with the laser pulse length σ Laser . The impact of the CSR wake is visible on cases corresponding to Q 0 = 1 nC and Q 0 = 500 pC, especially for σ Laser = 2 ps. The CSR wake distorts the "banana" by pushing down the coherent electrons in the phase space, giving them a negative relative energy deviation. The reference energy and the reference longitudinal position are set to have the mean of both distributions at zero. It allows to keep more of the tails during the microbunching transient regime.

Transient microbunching regime at low charge

In this section, the transient microbunching regime is described for a low initial charge (Q 0 = 100 pC). In the low charge case, the collective effects are impacting the beam dynamics but are not strong enough to lead to strong beam losses. The injected longitudinal phase space corresponds to the ones of Fig. 6.10, in particular the plots shown in this section are for the case of a laser pulse length σ Laser = 4 ps.

Due to the synchrotron motion, the injected bunch rotates in the longitudinal phase space with a speed given by the synchrotron frequency Ω s , Eq. (1.3). This rotation leads to a constant exchange between the features of the longitudinal position s distribution and the features of the relative energy deviation δ distribution. The synchrotron angular frequency for ThomX nominal lattice and an RF voltage V RF = 300 kV is Ω s = 1.98 • 10 6 rad s -1 which corresponds to a full rotation in the longitudinal phase space in T s ≈ 53T 0 ≈ 3.18 µs where T 0 ≈ 60 ns is the ring revolution period.

For the bunch corresponding to the case Q 0 = 100 pC and σ Laser = 4 ps, the rms values of the bunch duration and energy spread are σ s = 13 ps and σ δ = 4.6 • 10 -3 . Using the matching condition, Eq. (1.6), the rms energy spread for a matched beam of σ s = 13 ps would be σ δ,M atched = 2.1 • 10 -3 . As the injected bunch is not matched longitudinally with respect to the lattice RF bucket, the bunch starts filamenting in the longitudinal phase space leading to a longitudinal emittance dilution, see chapter 1.

The evolution of the longitudinal phase space for the case Q 0 = 100 pC and σ Laser = 4 ps is shown in Fig. 6.11. After 10 turns, the effect of the filamentation is already visible as the bunch tails are beginning to bend. The effect of the CSR is also visible on the beam core, the most coherent part of the bunch, which is pushed toward the negative δ due to the CSR wake. At the turn 20, the core has began to separate from the rest of the beam and forms a micro-structure, very compact longitudinally, which oscillates in the phase space. Also, at this position in the phase space, one of the bunch tails begins to form a second coherent peak in the longitudinal distribution. At the turn 50, the smaller tail has began to make a loop on itself due to the combined effect of the CSR and of the filamentation. The tails do not have a high coherence, but as they sometimes have the same longitudinal position as the core, they are deformed by the strong CSR emitted by the core. After 75 turns, the core and the longer tail both have wiggle-like deformations in their structures due to the CSR.

The time evolution of the electron bunch longitudinal density is shown in Fig. 6.12 for the first 100 turns. This type of plot will be available during operation by using a streak camera. On this plot, the splitting of the injected bunch, and the start of the microbunching, around the turn 10 is clearly visible. Then multiple microchunches, which are generated due to the combined effect of the CSR and of the filamentation, are doing synchrotron oscillations independently from each others. Twice per synchrotron period, the bunch is vertically aligned in the longitudinal phase space, as around turn 50 and 75 of Fig. 6.12. When this happens, the bunch has an increased longitudinal coherence and the CSR is stronger which leads to additional density modulations, i.e. microbunching, in the next half synchrotron period. The longitudinal feedback is only able to correct dipole oscillations, so stabilise the mean longitudinal position. But it can not correct the The time evolution of the CSR (top) and geometric (bottom) wakes are shown in Fig. 6.14 for the first 100 turns. As the injected bunch has an important coherent part and afterwards there are microbunches, the CSR wake amplitude, W CSR,max ≈ 0.02 MV, is about 10 times more important than the one of the geometric wake, W geom,max ≈ 1 • 10 -3 MV, and dominates the beam dynamics. The CSR is maximum when the bunch is at its maximum of coherence, around turn 20 and 50, when the bunch is vertically aligned in the longitudinal phase space.

After the first 100 turns, the bunch phase space begins to split in several microbunches which are doing synchrotron oscillations. The microbunching regime continues until the microbunches have filled the full RF bucket due to the filamentation. This process is illustrated in Fig. 6.14 where the phase space is shown at different times. The corresponding dynamics of each time is shown in the different streak plot of Fig. 6.15 where the evolution of the longitudinal distribution is visible. At turn 1000, many micro-structures are visible in the phase space. Contrary to the first turns, their synchrotron oscillations do not have the same frequency nor the same phase. After 2500 turns, the micro-structures seem to be less dense as each microbunch has begun to fill the phase space due to the filamentation. At turn 5000, most of the microbunch have been diluted in the phase space as the RF bucket begins to be filled. By turn 20 000, the transient microbunching regime has stopped as the RF bucket is nearly fully filled by the bunch and all the microbunch have been diluted by the filamentation process. 6.5. Transient microbunching regime at medium to high charge mismatch, then the bunch length increases as the RF bucket is filled by the filamentation. Then, the rms bunch length σ s reaches a stable value, σ s ≈ 40 ps once the RF bucket is filled. The energy spread σ δ has a similar behaviour to the bunch length σ s and reaches a stable value around σ δ ≈ 6.7 • 10 -3 . The transverse emittances increase a bit during the first 500 turns due to a slight mismatch, the transverse phase spaces are not fully Gaussian at injection. The horizontal emittance x also undergoes a slight increase during the transient regime due to the CSR, but its value stabilises around x ≈ 2.8 mm mrad. The vertical emittance y is mostly stable during the tracking, staying around y ≈ 2.3 mm mrad. During the transient regime simulation, the full charge injected, Q = 98 pC, is kept.

This simulation shows that the injected bunch undergoes a transient regime of microbunching, induced by the combined effect of the CSR and of the longitudinal mismatch. At low charge, this regime is well controlled and the resulting bunch has a much larger bunch length, energy spread but keeps its transverse emittance properties and its charge which are the most important beam properties for X-ray production via CBS. The bunch length and the energy spread can be reduced by increasing the RF voltage to obtain values closer to the ones of the Technical Design Report which ensure optimal X-ray production [START_REF] Variola | ThomX technical design report[END_REF].

Transient microbunching regime at medium to high charge

The transient microbunching regime has been presented in the previous section at low charge (Q 0 = 100 pC). When the charge increases, the collective effect amplitude increases proportionally. Thus, the beam dynamics can change when the charge is increased, in ThomX, a higher charge can lead to very fast beam losses due to the strong CSR. In the first part of this section, the mechanism leading to the beam losses at medium and high charge is explained in the case: Q 0 = 1 nC and σ Laser = 4 ps corresponding to the longitudinal phase space presented in Fig. 6.8. Then mitigations for the beam losses at high charge are discussed.

When the injected bunch has a high charge, the evolution of the longitudinal phase space is shown in Fig. 6.17. The injected bunch shape, visible in Fig. 6.8, is already slightly twisted by the CSR in the TL and has a charge Q = 992 pC at injection in the ring. After a single turn, the bunch core folds on itself due to the strong CSR, which reinforces the very peaked, and thus coherent, longitudinal distribution. At turn 3, the CSR produced by the coherent core has pushed most of the core toward the negative δ. Some particles are lost in the beam pipe walls due to their high negative δ induced by the CSR. The dispersion η x maximum value, located in the arcs, is η x,max = 0.878 m (ThomX nominal lattice). At this location, an electron with a relative energy deviation of δ = 0.02 has an horizontal offset due to the dispersion of x η ≈ 17.6 mm and can easily be lost on the beam pipe walls which are at 20 mm from the beam pipe center. After 10 turns, the bunch charge falls down to 641 pC as most of the core has been pushed in the beam pipe walls by the CSR. The remaining part of the core, which is near δ ≈ -0.02, is kept for a synchrotron period but is lost by turn 71. After 71 turns, only 430 pC out of the 992 pC injected remains, and most of the beam loss happens very fast, in about 10 T 0 = 0.6 µs.

Transient microbunching regime at medium to high charge

The evolution of the relative energy deviation δ distribution is shown for the first 100 turns in Fig. 6.18. From this plot, the CSR effect on the electron energy deviation is visible. Part of the beam undergoes relative energy deviation oscillations leading to the total loss of the electrons oscillating. A first part of the oscillating electrons is lost around turn 5 and the rest of them are lost around turn 65. This important beam loss due to CSR which pushes the coherent part of the bunch in the beam pipe walls in a few turns can be tackled in several ways. The obvious way would be to decrease the longitudinal coherence of the injected bunches. But as it is shown in the parametric study of the TL, section 6.3, even if the rms bunch length σ s can be increased by increasing the laser pulse length σ Laser . There is still a very coherent bunch core and most of the rms bunch length σ s increase is due to the lengthening of the beam tails which can be lost during the transient regime if they are too long.

Another mitigation possible would be to decrease the dispersion η x in the arcs to be able to increase the maximum energy deviation allowed. That way less electrons would be lost in the beam pipe walls during the first turns in the ring. This possible mitigation rises the problem of the stability of the far off-energy electron dynamics. A study of the dynamic aperture for ThomX, including multipole fields, misalignment and gradient errors have shown that the off momentum dynamic aperture at δ ± 1.5 % is at the vacuum pipe limits [START_REF] Chaikovska | Single particule & commissioning[END_REF]. So it is not desirable to go much further than the limit of 2 % in the maximum energy deviation allowed as part of the beam would be lost on the walls due to the finite dynamic aperture otherwise.

A third possibility is to increase the synchrotron frequency ω s , the longitudinal phase space rotation speed, so that the particles do not feel the same CSR wake for too long. Thus preventing the CSR to push too much the coherent core toward the negative δ. The synchrotron frequency ω s , Eq. 1.3, can be increased by either increasing the RF cavity voltage V RF or by tweaking the ring lattice in order to increase the first order of the momentum compaction factor α 1 . The RF cavity voltage V RF can be increased from its nominal value V RF = 300 kV to the maximum voltage V RF = 500 kV. It allows to decrease the synchrotron period T s from T s = 3.18 µs ≈ 53 T 0 to T s = 2.46 µs ≈ 41 T 0 . To further decrease the synchrotron period T s , two alternative ring lattices have been designed and are shown in Fig. 6.19 for a forth of ThomX ring. Compared to the nominal lattice which has a quasi zero dispersion η x in the straight sections, from s = 0 to s = 2.1 m in the plot, the lattice A and B have a much more important dispersion η x . The lattice A and B also have slightly lower dispersion maximum in the arcs which will allow to increase a bit the maximum energy deviation allowed and should reduce the losses at injection. The results is that the integral of the dispersive function η x is enlarged in the dipoles which increases the momentum compaction factor. The different orders of the momentum compactor factor for the different lattices are presented in Table 6.3. The lattice A and B provide a more important first order of the momentum compactor factor α 1 while the higher orders α 2,3,4 are reduced compared to the nominal lattice. The first consequence is the further decrease of the synchrotron period T s to T s = 2.07 µs ≈ 35 T 0 for the lattice A and to T s = 1.91 µs ≈ 32 T 0 for the lattice B (for V RF = 500 kV). Another consequence is that the filamentation, which is caused by the non-linear terms of the momentum compaction factor, will be reduced in the lattice A and B compared to the nominal lattice. The RF bucket for the different lattices are shown in Fig. 6.20 for V RF = 300 kV in dotted lines and for V RF = 500 kV in plain lines. The energy acceptance of the RF bucket δ RF is also increased up to δ RF = 4% for lattice A and up to δ RF = 5.5% for lattice B. The effect of the RF voltage V RF on the RF bucket 6.5. Transient microbunching regime at medium to high charge Table 6.3: Different order of the momentum compactor factor α 1,2,3,4 and synchrotron period T s for the different lattices presented in Fig. 6.19. is the momentum independent term of the path length variation, see Eq. 1.5.

Nominal lattice Lattice A Lattice B 3.4 • 10 -9

1.7 To estimate the efficiency of this mitigation, multiple cases have been simulated for the different lattices. The results are summed up in Fig. 6.21, showing the final charge stored after 500 turns Q 500t for different initial charge extracted at the photocathode Q 0 . For the low charge cases, for Q 0 = 100 pC and Q 0 = 250 pC, the results are the same for all the lattices as nearly the full charge is kept after 500 turns. For Q 0 = 500 pC, in the case of the nominal lattice only 340 pC is conserved after 500 turns, whereas for lattice A and B nearly the full charge is still stored. At 123 Chapter 6. Beam dynamics in the transient microbunching regime high charge, for Q 0 = 750 pC and Q 0 = 1000 pC, the stored charge for the nominal lattice caps around 400 pC. The lattice A and B allow to keep a higher proportion of the initial charge, up to 840 pC for lattice B for Q 0 = 1000 pC. After the first hundred turns where some of the charge is lost on the beam pipe walls due to the CSR, the microbunches formed by the CSR oscillates and slowly fill the phase space via filamentation as in the low charge case. But contrary to low charge case, sometimes the microbunch synchrotron oscillation amplitude increases and provokes the loss of the microbunch. Such a case is shown in Fig. 6.22, where the evolution of the electron bunch density is shown, between the turn 6600 and the turn 7000, for the case of Q 0 = 1 nC bunch with the lattice B. The microbunch oscillates with a higher longitudinal amplitude, corresponding to a higher relative energy deviation amplitude, and is lost in a few synchrotron oscillations as its amplitude increases.

The combined effect of the CSR emitted by the different microbunch, which is much stronger than in the low charge case, and of the filamentation leads the microbunch to have higher and higher synchrotron oscillation amplitude. This effect induces important charge losses during the transient microbunching regime, see Fig. 6.23, which stops either when all the microbunches have been lost or when the remaining microbunches have been diluted by the filamentation. In addition to beam losses, the strong CSR also induces important horizontal emittance x growth during the first thousand turns. The horizontal emittance x growth is linked to the different slice emittance translations and rotations as explained in the TL case, see section 6.3. The effect is reinforced in lattice A and B compared to the nominal lattice due to the increased dispersion η x in the straight sections. Further studies are needed to better understand and to mitigate the microbunch losses during the transient regime at high charge. As stated before, simulations of the microbunching instability are difficult because of the sensibility to numerical noise. The smoothing is introduced for this reason and controlled with the parameter N wind . But it adds a parameter fixed more or less arbitrarily by the user, which adds an uncertainty on the simulation results. If N wind is increased, the effect of the CSR is decreased on the simulations, if N wind is decreased, the effect of the CSR is increased. In consequence, until a benchmark with the experiment is done, these simulations can not give quantitative predictions about the dynamics but provide a needed qualitative understanding of the beam dynamics in the transient microbunching regime.

Also, even if the CSR and the geometric/RW impedance are taken into account in these simulations, some other effects are impacting the beam dynamics and are not considered. As stated in the introduction, the IBS, Touschek effect and the Compton backscattering are affecting the beam dynamics in a long time scale compared to the transient regime and neglecting them seems justified in that case. The space charge is not included in the beam dynamics simulation in the storage ring but its impact is very low, at least for the first hundred of turns. Figure 6.24 shows the longitudinal phase space after 100 turns in the storage ring with and without the space charge. The two phase space are very similar, the longitudinal profile density in the case with space charge seems to have slightly less microstrutures compared to the one without space charge. The remaining charge with space charge is also a bit more important than without. This indicates that the space charge effect may be beneficial and helps to reduce the CSR amplitude and to store more charge due to the additional diffusion the space charge brings. On the full duration of the transient regime, this effect may be significant so the matter will be investigated in future studies. Another point which may be improved is the longitudinal feedback model, Eq. (6.5), which is 6.6. Discussion about the simulation results a bit too simplistic to fully reproduce the real longitudinal feedback behaviour. A more realistic model already used for beam dynamics simulation in ThomX may be better suited for future studies [START_REF] Drebot | Electron beam dynamics with and without compton back scattering[END_REF]. The influence of the longitudinal feedback on the transient regime has not been studied in detail in this thesis and it may be an important lever to increase the stored bunch charge and to reach the expected performances. In the same way, the transverse feedback has not been included in the simulations and should be a crucial tool to limit the transverse emittance growth, especially at high charge.

Overall, what is shown here, is that the beam dynamics expected in ThomX storage ring is very different from usual dynamics in electron synchrotrons. A transient microbunching regime is triggered by the combined effect of a longitudinal mismatch of the injected bunch and the strong coherent synchrotron radiation. This regime should be well controlled at low charge, where the post transient regime bunch has filled the RF bucket and the small transverse emittance is preserved. At higher charge, the transient regime seems to induce both beam losses and an increase of the horizontal emittance due to the strong coherent synchrotron radiation. Further studies, and many experiments when the machine commissioning starts, will be needed to better understand the beam dynamics in ThomX. In any case, keeping both a high charge and low transverse emittances to achieve the nominal X-ray production goal will be a challenge. But as I have started to show with this thesis work, by tweaking the optics and by using feedbacks, it is possible to optimise this regime.

Part II Ion cloud dynamics and mitigations in ThomX

In electron accelerators, residual gas can be ionised by several effects like collisions with the electron beam, synchrotron radiation or tunnel ionisation. The positive ions resulting from the ionisation can be trapped in the negative beam potential of the electron beam [START_REF] Poncet | Ion trapping and clearing[END_REF]. The ion cloud effect on the beam can de divided in two parts. First of all, the effect of the electric field produced by the ion cloud distribution. The focusing force produced by the ions changes nonlinearly with the distance of the electron from the center of the ion cloud. This can lead to tune shift, tune spread, halo increase and emittance blow-up [START_REF] Hoffstaetter | Equilibrium ion distribution in the presence of clearing electrodes and its influence on electron dynamics[END_REF]. Secondly, the ion cloud oscillates at high frequency within the electron beam potential. As the electron beam feels an attractive force toward the ion cloud, the electron beam also oscillates which brings a resonant excitation to both oscillations. Under certain conditions the oscillations can grow exponentially and lead to an instability like the conventional ion trapping instability (CIT) [START_REF] Sakanaka | Differences in the ion trapping between uniform and partial bunch fillings[END_REF] or the fast beam-ion instability (FBII) [START_REF] Raubenheimer | Fast beam-ion instability. i. linear theory and simulations[END_REF] [START_REF] Wang | Beam ion instability: measurement, analysis, and simulation[END_REF].

For these reasons it is crucial to decrease the number of ions causing these effects, techniques which allow to achieve this depend on accelerator type. The vacuum has to be as good as possible as the number of ions is directly proportional to beam degradation. But even a vacuum as good as a few 10 -10 mbar is enough to produce important effect on the beam. Clearing gaps are an effective mitigation, it corresponds to short period of time during which the ions do not feel the focusing force of the electron beam. During this time, the ions are free to drift away from the beam. This technique has been used successfully in many accelerator like SPEAR3, NSLS or KEK-PF to avoid multi-turn trapping or to fight against FBII [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF] [119] [START_REF] Sakanaka | Differences in the ion trapping between uniform and partial bunch fillings[END_REF]. The utilisation of clearing electrodes in electron ring as mitigation technique against ions is also well documented [START_REF] Poncet | Ion trapping, clearing, beam-ion interactions[END_REF] [START_REF] Hoffstaetter | Ion clearing in an ERL[END_REF]. Clearing electrodes produce a constant electric field which extract the ions from the beam potential well. In most cases, a DC voltage of 2 or 3 kV is applied and is enough to extract the ions from the beam potential well. Typically storage rings and pulsed linacs use clearing gaps [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF] whereas Energy Recovery Linacs (ERLs) and small rings use clearing electrodes [START_REF] Pöplau | Numerical studies of the behavior of ionized residual gas in an energy recovering linac[END_REF] [START_REF] Takada | Ion effects in a compact electron storage ring[END_REF]. Another technique which is also used is the beam shaking, also called RF knock-out [START_REF] Bozoki | On the shaking of ions in electron storage rings[END_REF] [START_REF] Lee | Suppression of the transverse oscillation in the SRRC storage ring by RF knockout method[END_REF]. A kicker is used to shake the beam at the ion oscillation frequency which drives a beam-ion coupling resonance which will push the ions out of the beam center.

To design effective mitigation strategies against ions, it is crucial to understand the ion dynamics and all the elements which can affect the ions behaviour inside the accelerator. Foremost ion dynamics are influenced by the magnetic fields produced by magnets along the machine. Ions can be trapped by dipoles, under certain conditions, because of the magnetic mirror effect [START_REF] Miyahara | Dynamical analysis on the longitudinal motion of trapped ions in an electron storage ring[END_REF]. A clearing gap duration and frequency should be chosen suitably for the ions to be able to escape magnetic trapping. Also, the beam-ion interaction has been shown to be a 3D effect and its longitudinal component leads to ion accumulation points in the accelerator [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF] [START_REF] Hoffstaetter | Equilibrium ion distribution in the presence of clearing electrodes and its influence on electron dynamics[END_REF]. As a consequence, before positioning clearing electrode, a study of the accumulation points of the ions should be done in order to maximise clearing efficiency.

Historically, ion effects in electron accelerators have been first highlighted in ACO (Anneau de Collision d'Orsay) electron storage ring in 1963 at LAL [START_REF] Jolivot | Anneaux de stockage. le piegeage des ions dans ACO et leur balayage, Rapport technique 75-63/RJ-FB (Laboratoire de l'Accélérateur Linéaire (LAL)[END_REF]. Some years later, many electron rings would have troubles linked with ion trapping like DORIS at DESY [START_REF] Kohaupt | Mechanismus der ionenabsaugung im elektron-positron speicherring DORIS[END_REF], the ADONE ring at Frascatti [START_REF] Biagini | Observation of ion trapping at adone[END_REF] or the EPA (Electron Positron Accumulator) at CERN [START_REF] Poncet | Trapping of ions in the EPA electron beam: stability conditions and diagnosis[END_REF]. Later on, with the advent of storage ring based light sources, the impact of ions was such that some machines, like ACO and PF at KEK, had to switch to positron beams in order to avoid ion trapping [START_REF] Kobayakawa | Status of the photon factory storage ring[END_REF]. In some second generation synchrotron light sources, the commissioning of the storage ring was made very complicated due to ions. For example, in 1985, the Aladdin storage ring could only store 1.5 mA until clearing electrodes were installed to deal with ions [START_REF] Rowe | Synchrotron light source experiments: bringing aladdin on line[END_REF].

In modern storage rings, like 3rd generation light sources, ion trapping have become less of an issue due to the improved vacuum and the lower beam emittance. Another issue which rises at that time was the fast beam-ion instability (FBII) which was predicted by Raubenheimer and Zimmermann in 1995 [START_REF] Raubenheimer | Fast beam-ion instability. i. linear theory and simulations[END_REF] [START_REF] Stupakov | Fast beam-ion instability. II. effect of ion decoherence[END_REF]. Contrary to the conventional ion trapping instability (CIT) which happens when the ion cloud is trapped in the electron beam potential for many turns, the FBII can happen during a single passage of an electron beam and does not need for the generated ions to be trapped. The FBII has been first observed at the Advanced Light Source (ALS) in 1997 [START_REF] Byrd | First observations of a "fast beam-ion instability[END_REF] and at the Pohang Light Source in 1998 [START_REF] Huang | Direct observation of the fast beam-ion instability[END_REF] with artificially increased vacuum pressure. It was later similarly observed in many light source facilities like SOLEIL [START_REF] Nagaoka | Beam instability observations and analysis at SOLEIL[END_REF] or SPEAR3 [START_REF] Wang | Beam ion instability: measurement, analysis, and simulation[END_REF] but is usually not an issue during normal operation.

In the future, ion effects could be an obstacle for different kind of projects. For diffraction limited storage ring (DLSR), 4th generation light sources, next to no ion trapping is expected due to the pico-meter emittances reached in these type of rings. The FBII is still a danger but not more than for 3rd generation light sources. During MAX IV commissioning, the first DLSR in operation [START_REF] Tavares | Future development plans for the MAX IV light source: pushing further towards higher brightness and coherence[END_REF], ion effects were only felt during a short time when the vacuum pressure was still ramping down. However ions could still be a concern for some booster rings for 4th generation light sources which need to deliver higher and higher charges.

Due to the drive pushing for high intensity and high repetition rate in linacs, the issue of ion trapping and FBII may become of importance. The study and simulations done in order to limit the FBII in the Compact Linear Collider (CLIC) gave the vacuum pressure specification for CLIC design [START_REF] Rumolo | Update on fast ion instability simulations for the CLIC main linac[END_REF]. The effect of ion trapping has been recently observed for the first time in a single pass linac at Cornell photoinjector for Cornell Energy Recovery Linac (ERL) [START_REF] Full | Detection and clearing of trapped ions in the high current cornell photoinjector[END_REF] [START_REF] Full | Ion effects in high brightness electron linac beams[END_REF]. In future high intensity ERLs, it could be especially difficult to get rid of ion trapping because the most effective mitigation, clearing gaps, is not easy to implement due to RF beam loading effects [START_REF] Hoffstaetter | Ion clearing in an ERL[END_REF]. This part of this thesis, part II, deals with the ion dynamics in ThomX using mitigation strategies. As an introduction, an historical picture of the matter of ion trapping in electron accelerators is given with some insight for future machines. In chapter 7, the various effects impacting the ion cloud dynamics are discussed. Starting from the interaction between an electron of a beam and an ion from residual vacuum, the model we use to describe the 3D beam-ion interaction is explained and its limitations are highlighted. The ion accumulation conditions from the longitudinal component of the beam-ion are discussed. The motion of ions in dipole magnets is presented and illustrated by simulations, the magnetic mirror effect and the condition to have an ion trapped in a dipole is explained. Then, in chapter 8, simulations of the longitudinal and transverse ion cloud dynamics in ThomX are presented. The simulation code NUAGE for ion cloud tracking is presented and the effect of mitigations on ion dynamics is illustrated by simulations. Finally, in chapter 9, the matter of the multi-ionisation and of the ion dissociation is tackled and the ion cloud effect on the electron bunch is discussed.

Most of the concepts which will be described in this part are directly applicable to most electron machines. However, the numerical examples and the simulations which will be discussed are applied in the case of ThomX storage ring (using the nominal lattice and the nominal beam parameters) presented in chapter 2. ThomX is an interesting study case for the ion cloud as potentially all the ions are trapped. Also this PhD. took stage between the end of ThomX design phase and the building phase so it was also possible to design the mitigation strategies which will be used during ThomX operation.

Chapter 7 Ion cloud dynamics: physics and theory

Residual ions can significantly degrade the performance of a machine and produce various beam instabilities. To be able to treat these problems more effectively it is important to understand the dynamics of these ions in the accelerator. In this chapter, the physics of the ion cloud dynamics will be detailed analytically. The main equations governing the ion dynamics are derived from the interaction between an ion and an electron of the beam in section 7.1. The physical consequences of these equations describing the beam-ion interaction are explained in section 7.2. But the ion motion can also be impacted by the different magnetic fields inside an accelerator. Thus, the impact of magnetic field on the ions is discussed in section 7.3.

From beam-beam interaction to ion longitudinal dynamics

In this section, I establish the dynamics of residual vacuum ions in a beam pipe with a circulating bunched electron beam. I detail the works of D. Sagan, M. Bassetti, G.A Erskine and R. Talmann which are of interest on the subject. Most of the developments presented here are not shown in the literature, they are presented with their approximations and limits. The ion transverse dynamics is usually well documented but the longitudinal one is often neglected. I will show that in most cases, it is of prior importance to take into account both the longitudinal and the transverse ion dynamics.

In 1991, David Sagan published "Some aspects of the longitudinal motion of ions in electron storage rings", an article dealing with the effect of an electron beam on residual vacuum ions in storage rings [START_REF] Sands | The physics of electron storage rings: an introduction[END_REF]. In this article, he applies the theory of the beam-beam interaction described by Talmann [START_REF] Talman | Beam-beam deflecting fields[END_REF] in the case of the interaction between an electron beam and residual ions from the vacuum. This theory is based on the so-called "strong-weak" model, where, in our case, the residual ions are considered as a beam of very low intensity which will not disturb the electron beam. In that case, it is possible to express analytically the effect of an electron bunch, supposed Gaussian, on an ion.

To do this, I start from the Coulombian interaction between an electron of the beam and an ion and I deduce the change of velocity that this ion will undergo for an infinitesimal duration. Then I sum up this effect on all the electrons of a supposedly Gaussian bunch in the transverse Chapter 7. Ion cloud dynamics: physics and theory dimensions and infinitely short in the longitudinal dimension. Talmann shows that these velocity kicks can be written in the form of a two-dimensional potential [START_REF] Talman | Beam-beam deflecting fields[END_REF]. This potential expression can be used to express the ion velocity kicks as a function of the complex error function w(z) using the method of Bassetti and Erskine [START_REF] Bassetti | Closed expression for the electrical field of a two-dimensional gaussian charge[END_REF]. This makes it possible to obtain the transverse dynamics of the ions in terms of the transverse velocity kicks. In his article Sagan establishes an equation expressing the ion longitudinal velocity kicks as a function of the transverse kicks [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF]. The expression of the transverse kick derivatives needed to use Sagan's equation is also given. All these calculations are detailed in the following subsections.

Obtaining ion velocity kicks as a function of a potential using the Talmann derivation

I consider a single electron of the beam e which interacts, via the Coulombian interaction, with a residual ion of the vacuum i as depicted in Fig. 7.1. In Fig. 7.1, the velocity kick felt by the ion due to the interaction with the electron is decomposed in a transverse kick, in the case of the drawing it is an horizontal kick δv x , and in a longitudinal one δv s . The interaction between the two can be expressed as:

δ v i δt = 1 Am p F ei = -e 2 4π 0 r ie 2 Am p u ei . (7.1)
Where F ei is force felt by the ion because of the electron, m p is the proton mass, A is the atomic mass number of the ion, e is the elementary charge, r ie is the distance between the ion and the electron, v i is the ion speed, 0 is the dielectric permittivity of the vacuum and u ei = r ei r ei . The index e is used to designate the quantities that apply to the electrons and the index i for the quantities that apply to the ions. 7.1. From beam-beam interaction to ion longitudinal dynamics From Eq. (7.1), I express the velocity kick felt by the ion when the electron is crossing. For this, only the transverse component of the force F ei is needed to be considered. Indeed, in first approximation, the longitudinal component of F ei can be neglected as the longitudinal part of the force before and after r min compensate each other as seen in Fig. 7.2. Considering the transverse component of the Coulomb force as in Eq. ( 7.2), the ion velocity kick can be obtained using the projections in Eq. (7.3): From now on, I consider the electron coordinates at the minimum approach distance from the ion, so that r ie = r min :

∆v i = - e 2 4π 0 Am p + π 2 -π 2 1 r min cos(θ) 2 cos(θ) rdθ v e cos(θ) = - e 2 4π 0 Am p + π 2 -π 2 1 v e r min cos θdθ , ( 7
∆ v i = -2e 2 4π 0 Am p | r ei | r ie 2 v e u ei = K r ei 2 r ie , (7.6)
where

K = 2e 2 4π 0 Ampve = 2rpc 2 veA , r p = e 2
4π 0 mpc 2 is the classical proton radius and r ie is the vector distance between the ion and the electron computed at the minimum approach distance.

The equation (7.6) gives ∆v i , the velocity kick undergone by an ion during the crossing of a single electron from the bunch in the vicinity of this ion. It is now assumed that the beam has Gaussian transverse distributions of standard deviation σ x for the horizontal axis and σ y for the vertical axis. The total change in velocity undergone by the ion during the beam crossing ∆ v is obtained by summing on the N electrons of the bunch:

∆ v = N √ 2πσ x √ 2πσ y +∞ -∞ ∆ v i e - x 2 e 2σx 2 +
y 2 e 2σy 2 dx e dy e .

(7.7)

Following variables are introduced:

(u, v) = (x i -x e , y i -y e ) , (x, y) = (x i , y i ) .

(7.8)

Using the equation (7.7) projected on the horizontal axis with the new notations:

∆v x = -N K 2πσ x σ y +∞ -∞ e - (x-u) 2 2σx 2 + (y-v) 2 2σy 2 u u 2 + v 2 dudv , = -N K 2πσ x σ y σ x 2 ∂ ∂x + x +∞ -∞ e - (x-u) 2 2σx 2 + (y-v) 2 2σy 2 1 u 2 + v 2 dudv . (7.9)
Indeed, the integration variable u is constant for a given point of the integral so I can derive under the integral sign by x:

σ x 2 ∂ ∂x e - (x-u) 2 2σx 2 + (y-v) 2 2σy 2 1 u 2 + v 2 = -σ x 2 x -u σ x 2 e - (x-u) 2 2σx 2 + (y-v) 2 2σy 2 1 u 2 + v 2 .
(7.10)

To eliminate the denominator I will now introduce an integration by a dummy variable t using the fact that:

1 u 2 + v 2 = +∞ 0 e -t[u 2 +v 2 ] dt .
(7.11) Using (7.9) and (7.11) we have now:

∆v x = -N K 2πσ x σ y σ x 2 ∂ ∂x + x +∞ -∞ +∞ 0 e - (x-u) 2 2σx 2 + (y-v) 2
2σy 2 +t(u 2 +v 2 ) dtdudv . (7.12)

7.1. From beam-beam interaction to ion longitudinal dynamics Then using the known integral (7.13), to integrate (7.12) according to u and v:

+∞ -∞ e -ax 2 -bx+c dx = π a e b 2
4a +c , (7.13)

∆v x = -N K 2πσ x σ y σ x 2 ∂ ∂x + x +∞ 0 +∞ -∞ e - (x-u) 2 2σx 2 +tu du +∞ -∞ e - (y-v) 2 2σx 2 +tv
dv dt , (7.14)

∆v x = -N K 2πσ x σ y σ x 2 ∂ ∂x + x +∞ 0 √ 2πσ x √ 1 + 2tσ x 2 e -x 2 1 t +2σx 2 √ 2πσ y 1 + 2tσ y 2 e -y 2 1 t +2σy 2
dt , (7.15)

∆v x = -N K σ x 2 ∂ ∂x + x +∞ 0 e - x 2 1 t +2σx 2 + y 2 1 t +2σy 2 √ 1 + 2tσ x 2 1 + 2tσ y 2 dt . (7.16)
Using the following change of variable t = 1 q within (7.16), then:

∆v x = -N K σ x 2 ∂ ∂x + x 0 +∞ e - x 2
q+2σx 2 + y 2 q+2σy 2 q + 2σ x 2 q + 2σ y 2
-dq q .

(7.17)

Using the identity (7.18) to simplify (7.17):

σ x 2 ∂ ∂x + x e -x 2 q+2σx 2 = - q 2 ∂ ∂x e -x 2 q+2σx 2 , (7.18
)

∆v x = N K 2 ∂ ∂x +∞ 0 e - x 2
q+2σx 2 + y 2 q+2σy 2 q + 2σ x 2 q + 2σ y 2 dq . (7.19)
It is possible to express ∆v x (and ∆v x by the same method) as a function of a potential Φ(x, y) :

∆v x = - ∂Φ ∂x (x, y) , (7.20
)

∆v y = - ∂Φ ∂y (x, y) , (7.21) Φ(x, y) = -N K 2 +∞ 0 e - x 2
q+2σx 2 + y 2 q+2σy 2 q + 2σ x 2 q + 2σ y 2 dq . (7.22)

Resolution of the potential equation by the method of Bassetti and Erskine

To simulate the beam-beam interaction, Bassetti and Erskine evaluate the electric field produced by a 2D Gaussian potential [START_REF] Bassetti | Closed expression for the electrical field of a two-dimensional gaussian charge[END_REF]. They deduce practical expressions of the electric field produced as a function of the complex error function w(z). The shape of our potential Φ(x, y), Eq. (7.22), is identical to that obtained by Bassetti and Erskine with a different value of the K parameter. The same method can therefore be used to express the velocity variations of the ions as a function of Chapter 7. Ion cloud dynamics: physics and theory the complex error function w(z) as did Talmann in [START_REF] Talman | Beam-beam deflecting fields[END_REF]. For this, I set:

t 2 = 2σ y 2 + q 2σ x 2 + q , (7.23) a = x 2(σ x 2 -σ y 2 ) , (7.24) b = y 2(σ x 2 -σ y 2 ) . (7.25)
Which gives us:

q = 2 (σ y 2 -t 2 σ x 2 ) t 2 -1 , (7.26) q + 2σ x 2 = 2 (σ y 2 -σ x 2 ) t 2 -1 , (7.27
)

q + 2σ y 2 = 2t 2 (σ y 2 -σ x 2 ) t 2 -1 , (7.28) q + 2σ x 2 q + 2σ y 2 = 2t (σ y 2 -σ x 2 ) t 2 -1 , (7.29) e - x 2 2σx 2 +q + y 2 2σy 2 +q = e +[a 2 (t 2 -1)+b 2 (1-1 t 2 )] , (7.30
) Then, Eq. (7.22) can be expressed as:

dq = -4(σ y 2 -σ x 2 )tdt (t 2 -1) 2 , ( 7
Φ(x, y) = N K 1 r e [a 2 (t 2 -1)+b 2 (1-1 t 2 )] t 2 -1 dt . (7.34)
From here, I will introduce complex numbers to solve the potential integral, Eq. (7.34), in the complex plane. Then, ∆v x and ∆v y , the transverse components of the ion velocity kick are expressed as:

∆v x -j∆v y = - ∂Φ ∂x + j ∂Φ ∂y = -1 ∆ ∂Φ ∂a -j ∂Φ ∂b , (7.35)
where ∆ = 2((σ x 2 -σ y 2 )). Then, by multiplying by j the equation (7.42), we obtain the expression of the ion transverse velocity kicks as the Bassetti-Erskine equation [START_REF] Bassetti | Closed expression for the electrical field of a two-dimensional gaussian charge[END_REF]:

∆v x -j∆v y = -2N K ∆ 1 r a - jb t 2 e [a 2 (t 2 -1)+b 2 (1-1 t 2 )] dt , = -2N K ∆ e -(a+jb)
w(z) = e -z 2 1 + 2j √ π z 0 e τ 2 dτ . ( 7
j∆v x + ∆v y = -N K √ π 2(σ x 2 -σ y 2 ) w x + jy 2(σ x 2 -σ y 2 ) -e -x 2 2σx 2 + y 2 2σy 2 w x σy σx + jy σx σy 2(σ x 2 -σ y 2
) .

(7.43) This formula gives the additional transverse velocity that an ion will gain when the electron bunch passes by the ion. This speed change depends on the longitudinal and transverse ion position. In particular, it depends on the variation of the beam transverse dimensions along the accelerator.

Contrary to most publications using the Bassetti-Erskine formula we get a minus sign in Eq. (7.43) since this expression is derived here in the case of two beams of opposite charge corresponding to the electron beam and the ion cloud. It is also important to note that, in the Bassetti-Erskine formula, the electric charge of the two beams does not appear clearly, it is hidden Chapter 7. Ion cloud dynamics: physics and theory

in K = 2rpc 2 veA = 2e 2
4π 0 Ampve . Where v e is the velocity of the electrons, e is the elementary charge, 0 is the permittivity of free space and m p is the mass of the proton. The value of the charge of the two beams in the parameter K should be adjusted to use this formula for multi-charged ions.

Derivation of Sagan equation for the ion longitudinal dynamics

Sagan uses Talmann results and expresses the variation in longitudinal velocity as a function of ion transverse dynamics and lattice parameters [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF]. It is possible to decompose the velocity variation of an ion δv due to the passage of a relativistic electron into its transverse and longitudinal parts. If (s e -s) << (x e -x), (y e -y), the electron trajectory is quasi-parallel to the axis s and therefore:

δv x = K x e -x (x e -x) 2 + (y e -y) 2 , δv y = K y e -y (x e -x) 2 + (y e -y) 2 . (7.44)
The longitudinal component δv s is obtained using the condition u e . δv = 0 with u e the direction vector of the electron beam. This condition corresponds to the minimum distance between the electron and the ion and makes it possible to obtain equation (7.46). sx e δv x + sy e δv y + sδv s = 0 , (7.45)

δv s = -x e δv x -y e δv y . (7.46)
Where x e is the angle between the beam and the x-axis and y e is the angle between the beam and the y-axis. It is then possible to obtain the total longitudinal velocity kick ∆v s felt by the ion due to the electron bunch by summing over all the electrons of the bunch:

∆v s = +∞ -∞ dx e +∞ -∞ dx e +∞ -∞ dy e +∞ -∞ dy e +∞ -∞
dδδv s ρ(x e , x e , y e , y e , δ) , (7.47) where δ = ∆E E 0 is the relative energy deviation from the electron nominal energy E 0 and ρ is the Gaussian density of the bunch given in the equation (7.48). Contrary to the case of transverse variations, it is now necessary to sum up the transverse positions of the electrons x e and y e but also on beam directions x e and y e and on electron relative energy deviation δ because δv s and ρ explicitly depend on these parameters. The Gaussian density ρ of the bunch, equation (7.48), can be derived using phase space transformations P x = α x x + β x x and P y = α y y + β y y . This transformation makes the phase space circular 7.1. From beam-beam interaction to ion longitudinal dynamics so there is σ x = σ x and σ y = σ y , then ρ can be written as:

ρ(x, p x , y, p y , δ) = N (2π) From equations (7.44) and (7.46) and using the variables u = x -x e and v = y -y e , I get:

∆v x = K +∞ -∞ du +∞ -∞ dv +∞ -∞ dx e +∞ -∞ dy e +∞ -∞
dδ -u u 2 + v 2 ρ(x -u, x e , y -v, y e , δ) , (7.51)

∆v y = K +∞ -∞ du +∞ -∞ dv +∞ -∞ dx e +∞ -∞ dy e +∞ -∞ dδ -v u 2 + v 2 ρ(x -u, x e , y -v, y e , δ) , (7.52) ∆v s = K +∞ -∞ du +∞ -∞ dv +∞ -∞ dx e +∞ -∞ dy e +∞ -∞
dδ ux e + vy e u 2 + v 2 ρ(x -u, x e , y -v, y e , δ) . (7.53)

To express ∆v s as a function of ∆v x and ∆v y , it is necessary to use the following equalities:

+∞ -∞ dδ +∞ -∞
dx e x e ρ(x e , x e , y e , y e , δ)

= x e σ x 2 [-α x x + (ησ δ )(η σ δ )] +∞ -∞ dδ +∞ -∞
dx e ρ(x e , x e , y e , y e , δ) ,

(7.54) +∞ -∞ dx e +∞ -∞ du +∞ -∞ dδ u u 2 + v 2 (x -u)ρ(x -u, x e , y -v, y e , δ) = -σ 2 x ∂ ∂x +∞ -∞ dx e +∞ -∞ du +∞ -∞ dδ u u 2 + v 2 ρ(x -u,

Calculation of the transverse kick derivatives

To obtain the longitudinal velocity kick ∆v s from Sagan equation, Eq. (7.56), the partial derivatives ∂∆vx ∂x and ∂∆vy ∂y are necessary. To compute them, I start from the transverse velocity kicks given by the Bassetti-Erskine formula, Eq. (7.43):

∆v x = -N K √ π 2(σ x 2 -σ y 2 ) Im w x + jy 2(σ x 2 -σ y 2 ) -e -x 2 2σx 2 + y 2 2σy 2 w x σy σx + jy σx σy 2(σ x 2 -σ y 2 ) , (7.57) ∆v y = -N K √ π 2(σ x 2 -σ y 2 ) Re w x + jy 2(σ x 2 -σ y 2 ) -e -x 2
∂∆v x ∂x (x, y) = -N K √ π σ x 2 -σ y 2 1 √ π -Im x + jy 2 (σ x 2 -σ y 2 ) w x + jy 2 (σ x 2 -σ y 2 ) + e -x 2
∂∆v y ∂y (x, y) = -N K √ π σ x 2 -σ y 2 - 1 √ π -Re j x + jy 2 (σ x 2 -σ y 2 ) w x + jy 2 (σ x 2 -σ y 2 ) + e -x 2 2σx 2 + y 2 2σy 2 1 π σ x σ y + σ x σ y Re j x σy σx + jy σx σy 2(σ x 2 -σ y 2 ) w x σy σx + jy σx σy 2(σ x 2 -σ y 2 ) + 2(σ x 2 -σ y 2 ) 2 y σ y 2 Re w
x σy σx + jy σx σy 2(σ x 2 -σ y 2 ) .

Numerical problems in the velocity kick evaluation

In the numerical assessment of the quantities ∆v x , ∆v y and ∆v s , problems may occur. First, in cases where the negative imaginary argument is large, meaning for large negative values of y, we observe a divergence of the calculation. This divergence is due to the behaviour of the complex error function w(z) which grows exponentially for negative imaginary values. The calculation of ∆v then requires differences of very large numbers that exceed the accuracy of a 64 bit computer. The problem can be solved by considering the symmetries of the problem, the functions ∆v x (x, y) (and ∆v y (x, y)) are odd in x (respectively y) and even in y (respectively in x). Likewise, the functions ∂∆vx ∂x (x, y) and ∂∆vy ∂y (x, y) are even in x and y. We can therefore calculate these functions in the domain x > 0 and y > 0 where there are no problem of divergence and deduce by symmetry their values in the full domain.

A second problem arises and is specific to the ThomX case. Unlike most accelerators, in ThomX there are sections where σ y > σ x , which invalidate one of the calculation assumption of ∆v x and ∆v y and prevent the evaluation of 2 (σ x 2 -σ y 2 ) in the same quantities. However, the proof is still valid if we make the hypothesis σ y < σ x but it is then necessary to invert all the indices x and y in the expressions of ∆v x , ∆v y , ∂∆vx ∂x and ∂∆vy ∂y . Finally for round beams, with σ x = σ y , there seems to be a singularity because of computation of 1 σx 2 -σy 2 . But this singularity is compensated by similar ones in the arguments of the complex error functions w(z) [START_REF] Ziemann | Beyond bassetti and erskine: beam-beam deflections for non-gaussian beams[END_REF]. The complex error function w(z) has an asymptotic expansion, lim |z|→∞ w(z) = j √ πz [START_REF] Lehtinen | Error functions[END_REF], which cancels out the singularities. Using this expansion one can get the expression for round beams:

Beam-ion interaction

In section 7.1, the expression of the transverse (Bassetti-Erskine) and longitudinal (Sagan) velocity kick felt by an ion have been derived starting from the interaction between a bunch electron and an ion from residual vacuum. These two formulas can be used in conjunction to describe the beam-ion interaction. In this section, the physical implications of this model of the beam-ion interaction will be detailed. The main principles of the ion clouds dynamics in electron accelerators will be derived: the ion trapping conditions, the oscillation frequencies, the transverse equilibrium distribution and the longitudinal accumulation points. These concepts are illustrated by applications to ThomX case and will be used to benchmark and understand the simulations made in chapter 8.

Transverse dynamics

The horizontal and vertical velocity kicks, ∆v x and ∆v y , felt by an ion when a bunch is passing by, are known analytically in the case where the electron bunches have a Gaussian profile. They are given by the Bassetti-Erskine formula, Eq. ( 7.43), [START_REF] Bassetti | Closed expression for the electrical field of a two-dimensional gaussian charge[END_REF].

Taking the real part or the imaginary part of Eq.( 7.43), we obtain the transverse components ∆v x and ∆v y . We note that the velocity change that the ion undergoes depends explicitly on its position, x and y, but also on the beam sizes σ x and σ y which lead to an implicit dependence on the ion longitudinal position s. In figure 7.3, ∆v x is plotted as a function of the horizontal position x for several values of the vertical position y. It can be seen that in the domain x > 0 that ∆v x < 0, and that in the domain x < 0 that ∆v x > 0. Therefore, at first order, the beam will tend to herd the ions towards the Chapter 7. Ion cloud dynamics: physics and theory center of the beam. This effect is very important when the ion considered is close to the beam, typically when x σ x and y σ y . The ions will then undergo very large transverse oscillations with speeds of the order of 100 m/s. The force that the ions feel is strongly non-linear when the ion is further away from the beam, x > σ x and y > σ y . It is maximum around x ≈ 1.5σ x and then decrease as the ion moves away from the beam.

In the region near the beam centerline, x 2 σ 2 x + y 2 σ 2 y ≤ 1, the transverse kicks are linear. An approximate linear expression applicable in this range can be found using:

w(x + jy) ≈ 1 - 2 √ π y + j 2 √ π
x + higher-order terms , (7.63) which gives for the horizontal or vertical plane:

∆v (x,y) ≈ -N K σ (x,y) (σ x + σ y ) (x, y) ≈ -2N r p c Aσ (x,y) (σ x + σ y ) (x, y) . (7.64)
The map of the vertical velocity kick ∆v y is plotted in Fig. 7.4 for ThomX storage ring as a function of the ion vertical position y and longitudinal position s. Positive velocities along the y axis are shown in red and negative velocities are in blue. It can be seen that the domain y > 0 is globally blue, corresponding to ∆v y < 0, and the part y < 0 is globally red, corresponding to ∆v y > 0. However, it is observed that ∆v y has a longitudinal structure with intensity minimums and maximums in the axis y = 0.

Beam-ion interaction

Note that these points are close to dipoles, the non-zero dispersion η in these ranges causes a consequent increase of σ x =

x β x + η 2 σ δ 2 ≈ 5 mm with respect to σ y = y β y ≈ 0.5 mm. At first order, the vertical velocity kicks are inversely proportional to σ y (σ x + σ y ), see Eq. (7.64), there are therefore zones where the focusing of the ions towards the center of the vacuum chamber is less intense. High intensity zones in s = 4.5 m and s = 13.5 m correspond to the "interaction points" (IPs), where β y (and β x ) is minimum, curve in blue on the bottom graph. As ∆v y varies like 1 σy , a minimum of σ y , therefore a minimum of β y , leads to maximums of ∆v y observed at IPs. The same phenomena is observed for ∆v x in Fig. The effect of a bunch on the transverse ion dynamics is thus globally focusing towards the beam center. In particular, there are zones of very strong transverse focusing of the ions at the interaction points (IP) because of the minimums of the beta functions β (x,y) and of the dispersion function η. The zones close to the dipole singlet, in opposition to the doublet of dipoles to at the IPs, at s = 2.2 m, s = 6.8 m, s = 11.2 m and s = 15.8 m are the zones where the ion transverse focusing will be minimal because the functions β (x,y) and η are maximum there.

Trapping mechanism and critical mass

At first order, the effect of a passing bunch of a beam on the ions is similar to the effect of a focusing lens. It is this focusing which allows the ions to be trapped, or not, by the beam and leads to ion accumulation. In the framework of the linear approximation of the beam-ion force, Eq.( 7.64), one can study the ion stability during the passage of multiples bunches using the matrix formalism [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF]. A given ion will feel successively the focusing forces produced by bunch passing by, followed by a drift time between bunches. If y and v y are the vertical position and vertical speed of the ion, the subscript 0 detonating the initial conditions and the subscript 1 the final conditions, then from Eq. (7.64):

y v y 1 = 1 0 α 1 y v y 0 , (7.65)
where α = -N K σy(σx+σy) . The transfer matrix has the same form as a thin lens one. In between bunches, the ion is free to drift during the time t = T n , where T is the revolution time and n the number of bunches. The corresponding transfer matrix has the same form as a drift space:

y v y 1 = 1 t 0 1 y v y 0 . ( 7

.66)

The transfer matrix M for one complete period of the forces, from the beginning of a bunch to the next, is given by the matrix product:

M = 1 t 0 1 • 1 0 α 1 = 1 + tα t α 1 . (7.67)
The stability condition, which ensures ion trapping, is:

-2 < T r(M ) < 2 ⇐⇒ -2 < 2 + αt < 2 . (7.68)
As α is strictly negative in the case of a beam and an ion of opposite charge, the condition becomes:

αt > -4 . (7.69) This condition can be expressed as a function of a critical mass number A c , all masses larger than A c will be trapped. Therefore the condition for an ion of atomic mass number A to be trapped by the beam is given, using Eq. (7.69) and K = 2rpc A , by:

A > A c y = N r p S b 2σ y (σ x + σ y ) . ( 7

.70)

Where S b = T c n = L n is the bunch spacing. The ions with masses lighter than A c will be overfocused and will drift away too much before the next bunch can focus them. This condition has been derived considering the vertical motion of the ions but the demonstration is analogue for the horizontal motion if one neglect the effect of magnetic fields on the ions. In that case, the critical mass is A c x = N rpS b 2σx(σx+σy) . An ion is effectively trapped if its atomic mass number A is larger than the two critical mass numbers A c

x and A c y . The effect of the critical mass has been observed experimentally at ADONE in 1980, Frascati, Italy [START_REF] Biagini | Observation of ion trapping at adone[END_REF].

Beam-ion interaction

This condition is only valid for singly charged ions. The trapping condition for multi-charged ion of charge Q can be expressed as a function of the charge to mass ratio A q i , where q i is the number of ionisation undergone by the ion (i.e. Q = q i e): A q i > A c (x,y) . (7.71)

A consequence of this condition is that ions climbing up the "ionisation ladder", e.g. C + → C 2+ , may no longer be trapped by the beam. In the same manner, a trapped ion can dissociate in two ions which might not be trapped. In these cases, this is an additional clearing mechanism which limits ion accumulation. 2.3).

Ion oscillations

In the case of an ion which atomic mass number A is much larger than the critical mass A c , A >> A c , then the drift time in between two bunches can be neglected. The bunched beam can be approximated by a coasting beam and the ion motion can be described by an harmonic oscillator.

Chapter 7. Ion cloud dynamics: physics and theory

In the linear approximation, the electric field E (x,y) produced by a bi-Gaussian electron beam is given by:

E (x,y) ≈
-eλ e 2π 0 σ (x,y) (σ x + σ y ) (x, y) . (7.72) where λ e is the line density of electron along the electron beam. Typically λ e = N S b where N is the number of electron per bunch and S b is the bunch spacing. For the horizontal direction, the ion motion is given by the equation:

Am p ẍ = eE x . (7.73)
Which gives the equation:

ẍ = -e 2 λ e 2Am p π 0 σ x (σ x + σ y )
x .

(7.74)

The previous equation can be simplified by introducing the classical proton radius r p :

e 2 2π 0 m p = 2r p c 2 . (7.75)
Which now gives:

ẍ = - 2r p c 2 λ e Aσ x (σ x + σ y ) x , = -ω 2 x x , (7.76)
where ω (x,y) is the ion oscillation angular frequency, ω (x,y) = 2πf (x,y) , which is different according to the oscillation direction [START_REF] Stupakov | Fast beam-ion instability. II. effect of ion decoherence[END_REF]:

ω Stupakov (x,y) = c 2r p λ e Aσ (x,y) (σ x + σ y ) . (7.77)
Different theories, using different approximations, give slightly different expressions for the ion oscillation frequency. Among them, Chao expresses this quantity for an uniform round beam [START_REF] Chao | Lecture notes on topics in accelerator physics[END_REF].

ω Chao (x,y) = c 2r p λ e Aa 2 . (7.78)
Chao's expression is derived for an uniform transverse distribution where a is the half width of this rectangular distribution. If the transverse distributions are Gaussian then a = √ 2σ x = √ 2σ y [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF], and Chao's expression is reduced to Eq. (7.77), in the case of round beams.

Raubenheimer and Zimmermann take into account the coupled motion with the electron bunch [START_REF] Raubenheimer | Fast beam-ion instability. i. linear theory and simulations[END_REF] [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF]. The expression derived here, Eq.(7.77) assumes Gaussian bunches, like Raubenheimer's, and seemed the most logical to be derived considering the assumptions chosen in this thesis, it was also derived by Stupakov [START_REF] Stupakov | Fast beam-ion instability. II. effect of ion decoherence[END_REF]. In all these expressions, the ions are assumed to be created at rest, to have an uniform longitudinal distribution. Furthermore only linear motion and no coupling between the horizontal and vertical directions is considered.

ω Raubenheimer (x,y) = c 2r p λ e Ak (x,y) σ (x,y) (σ x + σ y ) , (7.79)

Beam-ion interaction

where k (x,y) is a geometrical parameter derived from the integration over the ion cloud and the electron beam, where they have both Gaussian distributions:

k (x,y) = Σ (x,y) (Σ x + Σ y ) σ (x,y) (σ x + σ y ) ≈ 3 2 . (7.80)
Where Σ (x,y) = σ 2 i,(x,y) + σ 2 (x,y) and σ i,(x,y) is the rms transverse size of the ion cloud. The expression derived here, Eq. (7.77), can be reduced to Raubenheimer's one for k (x,y) = 1, which corresponds to a case without coupling. If σ 2 i,(x,y) = σ 2 (x,y) /2, corresponding to a smaller ion cloud size due to the focusing by the beam, as the author assume [START_REF] Raubenheimer | Fast beam-ion instability. i. linear theory and simulations[END_REF], then k x = k y = 3 2 . It is interesting to note that Raubenheimer's expression only differs from Stupakov's expression by a factor 2 3 ≈ 0.82. From these results, it is worth noticing that the effect of the coupling between the electron beam and the ion cloud seems to slow down the oscillations. Figure 7.7 shows the ion oscillation frequencies for ThomX for the different expressions for CO + ions. 2.3).

Ion distribution at equilibrium

In the case where there is no coupled instability between the electron beam and the residual ions, it is possible to derive the ion equilibrium transverse distribution [START_REF] Tavares | Transverse distribution of ions trapped in an electron beam[END_REF] [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF]. The ions are supposed to be created by collision ionisation so they have the same distribution as the electron beam (an uniform distribution of the residual vacuum molecules is supposed). For a beam with a Gaussian distribution and no initial ion velocity, the one-dimensional ion equilibrium transverse distribution has been found to be:

ρ(x) = 1 π √ 2πσ x e -(x 2 /4σ 2 x) K 0 x 2 4σ 2 x , (7.81)
where K 0 is the modified Bessel function of the second kind. The asymptotic form of the ion equilibrium distribution near the beam center is:

ρ asympt (x) = - 1 π √ 2πσ x e -(x 2 /4σ 2 x) ln x 2 8σ x + γ c , (7.82)
where γ c = +∞ 0 e -x ln(x)dx ≈= 0.577215. Figure 7.8 shows the one-dimensional ion equilibrium transverse distribution ρ and its asymptotic form ρ asympt compared to the Gaussian electron beam distribution ρ Gauss . The two distributions ρ and ρ asympt are very similar and quite peaked in the center compared to the electron Gaussian distribution ρ Gauss . This particularly peaked distribution of the ions is due to the strong focusing force produced by the electron beam. Note that the field created by the ion in their equilibrium distribution is near the one created by a Gaussian ion distribution in the case σ i,x = σx √ 2 , where σ i,x is the transverse size of the ion cloud [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF].

Longitudinal dynamics

The "longitudinal" beam-ion interaction comes from the fact that the beam has a non-uniform transverse beam size along the direction of propagation s. As shown in Fig. 7.1, the individual 7.2. Beam-ion interaction electron trajectories are not strictly parallel to the longitudinal axis s when the beam envelope (of the electron beam) is varying. The force that one ion feels when an electron is passing by the ion is perpendicular to the electron trajectory. Consequently the velocity kick that the ion will feel has a longitudinal component in addition to the transverse one. The order of magnitude of longitudinal kicks is 1 m/s compared to 100 m/s for the transverse kicks but ∆v s is not negligible. The effect on the longitudinal velocity accumulates over several hundreds of bunch-ion interactions and leads to ion accumulation points along the machine.

The longitudinal velocity kick felt by an ion from a Gaussian electron bunch with a trajectory quasi-parallel to the longitudinal axis is given by Sagan formula [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF]:

∆v s = [-α x x + (ησ δ )(η σ δ )] ∂∆v x ∂x -α y y ∂∆v y ∂y . (7.83)
This equation gives the longitudinal velocity kick ∆v s as a function of the transverse kick derivative (see section 7.1.4), the optics of the machine and the beam parameters. Here α, β and γ are the Twiss parameters, is the emittance, η and η are the dispersion function and its derivative and σ δ = σ E E 0 is the relative energy spread. All the terms of Eq. ( 7.56) depends on the longitudinal position s except the emittances (x,y) and the energy spread σ δ . The transverse kick derivatives ∂∆vx ∂x and ∂∆vy ∂y depend on both the longitudinal and transverse positions. Figure 7.9 shows the plot of the longitudinal velocity kick ∆v s along the horizontal position x for two different values of α y . In the left plot α y = α x = 10 whereas as in the right plot α y = -α x = -10. As α x = -1 2 dβx ds , a positive α x corresponds to a converging beam (going along the positive values of s) in the direction x while a negative α x corresponds to a diverging beam in x. So in the left plot, the beam is converging toward a waist on both directions x and y. However, in the right plot, the beam in converging in the x direction and diverging in the y direction. In the left plot, ∆v s is positive so ions would feel a push toward the positive values of s, toward the minimum of β x and β y . Also the kick amplitude depends on both the horizontal position x and the vertical position y of the ion, ions closer to the beam center feel a stronger kick. In the right plot, the ∆v s sign depends on the ion vertical position y, ions near the beam center in the y direction feel a negative ∆v s and ions far from it feel a positive ∆v s . This dependence on the ion vertical position y is due to the competition between to two emittance terms of Eq. (7.83): α x x ∂∆vx ∂x and α y y ∂∆vy ∂y . When the ion is close to the beam in the vertical direction, as in this example the vertical beam size σ y is smaller than the horizontal one σ x , the ion is pushed toward the minimum of β y . When the ion is further away from the beam in the vertical direction, the ion is pushed toward the minimum of β x .

In Fig. 7.10, the longitudinal velocity kick ∆v s is plotted along the horizontal position x in a dispersive section, η = 1 m. In that particular case, the dispersion term of Eq. (7.83), (ησ δ )(η σ δ ) ∂∆vx ∂x , is big compared to the emittance terms. On the left plot, η = 1 so the dispersion η is increasing with increasing values of s whereas in the right plot η = -1, the dispersion η decreases with increasing values of s. It can be seen that for an ion near the beam center, x σ x and y σ y , if η = 1 then ∆v s < 0 and if η = -1 then ∆v s > 0. The ions are pushed toward the dispersion η minimum. For ions with an horizontal position |x| 1.5 σ x , the sign of ∆v s is inverted and the ions will be pushed toward the dispersion η maximum. This sign change of ∆v s 2.3). is linked to the sign change of ∂∆vx ∂x at the same position. When the transverse kick ∆v x exits the linear region, x σ x and y σ y , the non-linearity of the Bassetti-Erskine formula leads to ∂∆vx ∂x > 0 (see Fig. 7.3).

In Fig. 7.11, the color map of the longitudinal velocity kicks ∆v s is drawn for ThomX storage ring for CO + ions. Positive kicks (toward the right) are shown in red and negative kicks (toward the left) are shown in blue according to the colorbar scale. The absolute value of the longitudinal velocity kick is maximum at the central orbit, i.e when x,y = 0 m, and decreases with a transverse displacement. Such a kick map is useful to obtain the ion accumulation points. For example, we see from Fig. 7.11 that in the region near of s = 4.5 m, for s < 4.5 m, ∆v s > 0 and for s > 4.5 m, ∆v s < 0, so the ions will be pushed and trapped around this point. In fact, due to the longitudinal kicks on both sides of the accumulation point, the ions will oscillate longitudinally around this point. At s = 2.1 m and at s = 6.9 m there are two more accumulation points. The trapping region, the longitudinal width in which the ions are oscillating, at these two points is expected to be broader than at s = 4.5 m because of the uneven strength of the velocity kick creating these accumulation points.

An accumulation point is created when the sign of ∆v s flips from positive to negative for increasing values of s. For a ∆v s sign change from negative to positive, an expulsion zone is created. An expulsion zone is a longitudinal section in which ions created there will not stay: they will drift to an accumulation point or a free drifting section, a region where ∆v s is small and not changing along s. In Fig. 7.11, two expulsion zones leading to weak accumulation points are located from s = 3 m to s = 3.4 m, and from s = 5.5 m to s = 6 m. Two more weak expulsion zones leading to free drifting sections are located from s = 0.8 m to 1.2 m, and from s = 7.8 m to s = 8.2 m. When ∆v s ≈ 0 m/s, there is no longitudinal kick in this section and ions drift with constant velocity in such a section. In Fig. 7.11, the free drifting section extends from s = 0 m to The sign of the longitudinal velocity kicks ∆v s is given by the competition of the three terms of Eq. (7.83). For ThomX storage ring, ∆v s is dominated by the (ησ δ )(η σ δ ) ∂∆vx ∂x term as shown in the bottom plot of Fig. 7.11. The derivative of the transverse kick ∂∆vx ∂x is negative in the central region. Then the accumulation points are located at dispersion minima, points where the dispersion derivative changes from a negative sign to a positive sign. ThomX case is a particular one because its energy spread is large compared to most high energy storage rings. For a typical synchrotron light source, the relative energy dispersion σ δ would be lower and the -α x x ∂∆vx ∂x term would either be the dominant one or in competition with the (ησ δ )(η σ δ ) ∂∆vx ∂x term. In the case of a ring dominated by the -α x x ∂∆vx ∂x term, ∆v s ≈ 1 2 dβx ds x ∂∆vx ∂x and accumulation points would be located at β x minima.

Depending on the contributions of the three terms of Eq. (7.83), the ion accumulation points are located at different positions. If the energy spread σ δ term is dominant, as in ThomX, then ions accumulate at the dispersion function η minima. If one of the emittance x,y terms is dominant, then ions accumulate at the beta function β x,y minima. If two, or all, terms are of the same order of magnitude then ions accumulate at longitudinal location s = s 0 such as ∆v s (s 0 ) = 0 and d∆vs ds (s 0 ) < 0. The localisation of the longitudinal accumulation points gives the optimal location for a clearing electrode unless they are modified by magnetic fields. This will be discussed in section 7.3.

Potential well created by the electron beam, discussion

In this thesis, the residual ion dynamics is expressed in terms of velocity kicks ∆v, but historically the effect of the beam was expressed as a function of the potential V created by the beam [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF]. An ion is trapped in a potential well if its kinetic energy is lower than the electric potential energy generated by the beam. This description is interesting but as it assumes a coasting beam it can not describe precisely most of the phenomenons in bunched machines. In the simple case of a cylindrical costing beam of beam radius a in a circular vacuum chamber of radius r 0 , the potential created by such a beam is [START_REF] Nagaoka | Ions[END_REF]:

V (r) =        eλ e 2π 0 ln r 2 2a 2 - 1 2 + ln a r 0 (0 < r < a) , eλ e 2π 0 ln r r 0 (r > a) . (7.84)
Using this idea it is possible to estimate the ion accumulation points as the ions drift toward the deepest potential well [START_REF] Gröbner | Computation of the electrostatic beam potential in vacuum chambers of rectangular cross-section[END_REF]. It is possible to use Eq. (7.84) in order to compare this method with respect to the one previously used in this thesis, i.e. analysis of Sagan formula. It is important to stress that the application of this formula in ThomX case in a very rough approximation as ThomX is a bunched machine. Figure 7.12 shows the evolution of the potential along ThomX storage ring. As in ThomX case the beam is far from having an uniform round distribution, the potential V is plotted in both cases where a = σ x in blue V x and where a = σ y in red V y . One can see that the minimums of both potentials V x and V y are at the IPs (s = 4.5 m and s = 13.5 m), 7.2. Beam-ion interaction which indicates an accumulation point. For V x the local minimums agree with the results found previously, accumulation points at s = 2.1 m, s = 6.9 m, s = 11.1 m and s = 15.9 m. For V y the local minimums are different and do not agree with the previous results. This model works well enough for ThomX in regions where σ x ≈ σ y , i.e. the straight sections and the IPs. But in dispersive sections where σ x >> σ y , this model gives incorrect results if one uses a = σ y . If one want to use this method to found accumulation points an expression of the potential V using non round beam, and possibly non uniform, should be used. Figure 7.12: Potential created by the electron beam along ThomX storage ring longitudinal position s. The computation assumes an uniform cylindrical coasting beam of radius a. The blue line is V x using a = σ x and the orange one is V y using a = σ y . The radii used are different according to the direction, r 0x = 20 mm and r 0y = 14 mm. ThomX design parameter values are used for the computation, λ e = 3.5 × 10 8 electron/m (Table 2.

3).

Nevertheless it is important that the same result, locate accumulation points, could be achieved with different methods as the physics behind is the same. Supposedly if one derive an expression for the potential V of a bi-dimension Gaussian distribution (which is done in section 7.1 but only in integral terms) the precision of the two methods would be the same. Using the potential method has one advantage, it takes into account the beam pipe boundaries, there is an impact on the potential well for big variations of the beam pipe cross section and this can create potential walls and prevent ion longitudinal motions [START_REF] Gröbner | Computation of the electrostatic beam potential in vacuum chambers of rectangular cross-section[END_REF]. But nowadays the beam pipe are usually very smooth and uniform to avoid step-in and step-out transitions due to the big impedance they bring. On the other side, the Sagan formula has, in my opinion, more advantages. The formula is derived for a bunched bi-dimension Gaussian, which corresponds well to many applications. As it is expressed as a function of the optic functions and of the beam parameters it is easy to see the direct link between ion dynamics and the lattice design and that it is the lattice design which drives the ion dynamics. Following this idea it is possible to expect a given ion dynamics for a given lattice type. Beside, the three clearly identified terms of the Sagan equation, and in particular the dispersion term, helps to understand the idea that "ions converge toward regions of low beta function" is inaccurate, or in some case, wrong.

Magnetic fields and magnetic mirror effect

Ions can also be trapped by magnetic fields on certain conditions, which can modify the accumulation points and prevent ion clearing [START_REF] Miyahara | Dynamical analysis on the longitudinal motion of trapped ions in an electron storage ring[END_REF] [START_REF] Ohmi | Beam-ion instability in a magnetic field[END_REF]. The mechanism leading to ion trapping in magnetic fields is explained in this section.

The motion of a particle of charge q and mass m in a uniform and constant magnetic field B is well known, it is the cyclotron motion. The charged particle performs an helical motion, superposition of a uniform motion along B and a circular motion in the plane normal to B with an angular velocity ω c = qB m and a radius r c = v ⊥ ωc where v ⊥ is the velocity component which is perpendicular to the magnetic field. When an ion is inside a dipole magnet uniform magnetic field, it feels both the effect of the electron beam and the effect of the magnetic field.

In this section, we neglect the longitudinal effect of the beam-ion interaction and consider beam driven ion oscillations at angular velocities ω x,y in the x and y directions. In that case, the vertical motion of the ion is unchanged by the dipole field and the ions still oscillate at pulsation ω y . The horizontal motion of the ions is the combination of the oscillations due to the beam at pulsation ω x and due to the cyclotron motion at pulsation ω c . As usually ω x > ω c , the ions oscillate at pulsation ω x with an amplitude modulation varying at pulsation ω c . The ion horizontal oscillations driven by the beam translates also into an ion longitudinal drift velocity v d given by [START_REF] Miyahara | Dynamical analysis on the longitudinal motion of trapped ions in an electron storage ring[END_REF]:

v d = (ω c x 0 + v s 0 ) ω 2 x ω 2 c + ω 2 x (7.85)
where x 0 is the initial horizontal position of the ion and v s 0 is the initial longitudinal velocity. So the total longitudinal motion of an ion is the sum of this drift v d and the oscillation at angular velocity ω c due to the cyclotron motion. Because of this longitudinal drift v d , ions tend to drift away from the dipoles. In practice, ions are focused very near the beam axis. Therefore x 0 is small and the longitudinal drift velocity v d is limited.

In the fringe field of real dipole magnets, the magnetic field is non-uniform and changes with the longitudinal position B = B(s). The first consequence of this is that, an ion moving in a dipole fringe field has a varying cyclotron angular velocity ω c (s), cyclotron radius r c (s) and longitudinal drift velocity v d (s). A second consequence is that an ion coming from a magnetic field free region which enters the dipole can be reflected by the fringe field. This is called the "magnetic mirror" effect and the transmission or the reflection of the ion at the entrance of the dipole depends on initial conditions. In fact, it is the magnetic field gradient which is responsible for this effect and not the fringe field itself. It means that the effect is higher if the fringe fields are shorter as the gradient is higher. If the ion initial longitudinal velocity v s 0 is high enough the ion will go through the fringe field else it will be reflected, the condition for the reflection [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF] is:

v s 0 ≤ x 0 ω x Ω(B max ) -ω 2 x ≈ x 0 ω c (B max ) √ 2 (7.86)
Where x 0 is the initial horizontal position of the ion, Ω = ω 2 c + ω 2 x and ω c (B max ) implies that ω c should be computed for the highest value of the magnetic field B(s). The approximate condition for reflection in Eq. (7.86) is valid for ω x ω c , which is usually true. Using this criteria in the ThomX case, and with ω x ≈ 2.6 MHz and ω c ≈ 2.05 MHz, it takes 7.3. Magnetic fields and magnetic mirror effect a minimum longitudinal velocity v s 0 of 1350 m/s to go through a dipole field B y = 0.597 T for an ion whose initial horizontal position is x 0 = 1 mm. The simulation shown in Fig. 7.13 agrees with this estimate. Figure 7.13 shows the evolution of the ion longitudinal position when going through a ThomX dipole magnet for several initial longitudinal velocities. This simulation, based on NUAGE, a code described in section 8.1, considers a 1 m long bend section with constant optic functions β x = 10 m, β y = 9 m and η = 0 m. The constant value of the dispersion function η is not realistic but allows one to neglect the longitudinal effect of the beam-ion interaction to highlight the effect of the dipole magnet. The electron bunch has a repetition frequency of 16.7 MHz which is the same one as ThomX. All the 100 CO + ions start the simulation outside of the dipole magnetic field at the longitudinal position s = 0.25 m with longitudinal velocities ranging linearly from v s = 500 m/s to 3000 m/s. A fraction of the ions are reflected by the rising magnetic field when entering the dipole fringe field between s = 0.35 m and 0.4 m. The minimum initial velocity of all the transmitted ions is v s 0 ≈ 1300 m/s which is close to the value computed using Eq. (7.86), v s 0 = 1350 m/s. The longitudinal velocity increase of the transmitted ions while inside the dipole, from s = 0.4 m to s = 0.6 m, corresponds to the longitudinal drift velocity v d , Eq. (7.85).

There are at least two cases where ions can be trapped by the magnetic mirror effect which are illustrated in Fig. 7.14. The first possibility, case I, is to have ions with low longitudinal velocities between two dipoles. Then the ions are reflected back and forth from one dipole fringe field to the other and accumulate in the straight section between the two dipoles. Another possibility, case II, is to have an ion accumulation point due to the beam-ion interaction at a dipole location. If the longitudinal kicks from the beam-ion interaction are not strong enough for the ions to go through the dipole fringe field, then ions oscillate in the dipole fringe field. In that case, ions Chapter 8

Longitudinal and transverse ion cloud dynamics in ThomX

Simulations are needed to fully understand the dynamics of the ion cloud in an accelerator. As explained in chapter 7, ions are strongly impacted by the beam-ion interaction and by magnetic fields. In order to get the equilibrium distribution of the ions both effects should be simulated together.

In section 8.1, the NUAGE simulation code [START_REF] Gamelin | Nuage, ion cloud tracker[END_REF] is presented. Then, simulation results are shown for the ThomX storage ring without mitigation techniques in section 8.2. Finally, in section 8.3 and 8.4, the effect of clearing electrodes and clearing gaps are discussed.

NUAGE code, a novel code for ion cloud tracking

NUAGE is a data parallel Matlab based program which is designed to optimise ion cloud clearing [START_REF] Gamelin | Nuage, ion cloud tracker[END_REF] [START_REF] Gamelin | Longitudinal and transverse dynamics of ions from residual gas in an electron accelerator[END_REF]. NUAGE includes full dynamics of ionised ions: beam-ion interaction, effect of cleaning electrodes and tracking in magnetic elements. This program can be used to reach the ion equilibrium state, to locate accumulation points, trapping regions and to optimise clearing means. It also gives the local neutralisation factor which can be used to estimate the ion effect on beam dynamics using analytical models or other simulation programs.

Description of the simulation code

The NUAGE simulation code considers the ion cloud dynamics both in transverse dimensions and in the longitudinal one. The code is based on the physical model and equations derived in section 7.1. The equation of motion of an ion in a magnetic field in the curvilinear coordinates used in NUAGE are presented in Annex A. The beam-ion interaction model is based on the Bassetti-Erskine formula for transverse part [START_REF] Bassetti | Closed expression for the electrical field of a two-dimensional gaussian charge[END_REF] and on the Sagan formula for longitudinal part [START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF]. This model uses the "strong-weak" approximation in which ions are considered as a very weak beam which will not perturb the electron beam. In this model, the ion motion is completely determined by the beam Twiss parameters, the lattice design, the beam emittance and energy spread.

The main loop of NUAGE is described in the right diagram of Fig. 8.1, each iteration of this loop corresponds to a duration T 0 , which is the time between two bunches. The effect of DC clearing electrodes can be taken into account by using the 3D electric field, computed with an electrostatic solver, used as an input to the program. Ions which longitudinal positions are near the electrode positions in the accelerator feel a kick corresponding to the electrode electric field. Tracking in and out of magnetic fields is managed differently, tracking outside of magnetic fields corresponds to a simple integration of the kicks from the beam-ion interaction and the electrodes during the duration T 0 . Tracking in magnetic fields (and in curved sections) is done by solving the differential equation of motion in magnetic fields in a curvilinear frame derived in Annex A.

The left diagram of Fig. 8.1 shows the general outline of NUAGE code. The program starts with an initialisation of the parameters and of the ion cloud. In NUAGE, all the ions considered are created at the start of the simulation. Usually their positions follow the Gaussian beam distribution in transverse and are distributed uniformly along the ring in longitudinal. A Maxwell-Boltzmann distribution at room temperature is used for their speeds. Generating all the ions at the start of the simulation, instead of considering the ion creation rate, speeds up the establishment of the equilibrium state.

Then the ion cloud is tracked during the first cycle. A cycle is a number N of iterations of the main loop (right diagram of Fig. 8.1) with a determined parameter set: N , T 0 the time between two iterations, switch on/off the beam, switch on/off the clearing electrodes, ... Several cycles can follow each other and a pattern can be repeated. This structure allows to vary parameters in the same simulation to be able to represent many situations. In ThomX storage ring, the electron beam is dumped every 20 ms and there is a variable injection gap time (approximately T 0 = 60 ns with beam on. Then the second cycle is N = 66 iterations with T 0 = 60 ns without the beam to take into account the injection gap. For a multi-bunch accelerator, it is possible to use this cycle structure to model bunch filling pattern in this way. The NUAGE code then tracks the ion cloud for a fixed duration defined by the user.

As the ion generation rate is not directly dealt with in the program, it is important to take it into account in the analysis. The tracking with NUAGE from an initial distribution to a final one allows one to extract the clearing coefficient (t) defined by Eq. (8.1). The clearing coefficient is the ratio of the number of tracked ions N i (t) at time t, which were not cleared during the tracking, over the number of tracked ions at the start of the simulation N i0 . Using the clearing coefficients and the known ion production rates, it is possible to get global values like the neutralisation factor

η(t) = N i (t)
Ne defined as the ratio of trapped charges to beam charges.

(t) = N i (t) N i0 . (8.1)
Several approximations and hypotheses are made during the tracking and the analysis. Among them, the beam-ion model of section 7.2 is adopted. An ion is considered "alive" if it stays inside the beam pipe. As soon as it reaches the beam pipe boundaries it is considered cleared, so any reflection on the pipe walls which could keep this ion "alive" is not taken into account. The influence of a non-uniform vacuum profile is neglected, i.e. a uniform vacuum profile is assumed. The vacuum profile should have a relatively small impact on the ion longitudinal equilibrium distribution as the longitudinal beam-ion force is the main driver of the equilibrium state. Also, the equilibrium state obtained by NUAGE does not take into account the constant generation of new ions which drift from their generation position to accumulation points. In reality there is a constant flow of new ions which slightly modify the equilibrium distribution [START_REF] Hoffstaetter | Equilibrium ion distribution in the presence of clearing electrodes and its influence on electron dynamics[END_REF]. The ion space charge is not taken into account, but in most cases this effect is expected to be small. In [START_REF] Pöplau | Numerical studies of the behavior of ionized residual gas in an energy recovering linac[END_REF], the ion cloud effect is simulated with the ion cloud space charge to compute the ion oscillation frequencies and compared with the results given by the linear theory (without space charge). The good agreement found is a good indication to confirm that the space charge effect is small for ion clouds. The small difference remaining between the result found and the linear theory can be explained by the non-linearities. As the action of the ion cloud on the beam is not considered, all effects involving the coupling of the two beams are neglected. This includes the ion induced instabilities, shielding effects due to beam neutralisation, ... It also means that the NUAGE code is not adapted to simulate ion dynamics when the neutralisation factor η is very close to one.

Benchmarks

Several tests of the NUAGE code were made in order to be sure that it simulated correctly the ion dynamics. Here two of them are presented, a comparison of the ion equilibrium distribution obtained using NUAGE with the analytical formula discussed in section 7.2.4 and of the ion oscillation frequencies discussed in section 7.2.3. The test of the magnetic mirror effect using NUAGE in section 7.3 can also be seen as a successful benchmark of the ion dynamics in presence of magnetic fields.

In this tests, CO + ions are distributed uniformly in a 20 cm long straight section where the optical functions are constant: β x = 10 m, β y = 9 m, α x = α y = 0 and η = η = 0. ThomX beam parameters are used: E 0 = 50 MeV, x = y = 50 nm rad, Q = 1 nC and a beam repetition frequency f 0 = 16.7 MHz. These parameters correspond to σ x = 707 µm and σ y = 671 µm.

Transverse equilibrium distribution

For this test, the ion initial transverse distribution is the same one as the beam (Gaussian distribution) and their initial velocity distribution is a Maxwell-Boltzmann distribution at room temperature. The ions are tracked for a duration corresponding to 100 000 bunch-ion interactions (6 µs). At the start of the simulation, Fig. 8.2, the ions are strongly pushed toward the beam center by the different bunches. The ion transverse distribution is oscillating between a distribution near the initial ion distribution which is Gaussian and a very peaked distribution which is close to the equilibrium distribution. This can be observed in Fig. 8.2, which shows the evolution of the horizontal distribution of the ion cloud for the first 200 bunch-ion interactions. Progressively, with this distribution oscillation, the ion distribution converges toward the equilibrium distribution. During this convergence, the ion distribution oscillates around its equilibrium distribution, see Fig. The ion final transverse distributions after 100 000 bunch-ion interactions are plotted in Fig. 8.4 and compared with the analytic expression of the equilibrium distribution [START_REF] Tavares | Transverse distribution of ions trapped in an electron beam[END_REF] [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF]. The agreement between the distribution obtained by tracking and the analytic expression is very good.

Ion oscillations

As it was seen in the previous benchmark about the ion equilibrium distribution, when the ions are created with the beam Gaussian distribution it takes many bunch-ion interactions for them to 2 ≈ 0.7σ y . So when the ions are created with a bi-Gaussian from the beam they do not satisfy this criteria and even in their equilibrium distribution this condition is only verified for approximatively 80 % of the ions, see Fig. 7.8. Figure 8.5 shows the ion oscillations for several ions in the horizontal direction. Each of these 5 ions has a different initial horizontal positions X 0 and initial vertical positions Y 0 . It can be seen that the ions which have initial positions X 0 = [1, 0.7, 0.5] × σ x have a modulation in their oscillation amplitude. This modulation results from the coupling between the horizontal ion motion and the vertical one. In the linear approximation the motion is uncoupled, but outside the central part where this is true the two motions are coupled, see Eq.(7.43). To better see how the non-linearity and the coupling affect the ion oscillations, ion trajectories with initial coordinates X 0 , Y 0 , are plotted in Fig. 8.6. If the ion motion is perfectly linear the trajectory should be an unclosed Lissajous figure: the trajectory of a particle with sinusoidal motion on both planes where the ratio of the oscillation frequencies fx fy is an irrational number. It is the trajectory observed for X 0 σx = Y 0 σy = 0.1, where the ion trajectory is bounded inside a rectangle defined by the ion initial position. When the ion initial position X 0 and Y 0 are outside the linear region, the Lissajous figure boundary is deformed by the non-linear force, as in the case X 0 σx = Y 0 σy = 0.5 and X 0 σx = Y 0 σy = 2. The effect of the coupling is very visible in the case X 0 σx = 1 and Y 0 σy = 0.1: the ion initial horizontal position is outside the linear range contrary to the vertical position and the vertical motion is still disturbed.

To take this factor into account, in this benchmark several ion clouds with different initial distribution will be tracked and their ion oscillation frequencies will be computed by discrete Fourier transforms of the mean oscillation of the ion cloud. The ion initial transverse distribution is a 2D Gaussian distribution where µ x is the horizontal mean, µ y is the vertical mean, X 0 is the horizontal standard deviation and Y 0 is the vertical standard deviation. The ion initial velocities are set to zero. A set of 5 simulations with µ x = µ y = 0 and different parameters X 0 and Y 0 is computed, each with an ion cloud of 1000 ions tracked during 5000 bunch-ion interactions (0.3 µs).

Table 8.1 lists the ion oscillation frequencies f x and f y computed during the simulations and compare them with the one computed using the Stupakov formula. This analytic expression is chosen because its assumptions are the closest to our model compared to the others presented in section 7.2.3, Chao's formula assumes round uniform beams and Raubenheimer's one takes into account the coupling with the electron beam. Due to the non-linearity of the beam-ion interaction, and the coupling between the x and y, the oscillation frequencies simulated are close to the analytic formula only for X 0 σx = Y 0 σy = [0.3, 0.1], the region where the beam kicks are very linear. For simulations, the discrete Fourier transforms of the mean oscillation of the ion cloud is computed. The frequency with the maximum power spectral density is chosen as the ion cloud oscillation frequency.

f x (kHz) f y (kHz) Stupakov formula 298 306 Simulation, X 0 σx = Y 0 σy = 1 230 252 Simulation, X 0 σx = Y 0 σy = 0.7 262 270 Simulation, X 0 σx = Y 0 σy = 0.5 281 287 Simulation, X 0 σx = Y 0 σy = 0.3 295 299 Simulation, X 0 σx = Y 0 σy = 0.1 297 305
Figure 8.7 shows the frequency footprint, the spread of the individual ion oscillation frequencies, of the different CO + ion clouds simulated. It is visible that for all simulations, most of the ions are oscillating at the frequencies f x = 298 kHz and f y = 306 kHz which correspond to the values computed using the analytic formula. Unsurprisingly, the frequency spread increase with increasing values of X 0 and Y 0 which explain the ion cloud frequency shift (mean oscillation of the ion cloud) seen in Table 8.1. It is interesting that the frequency spread shows a strong correlation between f x and f y , it indicates that the frequency shift of these ions is due to the coupling between the planes.

Performances

NUAGE uses Matlab data parallel features to speed up calculation time. Figure 8.8 shows the variation of the computation time when the different modules of NUAGE are switched on and off for the ThomX storage ring. The top plot shows that the usage of the quadrupole module increases the time needed by a factor 1.8 (this factor depends on the ring lattice). The reason for this is that using this module increases the length of the regions where NUAGE tracks particles by solving a differential equation instead of using simple integration. In the case of ThomX, quadrupoles only add small corrections to the ion dynamics. The bottom plot seems to indicate that the simulation is quicker when the electrode module is on. In fact, the time needed to compute this module is very short and as the ions are cleared by electrodes there are less and less ions to track. As the number of main loop iteration increases this explains why using the electrodes modules actually speeds up the computation.

For ThomX case, only 3 cycles are needed which corresponds to roughly 666 000 iterations of the main loop using 1250 ions per core. This simulation typically lasts about 12 hours instead of the 20 hours expected from extrapolation of the data plotted in Fig. 8.8 because many ions are cleared and not tracked any more during the simulation.

Ion dynamics and longitudinal equilibrium state

In this section, the dynamics of an ion cloud is simulated from its generation to its longitudinal equilibrium distribution. At the start of the simulation, all ions are distributed uniformly along the ring longitudinal position. Figure 8.9 shows the evolution of the CO + ion longitudinal distribution along the longitudinal position s versus the number of bunch-ion interactions. The colour scale shows the local ion density (the number of ions per pixel) at a given longitudinal position and at a given time. A red area indicates a high density of ions whereas a dark blue one indicates the absence of ions. The ion cloud is tracked for 50 000 bunch-ion interactions, and reach its equilibrium state in approximately 25 000 interactions. The bottom plot of Fig. 8.9 is a synopsis of the ThomX storage ring elements taken into account for the simulation. Ions are tracked in the dipole and quadrupole magnets. Dipoles are modelled with their longitudinal fringe fields.

As it can be seen in Fig. 8.9, ions drift from their initial position to accumulation points. The accumulation points expected from the longitudinal beam-ion interaction in section 7.2.5 at s = 2.1, s = 4.5 and s = 6.9 m are found in the simulation. At s = 4.5 m, ions seem tightly focused 8.2. Ion dynamics and longitudinal equilibrium state longitudinally by the beam-ion force, whereas at s = 2.1 m and s = 6.9 m ions are less focused and drift near these points. The reason for this is the uneven strength of the longitudinal kicks, as explained in section 7.2.5, and the presence of dipole magnets at s = 2.1 m and at s = 6.9 m, near the accumulation points, which compete with the beam-ion force. At s = 4.5 m, there are two dipoles, one on each side of the accumulation region but not directly superposed to the accumulation point.

Near the accumulation point located at s = 2.1 m, the ions stay mostly on the left side of the accumulation point as the kicks on the right side are much stronger as it can be seen in Fig. 7.11. Some ions are trapped on the right side of the accumulation point: the beam kicks do not give them enough velocity to enter the dipole so they are reflected backward and oscillate in the fringe field region (case II of Fig. 7.14). Case I trapping, ions with low velocity oscillating between two dipoles, occur at s = 4.5 m. The case II trapping also happens at s = 4.1 m, s = 4.9 m and s = 6.6 m, this effect is more visible with clearing electrodes as we will see in next section (Fig. 8. [START_REF] Bulyak | Compact x-ray source based on compton backscattering[END_REF]).

The empty regions in Fig. 8.9, from s = 3 m to s = 3.4 m and from s = 5.5 m to s = 6 m, correspond to expulsion zones. In the free drifting sections, from s = 0 m to s = 0.8 m and from s = 8.2 m to 9 m, although there is no kick due to the beam-ion force many ions gather there. Ions are slowly pushed to these regions by the weak expulsion zones from s = 0.8 m to s = 1.2 m and from s = 7.8 m to s = 8.2 m. This simulation illustrates the very fast propagation of the ions toward their accumulation position. Dipole magnets modify the equilibrium state with ion reflections on fringe fields. In this case, the effect of quadrupoles is very small and bring only small modifications to the ion trajectories. In the transverse plane the ions quickly, in about 1000 bunch-ion interactions, converge toward an equilibrium distribution which is very peaked at the electron beam center [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF]. As a result, most of the ions are inside the electron beam, very near the axis where the quadrupole magnetic field is low.

The same kind of simulation has been done for H + 2 ions, Fig. 8.10 shows the tracking of an H + 2 ion cloud for 50 000 bunch-ion interactions. As the H + 2 ions are lighter than the CO + ions, they reach their equilibrium in less time, approximately 5 000 beam-ion interactions. Contrary to CO + ions, for H + 2 ions there are no accumulation at the IP (s = 4.5 m) because the H + 2 ions are not trapped in this area, see section 7.2.2.

The ion final distributions after 20 ms (333 333 bunch-ion interactions) for both ion types (CO + and H + 2 ) are shown in Fig. 8.11. The two distributions are very similar except for two things. As said previously the the H + 2 ions are not trapped around IP and IP bis (s = 4.5 m and s = 13.4 m) contrary to CO + ions. It can also be seen that there are 4 bins where there are much more H + 2 ions than of CO + ions. This local increase in trapped H + 2 ions happen at locations where trapping due to the magnetic mirror effect (of type II) is expected. In fact, the ion trapping due to magnetic fields is stronger for H + 2 ions than for CO + ions because the minimum longitudinal velocity to go through a dipole fringe field scale as 1 A , Eq. (7.86). Figure 8.12 shows the evolution of the clearing coefficient , Eq. (8.1), during these simulations. After 350 000 bunch-ion interactions, 90% of the initial CO + ions and 85% of the initial H + 2 ions are still trapped by the beam. The dotted lines, which correspond to the same simulations without magnetic fields, allow to estimate the amount of ions trapped because of the magnetic mirror effect. The effect is relatively small for CO + ions, about a 3% increase in ion trapped, but it is not a

Ion clearing using polarised BPM electrodes

Setting up clearing electrodes is an usual way of mitigating conventional ion trapping (CIT) in small electron storage rings and ERLs [START_REF] Poncet | Ion trapping and clearing[END_REF] [START_REF] Pöplau | Simulations for ion clearing in an ERL[END_REF]. Usually clearing electrodes are polarized plates placed into the vacuum chamber to provide a transverse electric field which collects the ions on the electrodes. In most cases a DC voltage of 2 or 3 kV is applied and is enough to extract the ions from the beam potential well. These examples correspond to electron beams with higher current and smaller beam size for which the beam potential well is deeper than the one produced by ThomX electron beam. It has been shown that for a small ring of ThomX size, and of comparable beam size but with a higher current, that a much lower electrode DC voltage is enough to clear correctly the ions. In the 90-210 MeV NIJI-I ring, Japan, in the nineties the clearing was done with a DC voltage of 300 V and did not improve further if the voltage was increased [START_REF] Takada | Ion effects in a compact electron storage ring[END_REF]. For ThomX a maximum DC voltage of 500 V has been chosen and should be enough to reach the total clearing of the electrodes regions. This value has been checked with the NUAGE code and the clearing did not improve for higher electrode DC voltage. Because of the relatively small constant potential V applied to such electrodes, on the order of one kV, clearing electrodes do not affect the electron dynamics. They are not generally used in large rings as covering a large machine with such electrodes is costly. As any accelerator component, clearing electrodes increase the total impedance of the accelerator, so a careful design of the electrodes is needed.

In order to achieve a good ion clearing with electrodes, electrode positioning is crucial and a study of the accumulation regions should be done before choosing electrode positions.

Clearing electrode using longitudinal electric field

Depending on the design of the electrodes, it is possible to generate both a transverse and a longitudinal electric field and not only the usual transverse field. In that case, using a negative polarity, the longitudinal field is such that it creates an artificial longitudinal accumulation point at the electrode position (a positive polarity would create an expulsion point). This longitudinal field helps as it will bring more ions to be cleared by the transverse field. A longitudinal field is created by the DC voltage difference between the electrodes and the vacuum chamber, which is grounded. In order to evaluate properly the effect of the clearing electrodes on the ions it is necessary to simulate the electric field produced by the electrode.

In ThomX, several different designs of clearing electrodes with multiple buttons are used, they are in fact similar to the button beam position monitors (BPM) designed by Soleil [START_REF] Hubert | The SOLEIL bpm and orbit feedback systems[END_REF] In the case of an electrode composed of several buttons, as in Fig. 8.14, the possibility to produce a longitudinal electric field depends on the symmetry. In the case of electrode IB bis, the zero of the transverse field is not at the vacuum chamber center as the buttons are not symmetric with respect to the cavity center. In the other cases (electrodes BPM6, BPM8 and IP ), the buttons are symmetric with respect to the vacuum chamber center so to have all buttons with negative polarity would not be efficient as the transverse field would be zero at the cavity centrer where the ions are. So for electrodes BPM6, BPM8 and IP the buttons have an opposite polarity which produces a transverse field but no longitudinal field along the beam axis. It is possible to get both fields in the cavity center using only one button (or two in the case of the BPM8 electrode) polarised negatively but the maximum amplitude of the field at the cavity center is much lower in that configuration. An example of electric field map in the transverse plane of the IP bis is shown in Fig. 8.14 for configuration -/-. In that configuration, the field arrows come from the grounded (neutral) vacuum chamber toward the negatively charged electrodes producing an horizontal electrical field. The same phenomena also happen longitudinally and also creates a longitudinal accumulation point. For configurations +/-and -/+, the field arrows would come from the negatively charged electrode to the positively charged one and create a vertical electric field.

Clearing electrode effectiveness

Clearing electrodes are implemented in NUAGE, the three components of the electrode electric field are computed on a grid, then interpolated at the ion positions in NUAGE simulation. The ions near clearing electrodes feel a velocity kick corresponding to the value of the electric field at their positions.

In order to have the best clearing possible with the electrodes available in ThomX, it is necessary to evaluate the clearing effectiveness of the different possible configurations. To do this the different configurations of the electrode systems have been simulated in NUAGE. Table 8.3 summarizes the simulation study done using NUAGE for 10 000 bunch-ion interactions for different polarisation configurations of the clearing electrodes. A 20 cm straight section with constant optic functions β x = 10 m, β y = 9 m and η = 0 m is used for the test, and the electron bunch has a repetition frequency of 16.7 MHz which is the same one as ThomX.

For a type IP bis electrode, only 18% of the initial ions remain after 10 000 bunch-ion interactions for configuration -/-. The longitudinal electric field produced by the -/-configuration allows 15% more clearing compared to the equivalent configuration, +/-, without longitudinal field. For every other electrode types, the best configuration still leave about 30% of uncleared ions after 10 000 bunch-ion interactions. The configuration -/-of the IP bis electrode can also be used on the BPM8 electrode using only two of the four electrodes.

The most efficient configurations will be used for the ion clearing on ThomX, meaning +/-for IP, -/-for IP bis, +/-for BPM6 and -/-for BPM8. For the electrode BPM6, the number of ions remaining in configuration -/-(29 %) is close the one of configuration +/-(29 %). But in the configuration +/-, the clearing in much faster a the start of the simulation, because there is no transverse field at the electrode center in configuration -/-, so this configuration is chosen. The electrode at s = 4.5 m is placed at the main accumulation point and allows the clearing of most of the ions there. The two electrodes of type BPM6 are located near the exit of the expulsion zones, i.e at s = 0.8 m and s = 8.2 m. This helps to isolate the free drifting regions and to prevent Table 8.3: Percentage of remaining ions after 10 000 bunch-ion interactions in a 20 cm straight section. The configuration indicates the electrode polarisation, the first sign corresponds to the upper electrode and the second one for the lower electrode. Respectively, + stands for U = 0.5 kV, -for U = -0.5 kV and 0 for U = 0 V. From NUAGE simulations with CO + ions and N i0 = 16000. As shown by this simulation, clearing electrodes should allow to clear an important fraction of the ions. There are still two uncleared accumulation regions at s = 2 m and s = 7 m but, due to the overcrowding of the machine and the difficulty to realise dipole chambers with clearing electrodes, it was not possible to install clearing electrodes there. Figure 8.17 shows the ion final longitudinal distribution after 20 ms (333 333 bunch-ion interactions) with clearing electrodes on for both H + 2 and CO + ions. Thanks to the clearing electrodes, the IP and IP bis regions are fully cleaned while the ion number is reduced in the straight sections and in the dipoles. Figure 8.18 shows the evolution of the clearing coefficient , Eq. (8.1), during this simulation. After 350 000 bunch-ion interactions with the clearing electrodes on, only 34% of the initial CO + ions are remaining and 32% of the initial H + 2 ions. These numbers have to be compared with the 90% of remaining CO + ions and 75% of remaining H + 2 ions when there is no clearing electrodes. The decrease of the clearing coefficient by about 50% shows that the electrodes (and their positioning) are very efficient.

Ion cloud dynamics with clearing electrodes

Ion cloud dynamics in presence of clearing gaps

Clearing gaps are also a widely used mitigation technique to fight ion trapping. For machines working with multiple bunches it consists in having empty RF buckets (without bunches) in a given pattern. The absence of the beam focusing force on the ions perturbs the ion transverse oscillations and leads to ion clearing. A long gap in the bunch train can be used to avoid conventional ion trapping while the use of multi-bunch train beam fillings has been shown to be very effective to counteract the fast ion instability [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF].

For a storage ring working with only one bunch, as ThomX, the concept of clearing gap is different. In ThomX, a bunch is stored for 20 ms, and used to produced X rays via Compton scattering, then it is dumped while a new bunch is injected. It is possible to delay by some time the injection of the new bunch to make the ion clearing more effective. In that case, the clearing gap is the duration between extraction of the used bunch and the injection of a new one. The physical effect of such a clearing gap on the ions is the same as the one implemented in multi bunch machines.

In section 8.2 the ion dynamics was described in the case of ions generated uniformly along the orbit. The equilibrium state obtained was modified in section 8.3 by the effect of the clearing electrodes. The ion cloud in its equilibrium state, reached after 350 000 bunch-ion interactions (approximately 20 ms) with clearing electrodes, is taken as the input for the simulation shown in Figure 8. [START_REF] Bruni | Electron beam dynamics in the 50 MeV ThomX compact storage ring[END_REF]. It shows the evolution of the vertical distribution of all the ions in the accelerator (whatever their longitudinal position) during the clearing gap of 4 µs (66 missed bunch-ion interactions). At the start of the clearing gap, all the ions are tightly packed by the beam-ion interaction within 300 µm of the beam mean orbit. During the gap, the ions are free to escape from the beam envelope as there is no beam-ion interaction.

In that case, since the gap duration is short, less than 1 % of the CO + ions are cleared during this gap, see Fig 8.20. For lighter ions like H + 2 , the same study shows that around 12 % of the ions will be cleared during a 4 µs gap. The evolution of the clearing coefficient during the gap is the same with or without clearing electrodes. The reason for this is that, during the gap, the ions are located far from the electrodes, otherwise the ions would be cleared, and as the gap is very short the ions do not have the time to move longitudinally. But even if the ions are not cleared during the gap, the ion vertical positions are mixed up Figure 8.22 shows the histogram of the ion positions 20 ms after the clearing gap for both CO + and H + 2 ions. Before the clearing gap, the two ion types had similar distribution with a bit more H + 2 trapped in the weak accumulation points, see Fig. 8.17. After the clearing gap, the two ion types do not have a similar distributions any more. The H + 2 ions have been cleared all along the ring but in the weak accumulation points where they are very difficult to clear due to the more important magnetic mirror effect for H + 2 . For CO + ions, the clearing gap decreased the amount of ions everywhere but there are still ions in the straight sections (from s = 17 m to s = 1 m and from s = 8 m to s = 10 m).

The loss of ions due to the clearing gap is increased in presence of clearing electrodes. This can be clearly seen in Fig. 8. [START_REF] Bane | A simplified model of intrabeam scattering[END_REF] showing the temporal evolution of the clearing coefficient for the tracking after the clearing gap with and without clearing electrodes. The "natural clearing", meaning clearing without electrodes, is more important for H + 2 ions than for CO + ions because 2 ions diverge transversally more during the gap as they are lighter and faster. The difference between the clearing coefficient with and without clearing electrodes is the consequence of the increased longitudinal velocity, due to the clearing gap, which brings ions to the clearing electrode locations. This effect is less important for H + 2 ions than for CO + ions due to the more important magnetic mirror effect for H + 2 preventing ions from escaping longitudinally. Chapter 9

Multi-ionisation and local neutralisation factor

The previous simulations and analysis allowed to understand the ion cloud dynamics and to reduce ion trapping by optimising the clearing. But, in order to estimate the effect of the remaining ions on the electron beam, it is necessary to be able to know the real ion number which will be trapped in the beam. To achieve this, one need not only to take into account the ion dynamics simulated by NUAGE but also the different processes involved in ion production. It is possible to do so by solving differential equations combining the different ionisation processes and the clearing coefficients computed in previous simulations of chapter 8.

The ion production and the different processes are explained in section 9.1, then in section 9.2 the methodology for the post-analysis of NUAGE simulations used here is explained. In the section 9.3 and 9.4, the results and the ion cloud effect on the tune shift and tune spread is presented for ThomX nominal lattice. 9.1 Ion production, dissociation and multi-ionisation

Ion production

There are several mechanisms which can create ions from the residual gas inside particle accelerators. The most common method is collision ionisation which corresponds to collisions of the beam particles with the residual gas molecules [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF]. For high energy storage rings, ionisation via synchrotron radiation can be the dominant mechanisms for ion production, but these ions are not produced in the beam vicinity where trapping is possible [START_REF] Raubenheimer | Ion effects in future circular and linear accelerators[END_REF]. These ions will form a halo around the beam which do not have an important impact on the beam dynamics. Another ionisation mechanism which can be of importance is field ionisation, also called tunnelling ionisation [START_REF] Raubenheimer | Ion effects in future circular and linear accelerators[END_REF]. When the beam electric field is strong enough to overcome the potential barrier confining an electron, this electron can escape via quantum tunnelling. Very strong electric fields (in the order of 10-100 GV/m) are needed to ionise a molecule via tunnelling ionisation, when this happens the full volume swept by the beam is ionised. Field ionisation is mainly a concern for future high intensity linac [START_REF] Rumolo | Update on fast ion instability simulations for the CLIC main linac[END_REF].

Chapter 9. Multi-ionisation and local neutralisation factor

In the setting of ThomX, only the collision ionisation is relevant. In that case, the number of new ions created per second can be expressed as:

N i new = σ i • N e • [i] • c , (9.1)
where σ i is the ionisation cross section for molecular species i, N e is the number of electrons in a bunch, c is the speed of light and [i] is the volumetric density of species i. The molecular density of species i can be expressed using the ideal gas law:

[i] = p i k B T , (9.2)
where p i is the partial pressure of species i, T is the room temperature and k B is the Boltzmann constant.

The cross section for an inelastic collision between a molecule or an atom by a relativistic electron can be estimated using the relativistic Bethe asymptotic formula [START_REF] Inokuti | Inelastic collisions of fast charged particles with atoms and molecules-the bethe theory revisited[END_REF]:

σ i = 4π h m e c 2 M 2 0 1 β e 2 ln β e 2 1 -β e 2 -1 + C 0 β e 2 , (9.3)
where h is the reduced Planck constant, m e is the electron mass, β e = ve c where v e is the electron speed and c is speed of light. M 0 and C 0 are constants determined experimentally which depend on the process and on the target. This formula can be used to describe the many processes which can happen when relativistic electrons collide with residual vacuum molecules: simple or multiple ionisation, dissociation or excitation.

A simple ionisation model: single ionisation

For ThomX case, a simple analysis can be done using Eq. (9.1), Eq. ( 9.3) and Tab. 9.1 for the single ionisation of the two most common species of the vacuum, H 2 and CO: N

H + 2 new ≈ 3.3 • 10 8 ion s -1 and N CO + new ≈ 1.8 • 10 8 ion s -1 .
In that case, total neutralisation of the electron beam occur in τ = 1 c(σ CO [CO]+σ H 2 [H 2 ]) ≈ 12.6 s. In practice, the neutralisation stops before full neutralisation of the electron beam: when the ion cloud density approaches the electron beam density some effects will limit any further increase of the ion density. As the ion density increases, the positive electric fields generated by the ion cloud begin to screen the negative field of the electron beam. This decreases the focusing fields which keeps the ion cloud in the beam orbit leading to both a spread of the ion cloud and ion losses. Another effect which limits the ion density is the ion space charge repulsion, for high density ion cloud, the space charge will tend to spread the ion cloud. Table 9.1: Value of the M 2 0 and C 0 for the single ionisation and corresponding cross section for a beam energy of 50 MeV [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF]. Number of new ions per second at 300 K for partial pressure P CO = 3.0 • 10 -11 mbar and P H 2 = 2.7 • 10 -10 mbar.

Ion production, dissociation and multi-ionisation

The evolution of a vacuum system which is composed of atoms, molecules and ions of species i, of volumetric density [i], is given by the differential equations [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF]:

d[i] dt = [N e ]c j (σ j→i [j] -σ i→j [i]) , (9.4)
where σ i→j is the ionisation cross section for production of species j from species i by electron impact and [N e ] is the electron beam volumetric density. The positive terms of the sum describe the creation of the atoms or ions by the different processes and the negative terms their destruction.

Here we consider that the electron beam is a uniform coasting beam of round transverse size σ x = σ y = 0.5 mm, so [N e ] = Ne L 0 πσ 2 x ≈ 4.4 • 10 14 electron m -3 . In theory it would be possible to build a model which takes into account most of the important process using this formula but it is difficult in practice due to the lack of data concerning the M 0 and C 0 constants for many processes, especially for multi-ionisation. The data concerning a few processes have been gathered here [158] [159]. Some experiments have reported important effects due to multi-ionisation [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF] [START_REF] Calvey | Ion effects in the APS particle accumulator ring[END_REF], so it is interesting to see if similar effects can be important for other cases.

Let's start by looking at the evolution of a simple system composed of H 2 , H + 2 , CO and CO + using Eq. (9.4) and considering only the processes described on Tab. 9.1:

                       d[CO] dt = -σ CO→CO + [CO][N e ]c , d[CO + ] dt = σ CO→CO + [CO][N e ]c , d[H 2 ] dt = -σ H 2 →H + 2 [H 2 ][N e ]c , d[H + 2 ] dt = σ H 2 →H + 2 [H 2 ][N e ]c . (9.5)
The initial conditions for this system are a partial pressure P CO = 3 • 10 -11 mbar and P H 2 = 2.7 • 10 -10 mbar at T = 298 K and no initial ions. In that case, the numerical resolution of this system gives the evolution of the different species described in Fig. 9.1. As in the vicinity of the beam there are much more electrons than of CO and H 2 molecules, the beam quickly ionises all the available molecules and then the ionisation stops at a neutralisation factor below 0.02. From experience, we know that this behaviour is not correct as electron beams can reach values close to full neutralisation. In reality the system represented here, which corresponds to the volume of our uniform coasting beam, is not closed and exchanges with the rest of the vacuum chamber. There is a diffusion of the molecules, due to thermal agitation, which replenishes the volume of the coasting beam. Typically the molecular diffusion mechanism, given by Fick's second law, can be expressed in the case of rotationally symmetric system of radial coordinate r as:

∂[i] ∂t = D i/j ∂ 2 [i] ∂r 2 , (9.6)
where D i/j is the diffusion coefficient characterising the diffusion of the molecule i in a medium composed of the molecule j which depends also on temperature and pressure. The equation system, Eq. (9.5), can be completed by adding the corresponding right hand side of Eq. (9.6) to the equations governing the evolution of molecular quantities. In fact, similar terms should also be added to ionic quantities as they are also susceptible to collide or be repelled by other species. But contrary to molecular quantities, ionic ones feel the effect of the beam which trap ions to the beam center and prevent their diffusion. So it seems legitimate to neglect any diffusion effect for ions, then in the case of a molecular diffusion in H 2 the modified system is given by:

                       ∂[CO] ∂t = -σ CO→CO + [CO][N e ]c + D CO/H 2 ∂ 2 [CO] ∂r 2 , ∂[CO + ] ∂t = σ CO→CO + [CO][N e ]c , ∂[H 2 ] ∂t = -σ H 2 →H + 2 [H 2 ][N e ]c + D H 2 /H 2 ∂ 2 [H 2 ] ∂r 2 , ∂[H + 2 ] ∂t = σ H 2 →H + 2 [H 2 ][N e ]c . (9.7)
This new system considers not only the temporal evolution of the ions but also their spacial evolution which complicates the problem. The diffusion coefficient are usually determined experimentally: D H 2 /H 2 = 1.604 cm 2 s -1 (at T = 273 K and P = 1 bar) and D CO/H 2 ≈ D N 2 /H 2 = 0.743 cm 2 s -1 (at T = 288 K and P = 75 mbar) [START_REF] Mostinsky | Diffusion", Thermopedia: A guide to thermodynamic head and mass transfer and fluids engineeding[END_REF]. Considering the previous situation where there were no more H 2 inside the coasting beam volume, the diffusion term can be estimated numerically:

D H 2 /H 2 ∂ 2 [H 2 ] ∂r 2
≈ 1.604 • 6.

               d[CO] dt = d[H 2 ] dt = 0 , d[CO + ] dt = σ CO→CO + [CO][N e ]c , d[H + 2 ] dt = σ H 2 →H + 2 [H 2 ][N e ]c . (9.8)
Using the same initial conditions as before the time evolution of this system is described in Fig. 9.2. The volumetric densities of the CO and H 2 are now constant and the amount of CO + and H + 2 is linearly increasing with time and full neutralisation is reached in 12.6 s as expected from the previous simple computation. As there is no limitation to ionisation in the system (9.8), the ionisation continues after full neutralisation in Fig. 9.2. A way to correct this non-physical behaviour is to introduce a factor limiting the ionisation when the neutralisation factor η grows. As explained before, when the neutralisation factor is close to one, the beam is screened which leads to ion losses, so the ion loss factor should be proportional to η. But there is no simple theory to model this phenomena, a high neutralisation factor also affects the electron beam and modifies its properties, and as seen before ion losses are complex and may not vary linearly with the neutralisation factor η. In first approximation, this unknown ion loss term can be approximated as -σ i→j [i][N e ]ηc in order to get the appropriate behaviour of the ionisation which should slow down as η increase. This Chapter 9. Multi-ionisation and local neutralisation factor approximation gives the following equation system:

                       d[CO] dt = d[H 2 ] dt = 0 , d[CO + ] dt = σ CO→CO + [CO][N e ](1 -η)c , d[H + 2 ] dt = σ H 2 →H + 2 [H 2 ][N e ](1 -η)c , η = [CO + ] + [H + 2 ] [N e ]
.

(9.9) Figure 9.3 shows the evolution of the system defined by Eq. (9.9). With this approximation the full neutralisation is reached in a longer time as the ionisation rate is no longer constant and the neutralisation factor η does not exceed one. In the case of a system with only two ion species like this one, the trapped-ion composition at full neutralisation is expected to be [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF]:

         [CO + ] F N = [N e ] σ CO→CO + [CO] 0 σ CO→CO + [CO] 0 + σ H 2 →H + 2 [H 2 ] 0 , [H + 2 ] F N = [N e ] σ H 2 →H + 2 [H 2 ] 0 σ CO→CO + [CO] 0 + σ H 2 →H + 2 [H 2 ] 0 . ( 9

A more complex ionisation model: dissociation and multi-ionisation

Even if there is no physical ground to the correction made in Eq. (9.9), it brings the correct physical behaviour. This correction adds a limit to these dynamical systems which exists physically but is difficult to theorise in equations. As it will be shown now for a more complex system which include multi-ionisation, such a limit can totally change the end results and the time evolution. In 9.1. Ion production, dissociation and multi-ionisation order to take into account the complex phenomenons which can occur, like molecular dissociation or multi-ionisation by electron impact, let's introduce a slightly modified version of Tavares's ionisation model [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF]. This model takes into account the different ionisation products possible with an initial gas composed of H 2 and of CO molecules. The H 2 can be ionised to produce H + 2 ions or be dissociated directly into two protons H + . The H + 2 ions can be dissociated into two protons H + and into a proton H + and an hydrogen atom H. The CO molecules can be ionised into CO + ions or dissociated into a combination of C, C + , O and O + . The CO + can be ionised further into CO 2+ but this species is unstable and dissociate quickly into C + plus O + . The CO + can also be dissociated into a combination of C, C + , O and O + but as the cross section is unknown, the cross section for the dissociation of N 2 is used, as did Tavares in his model, as N 2 and CO are supposed to have very similar behaviour. Furthermore, as there is no data, I suppose that the probability to produce C plus O + from CO + is the same as the one to produce C + plus O from CO + . The C + ions are also successively ionised to produce ions up to C 6+ . The same process of successive ionisation can also happen for O + ions up to O 8+ , but as there is no data for the cross sections, the ionisation after O + are not taken into account. The different processes taken into account are described in Tab. 9.2. This ionisation model is used to establish a set of equations similar to the system (9.9), which describes the evolution of the ion volumetric densities for all the species considered. The atoms, C, O and H, produced by the reactions listed in Tab. 9.2 are not trapped like the ions by the electron beam so they are free to drift away due to the thermal diffusion mentioned earlier. These atoms produced are then diluted in the total volume of the vacuum chamber so their volumetric densities in the coasting beam volume are negligible. In consequence, as before the molecular density of every neutral species is kept constant. The same correction as in Eq. (9.9) is used to limit the total neutralisation factor to one. Figure 9.4 shows the temporal evolution of the system defined by Tab. 9.2 with the same initial condition as before. The effect of the new processes added is very important as the final equilibrium is totally different from the more simple model which was previously used. Only 53% of the total neutralisation factor is due to ion ionised only once and 40% of the 53% comes from the H + ions. The H + 2 ions produced are in fact very quickly dissociated into H + ions. The reason for this is that the dissociation cross section of the H + 2 ions, σ 15 ≈ 0.39 Mb, is bigger than the ionisation cross section of H 2 , σ 12 ≈ 0.26 Mb. The rest of the neutralisation factor is due to the multi-ionised species, from C 2+ up to C 6+ . As for the H + 2 , the CO + ions dissociate very quickly to produce carbon and oxygen ions due to the very important dissociation cross section, σ 5/6 ≈ 2.4 Mb, compared to the CO ionisation cross section, σ 1 ≈ 1.2 Mb. Then the successive ionisations of the carbon ions are limited by the full neutralisation condition which leads to an equilibrium between the different carbon ions. In this example, the C 3+ and C 4+ ions are the ionisation states which are the most importantly represented. Probably the part of the multi-ionised ions in the final neutralisation is underestimated here because the multi-ionisation of the oxygen ions is not taken into account in this model.

Process

M 2 0 C 0 Cross-section (Mbarn) e -+ CO -→ CO + + 2e - 3.7 35.1 σ 1 = 1.2 e -+ CO -→ C + + O + 2e - 0.35 3.0 σ 2 = 0.11 e -+ CO -→ C + O + + 2e - 0.
Previously, the limit on ion accumulation was fixed to the maximum value possible of η = 1 corresponding to full neutralisation of the electron beam. But for many applications, the limit can be actually much lower for many reasons such as the ion natural clearing rate or mitigation techniques used to reduce ion accumulation. So it is interesting to study the same model but with different ion accumulation limits corresponding to a maximum neutralisation factor η max . Figure 9.5 shows the evolution of the system defined by Tab. 9.2 with different values of η max . The left plot is for η max = 10 -1 , in that case the role of the multi-charged ions is null and most of the charge is carried by H + ions. Because of the imposed limit, there is a competition between the production of hydrogen ions and of carbon ions and as the production of dihydrogen ions is faster than the

(σ CO→CO + [CO] 0 ≈ 9.1 • 10 -11 m -1 , σ H 2 →H + 2 [H 2 ] 0 ≈ 1.7 • 10 -10 m -1
), the hydrogen ions compose the most of the trapped ion composition. Because of that competition, the multi-ionisation of the carbon ions is inhibited and most of the carbon ions are in the C + state. Compared to the previous case where η max = 1, the main difference is that as the limit is lower, much less CO + ions are produced before the competition between CO + and H + 2 ions becomes important. Thus, with the high dissociation rate of CO + ions and the multi-ionisation of carbon ions, multi-ionised carbon ions can build up an important part of the total neutralisation factor in a small time even if more hydrogen ions are produced in the same time. For the middle plot, η max = 10 -2 , and the right plot, η max = 10 -3 , lowering the ion accumulation limit changes the equilibrium between H + and H + 2 ions. Globally, the effect of lowering the limit and imposing an equilibrium at this limit "freeze" the temporal evolution of the system when the ion accumulation limit is reached.

Here, the limit fixed on the ion accumulation is fixed arbitrarily and is the same for every ion species. Physically this is true only for η max = 1 which corresponds to full neutralisation of the electron beam. The other effects which can limit the ion accumulation such as the natural clearing rate or the mitigation techniques usually depends on the ion species. Meaning that there are different limits for each species which is not taken into account here. In addition to this, in this study the critical mass A c is assumed to be inferior to one so that all the ions are trapped but if it is not the case then the final equilibrium obtained may be changed.

In any case, these results suggest that ion dissociation, and even more so multi-ionisation, are important for high values (typically η ≈ 0.1) of the neutralisation factor η. For low values of η, these effect can probably be neglected in most cases. The experiments which reported important effects from multi-ionisation usually operate with high neutralisation which tend to comfort this theory (η ≈ 0.4 for the PAR at APS [START_REF] Calvey | Ion effects in the APS injector and storage ring[END_REF] [160] and near full neutralisation for the EPA at CERN [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF]).

Chapter 9. Multi-ionisation and local neutralisation factor

NUAGE post-analysis methodology

In the previous section, the ion production mechanisms were detailed and an ionisation model taking into account complex processes was introduced. The evolution of the different species was computed considering "artificial" limitations. In order to know the real evolution of these quantities, it is necessary to find a way to merge the analysis using differential equations to compute the system evolution and the NUAGE simulation results which gives the ion accumulation limit.

Iterative use of the clearing coefficient

The key to do this is to use the clearing coefficients computed during NUAGE simulations, see Fig. 8.12, 8.18, 8.20 and 8.23. The clearing coefficient is defined as the number of tracked ions N i (t) over the number of tracked ions at the start of the simulation N i0 , Eq. (8.1). But the clearing coefficient (n) can also be seen as the probability of survival of an ion when it is generated in a given distribution. Ions produced by beam ionisation are distributed uniformly along the accelerator, so their probability to survive after a time n is given by the clearing coefficient U (n) shown in Fig. 8.18 (case with electrode on). The ions which are not cleared propagate quickly towards an equilibrium distribution. Before a clearing gap, all the ions are considered as in the equilibrium distribution. The probability to have an ion alive before the gap to survive after a time n during the gap is given by the clearing coefficient gap (n) shown in Fig. 8.20. After a clearing gap, it is given by the clearing coefficient N U (n) shown in Fig. 8.23. In this analysis, ions have a "memory" which translates the fact that ions in different distributions behave differently and do not have the same survival probability.

For example, I consider that I inject the electron beam inside the storage ring at time n = 0 turn and that there were no ions in the vacuum before (N ions (0) = 0). If N new ions are created at each turn of the electron beam in the ring, then the number of ions in ring after one turn (at time n = 1 turn) is: .11) During this first turn, N new ions are created and as they are just being created I consider that none of them are cleared during this turn, so the term N new is multiplied by the clearing coefficient U (0) = 1 (0 turn since the ions were created). During the second turn, some of these ions are cleared and there are now N new U (1) ions remaining. However, one must also consider N new U (0) new ions which were created during this second turn:

N ions (1) = N new U (0). ( 9
N ions (2) = N new U (0) + N new U (1). (9.12)
After the second turn, we keep the ions from the first and second turns and add N new ε(0) ions that case, the N old gap (n gap ) ions remaining behave differently during the next cycle compared to the ions generated during the second cycle. During the second cycle, characterised by the clearing coefficients N U (n) for remaining ions and U (n) for ions created during this cycle, the number of ions N ions at time n is given by:

N ions (n) = n cycle i=1 N new (i) U (n cycle -i) gap (n gap )
After the first cycle and clearing gap

N U (n) + n i=1 N new (i) U (n -i) During the second cycle , = N old N U (n) + n i=1 N new (i) U (n -i), n ∈ [0, n cycle ]. (9.18)
Where N old is the number of remaining ions before the start of the second cycle. Then, during the second clearing gap, the number of ions N ions at time n is given by:

N ions (n) = n cycle i=1 N new (i) U (n cycle -i) gap (n gap ) N U (n cycle ) + n cycle i=1 N new (i) U (n cycle -i)
After the second cycle gap (n)

During the second clearing gap

, = N old gap (n), n ∈ [0, n gap ]. (9.19
) Where N old is the number of remaining ions before the start of the second clearing gap. By keeping going this scheme iteratively it is possible to know the number of ions of each species at any time.

Post-analysis algorithm

The equation (9.19) and the method developed in the previous subsection allows to know the number of ions at any time for a given species but to use it one should know the number of new ions produced at each turn. So I use an algorithm in order to take into account both the ionisation model defined in Tab. 9.2 and the method described in section 9.2.1.

The diagram of this algorithm is shown in Fig. 9.6. If it is the first cycle then N old = 0 but if it is not then the number of ions from previous cycles is stored in N old , N old = N ions . Each cycle is divided in N step steps. The program then solves the system of ordinary differential equations (ODE) defined by the ionisation system in Tab. 9.2 for a duration corresponding to

N cycle

Nstep . The ODE system solved is analogue to Eq. (9.8), meaning there is no "artificial" limitation on the ion accumulation and that the volumetric density of the molecular and atomic species are constant. The results of the ODE system are used as input for the N new variable for each ion species. Then the step of the sum corresponding to Eq. (9.16) is computed, the corresponding clearing factor U (j) is only applied if N new (i -j) > 0 (as N new (i -j) < 0 corresponds to ion dissociation or multi-ionisation). Then the ions from previous cycles N old are added to the number of total ion number N ions following Eq. (9.18). The program loops over these operations until the N step steps are done. After, the effect on the clearing gap is taken into account following Eq. (9.17). This 9.3. Neutralisation factor algorithm is repeated for as many cycles as wanted and gives the temporal evolution of the ion volumetric densities.

Neutralisation factor

The analysis presented in section 9.2.2 is applied in the case of ThomX with the clearing coefficient computed by NUAGE simulations for the ion species: H + 2 , H + , CO + , O + , C + , C 2+ and C 3+ . As the other ion species present in the model are only created in very low quantities (C 4+ , C 5+ and C +6 ), their clearing coefficients are taken equal to the ones of the C + ion. Figure 9.7 shows the results of this analysis, the evolution of the neutralisation factor η in two cases with and without clearing electrodes. The contribution to the neutralisation factor η from the different species is shown in colour and the full neutralisation factor is in black. At the time t = 0 ms and t = 20 ms, the neutralisation factor η increases as ions are produced by ionisation. After t = 20 ms, the neutralisation factor η drops because the clearing gap mixes-up ion positions leading to unstable ion motion and their eventual losses once the beam is back. It is this effect which produces the oscillations of the neutralisation factor η in Fig. 9.7. The effect of the gap is partly balanced by the new ions produced so that after two cycles at t = 40 ms the total number of ions has increased. After some cycles, a dynamic equilibrium is reached when the new ions compensate the ions cleared by the gap.

In the case with clearing electrodes on, the neutralisation factor η reach 1 • 10 -3 . The trapped ion composition is 56 % of H + 2 ions, 27% of CO + ions, 8 % of C + ions, 6 % of O + ions and the remaining charge is distributed along the species. As shown in section 9.1.3, the low maximum neutralisation factor reached limits multi-ionisations (and dissociations) so nearly 85 % of the ion charge is due to ion directly ionised from residual vacuum molecules.

In the case with clearing electrodes off, the neutralisation factor η reach 6 • 10 -3 . In that case, the maximum neutralisation factor is 6 times bigger than the case with clearing electrodes so multiionisations and dissociations are more important. The trapped ion composition is 25 % of H + 2 ions, 11% of CO + ions, 20 % of C + ions, 26 % of O + ions, 6 % of C 2+ ions and the remaining charge is distributed along the species. Here the ions produced by dissociations and multi-ionisations are responsible for 64 % of the total neutralisation factor so even at the neutralisation factor as low as η ≈ 6 • 10 -3 , these processes are not negligible.

These results differs from the results shown in Fig. 9.5 for several reasons. In Fig. 9.5, most of the ions produced are H + 2 or H + ions. But the H + ions are very weakly trapped in ThomX as the critical mass is near or above 1 in most of the ring, see Fig. 7.6. In fact, the simulation done for H + shows that this species is only trapped in the straight sections of the ring. So most the H + ions produced are lost immediately, this translates into a sharp drop of the clearing coefficient to = 0.2 in the uniform case and to = 0 (no ion trapped) after a clearing gap. As this analysis take into account this effect, the amount of H + 2 ions is limited by its dissociation into H + ions which are quickly lost.

Local neutralisation factor and induced tune shift

The neutralisation factor η = n i ne , in this case the average neutralisation factor, is usually defined as the ratio of the trapped charge to the stored charge. But the neutralisation is not homogeneous along the ring longitudinal position s and it is possible to define a local neutralisation factor whose mean would be equal to the neutralisation factor η. We use the definition of Baconnier given by [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF]:

η(s) = L n e dn i ds , (9.20)
Where L is the machine circumference, dn i ds is the local trapped ion density expressed in Coulomb per meter. It is possible to derive the expected tune shift from the ion cloud effect by using the equivalent quadrupole method. The force that the ion cloud applies on the electrons is identified to an equivalent quadrupole, this is used to derive the tune shift and tune spread. Depending on the assumptions done on the distribution of the ions several expressions are derived.

Cylindrical distribution

A cylindrical distribution with homogeneous transverse charge distribution is assumed for the trapped ions. The linear particle density is given by: The electric field produced by an infinitely long cylinder of constant linear charge density λ and radius r 0 is:

λ i = ηn e L . ( 9
E(r) = λr 2π 0 r 0 2 , r ≤ r 0 . (9.22) E(r) = λ 2π 0 r , r ≥ r 0 . (9.23)
The expression of the electric field produced by a constant linear charge density is extended to variable linear charge density, it is assumed that the change in the expression of the field is negligible. So the electric field inside the ion cylinder of transverse size r 0 is given by:

E(r, s) = eλ i (s)r 2π 0 r 0 2 . (9.24)
The force applied on an electron moving around the ring and with r < r 0 is:

F (r, s) = - e 2 λ i (s)r 2π 0 r 0 2 = - e 2 r 2π 0 η(s)n e Lr 0 2 . (9.25)
If this force is considered as an equivalent quadrupole:

k(s) = - 1 E dF dr = e 2 2π 0 E η(s)n e Lr 0 2 = 2r e γ η(s)n e Lr 0 2 . ( 9.26)
If the electron transverse amplitude is smaller than r 0 (not exact in the general case) then the tune shift is given by: ∆Q x = 1 4π

Gaussian distribution

A Gaussian distribution is now assumed for the transverse distribution of the trapped ions, here σ x and σ y represent the transverse size of the ion distribution. The ion linear particle density is given by:

λ i = ηn e L . (9.28)
At the first order, the electric field generated by a Gaussian transverse distribution of trapped ions is given in Eq. (7.72). So the derivative of the force felt by the electrons from the ions, for the horizontal plane, is:

dF dx = - e 2 2π 0 λ i σ x (σ x + σ y ) (9.29)
If this force is considered as an equivalent quadrupole: The equivalent quadrupole is then given by: k(s) = 2r e γL ηn e σ x (σ x + σ y ) (9.32)

k(s) = - 1 E dF dx = e 2 2π 0 E λ i σ x (σ x + σ y ) = e 2 2π 0 EL ηn e σ x (σ x + σ y ) ( 9
So the tune shift is given by:

∆Q x = 1 4π L 0 β x (s)k(s)ds = r e n e 2πγL L 0 β x η σ x (σ x + σ y ) ds (9.33)
As shown in section 7.2.4, in reality the distribution of trapped ions is not Gaussian but has it own distribution different from the transverse electron distribution. But it has been shown that a good approximation of this distribution is a Gaussian distribution of standard deviation σ i = σe √ 2

[117] [START_REF] Wang | Suppression of beam-ion instability in electron rings with multibunch train beam fillings[END_REF]. Using this approximation, Eq.(9.33) can be expressed using the electron transverse beam sizes σ xe and σ ye :

∆Q x = r e n e 4πγL L 0 β x η σ xe (σ xe + σ ye ) ds (9.34)

Estimation of the tune shift

Using NUAGE and the post-analysis, it is possible to obtain the local neutralisation factor from the simulation results. The ion equilibrium state (after a clearing gap) obtained via NUAGE simulation is renormalised with the neutralisation values computed with the post-analysis to compute the local neutralisation factor for each species. Figure 9.8 shows the local neutralisation factor with and without clearing electrodes.

Table 9.3 shows the tune shift for both cases using the Gaussian approximation, Eq. (9.34). The bar over the quantities, like in ∆Q x , indicates that the quantity was computed using mean values, like it is usually done when the local neutralisation factor η(s) is unknown, instead of computing the integral. There is a factor 5 to 10 in difference between the tune shift computed using local values ∆Q x,y and the tune shift computed using mean values ∆Q x,y , in this case using mean values tends to minimise the resulting tune shift. As it can be seen on Fig. 9.8, the ions are not equally distributed along the ring and most of them are around s = 2 m, s = 7 m, s = 11 m and s = 16 m. At these points the beam is small (σ x ≈ σ y ≈ 0.4 mm) and the vertical beta function is bigger than the horizontal one (β x ≈ 1 m, β y ≈ 5 m), see optics on Fig 2 .5. The difference between the local values and the mean values arises from the fact that most of the ions are at a location where the beam size is smaller than the mean beam size. The tune shift is more important in the vertical direction because the vertical beta function β y is more important than horizontal one β x at the ion location.

The value ∆Q x,y is also an estimation of the tune spread produced by ions [START_REF] Baconnier | Neutralisation of accelerator beams by ionisation of the residual gas[END_REF]. The fields created by the ion transverse equilibrium distribution are strongly non-linear and will affect Chapter 10

General conclusion

This thesis has presented a study of collective effects in the storage ring of the ThomX Compton backscattering X-ray source. During this work, the beam dynamics in ThomX has been shown to be very different from the beam dynamics in usual electron synchrotrons. Indeed, due to the injection in the storage ring without longitudinal matching and strong coherent synchrotron radiation (CSR) effects, a transient microbunching regime is triggered at injection. The mechanism leading to this regime is the same one as the microbunching instability. An electron bunch with an initial density modulation induces the emission of CSR, bringing in turn a stronger longitudinal modulation and so on. This regime, which lasts for about 1 ms out of the 20 ms of total storage time, stops when the bunch has filled the RF bucket via filamentation of the longitudinal phase space. As in ThomX, the damping times are long compared to the storage time, it is crucial to succeed to keep both a high charge and low transverse emittances in this regime to deliver the expected X-ray flux. After the transient regime, the matched beam is still sensible to collective effects. In particular to the ion cloud, produced by the ionisation of the residual gas, which can degrade beam properties and induce instabilities. This thesis has been organised in two parts. The first one deals with the design of a longitudinal impedance model including the geometric, resistive wall and CSR wakefields for ThomX storage ring in order to study the beam dynamics in the transient micro-bunching regime. The second part concerns the study of the ion cloud trapped by the electron beam and the mitigations to use to prevent beam degradation by ions.

Impedance models and beam dynamics during the transient microbunching regime in ThomX

To determine the geometric and resistive wall impedance model, several methods have been used to cross check the results. The model designed is based on CST simulations of every elements of the storage ring. Then the coaxial wire method has been used to measure prototypes of the storage ring elements to check the simulations. A precise evaluation of the different error sources of these measurements has been done and highlights the important uncertainty of this type of measurements. Nevertheless, the measurements have allowed to validate the simulations. As the simulation of the kicker impedance was not possible, because of very thin coatings, an analytical model, the multi-layered cylindrical chamber, has been used to evaluate the kicker impedance. The total impedance budget has been presented, corresponding to a loss factor of k ,T = 6.73 V pC -1 for a Gaussian bunch of σ = 2 mm. To this value, the RF cavity and its tapers contribute for 47 %, the septum chamber for 17 %, the kickers for 12 % and the rest is distributed among the other components of ThomX storage ring. Then, the method used in this thesis to link the impedance model to the beam dynamics simulations has been presented: the extraction of a pseudo wake function via deconvolution.

The CSR impedance model has been obtained by simulation of the beam in a rectangular vacuum chamber. It has allowed to take into account transient effects, due to straight sections in between dipoles, and resonances, due to reflections on the beam pipe, using the CSRZ code. The result has been compared with analytical models, the free space CSR and the parallel plate CSR, and has shown the importance of the transient effects and resonances in ThomX dipoles. The interference between the CSR emitted in each dipoles has also been investigated.

Using the impedance models developed in this thesis, the beam dynamics in the transient microbunching regime has been simulated using the CODAL tracking code. The upgrade of the CODAL code has been presented including new collective effect routines and the addition of parallel computing. Then, start to end simulations, from the photoinjector to the storage ring, have been presented (using ASTRA and CODAL). In the transfer line, the horizontal projected emittance growth at high charge due to the CSR has been highlighted. In the storage ring, the transient microbunching regime has been presented at low charge and at high charge. The mechanism leading to the splitting of the bunch in several coherent micro-bunches, due to the combined effect of the longitudinal mismatch and of the CSR, has been detailed. The filamentation of the micro-bunches in the longitudinal phase space slowly fills the RF bucket and stops the microbunching regime. At low charge, both the transverse emittance and the beam charge is conserved during this regime. At high charge, the strong CSR induces fast losses, in about 0.6 µs, of the coherent part of the injected bunch due to a too large energy deviation. These fast losses have been mitigated by an increase of the synchrotron frequency, which has been managed by an increase of the RF voltage and by using alternative optics with a higher first order of the momentum compaction factor. When a high charge is kept at injection, thanks to the mitigations, the micro-bunches are lost during the filamentation due to the growth of their individual synchrotron oscillation amplitude leading them to too large energy deviation. Further studies will be needed to better understand and to mitigate the micro-bunch loss at high charge.

The works presented in this part could be extended and refined in many directions. The geometric and resistive wall impedance model is currently being extended to cover the transverse impedance. Measurements of the kickers and of the septum chamber could be interesting to check if the measurements agree with their estimated impedance in this model. The effect on the beam dynamics of the different CSR impedance models presented in this thesis could be observed in simulations. This would allow to see the difference brought by the different models on the transient microbunching regime. In addition to this, there are still many efforts needed, both in simulation and afterwards during ThomX commissioning, to better understand ThomX particular beam dynamics.

Ion cloud dynamics and mitigations in ThomX

The matter of ion cloud dynamics and mitigations has been investigated using a "strongweak" model in which the electron beam does not feel the effect from the ion cloud. The model is based on the Bassetti-Erskine formula for the transverse dynamics and on the Sagan formula for the longitudinal dynamics, which have been demonstrated from first principles. The consequences of this model for the ion trapping in ThomX have been presented while stressing the links between the lattice design and the ion dynamics. It is the optics, and the beam parameters, which determines the ion behaviour inside the accelerator. The ion accumulation point, resulting from the longitudinal beam-ion interaction, positioning has been shown to depend on the relative contribution of the three terms of Sagan equation. In ThomX, the ion accumulation points are mostly close to the minimum of the dispersion function, contrary to the usual case where they are close to the minimum of the betatron function. The ion trapping in the magnetic fields of dipole magnets, due to the magnetic mirror effect, which can modify accumulation points has also been investigated.

The NUAGE code, a novel code for ion cloud tracking has been developed. It is quite unique in its features as it allows to simulate the transverse and longitudinal ion cloud dynamics with clearing electrodes and clearing gaps and also takes into account the effect of magnetic fields. Different benchmark of NUAGE have been presented. Simulations of the ion dynamics in ThomX have allowed to obtain the ion equilibrium longitudinal distribution. The ion accumulation has been shown to increase by 25 % for H + 2 ions because of trapping in magnetic fields. The knowledge of the accumulation points along the accelerator is crucial to properly position clearing electrodes in order to maximise the clearing efficiency. In ThomX, the clearing electrodes are integrated in BPMs, as additional electrodes, in order no to increase the machine impedance. Depending on the design of the clearing electrodes, it is possible to create artificial longitudinal accumulation points at the electrode location in order to optimise the clearing. The mechanism behind clearing gaps has been highlighted by simulations. The good synergy between the two mitigations have been demonstrated in simulations, the clearing gaps provide the ions with an increased mobility which brings more ions to the clearing electrodes.

The ion production, the ion dissociation and the multi-ionisation have been studied using differential equation systems with an artificial limitation on the ion accumulation. What has been found is that, the effect of the ion dissociation and of the multi-ionisation are more and more important as the neutralisation factor increases. Then using the same multi-ionisation model in conjunction with the NUAGE simulation results, the evolution of the neutralisation factor η in ThomX has been computed. Thanks to the simulations, it has been possible to optimise the ion cloud mitigation techniques and to minimise the neutralisation factor η. With clearing electrodes and the 4 µs clearing gaps, η ≈ 10 -3 , and with the clearing gaps only the neutralisation factor grows up to η ≈ 6 • 10 -3 . When η ≈ 10 -3 , the ion dissociation and the multi-ionisation are responsible for only 15 % of this value, but when η ≈ 6 • 10 -3 , these processes are not negligible as they account for 64 % of the total value. The neutralisation factors found, with or without the clearing electrodes, are well below the instability threshold of the classical ion trapping instability (CIT), which is around 10 -1 or more [START_REF] Nagaoka | Ions[END_REF]. This also confirms that, in Chapter 10. General conclusion ThomX case, the residual ion dynamics are far from being coupled with the electron beam dynamics and that the "strong-weak" approximation used here is justified. The local neutralisation factor has also been computed from the simulation results. It has allowed to estimated ion-induced tune shift (and tune spread), which is around 10 -4 with clearing electrodes and around 8 • 10 -4 without clearing electrodes.

This study also opens the door for future precise ion accumulation measurements on ThomX. As the measured tune shift due to ions depends on the local neutralisation factor, it should be possible to measure the tune shift in different configurations (with and without clearing electrodes, with variable clearing gap duration) and to compare the results with the estimated tune shift from this study. Also, as ion accumulation points are partly determined by the optic design, by changing the lattice it should be possible to study the ion longitudinal dynamics.

A.2. Lorentz force in the curvilinear frame time. The expression Eq. A.5 is obtained from Eq. A.2 -Eq. A.4. An important conclusion is that the longitudinal component of velocity v s is not equal to the derivative of the s coordinate with respect to time:

v s = ṡ, ṡ = v s 1 -hx . (A.6)
The acceleration vector of the particle is equal to the derivative of the velocity vector with respect to time:

A.2 Lorentz force in the curvilinear frame

In this section, the expression for the acceleration of a particle by the Lorentz force in the curvilinear frame is derived. Let us consider a general magnetic field with the components B i , a particle of charge q, and of mass m. Since unit vectors x, y, and s are orthogonal to each other, the expression for the vector product in the considered curvilinear frame is the same as in any ordinary Cartesian frame:

¨ r = q m x y s v x v y v s B x B y B s = q m    v y B s -v s B y v s B x -v x B s v x B y -v y B x    . (A.8)
By using the expressions for the acceleration vector component, Eq. A.7, and the left hand side of Eq. A.8, we get the system: to n°4 correspond to classic clearing fields where the ions would be sent toward the wall of the beam pipe, with an horizontal kick for configurations n°3 and n°4 and with a vertical kick for configurations n°1 and n°2. Configurations n°5 and n°6 create longitudinal electric fields which correspond to an accumulation point for configuration n°5 and an expulsion point for configuration n°6. Configurations n°7 and n°8 have no effect on the cavity center because of symmetry.

               vx + v s h ṡ correction = v y q m B s -v s q m B y , vy = v s q m B x -v x q m B s , vs -v x h ṡ correction = v x q m B y -v y q m B x .
Electric field maps in the transverse plane of the BPM 8 are shown in Fig. B.5 for configuration n°1, n°3, n°6 and n°7. In configuration n°1 the field arrows come from the positive electrodes on top to the negative electrode on bottom producing a vertical electrical field. In configuration n°3 the field created is horizontal as the field comes from the positive electrodes on the left to the negative electrodes to the right. For both configurations n°1 and n°3, two points of zero field are created respectively in the vertical axis and in the horizontal axis but should not be a problem for ion clearing as they are located far from the beam. Configurations n°2 and n°4 are the same as n°1 and n°3 but with inverted polarities.

The configuration n°6 has zero field in the cavity center, meaning probably a reduced impact on ion clearing, but strong transverse fields directed toward the electrodes. The configuration n°5 has a field zero in the longitudinal axis but the transverse field created are directed toward the B.3. IP and IP bis cavity center. Configurations n°7 has a field zero in the cavity center and the field arrows come from the positive electrodes in position n°1 and n°3 to reach negative electrodes in positions n°2 and n°4. Configuration n°8 is the same as n°7 but with inverted polarities.

B.3 IP and IP bis

Résumé Résumé vulgarisé

Les accélérateurs de particules sont des instruments qui utilisent des champs électriques et magnétiques pour guider et accélérer des particules électriquement chargées à des vitesses proches de celle de la lumière. Les particules accélérées peuvent être de nature diverse, comme des protons ou des électrons (les particules composant les atomes qui forment la matière qui nous entoure), ou des ions (des atomes ayant perdu ou gagné un ou plusieurs électrons). Plus de 35 000 accélérateurs ont été construit dans le monde depuis un siècle, la très grande majorité des accélérateurs existants sont des machines de petite taille conçues pour des applications industrielles ou médicales. Les applications industrielles des accélérateurs sont très variées. Ils sont par exemple utilisés pour souder, machiner ou traiter des métaux avec une grande précision, pour activer des réactions de polymérisation dans divers plastiques dans les industries automobiles et aéronautiques, pour implanter des ions dans des matériaux semi-conducteurs dans l'électronique ou encore pour stériliser des appareils médicaux ou des fruits et légumes. Les accélérateurs sont aussi de plus en plus utilisés dans le milieu médical, que ce soit pour l'imagerie médicale ou pour des traitements type radiothérapie avec différents types de faisceaux.

Parmi les accélérateurs existants, une centaine seulement sont de très grosses machines construites par des organisations nationales ou supranationales. Ces accélérateurs sont des instruments de recherche qui sont utilisés dans plusieurs buts. Afin d'étudier la matière, en physique des particules ou nucléaire, certains accélérateurs sont construits pour produire des collisions entre particules. Dans ces machines, les particules sont rapidement accélérées à des vitesses dites relativistes, c'est à dire à des vitesses proches de celle de la lumière. Lorsqu'une particule accélère pour devenir relativiste, elle se comporte comme si sa masse devenait de plus en plus importante. En réalité, lors de son accélération, cette particule va stocker de plus en plus d'énergie sous forme d'énergie cinétique. Lors d'un choc contre une cible fixe ou contre une autre particule, l'énergie disponible sous forme d'énergie cinétique peut être utilisée pour produire de nouvelles particules plus massives. Ce type d'accélérateur, appelé collisionneur, a permis de découvrir de nombreuses nouvelles particules. Par exemple, le grand collisionneur de hadrons (LHC) du CERN, une machine circulaire de 27 km de circonférence, a confirmé l'existence du boson de Higgs en 2012. D'autres accélérateurs, appelés sources de lumière, ont pour but la production de rayons X. Un rayon X est une radiation électromagnétique, au même titre que la lumière mais non visible à l'oeil nu, qui permet de sonder la matière à l'échelle atomique. Ces rayons X sont produits par le rayonnement naturel des électrons, appelé rayonnement synchrotron, lorsque ceux-ci ont une trajectoire courbe. Des paquets d'électrons sont alors stockés dans des accélérateurs circulaires spécialement optimisés pour la production de rayons X. Le synchrotron SOLEIL, située sur le plateau de Saclay, est la source de lumière nationale française et produit des rayons X pour des applications en physique, chimie, sciences des matériaux et du vivant.

Le nombre croissant d'accélérateurs et la recherche de performances toujours meilleures ont conduit au développement d'une physique spécifique aux accélérateurs de particules et au développement des technologies associées. Cette thèse s'inscrit dans cette démarche et présente des études sur les effets physiques entrant en jeu lorsqu'on augmente l'intensité du faisceau de particules. Plus particulièrement, cette thèse s'intéresse aux "effets collectifs", c'est à dire aux phénomènes qui émergent lorsqu'on prend en compte l'interaction des particules entre elles et avec leur environnement. Le cadre de cette thèse est aussi particulièrement innovant car il s'agit d'étudier ces effets pour l'accélérateur ThomX. Le projet ThomX a pour but de construire une source compacte de rayons X à moindre coût en utilisant l'interaction Compton inverse. Les rayons X seront produits par interaction Compton inverse entre un faisceau d'électrons et un laser, ce qui permet de transférer l'énergie d'électrons accélérés aux photons du laser.

Dans une première partie, cette thèse présente la conception d'un modèle prenant en compte l'interaction du faisceau avec la chambre à vide de l'accélérateur. Ce modèle est basé sur des simulations électromagnétiques et vérifié par des mesures radiofréquences. Le modèle développé est ensuite utilisé pour simuler la dynamique des électrons à l'intérieur de l'accélérateur et optimiser les performances de la machine. Cette thèse a permis de mettre en évidence un nouveau régime de dynamique faisceau spécifique à ThomX, appelé régime de micro-paquet transitoire.

La seconde partie de la thèse concerne l'étude des ions résiduels produits par l'interaction du faisceau d'électrons avec les molécules de gaz résiduel dans la chambre à vide. Ces ions, de charge électrique positive, peuvent être piégés par le faisceau d'électrons, de charge électrique négative, et perturber la propagation du faisceau d'électrons. Cette thèse présente la dynamique des ions dans ThomX à travers des modèles analytiques et des simulations. La connaissance de la dynamique des ions est par la suite utilisée pour concevoir des contre mesures permettant de limiter les effets négatifs des ions sur le faisceau d'électron.

Conclusions scientifiques générales

Cette thèse présente une étude des effets collectifs dans l'anneau de stockage de la source de rayons X par rétrodiffusion Compton ThomX. Au cours de ce travail, il a été démontré que la dynamique faisceau dans ThomX était très différente de la dynamique faisceau dans les synchrotrons classique. En effet, en raison des effets de l'injection dans l'anneau de stockage sans adaptation longitudinale et du rayonnement synchrotron cohérent (CSR), un régime micro-paquet transitoire est déclenché lors de l'injection. Le mécanisme conduisant à ce régime est le même que celui de l'instabilité micro-paquet classique. Un paquet d'électrons avec une modulation de densité initiale induit l'émission de CSR, ce qui entraîne une modulation longitudinale plus forte, etc. Ce régime, qui dure environ 1 ms par rapport à un temps de stockage total de 20 ms, s'arrête lorsque le paquet a rempli le seau RF via la filamentation de l'espace des phases longitudinal. Comme dans ThomX, les temps d'amortissement sont longs par rapport au temps de stockage, il est essentiel de réussir à conserver à la fois une charge élevée et des émittances transverses faibles dans ce régime afin de fournir le flux de rayons X attendu. Après le régime transitoire, le faisceau adapté est toujours sensible aux effets collectifs. En particulier le nuage d'ions produit par l'ionisation du gaz résiduel peut dégrader les propriétés du faisceau et provoquer des instabilités. les ions.

Pour déterminer le modèle d'impédance géométrique et résistif, plusieurs méthodes ont été utilisées pour confirmer les résultats. Le modèle conçu est basé sur des simulations CST de tous les éléments de l'anneau de stockage. Ensuite, la méthode du câble coaxial a été utilisée pour mesurer les prototypes des éléments de l'anneau de stockage afin de vérifier les simulations. Une évaluation précise des différentes sources d'erreur de ces mesures a été effectuée et met en évidence l'incertitude importante de ce type de mesures. Néanmoins, les mesures ont permis de valider les simulations. La simulation de l'impédance du kicker n'étant pas possible en raison de la très grande minceur des revêtements, un modèle analytique, la chambre cylindrique multicouche, a été utilisé pour évaluer l'impédance du kicker. Le budget total d'impédance a été présenté, ce qui correspond à un facteur de perte de k ,T = 6.73 V pC -1 pour un paquet gaussien de σ = 2 mm. La cavité RF et ses tapers contribuent pour 47 %, la chambre du septum pour 17 %, les kickers pour 12 % et le reste est réparti entre les autres composants de l'anneau de stockage. La méthode utilisée dans cette thèse pour relier le modèle d'impédance aux simulations de dynamique faisceau a été présentée : l'extraction d'une fonction de pseudo-champ de sillage via une déconvolution.

Le modèle d'impédance CSR a été obtenu par simulation du faisceau dans une chambre à vide rectangulaire. Cela a permis de prendre en compte les effets transitoires, dus aux sections droites entre les dipôles, et les résonances, dues aux réflexions sur la chambre à vide du faisceau, en utilisant le code CSRZ. Le résultat a été comparé aux modèles analytiques, le CSR en espace libre et le CSR entre plaques parallèles, et a montré l'importance des effets transitoires et des résonances dans les dipôles de ThomX. L'interférence entre le CSR émis dans chaque dipôle a également été étudié.

En utilisant les modèles d'impédance développés dans cette thèse, la dynamique faisceau dans le régime transitoire de micro-paquet a été simulée à l'aide du code CODAL. La mise à niveau du code CODAL a été présentée, y compris les nouvelles routines d'effets collectifs et l'ajout du calcul parallèle. Ensuite, les simulations du début à la fin de l'accélérateur, du photo-injecteur à l'anneau de stockage, ont été présentées (avec ASTRA et CODAL). Concernant la ligne de transfert, la croissance de l'émittance horizontale projetée à forte charge due au CSR a été mise en évidence. Dans l'anneau de stockage, le régime transitoire de micro-paquet a été présenté à charge faible et à charge élevée. Le mécanisme conduisant à la division du paquet en plusieurs micro-paquets cohérents, en raison de l'effet combiné de la désadaptation et du CSR, a été détaillé. La filamentation des micro-paquets dans l'espace des phases longitudinal remplit lentement le seau RF et arrête le régime de micro-paquet. À faible charge, l'émittance transverse et la charge du faisceau sont conservées pendant ce régime. À forte charge, le fort CSR induit la perte rapide, en environ 0.6 µs, de la partie cohérente du paquet injectée en raison d'un trop grand écart d'énergie.

Ces pertes rapides ont été atténuées par une augmentation de la fréquence synchrotronique générée par une augmentation de la tension RF et par l'utilisation d'une optique alternative avec un facteur de compression des moments du premier ordre plus élevé. Lorsqu'une charge élevée est maintenue à l'injection, grâce aux contre mesures, les micro-paquets sont perdues au cours de la filamentation en raison de la croissance de l'amplitude de leurs oscillations synchrotroniques individuelles, ce qui conduit à une déviation d'énergie trop importante. Des études complémentaires seront nécessaires pour mieux comprendre et atténuer la perte de micro-paquets à forte charge.

Le problème de la dynamique des nuages ioniques et des contre mesures a été étudiée à l'aide d'un modèle "fort-faible" dans lequel le faisceau d'électrons ne ressent pas l'effet du nuage d'ions. Le modèle est basé sur la formule de Bassetti-Erskine pour la dynamique transversale et sur la formule de Sagan pour la dynamique longitudinale, qui ont été redémontrées à partir des premiers principes. Les conséquences de ce modèle pour le piégeage des ions dans ThomX ont été présentées tout en soulignant les liens entre la conception de la maille de l'accélérateur et la dynamique des ions. C'est l'optique et les paramètres du faisceau qui déterminent le comportement des ions à l'intérieur de l'accélérateur. Les points d'accumulation d'ions, résultant de l'interaction longitudinale faisceau-ion, dépendent de la contribution relative des trois termes de l'équation de Sagan. Dans ThomX, l'accumulation d'ions est généralement proche du minimum de la fonction de dispersion, contrairement au cas habituel où ils sont proches du minimum de la fonction bêtatron. Le piégeage des ions dans les champs magnétiques des aimants dipolaires, en raison de l'effet de miroir magnétique, peut modifier les points d'accumulation et a également été étudié.

Le code NUAGE, un nouveau code pour la simulation des nuages d'ions a été mis au point. Il est unique dans ses fonctionnalités car il permet de simuler la dynamique transverse et longitudinale des nuages d'ions en considérant l'effet d'électrodes de nettoyage et d'espaces de nettoyage. Il prend également en compte l'effet de champs magnétiques. Différents tests de NUAGE ont été présentés. Des simulations de la dynamique des ions dans ThomX ont permis d'obtenir la distribution longitudinale à l'équilibre des ions. Il a été démontré que l'accumulation d'ions augmente de 25% pour les ions H + 2 en raison du piégeage dans des champs magnétiques. La connaissance des points d'accumulation le long de l'accélérateur est cruciale pour positionner correctement les électrodes de nettoyage afin de maximiser l'efficacité du nettoyage. Dans ThomX, les électrodes de nettoyage sont intégrées dans les BPM, en tant qu'électrodes supplémentaires, afin de ne pas augmenter l'impédance de la machine. En fonction de la conception des électrodes de nettoyage, il est possible de créer des points d'accumulation artificiels longitudinaux à l'emplacement de l'électrode afin d'optimiser le nettoyage. Le mécanisme derrière les espaces de nettoyage a été mis en évidence par des simulations. La bonne synergie entre les deux contre mesures a été démontrée lors de simulations. Les intervalles de nettoyage donnent aux ions une mobilité accrue, ce qui amène davantage d'ions aux électrodes de nettoyage.

La production d'ions, la dissociation des ions et la multi-ionisation ont été étudiés à l'aide de systèmes d'équations différentielles avec une limitation artificielle de l'accumulation d'ions. Ce qui ressort de ces études, c'est que l'effet de la dissociation des ions et de la multi-ionisation est de plus en plus important à mesure que le facteur de neutralisation augmente. Puis, en utilisant le même modèle de multi-ionisation en conjonction avec les résultats de simulation NUAGE, l'évolution du facteur de neutralisation η dans ThomX a été calculée. Grâce aux simulations, il a été possible d'optimiser les techniques de limitation du nuage d'ions et de minimiser le facteur de neutralisation η. Avec les électrodes de nettoyage et un espace de nettoyage de 4 µs, on a η ≈ 10 -3 , et en utilisant uniquement des espaces de nettoyage, le facteur de neutralisation augmente jusqu'à η ≈ 6 • 10 -3 . Lorsque η ≈ 10 -3 , la dissociation des ions et la multi-ionisation ne sont responsables que de 15 % de cette valeur, mais lorsque η ≈ 6 • 10 -3 , ces processus ne sont pas négligeables car ils représentent 64 % de la valeur totale. Les facteurs de neutralisation trouvés, avec ou sans électrodes de nettoyage, sont bien en dessous du seuil d'instabilité de l'instabilité classique par piégeage des ions (CIT), qui correspond environ à η ≈ 10 -1 ou plus. Cela confirme également que, dans le cas ThomX, la dynamique des ions résiduels est loin d'être couplée à la dynamique du faisceau d'électrons et que l'approximation "fort-faible" utilisée ici est justifiée. Le facteur de neutralisation local a également été calculé à partir des résultats de la simulation. Cela a permis d'estimer le décalage (et la diffusion) du nombre d'onde, qui correspond environ à 10 -4 avec les électrodes de nettoyage et à 8 • 10 -4 sans les électrodes de nettoyage. The thesis is focused on the study of collective effects in a 50 MeV electron storage ring, ThomX, in the absence of synchrotron radiation damping and of longitudinal matching. This thesis is divided in two distinct parts. The first part corresponds to the design of the impedance model (geometric and resistive wakefields, coherent synchrotron radiation) of the storage ring in order to simulate the beam dynamics. The geometric impedance model of the storage ring was obtained via simulation of the individual elements and was checked using wire measurements on prototypes. The coherent synchrotron radiation was simulated taking into account a rectangular vacuum chamber. Beam dynamics simulations, from the RF gun cathode to the storage ring, including collective effects are presented. The simulations are used to optimise the beam dynamics in the storage ring in the micro-bunching regime. The second part is the study of the ion cloud produced by the ionisation of the residual vacuum molecules and the optimisation of the ion clearing techniques. The longitudinal ion accumulation points and the trapping in magnetic fields are both studied analytically and by using a tracking code developed for this purpose. Clearing electrodes and clearing gaps are simulated and optimised using this code and the strategy chosen for the limitation of ion induced effects is described. Finally, the effect of multi-ionisation and ion dissociation is taken into account and the ion effect on the electron beam is estimated.

Universit é Paris-Saclay

Espace Technologique / Immeuble Discovery Route de l'Orme aux Merisiers RD 128 / 91190 Saint-Aubin, France

Figure 1 . 1 :

 11 Figure 1.1: Evolution of the normalised a) energy spread and b) emittance c) X-ray flux versus time. Solid line: IBS and CBS are considered, dotted line: only CBS, dashed line: only IBS. Each quantity is normalised to its value at injection. Parameters: geometric emittance x,0 = 5 • 10 -8 m rad, energy spread σ e,0 = 0.3 %, charge Q = 1 nC. Figure from [19].

Figure 2 . 1 :

 21 Figure 2.1: ThomX layout, figure modified from [24].

Figure 2 .

 2 Figure 2.1 shows the general layout of the machine. 5 MeV electrons bunches of at least 1 nC

2. 1

 1 Photoinjector, linac, transfer and extraction lines In this section, the photoinjector, linac, transfer line (TL) and extraction line (EL) are presented. A more detailed view of these parts of ThomX is shown in Fig. 2.2.

Figure 2 . 2 :

 22 Figure 2.2: Top and 3D view of the photoinjector, linac, transfer and extractions lines. Dipole magnets (D) are shown in red and quadrupole magnets (Q) in blue and green. (1): photoinjector, (2): linac, (3) & (9): beam dump, (4) & (6): diagnostic station, (5): beam scraper, (7): injection dipole, (8): extraction dipole.

Figure 2 . 3 :

 23 Figure 2.3: Typical optical functions of the ThomX transfer line (TL) lattice for a 1 nC bunch. Top: the horizontal betatron function β x is plotted in red, the vertical betatron function β y in blue and the horizontal dispersion η times 20 is plotted in green. Bottom: this plot is a synopsis of the TL elements. Focusing quadrupoles are represented in blue, defocusing quadrupoles are represented in red and dipoles in yellow.

Figure 2 . 4 :

 24 Figure 2.4: Top and 3D view of the storage ring. Dipole magnets (D) are shown in red and quadrupole magnets (Q) in blue and sextupole magnets (S) in yellow. (1): kicker magnets, (2): setpum, (3): interaction point (IP), (4): Fabry-Perot cavity, (5): RF cavity, (6): transverse feedback kicker, (7): virtual interaction point (IP bis).

Figure 2 . 5 :

 25 Figure 2.5: Optical functions of the ThomX storage ring lattice. Top: the horizontal betatron function β x is plotted in red, the vertical betatron function β y in blue and the horizontal dispersion η times 20 is plotted in green. Middle: this plot is a synopsis of the ring elements. Focusing quadrupoles are represented in blue, defocusing quadrupoles are represented in red and dipoles in yellow. Focusing sextupoles are shown in green and defocusing sextupoles in pink. Bottom: the horizontal rms beam size σ x in plotted in red and the vertical rms beam size σ y is in blue using parameters from Table 2.3.

Fig 3 . 1 . 1 √ 1 -

 3111 This phenomenon is a relativistic effect which increases the field in the sidewise direction by a factor γ, with γ = v 2 /c 2 the particle Lorentz factor. In the ultra-relativistic limit, v = c, the field lines become strictly perpendicular to the direction of motion and form a Dirac δ distribution in the transverse plane, as in (c) of Fig 3.1.

Figure 3 . 1 :

 31 Figure 3.1: Electric E (in black) and magnetic B (in blue) field lines created by a: non-relativistic (a), relativistic (b), ultra-relativistic (c) charged particle in free space.

Figure 3 . 2 :

 32 Figure 3.2: Coulomb repulsion and magnetic attraction between two particles of equal charge.The graph shows the evolution of the Lorentz force normalised by the Lorentz factor γ in pink (Total) and its two components the Coulomb force in purple and the magnetic force in green (both normalised by γ) versus β. Figure from[START_REF] Schindl | CAS -CERN accelerator school: intermediate course on accelerator physics[END_REF]

Figure 3 . 3 :

 33 Figure 3.3: Electric field E lines (in black) created by an ultra-relativistic charged particle (a), beam (b) moving on axis of a perfectly conducting vacuum chamber. Charges are represented by red surfaces while image charges created on the walls are shown with red outlines, figure inspired by [42].

3

 3

  .4 and continue to propagate after the bunch is gone as shown in (c) of Fig. 3.4.

Figure 3 . 4 :

 34 Figure 3.4: Simulation of the electromagnetic fields generated by a Gaussian ultra-relativistic bunch going trough a perfectly conducting step-out transition with a = 10 mm and b = 30 mm. The amplitude of the electric field is shown in logarithmic colour scale. Picture (a) is taken 0.25 ns after the bunch is injected into the step-out, picture (b) and (c) 0.4 ns and 0.7 ns after.

Figure 3 . 6 :

 36 Figure 3.6: Effect of a coherent energy spread induced in a dipole by CSR. Each bunch slice feels different CSR kicks which induce an offset of the slice centroid in the horizontal direction and a change in the betatron motion. As a result, the projected emittance is increased because of the slice misalignment in the horizontal phase space.

Figure 3 . 7 :

 37 Figure 3.7: Schematic of the source particle (S) which radiates electromagnetic field and of the test particle (T) which is feel a momentum change ∆ p because of it.

Figure 3 . 8 :

 38 Figure 3.8: Broad band longitudinal impedance in red and narrow band longitudinal impedance in blue. The plain lines show the real part of the impedance and the dotted lines the imaginary one. Resonator parameters for the broad band impedance: R s = 100 Ω, Q r = 1 and f r = ω r /2π = 10 GHz. Resonator parameters for the narrow band impedance: R s = 100 Ω, Q r = 100 and f r = ω r /2π = 25 GHz.

Figure 3 . 9 :

 39 Figure 3.9: Longitudinal impedances Z (top) and their corresponding wake potential W p (bottom) created by an inductive (left), a resistive (center) and a capacitive (right) resonator model. The longitudinal charge density ρ and its Fourier transform ρ for the bunch (with σ s = 6 mm) used to compute the wake potentials are shown in dotted black lines. The head of the bunch is in the region z < 0 and its tail in the region z > 0. Resonator parameters for the inductive impedance: R s = 100 Ω, Q r = 100 and f r = ω r /2π = 50 GHz. Resonator parameters for the resistive impedance: R s = 100 Ω, Q r = 1 and f r = ω r /2π = 10 GHz. Resonator parameters for the capacitive impedance: R s = 100 Ω, Q r = 100 and f r = ω r /2π = 2 GHz.

4. 1 .

 1 Methods and tools to determine the impedance of an accelerator component 4.1.2 Multi-layered cylindrical chamber analytic model using IW2D

Figure 4 . 1 :

 41 Figure 4.1: Multi-layered cylindrical chamber model, from [58]. Each layer is characterised by its complex permittivity c and permeability µ. The first layer (layer 0) is composed of vacuum. The last layer has an infinite radius.

χ

  m = µ r -1 the magnetic susceptibility. f m the relaxation frequency of permeability.h the layer thickness.

Figure 4 . 2 :Figure 4 . 3 :

 4243 Figure 4.2: Measurement setup for longitudinal impedance using the coaxial wire method

Figure 4 . 4 :

 44 Figure 4.4: Left: circular beam pipe of diameter D and wire diameter d corresponding to Eq. (4.7). Right: ThomX beam pipe cross section.

Figure 4 . 5 :

 45 Figure 4.5: S21 measurement of ThomX reference section, the 100 mm section is plotted in blue and the 500 mm section in red. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines.

Figure 4 . 6 :

 46 Figure 4.6: Standard deviation of the set of 5 S21 measurements on ThomX reference section (100 mm).

  Figure 4.7 shows the 3D CST model used for the wakefield simulation on the left and a picture of the bellows shielded by RF fingers. The bellows are in stainless steel (316LN) and the RF fingers are in silver.

Figure 4 . 7 :

 47 Figure 4.7: Left: CST model of the bellows with RF fingers. Right: picture of ThomX bellows with RF fingers.

Figure 4 . 8 :

 48 Figure 4.8: CST simulation results of the bellows. Top: longitudinal impedance Z with real part in red and imaginary part in blue. Bottom: Wake potential W p in red and normalised source charge (σ = 2 mm) in black.

Figure 4 . 9 :

 49 Figure 4.9: S21 measurement of ThomX bellows, with RF fingers in red, without RF fingers in black and the 100 mm reference section in blue. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines.

Figure 4 . 10 :

 410 Figure 4.10: Real part of the impedance measurement of ThomX bellows, with RF fingers in the top plot and without in the bottom plot. The mean value for the set of 5 measurements is plotted in plain line, the CST simulation is shown on dotted lines and the 95 % CI is shown in thin dotted lines.

Figure 4 . 11 :

 411 Figure 4.11: Left: CST model of the pumping port. Right: picture of a pumping port prototype used to do the RF measurement.

Figure 4 . 12 :

 412 Figure 4.12: CST simulation of the pumping port. Top: longitudinal impedance Z with real part in red and imaginary part in blue. Bottom: Wake potential W p in red and normalised source charge (σ = 2 mm) in black.

Chapter 4 .Figure 4 . 13 :

 4413 Figure 4.13: Top: S21 measurement of ThomX pumping port in red and the 100 mm reference section in blue. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines. Bottom: real part of the impedance measurement of ThomX pumping port. The mean value for the set of 5 measurements is plotted in blue, the CST simulation is in black and the 95 % CI is shown in thin dotted lines.

Figure 4 .

 4 Figure 4.14: Left: 3D mechanical drawing of a BPM4 bloc. Right: CST model of a BPM4 bloc, made by Moussa El Ajjouri from SOLEIL.

Chapter 4 .Figure 4 . 15 :

 4415 Figure 4.15: CST simulation of the BPM4. Top: longitudinal impedance Z with real part in red and imaginary part in blue. Bottom left: zoom of the wake potential W p (in red) around the normalised source charge (σ = 2 mm) in black. Bottom right: full wake potential W p .

Figure 4 .

 4 Figure 4.16: Top: S21 measurement of a BPM4 prototype in red and the 100 mm reference section in blue. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines. Bottom: Real part of the impedance measurement. The mean value for the set of 5 measurements is plotted in blue, the CST simulation is in black and the 95 % CI is shown in thin dotted lines.

Figure 4 .

 4 Figure 4.17: Left: CST model of the RF cavity with tapers. Right: picture of the RF cavity with tapers (old model with bellows), cooling coils, HOM tuner and power coupler.

Chapter 4 .

 4 ThomX geometric and resistive wall impedance model: simulations and measurements

Figure 4 . 18 :

 418 Figure 4.18: CST simulations of the RF Cavity and of the tapers. Wake potentials W p are shown in red, the Gaussian normalised source charges of standard deviation σ in black, the real part of the longitudinal impedance Re[Z ] in red and its imaginary part Im[Z ] in blue. (a): wake potential created in the RF cavity by a σ = 2 mm bunch. (b): wake potential created in the RF cavity by a σ = 10 mm bunch. (c): wake potential created in the RF cavity and the tapers by a σ = 2 mm bunch. (d): wake potential created in the tapers (in step out/step in) by a σ = 2 mm bunch. (d): longitudinal impedance created by the tapers (in step out/step in)

Figure 4 . 19 :

 419 Figure 4.19: Top: S21 measurement of ThomX old tapers in red and the 500 mm reference section in blue. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines. Bottom: Real part of the impedance measurement of ThomX old tapers with bellows. The mean value for the set of 5 measurements is plotted in blue, the CST simulation is in black and the 95 % CI is shown in thin dotted lines.

  4.20 shows the S21 transmission parameter for this measurement. The real part of the impedance is shown in the bottom plot of Fig. 4.20. The peaks which can be observed between 4 GHz and 5.5 GHz are due to the bellows in the tapers as shown in the bottom plot of Fig. 4.19.

Figure 4 .

 4 Figure 4.20: Top: S21 measurement of ThomX RF cavity with the old tapers in red and the 500 mm reference section in blue. The mean value for the set of 5 measurements is plotted in plain line and the 95 % CI is shown in dotted lines. Bottom: Real part of the impedance measurement of ThomX RF with the old tapers. The mean value for the set of 5 measurements is plotted in blue, the 95 % CI is shown in thin dotted lines. The peaks up to 2 GHz are named according to Table 4.5.

Figure 4 . 21 :

 421 Figure 4.21: 3D mechanical design of ThomX kickers.

Figure 4 . 22 :

 422 Figure 4.22: Toy models based on ThomX kicker geometry.

Figure 4 . 23 :

 423 Figure 4.23: Longitudinal impedance produced by the model 1 of Fig. 4.22 versus frequency. Real part is in red and imaginary part in blue.

Figure 4 . 24 :Figure 4 . 25 :

 424425 Figure 4.24: Longitudinal impedance produced by the model 2 of Fig. 4.22 versus frequency. Real part is in red and imaginary part in blue. The top plot is the full spectrum from DC to 1 THz and the bottom one is a zoom ranging from DC to 80 GHz.

Figure 4 . 26 :

 426 Figure 4.26: Plain lines show the skin depth δ skin for various material versus frequency. Dotted lines show the thickness of the material in ThomX kicker.

Figure 4 . 27 :Figure 4 . 28 :

 427428 Figure 4.27: Longitudinal impedance produced by the kicker versus frequency. Real part is in red and imaginary part in blue. The top plot is the full spectrum from DC to 1 THz and the bottom one is a zoom ranging from DC to 80 GHz.

Figure 4 . 29 :

 429 Figure 4.29: CST model of the septum chamber, in full view (top) and in cutting view (bottom).

Chapter 4 .

 4 ThomX geometric and resistive wall impedance model: simulations and measurements

Figure 4 . 30 :

 430 Figure 4.30: CST simulation of the septum chamber. Top: longitudinal impedance Z in red and horizontal impedance Z x in blue. The real part is shown in plain lines and the imaginary one in dotted lines. Bottom: longitudinal wake potential in red, transverse wake potential in blue and Gaussian (σ = 2 mm) source charge in black.

Chapter 4 .Figure 4 . 31 :

 4431 Figure 4.31: CST model of the transverse feedback kicker. Top: open view of the transverse feedback kicker. Bottom left: cutting view of the transverse feedback kicker cross section. Bottom right: zoom on the open view of the transverse feedback kicker.

Figure 4 . 32 :

 432 Figure 4.32: CST simulation of the transverse feedback kicker for different values of the height of the capacitive section h. (a): real part of the longitudinal impedance Re[Z ]. (b): imaginary part of the longitudinal impedance Im[Z ]. (c) and (d): wake potential W p and normalised source charge distribution (σ = 7 mm) in black.

Figure 4 .

 4 Figure 4.33: Top: 3D mechanical drawing of the IP chamber. Bottom: Modified CST model used for the wakefield simulations.

Figure 4 . 34 :

 434 Figure 4.34: CST simulation of the IP chamber using the modified model (bottom of Fig. 4.33). Top: longitudinal impedance Z with real part in red and imaginary part in blue. Bottom: Wake potential W p in red and normalised source charge distribution (σ = 2 mm) in black.

Figure 4 . 35 :

 435 Figure 4.35: Real part of the longitudinal impedance Re[Z ] for ThomX storage ring (without the RF cavity contribution). Each component contribution to the total impedance is represented by a coloured area. The full sum corresponds to the upper limit of the yellow (pumping ports) area.

Figure 4 . 36 :

 436 Figure 4.36: Imaginary part of the longitudinal impedance Im[Z ] for ThomX storage ring (without the RF cavity contribution). Each component contribution to the total impedance is represented by a coloured area. The full sum corresponds to the upper limit of the yellow (pumping ports) area.

Figure 4 .

 4 Figure 4.38: Wake potentials obtained via convolution of the wake function wf with the longitudinal charge density ρ in blue. Wake potentials obtained via CST simulation W p,CST in dotted red. Normalised longitudinal charge density ρ in black for a Gaussian bunch (top) and for a "real" bunch obtained in beam dynamics simulation (bottom).

Figure 5 . 1 :

 51 Figure 5.1: Steady-state CSR impedance in free space Z F S in red and between two parallel plates Z P P in blue for a ThomX ring dipole. The real part of the impedance is shown in plain lines and the imaginary part in dotted lines. Parameters: L = 0.2964 m, R = 0.3773 m, h = 28 mm.

Figure 5 . 2 :

 52 Figure 5.2: CSR wake potential radiated by a Gaussian longitudinal charge density ρ (σ = 0.5 mm) for a ThomX ring dipole with the free space model W p,F S (left) and with the parallel plate model W p,P P (right). The head of the bunch corresponds to negative z values and the tail to positive z values. Parameters: L = 0.2964 m, R = 0.3773 m, h = 28 mm.

Figure 5 . 3 :

 53 Figure 5.3: Schematics of the electron interaction within a bunch due to coherent synchrotron radiation (CSR). White arrows show the propagation direction of the bunch and red arrows the emitted CSR field. The bunch is represented by an ellipse with the black contour with inside an electron of the tail in blue and one of the head in green. (a): effect of CSR in free space, the CSR radiated by the tail affects the head of the bunch. (b): effect of the walls, the CSR radiated by the head is reflected on the walls and affects the tail. (c): transient effect at dipole exit, the CSR field emitted at the dipole exit travels parallel to the bunch and interacts with it during the drift.

Figure 5 . 4 :

 54 Figure 5.4: Geometry of a curved vacuum chamber simulated by the CSRZ code. The beam is represented by the curved line with the arrows, figure from [37].

Figure 5 . 5 :

 55 Figure 5.5: CSR impedance computed with the parallel plate model Z P P (steady-state) in red and using CSRZ for a single ThomX ring dipole Z CSRZ,1B . The real part of the impedance is shown in plain lines and the imaginary part in dotted lines. Parameters: L = 0.2964 m, R = 0.3773 m, h = 28 mm, a = 40 mm.

Figure 5 . 6 :

 56 Figure 5.6: CSR wake potential radiated by a Gaussian longitudinal charge density ρ (σ = 0.5 mm) for a single W p,CSRZ,1B (left) and two W p,CSRZ,2B (right) ThomX ring dipoles. The wake potentials are computed using Eq. (3.25) and the CSRZ impedances. The head of the bunch corresponds to negative z values and the tail to positive z values.

Figure 5 . 7 :

 57 Figure 5.7: CSR impedance computed using CSRZ for a single ThomX ring dipole Z CSRZ,1B and for two dipoles Z CSRZ,2B (configuration at the IP). The impedance for two dipoles Z CSRZ,2B is normalised (divided by 2) for comparison with other impedances. The real part of the impedance is shown in plain lines and the imaginary part in dotted lines.

Figure 6 . 1 :

 61 Figure 6.1: Plots of the product Re[Z]|ρ| 2 versus the frequency for different bunch length σ s . The impedance Z corresponds to the CSR impedance of the full storage ring for the red line (8 × Z CSRZ,1B , see Fig. 5.5). The impedance Z corresponds to the full geometric/RW impedance model, see section 4.2.9, for the blue line. The black line shows the modulus squared of the bunch spectrum |ρ| 2 is arbitrary units (A.U.)

Figure 6 . 2 :

 62 Figure 6.2: Benchmark of the space charge effect between CODAL and ASTRA [109] for a 1 m drift space with a converging 1 nC bunch. The plots show x,y , the normalised emittance, σ x,y , the rms bunch size, σ s , the rms bunch length and ∆E, the absolute energy spread versus s, the longitudinal position along the drift. 3D grid parameter used in CODAL: N x = 90, N y = 90, N s = 60. ASTRA simulations made by Christelle Bruni.

Figure 6 . 3 :

 63 Figure 6.3: Top: smoothed longitudinal profile used to compute ρ for different values of the smoothing parameter N wind . Bottom: raw histogram data of the longitudinal phase space. Parameters: N bin = 400, N rms = 5, N p = 10 6 .

6. 2 .

 2 Figure 6.4: Division of ThomX storage in sectors for the geometric and resistive wall wake potential computation in CODAL.

Figure 6 . 5 :

 65 Figure 6.5: Diagram of the algorithm used for the parallel computing of the collective effects in CODAL.

1 nCσ

 1 Laser = 2 ps x = 1.5 mm.mrad y = 1.5 mm.mrad σ s = 2 ps σ δ = 0.24% x = 3 mm.mrad y = 3 mm.mrad σ s = 3 ps σ δ = 0.23% x = 5 mm.mrad y = 5 mm.mrad σ s = 3.7 ps σ δ = 0.23% σ Laser = 4 ps x = 1.3 mm.mrad y = 1.3 mm.mrad σ s = 3.5 ps σ δ = 0.48% x = 3.5 mm.mrad y = 3.5 mm.mrad σ s = 4 ps σ δ = 0.46% x = 5 mm.mrad y = 5 mm.mrad σ s = 4.5 ps σ δ = 0.46% σ Laser = 6 ps x = 1.2 mm.mrad y = 1.2 mm.mrad σ s = 4.5 ps σ δ = 0.73% x = 3.5 mm.mrad y = 3.5 mm.mrad σ s = 5 ps σ δ = 0.6% x = 5.5 mm.mrad y = 5.5 mm.mrad σ s = 5.5 ps σ δ = 0.73%

1 nCσ

 1 Laser = 2 ps x = 1.6 mm.mrad y = 1.8 mm.mrad σ s = 7 ps σ δ = 0.23% Q = 100 pC x = 5.2 mm.mrad y = 4.1 mm.mrad σ s = 7 ps σ δ = 0.19% Q = 500 pC x = 14 mm.mrad y = 6 mm.mrad σ s = 6 ps σ δ = 0.19% Q = 999 pC σ Laser = 4 ps x = 1.9 mm.mrad y = 1.5 mm.mrad σ s = 13 ps σ δ = 0.46% Q = 100 pC x = 5.7 mm.mrad y = 5.5 mm.mrad σ s = 12 ps σ δ = 0.46% Q = 498 pC x = 9 mm.mrad y = 6.8 mm.mrad σ s = 12 ps σ δ = 0.39% Q = 997 pC σ Laser = 6 ps x = 2.2 mm.mrad y = 1.2 mm.mrad σ s = 16 ps σ δ = 0.61% Q = 98 pC x = 5 mm.mrad y = 6 mm.mrad σ s = 17.5 ps σ δ = 0.59% Q = 489 pC x = 9 mm.mrad y = 8 mm.mrad σ s = 15.5 ps σ δ = 0.55% Q = 975 pC off. There is a slight increase of the emittance in both directions in the curves corresponding to the tracking only, without collective effect, due to the chromatic effects in the quadrupoles at s = 0.8 m and s = 1.2 m linked to the high betatron function value at this location, see TL optics in Fig. 2.3.

Figure 6 . 6 :

 66 Figure 6.6: Evolution of the horizontal (X, in red) and the vertical (Y, in blue) normalised emittance x and y along the longitudinal coordinate s in the transfer line (TL). This plot corresponds to the case of an input bunch with an initial charge Q 0 = 1 nC and with a laser pulse length of σ Laser = 4 ps. Results are shown for different simulations with coherent synchrotron radiation (CSR) and space charge (SC) switched on and off. The black line corresponds to a synoptic of the TL elements where dipoles are represented by bricks and quadrupoles by chevrons.

6. 3 .Figure 6 . 7 :

 367 Figure 6.7: Plots at the exit of the linac, (a), (b) and (c), and at the injection into the storage ring, (d), (e) and (f). The plots (a) and (d) correspond to the horizontal position x versus the longitudinal position s along the bunch. The plots (b), (c), (e) and (f) correspond to the horizontal phase space, x the horizontal deviation versus x the horizontal position. The plots (a), (b), (d) and (e) represent the macroparticle density in colour scale. The plots (c) and (f) show different longitudinal slices of the bunch in different colours. Simulation parameters: Q 0 = 1 nC, σ Laser = 4 ps.

Figure 6 . 8 :

 68 Figure 6.8: Longitudinal phase space, relative energy deviation δ versus the longitudinal position s, at the injection into the storage ring. Results are shown for different simulations corresponding to the case of an input bunch with an initial charge Q 0 = 1 nC and with a laser pulse length of σ Laser of 2 ps (top), 4 ps (middle), 6 ps (bottom).

Figure 6 . 9 :

 69 Figure 6.9: Longitudinal phase space, relative energy deviation δ versus the longitudinal position s, at the injection into the storage ring. Results are shown for different simulations corresponding to the case of an input bunch with an initial charge Q 0 = 500 pC and with a laser pulse length of σ Laser of 2 ps (top), 4 ps (middle), 6 ps (bottom).

Figure 6 . 10 :

 610 Figure 6.10: Longitudinal phase space, relative energy deviation δ versus the longitudinal position s, at the injection into the storage ring. Results are shown for different simulations corresponding to the case of an input bunch with an initial charge Q 0 = 100 pC and with a laser pulse length of σ Laser of 2 ps (top), 4 ps (middle), 6 ps (bottom).

Figure 6 . 11 :

 611 Figure 6.11: Longitudinal phase space, relative energy deviation δ versus longitudinal position s, at different times after injection. The phase space projection on both axes are shown in arbitrary units. Both curves are smoothed and the longitudinal one corresponds to the profile used to compute the wake potentials. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 12 :

 612 Figure 6.12: Time evolution of the electron bunch density (in colour) at injection versus the longitudinal position s. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 13 :

 613 Figure 6.13: Time evolution of the CSR wake (top plot, in colour) and of the geometric wake (bottom plot, in colour) at injection versus the longitudinal position s. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 .

 6 Figure 6.[START_REF] Bulyak | Compact x-ray source based on compton backscattering[END_REF] shows the evolution of the rms bunch length σ s and of the transverse emittances x,y during the transient microbunching regime. At the injection, σ s oscillates due to the longitudinal

Figure 6 . 14 :

 614 Figure 6.14: Longitudinal phase space, relative energy deviation δ versus longitudinal position s, at different times. The phase space projection on both axes are shown in arbitrary units. Both curves are smoothed and the longitudinal one corresponds to the profile used to compute the wake potentials. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 15 :

 615 Figure 6.15: Time evolution of the electron bunch density (in colour) versus the longitudinal position s. The four plots corresponds to 50 turns of the dynamics with different starting turn t start , from top to bottom, t start = 1000, t start = 2500, t start = 5000 and t start = 19950. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 .

 6 Figure 6.16: Top: time evolution (expressed in turns) of the rms bunch length σ s . Bottom: time evolution (expressed in turns) of the horizontal normalised emittance x in red and of the vertical normalised emittance y in blue. Simulation parameters: Q 0 = 100 pC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 17 :

 617 Figure 6.17: Longitudinal phase space, relative energy deviation δ versus longitudinal position s, at different times after injection. The phase space projection on both axes are shown in arbitrary units. Both curves are smoothed and the longitudinal one corresponds to the profile used to compute the wake potentials. Simulation parameters: Q 0 = 1 nC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 18 :

 618 Figure 6.18: Time evolution of the electron bunch density (in colour) at injection versus the relative energy deviation δ. Simulation parameters: Q 0 = 1 nC, σ Laser = 4 ps and G F B = 0.1.

Figure 6 . 19 :

 619 Figure 6.19: Optical functions versus the longitudinal position s in a forth of ThomX storage ring for different lattices. β x and β y are the horizontal and vertical betatron function and η x is the horizontal dispersion function (shown multiplied by 20 is the plots). The black line corresponds to a synoptic of the ring elements where dipoles are represented by bricks and quadrupoles by chevrons. Lattice design by Alexandre Loulergue.

3. 18

 18 µs ≈ 53 T 0 2.67 µs ≈ 44 T 0 2.47 µs ≈ 41 T 0 T s (V RF = 500 kV) 2.46 µs ≈ 41 T 0 2.07 µs ≈ 35 T 0 1.91 µs ≈ 32 T 0is also visible, when V RF is increased the longitudinal extension of the RF bucket decreases which should lead to a smaller bunch length after the transient regime.

Figure 6 . 20 :

 620 Figure 6.20: RF bucket in the longitudinal phase space, relative energy deviation δ versus the RF phase φ, corresponding to the different lattices presented in Fig. 6.19 for different values of the RF voltage V RF . The RF buckets are shown in dotted lines for V RF = 300 kV and in plain lines for V RF = 500 kV. The RF buckets are plotted taking into account the momentum compaction factor up to forth order.

Figure 6 . 21 :

 621 Figure 6.21: Charge after 500 turns in the storage ring Q 500t versus the charge extracted at the photocathode Q 0 for the different lattices. Simulation parameters: σ Laser = 4 ps, V RF = 500 kV and G F B = 0.1.

Figure 6 . 22 :

 622 Figure 6.22: Time evolution of the electron bunch density (in colour) versus the longitudinal position s between turn 6600 and turn 7000. Simulation parameters: Lattice B, Q 0 = 1 nC, σ Laser = 4 ps, V RF = 500 kV and G F B = 0.1.

Figure 6 . 23 :

 623 Figure 6.23: Evolution of the charge during the tracking in the different lattices. Simulation parameters: Q 0 = 1 nC, σ Laser = 4 ps, V RF = 500 kV and G F B = 0.1.

Figure 6 . 24 :

 624 Figure 6.24: Longitudinal phase space, relative energy deviation δ versus longitudinal position s, at turn 100 with and without space charge. The phase space projection on both axes are shown in arbitrary units. Both curves are smoothed and the longitudinal one corresponds to the profile used to compute the wake potentials. Simulation parameters: Lattice B, Q 0 = 1 nC, σ Laser = 4 ps and G F B = 0.1.

Figure 7 . 1 :

 71 Figure 7.1: Schematic drawing of the ion-beam interaction, the force felt by the ion is perpendicular to the local direction of the electron, figure inspired by [127].

Figure 7 . 2 :

 72 Figure 7.2: Schematic of the interaction between an ion and an electron.

F

  ei . e x dt = -e 2 4π 0 Am p +∞ -∞ cos(θ) r 2 dt . (7.2) Using trigonometry and projections in Fig.7.2, one obtains: δθ = v e δt cos(θ)

. 4 ) 7 . 2 -π 2 cos θdθ = -2 e 2 4π 0

 472220 Chapter Ion cloud dynamics: physics and theory ∆v i = -e 2 4π 0 Am p r min v e + π Am p r min v e . (7.5)

. 31 )

 31 By assuming σ x > σ y :

2 √

 2 .40) I can therefore express the integral as a function of the Faddeeva function w(z): a + jb) -e -(a+jb) 22j-e -(a+jb) π w(ar + jb r )e (ar+ jb r ) + jb) -e -(a+jb) 2 e (ar+ jb r ) 2 w(ar + jb r ) .(7.42)

e

  -βx(x -η δ) 2 +2αx(x-ηδ)(x -η δ)+γx(x-ηδ)dy e ρ(x e , x e , y e , y e , δ) = N .(7.49)

  x e , y -v, y e , δ) .

( 7 . 55 )

 755 Sagan equation[START_REF] Sagan | Some aspects of the longitudinal motion of ions in electron storage rings[END_REF] is then obtained by combining equations (7.53), (7.54) and (7.55):∆v s = [-α x x + (ησ δ )(η σ δ )]∂∆v x ∂x -α y y ∂∆v y ∂y .(7.56)

7. 2 .

 2 Beam-ion interaction j∆v x + ∆v y =

Figure 7 . 3 :

 73 Figure 7.3: Horizontal velocity kick ∆v x versus the horizontal position x for several vertical position y. The values used for the parameters are σ x = 1.5 mm, σ y = 0.5 mm, N = 6.25 × 10 9 and A = 28 (CO + ions).

Figure 7 . 4 :

 74 Figure 7.4: Top: Vertical velocity kick ∆v y map as a function of the vertical position y and of the longitudinal position s of the ion along ThomX storage ring. Bottom: the Twiss parameter β y is plotted in blue and σ y (σ x + σ y ) (represented with arbitrary units) is shown in orange. The values used for the parameters are N = 6.25 × 10 9 and A = 28 (CO + ions). ThomX nominal optic functions, which are used here, are shown in Fig 2.5.

7 . 5 ,

 75 longitudinal structures caused by maxima of σ x (σ x + σ y ), high intensity zones of ∆v x at minimums of β x at IPs. Note also relatively strong kicks ∆v x at s = 2.2 m, s = 6.8 m, s = 11.1 m and s = 15.8 m. They are produced by a minimum of β x at these points, curve in blue in the bottom graph. Conversely areas of relatively low intensity are observed at s = 1.2 m, s = 7.8 m, s = 10.2 m and s = 16.7 m are due to local maximums of β x .

Figure 7 . 5 :

 75 Figure 7.5: Top: Horizontal velocity kick ∆v x map as a function of the horizontal position x and of the longitudinal position s of the ion along ThomX storage ring. Bottom: the Twiss parameter β x is plotted in blue and σ x (σ x + σ y ) (represented with arbitrary units) is shown in orange. The values used for the parameters are N = 6.25 × 10 9 and A = 28 (CO + ions). ThomX nominal optic functions, which are used here, are shown in Fig 2.5.

Figure 7 .

 7 6 shows the critical masses A c x and A c y for ThomX in a semilog plot. The critical mass numbers are compared to the masses of usual ions found in vacuum chambers. The ions CH + 4 , H 2 O + , CO + and CO + 2 are trapped in both planes all around the ring. The H + 2 ions are trapped in most of the ring but not around the IP and IP bis, between s = 4.2 m and s = 4.7 m and between s = 13.2 m and s = 13.7 m.

Figure 7 . 6 :

 76 Figure 7.6: Critical mass numbers A c x in the horizontal direction (in blue) and A c y in the vertical direction (in orange) along the longitudinal position s in ThomX storage ring. The atomic mass number of usual ions are also shown, H + 2 in yellow, H 2 O + in purple, CH + 4 in green, CO + in light blue and CO + 2 in maroon. ThomX design parameter values are used for the computation, S b = 18 m and N = 6.25 × 10 9 (Table2.3).

Figure 7 . 7 :

 77 Figure 7.7: Ion oscillation frequencies for CO + along ThomX ring longitudinal position s.The top plot shows the horizontal direction and the bottom one the vertical direction. Chao's expression is represented in blue, Stupakov's one in orange and Raubenheimer's one, Eq. (7.79) with k (x,y) = 3 2 , in yellow. ThomX design parameter values are used for the computation, A = 28 (CO + ) and λ e = 3.5 × 10 8 electron/m (Table2.3).

Figure 7 . 8 :

 78 Figure 7.8: The Gaussian electron beam normalised transverse distribution ρ Gauss , with σ = σ x , is plotted in blue. The ion equilibrium transverse normalised distribution ρ is plotted in orange. The yellow line corresponds to the asymptotic form of the ion equilibrium distribution normalised ρ asympt . The purple dotted line corresponds to the ion normalised Gaussian distribution with σ i,x = σx √ 2 which approximates the field created by the ion equilibrium distribution [118].

Figure 7 . 9 :

 79 Figure 7.9: Longitudinal velocity kick ∆v s vs horizontal position x for several position y without dispersion, η = 0 m and η = 0. Left: α x = α y = 10. Right: α x = -α y = 10. The other parameters are common for both plots: σ x = 1.5 mm, σ y = 0.5 mm, x = y = 50 nm.rad, σ δ = 6 × 10 -3 , A = 28 (CO + ) and N = 6.25 × 10 9 (Table2.3).

Figure 7 . 10 :

 710 Figure 7.10: Longitudinal velocity kick ∆v s vs horizontal position x for several position y with dispersion. Left: η = 1 m and η = 1. Right: η = 1 m and η = -1. The other parameters are common for both plots: α x = α y = 10, σ x = 1.5 mm, σ y = 0.5 mm, x = y = 50 nm.rad, σ δ = 6 × 10 -3 , A = 28 (CO + ) and N = 6.25 × 10 9 (Table2.3).

Figure 7 .

 7 Figure 7.11: Top: Color map of the longitudinal kicks ∆v s vs the horizontal position x and the longitudinal position s along half of the ThomX ring for CO + ions (A=28). Bottom: 20α x x in blue, η x η x σ δ 2 in orange and 20α y y in yellow vs the longitudinal postion s along half of the ThomX ring. The emittance terms of Eq. (7.83) have been multiplied by 20 in order to make their variations visible.

Figure 7 . 13 :

 713 Figure 7.13: Evolution of the ion longitudinal distribution when going trough a dipole magnet for various initial longitudinal velocities. The ion longitudinal distribution is shown in the top plot versus time (expressed in turns or bunch-ion interaction) in ordinate and versus the longitudinal position s. The colour scale shows the local density of ions (the number of ions per pixel). The bottom plot shows the vertical magnetic field B y as as function of the longitudinal position s. Results obtained using the NUAGE simulation code, see section 8.1.

Figure 8 . 1 :

 81 Figure 8.1: Diagrams explaining the working of NUAGE. Left: General outline of NUAGE code, using 3 cycles with different parameter set and cycles 2 and 3 alternating. Right: Schematic of the main loop of NUAGE simulation code, corresponding to one cycle.

  8.3.

Figure 8 . 2 :

 82 Figure 8.2: Evolution of the horizontal distribution of a CO + ion cloud for the first 200 bunch-ion interactions, starting from the beam Gaussian distribution in the transverse plane. The colour scale represent the number of ion per pixel. The ion density is plotted versus the time (expressed in bunch-ion interactions) in ordinate and versus the horizontal position. The number of ions at the start of the simulation is N i0 = 32000.

Figure 8 . 3 :

 83 Figure 8.3: Evolution of the horizontal distribution of a CO + ion cloud between the bunch-ion interactions 19 800 and 20 000. The colour scale represent the number of ion per pixel. The ion density is plotted versus the time (expressed in bunch-ion interactions) in ordinate and versus the horizontal position. The number of ions at the start of the simulation is N i0 = 32000.

Figure 8 . 4 : 2 σ 2 x + y 2 σ 2 y≤ 1 .

 8422221 Figure 8.4: Comparison between the ion transverse equilibrium distributions computed from NUAGE simulations and the analytic expression. The histogram of the ion positions correspond to simulation data after 100 000 bunch-ion interactions with N i0 = 32000 CO + ions.

Figure 8 . 5 :

 85 Figure 8.5: Ion horizontal position versus time, the ion initial position is different for each ion.

Figure 8 . 6 :

 86 Figure 8.6: Trajectories of a single ion with different initial horizontal positions X 0 and initial vertical positions Y 0 during 50 000 bunch-ion interactions. The colour scale indicates the time spent at a given position.

Figure 8 . 7 :

 87 Figure 8.7: Plots of the frequency footprint of the CO + ions. The plots show the 2D histogram of the ion oscillation frequencies, vertical frequency f y versus horizontal frequency f x , for different initial conditions. The colour scale indicate the density of ions which have the same oscillation frequencies. The ion initial distribution is a 2D Gaussian with horizontal standard deviation X 0 and vertical one Y 0 . NUAGE simulation with 1000 ions tracked during 5000 bunch-ion interactions.

Figure 8 . 8 :

 88 Figure 8.8: Left plot shows the time needed to compute 1000 iteration of the main loop depending on the number of ion simulated per core for different NUAGE configurations. Right plot shows the time dependence on the number of iteration of the main loop for 1000 ions per core for different NUAGE configurations. Results may depend on lattice used, here ThomX storage ring lattice is used. Computed using an Intel Xeon CPU E5-2630 (8 cores at 2.40 GHz).

Figure 8 . 9 :

 89 Figure 8.9: Tracking of a CO + ion cloud during 50 000 bunch-ion interactions, starting from an uniform distribution in the longitudinal dimension. The ion density is plotted versus the time (expressed in bunch-ion interactions) in ordinate and versus the longitudinal position for half of the ThomX storage ring in abscissa. The number of ions at the start of the simulation is N i0 = 10 5 . The bottom plot is a synopsis of the ThomX storage ring elements taken into account for the simulation. Focusing quadrupoles are represented in blue, defocusing quadrupoles are represented in red and dipoles in yellow.

Figure 8 . 10 :

 810 Figure 8.10: Tracking of a H + 2 ion cloud during 50 000 bunch-ion interactions, starting from an uniform distribution in the longitudinal dimension. The ion density is plotted versus the time (expressed in bunch-ion interactions) in ordinate and versus the longitudinal position for half of the ThomX storage ring in abscissa. The number of ions at the start of the simulation is N i0 = 10 5 . The bottom plot is a synopsis of the ThomX storage ring elements taken into account for the simulation. Focusing quadrupoles are represented in blue, defocusing quadrupoles are represented in red and dipoles in yellow.

Figure 8 . 11 :

 811 Figure 8.11: Histograms of the ion final distribution after 20 ms (333 333 beam-ion interactions). The number of ions is indicated versus the longitudinal position s along ThomX ring. Red bars represent the CO + ions and blue ones the H + 2 ions. The number of ions at the start of the simulation for both simulations is N i0 = 10 5 .

Figure 8 . 12 :

 812 Figure 8.12: Clearing coefficient versus the number of bunch-ion interactions. The red curves show the results for H + 2 ions and the blue ones for CO + ions. The plain curves correspond to NUAGE simulations with magnetic fields and the dotted ones without magnetic fields.

  . It is possible to use an electrode both for ion clearing and for position monitoring at the same time but it might degrade the monitoring performance. For this reason, ThomX BPMs were designed to have separate electrodes for clearing and for monitoring. The nominal case where only the electrodes designed for clearing are used is studied here. The different designs are shown in Fig. 8.14, the electrodes BPM6 and BPM8 are integrated in BPM blocks and the electrodes IP and IP bis are stand-alone. The map of ThomX storage ring with the positioning of the BPMs and clearing electrodes is shown in Fig. 8.13.

Figure 8 . 13 :

 813 Figure 8.13: Electrodes and BPMs in ThomX ring. The BPM6 and BPM8 contain both a BPM and a clearing electrode in a single block. The BPM4 are only a BPM and the IP and IP bis are only clearing electrodes.

8. 3 .Figure 8 . 14 :

 3814 Figure 8.14: Transverse electric field created by different clearing electrodes. The colour scale for the arrows is linear from red, E = 20 kV m -1 , to blue, E = 0 kV m -1 . Electrode IP bis: configuration -/-, the two buttons are negatively polarised, U = -0.5 kV. Electrode BPM6 : configuration -/+ the upper button is negatively polarised, U = -0.5 kV, and the lower button is positively polarised, U = 0.5 kV. Electrode IP : configuration +/-the upper button is positively polarised, U = 0.5 kV, and the lower button is negatively polarised, U = -0.5 kV. Electrode BPM8 : configuration +/+/-/-the upper buttons are positively polarised, U = 0.5 kV, and the lower buttons are negatively polarised, U = -0.5 kV.

Figure 8 .

 8 Figure 8.16 shows the tracking of a CO + ion cloud in half the ThomX storage ring using clearing electrodes. The simulation shown here is similar to the one shown in Fig.8.9 but with ten electrodes clearing the ions. Two type BPM8 electrodes are located at s = 3.1 m and s = 5.9 m, two type BPM6 electrodes are located at s = 0.7 m and s = 8.3 m and one type IP is located at s = 4.5 m. The five others are dispatched similarly in the second side of the ring with a type IP bis electrode instead of the type IP electrode. The electrode at s = 4.5 m is placed at the main accumulation point and allows the clearing of most of the ions there. The two electrodes of type BPM6 are located near the exit of the expulsion zones, i.e at s = 0.8 m and s = 8.2 m. This helps to isolate the free drifting regions and to prevent

  . The two electrodes of type BPM8 at s = 3.1 m and s = 5.9 m are not very effective but decrease to some extent the number of ions trapped near the weak accumulation points at s = 2 m and s = 7 m. The ion reflection by the dipole fringe fields is visible at s = 2.3 m, s = 4.1 m, s = 4.9 m and s = 6.7 m.The ion trapping due to magnetic fields is highlighted by red dotted arrows in Fig.8.[START_REF] Bulyak | Compact x-ray source based on compton backscattering[END_REF]. Case I trapping, where ions are reflected between two dipoles, is visible at s = 4.5 m. Case II trapping (seeFig. 7.14), where ions oscillate in the vicinity of a dipole fringe field next to an accumulation point is visible around s = 2.5 m. Because dipoles can add additional trapping and are often near the accumulation points (because of the dispersion change at dipole positions), setting the clearing electrodes near or inside dipole magnets is generally effective.

Figure 8 . 16 :

 816 Figure 8.16: Tracking of a CO + ion cloud during 50 000 beam-ion interactions with clearing electrodes on. The bottom plot is a synopsis of ThomX storage ring elements taken into account for the simulation. Number of ions at the start of the simulation N i0 = 10 5 . Focusing quadrupoles are represented in blue, defocusing quadrupoles are represented in red, dipoles in yellow. Clearing electrodes of type IP bis and BPM8 in configuration -/-are shown in green and electrodes of type BPM6 in configuration +/-in magenta. Red dotted arrows highlight the effect of ion trapping of case I and II due to the dipoles.

Figure 8 . 17 :

 817 Figure 8.17: Histograms of the ion final distribution after 20 ms (333 333 bunch-ion interactions) with clearing electrodes on. The number of ions is indicated versus the longitudinal position s along ThomX ring. Red bars represent the H + 2 ions and blue ones the CO + ions. The number of ions at the start of the simulation for both simulations is N i0 = 10 5 .

Figure 8 . 18 :

 818 Figure 8.18: Clearing coefficient versus the number of bunch-ion interactions with clearing electrodes on. The red curves show the results for H + 2 ions and the blue ones for CO + ions.

Figure 8 . 19 :

 819 Figure 8.19: Tracking of a CO + ion cloud during the clearing gap. The ion vertical distribution is plotted versus time (expressed in number of bunch-ion interactions) and the vertical position y. The beam-ion interaction is switched off but the effect of magnets and clearing electrodes is present. Number of ions at the start of the simulation N i0 = 35000.

Figure 8 . 20 :

 820 Figure 8.20: Clearing coefficient versus the number of bunch-ion interactions during the clearing gap of 4 µs. The red curves show the results for H + 2 ions and the blue ones for CO + ions.

Figure 8 . 21 :

 821 Figure 8.21: Tracking of a CO + ion cloud during 50 000 bunch-ion interactions just after a clearing gap with clearing electrodes on. The ion number at the start of the simulation is N i0 = 35000.

Figure 8 . 22 :

 822 Figure 8.22: Histograms of the ion final distribution after the 4 µs clearing gap and 20 ms tracking (333 333 bunch-ion interactions) with clearing electrodes on. The number of ions is indicated versus the longitudinal position s along ThomX ring. Red bars represent the H + 2 ions and blue ones the CO + ions.

Figure 8 . 23 :

 823 Figure 8.23: Clearing coefficient versus the number of bunch-ion interactions during the tracking after the clearing gap of 4 µs. The red curves show the results for H + 2 ions and the blue ones for CO + ions. Plain lines correspond to results where the clearing electrodes are switched on and dotted lines to the results where they are switched off (same setting for all steps of the simulation, from tracking from uniform distribution to gap and tracking afterwards).

Process M 2 0C 0 2 new = 1 . 8

 20218 Cross-section (Mbarn) N i new (ion/s) e -+ CO -→ CO + + 2e - 3.7 35.1 σ 1 = 1.2 N CO + new = 3.3 • 10 8 e -+ H 2 -→ H + 2 + 2e - 0.70 8.1 σ 2 = 0.26 N H + • 10 8

Figure 9 . 1 :

 91 Figure 9.1: Time evolution of the system defined in Eq. (9.5). Left: volumetric density versus time for different species. Right: neutralisation factor η versus time, the H + 2 component is in blue, the CO + one in orange and the sum (i.e. the total neutralisation factor) is in black. Initial conditions: [CO] = 7.4 • 10 11 m -3 , [H 2 ] = 6.7 • 10 12 m -3 , [CO + ] = [H + 2 ] = 0 m -3 .

Figure 9 . 2 :

 92 Figure 9.2: Time evolution of the system defined in Eq. (9.8). Left: volumetric density versus time for different species. Right: neutralisation factor η versus time, the H + 2 component is in blue, the CO + one in orange and the sum (i.e. the total neutralisation factor) is in black. Initial conditions: [CO] = 7.4 • 10 11 m -3 , [H 2 ] = 6.7 • 10 12 m -3 , [CO + ] = [H + 2 ] = 0 m -3 .

. 10 )

 10 Where [CO + ] F N and [H + 2 ] F N are the ion volumetric densities at full neutralisation and [CO] 0 and [H 2 ] 0 are the initial molecular volumetric densities. Using this solution gives [CO + ] F N = 1.52 • 10 14 ion m -3 and [H + 2 ] F N = 2.90 • 10 14 ion m -3 which correspond precisely to the values at full neutralisation found by solving numerically the system (9.9), see Fig. 9.3.

Figure 9 . 3 :

 93 Figure 9.3: Time evolution of the system defined in Eq. (9.9). Left: volumetric density versus time for different species. Right: neutralisation factor η versus time, the H + 2 component is in blue, the CO + one in orange and the sum (i.e. the total neutralisation factor) is in black. Initial conditions: [CO] = 7.4 • 10 11 m -3 , [H 2 ] = 6.7 • 10 12 m -3 , [CO + ] = [H + 2 ] = 0 m -3 .

Figure 9 . 4 :

 94 Figure 9.4: Time evolution of the system defined by the ionisation model in Tab. 9.2. Left: volumetric density versus time for carbon monoxide ion CO + and different carbon ions. Right: neutralisation factor η versus time, the total neutralisation factor η is in black, the sum of the contribution of the ions ionised only once is in dotted black and the contribution to the neutralisation factor of each of the ion species is indicated in coloured lines. Initial conditions: [CO] = 7.4 • 10 11 m -3 , [H 2 ] = 6.7 • 10 12 m -3 and any other species to 0 m -3 .

Figure 9 . 5 :

 95 Figure 9.5: Time evolution of the system defined by the ionisation model in Tab. 9.2 for different maximum neutralisation factor η max . From left to right: η max = 10 -1 , η max = 10 -2 and η max = 10 -3 . The neutralisation factor η is plotted versus time, the total neutralisation factor η is in black, the sum of the contribution of the ions ionised only once is in dotted black and the contribution to the neutralisation factor of each of the ion species is indicated in coloured lines. Initial conditions: [CO] = 7.4 • 10 11 m -3 , [H 2 ] = 6.7 • 10 12 m -3 and any other species to 0 m -3 .

Chapter 9 .

 9 Figure 9.6: Diagram of the algorithm used to estimate the ion number evolution during a cycle.

Figure 9 . 7 :

 97 Figure 9.7: Neutralisation factor η versus time with clearing electrodes on the left and without clearing electrodes on the right. The full neutralisation factor is represented by the plain black line and the sum of the singly ionised ion contributions is represented by the dotted black line. Initial residual gas mix: total pressure P t = 3 10 -10 mbar with 90% of H 2 and 10% of CO.

. 21 )

 21 Chapter 9. Multi-ionisation and local neutralisation factor

.30) 9 . 4 .

 94 Local neutralisation factor and induced tune shiftIntroducing the classical radius of the electron:

Figure 9 . 8 :

 98 Figure 9.8: Local neutralisation factor η from each ion species versus the longitudinal position s. With clearing electrodes on the top plot and without on the bottom one.

  x + x • ˙ x + + ẏ • y = = ṡ • s + ẋ • x + x • ˙ x + ẏ • y = = ṡ • s + ẋ • x -h ṡx • s + ẏ • y =

  ¨ r = vx x + v x ˙ x + vy y + vs s + v s ˙ s = = vx x + v x (-h ṡ) s + vy y + vs s + v s (h ṡ)

  in the transverse plane of the BPM 6 are shown in Fig. B.3 for configuration n°2 and n°4. In configuration n°2 the field arrows come from the positive electrode in position n°3to the negative electrode in position n°1 and this electrode will collect the ions. For configuration n°4 the field near the longitudinal axis is nearly zero but there is still strong transverse fields out of the axis. Part of the ions should still be collected in both electrodes.

Figure B. 3 :

 3 Figure B.3: Electric field map of the transverse plane of BPM 6. The left map shows configuration n°1 and the right map shows configuration n°2. The colour scale is linear, red arrows correspond to a field superior to 10 kV while blue arrows to a field near 0 V.

Figure B. 5 :

 5 Figure B.5: Electric field map of the transverse plane of BPM8. The top left map shows configuration n°1, the top right map shows configuration n°3, the bottom left map shows configuration n°8 and the bottom right map shows configuration n°6. The colour scale is linear, red arrows correspond to a field superior to 20 kV while blue arrows to a field near 0 V.

  The different configurations possible for IP and IP bis are shown in Tab. B.3. By convention, the top electrode of IP and IP bis is called n°1 and the bottom one n°2. Their corresponding electric fields in the cavity center is shown in the three plots of Fig. B.6. Configurations n°IP 1, n°IP 2, n°IP bis 1 and n°IP bis 2 correspond to classic clearing fields where the ions would be sent toward the wall of the beam pipe with vertical kicks. Configurations n°IP 3 and n°IP 4 create longitudinal electric fields which correspond to an accumulation point for configuration n°IP 3 and an expulsion point for configuration n°IP 4. Configurations n°IP bis 3 and n°IP bis 4 create both longitudinal fields and horizontal kicks. B.3. IP and IP bis Electric field maps in the transverse plane of the IP and IP bis are shown in Fig. B.7 for configuration n°IP 1, n°IP 4, n°IP bis 1 and n°IP bis 4.In configuration n°IP 1 the field arrows come from the positive electrodes on top to the negative electrode on bottom producing a vertical electrical field. The configuration n°IP 4 has a field zero in the cavity center and transverse fields directed toward the electrodes. In addition this configuration also creates a longitudinal accumulation point. Configurations n°IP 2 and n°IP 3 are the same as n°IP 1 and n°IP 4 but with inverted polarities, meaning a transverse field for n°IP 2 and an expulsion point added to focusing field toward cavity center for n°IP 3. It is interesting to note that configurations n°IP bis 1 to n°IP bis 4 are also realisable using half of the BPM 8 clearing electrodes if wished.

Figure B. 7 :

 7 Figure B.7: Electric field map of the transverse plane of IP and IP bis. The top left map shows configuration n°IP 1, the top right map shows configuration n°IP 4, the bottom left map shows configuration n°IP bis 1 and the bottom right map shows configuration n°IP bis 4. The colour scale is linear, red arrows correspond to a field superior to 20 kV while blue arrows to a field near 0 V.

Figure 10 . 8 :

 108 Figure 10.8: Processus de diffusion Compton inverse entre un faisceau d'électrons et un faisceau laser. Les photons incidents sont boostés en énergie et se convertissent en rayons X émis suivant un cône [24].

Figure 10 . 9 :

 109 Figure 10.9: Photographie de l'interieur de la casmate ThomX (Septembre 2018).

Titre:

  Effets collectifs dans un r égime de micro-paquet transitoire et att énuation du nuage d'ion dans ThomX Mots cl és : Dynamique faisceau; champ de sillage; imp édance; nuage d'ion; anneau de stockage; rayonnement synchrotron coherent R ésum é : La th èse est ax ée sur l' étude des effets collectifs dans un anneau de stockage d' électrons de 50 MeV, ThomX, en l'absence d'amortissement synchrotron et d'adaptation longitudinale. Cette th èse est divis ée en deux parties distinctes. La premi ère partie correspond à la conception du mod èle d'imp édance (champ de sillage g éom étrique, r ésistif et rayonnement synchrotron coh érent) de l'anneau de stockage afin de simuler la dynamique faisceau. Le mod èle d'imp édance g éom étrique de l'anneau de stockage a ét é obtenu par la simulation des él éments individuels et a ét é v érifi é en utilisant des mesures RF sur des prototypes. Le rayonnement synchrotron coh érent a ét é simul é en tenant compte d'une chambre à vide rectangulaire. Des simulations de la dynamique faisceau, de la cathode de canon RF à l'anneau de stockage, comprenant les effets collectifs sont pr ésent ées. Les simulations sont utilis ées pour optimiser la dynamique faisceau dans l'anneau de stockage dans le r égime de micro-paquet. La deuxi ème partie concerne l' étude du nuage d'ions produit par l'ionisation des mol écules du vide r ésiduel et l'optimisation des techniques de nettoyage des ions. Les points d'accumulation longitudinaux des ions et le pi égeage dans les champs magn étiques sont tous les deux étudi és analytiquement et en utilisant un programme d évelopp é à cet effet. Les électrodes de nettoyage et les espaces de nettoyages sont simul és et optimis és en utilisant ce code et la strat égie choisie pour la limitation des effets induits par les ions est d écrite. Enfin, les effets de la multi-ionisation et de la dissociation ionique sont pris en compte et l'effet des ions sur le faisceau d' électrons est estim é. Title : Collective effects in a transient microbunching regime and ion cloud mitigation in ThomX Keywords : Beam dynamics; wakefield; impedance; ion cloud; storage ring; coherent synchrotron radiation Abstract :

Table of contents 1

 of1 Problem statement and scope of the thesis 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formalism for collective effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Wake function and impedance . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Wake potential and loss factor . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Resonator model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Methods and tools to determine the impedance of an accelerator component . . . Dimensionless system of equations for the equation of motion in a quadrupole field B Clearing electrodes fields B.1 BPM 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2 BPM 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.3 IP and IP bis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	4 ThomX geometric and resistive wall impedance model: simulations and mea-surements Résumé 4.1 Table of contents A.6 Bibliography Chapter 1

1.2 A storage ring without damping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Injection without longitudinal matching . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Scope of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 A Compton X-ray source: ThomX 2.1 Photoinjector, linac, transfer and extraction lines . . . . . . . . . . . . . . . . . . 2.2 Storage ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Fabry-Perot cavity and X-ray line . . . . . . . . . . . . . . . . . . . . . . . . . . . I Impedance models and beam dynamics during the transient microbunching regime in ThomX 3 An introduction to collective effects 3.1 Collective effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Space charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Geometric and resistive wall wakefields . . . . . . . . . . . . . . . . . . . . 3.1.3 Coherent synchrotron radiation . . . . . . . . . . . . . . . . . . . . . . . . 3.2 4.1.1 Time domain simulation using CST PS . . . . . . . . . . . . . . . . . . . . 4.1.2 Multi-layered cylindrical chamber analytic model using IW2D . . . . . . . 4.1.3 RF Measurement using the coaxial wire method . . . . . . . . . . . . . . . 4.1.3.1 Measurement setup . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3.2 Line impedance and adaptation . . . . . . . . . . . . . . . . . . .

Table 1 .

 1 1: Storage ring parameters for ThomX and for a typical 3rd generation synchrotron light source

	Parameter	ThomX	Typical 3rd generation synchrotron light source
	Beam energy E	50 MeV	3 GeV
	Relativistic Lorentz factor γ	98	5870
	Bunch charge Q	1 nC	500 pC
	Number of bunches	1	1000
	Bunch length (rms) σ s	8 ps (at injection) 35 ps (after transient regime)	20 ps (at equilibrium)
	Energy spread (rms) σ δ	0.4 % (at injection) 0.6 % (after transient regime)	0.1 % (at equilibrium)
	Ring circumference L 0	18 m	600 m
	Beam lifetime	10 s	50 h
	Longitudinal damping time τ s	0.6 s	4 s
	Storage time	20 ms	10 h

Table 2 .

 2

	1: Photoinjector design parameters
	Parameter	Value Units
	Beam energy E at exit	5	MeV
	Charge Q	1	nC
	Number of bunches per RF pulse	1
	RF Frequency	3	GHz
	Number of cells	2.5
	Accelerating gradient	80	MV/m
	Repetition frequency	50	Hz

Table 2 .

 2

	2: Linac design parameters
	Parameter	Value	Units
	Beam energy E at exit	50 (70)	MeV
	Length	4.5	m
	RF Frequency	3	GHz
	Accelerating gradient (max)	12.5 (18)	MV/m
	Repetition frequency	50	Hz
	Number of cells	135
	Electron bunch length σ s at the exit (@ 1 nC)

Table 2 .

 2

	3.

Table 2 .

 2

	3: ThomX storage ring design parameters
	Parameter	Value		Units
	Beam energy E 0	50		MeV
	Emittance (rms, normalised) at injection x,y (@ 1 nC)	7 -9	mm.mrad
	Relative energy spread at injection σ δ (@ 1 nC)	0.2 -0.6		%
	Bunch length at injection (rms) σ s (@ 1 nC)	6 -16		ps
	Bunch charge Q	1		nC
	Number of electrons in a bunch N	6.25 10 9
	Circumference L 0	18		m
	Revolution frequency f 0	16.66		MHz
	Revolution period T 0	60		ns
	Number of bunch	1
	Current I	16.7		mA
	RF frequency f RF	500		MHz
	RF voltage V RF	300-500		kV
	Transverse/longitudinal damping time τ x,y /τ s	1/0.5		s
	Momentum compaction factor α 1	0.0124
	Tune x/y, Q x /Q y	3.17/1.74
	Storage time before extraction/injection T store	20		ms
	Clearing gap duration	4		µs
	Clearing electrode voltage	500		V
	Total pressure P 0	3 10 -10		mbar
	Partial pressure of CO, P CO	3 10 -11		mbar
	Partial pressure of H Parameter	Value		Units
	Laser wavelength	1030		nm
	Pulse length at the interaction point Transverse laser size at the interaction point	10 100		ps µm
	Repetition frequency	33.33		MHz
	Input power	50-100		W
	Stored power	300-600		kW
	Maximum energy	46 (@ 50 MeV), 90 (@ 70 MeV)	keV
	Flux	10 11 -10 13		ph s -1
	Spectral width	1-10		%
	Divergence without diaphragm	10 (@ 50 MeV)		mrad

2 , P H 2 2.7 10 -10 mbar the Fabry-Perot cavity is mounted on an hexapod mover. This allows to translate the table by ± 2 mm in vertical and by ± 5 mm in horizontal with a precision of 1 µm and to rotate the structure on three different axes by ± 1 mrad with a precision of 2 µrad. The nominal parameters of the Fabry-Perot cavity and of the input laser are reported in Tab. 2.4. Table 2.4: Fabry-Perot cavity and X-rays design parameters.

Table 4 .

 4

	1: Yokoya factors for an elliptic geometry and R ≈ 0.1765.
	Longitudinal	X dipolar Y dipolar X quadripolar Y quadripolar
	1	0.5627	0.8691	-0.3056	0.3133
	4.1.3 RF Measurement using the coaxial wire method
	4.1.3.1 Measurement setup

Table 4 .

 4 4: Parameter used in CST simulations for ThomX elements: r is the relative permittivity, µ r is the magnetic permeability, σ DC is the conductivity at DC.

	Material	CST Type	r r r	µ r µ r µ r	σ DC σ DC σ DC (S/m)
	Stainless steel 316LN	Lossy metal	1	1	1.3 • 10 6
	Silver	Lossy metal	1	1	6.3 • 10 7
	Copper	Lossy metal	1	1	5.96 • 10 7
	Molybdenum	Lossy metal	1	1	1.82 • 10 7
	Supermimphy L	Lossy metal	1	1 (in simulations)	1.66 • 10 6
				520 • 10 3 @ DC, 80 • 10 3 @ 60 Hz
	Alumina	Normal	9.4	1	0
	Marcor	Normal	6.03	1	1 • 10 -13

Table 4 .

 4 5: RF cavity longitudinal modes simulated with HFSS[START_REF] Khaldi | Simulations and RF measurements of the fundamental and higher order modes of the ThomX 500 MHz cavity[END_REF].

	Mode

Table 4 .

 4 7: Summary of all the elements composing ThomX storage ring and of their relative contribution to the impedance budget. Loss factor k computed for a Gaussian longitudinal distribution of σ = 2 mm.

	Element

  • 10 -9 8.8 • 10 -10

	α 1	0.0124	0.0176	0.0205
	α 2	0.3514	0.3105	0.2772
	α 3	-1.432	-1.095	-0.888
	α 4	6.845	4.480	3.1834
	T s (V RF = 300 kV)

Table 8 .

 8

1: Table of the CO + ion cloud oscillation frequencies computed with Stupakov formula and from NUAGE simulation.

  Ion production, dissociation and multi-ionisation constant values of the volumetric density [CO] and [H 2 ] and gives the system:

7

•10 12 0.05 2 ≈ 4.3 • 10 15 ion s -1 . This rough estimate gives a time to refill the beam volume of 1.6 µs which is small compared to the time period of the system. A simple solution to get rid of this problem is then to consider that the diffusion process is instantaneous so that the two terms of the molecular density evolution in Eq. (9.7) cancel each other. This leads to 9.1.

Table 9 .

 9 2: Value of the M 2 0 and C 0 for the different proccesses and corresponding cross section for a beam energy of 50 MeV[START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF].

	11	0.97	σ 3 = 0.035

Table 9 .

 9 3: Table of horizontal and vertical tune shift due to ion trapping, with and without clearing electrodes. The index x or y indicates the horizontal and the vertical directions. The bar over the quantities indicates that the quantity was computed using mean values.

µs) during which there is no beam. Starting from uniform longitudinal distribution of the ions, an alternation of two cycles is used. First cycle is N = 333000 iterations of the main loop with

Remerciements

Cette thèse a été organisée en deux parties. La première traite de la conception d'un modèle d'impédance longitudinale incluant les champs de sillage géométrique, l'effet des parois résistives et le CSR pour l'anneau de stockage de ThomX afin d'étudier la dynamique du faisceau dans le régime transitoire de micro-paquet. La seconde partie concerne l'étude du nuage d'ions piégé par le faisceau d'électrons et des contre mesures à utiliser pour prévenir la dégradation du faisceau par

gather around the longitudinal position s 0 where the longitudinal beam-ion kick is compensated by the longitudinal drift speed from the dipole: |∆v s (s 0 , x 0 , y 0 )| = |v d (s 0 , x 0 )|. The computation of the static electric field produced by the DC clearing electrodes is done using the low frequency solver of CST [START_REF]CST particule studio[END_REF]. For each system of electrodes, the electric field has been simulated for all the relevant possibilities of potential distribution. Here the results will be presented for the IP bis electrode only, the systematic study of the clearing fields is available in appendix B.

The different configurations possible for the IP bis clearing electrode are shown in Tab. 8.2. By convention the top electrode of IP bis is called n°1 and the bottom one n°2. Their corresponding electric fields in the cavity center are shown in the three plots of Fig. 8. [START_REF] Jacquet | High intensity compact compton x-ray sources: challenges and potential of applications[END_REF]. Configurations +/-and -/+ correspond to classic clearing fields where the ions would be sent toward the wall of the beam pipe with vertical kicks. In the case of configuration -/-, the longitudinal electric field is positive before the electrode center and negative after which corresponds to a Lorentz force toward the electrode for positively charged ions. It is the opposite case for configuration +/+, the longitudinal electric field is negative before the electrode center and positive after which corresponds to a Lorentz force which repels positively charged ions from the electrode. So configurations -/-create artificial accumulation point and configuration +/+ an artificial expulsion point in addition to the horizontal kicks that both configurations produce.

Electrode polarity

Effect on axis The electrode polarity for each electrode is given by the signs + for U = 500 V and -for U = -500 V. The effect on axis corresponds to the effect of the electrostatic field produced by the electrodes on the longitudinal axis (x = y = 0). The colour of the curves representing a given configuration in Fig. 8.15 are in the last column. 9.2. NUAGE post-analysis methodology created during the third turn. Then for the n th turn this gives:

Eq. (9.13) can be rewritten as an integral:

But as it is shown in section 9.1, the number of new ions per turn N new is not constant and depends on many parameters. So, if I consider a variable number of ion created per turn:

(9.15) Which can be rewritten as a sum:

Then, during the clearing gap characterised by the clearing coefficient gap (n), no new ions are produced and the number of ions N ions at time n is given by:

Where n cycle is the time between two clearing gaps, n gaps is the clearing gap duration and N old is the number of ions "alive" at the end of the cycle. Here in order to use the clearing coefficient gap (n), computed after tracking of n cycle turns, I assume that all the ions produced during the first cycle are in their equilibrium distribution (longitudinal and transverse) at the end of the cycle. This is true for most of the ions but the ones produced at the very end of the cycle (the convergence speed toward equilibrium depends on the species). After the clearing gap, the remaining ions have a non uniform distribution in the longitudinal direction and transverse distributions are mixed up. In Appendices Appendix A Equation of motion of a charged particle in a magnetic field in the curvilinear coordinates

The motion of the ions produced from the residual gas is mainly driven by the beam-ion interaction but can also be impacted by the many magnetic fields which are inherent to each accelerators. To take into account the effect of such magnetic fields on the ions, one should derive its equation of motion. The Bassetti-Erskine and Sagan formulas, Eq. 7.43 and Eq.7.56, are derived for the so-called curvilinear frame. This frame, Fig. A.1, uses the (x, y, s) coordinate system, in which the s-axis is aligned with the beam orbit, the x-axis is the horizontal axis and the y-axis is the vertical axis. However when there is a velocity change in the dipole magnets, where the beam orbit is curved, the direction of the Lorentz force does not represent the direction of the velocity change in the curvilinear frame. In order to correctly model the curvature of the orbit, it is necessary to take into account the rotation of the frame direction vectors. The following section elaborates the derivation of the equation of motion of a charged particle in a magnetic field in the curvilinear frame [START_REF] Radevych | Residual ion tracking in ThomX[END_REF]. The dimensionless system of equations which is implemented in the NUAGE code, see section 8.1, is also given.

A.1 Radius vector, velocity, and acceleration in the curvilinear frame

We consider the following curvilinear frame as it is depicted in the Fig. A.1. The longitudinal direction (s-axis) is along the reference trajectory of the electron bunch. The origin of the frame, the point O, is fixed at the laboratory frame. The s-coordinate of a particle is equal to the path length along the electron bunch reference trajectory from the point O to the point M . The radius of curvature is noted ρ(s), and its inverse, the curve parameter, is noted h = 1 ρ(s) . x, y, s are unit vectors along the corresponding axes.

Taking into account the rotation of the unit vectors depending on the longitudinal position of a particle, we get the system of equations A.1. In this case, we assume that the reference trajectory coordinates The curvilinear frame, the s-axis is along the reference trajectory of the electron bunch, the x-axis is the horizontal axis and the y-axis is the vertical axis. lies on the same plane and its y-coordinate is always constant and equal to zero.

Time derivatives can be expressed with a change of the s-coordinate with time:

The unit vector s is tangent to the trajectory:

The radius vector of a particle is expressed as a sum of the vector from the origin O to the reference point M ( OM ) and the vector from the point M to the particle in the xM y-plane, Eq. A.4. The x, y, and s are corresponding coordinates of the particle in the curvilinear frame.

Then the velocity of the particle is equal to the derivative of the radius vector r with respect to coordinates Underlined additional components distinguish the curvilinear coordinates from Cartesian ones.

(A.10)

The expression in Eq. A.11 is used to remove the derivative ṡ from Eq. A.10 and get the final system of equations Eq. A.12:

(A.12)

A.3 Equation of motion in a dipole field

In this subsection, the particular case of a dipole field is considered. The dipole magnetic field is directed along the vertical axis:

Beginning from the system Eq. A.12 for the case of a dipole field:

The radius of curvature ρ can be expressed as a function of the magnetic rigidity where p e is the electron bunch reference momentum and e is the electron electric charge:

ρ = p e eB y .

(A.15)

It allows us to rewrite the system, Eq. A.14, with known quantities:

A.4. Dimensionless system of equations for the equation of motion in a dipole field Finally, it gives the equation of motion of a charge particle in a dipole magnet in curvilinear coordinates:

(A.17)

A. [START_REF] Alwmark | A 3-d study of mineral inclusions in chromite from ordinary chondrites using synchrotron radiation x-ray tomographic microscopy-method and applications[END_REF] Dimensionless system of equations for the equation of motion in a dipole field

For numerical purposes, as the implementation of the equations in NUAGE code [START_REF] Gamelin | Nuage, ion cloud tracker[END_REF], it is required to make the system of differential equations dimensionless. In this paragraph, we omit the vertical components since the equations for them in the dipole magnetic field are the same as in Cartesian coordinates.

Starting from the system of equations for the equation of motion in a dipole field, Eq. (A.17):

The time variable t can be replaced by a dimensionless parameter λ multiplied by some reference time τ (e.g. the duration of one turn in a ring):

Considering relativistic electrons and assuming that their velocity is equal to the speed of light (v e ≈ c), we can replace the coordinates x(t), s(t) and velocities v x (t), v s (t) by dimensionless functions of the parameter λ: ξ(λ), η(λ), κ ξ (λ), and κ η (λ) respectively. In this case, the speed of light c is arbitrary chosen characteristic velocity.

Then time derivatives must be expressed through the derivatives with respect to the parameter λ, Eq. A.21:

The final dimensionless system of equations is obtained from Eq. A.18 -Eq. A.21:

(A.22)

A.5 Equation of motion in a quadrupole field

In this subsection, the particular case of a quadrupole field is considered. The case of a single function magnet is considered, so the quadrupole is placed in a straight section where ρ → ∞. For the case of a combined function magnet, the equations of motions could be derived in the same way using Eq. A.12 and the appropriate magnetic field. A quadrupole with the following magnetic field is considered [START_REF] Latina | Introduction to transverse beam dynamics. lecture 1: magnetic fields and particle trajectories[END_REF]:

where g is a gradient of the quadrupole magnet. If the focusing strength of the magnet k is known, the gradient g can be estimated by: k = g p e /e , (A. [START_REF] Favier | Etude et conception d'une cavité fabry-perot de haute finesse pour la source compacte de rayons x ThomX[END_REF] where p e and e are the momentum and charge of the reference particle that moves along the longitudinal axis of the curvilinear frame. Since a quadrupole placed on straight sections is considered, the system of equations, Eq. A.12, is simplified. The full system of differential A.6. Dimensionless system of equations for the equation of motion in a quadrupole field equations is the same as in the Cartesian frame:

Taking into account the fact that B s = 0 and the magnetic field expression, Eq. A.23, we get the equation of motion of a charge particle in a quadrupole magnet:

(A.26)

A.6 Dimensionless system of equations for the equation of motion in a quadrupole field

Following the same approach with Eq. (A.26), we can change the variables by using Eq. A.27 to Eq. A.29.

(A.28)

Appendix A. Equation of motion of a charged particle in a magnetic field in the curvilinear coordinates

Finally, the dimensionless system of differential equations for the quadrupole field is: and n°2 correspond to classic clearing fields where the ions would be sent toward the wall of the beam pipe, here with both an horizontal and a vertical kick. Configurations n°3 and n°4 create longitudinal electric fields which correspond to an accumulation point for configuration 3 and an expulsion point for configuration n°4. In the case of configuration n°3, the longitudinal electric field is positive before the electrode center and negative after which correspond to a Lorentz force toward the electrode for positively charged ions. It is the opposite case for configuration n°4, the longitudinal electric field is negative before the electrode center and positive after which correspond to a Lorentz force which repels positively charged ions from the electrode. Longitudinal field such as these have been used to trap ions [START_REF] Tavares | Bremsstrahlung detection of ions trapped in the EPA electron beam[END_REF].