Impedance studies of 2 D azimuthally symmetric devices of finite length

In particle accelerators, the beam quality can be strongly affected by the interaction with self-induced electromagnetic fields excited by the beam in the passage through the elements of the accelerator. The beam coupling impedance quantifies this interaction and allows predicting the stability of the dynamics of high intensity, high brilliance beams. The coupling impedance can be evaluated with finite element methods or using analytical approaches, such as field matching or mode matching. In this paper we present an application of the mode matching technique for an azimuthally uniform structure of finite length: a cylindrical cavity loaded with a toroidal slab of lossy dielectric, connected with cylindrical beam pipes. In order to take into account the finite length of the structure, with respect to the infinite length approximation, we decompose the fields in the cavity into a set of orthonormal modes. We obtain a complete set of equations using the magnetic field matching and the nonuniform convergence of the electric field on the cavity boundaries. We present benchmarks done with CST Particle Studio simulations and existing analytical formulas and codes, pointing out the effect of different material conductivities, finite length, and nonultrarelativistic particle beam velocity.


I. INTRODUCTION
The problem of calculating the impedance of finite length devices, in particular, simple cavities, has been approached mainly by means of the field matching technique.This technique is based on imposing the continuity of electric and magnetic fields at the boundaries between the finite length device and the access beam pipes.While the magnetic continuity can be easily imposed, this is not the case for the electric continuity.The problem can still be solved by means of careful approximations as it has been recently studied in [1][2][3][4] where the cavity-like structure is approximated as a thin insert.
In this work we want to study rigorously the electromagnetic fields scattered by a particle beam traveling through a cavity loaded with a generic linear, isotropic, stationary, dispersive, homogenous, toroidal material, by means of the mode natching method [5,6] and derive the longitudinal beam coupling impedance.
The work is divided in three parts: Sec.II will present the theoretical background of the mode matching technique; in Sec.III wewill derive the electromagnetic fields scattered in the structure; in Sec.IV we will present applications and benchmarks for meaningful cases in accelerators.We will compare our model with the classical thick wall formula for resistive wall impedance, and with a particle wakefield commercial simulator for low conductivity cases.The impedance dependency on the device length will be also studied in order to assess the validity of the usual "infinite length" approximation.The study of thin inserts will be presented and compared with the theory developed in [4].Since the used approach is nonultrarelativistic, we will also study the impedance behavior as a function of the relativistic particle beam velocity.

II. THEORETICAL BACKGROUND
In this section we will show the expressions for the electromagnetic field decomposition in a closed volume.The derived equations are the basis for the mode matching method.
Given a volume V, enclosed in an ideal surface S ¼ S E ∪S H , with S E perfect electric, and S H perfect magnetic boundary surface, the scattered electromagnetic fields Ē and H may be decomposed by means of the Helmholtz theorem in summation of irrotational and solenoidal modes that constitute a complete set of orthonormal functions.We can write where ēn and hn are solenoidal and fn and ḡn irrotational orthonormal eigenvectors.Table I shows a set of eigenvectors and the relative differential equations and boundary conditions they have to satisfy ( no is the unit vector normal to S pointing internally to the volume) [5,6].
Since the eigenvectors are determined by the geometry of the structure under study, the problem reduces in finding the coefficients V n , I n , F n , G n .This can be done by imposing the continuity of the electromagnetic field on the boundary surface S. It is understood that in this condition one must take into account also the impressed field generated by the sources.
On S E , because of the homogenous boundary condition, which is an intrinsic property of the eigenmodes, it is not possible to perform tout court the matching of the electric field.Analogously this happens on S H for the magnetic field.
This difficulty can be surmounted by resorting to a procedure that will be described in the following.
Let Ē be the given imposed electric field on the surface S .If we consider the quantity ∇ • ð Ē × hÃ n Þ, and resort to simple algebra, we get the following expression: In the right-hand side we use Maxwell's equation for Ē and the expression (1a), then integrate in the volume V. Applying the divergence theorem and exploiting the orthonormality of the eigenmodes, we get the following expression: where Z 0 is the characteristic impedance of vacuum.Doing the same for the quantity ∇ • ðē Ã n × HÞ, we have from which we get the coefficients I n , V n : with Y 0 ¼ 1=Z 0 .Analogously we may proceed for the irrotational fields, obtaining The results of the above procedure may appear contradictory.
On S E , for example, we have imposed the use of the eigenmodes that satisfy homogeneous boundary conditions: one might be tempted to infer that the expansion coefficients should vanish.There is, indeed, no contradiction: the result of the left-hand side is obtained integrating on the volume V a positive definite function, while the result of the right-hand side is obtained integrating on the surface S the "imposed" field Ē.However, such an expansion will only be nonuniformly convergent.This behavior will impose some cautions on the expansion truncation.

III. DERIVATION OF THE ELECTROMAGNETIC FIELDS
The structure we studied is a cavity connected with a beam pipe of radius b and filled with a toroidal insert of thickness t, as shown in Fig. 1 The surface S 1 divides region I from IV, S 2 region II from IV, S 3 region III from IV.
Regions I, II, and IV are filled with vacuum (permittivity ϵ 0 and permeability μ 0 ); region III with a linear, isotropic, stationary, dispersive, homogenous material (complex permittivity ϵ d and permeability μ d ).
The beam current density ρ z ðr; φ; z; tÞ is represented in a time domain as a particle of charge Q traveling

Eigenvector
In V On In the following, we will consider the particular case for the azimuthal number m ¼ 0 that corresponds to the longitudinal distribution used for the longitudinal impedance calculation: In a frequency domain we have where k b ¼ ω=v is the propagation constant of the beam.
In order to handle the problem of determining the longitudinal beam coupling impedance, the electromagnetic field induced by the beam current J0 ¼ ρ0 v will be calculated as a superposition of a source and a scattered field: A. Source fields The source fields are calculated as the field induced by the beam current J0 , along the axis of a perfectly conducting beam pipe of radius b.The fields are given by [7,8]

B. Scattered fields
Since the source field is transverse magnetic (TM), for symmetry reasons, also the scattered fields in all the four regions consist in TM waves: all the components can be derived from the longitudinal electric field Ēz .
In region I, the electromagnetic fields can be decomposed as a modal series: where each mode is given by the following longitudinal and transverse expressions [5,6]: Analogous relations hold for region II with coefficients D p .For both regions I and II, Tðr; φÞ ¼ J 0 ðξ 0;p r=bÞ with ξ 0;p being the zeros of the Bessel function J 0 ðrÞ and p ∈ ℕ þ .The other parameters of Eq. ( 9) are shown in Table II.
In region IV we can expand the fields in the complete set of orthonormal modes of Eqs.(1a) and (1b) with coefficients I p;s and G p;s .Surface S is in this case S ¼ S 1 ∪S 2 ∪S 3 and we chose perfect electric boundary conditions (i.e. S ¼ S E ).
The solenoidal set of modes ēIV n and hIV n can be found solving the equations in Table I.It is worth noticing that the n index is a triple index.Referring to cylindrical coordinates, n is given by the azimuthal m, radial p, and longitudinal s indexes.The index m is, for this beam current excitation, equal to 0. For the given boundary condition Table I  The expression (9) for TM modes still holds with T ¼ J 0 ðξ 0;p r=bÞ.Table IV resumes the other coefficients, where α 0;p;s ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi . Note that the fields have been normalized to the electric field volume norm in order to apply the mode matching method: For the irrotational fields, having perfect electric boundaries, we have F p;s ¼ 0 fromEq.(3b).The coefficients G p;s are non-null and correspond to the eigenvectors given by 8 < : We can find , and β s ¼ sπb=L, with s ∈ ℕ 0 .
These fields have been normalized to the volume norm analogously to the solenoidal ones.
To summarize, the problem of calculating the scattered fields reduces to finding the unknown infinite vectors C p , D p , A s , I p;s , G p;s .The complete expression for the electromagnetic fields in each region can be found in Appendix C.

C. Magnetic matching
Three matching equations can be found applying the field matching at thesurfaces S 1 , S 2 , S 3 .By means of an adhoc projection (Ritz-Galerkin method [6]) each functional equation may be transformed into an infinite set of linear equations.

Matching on S 3
Between region III and IV we can impose the continuity of longitudinal and azimuthal magnetic field components.Longitudinally we have: that simplifies to G IV z ¼ 0. This implies that the irrotational modes do not couple (G p;s ¼ 0). 021001-4 Azimuthally we have Substituting the azimuthal components and projecting over cosð

Matching on S 1
Between region I and IV we can impose continuity of the radial magnetic field components: Substituting the radial components in Eqs. ( 9) and ( 15) and projecting over ∇T=N 0;p we get

Matching on S 2
In an analogous way, we obtain for II and IV

D. Electric matching
Equations ( 12), (14), and (15) constitute a set of three equations in four unknowns.In order to get a fourth equation we should find a tool to match the tangential component of the electric field.This is not as simple as for the magnetic field since, according to the assumed expansion, the tangential component of the electric field on the boundary S ¼ S 1 ∪S 2 ∪S 3 is null by definition.Note that in the present case S ≡ S 0 of Eqs.(2a) and (2b).As previously mentioned, the expansion given by Eqs.(1a) and (1b) will not converge uniformly on the boundaries.However, this difficulty may be circumvented by resorting to the Eqs.(2a) and (2b): The surface integral has to be split for S 1 , S 2 , S 3 .After some algebra it leads to Equations ( 12), ( 14), ( 15), (17) constitute four independent vector equations in four vector unknowns.The problem is formally solved.

E. Sums manipulation
One way to simplify the system of equations is to proceed saturating the sums, either in the longitudinal index s or in the radial index p.This helps the study of the numerical convergence of the problem.
Inserting Eq. ( 17) in ( 14) and summing over s applying Eqs.(A1) and (A2) of Appendix A, we get Inserting Eqs. ( 17) in ( 15) and summing over s applying Eqs.(A1) and (A2) we get Solving the system in C p and D p and passing to a matrix formalism we have Analogously, inserting Eq. ( 17) in ( 12) and summing over p, applying (A3) and passing to a matrix formalism we get The matrix elements for E1, D1, N1, N2, M1, M2, B are reported in Appendix B, together with the dimension used for numerical truncation.Inserting Eqs.(20) and (21) in Eq. ( 22) we can find A s and from that, C p and D p .Applying these results in Eq. ( 17) we can also derive the I p;s coefficients.
We can calculate the longitudinal beam coupling impedance as [8] IMPEDANCE STUDIES OF 2D AZIMUTHALLY … Phys.Rev. ST Accel.Beams 17, 021001 (2014) 021001-5 The integral has to be split along regions I, II, and IV.In particular, to calculate the impedance contribution of region IV, we used Eqs.(A3) and (A4).

IV. APPLICATIONS
In this section we will show a series of studies related to the impedance dependence on the conductivity σ of the material in region III, on the length L of the device, and on the velocity v of the particle beam.The model dimensions are, unless differently specified, b ¼ 5 cm, t ¼ 25 cm, and L ¼ 20 cm according to Fig. 1.The material filling region III is supposed to have ε Depending on the case under study, a number of longitudinal modes S and transverse modes P have been chosen for the matrix truncation in the numerical implementation.The choice is done in order to be able to cover the whole frequency range with enough accuracy.An intuitive way to have a first estimation on the number of modes required to study a given structure is given by the separability condition: Given the geometry in terms of beam pipe radius b, cavity thickness t and insert length L, we can estimate the maximum number of modes P and S in order to reach the maximum frequency to be simulated f max .We defined S and P as the maximum number of longitudinal and radial cavity modes, differently from s and p, longitudinal and radial modal indexes: while the radial index p ¼ P, it is important to notice that s ¼ S − 1 since TM modes can have the s index equal to zero.
Figure 2 shows the case for a resistive wall calculation: σ ¼ 10 6 S=m and f max ¼ 10 GHz.Different choices of S are shown (S ¼ 5, 10, 15, 25) for the same number of radial modes (P ¼ 5): by increasing the number of longitudinal modes we can converge to the expected curve for the longitudinal resistive wall.In case of S ¼ 25 we cover the frequency span we are interested in.If, for example, we consider the case S ¼ P ¼ 5, the maximum frequency f max that could be simulated is 3.8 GHz. Figure 2 shows indeed a roll off in the impedance around this frequency as expected.Similar considerations hold for a higher number of modes.It has to be noted that in this case the number of radial modes P is not relevant since the current flows mainly on  the insert surface and therefore radial resonances are not expected.
For lower conductivities, resonant modes start to appear and the role of P modes becomes evident.
Figure 3 shows the case for a very narrow empty cavity: L ¼ 2 mm, t ¼ 45 cm, b ¼ 5 cm, σ ¼ 10 −10 S=m, f max ¼ 5 GHz.In this case, choosing S ¼ 1 is sufficient to cover the range of interest while, due to the thickness, we have to consider up to P ¼ 20 modes in order to converge as shown in Fig. 4.

A. Impedance dependence on conductivity
Figure 5 shows the comparison between the standard theory for thick wall [7] and our model: the agreement is good for high conductivity (σ > 10), while a discrepancy starts to be important for low conductivity at frequencies above cutoff.This is because the losses from the scattered waves into the pipes, which can propagate only above cutoff, become comparable to those produced into the volume of the insert, therefore increasing the impedance.
It is worth anticipating that the deviation from the thick wall formula becomes more and more pronounced if the skin depth becomes comparable to the insert thickness or the insert length L is smaller than the minimum half wavelength at cutoff λ co =2.The more general case is studied in Sec.IV B.
By further decreasing the conductivity, cavity resonances start to appear.Resonances have to be correctly measured in terms of shunt impedance R s , quality factor Q, and resonance frequency f res , in order to be able to identify the most dangerous ones for beam stability.CST Particle Studio Wakefield Solver [9] is a time domain simulator that allows the user to estimate the beam coupling impedance for different structures.The bunch is modeled as a Gaussian charge distribution with length σ b .Being a time domain solver the impedance is calculated in postprocessing as the ratio of the wake potential and the bunch spectrum.Therefore, depending on the wanted frequency range, an adequate bunch length has to be chosen.Figure 6 shows the comparison of CST and the mode matching impedance in case of σ ¼ 10 −2 S=m for two bunch lengths, σ b ¼ 4 cm and σ b ¼ 2 cm.With σ b ¼ 2 cm, at the cutoff frequency, the bunch spectrum has become ∼60% of its maximum value, while, using 4 cm, it is ∼10%.This justifies the better agreement reached for σ b ¼ 2 cm.Shorter bunch lengths are of course possible, paying a correspondent increase of mesh cells and computation time.
In the case of low conductivities, the estimation could become inaccurate due to the length of the wakefield oscillations.Figure 7 shows the convergence studies for the quality factor Q of the first resonance peak of Fig. 6.
Decreasing the conductivity from σ¼10 −3 S=m to σ¼3 × 10 −4 S=m, a longer wake is needed in order to estimate the correct value of Q.For example, the case of σ¼3 × 10 −4 S=m reached 5% discrepancy in Q evaluation with a wake length of 60 m.Lower values for conductivity would require longer wake and considerably longer simulation time.Note that Q is obtained with a fitting procedure and is normalized over Q MM , the merit factor calculated with mode matching that agrees within a few percent with the theoretical one.Further decreasing the conductivity, we can recover the empty-pillbox case.Since for conductivity ideally equal to zero, the resonances would be represented by Dirac functions for the real part of impedance, we used 10 −7 S=m.The radius of the beam pipe has been chosen as b ¼ 1 cm in order to avoid perturbation to the resonant frequencies due to the coupling with the beam pipe aperture.The length and thickness are L ¼ 20 cm and t ¼ 25 cm. Figure 8 shows the real part of the impedance and the position of the expected TM modes in an empty cavity pillbox as well as the results from computations with mode matching: the agreement with theory is very good.It is worth reminding the reader that TE modes do not couple with the beam source and therefore are not excited (differently would be, for example, in the transverse impedance study where also TE modes can be coupled).
If we now focus on the low frequency behavior of the longitudinal impedance, we can compare the mode matching results with the formula [10] This formula is valid in two regimes: (a) if L ≫ 2t then L is replaced by the thicknesst; (b) if L ≪ 2t then L is the insert length.Both of these are good approximations for k < 1=ðb þ tÞ i.e. f < f max ¼ c 2πðbþtÞ .Figure 9 shows the comparison of mode matching and the theoretical formula choosing σ ¼ 0 S=m and varying the insert length.The agreement for f=f max < 1 is generally good and we can distinguish the regimes (a) and (b), respectively, for L ¼ 1 m and L < 1 cm having 2t ¼ 50 cm.When the length becomes closer to 2t (for example on the curve for L ¼ 10 cm) the model starts to significantly deviate from the calculated impedance, being out of the range of the formula's applicability.
To complete the study, a comparison with the already existing theory for thin resistive inserts from Shobuda-Chin-Takata (SCT) [4] was done.In Shobuda's model the perfect electric conductor (PEC) boundary layer around the insert (layer around region III in Fig. 1) is not present and the field can propagate in free space.Moreover, following the approximation of short insert, the longitudinal modes have been neglected.The regime in which the two models are expected to agree is above the frequency in which the skin depth approaches the cavity PEC boundary.This behavior is clearly shown in Fig. 10 where we compared the two models varying the conductivity from σ¼10 2 S=m to σ ¼ 10 4 S=m.Below the frequency in which the skin depth becomes comparable with the transverse dimension of the cavity, the two models differ: in our model, the transverse field approaches the cavity's boundary and is  From f skin the two models start to converge to the same impedance value.However, one may notice that the mode matching impedance values slightly oscillate around Shobuda's ones before converging to the same curve.This discrepancy can be understood considering that around f skin the skin depth is comparable with the insert thickness.This implies that in our model the backward wave slightly interferes with the outgoing wave producing a modest standing wave pattern in the insert, therefore affecting the impedance.With increasing frequency, the backward wave amplitude becomes smaller and smaller and this pattern vanishes.

B. Impedance dependence on length
The impedance of a circular resistive sector inserted in a beam pipe can be studied, in first approximation, with a 2D model, i.e. assuming infinite length and scaling the impedance per meter to the device length [7,8].In this section we will present a series of studies done varying the length of our model in order to understand the contribution of finite length with respect to the infinite length approximation.Figure 11(a) shows the dependence on length in case of σ ¼ 1 S=m : the impedance shows similar behavior for all the device lengths but exhibits a resonant peak just below cutoff frequency, while at the cutoff it vanishes.
In order to explain the results we resort to a representation of the device as a circuit with lumped elements.Below the cutoff a semi-infinite pipe exhibits reactive input impedance which, for TM modes, is capacitive [11] (p. 698) where f co is the cutoff frequency.The impedance vanishes at cutoff and becomes resistive above.
According to the circuital representation, the two pipe impedances are in parallel to the "impedance of the insert," where the quoted expression indicates the impedance of the insert calculated replacing the two pipes with two PEC circular plates, which seal the insert and form a closed cavity.
Focusing on Figs.11(a) and 11(b), we may infer that the dissipation is such that we are in the regime of thick wall behavior (the insert thickness is larger than the skin depth): the surface impedance is very small and its phase angle is steadily π=4.It is apparent that at a certain frequency, just a bit smaller than f co , the capacitive reactance of the pipe becomes so small to equal the inductive reactance of the wall.In this case we have the typical behavior of a parallel resistance capacitance inductance circuit and that explains the resonance sharp peaks appearing in Figs.11(a) and 11(b).At the cutoff frequency the impedance vanishes.This is a typical behavior of trapped modes.Of course the circuital model is valid only if the length L is smaller than the minimum half wavelength, which in our case is λ co =2 ¼ 6.5 cm.This may explain why from L ¼ 20 cm the impedance does not vanish at the cutoff frequency.Note that the Q factor does not only depend on the amount of power losses but also on the fast change of the capacitive reactance in the narrow domain close to f co .However, the Q factor decreases according to the increase of the power losses, namely, according to the increase of the insert length and, up to a certain extent, according to the decrease of the conductivity.
When the conductivity of the insert becomes smaller than a certain amount, since the skin depth becomes comparable or larger than the sector thickness, the behavior of the insert changes: the resonances of the insert itself, which are due to the interference of outgoing and reflected waves, become apparent as depicted in Fig. 11(c).One may notice that at cutoff frequency, the resonant behavior has disappeared, and only the cliff to zero is apparent for the first three curves.Comparing with Figs.11(a) and 11(b), one could infer that the presence of the cutoff resonance depends on conductivity, while it is now understood that no resonance should appear for an insert with length L > λ co =2.This is only partially true: a deeper analysis shows that the possibility of two different states may happen also at constant conductivity and different thickness.
Figures 12 and 13 show the coupling impedance relevant to a fixed length L ¼ 8 mm for two different values of the insert thickness, respectively, t ¼ 25 cm and t ¼ 15 cm, and the conductivity σ ¼ 0.01 S=m corresponding to the case of Fig. 11(c): changing the value of t, the standing wave pattern changes and the cutoff frequency moves from an inductive region to a capacitive region.The different slopes of the closest resonance peak are clearly visible in the bottom part of the picture.
In the second case we are in the same condition as Figs.11(a) and 11(b) while, in the first case, the kink flips from the resonant behavior to the opposite polarity because the insert appears as a capacitance and therefore there is no inductance to produce a resonance.By the way, it is not unexpected that the ratio between the number of resonances is equal to the ratio between the two insert thicknesses.
A short insert with low conductivity, therefore, could give rise to the cutoff resonance according to the capacitive or inductive behavior of the insert nearby resonance.
These examples have enlightened the potentialities of the mode matching techniques and are not academical.A recent interest arose at CERN for materials with low losses.This is witnessed by the study of the dielectric properties at high frequency of SiC (ε r ¼ 10 and tg δ ¼ 0.2), oriented to its use in accelerator devices: recently this material has been characterized [12]; its equivalent conductivity would be estimated as σ eq ¼ ωϵ 0 ϵ r tgδ ¼ 0.1 S=m at f ¼ 1 GHz which is in the range of our examples.Furthermore, allowing for alumina 96% (ε r ¼ 9.4 and tg δ ¼ 4 × 10 −4 ), its equivalent conductivity is σ eq ≃ 5 × 10 −4 S=m at f co ¼ 2.29 GHz the cutoff frequency of a beam pipe with radius b ¼ 5 cm. Figure 14 shows the longitudinal impedance correspondingly to a 8 mm long alumina insert that could represent a beam pipe flange: the characteristic resonance close to cutoff can be appreciated at f trap ¼ 2.2946 GHz.This can be explained being the cutoff on the inductive impedance slope of the most nearby resonance.
Tests have been done also with CST-Eigenmode Solver, in order to verify if this behavior is the signature of a trapped mode.Figure 15 shows a simple model simulated: an 8 mm long alumina insert between two L pipe long beam pipes, sealed by PEC plates on both ends.The structure exhibits a mode at 2.2955 GHz, very close to f trap , that turns to be a TM 0;15;0 .The small discrepancy in frequency can be explained by the finite beam pipe length that we have chosen (L pipe ¼ 120 cm on both ends): close to cutoff, the EM field expands into the pipes; therefore, by increasing the beam pipe length, this discrepancy could be reduced.
As in the cases of Figs. 12, 13, and 14, by varying the insert thickness the resonance could disappear if the cutoff frequency corresponds to a capacitive insert resonance slope.This possibility, together with the absence of constriction on the insert dimensions, constitutes an extension of the trapped mode theory [10] developed for small cavitylike beam pipe perturbations.The frequency of the trapped mode can be analytically estimated with the formula where ω 01 is the beam pipe cutoff frequency ω

C. Impedance dependence on beam velocity
In the following we present some studies on nonultrarelativistic beams.Mode matching has been compared with the 2D axisymmetric code for multilayer beam pipes recently developed by N. Mounet et al. [13].Figure 17 shows the velocity dependence of longitudinal impedance in the case of using copper as filling material: all curves are below the ultrarelativistic case.
The ultrarelativistic beam approximation, commonly used in impedance calculations, constitutes, in the case of the longitudinal impedance, the worst-case scenario.
It is well known that, in Leontovich approximation, the decrease of the impedance with the beam velocity can be understood resorting to the perturbative method which assumes that the longitudinal current on the insert is just equal to the one circulating on a PEC pipe.According to Eq. ( 8) in an infinite smooth pipe the magnetic field on the wall is given by the following formula: which suggests that the maximum of the surface current is for frequencies that satisfy the following approximate equation: The frequencies calculated with Eq. (25) corresponding to β ¼ ð0.2; :::; 1Þ are indicated in Fig. 17 by vertical black lines and the intercepts with the impedance curves by colored dots.
However, this behavior is no longer kept for lower conductivities.Figure 18 shows the case of an insert with σ ¼ 0.05 S=m.Two features deserve explanation.There is a remarkable discrepancy between the mode matching results and the 2D axisymmetric code: the insert conductivity is so small that the infinite length approximation does not apply to this case.Furthermore, in both codes the maxima do not correspond to the frequencies calculated with Eq. (25), because the perturbative technique valid for the previous case cannot be applied here.

V. SUMMARY
The longitudinal beam coupling impedance of a finite length device was successfully derived with the mode matching method and benchmarked with existing theories and numerical simulations.
It has been shown how the method converges in function of longitudinal S and radial P number of modes, analyzing the relation with the geometry and the frequency range to be simulated.
Studying the impedance dependence on conductivity, we pointed out that a discontinuity in the surface impedance between cavity and beam pipe produces an increase in the real part of the impedance above cutoff due to the increased losses in the cavity: at low conductivities this behavior is evident while it becomes negligible for high conductivity cases.
For low conductivity materials, we showed that the mode matching method can give reliable estimations of resonance parameters, that otherwise would require long simulation time.This constitutes a good benchmark tool for numerical simulators like CST that encounter more difficulties for very high or very low conductivities.Even in the case of an empty cavity, or for thin conductive inserts (SCT model), mode matching was able to recover already established results, becoming an all-comprehensive bridge between different theories.Studying the dependence of the impedance over the device length, we showed that, for lengths L < λ co =2, a resonant behavior exists around the beam pipe cutoff frequencies due to the interplay between beam pipe impedance and insert impedance, analogously to what has been developed, under specific conditions, in the trapped mode theory.The characteristic kink behavior was explained resorting to a reasonably simplified transmission line model, and cases of short alumina beam pipe flanges were presented as possible applications to real accelerators.We underlined the correlation between small losses (either due to conductivity or complex permittivity), insert dimensions, and kink presence.This effect could be harmful for beam stability depending on the shape of the bunch spectrum.
For very small inserts, mode matching could be benchmarked with the theory of trapped modes: a good agreement within the limits of this theory could be found.
The study of the dependence on beam velocity showed that the impedance decreases accordingly to the decay of the driving magnetic field.This can be predicted, within a perturbative approach, by the well-known formula in Eq. (8).However it was shown that this applies only for high conductivity values.The ultrarelativistic case remains a worst-case scenario.
A more complete description of the interplay of scattered fields and beam stability requires the knowledge of the transverse beam coupling impedance.The mode matching calculation for this case has been developed and will be soon published.
The absence of evident limitations in the simulation of canonical problems sets the Mode Matching as the most complete and suitable technique for code benchmarking and detailed impedance studies.Moreover, an extension to more complicated structures is under investigation: commonly used numerical eigenmode solvers could generalize the matching procedure taking into account the mode expansion in arbitrary structures.

APPENDIX A
Here we report some of the most relevant series we used in order to simplify the mode matching implementation.Some of them are well known [14]; others have been derived from the Kneser-Sommerfeld formula [15].
The series used are the following:

APPENDIX C
Here we report the complete field expressions, schematically written through the paper to help the reading.
α b ¼ k b b, K 0 , I 0 are the modified Bessel functions of argument x ¼ α b =γ and u ¼ ðα b rÞ=ðγbÞ.K 0 and I 0 represent the derivative with respect to the argument.

FIG. 5 (
FIG. 5 (color online).Comparison of the mode matching method (full lines) with the standard thick wall formula (dashed lines) for conductivities from σ ¼ 10 S=m to σ ¼ 10 3 S=m.Frequency f is normalized to the cutoff frequency f co .Mode matching modes: S ¼ 20, P ¼ 10.

FIG. 11 (
FIG. 11 (color online).(a) Impedance normalized over the device length for conductivity σ ¼ 1 S=m.The length is varied from 20 um to 1 m.Mode matching parameters: S ¼ 10, P ¼ 10.(b) Impedance normalized over the device length for conductivity σ ¼ 100 S=m.The length is varied from 20 um to 1 m.Mode matching parameters: S ¼ 10, P ¼ 10.(c) Impedance normalized over the device length for conductivity σ ¼ 0.01 S=m.The length is varied from 20 um to 1 m.Mode matching parameters: S ¼ 10, P ¼ 10.

FIG. 10 (
FIG. 10 (color online).Comparison of mode matching (thick lines) and SCT's model (dashed lines).Curves with the same color refer to the same conductivity value.The black marks show the frequency f skin in which the skin depth approaches the cavity radius.Geometry: b ¼ 7 cm, t ¼ 1 cm, L ¼ 1 cm.Mode matching parameters: S ¼ 5, P ¼ 5.

FIG. 12 .
FIG. 12. Real part of the impedance for thickness t ¼ 25 cm.The different behavior at cutoff is clearly visible.b ¼ 5 cm, L ¼ 8 mm, σ ¼ 0.01 S=m.

TABLE I .
Eigenvector equations.

TABLE III .
TM waves in region III.