Closed analytical expression for the electric ﬁeld proﬁle in a loaded rf structure with arbitrarily varying y g and R 000 (cid:1)(cid:1)(cid:1) Q

The design of a detuned and damped accelerating structure implies variations in the geometry which induce, in turn, a variation of the group velocity y g and the impedance per unit length R 0 , divided by the quality factor Q . The resulting differential equation for the longitudinal electric ﬁeld (fundamental mode) contains coefﬁcients that depend on the distance z along the structure. This report describes a possible method to solve this nonlinear, ﬁrst-order differential equation analytically and how to obtain approximate closed algebraic forms, by using the sequence of Gauss integration methods. Analytical expressions of the longitudinal ﬁeld proﬁle in a loaded or unloaded accelerating section are deduced for both linear and arbitrary variations of y g and R 0 (cid:1) Q . Simple relations between the average ﬁeld (cid:2) E (cid:3) and the ﬁeld at the entrance of the structure E (cid:4) 0 (cid:5) make it possible to provide the dependence of the ﬁeld function E (cid:4) z (cid:5) on the design value for (cid:2) E (cid:3) and on the structure parameters. The results are in good agreement with the direct numerical integration. Applications are presented for particular structure designs.


I. INTRODUCTION
In the design of a detuned and damped accelerating structure [1], the variations in the geometry induce a variation of the group velocity y g and the shunt impedance per unit length divided by the factor of merit R 0 ͞Q [2]. As a consequence, the differential equation for the longitudinal electrical field E is modified into an equation with coefficients that are dependent on the coordinate z, i.e., the distance along the structure. Though the resulting equation can be solved numerically, it is always interesting to derive, whenever possible, an analytical solution in a closed algebraic form. This can provide insight into the dependence of the result on the input parameters as well as the possibility of using a short symbolic program for a rapid interactive analysis of various structure designs. A method is proposed hereafter to solve the differential equation for the electric field of a loaded or unloaded structure and to find accurate analytical approximations which can be written in a closed form. A comparison with the direct numerical integration of the basic equation (with Cauchy's method) shows a very good agreement with the analytical result in the z interval of interest. The present analysis provides relationships between, on the one hand, the field profile of the fundamental mode and, on the other hand, the structure length, the average accelerating gradient required, as well as the variations of the group velocity and R 0 ͞Q along the cavity for tapered or detuned damped structures. These variations serve as inputs for the analytical solution of the problem, and they are derived from numerical field computation programs. The presented analysis gives a very useful complement to the common relations widely used for constant impedance or constant gradient structures and is applicable, in particular, to the (Compact Linear Collider) CLIC tapered damped structure [1]. This structure and a damped detuned structure of (Next Linear Collider) NLC type [2] are used to illustrate the application of our formalism and the accuracy of the results.

II. BEAM LOADING EQUATION TO BE SOLVED
The derivation of the differential equation for the longitudinal electric field as a function of the distance z along an accelerating structure is given in Refs. [3,4]. An analytical solution is presented in [3] for the case of constant R 0 ͞Q and linearly varying group velocity, and the equation is solved numerically for the case where both R 0 ͞Q and y g vary linearly. Ref. [4] proposes a solution for a constant-gradient structure when the shunt impedance per unit length does not change.
The present paper gives a general class of analytical solutions valid for arbitrarily varying R 0 ͞Q and y g , not necessarily constant quality factor Q, and for a flat beamcurrent distribution with respect to z. With the assumption that the power flow is constant except for the dissipation in the wall (depending on the factor Q) and the power exchange with the beam (proportional to the factor R 0 ͞Q), the basic differential equation is written as [3,4] d dz where y g ͑z͒ is the group velocity and v the frequency of the fundamental mode. The question that arose was how to solve the differential equation (1) with linear variations with respect to z of y g and R 0 ͞Q, over the length L of the structure, y g ͑z͒ y g ͑0͒ 2 Dy g z L , and for a given initial value (at z 0) of the longitudinal electric field defined by More generally, we are interested in trying to solve Eq. (1) for any relevant functions F 1 ͑ ͑ ͑y g ͑0͒, z͞L͒ ͒ ͒ and F 2 ͑ ͑ ͑R 0 ͞Q͑0͒, z͞L͒ ͒ ͒ of z, representing possible variations of the group velocity and the impedance factor, and this for a given average longitudinal electric field over the length of the structure. This means solving (1) with and assuming that we can find an explicit relation between the initial value of the field and its average ͗E͘ taken over the structure [see Eq. (10) below] In this report, a method is described that allows the solution of Eq. (1) in the general case and gives an expression for the field E͑z͒ containing, however, integrals which cannot be fully evaluated analytically for the assumed variations (2) or (4) of the coefficients. Therefore, Gauss approximations of the integrals are proposed, so as to obtain in both cases explicit analytical solutions which provide very accurate estimates in the parameter interval of interest (confirmed by comparison with numerical quadrature) as well as the dependence of the solutions on the accelerating structure parameters. For any functions F 1 and F 2 , the approximate solution E͑z͒ obtained for the field is a linear function of its initial value E͑0͒. Therefore, the average field ͗E͘ obtained by further integration upon z of E͑z͒ will also be a linear function of E͑0͒ which can eventually be solved for E͑0͒ in order to provide the form (5). Again the integration of E͑z͒ is done using Gauss approximations that provide a very good evaluation of the average as shown in the applications.

III. CLOSED EXPRESSION OF THE BEAM LOADING VOLTAGE
A. Solution for linear variations of y g and R 0 0 0 ͞ ͞ ͞Q Solving Eq. (1) for the longitudinal electric field in the case of the linear variations defined by (2) has been done according to the derivation described in Appendix A. It provides the following expression for the beam loading voltage profile as a function of z, to the second order of the Gauss approximation: with and remembering that z remains smaller than the structure length L, The next step consists of finding a relation between the initial value E͑0͒ of the electric field which appears in (6) and its average ͗E͘ obtained by integration over the structure length, Using Gauss approximation of this integral to second order gives the following expression: Since the field E͑z͒ in Eq. (6) is a linear function of E͑0͒, its average ͗E͘ in (11) will also be a linear function of E͑0͒. This linear relation can be easily inverted, in the way shown in Appendix A, in order to provide the necessary expression for the initial field which corresponds to a given average gradient. The initial value so obtained can then be plugged into the solution for the voltage profile which is eventually expressed as a function of the average ͗E͘, the quantity that is relevant for the structure design.
where the exponent p is equal to B. Solution for arbitrary variations of y g and R 0 0 0 ͞ ͞ ͞Q Solving Eq. (1) for the longitudinal electric field in the case of the arbitrary variations defined by (4) has been done according to the derivation summarized in Appendix B. The second-order approximation used in Appendix B gives good accuracy for the final result, provided that the functions F 1 and F 2 have sufficiently slow variations, so that they have a behavior close to polynomials of a degree 3. For functions with larger variations, the result should be cross checked by numerical integration before making general use of it and, if the accuracy is judged to be inadequate, the next member in the sequence of Gauss approximations should be tried. Taking this caveat into account, the solution (B10) gives a closed expression for the beam-loaded voltage profile as a function of z, which now contains second-order Gauss approximations of all the definite integrals including the one giving the exponent of the solution of the homogenous equation, with and for 0 # z # L .
As in the preceding case, it is now necessary to express the initial field value as a function of the average ͗E͘ required. This has been done and is documented in Appendix B. The result, valid for arbitrary smooth functions F 1 and F 2 , is given here: with the following expression for G 1 (Appendix B), and the numerical values of a 1 and a 2 recalled above and in both Appendices. Although the preceding results are given for a constant Q value, it is simple to extend them to the case where the quality factor Q varies. The rigorous mathematical justification of this generalization of the results is given in Appendix B. It is based on the fact that the general solution (A11) in Appendix A requires an integration of the ratio C 1 ͞F 1 v͑͞QF 1 ͒. For an arbitrary varying function F 1 (i.e., y g ), the integral must be done by using the Gauss approximation method, as indicated by Eq. (B2) in Appendix B. An additional variation of Q does not require changing this treatment of the integral, provided the whole variation of the product QF 1 is taken into account when integrating C 1 ͞F 1 , as shown in Eqs. (B5) and (B6) of Appendix B. Defining f as the variation of Q relative to its averageQ and F 3 as the product of the variations f and F 1 gives Because the factor Q never rapidly varies in the practical cases, the product function F 3 is expected to typically have as slow variations as F 1 . Therefore, the integral of 1 F 3 can still be done by using a second-order Gauss approximation, keeping in mind that a higher order can be applied if the accuracy requires it. The result takes the form of Eq. (B6) in Appendix B, and the beam-loaded field profile for simultaneously varying Q, y g , and R 0 ͞Q becomes The associated relation between the initial field value and its average over the structure keeps the same form as in Eq. (17), after replacing the expression ͑v͞Q͒G 1 in all the exponential functions by These generalized expressions make it possible to fully include variations of the quality factor in strongly detuned structures.

A. The CLIC tapered damped structure
The parameter values (22) retained for the application discussed in this section are those of the CLIC design of a tapered damped structure (TDS) [1,3]. This case can be treated by considering linear variations of the group velocity and the shunt impedance per unit length such as the relations given in Sec. III A apply. The numerical values actually introduced in Eqs. (2), (6), (7), and (12) and corresponding to the CLIC TDS [3] are as follows: y g ͑0͒ 3.240 3 10 7 m͞s, Dy g 1.619 3 10 7 m͞s , The decimal values of the coefficients a 1 and a 2 are This application allows the comparison of the results of a direct numerical integration with the analytical approximation of the solution (6), in the case of a linear variation of y g and R 0 ͞Q. The curves of Fig. 1 indicate that the analytic expressions (6) depict extremely well the voltage profile in the structures either unloaded (I 0) or loaded with the assumed beam current (I 0.96 A). The actual deviation never exceeds 0.2% in this particular case. In addition, the average value given by (11) and equal to 163.50 MV͞m agrees very well with the one obtained by numerical integration, i.e., 163.47 MV͞m. In practice, one would rather start from an average field value, e.g., 150 MV͞m, compute the corresponding initial value E͑0͒ with (12), and then deduce the voltage profile with and without beam loading as illustrated in Fig. 2. This provides a very direct and precise way to obtain the electric field along the structure for a wanted average accelerating gradient.

B. Damped detuned structure of the NLC type
In order to check the analytical expressions of Sec. III B, which are valid for nonlinear variations of the group velocity and the shunt impedance, we would like to now consider a structure of the type studied at SLAC and known under the name of RDDS (rounded damped detuned structure) [2]. In such a structure, the variation of y g can be large and strongly nonlinear while the shunt impedance equally varies nonlinearly. In the selected example, y g decreases from about 0.11c to 0.03c and the impedance increases from 7. to 1.03 3 10 8 V͞m. To get the functions y g ͑z͒ and R 0 ͞Q͑z͒ generally defined by Eqs. (4), polynomial fits of the curves y g ͑z͒ and R 0 ͑z͒ provided to us [5] were made and the factor of quality Q was assumed to be constant and equal to 7875. Retaining the average of Q represents at this stage a good approximation (in fact, Q may vary from about 8250 to 7500). This approximation can, however, be removed at any time by applying the relations (19) and using the actual function Q͑z͒ Qf͑z͒ to generate R 0 ͞Q͑z͒ before doing the fit.
The results of the fits give the following functions F1 and F2:  (24) and (25) made for the relative group velocity and the shunt impedance per unit length, respectively. In these graphs, the full lines correspond to the polynomial fits of degree 3 while the diamonds correspond to the initial data. For the other necessary parameters of the structure, the following values [5] were taken: It is first necessary to use the relation (17) for deducing the initial field value from its average, using the particular functions (24) and (25) and the parameters (26). The value so obtained is 55.62 MV͞m. Equation (14) then gives the electric field profile (to second order in the Gauss approximation) with and without beam loading along the structure (Fig. 5). Comparison in the same conditions with numerical integration of the differential equation indicates a very good agreement (Fig. 5). In this nonlinear example, the maximum deviation which takes place at the end of the strongly loaded structure reaches approximately 4.5%. If necessary, this deviation could be further reduced to a level comparable to the one of the first application by working to the third order.

V. CONCLUSIONS
This paper describes the method proposed by the authors to solve analytically the differential equation for the longitudinal electric field as a function of the coordinate z along an accelerating structure and to extend the range of solutions. The method provides a closed expression of the field profile for arbitrary but smooth variations of the group velocity y g and the impedance per unit length, divided by the quality factor, R 0 ͞Q. This expression results from an approximation that is required to achieve the final quadrature explicitly, but can be made as accurate as desired by raising the order of this approximation. When dealing with the electric field profile in an rf cavity, it is shown that a second-order approximation is already very good.
The first step consists of changing variables in order to write the equation of the field in the form of Bernouilli's equation, which can then be transformed into a linear, inhomogeneous equation by a standard substitution. The latter equation is solved in the usual manner (Green's method) and the result is an expression for the field which contains a double quadrature. This last quadrature can be evaluated only in a closed form with some approximation. For linear variations of y g and R 0 ͞Q, one integral can be resolved and the double quadrature replaced by a single one, while for nonlinear variations this is not possible. In all cases, the remaining single or double quadrature is achieved by using the Gauss integration sequence most frequently introduced in numerical applications. Provided the integrand function shows a sufficiently smooth variation with the independent variable, numerical integration formulas can be applied for an analytical description of a quadrature operation by using just one discretization step. The remarkable result is that the second member of the Gaussian sequence of approximations applied over the entire interval of integration not only gives excellent estimations in the single quadrature case (within 0.2%) but also provides very good evaluations of the double quadrature (within better than 4.5%). This accuracy can, of course, always be improved by going to the next order of the Gauss approximation though at the expense of a more complex expression for the solution. More precisely, the properties of the Gauss approximations are such that the order n will give good results for functions F 1 and F 2 varying like polynomials of degree 2n 2 1.
The closed, analytical expressions of the field obtained have been applied first to the tapered, damped structure of CLIC (30 GHz) where linear variations of the key quantities can be assumed and second to a damped, detuned structure of NLC type, with strong nonlinear variations of these same quantities. In both cases, checking with a direct numerical integration of the differential equation proves the noteworthy validity of the proposed solution. Furthermore, this solution is, by nature of the problem, a linear function of the field at the entrance of the cavity. Therefore, an additional integration over the cavity length, which is again done following the same method, provides an explicit relation between this initial field and the field average in the cavity. This allows the direct expression of the voltage profile as a function of the average accelerating field, which is one of the main characteristics of the design.
It is important to underline that all the obtained fieldprofile expressions valid for a wide range of detuned accelerating structures can be introduced, in their symbolic form, into executable files of mathematical computation applications such as MAPLEV, MATHCAD, and EXCEL. This makes possible a rapid, interactive evaluation and optimization of the characteristics of specific structures for various design parameters, without resorting to any numerical integration.
The method described here for analytically solving the nonlinear, first-order differential equation associated with the field distribution in an rf structure is sufficiently general to be applied to other problems of physics or engineering provided the coefficients appearing in the differential equation of the phenomenon vary smoothly enough with the independent variable. It has proven to be very successful in predicting the longitudinal field profiles of different structures, with and without beam loading.

APPENDIX A: ANALYTICAL SOLUTION WITH
LINEAR VARIATION OF y g AND R 0 0 0 ͞ ͞ ͞Q For the authors' convenience, the nonlinear first-order ordinary differential equation (1) has first been rewritten by using the following definitions and changes of variables: x z, y E͑z͒ .
These variable definitions (A1) will be used, in the limited interval 0 , x , L, to express the solution y͑x͒ of the differential equation for the given initial condition The quantities C 1 and C 2 are constant (if Q is not constant, its average value has to be introduced into C 1 as an approximation) and the functions F 1 and F 2 vary linearly with x, in agreement with (2), In a first step, a simplification of the equation can be obtained by performing a substitution of the dependent variable y: This leads to the new equation which can be identified as Bernoulli's equation [6] with exponent 1͞2 in the new variable z z͑x͒. As usual for the analytic solution of this type of equation, we now apply a second substitution of polynomial type which is defined by where q is yet to be determined. The multiplication of the equation thus obtained by u q gives The resulting equation becomes linear and inhomogeneous if q 21 and can be written as with the solution Using the definitions for F 2 and F 1 as listed above, two of the three integrals are and using the notation j x͞L and p C 1 L͑͞2a 1 ͒, u͑x͒ becomes Since the remaining quadrature cannot be evaluated in closed form, the function (A14) provides the most general expression for the solution of (A10). Having in mind an interest in a simplified, closed analytical expression giving an accurate estimate of the function (A14), we use the following two approximations of a general integral: and where While Eq. (A15) represents the well-known "mean value approximation" of an integral, Eqs. (A15) and (A16) are generally known as the first two members of the sequence of Gauss integration approximations [7]. While (A15) is the exact integral of linear functions, the approximation (A16) turns out to be exact up to thirdorder polynomials. The constants a 1,2 are the zeros of the second-order Legendre polynomial [7]. The sequence is such that, at the order n, the n values a n to be used for the evaluations f͑a n x͒ of the function are the zeros of the nth order Legendre polynomial and the result is exact up to the ͑2n 2 1͒th order polynomials.
In this way and after transforming back the dependent variable from u to y, we finally obtain two approximations for the actual solution of Eq. (A2).
Using the first-order Gauss approximation (A15), Using the second-order Gauss approximation (A16), A comparison has been made of the two analytic approximations y 1 ͑x͒ and y 2 ͑x͒ given in Eqs. (A18) and (A19) with a direct numerical integration of Eq. (A2), using the numerical values listed in (22). The results indicate that the numerical solution is indistinguishable from the approximation y 2 ͑x͒ within the entire interval of integration. In addition, even y 1 ͑x͒ differs from the numerical integration results only by an amount which never exceeds about 3% (value reached at the end of the interval, when x L).
As mentioned in Sec. II, it is then necessary to express the field y 2 ͑j͒ as a function of the average field ͗y͘ instead of its initial value y 0 as in (A19). The average is simply given by the following integral: Considering the curve shown in Fig. 1 for the voltage profile, it is evident that the function y 2 is smooth with no zeros in the interval ͓0, 1͔. As a consequence, the Gauss approximation described above applies to the integral (A23). Using it to second order, with the special value x 1 according to (A23), we obtain Since the differential equation for the dependent variable u is linear, the solution is always a linear function of the initial condition. This is obviously satisfied by the approximate solution which takes the form The last equation gives the definition of the functions g͑j͒ and h͑j͒, by direct comparison with (A19). Introducing (A25) into (A24), the result for the average estimate becomes The preceding relation can of course be easily solved for the initial condition y 0 , where the notation ͗y 2 ͘, valid for the second-order approximation, is replaced by the more general notation ͗y͘. Hence, when designing a structure for a given average field, the relation (A27) can be used to calculate the initial value corresponding to the design characteristics. Once the initial value y 0 is known, the general expression (A19) is applicable to find out the voltage profile related to the specific linear variations assumed for y g and R 0 ͞Q.
Inserting the explicit form of the functions g͑j͒ and h͑j͒ into the relation (A27) gives the full expression for the initial value associated with a particular average. In the case of linear variations treated in this Appendix, this expression is where the coefficients are defined in (A1), the parameters a 1 and a 2 in (A20), and the exponent p in (A22).

APPENDIX B: ANALYTICAL SOLUTION WITH
ARBITRARY VARIATION OF y g AND R 0 0 0 ͞ ͞ ͞Q Let us start again from the general form (A11) of the solution obtained in Appendix A: The functions F 1 and F 2 are now arbitrary and not explicitly defined, though assumed to have small enough variations for using Gauss approximations of the integrals. The last condition means that the functions F 1 and F 2 must not have too many oscillations and zeros in the interval of interest. More precisely, the use of the second-order Gauss approximation gives exact results for polynomials of up to degree 3. For the integral, which appears in the exponential functions of (B1), we can write for constant Q applying the second-order approximation defined in Eq. (A16). This form of G 1 strictly applies for a constant Q. When Q varies, it is sufficient to modify (B2) according to the following description. Let us first define the variation of Q around its average valueQ by and the corresponding constant C 1 by With these definitions and the introduction of the function f͑z͒ in the development of Appendix A leading to the equation (A11), the function G 1 is modified as follows: and (B5) defines F 3 as the product fF 1 . The form of G 1 remains unchanged with simply F 3 replacing F 1 , i.e., for varying Q, and the whole subsequent treatment applies with either (B2) or (B6). The next step consists of finding an approximation of the second integral in (B1) which represents a particular solution of the inhomogeneous differential equation and contains the definite integral G 1 , Having included the approximation (B2) into (B7), the expression of G 2 has been reduced to a single integral containing the three functions G 1 ͑x͒, F 1 ͑x͒, and F 2 ͑x͒. At this point it is once more possible to apply the secondorder Gauss approximation (A16) to the last form of G 2 in (B7) and get The solution (B1) now becomes u͑x͒ e 2 C 1 Introducing (B2) and (B8) into (B9) and back transforming the variable u into y provides the approximate expression sought for the solution of (A2) in the case of a general variation of y g and R 0 ͞Q, As expected, the solution is again a linear function of the initial condition y 0 , and the functions g͑x͒ and h͑x͒ defined in Eq. (A25) take the following forms: Having these two functions and following the deduction made in Appendix A, the application of Eq. (A27) gives the explicit relation between the initial value y 0 and the average value ͗y͘ required for designing a structure.