Optimal choice of cell geometry for a multicell superconducting cavity

An algorithm for optimization of the multicell cavity cells is proposed. Inner cells are optimized for minimal losses or minimal magnetic field, when the aperture diameter, Epk=Eacc—the ratio of peak electric field to the accelerating field, and the wall slope angle are given. Optimization of the end cells is done for minimal losses or maximal acceleration in them. Two shapes of the end cells—with and without the end irises—are analyzed. This approach facilitates further optimization for higher order modes extraction because it permits keeping the achieved optimal values nearly the same while changing some dimensions of the cells. Comparison of the proposed cavity geometry with the TESLA cavity geometry illustrates the traits of the presented approach. It is also shown that lower values of the wall slope angle, which lead to the reentrant shape for the inner cells, are also beneficial for the end cells. For the Cornell Energy Recovery Linac most dangerous are dipole modes causing the beam breakup (BBU). Minimization of power of higher order modes (HOMs) in a multicell cavity was done using derivatives of the BBU parameter with respect to geometric parameters of the cavity cells. As a starting point of optimization, the shape with minimal losses at the fundamental mode was taken. Further changing the shape for better propagation of HOMs was done with degradation of the fundamental mode loss parameter G Rsh=Q within 1% while decrease of the BBU parameter was nearly 3 orders of magnitude. The BBU threshold current tends to be inversely proportional to this parameter.


I. INTRODUCTION
A superconducting (SC) cavity is an expensive device as regards to material, technology of mechanical and chemical processing, and conditions of work: vacuum, liquid helium, adverse effect of outside magnetic fields, etc.
On the first glance, the choice of a superconducting cavity shape does not seem to be a complicated issue and a wide variety of cavity shapes can be fabricated using nearly identical manufacturing procedures.However, along with the surface treatment, the shape determines nearly all basic cavity figures of merit, such as achievable acceleration (accelerating field E acc ), peak electric and magnetic field (E pk and H pk ), and minimal losses (G Á R sh =Q, geometric factor times specific shunt impedance).It plays a major role in setting limits to maximal beam current and minimal emittance, which strongly depend on beam excitation of higher order modes (HOMs).A poorly chosen shape can be responsible for multipacting, which can limit the accelerating voltage, impair vacuum, and heat the cavity surface.
Many of the problems associated with the choice of cavity shape were overcome early on by adopting spherical/elliptical cell shape with tilted end plates [1].A cumulative experience of the superconducting radiofrequency (SRF) community was later applied to the development of the cavities for the TESLA project [2].The resulting cavity shape was remarkably well optimized as we will see in the following sections.
Further development of the individual cells' shape is due to progress achieved in developing clean cavity preparation procedures that reduced significance of the peak electric field and led to understanding of the principal importance of the ratio of peak magnetic field to the accelerating field [3] and proposal of usage of the reentrant (RE) shape [4], which decreases the value of H pk =E acc sacrificing to some extent the ratio E pk =E acc .This approach brought world record accelerating gradient values of 47 MV=m [5] and 52 MV=m [6] for a single-cell 1300 MHz SC cavity with 70 mm aperture, 20% higher E pk =E acc , and 10% lower H pk =E acc than in the TESLA cavity.
There is still a lot to be done to convince the SRF community that reentrant (RE) SC cavities should be accepted for broad use in accelerator applications.One of the most pressing issues is to demonstrate that the high accelerating gradient can be achieved in a multicell RE cavity.In spite of the success of single-cell reentrant cavities, some people expect problems with chemical treatment of multicell cavities.These problems are now being studied at Cornell.Behavior of HOMs is also to be studied for this geometry.
In what follows, the author wants to separate the problem of optimization for minimal losses of the cavity and the problem of HOMs extraction.The inner cavity cells can be optimized for maximal GR sh =Q, whereas the end cells can be tuned for extraction of HOMs.The end cells' GR sh =Q can be sacrificed to some extent because their contribution to the total losses is limited.The similar procedure was done for the TESLA cavity optimization (Haebel, 1992 [2]).
This paper consists of two major parts.In the first part, optimization for maximal GR sh =Q (minimal losses) is done for inner and end cells.The description of tuning the end cells for HOMs extraction is the subject of the second part.
As a preliminary work, a thorough study of both non-RE and RE geometries of the inner cells was performed and optimal shapes for these cells were found in [7].Any wall slope angle, the E pk =E acc ratio, and aperture radius can be given depending on the project requirements.All other geometrical dimensions of the inner cell in the elliptic approximation for both equatorial and iris region can be found using the tabulated data or following the procedure described in these papers.
Shape and parameters of the end cells of a multicell cavity are mostly responsible for propagation of HOMs out of the cavity.At the same time they should not reduce the total value of acceleration and not be the weakest link in the sense of E pk or H pk .
Under preset limitations on the aperture, E pk =E acc , and the wall slope angle, the optimization of the inner cells consists in minimization of losses for a given E acc .Acceleration in the end cells is not necessarily the same as in the inner ones.One can optimize the end cells in two different ways: either for maximal acceleration regardless of the power loss ( min E pk =E acc , because E pk should be the same as in the inner cells), or for maximal acceleration per unit power ( max G Á R sh =Q for the end cells).The first optimization brings maximal acceleration for a given number of cells, the second one-for a given power.While the difference in results can be small, it is important to understand what optimization is being performed.
A short recollection of the inner cell shape optimization is presented here.More details can be found in [7].Some aspects of the end cell optimization are also discussed in the present paper.
Optimization of a SC cavity for minimal losses of the fundamental mode power is necessary because these losses define the major part of total power needed for cryogenics in the continuous wave operation.On the other hand, the current in the accelerator is limited by HOMs excited in the cavities by the electron bunches, and to minimize this detrimental effect one should change this initially found ''best'' shape.
We suppose to resolve this contradiction in the following way.(1) Find the best shape of the inner and end cells of the cavity from the viewpoint of minimal losses.(2) Change the shape of the end cells, even end half-cells only, to improve coupling between the cavity and the beam pipes keeping the increase of fundamental losses in the end cells at some limited level.The losses will increase in the end cells only, so the total relative increase will be smaller for a multicell cavity.(3) If necessary, change the shape of the inner cells, keeping in mind their bigger contribution into total losses.

II. OPTIMIZATION OF A MULTICELL CAVITY FOR MINIMAL LOSSES
A. Inner cell shape: The geometry for optimization We employ the construction of the cell profile line as two elliptic arcs with half-axes A, B, a, and b, separated by a straight segment of length l, Fig. 1, conjugated to arcs.We talk about a nonreentrant shape if the angle is more than 90 .The reentrant cell can also have a straight segment.In earlier optimization [4] the length of this segment appeared to be zero after consecutive steps of optimization.
The radius of the iris aperture R a is chosen by some additional considerations; it is not the task of this optimization and should be taken as an independent parameter.The length L of the half-cell is taken as a quarter of the wavelength, and boundary conditions correspond to the mode.The procedure of search for the best shape consists in calculating H pk =E acc or G Á R sh =Q for all suitable sets of the half-axes; the value of R eq is used for tuning the inner cells to the operating frequency.(In further discussion the tuning is done to the resonance frequency f ¼ 1300 MHz, which is the fundamental mode of the cavity).
Sure, a more intricate profile line can give a better eventual result, and we used earlier a description of the profile with six circular arcs [4].However, an improvement of H pk =E acc was not more than 1% in the case of six circle arcs in comparison to two elliptic arcs though this optimization can be incomplete because of its complexity.
Adoption of an elliptic arc for the equatorial area is crucial.The problem of cavity electric strength led to the iris edge to take the shape of an elliptic arc a long time ago.We apply an ellipse to the inductive part of the cell because now we have a problem of magnetic strength.

VALERY SHEMELIN
Phys.Rev. ST Accel.Beams 12, 114701 (2009) 114701-2 In the optimization with two elliptic arcs without a straight segment we have three independent parameters for optimization: three half-axes (A, B, and a), the fourth one (b) is defined by geometrical restrictions.
If we introduce the limiting angle of slope we need to search the minimum (of H pk =E acc or losses) in a 4D space: A, B, a, and b under two limiting conditions: E pk =E acc is less and the angle is bigger than definite values.As a result of these conditions the value of l can be not a zero anymore.
Calculations were done with TUNEDCELL code that is a wrapper code for SLANS and was developed especially for fast optimization [8].The SLANS code [9] is known as a code with high accuracy [10] that is necessary for our goal.

B. Results of optimization inner cells
Results of optimization for a minimal magnetic peak field are presented in Fig. 2 (solid lines).For easier comparison with the well-known TESLA cavity [2], with ¼ 103:2 which is a prototype for the ILC, the values of H pk =E acc on the graph are normalized to corresponding values of TESLA (42 Oe=ðMV=mÞ) so that h ¼ H pk =42E acc is equal to 1 for TESLA cells.{According to our calculations, the normalized magnetic field appears about 1.5% less than this value [41:4 Oe=ðMV=mÞ], as shown on the graph, Fig. 2. In publications [2] of 1992 (Haebel) H pk =E acc ¼ 41:7, later (Edwards, 1995) this value is shown as 42, the last publication (Aune, 2000) gives 42:6 Oe=ðMV=mÞ.Normalization for 42 is chosen because: (1) it is convenient to use ''round'' numbers, (2) some deviations in different references are about this value.}Another defining parameter, E pk =E acc which is close to 2 for the TESLA cells, was kept for the upper curve and increased for the next ones.(Again, our calculations give for the TESLA regular cells E pk =E acc ¼ 1:99.This is why this point slightly falls out of the curve.)10% higher electric peak field decreases the magnetic peak field by 7% as can be seen from the end point of the second solid curve.A sacrifice of the next 10% in electric field decreases h more only by 2% [4] giving in sum À9% in h for þ20% in E pk =E acc .The aperture radius R a ¼ 35 mm for the first group of curves is the same as in TESLA inner cells while it is 30 mm for another group.Influence and a possible benefit for higher gradient from decreasing the aperture is much higher than from increasing the overvoltage E pk =E acc .Smaller aperture causes smaller coupling and hence worst field flatness, also as higher wakefields.However, it is shown that ILC will tolerate the cavities with the new (reentrant) shape and the smaller iris diameter [11].
Results of optimization for maximal G Á R sh =Q are presented in Fig. 3.They are also normalized for the TESLA value: The extreme left points of curves in Figs. 2 and 3 correspond to minimal length of the straight segment: l ¼ 0 when the cell presents two conjugated elliptic arcs, the geometry discussed earlier [4,12].When optimizing for max G Á R sh =Q, the values of h slightly increase, these dependences are shown in Fig. 2 by dashed lines.When we optimize for min h, values of G Á R sh =Q become somehow smaller than immediately by maximization of G Á R sh =Q.There is an attempt to show this in Fig. 3 by dashed lines but actually these lines graphically coincide with the solid ones.This means that we do not need to optimize for max G Á R sh =Q-optimization for min h gives us the shapes that have practically minimal losses.When we try to optimize for max G Á R sh =Q, the maximal magnetic field shifts to smaller radius because the losses depend not only on the value of the field but also on the value of area where it exists.Smaller radii can give a smaller contribution to losses even if they have a higher field.However, this change is negligible if we optimize for max G Á R sh =Q.A minimal peak magnetic field secures low losses in the whole cavity.
Another remarkable fact is that the cell-to-cell coupling for the inner cells optimized for minimal H pk =E acc increases when passing from non-RE to RE geometry, Fig. 4.Even though this benefit is not very significant, about 0.1%, it denies the anxiety that the coupling can be lower for the RE case.
Distributions of the magnetic field along the profile line of the cells with R a ¼ 30 mm, E pk =E acc ¼ 2:2 and with minimal slope angle (lowest curves in Fig. 2 and the uppers in Fig. 3, extreme left points with l ¼ 0) for both cases of optimization are shown in Fig. 5.
There is also shown on the graphs of Figs. 2 and 3 the cell of the low-loss (LL) cavity of JLab [13].This well-optimized geometry takes its place on our graphs corresponding to its aperture and slope angle (98.0 ).Its position on the graphs is defined also by E pk =E acc ¼ 2:22 and R a ¼ 30:49 mm (recalculated to 1300 MHz).These examples, both TESLA and LL, show that cavity cells can be compared only taking into account their E pk =E acc ratio, aperture radius R a , and the wall slope angle.After the choice of these values, the correct optimization should be done, and other figures of merit can be obtained.There is no necessity to optimize specially for low losses because optimization for lowest peak magnetic field successfully serves to both goals: highest gradients and lowest losses.
Calculation of elliptic arc parameters, namely A, B, a, and b, for both cases of optimization, appeared a timeconsuming task not only because of four-dimensional space of these parameters but also because of a very small change of h in some cases when this parameters are varied.Gradients of the functions could not be calculated because the computational noise becomes higher than accuracy of calculations for small steps.To avoid false local minima the dependences of these parameters on were also analyzed.First results of these calculations gave smooth curves hðÞ but points for dependences AðÞ, BðÞ, and so on were scattered.After more accurate calculation most points fell on smooth curves though corrections of hðÞ were mainly in the fourth digit.Results for these dependences and other details are presented in our inner report [7] (second paper).
Further in this paper we will use a seven-cell cavity being developed for the Cornell Energy Recovery Linac (ERL) as an example.During preliminary discussions of this project it was decided to choose an optimized inner cell with E pk =E acc ¼ 2, ¼ 95 , and R a ¼ 35 mm.These numbers, according to [7], lead to the following geometry and parameters: A ¼ 43:99, B ¼ 35:06, a ¼ 12:53, b ¼ 20:95 (all in mm), G Á R sh =Q ¼ 31 838 Ohm 2 (3% higher than for the TESLA cavity), and H pk =E acc ¼ 40:23 Oe=ðMV=mÞ (96% of the TESLA cavity).Small  improvements are mainly due to a smaller value of : the TESLA cavity inner cells have ¼ 103:2 .A summary of geometrical limitations for inner and end cells will be done in Sec.III because some of them are connected with propagation of HOMs.

C. End cells of a multicell cavity
Let us consider two shapes of the end cells presented in Fig. 6.The left half-cells are taken to be of the same shape as the inner half-cells.However, the right half-cells should be different because addition of the beam pipe changes both the frequency and the field distribution.
For the seven-cell cavity we have chosen asymmetric end cells: one of each type.The radius of the beam pipe for the type a end is R bp ¼ 39 mm, like in the TESLA cavities.For the type b end R ae ¼ 37 mm, and R bp ¼ 55 mm.These values were adopted after several preliminary attempts to optimize higher order modes.Some consideration about further optimization of these radii will be given later.
The equatorial radius of the end half-cells is now fixed to be equal to the radius of the inner, optimized, cell.In contrast with the inner cells, where R eq was used for tuning, tuning of the end cell is now performed by changing its length L e (all parameters of the end half-cells are denoted by the index e, of the inner cell by i, and of the elliptic arc on the tube side by t).Dimensions A e , B e , a e , b e , a t , b t , and c can be used for optimization.Of course, so many free parameters make the problem of optimization very difficult, but we can ease our task by making some simplifications.For example, the value of the rounding radius c influences the frequency and peak fields very weakly and can vary in a broad range.On the other hand, if this radius is small, a local minimum of the electric field occurs in this corner that can lead to multipactor [14] (in spite of weakness of this field).A reasonable choice for c is 2 Á ðR bp À R ae Þ as was checked in the cited paper.
The end cells can be optimized separately from the rest of the structure if they are tuned to the same frequency.However, even in this case, when the end cell is added to several inner cells with the same frequency, the frequency of the united structure is slightly different from the initial one.This frequency shift depends on the cell-to-cell coupling and was about À1 Á Á Á þ 3 kHz for the type a end cell and þ4 Á Á Á þ 5 kHz for the type b.For optimization of the end cells, analogous to inner cells, a special envelope code TUNEDCELLEND was developed [8] on the basis of the SLANS code for both end cell geometries discussed here.This code saves time spent on tuning to the desired frequency and, like the above-mentioned TUNEDCELL code, makes it possible to analyze shapes for selected sets of half-axes.Thus the tuning change of L e is moved ''out of brackets'' and from now on we may not mention L e when tuning the end cell separately of others.
In the following we will use A e and B e as a pair of variables for optimization.In principle, it is possible to choose any other pair of values, e.g. a e and b e , and make compensation for one of them by changing the second one, keeping all other variables (A e and B e in this case) constant.

D. Optimization of end cells for maximum acceleration 1. End cells of the type a
Curvature radius at the lowest point of the rightmost ellipse [Fig.6(a)] is chosen to be not less than 6 mm because of possible technological problems in the process of stamping the half-cells.Let us start with this curvature and the simplest case of a e ¼ b e ¼ 6 mm.Scanning A e and B e , one can plot the dependence of e ¼ E pk =2E acc on these variables, Fig. 7.The value of e should be minimal if we want maximal acceleration in the end cell, according to its definition and by the following reasons.The accelerating field of the last cell is defined as E acc ¼ V acc =ð=2Þ ¼ V acc =ð2L i Þ like for the inner cell.This is because we are actually interested in acceleration in the end cell and by OPTIMAL CHOICE OF CELL GEOMETRY FOR A . . .Phys.Rev. ST Accel.Beams 12, 114701 (2009) changing the length of the end half-cell for tuning we want to increase the voltage V acc without paying much attention to its length.At the same time, the maximal electric field E pk should be on the inner side of the end cell.In this case it will be the same as on the other side of the inner iris due to the same geometry of both sides of it.The right-hand rising part of each curve in Fig. 7 corresponds to the peak of electric field jump from the left side (iris) to the right side (pipe rounding) of the cell in Fig. 6(a).This is why the progress of the curves changes.One can see a very shallow minimum of the envelope curve close to A e ¼ 48 mm and B e ¼ 33 mm (Fig. 7).When we move along the envelope curve, changes of A e are compensated by adjusting B e so that each point on the envelope curve corresponds to the minimum of e for an individual curve e vs B e .By changing the value a e ¼ b e , one can find that the minimum of such envelopes occurs at the value of about 12 mm, Fig. 8  The last step of the procedure can be called a fine-tuning for the minimum.It was not used from the very beginning because a very shallow minimum of e is difficult to find Further calculations were done for the half-cavity with an electric wall boundary condition at the left end plane, Fig. 9, to exclude influence of the other end cell.The upper curve in Fig. 10 is analogous to the V-like curves of Fig. 7 for the end cell when only B e is being changed, and the frequency is kept constant by adjusting L e .The lower curve is for the half-cavity case.Addition of the end cell disrupts flatness of the electric field on the axis of the inner cells and changes the frequency by about 1 kHz.Tuning by changing the end half-cell length L e restores the flatness.This tuning is similar to tuning field flatness of the cavity in situ because it amounts for only a few microns of length change and cannot be achieved in fabrication.
One can see that the point where the electric field peak jumps from the inner iris to the outer side of the cell is at a different value of B e for the half-cavity as compared to the end cell calculated alone, Fig. 10.However, at bigger values of B e the angle decreases below 95 , so one could not increase B e , and even if one could, the decrease of e with this change is negligible.The value of e for the halfcavity can be found using formula For e i ¼ 1 (actually 1.0002) and e i ¼ 1:0103 we calculate e ¼ 1:0031.The actual value from computer simulation is 1.0035.The discrepancy is due to a change of the end cell by tuning and accuracy of calculation.

End cells of the type b
For the end cells of type b we could not search for minimum e with arbitrary values of a e and a t .This is because the sum a e þ a t in this optimization would grow infinitely resulting in a smaller radius of the beam pipe R bp and preventing propagation of some HOMs.So this value has to be limited in some way.''Thickness'' of the iris can be defined by its curvature radius at the point nearest to the axis, for inner cells it is R ci ¼ a 2 i =b i ¼ 7:494 mm.For the end iris we have two curvatures: R ce ¼ a 2 e =b e and R ct ¼ a 2 t =b t .Let us set the upper limit for the end iris to R ce þ R ct < 2R ci % 15 mm.Technological limitations R ce !6 mm, R ct !6 mm are also valid as above.
Graphs analogous to the graphs for the type a cell are shown in Figs.11 and 12.The same behavior of the peak electric field, jumping from one side of the cell to the other one when B e increases, is observed as for the type a transition, Fig. 7. Reduction of the normalized electric field with growing sizes of the end iris is shown in Fig. 12  accordance with above-mentioned effect of the smaller beam-pipe radius.Three upper curves in Fig. 12 are calculated for equal half-axes of the end iris.The fourth curve shows the result of redistribution of the curvature radii in the sum R ce þ R ct ¼ 15 ¼ 9 þ 6 mm: if the outer radius is smaller the force lines are better attracted to it and E acc increases.The lowest curve represents replacement of the circle of radius 9 mm by an ellipse with same curvature at the lowest point.Further increase of a e and b e is prevented by the 95 limit on the wall slope angle.Change of the outer elliptic arcs of the end iris under condition a 2 t =b t !6 mm leads only to a negligibly small decrease of e when both a t and b t grow.This is also because of an effective decrease of the beam-pipe diameter with the thicker iris.Thus we decided to keep a t ¼ b t ¼ 6 mm.
The final (''fine'') tuning of the type b end cell gives min e e ¼ 1:0174 for A e ¼ 52:1, B e ¼ 47:9, a e ¼ 9:9, b e ¼ 11:3 mm, and e ¼ 95:0 .This is shown as a separate point in Fig. 12. Behavior of e e vs B e , when all other cell dimensions but L e are constant, is shown in Fig. 14, upper curve.The lower curve, for the half-cavity, has e ¼ 1:0054, while from (1) we calculate 1.0051.
After adding the type b end cell to the chain of half-cells (Fig. 13), the frequency of the whole cavity became several kHz higher and the decrease of L e was needed to tune the half-cavity.Figure 14 is similar to Fig. 10.Comparing these two figures, one can see that now the jump of the peak electric field to the outer iris happens at a smaller difference of B e values before and after adding than for the type a end cell.

E. Optimization of end cells for minimal losses 1. End cells of the type a
Results of optimization for minimal losses of the type a end cells are presented in Fig. 15.Normalization of G Á R sh =Q (or R sh , which is the same because we compare the cells from the same material, and G=Q ¼ R s , surface resistance, is therefore constant) is made on this value of the inner cell (G Á R sh =Q ¼ 31 838 Ohm 2 ).As above, we started from the circular iris with values a e ¼ b e ¼ 6 mm: the lowest group of four curves in Fig. 15.The curve crossing the other three corresponds to the jump of E pk from the inner iris to the outer side of the cell (now we do   Change to an elliptical cell-to-pipe transition (a e Þ b e ) further improves R sh , and the best point is shown in Fig. 15.

End cells of the type b
Results of optimization for maximal G Á R sh =Q for the type b cells are shown in Fig. 16.Here we again started from minimal half-axes of the iris ellipses: a e ¼ b e ¼ a t ¼ b t ¼ 6 mm-the lowest group of curves, then we change these values to 7.5 mm, and then redistribute the sum a e þ a t ¼ 15 mm, so that to increase curvature at the outer side of the iris: a e ¼ b e ¼ 9, a t ¼ b t ¼ 6 mm.In these transformations, E pk again jumps from the inner iris to the outer one.Finally, the best point under two conditions: E pk on the inner iris and !95 , is found by stepwise search of the maximal R sh .
Adding of the optimized end cell of both a and b types to the uniform row of inner cells is done similar to the earlier described procedure for maximal acceleration and requires only small frequency tuning afterwards.

F. Discussion of optimization results
Results of optimization for maximal acceleration and for minimal losses are summarized in Table I.In spite of different goals of two optimizations, the results are very close in terms of e and G Á R sh =Q.Only 0.03% to 0.04% gain in R sh was obtained with optimization for minimal losses versus optimization for maximum acceleration.Even smaller gain was obtained for e, not more than 0.01%, which is at the level of accuracy of the calculations.The situation is similar to the optimization for minimal losses and for minimal H pk performed in [7] where the difference in results and in shapes of the optimal cavities was very small.However, in the presented here case half-axes of the big ellipses differ by more than 0.5 mm, and the cells with maximal R sh are about 1% shorter than those with minimal e.This is not a very strong but an additional argument to optimize for maximal R sh : the whole cavity length becomes shorter.A minimum of e (or maximum of R sh ) is very shallow and we can remain to be close to it even if one of the parameters (A e , B e , a e , b e ) is perturbed: the other three variables can be adjusted to compensate the initial deviation, keeping the declared limitations.
The limiting angle ¼ 95 was reached in all optimizations.This means that the abandonment of angle limitations and transition to the RE shape will be beneficial for the end cells as it is for the inner ones.
It should be noted that optimization for minimal H pk =E acc is not needed for the end cells, at least in the presented case.A maximum of the magnetic field always appears on the inner wall of the end cell and its value is close to the maximum in the inner cells as it is seen in Fig. 17.
We can also note that in the case of TESLA cavity, the magnetic field in the end cells has nearly equal values at both sides of the end cells while the electric field is lower at the outer side, Fig. 18.

G. Field flatness
The quality of the cavity tuning is usually characterized by so-called field flatness, which is defined as cell-to-cell equality of maximal fields on the cavity axis [15].This requirement is important from the practical point of view and gives a clear guide for cavity tuning.
In the presented here analysis, keeping E pk constant, and striving to increase E acc (or to minimize losses), we can have different maximal fields on axis in the inner and in the end cells.Our goal makes it unnecessary to have exactly the same amplitude of the axial electric field in the inner and end cells.Let us compare fields in the seven-cell ERL cavity optimized for minimum losses, Fig. 17, with the TESLA cavity, Fig. 18.The ERL cavity optimized for maximum acceleration is not too different.
One can see that the maxima of both electric and magnetic fields on the surface along the profile line of the ERL cavity are equal in both inner and end cells.Maximal electric fields on the cavity axis are higher in the end cells (2.3% and 2.6%, for the left and right side, respectively) than in the inner cells.This difference is big enough and can be taken into account in the process of cavity tuning after fabrication.Optimization for maximal R sh made it possible to have the end cells only by 1.0% (type a) and 1.7% (type b) less accelerating than the inner cells.
The TESLA cavity has not identical end cells.This asymmetry, however, is not seen in Fig. 18, because of scale.For calculation of fields in the TESLA cavity, we used geometric data from [2] but ''tuned'' them to 1300.000MHz by changing lengths of the cells and equatorial radius, because accuracy given in the papers is not sufficient to have equal frequencies of inner and end cells, and, consequently, field flatness of the inner cells.These changes, however, were within the precision range given in the papers, for example, the left cell length given as L e ¼ 56 mm was tuned to be 55.722 mm.The TESLA cavity

VALERY SHEMELIN
Phys.Rev. ST Accel.Beams 12, 114701 (2009) geometry and our results for fields on the cavity surface and on axis are presented in Fig. 18.Our ''tuning'' shows also a slight excess of the axial field in the end cells, 0.9% and 1.3%, respectively.The end cells have lower peak fields on the cell-to-pipe transitions, 7.2% and 7.9%, respectively.Because of this ''easier regime,'' the contribution to acceleration of the end cells is lower than in the inner cells, by 2.0% and 1.6% (both of the type a in our designation).If this is a payment for better extraction of HOMs-and the TESLA end cells were designed with this purpose (Haebel [2])-it is, of course, acceptable.
Each end cell has 4 degrees of freedom: their half-axes A e , B e , a e , and b e , whereas R eq is defined by inner cells and L e is used for tuning to the fundamental frequency.A very strong influence of the cell profile on the mode spectrum was pointed out in [16] that gives us a hint to use these degrees of freedom-but mainly in the end cells-for better extraction of HOMs.

A. Limitations for the peak electric field and geometric parameters
We should impose some limitation on the cell shape due to computational, technological, and other conditions.This discussion will be also done on the basis of parameters chosen for the Cornell Energy Recovery Linac (ERL).
We should choose limitations for the cell wall slope angle.In spite of better loss properties of the reentrant shape [7], Fig. 1, this shape is still in a stage of detailed investigations in our lab and elsewhere and now we will discuss more traditional, nonreentrant shape.Nevertheless, the angle of the wall slope should be given, and we will take ¼ 95 , trying to come closer to the angles < 90 but still to be on the traditional side of this barrier.
The next limitation is connected with normalized peak surface field E pk =E acc , where E pk is maximal electric field on the surface and E acc is the acceleration V acc in the cell in volts divided by =2.This definition, E acc ¼ V acc =ð=2Þ instead of E acc ¼ V acc =L cell , where L cell is the geometric length of the cell, should be kept for the end cell also because its active length is not defined: the field is penetrating into the beam pipe and actually we are interested in voltage on the cell, the length of the end cell is not very important.Increasing the value of E pk =E acc , one can decrease the maximal normalized magnetic field H pk =E acc and losses in the cell.Minimization of H pk =E acc also gives a possibility to achieve the maximal accelerating rate E acc in the cavity because the magnetic field is a hard limit for the SC niobium and the electric field is a soft limit [3].However, too high E pk =E acc will lead to the field emission, and we should be limited by the reasonable value of it.In the case of the Cornell ERL we took a conservative value The basic geometric parameter which we will take as a given one, is the iris aperture R a .Smaller values of R a decrease losses of the fundamental mode but strongly increase problems with HOMs.We will rely upon TESLA experience and take for the inner cells R a ¼ 35 mm.As it was said earlier, the curvature radius of the iris cannot be too small even if it does not increase the E pk .This is due to difficulties to guarantee accuracy in the process of stamping the half-cells.
The higher order modes should have a possibility to propagate to the load through the beam pipe.So, the radius of the beam pipe should be above the cutoff value of the lowest HOMs.In the TESLA cavities (Edwards and Aune [2]) the beam-pipe radius is R bp ¼ 39 mm.This corresponds to the cutoff frequency of the dipole mode equal to f c ¼ 2253 MHz.For the geometry chosen for the ERL cavity, only modes of the 3rd dipole band and higher can propagate through this beam pipe.The lowest modes of the first band have their frequency near 1600 MHz but can be tuned for our geometry to about 1700 MHz.To guarantee a possibility of their extraction, we choose the beam-pipe radius R bp ¼ 55 mm with a cutoff frequency of 1597 MHz and decided to make the beam pipes on different sides of the cavity with different inner radii: R bpa ¼ 39 and R bpb ¼ 55 mm.
We will keep the smaller radius from one side of the cavity because in the case of a broad beam pipe we need to place the HOM load further from the cavity to prevent degradation of the quality factor of the fundamental (accelerating) mode.We are forced to use a broad pipe but can use it from only one side of the cavity to make the whole cavity shorter.The solution with a broad pipe was not used in the TESLA cavity, possibly because the need to suppress HOMs was not as essential as it is in the case of the ERL.
Trying not to weaken accelerating properties of the end cell with a broad pipe, we will use an iris between the cavity and the broad pipe.So, the end cells will be of two kinds, Fig. 6, in Sec.II they are called ''end cells of type a, and type b''.

B. Model of the HOM load for simulation
If we optimize the end cells for better propagation of HOMs whose frequencies are over the cutoff, we should have a nonreflecting load at some distance from the end cell at each side of the cavity.For the free space such a load is known: having the impedance of material Z ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 0 ="" 0 p of the same value as the impedance of free space Z 0 ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 0 =" 0 p , we should have relative permeability and permittivity of the material equal and having nonzero imaginary parts, for example, ¼ " ¼ 1 À i, we will have full absorption if the thickness of the absorber is big enough.Unfortunately, in the waveguide, the impedance has a dispersion, and such a perfect absorber cannot be realized in simulation or in practice.The impedance has different dependences on frequency for TE waves, , and for TM waves, , where is the wavelength in the free space and c is the cutoff wavelength of an empty waveguide.
The reflection coefficient from the interface between an empty and a filled waveguide can be found for the TE wave as where ¼ 0 = c ; for the TM waves in the equation for À should be changed by ".If we take the loss tangent equal to 1, we can see, Fig. 19, that À very weakly depends on the absolute value of " and .For simplicity of the mesh in the simulation of the lossy stuff, we will take ¼ " ¼ 1 À i.
One can see that for the 10% shorter wavelength than the cutoff wavelength, the reflection is equal to À ¼ 0:5 or only 25% in power.Absorption of three-quarters of power propagating into the pipe will secure very low Q of the mode if the coupling with the pipe is big enough.
The ideal absorption can be found if we calculate the external quality factor Q ext of the cavity.Calculation of the Q ext is analyzed in [17].For the case of the round waveguide with a TE 11 wave, we can find where Q E and Q H are defined when different boundary conditions are imposed at the end of the waveguide: where U is total energy in the cavity, Ã and are wave-lengths in the waveguide and in the free space, respectively, a is the radius of the waveguide, E m is the maximal electric field on the magnetic wall at the butt of the waveguide, H e is the maximal magnetic field on the electric wall at the butt of the waveguide, and J 1 ð 0 11 Þ is the Bessel function of the first kind at the point of the first root of the derivative J 0 1 ðxÞ.In the model, the load is a disk at the butt of the pipe filled with the lossy material, Fig. 20.A half-cavity with a magnetic wall at the left boundary was used for this simulation.The structure of the electric field of a mode with a low coupling with the load is also presented in the picture.
Comparison of results with the lossy load in the beam pipe of radius R bp ¼ 39 mm having ¼ " ¼ 1 À i and results with calculated Q ext according to above-mentioned procedure is shown in Fig. 21.The relevant values of the beam breakup (BBU) parameter p are also presented.Its change with the transition from the modeled load to the ideal one is practically the same as of Q because R=Q weakly depends on Q.The BBU parameter on this figure is big because this calculation is done before its optimization.
Here the modes of the 3rd dipole band were examined.
One can see that the ideal Q ext is about 2 times lower than the loaded Q L at the lowest frequency of this band, and only 20% lower at the highest frequency.Let us remind that the cutoff frequency is f c ¼ 2253 MHz, less than 10% lower than the lowest frequency of this band.It is clear that for highest bands of HOMs the load with ¼ " ¼ 1 À i can be treated as a good one.FIG.20.A half-cavity with a disk shape load at the end of the beam pipe for the data presented at Fig. 21 and a  For the 1st dipole band, we have a smaller margin than for the 3rd one, approximately 1700 MHz versus 1600 MHz, i.e. about 6%.However, as we will see later, there is no problem with coupling of these modes with the pipe, and, moreover, the ideal Q ext (and, hence, p) is always less than in the model.Of course, we cannot find the best solution with the nonideal load but we still can find a geometry which has a significant coupling with the load.
Final optimization will be done with the model of a real HOM load which (1) is far from the ideal in the shape, it cannot fill the whole pipe; and (2) is far from ideal in the electromagnetic properties of the lossy material.However, we will try to separate again our task: first we separated optimization of the fundamental mode and HOMs; now we are trying to separate optimization of the HOMs extraction and their absorption by the load.

C. Usage of derivatives @p=@q
We can find derivatives @p=@q of the BBU parameter with respect to any size of the end half-cells' half-axes: so that q ¼ A a ; B a ; . . .; a b , or b b .We can do this for any HOM dipole mode.Having the matrix of @p=@q, we can minimize the maximal value of p for a given frequency range.We will limit the task by eight most dangerous modes, i.e., the modes with biggest p.After the first run of optimization with the end iris R ae ¼ 37 (as in Sec.II), it was decided to increase it to the same value as at the other side.The shape of the end cell was corrected for this aperture.For the transition radius R ae ¼ R aea ¼ 39 mm for the type a end half-cell and R ae ¼ R aeb ¼ 39 mm for the type b end half-cell (Fig. 6), such a matrix is presented in Fig. 22, for frequencies shown in the upper line and values of p shown in the lower line.Values of q are shown in the column on the right.
The values of p were decreased nearly 3 orders of magnitude from the initial geometry when all the cells had minimal fundamental losses, Fig. 23.A very high BBU threshold [18], about 10 A, corresponds to this new geometry.The value of G Á R sh =Q, defining fundamental losses in the cavity, decreased in this optimization only by 4.6% for the type a cell and by 1.1% for the type b (broader) cell.Since the losses in the inner cell did not change, the total drop of G Á R sh =Q, i.e., increase of losses, in a seven-cell cavity will be 0.8% only.Unfortunately, small deviations of the shape lead to a dramatic increase of p [19] and a further decrease of maximal p is desirable.From a general point of view, a decrease of the BBU parameter should lead to a decrease of its derivatives @p=@q because the value of p is limited from below.This should lead to a weaker sensitivity of dimensions to disturbances.However, another possibility to decrease this sensitivity exists: broadening of the HOMs bandwidths [19].
Further decrease of p is limited by behavior of derivatives for two modes: 2511 and 2513 MHz, see Fig. 22.The FIG. 22. (Color) Matrix of derivatives @p=@q and associated frequencies, p's, and q's.biggest derivatives correspond to half-axes A a and B a but they have different signs.Values of p for these two modes are nearly equal: 2261 and 2259.So, further improvement of p can be done by changing other half-axes of the end cells, but it will be insignificant.From Fig. 22, one can see that lowest modes are more sensitive to the change of the type b end cell (left lower quarter of the matrix) whereas the higher modes depend strongly on the type a cell, with the smaller pipe (righthand upper quarter).This means that the lowest HOMs are directed to the broader pipe and the higher modes propagate to the smaller pipe though they could be tuned for propagation into the broader pipe as well.The example pictures of electric field of these modes confirm the aforesaid, Fig. 24.
An attempt to redirect the lowest mode of the two with highest @p=@q (f ¼ 2511 and 2513) was made.This separation was successful, Fig. 25; frequencies of the modes somewhat changed: to 2514 and 2517 MHz.Unfortunately, after this procedure several other modes substantially increased their BBU parameter and this attempt was left aside.
Further improvement of the geometry can be done using the same procedure of decreasing the maximal BBU parameter-now for the inner cells.This tuning for lower p can be closely related to the broadening of the bandwidths of the HOMs.

IV. CONCLUSIONS
An algorithm for calculation of inner and end cells of a multicell cavity with minimal losses or H pk =E acc is presented.
It is shown that optimization of the end cells can be done independently of the inner cells and only a small tuning is needed when the end cell is added to the uniform cells' chain.
The analysis shows that a proper choice of geometry can help to use end cells either for their highest possible acceleration or for minimal losses.In both cases, limitations of maximal surface electric fields and wall slope angle were the same as for the inner cells.
Comparison of the proposed ERL cavity geometry with the TESLA cavity geometry illustrates the traits of this two-sided approach to optimization.It is also shown that the lower values of the wall slope angle are preferable not FIG.25.Redirection of modes with maximal @p=@q into different pipes.

VALERY SHEMELIN
Phys.Rev. ST Accel.Beams 12, 114701 (2009) 114701-14 for the inner cells only but for the end cells as well.
Removing the angle restriction will lead to the reentrant cavity having minimal losses or maximal acceleration for a given E pk =E acc and aperture.
As the next optimization step, mutual compensation of variable geometric parameters is used to find a geometry with better HOMs extraction properties with a very small deterioration of the losses and the magnetic peak field.
A possibility to control tuning of the HOMs propagation into the beam pipes was demonstrated.Usage of derivatives of the BBU parameter with respect to cell dimensions is a powerful method of suppression of the HOMs.Minimization of the BBU parameter of dipole HOMs was done changing the shapes of the end half-cells of the cavity with increase of power losses of the fundamental mode by 0.8%.Decrease of the BBU parameter was nearly 3 orders of magnitude compared to the original shape tuned for minimal losses.The BBU threshold current increased the same amount, up to 10 A.

FIG. 2 .
FIG. 2. (Color)Normalized magnetic peak field for different angles of slope.Solid lines present optimization for min h, dash lines are for max G Á R sh =Q.

FIG. 3 .
FIG. 3. (Color) Normalized loss parameter for different angles of slope.Solid lines are for max G Á R sh =Q, dashed lines are for minimal h.(Graphically both lines nearly overlap).

FIG. 4 .
FIG. 4. (Color)Cell-to-cell coupling vs angle of slope for inner cell optimized for minimal h.

FIG. 5 .
FIG. 5. (Color) Geometries of the cells (left picture) with min h (red solid line) and max G Á R sh =Q (blue dashed line) practically coincide.Difference in magnetic fields along the profile lines of the cell (right) is also negligible.A, B, a, and b are half-axes of elliptic arcs.

FIG. 6 .
FIG. 6. (Color) Two possible end cells of a multicell cavity: with a simple transition to the beam pipe (a), and with an iris and a broader beam pipe (b).
(a).Values of A e , providing minimal e for each B e , are shown in Fig. 8(b).
Figure 8(c) reveals that the wall slope angle decreases very fast with the increase of a e ¼ b e .So we have to stop at a e ¼ b e ¼ 10 mm having e ¼ 1:0125, because of the agreement to keep the angle !95 .[The curve with a e ¼ b e ¼ 11 mm is not shown because it overlaps with the curve for 10 mm in Fig. 8(a) and gives no improvement in e.]Further improvement in e can be made if we allow a e Þ b e , and make the iris elliptical.This phase of optimization can be done by small steps around the best point while checking for two conditions: !95 and radius of curvature R c ¼ a 2 e =b e !6 mm as it was mentioned above.This optimization results in transforming the circle a e ¼ b e ¼ 10 mm into an ellipse with a e ¼ 8:4 mm, b e ¼ 11:5 mm at A e ¼ 50:9 mm, B e ¼ 45:3 mm for e ¼ 1:0103.The final result for the type a minimum e value is shown as a separate point in Figs.8(a)-8(c).

FIG. 8 .
FIG. 8. (Color) Normalized electric field e envelopes (a), length of the half-axis A e (b), and the wall slope angle (c) for different circular roundings of the iris (a e ¼ b e ) vs length of the other half-axis, B e .The single point is the final result.
FIG.9.Half-cavity with the type a end cell.

FIG. 14 .
FIG. 14. (Color) e ¼ E pk =2E acc for the type b end cell alone and for the half-cavity from Fig. 13.

FIG
FIG. 12. (Color) Normalized electric field envelopes vs half-axis length B e for the type b end cells.The single point is the final result.

FIG. 16 .
FIG. 16. (Color) Normalized R sh for the type b end cells.

FIG. 18 .
FIG. 18. (Color) Geometry, fields along the profile line, and electric field on the axis of the TESLA cavity.

FIG. 17 .
FIG. 17. (Color) Geometry of the cavity combined from the two half-cavities: shown in Fig.6(mirrored about the left end plane) and 10, the fields along the profile line, and the electric field on axis.

FIG. 23
FIG. 23. (Color) BBU parameter p vs frequency for the cavity with minimal fundamental losses before and after optimization for minimal p.

FIG. 21
FIG. 21. (Color) Q ext and BBU parameter p [Ohm=cm 2 =GHz] for the cavity optimized for minimum losses, before HOM optimization.

FIG. 24 .
FIG. 24.Electric field of eight modes with biggest p.
. 12. (Color) Normalized electric field envelopes vs half-axis length B e for the type b end cells.The single point is the final result.Increase of the values of a e and b e up to 10 mm increases the maximum of this separating curve (see the group of four curves for a e ¼ b e ¼ 10 mm, and A e ¼ 48, 49, and 50 mm).A further increase of a e and b e , up to 12 mm, leads only to a small increase of the maximum of the separating curve; the wall slope angle for a e ¼ b e > 12 mm becomes smaller than 95 and these points do not add to the maximal R sh .

TABLE I .
[2]parison of geometries.All dimensions are in mm.R sh =Q is in Ohm, G Á R sh =Q is in Ohm 2 .Angles i or e are in degrees.Some dimensions for the TESLA[2]cavity (R eq , L i and L e ) are tuned for 1300 MHz.
dipole mode with high Q ext .