Calculation of coherent synchrotron radiation impedance using the mode expansion method

We study an impedance due to coherent synchrotron radiation (CSR) generated by a short bunch of charged particles passing through a dipole magnet of finite length in a vacuum chamber of a given cross section. In our method we decompose the electromagnetic field of the beam over the eigenmodes of the toroidal chamber and derive a system of equations for the expansion coefficients in the series. The general method is further specialized for a toroidal vacuum chamber of a rectangular cross section where the eigenmodes can be computed analytically. We also develop a computer code that calculates the CSR impedance for a toroid of rectangular cross section. Numerical results obtained with the code are presented in the paper.


I. INTRODUCTION
Synchrotron radiation of a relativistic beam moving in a toroidal chamber with conducting walls has been extensively studied in the past (see, e.g., [1][2][3]).The effect of the coherent radiation on beam dynamics is usually formulated in terms of a so-called coherent synchrotron radiation (CSR) impedance or wakefield.Many important features of the CSR impedance have been analyzed based on an exact solution of Maxwell's equations for rectangular cross section of the chamber.In the limit when the characteristic transverse size of the vacuum chamber L is much smaller than the toroid radius R, L ( R, this solution can be simplified, and the wakefield and impedance can be computed.A special case of a beam propagating between parallel conducting plates can be treated using a simpler method of image charges [4].The results of the parallel plates model are formulated in a relatively simple analytical expressions, and are widely used in applications.
One of the drawbacks of the previous approaches [1][2][3][4] is that they are only applicable to a very specific geometry of the toroid, for which Maxwell's equations allow separation of variables.A different and a more general approach to the problem was proposed by the authors in Ref. [5].It uses the smallness of the parameter ¼ ffiffiffiffiffiffiffiffiffi ffi L=R p to simplify Maxwell's equations, keeping only terms of the lowest order in .It turns out that in this approximation the transverse components of the electric field satisfy a so-called parabolic equation which was proposed more than 50 years ago in the diffraction theory [6], and has been widely used since that time.It is also a standard approximation in the FEL theory [7], and more recently was applied to the beam radiation problems in free space [8] and to the theory of high frequency impedance [9].In a subsequent development of the method [10,11], Agoh and Yokoya added a source term to the parabolic equation due to the beam current and developed an algorithm for its numerical solution.Important practical results for various accelerators were obtained using the code in [12,13].
In this paper we continue developing the approach of Ref. [5] and apply it to the case of the coherent synchrotron radiation of a beam that passes through a bend magnet of finite length.The geometry of the problem is shown in Fig. 1: it includes a toroidal segment and two long straight sections connected to the toroidal one.The first, entrance straight section is connected to the toroidal one at point A, and the second, exit section is connected at point B. The FIG. 1. (Color) A section of a vacuum chamber with toroidal bend between points A and B (a quarter of the pipe is cut out to expose the internal parts of the drawing).The thick black solid line is the central line of the pipe.Shown is a local coordinate system at the position with the longitudinal coordinate equal to s. cross section of every pipe is assumed to be the same.The length of the toroidal segment is equal to l as measured along the central line of the toroid between points A and B. This central line is assumed to be a plane curve.The coordinate along the axis of the toroid is s; it is chosen in such a way that the beam propagates in the positive direction.We also use x and y coordinates in directions transverse to s: the coordinate y is perpendicular to the plane of the central line, and the coordinate x is measured along the radius of the curvature of the central line.The origin of the coordinate system x, y is located on the central line of the pipe.
We note that the wakefield of a point charge for the trajectory shown in Fig. 1 in free space, in the absence of metallic walls, was calculated in Ref. [14].
We assume that a bunch of ultrarelativistic charged particles travels through the bend with the velocity v close to the speed of light and use the approximation v ¼ c.We also assume that the bunch length z is much smaller than the characteristic transverse size L-in the opposite limit the frequencies associated with the bunch are below the cutoff, and the bunch does not radiate.Although not required in the general method, we make several additional simplifying assumptions: (a) the transverse size of the beam is small and can be neglected, and (b) the beam orbit coincides with the central line of the pipe.It follows also from these assumptions that the longitudinal distribution of the beam (relative to its central point) does not change with time-it is ''frozen'' by the requirements of v ¼ c and the zero transverse extension of the beam.
Our approach to the general problem is split into several steps.In Sec.II we first present and analyze a parabolic equation that describes excitation of the electromagnetic field by moving charges inside of a toroidal section of the waveguide of radius R. Of course, this equation is also valid for a straight cylindrical pipe, where formally R ¼ 1. Eigenmodes in a toroidal waveguide and the general method of finding the electromagnetic field of the beam by means of expanding it over the modes are described in Sec.III.We then consider, in Sec.IV, the specific problem of a beam entering the toroid from a straight pipe, and, in Sec.V, a beam exiting from the toroid to the straight waveguide.General formulas obtained for the arbitrary shape of the cross section of the waveguides and arbitrary transverse profile of the beam density are then applied to the case of a rectangular cross section and a narrow beam in Sec.VI.Finally, in Sec.VII, we present numerical results for the longitudinal CSR wakefield for several different geometries of the toroid.
Throughout the paper we assume a perfect conductivity of the walls.

II. PARABOLIC EQUATION FOR THE FIELD
In this section we present a parabolic equation for the electromagnetic field generated by a beam of charged particles in a toroidal waveguide with a given cross section.The detailed derivation of the equation can be found in [5,10]; here we only present the equation and discuss its conditions of validity.
We consider a section of a smooth toroidal vacuum chamber of radius R and arbitrary cross section as the one shown in Fig. 1 between points A and B. The parabolic equation is formulated for the electric field and the current in the curvilinear coordinate system x, y, and s shown in Fig. 1.We introduce the Fourier transformed electric field Ê and the longitudinal component of the current ĵs with the aid of the following expressions: dte i!tÀiks Eðx; y; s; tÞ; dte i!tÀiks j s ðx; y; s; tÞ; ( where k !=c.We also introduce the transverse component of the electric field Ê? as a two-dimensional vector Ê? ¼ ð Êx ; Êy Þ, and the longitudinal component of the electric field Ês .Note that the additional factor e Àiks in Eqs. (1) removes a rapidly oscillating dependence of the Fourier components on the variable s, typical for waves propagating along s with the velocity close to the speed of light.
A mathematical assumption that leads to the parabolic equation is a slow dependence of the functions Ê? and ĵs versus s, such that @=@s ( k.It means that we are interested in components of the field propagating in the positive direction of s at small angles to the axis of the toroid.In particular, we neglect a part of the field propagating in the negative direction of s.As was shown in Refs.[5,10] using this approximation for the electric field Ê? generated by the beam inside the toroid leads to the following parabolic equation: where r ?¼ ð@=@x; @=@yÞ.The longitudinal electric field can be expressed through the transverse one and the current Boundary conditions for Eq. ( 2) are imposed on the metal wall by the requirement that the tangential components of the electric field vanish on the surface of the toroid.If n is a normal vector to the surface, we have If follows from Eq. (3) that, if the density of the current on the wall vanishes, the second equation in (4) reduces to ðdiv Ê? Þj wall ¼ 0.
Note that an axisymmetric version of Eq. ( 2) for a straight pipe (R ¼ 1) was used in [9] for a study of the longitudinal impedance in the limit of high frequencies.

III. EIGENMODES AND BEAM FIELD EXPANSION
Within the framework of the parabolic equation a toroidal waveguide possesses a set of eigenmodes which are special solutions of Eq. ( 2) with ĵs ¼ 0. Each eigenmode can be characterized by two integer indices, m and p, and the wave number q mp ð!Þ, which is a function of frequency !, Êmp;? ðx; y; sÞ ¼ E mp;? ðx; yÞe iq mp ð!Þs ; Êmp;s ðx; y; sÞ ¼ E mp;s ðx; yÞe iq mp ð!Þs : (5) To simplify notations we do not indicate the argument ! in the components of the field in Eq. ( 5).We will also drop arguments of these functions in what follows in cases where it does not lead to confusion.A time dependent solution corresponding to a given mode is given by with Note that the validity condition for the parabolic equation @=@s ( k requires jq mp j ( k, which means that the frequency of the mode is much larger than the cutoff frequency (at which k mp ¼ 0).The transverse structure of the mode and the eigenvalue q mp ð!Þ are determined from the homogeneous parabolic equation: which is obtained by putting (5) into Eq.( 2) and setting ĵs ¼ 0. The longitudinal component of the field can be expressed through the perpendicular components using Eq. ( 3): As we will see below in the analysis of eigenmodes of a rectangular waveguide [Eq.(59)], the parabolic equation correctly describes modes at frequencies much higher than their cutoff frequencies.Such modes make a dominant contribution to the impedance of a bunch with a length much shorter than the characteristic transverse size of the waveguide.
One can prove that the modes E mp;? compose a complete orthogonal set, which can always be normalized in such a way that the following orthogonality condition holds, where the integration goes over the cross section of the toroid.In the general case, for a given shape of the toroid, Eq. ( 7) represents a two-dimensional problem which can be solved numerically.An example of such a solution for a round cross section of the toroid is given in Ref. [5].Eigenmodes for the rectangular cross section can be found analytically [5].We give a short derivation for this case in Sec.VI A.
Following a general method of Ref. [15], we expand the perpendicular part of the electric field Ê? generated by the current ĵs into a series Êmp;? ðx; y; sÞ (10) over the eigenmodes.Putting this series into Eq.( 2), multiplying the result by ÊÃ mp;? , integrating it over the cross section of the waveguide, and using the orthogonality property (9) leads us to the equation for the series coefficients: ZZ dxdyðr ?ĵs Á E Ã mp;? Þ: (11) As discussed in the Introduction, we assume that the current ĵs does not vary with s and integrate (11) over s from s ¼ 0 to the current value of s.The right side of (11) depends on s through the exponential factor e Àiq mp s which makes the integration trivial: Using Eq. ( 3), we also obtain the longitudinal component of the field: Equations ( 12) and ( 13) give a general solution for the longitudinal field generated by the beam inside the toroidal pipe.This solution depends on the initial values of the coefficients C mp ð0Þ which should be found from expansion of the beam field at the entrance to the toroidal segment over the toroidal eigenmodes.We will carry out this expansion in the next section.

IV. BEAM ENTERING A TOROIDAL SEGMENT FROM A STRAIGHT SECTION
When the beam enters the toroidal section at point A (corresponding to s ¼ 0) in Fig. 1, its field at this point, CALCULATION OF COHERENT . . .Phys.Rev. ST Accel.Beams 12, 104401 (2009) 104401-3 Eð0Þ, is equal to the equilibrium steady state Coulomb field that it carries in the long straight pipe.We will use the notation E ss ?for this steady state field.Because we assume that the beam is moving with the speed of light, the longitudinal component of E ss ? is equal to zero.It is therefore equal to zero at the entrance s ¼ 0 to the toroidal segment.The continuity of the electric field at s ¼ 0 allows us to determine the initial values C mp ð0Þ in Eq. (13).
Indeed, putting simultaneously Ês ¼ 0 and s ¼ 0 in Eq. ( 13) gives Finding ĵs from this equation and substituting it back to Eq. ( 13) gives The perpendicular electric field of the beam at s ¼ 0, which we denote Ê? ð0Þ, being also continuous at this point can be expanded into the series over eigenmodes of the toroid as Using the orthogonality property ( 9), we find Substituting C mp ð0Þ into Eq.( 15) gives Making integration by parts in the first term on the right side and using Eq. ( 8) yields an alternative form of the last equation: It is interesting to note here that the second term in Eq. ( 19) gives a solution to a different problem where a plane electromagnetic wave falls onto an open end of a toroidal pipe in the normal direction.In this case, the source current is zero, ĵs ¼ 0, and the longitudinal projection of the incoming wave is also zero, E s ð0Þ ¼ 0, as has been assumed in the derivation of Eq. ( 19).Equation ( 19) then gives a distribution of the longitudinal field along s trapped inside the toroidal waveguide in the parabolic equation approximation.
As was pointed out above, from field continuity at s ¼ 0 we have where Êss is the Fourier component of the beam field in the straight pipe.The field Êss ?can also be found from the parabolic equation ( 2) in the limit R ! 1.With the assumed equality v ¼ c, the beam current in the straight pipe has a form j s ðx; y; s À ctÞ, and, as it follows from (1), the Fourier transformed ĵs does not depend on s.Hence, Êss ?does not depend on s either, and the parabolic equation for Êss ? in a straight pipe reduces to As was mentioned at the beginning of this section, the parallel component E s of this field is zero so that Eq. ( 3) reduces to Equations ( 21) and ( 22) are consistent with the perpendicular field being a potential one, i.e., with the potential c ¼ c ðx; yÞ obeying the Poisson equation The boundary condition Êss ?j w Â n ¼ 0 at the conducting wall of the waveguide means that c has a constant value on the wall, c ¼ const.Without loss of generality, the constant can be set to zero, so that Eq. ( 24) should be solved with the boundary condition A general solution of the boundary value problem, Eqs. ( 24) and ( 25), for a rectangular cross section, in a form most suitable for our purposes, can be found in Ref. [16].We will use this solution below in Sec.VI B.
Repeating the calculation that leads to Eq. ( 19) and using Eqs.(20) and (23) for Ê? ð0Þ, one finds for the transverse component of the electric field inside the toroid We will now consider what happens to the electromagnetic field beyond point B, at s > l, after the beam exits from the toroidal section.We assume that the straight exit pipe is long enough so that eventually the electromagnetic field of the beam reaches its steady state, the radiation that came out of the toroidal section gets behind the beam and the interaction between the radiation field and the beam ceases.
With minor modifications, we can repeat the derivation of Sec.II and find the longitudinal electric field of the beam after it exits from the toroid into the straight pipe.We now need to expand the field into a series of eigenmodes in the straight waveguide.They satisfy the same Eq.( 7) with R ¼ 1: where we use the tilde to distinguish various quantities in the straight pipe from their analogs in the toroid.Each mode has a longitudinal component of the field given by Eq. ( 8).It is convenient to separate the steady state field given by Eq. ( 23) from the field in the straight waveguide and expand the difference over the eigenmodes: Cmp ðsÞ Êmp;? : Repeating the derivation of Sec.II, it is easy to find that and hence Cmp ðsÞ are equal to their initial values at the transition point s ¼ l, Cmp ðsÞ ¼ Cmp ðlÞ.Equation (29) can be explained as follows.When the beam enters the straight pipe, it ceases to radiate electromagnetic waves, and the amplitudes of the waveguide eigenmodes do not change with distance s.They are determined by the electromagnetic field that comes out from the toroidal segment and is converted into the eigenmodes of the straight waveguide at the transition point s ¼ l.
To find the coefficients Cmp we use the continuity of the field at the transition point B and expand the difference Ê? À Êss ?¼ Ê? À r ?ĉ at s ¼ l (that is at the exit from the toroid) over the eigenmodes of the straight waveguide, Cm 0 p 0 Ẽm 0 p 0 ;? e iq m 0 p 0 ðsÀlÞ : (30) Note that where the integration goes over the cross section of the pipe.Using the orthogonality condition for the modes of the straight waveguide, and also using Â ð1 À e iq mp l ÞE mp;? ; which follows from Eqs. ( 26) and (31) at s ¼ l, we find the coefficients where stands for the matrix elements in the expansion of the toroidal eigenmodes E mp;? over the eigenmodes Ẽm 0 p 0 of the straight waveguide.It might be also useful to expand E Ã mp;? in the integrand of the right side in (34), E Ã mp;? ¼ X m 00 ;p 00 Ã mpjm 00 p 00 ẼÃ m 00 p 00 ;? : Then, Eq. (30) reads ĵs div ẼÃ m 00 p 00 ;? mpjm 0 p 0 Ã mpjm 00 p 00 ð1 À e iq mp l Þe iq m 0 p 0 ðsÀlÞ Ẽm 0 p 0 ;? : (38) An expression for the longitudinal field is obtained from the previous formula by substituting Ẽm 0 p 0 ;? with Ẽm 0 p 0 ;s : ĵs div ẼÃ m 00 p 00 ;? mpjm 0 p 0 Ã mpjm 00 p 00 ð1 À e iq mp l Þe iq m 0 p 0 ðsÀlÞ Ẽm 0 p 0 ;s : CALCULATION OF COHERENT . . .Phys.Rev. ST Accel.Beams 12, 104401 (2009) 104401-5

VI. RECTANGULAR CROSS SECTION OF THE VACUUM CHAMBER
We will now apply the general formalism developed in previous sections for an arbitrary geometry of the transverse cross section of the toroid to a particular case of the rectangular cross section.In this case, the parabolic equation can be solved using separation of variables and the eigenmodes are explicitly expressed in terms of the trigonometric and Airy functions.

A. Eigenmodes in toroidal waveguide with rectangular cross section
We consider a toroidal waveguide with rectangular cross section of width a along the x axis and height b along the y axis.Note that the characteristic transverse size L introduced in the Introduction, for rectangular cross section, is estimated as L $ minða; bÞ.The origin of the coordinate system is at the center of the rectangle, with the metallic boundaries located at x ¼ AEa=2 and y ¼ AEb=2, see Fig. 2. In such a waveguide, the eigenmodes are separated into two sets.One set comprises the modes polarized along the x axis, and the other set along the y axis.
It is convenient to introduce the dimensionless coordinate and Using the variable , the transverse electric field in these modes can be written as [5] for the E x modes, and for the E y modes, where denotes a normalization factor for the index p, and p0 ¼ 1 if p ¼ 0 and p0 ¼ 0 otherwise.
The functions U m ðÞ and V m ðÞ obey the same equation, but different boundary conditions at ¼ AE a =2, namely, The prime in the equations above indicates differentiation with respect to .The notation Ä m in Eqs.(43) stands for where in the last equation we used the smallness q mp ( k. A general solution to Eqs. ( 43) and (44) involves the Airy functions Ai and Bi, see [5], and can be written as where the eigenvalues Ä V m and Ä U m of Ä m are found, respectively, from the equations The factors N V m and N U m in Eq. (46) determine normalization of the eigenfunctions on the index m and are given below.Index m is defined so as to indicate the number of nodes of the functions U m ðÞ and V m ðÞ on the interval À a =2 < a =2.It takes the values 0; 1; 2 . . .for the functions V m and 1; 2; 3 . . .for the functions U m .
The normalization (9) for the vectorial functions E mp;? , with the explicit expressions for the field components (42), leads to the following conditions for the functions V m and U m : a b x y FIG. 2. Cross section of a rectangular toroidal chamber with a denoting the width in the horizontal (x) and b denoting the height in the vertical (y) directions.The origin of the coordinate system is located at the center of the rectangle.
Using the identity Z d Ci 2 ðÞ ¼ Ci 2 ðÞ À Ci 02 ðÞ valid for any linear combination CiðÞ ¼ AiðÞ þ BiðÞ of the Airy functions, we find from (49) that the normalization constants in Eq. ( 46) are given by the following expressions: m and Ä V m are found, the corresponding values of q mp are obtained from the equation (45), where b is defined in (41).We will use the notations q V mp and q U mp to distinguish between the eigenvalues of the functions V m and U m , respectively.
Longitudinal fields for the eigenmodes can be found from Eq. ( 8); they are expressed as (51a) for the E x and E y modes, respectively; note that modes with either m ¼ 0 or p ¼ 0 have no longitudinal field.The right side of (50) can vanish at some particular frequencies leading to q mp ¼ 0 and k mp ¼ !=c.Such a frequency corresponds to a resonant mode that has a phase velocity equal to the speed of light and can be excited by an ultrarelativistic beam.Coherent synchrotron radiation due to excitation of such modes was studied in detail in Ref. [5].

B. Steady state field in straight rectangular waveguide
As explained in Sec.IV, in addition to finding modes in the toroidal waveguides, we need to calculate the steady state field of the bunch in a straight waveguide.For a rectangular waveguide, this field can be found analytically from Eqs. ( 24) and (25).For our purposes, it is enough to consider only the case when the source current corresponds to a point charge q moving along the geometrical center of the waveguide, i.e., j s ¼ qcðxÞðyÞðs À ctÞ.The Fourier transformation (1) of the current gives It is convenient to consider c in (24) as a function of variables and y and expand it in Fourier series over the variable y: The electric field is then given by

C. Eigenmodes in straight rectangular waveguide
The eigenmodes of the straight rectangular waveguide in our approximation satisfy the parabolic equation ( 27) with the longitudinal electric field in the modes given by The modes with different polarization but the same numbers m and p have equal wave numbers Note that this expression can be obtained from the exact dispersion relation for eigenmodes in the rectangular waveguide in the limit when the mode frequency is much larger than the cutoff frequency.The quantity div Ẽmp;? related to the longitudinal electric field in the mode is equal to for the E x modes and for the E y modes; note that the longitudinal field is absent if either m ¼ 0 or p ¼ 0. Finally, we also note that for large negative values of Ä m , such that jÄ m j ) 1  2 a ; (61) the toroidal modes (42) approach the modes of a straight waveguide.In this limit, Ä U m % Ä V m % À 2 m 2 = 2 a , and V m ðÞ % Ṽm ðÞ, U m ðÞ % Ũm ðÞ.The condition (61) can be also written as 2 m 2 ) 2 3 a or m ) ka ffiffiffi ffi a R r :

D. Beam entering and exiting rectangular toroidal section
Using the results of the previous sections, we can calculate the longitudinal field (19) generated by a point charge after it enters a toroidal waveguide from a long straight section.These calculations are carried out in Appendix A, and the result is given by Eq. (A8).We reemphasize here that we use the Fourier representation and the right side of (A8) is a function of the frequency !.Note that at frequencies of resonant modes, that is when q U mp ¼ 0 or q V mp ¼ 0, the denominator of the right side of (A8) vanishes.This however does not lead to a singularity of the expression because the corresponding numerator 1 À e iq U mp s or 1 À e iq V mp s vanishes at the same time.
If the toroidal part of the transition is long enough, as the beam propagates away from the entrance to the toroid and s increases, the electromagnetic field inside the toroid will be approaching its limiting steady state value.This steady state toroidal field can be formally obtained as a limit s ! 1 in Eq. (A8).It is derived in Appendix B and is given by Eq. (B11).On the axis ¼ y ¼ 0 it reduces to a relatively simple expression (62) A similar expression has been derived in Ref. [5] [Eq.(B9) in Appendix B], however, it was incorrectly concluded that from this equation it follows that the field in front of the particle is equal to zero.Note that in contrast to (A8), Eq. ( B11) is singular at frequencies of the resonant modes where one of the denominators on the right side vanishes.The terms sgnð!Þi0 in the denominators of (B11) establish the correct way to treat these singularities.According to Eq. (B7), the deltafunction parts of the singular expression contribute to the real part of Ês0 ð!Þ, which is an even function of the frequency !.The principal part of the singularity is responsible for the imaginary part of Ês0 ð!Þ, and is an odd function of frequency.
After the beam exits the toroidal segment and enters the region s > l of the straight pipe, the electromagnetic field generated inside the toroid travels with the beam for some time.The group velocity of this field, however, is smaller than the speed of light, and eventually it starts to lag behind the beam.Calculation of this field is carried out in Appendix C.
In Appendix D we obtain general expressions for the longitudinal field integrated through the toroidal segment and the exit pipe.This field gives the usual definition of the longitudinal CSR wake caused by the beam passage though the bend magnet.

VII. NUMERICAL RESULTS
To calculate the field generated by a bunch of particles traveling through a toroidal bend shown in Fig. 1, we wrote a computer program using the Mathematica programming environment [17].The program assumes a beam moving with the speed of light on the central line of the toroid x ¼ y ¼ 0 and neglects the transverse size of the bunch.The distribution function of the bunch is given by Nfðs À ctÞ, where N is the number of particles in the bunch, and f is normalized by unity.The bunch is characterized by the spectrum fð!Þ: d!e Ài!z=c fðzÞ: For a Gaussian bunch with the rms length z we have The field of the bunch in the space-time domain is given by the inverse Fourier transform: We express this field as a function of the variables z ¼ s À ct, which is a coordinate relative to the center of the bunch at a given time, and divide it by the total charge Nq; the resulting quantity is the longitudinal wake of the bunch at location s: The code calculates this wake on the beam orbit x ¼ y ¼ 0 for any given value of s.It can also compute the integrated wake Z 1 0 wðz; sÞds; using Eq.(D5), where the integration takes into account both the wake in the toroid and in the exiting straight pipe.Note that the wake in the straight entrance pipe, where s < 0, is zero, which is reflected in the choice of the lower integration limit in (66).
In addition to calculation of the field for the geometry shown in Fig. 1, our code computes the field Ês using Eq. ( 62).This steady state field would set up in a long toroidal section when the transition processes caused by the entrance to the toroid can be neglected.As was pointed out in Appendix B, the field Ês has singularities at the frequencies corresponding to the toroidal modes that are resonant with the beam.A special numerical procedure is used to select singularities in (62) and to separately evaluate their contribution to the integral (65).We use this algorithm, in particular, for comparison with a model of two conducting parallel plates widely referred to for evaluation of the shielding effect of the conducting walls.
To illustrate the capabilities of the code we compute the CSR wake for the following numerical parameters: the rms bunch length z ¼ 0:5 mm and the orbit radius R ¼ 1 m.We vary the aspect ratio of the rectangle A ¼ a=b and the vertical dimension b.The plots below represent three  62)] for a rectangular toroid with the aspect ratio A ¼ 3 in Fig. 3, A ¼ 1 in Fig. 4, and A ¼ 0:5 in Fig. 5, and the four different values of the dimension b.The black curve on each plot shows the wake for the toroid and the dashed line shows the Gaussian beam profile.For comparison, in Figs. 3 and 4, the red curve shows the wake calculated for the parallel plates model with the gap equal to b and the blue line shows the wakefield in free space (no shielding).
Analyzing Fig. 3, one can see that a vacuum chamber with an aspect ratio A ¼ 3 can be reasonably well approximated by the parallel plates model, however, only in the vicinity of the bunch.There are noticeable deviations from the model at large distances s $ 5-10 mm behind the bunch which become more pronounced for smaller values of the gap b.Of course, the square cross section of the vacuum chamber, Fig. 4 with A ¼ 1, shows even a larger deviation from the parallel plates model, as expected.
An interesting feature visible in Figs.4(c), 5(b), and 5(c) is almost sinusoidal oscillations of the wake behind the bunch.This effect can be explained by a dominant excitation by the beam of a single resonant mode (that is a mode with the phase velocity equal to the beam velocity c) in the toroid.For example, as calculations show, the frequency of the lowest resonant mode in the toroid with a square cross section of 1 cm [corresponding to the case of Figs.4(c)] is equal to ! ¼ 1:43 Â 10 12 s À1 corresponding to the wavelength of 1.31 mm.This is the wavelength of oscillations seen in Figs.4(c).Similarly, the lowest resonant mode for the toroid with A ¼ 0:5 and b ¼ 2 cm has a wavelength of 2.0 mm, in agreement with the oscillation period in Fig. 5(b).
Figures 6 and 7 show plots of the transient wakefields of the bunch inside the toroid for several distances s from the entrance to the toroid.Figure 6(a) demonstrates a buildup of the wake with increasing distance from the entrance.Figure 6(b) shows that even deep inside the toroid, at distances $90 cm, the wakefield behind the beam, z $ 5-10 mm, does not reach an equilibrium value and continues to evolve with increasing s.
We compared the process of buildup of the wakefield at the entrance to a toroidal segment for the case A ¼ 3 and b ¼ 4 cm with the wakefield at the entrance to a bend in free space (which mathematically corresponds to the limit a, b ! 1 in our method).The wakefield in free space was computed using equations from Ref. [14], in the limit The result of such a comparison is shown in Fig. 8.The shielding effect in the toroid of this large aperture is relatively weak and this plot shows a rather good agreement with the free-space wakefield.The deviations from the free space case are observed in front of the bunch at larger distances (17 and 22.6 cm) from the entrance to the bend.
Figure 9 shows the evolution of the wake after the beam exits from the toroidal section and travels through the straight pipe.Note how with increasing distance from the  exit Ás, the wake in the vicinity of the bunch, jzj & 5 mm, gradually disappears, while the wake at large distance behind the bunch, z $ À15 mm, decreases with the distance rather slowly.Finally, Fig. 10 shows an integrated wake (66) for three different lengths of the toroidal segments.

VIII. CONCLUSIONS
In this paper we presented a new method for calculation of the CSR wake in a vacuum chamber with perfectly conducting metallic walls.Our general method, in principle, is applicable to arbitrary cross section of the toroidal pipe.It, however, requires knowledge of the toroidal modes for this cross section, which in general can only be found numerically.Note, however, that finding the eigenmodes constitutes a two-dimensional computational problem, and can be relatively easily accomplished with existing numerical codes.Although we focused our analysis on calculation of the longitudinal CSR wakefield, the transverse component of the wake can also be computed in our method.
In the case of a rectangular cross section of the pipe, the toroidal eigenmodes can be calculated analytically and summation in the series representation of the electromagnetic field can be carried out.A numerical algorithm that calculates the CSR wake for such a cross section is implemented as a Mathematica computer code.The results of the numerical calculations with the code are presented and compared with the parallel plates model.This will now properly combine with Êð1Þ s ð; yÞ in the limit s ! 1.
We now consider the field Êð1Þ s given by (A4).In the limit of s ! 1, the following asymptotic relations hold: where symbol P indicates that integration of 1=a should be treated as a principal integral.Equivalently, we can write Using this relation, we find that in this limit Êð1Þ s ð; yÞ ¼ À Using (50) we arrive to the final formula, Note that Ês ð; yÞ has singularity at the frequencies where Ä m À 2 p 2 = 2 b ¼ 0. As it follows from Eqs. (50) and (6), at these frequencies q mp ¼ 0 and k mp ¼ !=c, which means that the phase velocity of these modes is equal to the speed of light.Such modes are resonantly excited by an ultrarelativistic particle, and in steady state their amplitude tends to infinity.A detailed study of excitation of these modes (using a different method) was carried out in [5].

APPENDIX C: DERIVATION OF EXPRESSION FOR
Ês FOR A BEAM EXITING TOROIDAL SECTION In this section, we derive the wakefield within a second straight segment given by Eq. (39) for the case of a waveguide with rectangular cross section.Note that in this case the number of summations in Eqs.(38) and (39) reduces by two since the transformation matrix has a form mpjm 0 p 0 ¼ mjm 0 pp 0 ; (C1) and the integral in the square brackets can be calculated analytically.
Taking into account the specific form (C1) of the coefficients mpjm 0 p 0 ¼ mjm 0 pp 0 in this case reduces (39) to To distinguish between the mjm 0 coefficients for E x and E y modes we will use subscripts V and U correspondingly.With the use of Eqs.(58) mjm 0 can be rewritten as with the boundary condition c p ðAE a =2Þ ¼ 0 yields[16]

FIG. 6 .
FIG. 6. (Color) Wakefields for the case A ¼ 3 and b ¼ 2 cm at various distances from the entrance to the toroid: (a) distances 4, 8, 12, and 16 cm from the entrance (a larger distance corresponds to a larger amplitude of the wake), (b) distances 84, 88, 92, and 96 cm from the entrance.

FIG. 7 .FIG. 8 .FIG. 9 .
FIG. 7. (Color) Wakefields for the case A ¼ 1 and b ¼ 2 cm at various distances from the entrance to the toroid: (a) distances 4, 8, 12, and 16 cm from the entrance (a larger distance corresponds to a larger amplitude of the wake), (b) distances 84, 88, 92, and 96 cm from the entrance.

FIG. 10
FIG. 10. (Color) Integrated wake for the case A ¼ 3 and b ¼ 2 cm and three lengths of the toroidal segment: 5 (blue line), 10 (broken red line), and 20 (thin black line) cm.
p ðÞV m ðÞV m ðÞ is the expansion of c 0 p ðÞ into a series over the complete set of orthogonal functions V m ðÞ.Hence, Eq. (54).The final step is to expand the delta function into series over functions U m : B6) and (B9) we obtain Ês ð; yÞ ¼ Êð1Þ s ð; yÞ þ Êð2Þ s ð; yÞ (we remind the reader that we use tilde to indicate quantities that refer to a straight waveguide, with toroidal analogs not having the tilde sign).Introducing the functions Ṽm ðÞ and Ũm ðÞ that are related to the field components Ẽmp;x and Ẽmp;y through Eqs.(42), we find that determine normalization of the modes.If we choose the same normalization (49) for the functions Ṽm ðÞ and Ũm ðÞ as for V m ðÞ and U m ðÞ, we obtain CALCULATION OF COHERENT . . .