Beam simulations with initial bunch noise in superconducting RF proton linacs

Circular machines are plagued by coupled bunch instabilities (CBI), driven by impedance peaks, where then all cavity higher order modes (HOMs) are possible drivers. Limiting the CBI growth rate is the fundamental reason that all superconducting rf cavities in circular machines are equipped with HOM dampers. The question arises if for similar reasons HOM damping would not be imperative also in high current superconducting rf proton linacs. Therefore we have simulated the longitudinal bunched beam dynamics in such machines, also including charge and position noise on the injected bunches. Simulations were executed for a generic linac with properties close to the planned SPL at CERN, SNS, or Project X at FNAL. It was found that with strong bunch noise and monopole HOMs with high Qext large beam scatter, possibly exceeding the admittance of a receiving machine, cannot be excluded. A transverse simulation shows similar requirements. Therefore including initial bunch noise in any beam dynamic study on superconducting rf cavities in high current proton linacs is advisable before envisaging to omit all HOM dampers. Published in PHYSICAL REVIEW SPECIAL TOPICS ACCELERATORS AND BEAMS 13, 011001 (2010) Beam simulations with initial bunch noise in superconducting rf proton linacs


I. INTRODUCTION
In Ref. [1] the necessity of higher order mode (HOM) dampers on the superconducting rf cavities in the SNS [2] linac has been studied.Even if they were not considered absolutely necessary, to be on the safe side, they have been installed.At CERN the SPL [3] project and at FNAL Project X [4] are confronted with a similar decision.Therefore we have examined the question taking into account possible bunch phase noise and bunch-charge jitter at injection, creating an initial seed for all HOMs independent of where their frequency is located with respect to the machine lines.This initial excitation launches under certain conditions for a linac with high Q ext HOMs a beam growth fast enough to create intolerable bunch deviations even during the short beam-pulse duration.
Coupled bunch instabilities (CBI) [5][6][7][8][9][10] are a wellknown nuisance in circular machines for all three phasespace planes (spatial dimensions).Containing the growth of CBI is the fundamental reason for HOM dampers on superconducting rf cavities in machines as CESR, HERA (e), KEK-B, LEP2, LHC, and TRISTAN.In high current factories such as DAÈNE, KEK-B, and PEP-II even the Q 0 with natural damping in normal conducting cavities (in the coarse order of 10 4 ) is not sufficiently low so that special bulky damping systems were added to these cavities.As an additional benefit, such dampers also limit the field rise and power extraction for HOMs accidentally very close to machine lines.
In the transverse planes an akin mechanism plagues linacs, the cumulative beam breakup [11,12].Until recently, all sizable linacs accelerated only electrons, which become highly relativistic easily and hence showed practi-cally no time-of-arrival shift due to energy deviations (stiff beam).This has recently changed with the advent and plans for large superconducting p linacs, an important detail.
In fact, an essential ingredient in the CBI mechanism is that an initial momentum deviation creates bunch position deviations over drift spaces.In the longitudinal plane this means that bunch n does not arrive perfectly regular at n Á T; due to the energy deviation dE n it gets a time-of-arrival deviation dt n .Then for the heavy protons, not easily becoming highly relativistic (soft beam), a fresh examination of a possible cumulative breakup in the longitudinal plane is appropriate.
In the following we will therefore examine by simulation the beam dynamics of a linac in the longitudinal plane with low initial noise on the beam at injection.We will find conditions for an excitation, possibly driving the beam out of its design acceptance, including in a receiving machine.Some more theoretical considerations explaining the interaction of a long bunch train/pulse and an HOM at any arbitrary frequency (far away from all machine lines) are included in [13], as well as a three-cavity model demonstrating the self-exciting mechanism by mathematical analysis and numerical iteration.
As initial excitation, for choice of the ''seed,'' three mechanisms have been considered.First, even a perfectly regular beam without noise excites an HOM at any frequency.
The second seed considered is the (longitudinal) dt position noise of bunches at injection.A Gaussian scatter of ¼ 0:1 ps was applied and the created growth was considerably wider than caused by the initially regular beam only.
The third seed is the intensity noise of bunches at injection.From today's knowledge a bunch-to-bunch H À intensity scatter of 1% is not unrealistic [14], better data will be known once the LINAC4 source is running.Hence, a Gaussian scatter with q ¼ 1% was assumed and this created an even wider beam spread.
The spectrum of the bunch noise decides which HOMs may be exited by it.A sharp frequency in the bunch jitter appears in the beam spectrum above and below each machine line at k=T AE with the interbunch time T and the integer machine line index k.Therefore a jitter noise band between zero and an upper limit f up will show up as antisymmetric bands around each machine line (see sketch in Fig. 1).For a flat jitter spectrum with f up ¼ 0:5=T (172 MHz for SPL) bands would mutually touch (white noise) and hence all HOM frequencies are excited.Since the expected bunch length is in the few ps range, this beam spectrum will be sizable up to several 100 GHz.
For the real machines each beam pulse (about 1 ms length) is chopped many times with possibly varying pattern.SNS has to inject only into the accumulator ring (fixed kicker gap pattern) but Project X has a double chopping pattern and SPL will have several clients (as all LHC filling pattern, ISOLDE, SPS fixed target physics, PS2 physics) with differing chopper requirements.This chopping creates many secondary machine lines around which the basic noise bands then also appear (see sketch in Fig. 2).
To cover all these cases for the generic linac considered here, we assume a white noise spectrum, i.e., every mode has the same expectation value for the exciting rf current component.

II. BASIC RELATIONS
It is easier to use complex notation for voltages with the convention that the observed physical quantity is the real part of the complex variable.As time dependence we use the factor expðþi!tÞ, fixing the sign of the imaginary part.
Since bunches are very short compared to even the highest considered HOM wavelengths, the mutual bunchcavity interaction is well modeled with ''point bunches.''Particle losses from weakly populated bunch tails (halos) are not explicitly considered in this paper.
The interaction between a charged particle-or a point bunch-and a longitudinal cavity mode (HOM) works in two ways.First, beam loading takes place, i.e., the charge q induces in an HOM of angular frequency !H and geometrical constant (R=Q) (circuit ) a decelerating (negative) real voltage Fields superimpose, hence 1 the complex induced voltage ÁV ind adds to any existing complex voltage V H . Second, if the HOM is already excited by a complex voltage V H , any particle passing the cavity (i.e. its reference plane) at t ¼ t 0 meets the energy change Furthermore, each particle feels half of its own induced voltage as deceleration and it is easily seen that the same holds for (the average particle energy of) point bunches.This effect is local to the bunch; the energy loss is hence independent of any passage time t 0 : When a bunch passes a driven accelerating cavity, the accelerating mode also has to be taken into account.For a realistic machine the main rf voltage V rf is stabilized, e.g., by an rf vector feedback.Therefore one can consider the beam loading in the accelerating mode as perfectly compensated, i.e., nonexistent.V rf is then always well phase  adjusted to the nominal time of arrival so that particles in nominal bunches see the energy gain ÁU: Then particles in a true bunch with a time lag dt (positive for later arrival) see a different acceleration by the main rf, deviating by This effect provides (for s < 0) the longitudinal focusing, faster (slower) particles getting less (more) energy than nominal ones.On purpose in the simulation and despite costing CPU time dU rf is not linearized [ À eV rf !rf sinð s Þ Á dt] to keep perfect precision; dt amplitudes can get large when growth develops.Now we assume an HOM already excited in that cavity that has in the instant when the nominal bunch would pass the complex reference voltage V H;ref .But the true bunch is late by dt (defined as early if dt < 0), i.e., the voltage at the passage of the true bunch is neglecting the mode attenuation effect during the small time interval dt.Then the particle energy change due to V H , taking also (3) into account, becomes ) Also here we have renounced linearization.Then the energy deviation after the interaction with cavity m, as seen at cavity (m þ 1), becomes The bunch induces a purely real voltage in the HOM, i.e., just after the bunch passage the voltage becomes with V H;b of (6).For the following calculations we want to be independent of this ''obsolete'' dt and we transform this voltage to the reference time 2 in multiplying with expðÀi!H Á dtÞ, yielding and since ÁV ind is purely real These relations express a single interaction of an HOM with a bunch that is dt off its scheduled time of arrival.Reference voltages V H;ref are expressed for the nominal time of arrival and are hence independent of all dt.Now we apply these relations for a bunch train (or beam pulse), where nominal bunches would arrive at regular time intervals T (interbunch time).During the time T the phase advance Ác H of this HOM is given by and the absolute voltage attenuation factor ja H j is so that the HOM reference voltage V H;ref changes from the reference time n Á T to the next one ðn þ 1Þ Á T by the complex factor a H : To obtain then the reference HOM voltage for the following reference time ðn þ 1Þ Á T when the next nominal bunch is scheduled, we simply use The relativistic relation between the total energy E, equal E kin þ m 0 c 2 , and the particle speed v is The time of flight t f on the fixed (reference plane) distance L between adjacent cavities is given by These equations can be combined, expressing the time of flight as a function of ¼ E=m 0 c 2 : This yields in first order for small energy deviations dE the variation in time of flight The ''À'' sign is justified since particles with higher energy are faster and hence have smaller time of flight, i.e., negative dt.
At cavity (m þ 1) the time-of-arrival variation dt ðmþ1Þ with respect to the nominal time of arrival is the sum of dt ðmÞ , the already accumulated time lag at cavity m, and the time-of-flight variation between cavities m and (m þ 1), hence with ðdt=dEÞ E from expression (19); ðdt=dEÞ E is expressed 2 This method appears to violate causality for bunches arriving after the reference time (dt > 0).But this ''old'' reference voltage will not be used as such but only for extrapolation to a ''new'' reference voltage far in the future, hence causality is conserved.for an average energy between the centers of the adjacent cavities.Here we can use linearization since dE is always very small compared to the total energy.

III. PRACTICAL EXECUTION OF THE SIMULATION
We blindly launch bunch after bunch into the linac and let the computer, imitating nature by the model described before, decide step by step what happens.
When a nominal bunch travels along the linac, at each cavity its energy increases due to the main rf as given by (4); the rf phases are assumed adjusted with the corresponding time of flight, then always presenting the desired phase angle.This allows expressing the (nominal) bunch energy at each cavity and precalculating and memorizing all data needed that do not depend on dt, dE, or any HOM voltage.This avoids multiple calculations and hence minimizes CPU time.In principal, each cavity may have its distinct parameters but for simplicity (generic linac) we assume the same values except the HOM frequencies f H .
Each cavity has its own (memory for the) complex HOM reference voltage V H;ref and its own shifted clock: t ¼ 0 is defined when the first nominal bunch passes (the reference plane of) this cavity.This avoids a clumsy explicit consideration of the (nominal) time of flight from the start of the linac to that cavity.
The central part of the program tracks a single bunch through the linac.Bunches may have an initial dt (or dE) jitter or a charge jitter; if any of these options is declared to be active, these starting values are determined at random with the agreed distribution function and width parameter.
The bunch n enters the first cavity with the initial deviations dE ð0Þ , dt ð0Þ , and dq; it gets after the cavity a new energy deviation dE ð1Þ given by (8); the first cavity reference voltage is modified as prescribed in (11) and (15) to be ready for the passage of the next bunch in this cavity.The time-of-arrival deviation dt ð1Þ at the following cavity is determined by ( 19) and (20).Now dE ð1Þ , dt ð1Þ , and the (memorized) reference voltage V H;ref of the second cavity allows determining the following step similarly, and so on until the last cavity.After the last cavity M, the final dt ðMÞ and dE ðMÞ are the values at ejection.Now all memories of the cavity HOM voltages contain the values the following nominal bunch (n þ 1) would encounter at its passage.
In this way all bunches of a pulse are tracked one after the other through the linac, each one entering with its own random deviations dE ð0Þ , dt ð0Þ , and dq (if active) and encountering the HOM voltages left back from the previous bunches.When !H Á dt ðmÞ leaves the range between Àj s j and þ2j s j, tracking of the following bunches is aborted considering all following calculations useless since the following bunches will not get correctly accelerated anymore.But this option can be disabled to track even such bunches.
At the beginning for a new random HOM setting-i.e.new central HOM frequency hf H i between two adjacent machine lines and new scatter around it with supposed distribution function-all HOM voltages are considered zero.For Q ext !some 10 7 non-negligible fields from the previous pulse survive the beam-pulse pause, the following pulse then getting an immediate modulation from the start on and showing an increased tendency for instability.Therefore the decaying HOM voltages are tracked over the beam-pulse pause until the start of the next beam pulse.For the highest assumed Q ext ¼ 10 8 , the voltage descent during the beam-pulse pause can be estimated to at least 50%.
For a pulse repetition rate of 50 Hz, a change of HOM frequency by only about 25 Hz changes a constructive to a destructive resonance condition for that HOM and vice versa.The HOM frequency scatter is considerably larger than 25 Hz, hence nothing definite is known on the resonance condition and the outcome depends entirely on very fine details in the random frequency choice.Therefore also here Lorentz force detuning and microphonics are considered comprised within this f H random choice.
To simulate definitely independent pulses, it is possible to enforce zeroing for all HOM voltages at the start of each new beam pulse.
For the sake of principle, the pause time is (microscopically) adjusted to become an exact multiple of T; but this is of no true importance since the HOM frequency has no definite relation to 1=T.
Three independent random generators were defined, each having its own random seed.They are based on the Mersenne Twister [15], a modern high quality random generator with high sequential independence.The first generator determines the center values hf H i of the HOM frequencies, the second the scatter of the individual cavity HOM frequencies f H around hf H i, and the third one the bunch-noise sequence.Random seeds are either fixedproducing always the same random sequence as needed for debugging or showing coherent results from different runs-or being defined as a function of the computer clock, each run automatically producing a new random sequence.
This program structure allows studying the three dependencies independently, e.g., letting one linac-i.e.always the same hf H i and frequency scatter around it-be exposed to different sets of bunch noise or expose the same bunch noise to different linacs.At the end of each pulse plots can be made: (i) phase-space map of the bunch centers (dt ejec , dE ejec ); (ii) ejection dt ejec or dE ejec as a function of bunch number, showing the growth of ejection envelope with time; (iii) the absolute HOM voltage of any (prechosen) cavity at the bunch passages for a full pulse; (iv) the remaining absolute HOM voltages in all cavities after a pulse; (v) track of dt or dE for the last bunch, generally about the worst one, along the linac, i.e., at all cavity locations.J. TU ¨CKMANTEL Phys.Rev. ST Accel.Beams 13, 011001 (2010)

011001-4
Furthermore the program can make histograms over different HOM conditions, e.g., 2500 statistically independent machines.For each new ''event'' an HOM center frequency hf H i is chosen at random with equal probability between two predefined machine lines.Then the individual cavities get an HOM frequency f H attributed scattered with Gaussian distribution around hf H i. One or several consecutive pulses can be run through this setup.Histograms can be made of: (i) the worst and rms values of dt eject or dE eject calculated over a full pulse; (ii) the highest absolute voltage encountered in any cavity at the end of a pulse; (iii) the last bunch number tracked, showing the ''abort history'' of pulses; entries in numbers less than 400 000 show bad instabilities with aborted pulses.
Finally, the beam current I b and the HOM frequency scatter width Áf can be varied and the worst and rms dE eject and dt eject are displayed.

IV. PROGRAM CHECKS
Equations ( 1)-( 15) also describe the longitudinal CBI physics in a synchrotron.Only the continuous injection of new bunches in a linac has to be replaced by a limited set of repeating bunches and, assuming a localized HOM, ðdt=dEÞ E of (19) has to be replaced by the change of T rev proportional to dE (momentum compaction).
As a check we have created a correspondingly slightly modified version of the simulation program.We have run it for parameters as LHC at injection (450 GeV=c) but with only 405 regularly distributed bunches3 without gap.The driving HOM is assumed at a single location in the ring.For the first run f H is assumed Áf % 5 Á f rev away from the closest machine line (f ML ¼ 3 Á f rf was used).Figure 3 shows the development of the dt of bunch #0 at the cavity as a function of the turn number; all other bunches behave similarly.The simulation shows a dt (synchrotron) oscillation with about 65 Hz, as to be expected for LHC at injection, and the amplitude of the oscillation grows exponentially due to CBI as it should in the present case.
A snapshot of the longitudinal position deviations dt n of all 405 bunches along the ring circumference shows a very clean sinusoidal pattern with five crests and troughs (Fig. 4).This pattern has developed on its own ''out of nothing'' during the calculations, as expected by the CBI theory.In fact, when this pattern runs f rev times per second around the ring, for an observer at rest this is a traveling wave with Áf ¼ 5 Á f rev .Therefore this moving pattern can ''impact excite'' any resonator-as a spectrum analyzer or an HOM-at this frequency. 4It is irrelevant if this resonator executes another integer number of oscillations between two sequential bunches; hence, a resonance condition exists for all f H differing by the above Áf (see footnote) from the closest multiple of the interbunch frequency (machine line).
A further example was run with Áf % 21 Á f Rev and a similar snapshot (Fig. 5) shows a pattern with 21 crests and troughs along the ring developing on its own out of nothing, resonant with its driving f H .
These simulation results agree with all expectations and give confidence that the beam physics is well modeled in showing a synchrotron oscillation of dt with a frequency of about 65 Hz (displayed on 2500 machine turns % 220 ms) with an exponentially growing amplitude due to coupled bunch instabilities (CBI).
dt at turn 2500 the program and, hence, it will also give correct results for a linac, i.e., for a sequence of always new bunches.

V. COMMON INGREDIENTS
Many parameters of SNS, SPL, and Project X do not differ considerably.In the following we assume a generic machine similar to SPL but using for yet not well-defined parameters settings taken over from [1] used for the SNS simulations.In particular, we also use as a worst case a cavity-to-cavity HOM frequency spread of only 0.1 MHz, a longitudinal (R=Q) of 5 up to 50 as well as a transverse ðR=QÞ ?¼ 50.These values also match well the ones found for the presently considered high-SPL cavities.We also apply the same safety factor as [1] with a beam current exaggerated up to 10 times the design value.
All superconducting cavities encounter microphonics and (pulsed) Lorentz force detuning.But the frequency stroke is in the worst case much lower than the minimum assumed HOM frequency spread.Therefore we consider that these two effects are in the statistical sense covered by the HOM frequency spread and do not need a dedicated modeling.
All finer details as, e.g., the variation of (R=Q) with particle speed along the linac are ignored in the present generic model, an average (R=Q) is assumed for all cavities.Possible micropulse structures are neglected and homogeneous macropulses of 1.2 ms duration (SPL) are assumed with a bunch repetition rate of f b ¼ 352:2 MHz, corresponding to about 400 000 bunches.
Bunches are short and are treated as points of charge n p Á e; problems concerning particle losses from bunch halos are not analyzed here; they will ask for even higher beam quality than estimated here.
The main rf in the superconducting section is working at twice the bunch frequency, i.e. f rf ¼ 704:4 MHz; Project X intends to run at the ILC frequency of 1.3 GHz.Artificially the bunch charge can be scattered, e.g., by ¼ 1%, and/or the interbunch time can be scattered at random, e.g., in the range of AE0:1 ps.
The accelerating voltage is assumed the same for all 250 cavities with V rf ¼ 20:7 MV and the stable phase anglemeasured from the top of the rf voltage-is assumed s ¼ À15 as foreseen for SPL so that particles see 20 MeV energy increase at each cavity, i.e., in total 5 GeV acceleration. 6Injection energy is assumed at 160 MeV.
The average (''drift'') distance from cavity center to cavity center is assumed 2 m as for SPL (246 cavities on 502 m).Longitudinal focusing is guaranteed by the abovedefined main rf.

VI. PROGRAM RUNS
We separate the program runs into three main parts.In the first one we assume a center mode frequency hf H i without any relation with respect to machine lines.For the presented runs hf H i is assumed anywhere between h ¼ 6 (2212 MHz) and h ¼ 7 (2464 MHz), corresponding to 3 to 3.5 times the fundamental mode frequency of 704.4 MHz.The initial excitation for growth comes out of the beam noise, generally much larger than the noise-free excitation starting with a regular beam.As an example, we will  examine a single typical linac while injecting always the same beam (scatter) but vary Q ext of the (single) HOM and show the importance of the different components hf H i, the f H scatter around this value, and the bunch scatter at injection.Finally, we will make histograms over 2500 linacs, established in ''rolling dices'' concerning hf H i, the f H scatter around hf H i, and the bunch scatter at injection.
In the second part, we will study the superposition of beam excursions caused by several completely incoherent modes.This consideration is important since-as will be shown in the first part-not only modes ''close to a machine line'' contribute but equally all modes wherever their hf H i is.Then there are many more contributing HOMs than when all modes somewhat away from machine lines are considered as excluded.The maximum possible bunch excursion in dt and dE takes place when all individual amplitudes add up (worst case).
In the third part, we will show a set of examples with conditions as in the first part (including identical f H scatter) but forcing hf H i relatively close to a machine line-but still many bandwidths away, so no real coincidence takes place.It illustrates the additional danger if modes are close to a machine line where the ''noise-free'' excitation starting from a regular beam is much larger than the one from bunch noise.
For a typical linac as used here, Table I shows for a few selected cavities the cavity number, the nominal particle momentum at this cavity, the applied random HOM frequency deviation Áf H with respect to the nominal value, and the time slip dt=dE.
For completeness also some examples in a transverse plane with a dipole mode are shown.

VII. THE GENERAL FREQUENCY CASE
We examine first the increasing scatter of the bunch centers at the end of the linac (ejection) in longitudinal phase space ðdt; dEÞ.
We apply an example of the generic machine defined above having a single HOM with a center frequency about halfway between two machine lines (h ¼ 6:484 45), far away from any machine line hit.We assume this linac in two otherwise perfectly identical incarnations only differing in Q ext ¼ 10 8 or 10 7 .We display the position of all bunches at ejection in phase space.Also the emerging bunch pattern for different h will be examined.Other corroborating plots (as dt and dE along the pulse, excited voltages in different cavities) are shown in the Appendix.Then for Q ext ¼ 10 8 and 10 7 we create 2500 different linacs at random and make histograms of important quantities.For each (random) linac the center HOM frequency is somewhere (flat probability) between two adjacent machine lines h ¼ 6 and h ¼ 7 and the individual HOM frequencies are scattered around this center frequency (Gaussian distribution).
Similar to what was done in [1], we assume ðR=QÞ ¼ 50 circuit ( ¼ 100 linac ) and a beam current of 400 mA, about 10 times the design current and, hence, exaggerating here as a safety factor.The HOM frequencies scatter around the center value is Áf ¼ 100 kHz.We run two consecutive pulses of 400 000 bunches (1.2 ms) without zeroing the cavity voltages between and display the results of the 2nd pulse.This is done since for about Q ext ! 3 Â 10 7 non-negligible fields survive the beam-pulse pause until the start of the second pulse, changing the results; this method is preserved also for Q ext 10 7 to display perfectly comparable cases, including the same beam noise.
There are three different types of initial beam excitation to be considered.However, it reveals that the bunch-charge jitter is by far the most dangerous one.This can be demonstrated easily (done for the Q ext ¼ 10 8 case here).The phase-space plots shown here always depict the location of the 400 000 bunch centers of one pulse at ejection.To see the differences immediately, the graphic scaling is always the same, chosen such that all tested cases fit in it.
In Fig. 6 no injection beam noise is applied but only HOM excitation by the initially perfect beam.As to be expected, not considering the bunch noise leads to a relatively stable beam with only tiny excursions.Next we take the bunch position (phase) noise into account with a Gaussian profile of ¼ 0:1 ps. Figure 7 shows the phase-space plot at ejection, the covered area is considerably larger.Finally we take a Gaussian bunch-charge scatter with ¼ 1% into account.Figure 8 shows the result and one sees that the covered phase-space area is much larger than the two previous ones.Therefore it is clear that this type of scatter is the most dangerous one, the others can be neglected in the future.For this reason we will from now on only examine cases with this type of initial noise (except if explicitly stated different).
Figure 9 shows the excited voltages left after these two pulses.One sees that most cavities are relatively weakly excited while a few, close the ''best compromise frequency'' on which the beam is excited, are driven to considerably higher voltages.This clearly shows that there is no law of large numbers for this aspect; different linacs can show quite different behavior.Further graphic displays for this case can be found in the Appendix.
Figure 10 shows the same distribution but for the first pulse.One sees that the second one covers a larger phasespace area, hence the fields surviving the beam-pulse pause were supporting.
Figure 11 shows the equivalent phase-space plot as Fig. 8  conditions.One sees that there is no fundamental difference to Q ext ¼ 10 8 , far away from the factor 10 of the ratio of the Q ext .This can be understood in considering that even for Q ext ¼ 10 7 the voltage rises nearly linear during a beam pulse of 1.2 ms and the voltage is then (practically) independent of Q ext .Further plots for this case can be found in the Appendix.
Figure 12 shows the equivalent phase-space plot for Q ext ¼ 10 6 , otherwise the same conditions as before.One sees that here the scatter in the phase space at ejection is strongly reduced but still not perfect for a beam with good quality for injection into a following machine.

A. Different beam pulses in the same linac
To compare the effect of different (statistically independent) bunch-charge sequences at injection, we have chosen the case of Q ext ¼ 10 7 , where no significant field survives the beam-pulse pause.We show different parameters for  four (independent) pulses.We see in Fig. 13 that the details of the result are slightly different but the coarse behaviorthe covered phase-space area-is relatively independent of the injected noise sequence within, say, a factor 2. This is understandable since there are 400 000 random data, hence the spectral contents of different series do not differ significantly.
When comparing the induced voltages in Fig. 14, the cavity with the highest excitation is not always the same one.This shows that the best compromise frequency on which the longitudinal bunch excitation establishes itself can flip to another pattern if the injected noise contains slightly different random spectral components.

B. Different hf H i with same f scatter and noise
Here we compare four linacs with random HOM center frequency hf H i (the random procedure chose h ¼ 6:272 96, h ¼ 6:029 32, h ¼ 6:590 20, and h ¼ 6:081 58), all far away from any machine line.The f H scatter relative to this center frequency and the injected bunch-charge sequence are identical in all four cases (same random numbers).One sees in Fig. 15 that the results are quite similar, i.e., as to be expected the position of hf H i is of no real importance, the HOM filters its own frequency component out of the bunch noise wherever hf H i is located.This is an important result, demonstrating the already theoretically expected [13] independence concerning hf H i. This means that not only modes close to a machine line are dangerous but-for otherwise same parametersall equally contribute to a growing beam scatter.

C. Different f scatter with same hf H i and noise
As a last step, we compare four linacs with different f H scatter around the same ''standard'' center frequency hf H i (h ¼ 6:484 45) and identical injected bunch-charge sequence.While cases 1 and 4 (Fig. 16) are roughly average, for case 3 the covered phase-space area is much smaller than the average one while case 2 even does not fit in the (common) display scaling.In fact this pulse was aborted (in a real machine triggering an interlock) after about 248 000 bunches since dt was so large that it went out of the bucket where acceleration gets lost.One sees that the ''random decision'' in the HOM frequency scatter has a very large influence on the result, i.e., there are ''lucky'' and ''unlucky'' linacs.This is understandable since-in contrast to 400 000 bunches-for only 250 cavities the net effect of the individual ''choice'' can differ a lot from case to case.

D. Emerging bunch pattern
In Sec.IV, we have shown that for CBI in a synchrotron-as it should be-bunch sequences develop out of nothing that have a pattern matching as traveling wave the frequency of the driving HOM [modulo the bunch repetition (machine line) frequency f ML;K ¼ K=T].The strong beam deflection observed also for the linac case arouses the suspicion (and can also be guessed from theoretical considerations, see e.g.[13]) that a similar resonant mechanism, alternately driving HOM voltage and beam excursion, is active in the linac case.
Therefore we have a look now at the dt n of bunches at the end of the linac.To get a good graphic resolution for the individual bunches, displayed as red dots, we have plotted only the last 30 bunches of the full pulse, while arbitrarily choosing four different h ¼ hf H i Á T that differ by some integer multiple of 1=30 from integer (K ¼ 6).
For the case h ¼ 6:0333, displayed in Fig. 17, top left, a smooth pattern with one crest and trough on these 30 bunches developed out of nothing (noise) during the calculations.In fact here h ¼ 6 þ 1=30, hence to match hf H i ¼ ð6 þ 1=30Þ=T a bunch-to-bunch phase advance of 2=30 radian in the developing pattern could be guessed already, i.e., one crest and trough per 30 bunches just as the simulation developed on its own.Figure 17, top right, shows the case h ¼ 6:0666 where two crests and troughs developed on these 30 bunches, i.e., a bunch-to-bunch phase advance of 2=15 radian, well matching h ¼ 6 þ 2=30.Figure 17, bottom left, shows the case h ¼ 6:2 with six crests and troughs on these 30 bunches, well matching h ¼ 6 þ 6=30.Finally, 7 h ¼ 6:501 is displayed, Fig. 17, bottom right, with one crest and trough for any two bunches, i.e., 15 in all on the 30 bunches, well matching h In all these cases these patterns, which developed on their own during calculations, and the expectations agree very well.Compared to the CBI cases as shown in Figs. 4  and 5 the present patterns are less pure sinusoidal since more noise components are admitted during their formation along the 400 000 ''randomized'' bunches, i.e., small components of other harmonics are added and mixed.

E. Histograms
After having studied very few typical cases in more detail (also see the Appendix for corroborating plots), we shall examine now 2500 statistically independent linacs and make histograms.Each linac has its own (single) hf H i-flat probability between h ¼ 6 and h ¼ 7-a different set of HOM frequency scatter around hf H i-Gaussian FIG.16. (Color) Phase-space plots for four different choices of random f H scatter with the same Áf , identical HOM center frequency hf H i (h ¼ 6:484 45), and the same bunch-charge sequence each.Scaling ½AE3 ps Â ½AE5 MeV. 7Precisely h ¼ 6:500 was one of the cases where accidentally the pulse had to be abandoned prematurely.It was already on its way out of the main rf bucket for these last 30 bunches; hence, the only slightly differing h ¼ 6:501 was examined.
with Áf ¼ 100 kHz-and a different bunch-charge sequence-Gaussian with q ¼ 1%.Each of these 2500 linacs will have two incarnations, only differing in Q ext ¼ 10 8 and 10 7 ; this allows creating two sets of histograms to compare the effect of different Q ext in a statistically significant manner.
We run two consecutive pulses (i.e.5000 pulses in total) and the worst as well as the rms value in dt and in dE were collected in a histogram.Since some pulses had to be aborted when dt became so large that it left the bucket, we have also made a histogram of the last ''surviving'' bunch number.In a perfect case all entries should end up in the highest bin (all bunches passed), i.e., 5000 counts are expected, but in reality there are nonzero bins much lower, indicating aborted pulses.
Finally, the highest excited voltage of any cavity was also collected in a histogram.Figure 18 shows that about 300 pulses did not pass completely and had to be aborted prematurely (dt went out of the bucket, losing this bunch and following ones due to lack of acceleration).In a real high current machine, especially when radioactivation is an important issue, this is not tolerable.
Figure 19 shows the histogram of dE for the worst deviation (red), going up to 30 MeV, and the rms values.Figure 20 shows the similar distributions for dt reaching up to about 50 ps.
Figure 21 shows a histogram of the highest voltage in any cavity at the end of the pulses; in a few cases even 20 MV were obtained.

Case
Figure 22 shows that even for Q ext ¼ 10 7 still about 100 pulses did not pass completely (highest bin).In a machine where radioactivation is an important issue, even this is hardly tolerable.
Figure 23 is equivalent to Fig. 19, Fig. 24 equivalent to Fig. 20. Figure 25 shows the histogram of the highest voltage in any cavity at the end of the pulses; in a few cases even 10 MV were obtained.

F. Parameter scans
In the following we show plots for the standard linac of the worst and average dE and dt while varying the beam One sees that an increase of the HOM f scatter Áf rapidly enforces a decrease of the bunch excursions.For the beam current scan in all cases, the bunch excursions increase more than linearly with the beam current.

VIII. SUMMING OF MANY INDEPENDENT MODES
We have seen before that not only very few (if any) modes very close to a machine line present a danger but that any mode drives beam scatter growth-provided (R=Q), Q ext and the distribution of f H around its center value are appropriate.On the other hand, the growth mechanism builds on a resonant interaction of the HOM field and a bunch pattern (longitudinal dt pattern here).When several independent modes participate, the bunch sequence modulation becomes the superposition of the individual contributions.
Therefore in this second part we will now study the summing-up effect of many independent HOMs.The ex- isting program foresees only one HOM per cavity.To get a first idea without major program modifications, again we allocate to each cavity only a single HOM with the mode properties of Fig. 8.But the individual f H will be so widely scattered (flat probability) in a range of 352.2 MHz, between h ¼ 6 and h ¼ 7, so that all these HOMs can be considered independent.This means that a beam oscillation in dt and dE driven by one more upstream cavity is not picked up resonantly by a more downstream cavity and then enhanced.The fields are driven solely by the ''random walk'' of the beam noise.Then initially the HOM amplitudes rise with about the root of the bunch number (i.e. also time); this rise levels off when saturation is attained during the pulse of 1.2 ms which is the case for Q ext below some 10 6 .But even under these ''unfavorable'' conditions the phase space at ejection with Q ext ¼ 10 8 (Fig. 34) and Q ext ¼ 10 7 (Fig. 35) shows still significant scatter and one has to go down to about Q ext ¼ 10 6 (Fig. 36) to have a really stable beam.Figure 37 shows all final cavity voltages for Q ext ¼ 10 8 .Even then there are a few cavities having an increased voltage compared to the average.This could be explained that these few cavities are accidentally close in frequency and collaborate to enhance the beam oscillation there.
To weigh the danger of this process, one should keep in mind that the present simulation considers only a single independent mode per cavity, but in reality each cavity may carry several, say N, independent dangerous modes.Because of the statistical independence of the modes it is to be expected that the 2D phase-space area will be larger Also no threshold in beam current is to be expected, i.e., even a large number of only ''weak'' modes can drive the beam apart.
Evidently the danger will be even larger when there are independent HOMs but each one having about the same frequency in each individual cavity, then resonantly enhancing the beam-oscillations along the linac.

IX. MODES CLOSE TO A MACHINE LINE
Now we will examine in the third part the same linac already seen in the previous examples with Áf ¼ 100 kHz f H scatter.But now we will force the central HOM frequency hf H i to be only 100 kHz, 300 kHz, or 1 MHz away from a machine line (and will disable the bunch noise for simplicity, it can make things only worse).Since the f H scatter is at least 100 kHz, bringing hf H i closer than 100 kHz towards the machine line will not change things essentially.Modes with ðR=QÞ ¼ 50 are very rare, so we have tested with ðR=QÞ ¼ 5 , 1 , or even 0:2 where modes are much more frequent and one |V| after passage of bunch 400000, pulse 2   II shows the tested conditions with the corresponding figure numbers; cases where a ''pointlike'' beam could be extrapolated from previous runs with worse conditions were not executed

X. TRANSVERSE SIMULATIONS
Initial bunch noise can be a driver for transverse beam blowup as well.One type of transverse noise consists of a scatter in transverse injection position or angle.But also bunch-charge scatter creates similar excitation if the beam is not injected perfectly on axis.It is easy to see that, e.g., for a perfect injection adjustment a transverse injection jitter of 10 m is statistically equivalent to a fixed 1 mm injection offset with a 1% charge jitter.
Since a possible problem was already shown for longitudinal beam dynamics, we will show only two transverse examples to demonstrate that the situation is equivalent.
The Panofsky-Wenzel theorem [16] in its enhanced form [17,18] is valid for any confined cavity mode; assuming time dependence as expðþi!tÞ it states8 The transverse voltage V ? is defined by the relation hence, for any mode field Dipole modes, representing the essential transverse impedances, have a longitudinal voltage proportional to the off-axis position x (in good approximation close to the axis).For dipole modes (21) means then that the transverse deflection Áp x is independent of the off-axis position x at which the deflected particle passes the dipole field.
The fact that V z ðx 0 Þ=x 0 is constant for dipole modes also allows defining a transverse ðR=QÞ ?, independent of the field excitation strength and the position x 0 where the longitudinal voltage integration for V z ðx 0 Þ was executed: It is identical to This constant allows obtaining the transverse voltage induced by a (point) charge q, proportional to the off-axis distance x by The factor i expresses the fact that ÁV ? and the longitudinal V z ðxÞ are 90 out of phase.
For the transverse momentum p x and the longitudinal momentum p z , the particle track has the slope x 0 ¼ p x =p z .At each quadrupole of the focusing system, the particle gets a deflection Áp x proportional to x.Instead of modeling all individual F and D quadrupoles and drift lengths, a smooth focusing description is used here.The local focusing strength is expressed by the (local) function.Over the cavity-to-cavity path length L-for which is assumed constant-the displacement x and the slope x 0 transform as As it should be, the determinant of the transfer matrix is identical to 1, conserving transverse emittance.Without deflections from transverse HOMs a particle executes a transverse oscillation with wavelength 2. With these ingredients one can track the variables x and x 0 ¼ p x =p z .The locally encountered momentum deflection for a given cavity V ? is defined by (22)-in contrast to the longitudinal case there is no self-deflection-and the newly induced ÁV ?by (26).The variables x and x 0 just behind the (reference plane of the) previous cavity are tracked by (27) just in front of the (reference plane of the) next one.
In principle, as shown above, there is also an associated longitudinal voltage V z ðxÞ and a corresponding change in time of flight.However, for realistic transverse amplitudes (some mm) this effect can be neglected and bunches are assumed perfectly on time for the transverse simulations.In contrast to the longitudinal simulations, where the HOM waveform induces nonlinearity, the transverse case is perfectly linear then.The beam path appears infinitely wide but in reality the beam would hit the beam pipe once the excursion exceeds it limits.
As done in the SNS simulations we use a peak transverse ðR=QÞ ?¼ 50 (circuit ).The transverse focal period length is assumed constant at 55 m ( ¼ 55 m=2) as for SPL at the start of the linac.It is assumed constant along the linac, while the SPL focusing gets even weaker along the linac.For Áf ¼ 100 kHz, 10 m transverse injection jitter and Q ext ¼ 10 8 we obtain the transverse phase-space image for the second pulse as Fig.48 with excursions of up   to 100 mm, well out of a realistic beam pipe for such a machine.Figures 49 and 50 show the corresponding x 0 and x at ejection for all 400 000 bunches. Figure 51 shows the transverse voltage after the last bunch, reaching up to 30 MV. Figures 52 and 53 track x 0 and x for the last bunch along the linac.
A second series of plots shows the equivalent situation but for the first pulse (Figs.54-56).It is clearly visible that there is a considerable emittance growth from the first to the second pulse.For even later pulses (not shown) this growth continues about exponentially, hence for Q ext ¼ 10 8 and Áf ¼ 100 kHz the assumed 400 mA beam current is above the threshold current.Figure 57 shows the remaining transverse voltage after passage of the first pulse.
Finally, for Q ext ¼ 10 7 the ejected phase space is shown in Fig. 58.The case of the second pulse is shown here but since for Q ext < some 10 7 there is no pulse-topulse coupling, this picture is statistically equivalent to any following pulse, i.e., the threshold current is not reached then.

XI. CONCLUSION
We have included in our simulations initial jitter of bunches at injection with respect to injection time ( AE 1 ps) and bunch charge (1%) in the longitudinal case and transverse jitter (10 m) for the transverse case.
It shows then that for any HOM frequency-irrespective of its position with respect to machine lines-for modes with (R=Q) as large as 50 ðcircuitÞ and a Gaussian cavity-to-cavity f H spread of 100 kHz, bunches jitter considerably at ejection in energy and arrival time if Q ext ! 10 6 .It is advisable for a good quality beam injecting into a following machine that Q ext 10 6 would be kept.This is especially recommended since in this frequencyindependent case there can easily be several such modes, in the worst instance adding up collinearly their induced amplitudes in dt and dE.
This process is initiated by very small bunch noise, the growth is then created by mutual excitation of coherent bunch pattern and HOM voltages; it is not to be excluded that cavity breakdown is triggered.
For the special case of a mode with hf H i within 100 kHz of a machine line but with an (R=Q) reduced to 5 or even 1 there is also no stable beam for Q ext > 10 6 , and the limit Q ext 10 5 is recommended for the higher (R=Q) at 100 kHz difference; at Q ext ¼ 10 7 even for ðR=QÞ ¼ 0:2 there is still not a completely negligible jitter.
As done in the SNS simulations [1], the beam current was exaggerated by a factor 10 to have a safety factor.Therefore, using some of this leeway, one should never allow Q ext > 10 7 but try even to respect Q ext 10 6 .
The precise data of any considered linac-we have defined a generic machine here-should be examined specifically, but no fundamental changes of the results are to be expected.However, there remain several points to elucidate in subsequent works.
Because of the excitation starting from noise, many HOMs at any frequency can get excited to non-negligible levels and the average cryogenic load as a function of Q ext has to be estimated.
Furthermore the required beam quality for a following machine should enter more explicitly into the considerations, comparing it with the covered phase-space area at ejection of the linac.Since we have only calculated the bunch center excursions here, the effect of possible induced losses of more distant particles in halos causing radioactivation of the linac elements should be estimated, defining another severer limitation.
In summary, a superconducting proton linac without any HOM damping should not be envisaged.Very few cavities with only natural damping intermingled between welldamped ones-as presently the case at SNS-might be tolerable provided there is no HOM with sizable (R=Q) very close to a machine line.

APPENDIX
For better readability of this paper, avoiding an interruption of the main chain of arguments, several corroborating plots have not been shown in the main part.However, for completeness and further documentations these plots may be consulted here.
One series of plots concerns the development of dE and dt along a beam pulse, i.e., with time.For Q ext ¼ 10 8 , where essential fields survive the beam-pulse pause, a comparison for the first and second pulse are worthwhile.
The dE and dt of the last bunch (about the ''worst one'') along the linac are also shown as example.
Another series of plots shows the cavity voltage of the first, last, and ''worst'' one against time and in polar dis-     250), pulse 2. Finally, the remaining voltages after pulse 1 (Fig. 73) and pulse 2 (Fig. 74) for all 250 cavities are displayed.

Case
We show some relevant cases equivalent to the previous section but for Q ext ¼ 10 7 .Figure 75 displays the dE excursions, Figure 76 the dt excursions at the end of the linac for all 400 000 bunches of only the second beam pulse, the field memory over 19 ms at Q ext ¼ 10 7 being negligible.Figure 77 displays the remaining cavity voltages after the pulse.We show some relevant cases equivalent to the two previous sections but for Q ext ¼ 10 6 .Figure 78 displays the dE excursions, Figure 79 the dt excursions at the end of the linac for all 400 000 bunches of the second beam pulse.

FIG. 1 .
FIG. 1. (Color) Sketch of primary bunch-noise spectrum (bottom) and the beam spectrum as seen by the HOMs (top) for flat beam pulses (no pulse chopping).
FIG. 2. (Color) Sketch of primary bunch-noise spectrum (bottom) and the beam spectrum as seen by the HOMs (top) for beam pulses with pulse chopping.

3 FIG. 4
FIG. 4. (Color) Program check: Snapshot of the longitudinal position deviation dt n of all 405 bunches (red dots, adjacent ones linked by a blue line) along the machine circumference.The sinusoidal pattern with just five crests and troughs develops out of nothing since the HOM is about 5 Á f Rev away from the nearest machine line (resonance condition).

8 dt 8 FIG. 5 .
FIG. 5. (Color) Program check: As Fig. 4 but for f H about Áf % 21 Á f Rev away from a machine line; the emerging pattern has 21 crests and troughs.

1 FIG. 9 .
FIG. 9. (Color) The voltage in the 250 cavities after passage of the 2nd pulse; conditions as Fig. 8.The equivalent plots (not shown) for conditions as Figs.6 and 7 show only small cavity excitation.

FIG. 14 .
FIG. 14. (Color) Cavity voltage plots after four different pulses corresponding to Fig. 13.Cavity #91 is clearly the worst one for pulses 1 and 4 but not for pulses 2 and 3.

FIG. 15 .
FIG. 15. (Color) Phase-space plots for four random HOM center frequencies hf H i (between h ¼ 6 and 7) but identical f H scatter and bunch-charge sequence.Scaling ½AE3 ps Â ½AE5 MeV.

FIG. 44
FIG. 44.(Color) Phase-space image of the ejected bunches of the second pulse.Conditions as Fig. 43 but Q ext ¼ 10 7 .

FIG. 47
FIG. 47. (Color) Phase-space image of the ejected bunches of the second pulse.Conditions as Fig. 46 but Q ext ¼ 10 7 .

FIG. 48
FIG. 48.(Color) Transverse phase-space image of the ejected bunches in x and x 0 .Q ext ¼ 10 8 , ðR=QÞ?¼ 50 , hI b i ¼ 400 mA, Áf ¼ 100 kHz, 0.01 mm transverse injection jitter, 2nd pulse.In reality the beam pipe does not cover such width, hence the beam would hit the beam pipe before.
FIG. 59. (Color) dE at ejection [ AE 5 MeV] of bunches 1 to 400 000, pulse 1.The envelope starts with zero amplitude and increases with bunch number (time).

6 FIG
FIG. 63. (Color) dE [ AE 5 MeV] for the last bunch of pulse 2 along the linac.The corresponding plots (not shown) to conditions of Fig. 6 (no noise) and Fig. 7 (phase noise) show considerably smaller dE excursions.

FIG. 70 1 FIG 8 Figures
FIG. 70.(Color) Polar display of the cavity voltage above.The ''curling'' is a beating between the cavity HOM frequency and the beam modulation.

TABLE I .
Example of some of the 250 cavities of the linac and their data: nominal momentum (p multiplied by c) at the downstream cavity end, its (random) deviation of the HOM frequency (Gaussian scatter ¼ 100 kHz) from the (random) nominal value, and the time slip per energy deviation constants dt=dEðEÞ.
FIG. 27. (Color) dE as a function of Áf for two consecutive pulses with Q ext ¼ 10 8 , I b ¼ 400 mA; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.
FIG. 26.(Color) dt as a function of Áf for two consecutive pulses with Q ext ¼ 10 8 , I b ¼ 400 mA; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.FIG.28.(Color) dt as a function of I B for two consecutive pulses with Q ext ¼ 10 8 , Áf ¼ 100 kHz; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.BEAM SIMULATIONS WITH INITIAL . . .ext ¼ 10 8 , Figs. 30-33 to Q ext ¼ 10 7 .Filled upward triangles show the cases with 1% bunch-charge scatter, hollow downward triangles the case without any bunch noise.It becomes evident that in all cases bunch noise considerably increases the beam scatter at ejection.
FIG. 31.(Color) dE as a function of Áf for two consecutive pulses with Q ext ¼ 10 7 , I b ¼ 400 mA; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.FIG.29.(Color) dE as a function of I B for two consecutive pulses with Q ext ¼ 10 8 , Áf ¼ 100 kHz; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.
+ 2 FIG.32.(Color) dt as a function of I B for two consecutive pulses with Q ext ¼ 10 7 , Áf ¼ 100 kHz; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.FIG. 30.(Color) dt as a function of Áf for two consecutive pulses with Q ext ¼ 10 7 , I b ¼ 400 mA; red: worst bunch in pulse; blue: rms; filled upward triangles: with 1% charge scatter; hollow downward triangles: without bunch noise.