Equation: Application to Accurate and. Rapid Calculation of Coil ... magnets, electron optics, electron tubes, magnetic and electric fields, permanent magnets ...
1050
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
Off-Axis Expansion Solution of Laplace’s Equation: Application to Accurate and Rapid Calculation of Coil Magnetic Fields Robert H. Jackson
Abstract— A flexible algorithm for the accurate computation of off-axis magnetic fields of coils in cylindrical geometry is presented. The method employs a partial power series decomposition of Laplace’s equation about the symmetry axis where the series coefficients are derivatives of the field along the axis. A method for computing high order analytic derivatives for four “basic” coil types (loop, annular disk, thin solenoid, and full coil) will be demonstrated. Utilizing these derivatives, highly accurate offaxis fields can be calculated for the basic coil types. For ideal current loops, field errors of less than 0.1% of the exact elliptic integral solution can be obtained out to approximately 70% of the loop radius. Accuracy improves substantially near the symmetry axis and is higher than normally achievable with mesh-based or integral solvers. The simplicity, compactness and speed of this method make it a good adjunct to other techniques and ideal as a module for incorporation into more general programs. Index Terms— Accelerator magnets, algorithm, coils, electromagnets, electron optics, electron tubes, magnetic and electric fields, permanent magnets, simulation, solenoids.
I. INTRODUCTION
M
ANY systems of both theoretical and experimental interest can be approximated as two-dimensional (2D) with an axis (or plane) of symmetry. For such systems, it is possible to obtain useful and accurate solutions to Laplace’s equation in the source-free region near the symmetry axis from knowledge of the potential (or field) on the axis. The method employs a partial power series decomposition of the scalar potential function in the transverse variable where the series coefficients are axial derivatives of the on-axis potential. This technique has been known for a considerable time [1] and was applied analytically, before computers became ubiquitous, to calculations of electric and magnetic lenses, see examples in [1], [2]. With the advent of digital computers, this technique quickly migrated from analytic to discrete implementations, e.g., see [3]. It was later pointed out [4] that the expansion method was subject to accuracy and stability problems which were claimed to render the technique virtually useless. However, as will be shown in this work, these problems were Manuscript received April 3, 1998; revised July 27, 1998. Part of this work was performed and finalized while the author was on sabbatical at the AEA Technology Culham Laboratory, Abingdon, U.K. The review of this paper was arranged by Editor J. A. Dayton, Jr. This work was supported by the United States Navy, Office of Naval Research. The author was with the Vacuum Electronics Branch, Naval Research Laboratory, Washington, DC 20375-5347 USA. He is currently at Lucent Technologies, Norcross, GA 30071–2992 USA. Publisher Item Identifier S 0018-9383(99)04204-5.
(a)
(b)
(c)
(d)
Fig. 1. Schematic geometries and parameters for the four basic cylindrical coil types. Note that all of the on-axis field equations are referenced to the lower, left-hand corner source coordinates. (a) Ideal loop. (b) Annular disk. (c) Thin solenoid. (d) Full coil.
mostly due to implementation details rather than to the method per se. In more recent years the technique has fallen out of favor because of the advent of powerful general purpose Laplace and Poisson solvers and because of the presumed unreliability of the method. However, numerous applications in design simulation, optimization and synthesis (as well as field mapping) could benefit greatly from a compact, flexible field calculation technique which is rapid enough to be used interactively and compact enough to be embedded as a module in other codes. This paper will present an algorithm for the numerical calculation of expansion solutions to Laplace’s equation. The technique will be applied to the computation of off-axis fields of cylindrical magnetic systems, starting with four basic coil types: loop, annular disk, thin solenoid, and full coil (see Fig. 1). Accuracy is achieved by high order analytic differentiation of the on-axis field equations for these four basic types. Field errors of less than 0.1% of the exact elliptic integral solution can be obtained for an ideal current loop out to approximately 70–80% of the loop radius. For radii closer to the axis accuracy improves dramatically (by orders of magnitude) and is usually better than mesh-based or integralequation codes in this region.
0018–9383/99$10.00 1999 IEEE
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
1051
The general equations of the expansion solution method will be developed in Section II. These equations will then be specialized to 2-D cylindrical coordinates inclusive of the axis, which will remain the focus for the rest of the paper. The section will close with an illustration of the expansion technique applied to a case with a known analytic solution. The third section will address numerical implementation issues of the expansion method. Specifically, techniques will be developed for high order analytic differentiation of the four basic cylindrical coil geometries. The single turn current loop will be used to guide this development because it has a simple on-axis functional form, “easily” calculated analytic derivatives, and an exact elliptic integral solution over all space for comparison with numerical results. The differentiation techniques will then be applied to the on-axis field expressions for the other cylindrical coil configurations, i.e., annular disks, thin solenoids, and “real” coils. The accuracy of field calculations for these sources will be shown to be substantially the same as for the ideal single loop. The final section will discuss applications of this technique to multi-source magnetic systems. With the basic building blocks developed in the previous sections, it is possible to construct equivalents to many magnetic systems, including measured field data, permanent magnet systems, and devices with ferromagnetic materials.
Performing the “normal” partials in the first term leads to a recursion relating and the “planar” derivative of This recursion can be solved to give an explicit expression in terms of multiple applications of the Laplacian to for or Use will be made of the following notation either in writing a general form for the functional coefficients of the solution (assuming differentiability to the required order): (6) As an example, in rectangular coordinates, (5) produces the following recurrence relation: (7) Using the notation in (6), the solution becomes
(8) From this and (1),
and
are given by
(9) II. THE GENERAL EXPANSION SOLUTION The objective is to use knowledge of the solution on a subset of the region of interest to obtain a solution throughout the entire (source free) region. We proceed in the following manner assuming a scalar potential solution for a vector field which has zero divergence in a source free region. (Also see the derivations provided in [1] and [2])
The fields are then generated by applying the gradient operator
(1) and hence (2) Instead of representing in the usual complete power/Fourier series decomposition, it is decomposed as a partial power series with unspecified functional coefficients (3) Splitting the Laplacian (assuming orthogonal coordinates) into in which the solution a “normal” component (e.g., in or dependence is unknown and a “planar” component (e.g., in in the coordinates containing the known solution (4) and substituting (3) and (4) into (2) yields the following equation:
(5)
(10) Therefore, in principle, a detailed knowledge of the potential (or field), its normal derivative, and their “planar” derivatives on some given plane [three-dimensional (3-D)] or line (2-D) is sufficient to produce a solution throughout the source free region. Details of the equations will vary depending on the geometry and any symmetry conditions which are applied (as will be seen in the cylindrical coordinate derivation below.) However, the general features of this technique are evident from the above development. In particular, it takes both the potential (field) and its normal derivative to completely specify the general solution. The resulting equations split explicitly into components which are either symmetric or anti-symmetric If a symmetry is known to apply in the normal coordinate, or to zero and to the general solution, this sets either reduces the equations that have to be dealt with to single sums. The limitations of early digital computers forced initial implementations of these expansions to rely on methods which minimized operation count and memory usage. In many cases
1052
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
finite difference derivatives were expanded and merged with a truncated expansion series to yield a single series. However, implemented in this manner, both the accuracy and stability of the technique suffer [4], severely limiting the region of validity. Differentiation and summation really must be addressed separately to achieve maximum accuracy and stability. Note that the derivatives in the sums increase by two for each additional series term. This has the undesirable effect of requiring high order derivatives in regions where the sums are slowly convergent (normally in the vicinity of the source.) In practice, the process of taking successive derivatives must be handled with extreme caution. Poorly implemented numerical differentiation can quickly produce large errors restricting the useable region of solution. This is especially true when differencing experimentally determined values, e.g., see [5] and references therein. The stability and the region of accurate solution are both and its normal derivative are known in funcenhanced if tional form. Such solutions can sometimes be obtained directly (see Section III) or, more generally, by approximating the system under study with an amalgam of elements having exact functional solutions (see Section VI). Note that this does not eliminate potential problems with the successive derivatives if they are calculated numerically; it only delays them. At this point, the above equations will be specialized to the case of 2-D cylindrical coordinates inclusive of the axis. For this development, the cylindrical coordinate system , corresponds to Starting with (4), the normal derivative (radial direction) and the planar derivative (axial direction) are
(11) Substitution into (5) results in a recurrence relation given by (12) Because cylindrical symmetry requires that the normal (i.e., , the coefficient must be set radial) derivative be at and equal to zero. Rewriting (12) in terms of derivatives of coordinates substituting into (3) gives the solution for for the source free region (13)
where is the on-axis “planar” component of the field, as defined below (15) The equations for the field components have been cast in rather than the potena form using the on-axis field tial since the examples considered below have analytic field solutions on the axis. For fields with cylindrical symmetry, a knowledge of the potential or field along the axis is sufficient (again, in principle) to produce a solution for all radii less than the source radius. Fortunately, as will be demonstrated below, the radial limit of solution validity improves as the axial distance from the source increases. An expression for the vector potential can be obtained from the integral relating the flux through a surface with the contour integral of the vector potential along the boundary of the surface. The resulting equation is (16) and the closely related function, the flux, is defined by (17) A quick check will demonstrate that the fields given by (14) are both divergence and curl free; that the curl of (16) yields (14) [(16) is trivially divergence free]; and that when the Laplacian is applied to , (13), the result is indeed zero. These equations, (14), (16), and (17), are applicable to any field with cylindrical symmetry with a sufficiently differentiable on-axis form and will be used in the remainder of the paper. Exactly analogous developments can be carried out in other coordinate systems and in 3-D. To illustrate and check the technique, it will be applied to an on-axis equation which is easily differentiable and has a known analytic off-axis solution. Periodic fields with cylindrical symmetry illustrate the completeness of the technique nicely. Let be the on-axis function of a field which satisfies Laplace’s equation and can be represented by a sine series on the axis. can be represented by the general form Thus,
The even and odd derivatives of then given by
with respect to z are
Substitution of (13) into (1) yields the solutions for the radial and axial field components off-axis
(14)
Substituting these expressions into (14) yields the expansion series equations for the axial and radial off-axis fields in the
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
form of double sums
After some rearrangement and collection of terms, these become
The bracketed sums will be recognized as the series represenand modified Bessel functions of the tations for the as the argument. Replacing the bracketed first kind with sums with the analytic functions which they represent gives the final forms for the off-axis fields
1053
of first and th derivative values. For analytic functions, is computationally measurable and hence a “reasonable” estimate of is possible, see [6] for details. For measured is nominally in the range data, the relative accuracy of of 10 –10 , and hence, should be comparably large. This implies that the differencing should also be large. Thus, one difficulty often encountered with differencing experimental values is that the data points are too close together, putting the differences well into the roundoff-error dominated domain. Incorrect -spacing can be as much a limitation as low precision and noise. Large ’s also imply stringent limits on the accuracy which can be obtained. Higher accuracy differencing formulas [6], [9]–[10] and/or acceleration techniques (e.g., Richardson extrapolation, [8]) can improve the limited accuracy at large to some degree. Hence, with attention to details and a healthy respect for the limitations of finite differencing, it is possible to achieve satisfactory performance over a considerable fraction of the source-free volume with numerical derivatives. Some additional perspective on this issue can be obtained by examining Fig. 4 and the associated discussion concerning the relationship between errors and the factors affecting expansion series convergence rates. III. CYLINDRICALLY SYMMETRIC MAGNETIC COILS
These equations will be quite familiar to anyone who has dealt in detail with periodic magnetic fields in cylindrical coordinates (such as those from periodic permanent magnet stacks.) They are identical to the solutions obtained in the more usual fashion by completely applying the separation of variables method to Laplace’s equation and utilizing orthogonal function series appropriate to cylindrical coordinates. For the purposes of this paper only analytic derivatives will be employed; numerical differencing relevant to this technique will be given detailed consideration in a separate paper [6]. However, because both the accuracy and range of validity of this technique are so dependent on high order derivatives, a brief discussion is in order before continuing the primary thread of this paper. Numerical differentiation is discussed in standard reference texts, for example [7] and [8], and in the specialized literature, see, for example, [6] and [9], [10] and references therein. Even a casual review of this material will emphasize the need to carefully select the finite difference spacing in order to balance truncation and roundoff error. In [6] it is shown that the optimum -spacing for an th order central difference is given approximately by
where is the largest positive value such that the numerical implementation of the function satisfies
The essential features to note here are that the difference spacing depends not only on the function and the evaluation point, but also on the order of the derivative and on the ratio
Having developed the basic off-axis expansion equations above, it remains to develop a “practical” implementation and explore how well it works. There are two primary considerations involved in numerical implementation of (14), (16), and (17), 1) accurate computation of the derivatives and 2) accurate summation of the series. The first issue will be addressed by developing analytic high order derivatives of the on-axis field functions for all of the basic coil types. Some general comments on the second issue will be presented at the conclusion of this section. The basic cylindrical coils which will be dealt with in this paper are shown schematically in Fig. 1. The position and geometric features of the coils will always be referenced from the lower left corner of the current windings, i.e., The ideal current loop is the fundamental element of this group. The other three coils can be built up from the loop by integration of the current source. A. Ideal Loop Derivatives The initial focus will be on determining the on-axis derivatives of the ideal loop, Fig. 1(a), to high order. The axialfield on-axis equation for a single-turn, infinitely thin current carrying loop can be found in any introductory textbook on electromagnetic theory, e.g., [11], and is given by (23) where and are, respectively, the radius and axial position is the permeability of free of the loop, is the current and space (SI units). This equation could be dealt with as is, but it has a “natural” normalization parameter—the loop radius, —which will provide a good example of the benefits to be
1054
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
TABLE I ANALYTIC DERIVATIVES OF THE EQUATION FOR THE ON-AXIS MAGNETIC FIELD OF A IDEAL CIRCULAR CURRENT LOOP. THE TABLE LISTS THE POLYNOMIAL COMPONENTS OF THE GENERAL FORM (28)
gained from normalizing on-axis forms. Using the loop radius as the scale parameter, (23) can be recast as
satisfies the recursion given below in (28), where the denotes differentiation with respect to the argument,
(24)
(28)
where (25) This clearly splits the equation into a component containing the physical parameters and one having the functional dependence. Hence, differentiation can now be performed straightforwardly using the “natural” scale of the field without reference to the physical parameters of the loop, which only need be considered at the end of the process. Equation (24) translates very naturally into the expansion solution sums where the terms in the expansions normalize in the following manner: (26) Therefore, an expansion solution for any loop field reduces to generating an expansion solution for the normalized and multiplying by The focus now component shifts to differentiation of the normalized equation for (25). Computing the first few derivatives by “hand” [12] and examining the results suggest that the th derivative of can be put into the general form shown in (27) where is a polynomial (27) It can be shown by differentiation of (27) once, that the can be regained, provided form of (27) with
(27) Starting with the known on-axis equation, and (28) provide the means to generate derivatives of the loop equation to any desired order. The results of performing these operations out to order 15 are shown in Table I. This process has been carried as far as order 20 beyond which the coefficients can no longer be contained exactly in double is not precision floating point variables. (Note that computed as listed in the table, but according to Horner’s rule, see discussion at the end of this section.) Even though the derivative equations are arrived at by a mathematically exact process, some means of testing and validating would still be helpful. Each equation was checked by taking lower order derivative equations and numerically differentiating until the order is the same as the equation to be checked. With the mathematical software used to assist this work [12], numerical differentiation could be applied up to three times before the resulting values became too “noisy” for comparison. The results were plotted and compared with the analytic derivatives. This process was used, beginning with the first derivative, to ensure that all of the derivative equations were accurate. The methodology developed above was also applied to the other basic coil types. The on-axis equations for the other coils were computed by integration of the loop onaxis equation with the current distributions as given in Fig. 1. The resulting equations are shown below with the physical parameters already separated from the normalized forms. Thin Solenoid: (29)
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
1055
TABLE II NUMERATOR POLYNOMIALS FOR THE ANALYTIC DERIVATIVES OF THE EQUATION FOR THE ON-AXIS MAGNETIC FIELD OF AN INFINITELY THIN ANNULAR CURRENT DISK. THE EQUATIONS GIVEN IN THE TABLE ARE FOR THE P (x) COMPONENT OF THE DERIVATIVE OF b(x) (37)
The normalized derivatives are
Annular Disk:
(35) (30) Full Coil:
The problem now reduces to finding a recursive formula for the successive derivatives of the normalized disk equation After going through a fair amount of tedious algebra, the following form for the th derivative of with respect to its argument was obtained:
(31) (36) are in units of A/m for the disk The current densities for the full coil. The normalized and solenoid, and parameters for these equations are given by (also see Fig. 1)
and are polynomials. As above, it can be where shown by differentiation of (36), that the form of (36) with can be regained, provided and satisfy the recursion relations given below in (37), where the denotes differentiation with respect to the argument
B. Annular Disk Derivatives For reasons which will become apparent below, the analytic on-axis derivatives for the annular current disk will be developed next. This case is far less straightforward than the ideal current loop, and it will first be necessary to rearrange the onaxis equation for the disk. Instead of (30), the disk equation will be written as (32) The variable
is given by (33)
For this case, the functions shown below
and
both have the form (34)
(37) (36) and (37) Starting with the first derivative, and provide the means to generate the derivatives of to any desired order. The polynomials, and are listed in Tables II and III out to order 10, beyond which the coefficients can no longer be exactly represented in standard double precision format. As before, (36) was checked by taking lower order derivatives, numerically differentiating to the higher order, and plotting the results to see if they overlay the equation to be checked. Using (36) and (37) in conjunction with (32) yields the sought after derivatives of the annular disk on-axis equation . The derivative formulas for b need to be applied twice, once and once for Then, for each component must be divided by the appropriate power of
1056
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
TABLE III NUMERATOR POLYNOMIALS FOR THE ANALYTIC DERIVATIVES OF THE EQUATION FOR THE ON-AXIS MAGNETIC FIELD OF AN INFINITELY THIN ANNULAR CURRENT DISK. THE EQUATIONS GIVEN IN THE TABLE ARE FOR THE Q(x) COMPONENT OF THE DERIVATIVE OF b(x) (37)
or , [see (35)], and finally added together to yield the complete derivative. C. Solenoid and Full Coils Derivatives It appears that the derivatives for the solenoid and full coil remain to be computed. However, these equations are already in hand, as will now be demonstrated. Fig. 2 shows the onaxis amplitude of the normalized component of the solenoid equation and its first derivative for a solenoid whose length is Also plotted are the on-axis field five times its radius, amplitudes of two current loops (normalized equations) having the same radius as the solenoid, one placed at the solenoid entrance and one positioned at the exit. The difference between is also plotted, the ’s. As can the two loop fields be seen, the loop differences overlay the first derivative of the solenoid field apparently exactly. The agreement evident in Fig. 2 certainly suggest that derivative and the loop differences are identical. Returning to the on-axis solenoid equation, (29), computing the first derivative analytically, and rearranging terms, shows that the relationship is indeed exact. Therefore
where the ’s are the normalized on-axis forms for the indicated coil type. More generally, any derivative order of the normalized solenoid equation can be related to the loop derivatives by
Fig. 2. On-axis field amplitudes for two current loops and a solenoid with = 5: Also plotted are the first derivative of the solenoid field and the difference of the two loop fields.
relationship does exist for the coil-disk case. Therefore, the first derivative of the normalized coil on-axis field is given by the difference of two annular disk normalized fields, one disk at the coil entrance and the other at the exit. More generally, an equation analogous to (38) can be written for any order coil derivative, (39) below, in terms of derivatives of the two disks
(38) So, with some attention to minor details, (38) yields the analytic solenoid derivatives to high order. Since the ideal loop derivatives have been calculated to order 20, the thin solenoid derivatives are automatically known to order 21. It is tempting to apply the correspondence between solenoid and loop derivatives to those of coils and annular disks. For once, this is a temptation which is rewarded, as shown in Fig. 3. Although the algebra is much more tedious than for the solenoid case, it is possible to show that an exactly analogous
(39) So, we are now in possession of high order analytic derivatives of all four basic cylindrical coil types. Recursive formulas were developed to compute the ideal loop (order 20) and annular disk (order 10) derivatives. Then relationships were established between loops and solenoids, and between disks
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
1057
over all space which can be found in a number of standard texts, e.g., see [13], [14]. The equations for the magnetic field and flux of an infinitely thin circular current loop are given below
(40) and are the complete elliptic integrals of the first where and are as previously and second kind, respectively, defined, and the other parameters are determined by
Fig. 3. On-axis field amplitudes for two annular disks and a coil with = 5 and = 1:5: Also plotted are the first derivative of the coil field and the difference of the two disk fields.
and coils which trivially yielded the analytic derivatives for thin solenoids (order 21) and full coils (order 11). D. Numerical Evaluation Issues We are now in a position to consider evaluation issues for both the derivatives and the expansion sums. Having an analytic expression is no guarantee of accurate numerical values, especially since the higher derivatives of all the coil types contain large coefficient, high degree polynomials. It is well known that care must be taken in evaluating such functions and the standard method is Horner’s rule [7], i.e., backward summation. Hence, the derivative polynomials given in Tables I–III are not evaluated as shown, but by Horner’s rule, which is both more efficient and more accurate. Summation concerns extend to the expansion sums, (14), (16), and (17), as well. The terms are summed backward, starting with the highest derivative term and working back to the lowest derivative or on-axis term. Unlike the polynomial sums, which are finite, the expansion sums are infinite and the rate of convergence becomes an issue. Various series acceleration techniques may be applied in special circumstances [8]. For example, when the derivative terms are such that the sums are monotonically increasing or decreasing then Aitken’s process can add an order of magnitude or two to the accuracy of the sum [7], [8]. For alternating series, summation accuracy can be substantially improved by applying Euler’s transformation [7], [8]. The work reported in this paper does not utilize series acceleration techniques because many cases do not fit the requirements of either of the above techniques and no generally valid acceleration method is known. However, this is an area that should receive further attention. IV. ANALYTIC
AND
NUMERIC COMPARISONS
To gauge how well the off-axis expansion works and over what ranges it maintains useful accuracy, it must be compared with a known solution. The ideal loop has an analytic solution
(41) The field and flux values generated by (14) and (17), implemented as discussed in the previous section, will be compared with the analytic results from (40). One might assume that this is a trivial test, but quite the opposite is true. Because the infinitely thin loop is a source singularity, the high gradients in the vicinity of the loop represent a severe test for the expansion solution method. The other coil types have source densities which are nonsingular in at least one dimension. The difference this makes will be seen in a full coil example below. The factors which affect error in this technique are explored in the figures below. Note that in these figures, the errors are plotted as the log base 10 of the absolute value of the percent relative error. Therefore, a value of zero represents a 1% error and a value of 14 represents agreement to 16 decimal places, i.e., machine precision. The errors in the expansion method are closely related to the rate of convergence of the expansion sums, i.e., how many terms are necessary to get within some tolerance of the exact answer. This will depend not only on the type of source, but on the axial and radial position relative to the source as well. These dependencies are examined in Figs. 4 and 5 where the effects on the error of the number of terms in the sums and the radial position are plotted. Fig. 4 shows the error in directly under the loop. Note the strong dependence on radius and the monotonic decrease in error (good candidates for series acceleration.) If 1% (0 in the plots) is set as the maximum can be computed allowable error, then good values for out to 80% of the coil radius using analytic derivatives out to order twenty. Note that for radii out to 20% of the loop radius the agreement is essentially exact. is identically Not all cases are this well behaved. Since at an axial zero under the coil, Fig. 5 shows the error in position half a radius away from the loop. Again, there is a strong dependence on radial position, and the convergence behavior is not entirely monotonic as more terms are added can to the sums. At the 1% error limit good values for be computed out to just below 90% of the coil radius. Radii
1058
Fig. 4. Errors in the off-axis expansion Bz sum, (14), relative to the exact values, (40). Each curve is for a different normalized radius as indicated in the legend. These values were computed at x = 0:
Fig. 5. Errors in the off-axis expansion Br sum, (14), relative to the exact values, (40). Each curve is for a different normalized radius as indicated in the legend. These values were computed at x = 0:5:
out to 20% of the loop radius yield agreement to essentially machine precision. As illustrated very clearly in the above figures, the number of terms needed to reduce the error below the permissible limit depends strongly on radial position and on axial position as well. Looking at Figs. 4 and 5 from a slightly different perspective, we can ask what can be done with a limited number of derivatives. Surprisingly, quite a lot can be accomplished with only four-to-six accurate derivatives. The figures show that the error remains below the maximum error limit for radii up to 40–50% of the loop radius. This is quite encouraging evidence that numerical differencing of experimental data or noncoil cases can still yield significant utility. Numerically computing an accurate fourth derivative from measured data is still no trivial task, but it is at least a manageable one. The behavior of the error as a function of distance from the source is presented in the next figure. Fig. 6 covers an
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
Fig. 6. Errors in the off-axis expansion sums of Bz and Br , (14), relative to the exact values, (40). Axial positions are normalized by the loop radius. The error was clipped at a maximum of two for purposes of plot clarity. The normalized radial positions were both less than and (significantly) greater than the loop radius, r = 0:5 and 3.0.
axial range of fifteen loop diameters, showing the errors in and using all of the available the expansion computed analytic derivatives. The calculations were conducted for two and The first radius (normalized) radii, is comfortably within the loop radius and, as the plot shows, the errors of both field components are significantly below the maximum error limit for all values of The second radius is well beyond the expected physical limit of the method, therefore the radius at which the source is first encountered. However, provided the derivatives are sufficiently small, the expansion sums remain convergent and reasonable values can be obtained if the evaluation point is below the radius at which the fields flip sign. As shown in Fig. 6, for an evaluation radius of three times the loop radius, the error is below the limit for axial distances exceeding four loop radii. The error diminishes rapidly further away, reaching close to machine precision at a distance of fifteen loop radii. The data in Figs. 4–6 indicate that the expansion method may not be limited to small fractions of coil volumes. This issue is more important than it may appear at first and will be discussed again in the next section. To get a more global perspective on the domain of validity of the expansion method, a contour plot was made of the magnetic flux relative error versus axial and radial position (Fig. 7). Each shaded region in Fig. 7 represents a particular error range. The regions of 1 and 0.1% relative errors have been shaded out-of-sequence to highlight their positions. As expected, the vicinity of the loop has the highest errors and the lowest radius at which the errors exceed the limit. Away from the loop, the error contours increase radially at about a 30 angle and in roughly “straight” lines. Hence the error contours are consistent and do not vary unpredictably in radius away from the source. Because these calculations used the normalized equations, the conclusions are valid, in detail, for any current loop. Although the details will vary, the other coil types are expected to exhibit similar global behavior.
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
1059
Fig. 7. Contour plot of the relative error in the computed magnetic flux of an ideal loop as a function of normalized radial and axial position. Note that the 0.01–0.1% error band has been shaded to highlight its location.
Analytic equations are not available for the other coil types, so comparisons must be made against other calculation techniques. The comparisons above validate the loop and thin solenoid cases (an additional solenoid example will be considered in the next section.) For the annular current disk and full coil, validation comparisons will be based on a full coil field computation using the integral equation code EFFI , [15]. The coil length was five times its inner radius, , the inner the coil height was half its inner radius, radius was 4 cm and the current density was 100 A/cm All available analytic derivative orders (up to eleven) were used for the expansion calculations. Fig. 8 compares the axial magnetic fields calculated by EFFI and the off-axis expansion technique, (14). The agreement between the two computations is excellent in both the shape and amplitude of the field. A blowup of the plot shows about 0.1% difference between the two curves. [This same degree of difference was found for the on-axis values as well, where the expansion is exact. This may be caused by some slight difference in the discretized current volume in EFFI.] Note that these plots are at the coil inner radius. Unlike the loop, the coil current density is not singular anywhere. The impact of this on series convergence rates is clear, the coil expansion produces better results at larger radii with fewer terms (about half) than the loop expansion. Fig. 9 compares the radial magnetic fields calculated by EFFI and the off-axis expansion technique for the coil parameters above. Again, both the field shape and amplitude are in excellent agreement between the two computations. These plots are for two different radii, one at half the coil inner radius occur and the other at the coil inner radius. Large spikes in at the entrance and exit at the coil inner radius. This is expected
Fig. 8. Comparison of EFFI and expansion solution calculated Bz field magnitude for a full coil with = 5 and = 1:5: Note that the normalized radius for this plot is r = 1, i.e., at the inner radius of the coil windings. The agreement is exceptional, to within 0.1%.
since depends on the first axial derivative which behaves as two annular disk fields, one at the entrance and one at the exit. The inset figure shows a blowup of the right-hand spike. The field values calculated by the expansion technique do not “peak” as sharply as the EFFI values, including higher derivative terms would improve this somewhat. However, this is still an impressive level of agreement for the expansion method, going all the way up to the source. Again, a more global perspective is obtained through a contour plot of the magnetic flux as shown in Fig. 10. This figure shows an overlay of the flux contours from the EFFI
1060
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
The developments above have demonstrated that very accurate off-axis field calculations can be made by the expansion method for the four basic coil types. The expansion series coupled with the analytic derivatives from the previous section have been shown to yield useable accuracy out to regions near (or at) the source. Furthermore, it was shown that the region of acceptable accuracy increases substantially as axial distance from the source increases. Another important feature is the consistency of the above results. In other words the behavior of error in the technique follows predictable patterns and does not fluctuate randomly from point to point. V. APPLICATIONS TO CYLINDRICAL MAGNETIC SYSTEMS
Fig. 9. Comparison of EFFI and expansion solution calculated Br field magnitude for a full coil with = 5 and = 1:5: The normalized radii for this plot are r = 0:5 and 1.0. The agreement is exceptionally good although the expansion solution does not “peak” as sharply at the coil faces, as shown in the inset.
With the developments above, accurate fields can be calculated for individual coils; however, the objective is a capability for designing and simulating magnetic systems. This section will outline some options for system calculations and present a few example cases. Three approaches to applying the Laplace expansion technique to an assemblage of magnetic elements will be discussed briefly: and use 1) Compute a total-system on-axis function the total function to directly compute derivatives and sums (42) 2) Compute the derivatives separately for each source. Then, for each derivative order, sum the contributions from all the sources into a total system-derivative for that order (43) 3) Compute the fields at all points separately for each source. Then sum the field contributions to get the total system field
Fig. 10. Overlay of EFFI and expansion solution calculated flux contours for a full coil with = 5; = 1:5; r0 = 4 cm and current density = 100 A/cm2 : The coil is located from z = 0 to z = 20 cm. The overlay is exceptionally good even slightly into the coil.
(44)
calculations (thick dark lines) with those from the expansion calculations (thin light lines). The overlay is remarkably good out to just past the coil inner radius, the contour line labeled 2000. Starting at this radius, the expansion method contours become denser and “flatter” than the EFFI contours, pushing away at the edges and in the center. There is no sign in this plot of the rapid changes in error as seen in Fig. 7 near the current loop, a direct result of the “smoother” current distribution. As in the loop case, increasing the distance from the source, increases the radius below which the error is acceptable. This is indicated in Fig. 10 by the good overlay of the outermost contour lines. This example serves to validate both the disk and coil expansion models.
Each approach has its own positive and negative aspects. The first approach is the fastest of the three, but also the least flexible and the most subject to error. In cases where measured data must be used and for nonanalytic cases this is the only direct approach. The second method is not quite as fast, but is more flexible and can make direct use of the analytic developments in the previous section. The last approach is the slowest, but the most flexible of the three. This method can address some 3-D effects such as center offset and axis misalignment. [Remember that it is the source which has to have cylindrical symmetry, not the evaluation points. The fact that the radius of limiting accuracy increases with distance from the source makes it possible to apply the coil models above in such 3-D problems, within reasonable limits!]
JACKSON: OFF-AXIS EXPANSION SOLUTION OF LAPLACE’S EQUATION
Fig. 11. Overlay of exact analytic and expansion solution flux values as calculated by the SCRIBe code for a system of four ideal loops. The flux was evaluated along a radius at the center of the simulation region.
Any of these three approaches can be used in conjunction with methodologies for generating coil-based equivalents to the system under study. This provides a powerful capability for addressing general magnetic systems. An example of the utility of this combination will be given in the final example below. For present purposes the second approach was chosen because it provides a good mix of speed, accuracy and flexibility for 2-D problems. The analytic derivatives of the four basic coil types were implemented in six compact subroutines. Two of the subroutines return normalized derivatives, one for the ideal loop and the other for the annular disk. The other four subroutines use the normalized derivatives and the physical parameters to compute the actual derivatives for specific instances of the four coil types. These subroutines were integrated into the electron optics simulation code SCRIBe [16]. For each coil, the derivatives are calculated at a fixed array of axial points and the derivative orders are separately accumulated in arrays for each point. This implementation also allows for the inclusion of numerically differenced values. Fields are then calculated by taking the two fixed axial points which bracket the field point, computing the fields at these points at the radius of the field point, and then interpolating to the axial position of the field point. The first example compares the flux generated by four ideal current loops. The data describing the axial position, radii (100 cell units), and currents for the four loops were read into SCRIBe. The total magnetic field was calculated using both the analytic loop fields, (40), and the off-axis expansion with all available derivative terms. Fig. 11 shows the flux calculated by both methods along the radius in the center of the simulation region. The values agree to a minimum of five decimal places for all points. The second example shows the radial magnetic field generated by a seven coil superconducting magnet which is part of a gyroklystron experiment [17]. Again, the data defining the axial positions, radii, lengths, thickness, and current densities
1061
Fig. 12. Overlay of EFFI and expansion solution calculated radial magnetic field for a seven coil superconducting solenoid. The data were computed at r = 1:85 cm, a normalized radius of :0.32.
for the seven coils were read into SCRIBe and also into cm EFFI. Fig. 12 graphs the radial magnetic field at as computed by EFFI (points) and the off-axis expansion implementation in SCRIBe (line). The curves are in excellent agreement. Examination of a blowup of Fig. 12 shows the same 0.1% difference in the curves which was observed in the individual coil case, see Fig. 8 above. The final example brings together and tests several of the claims made above. The system to be modeled is an eight period PPM (periodic permanent magnet) stack, i.e., 16 permanent magnets and 17 iron pole pieces. The magnets are modeled with two thin solenoids of opposite polarity which would normally be located at the inner and outer radial surfaces of the magnets. The iron pole pieces act as near perfect flux conductors, effectively moving the thin solenoids to the inner and outer radii of the pole pieces. The eight period configuration was modeled with the FEM code Maxwell 2D [18] and by the off-axis expansion technique in the form of an equivalent system of 32 thin solenoids. The results are field from both compared in Fig. 13 where the on-axis calculations is plotted. The agreement is astonishingly good and validates not only the off-axis expansion, but also the use of coil-equivalent systems to model permanent magnets and ferromagnetic materials. In addition, the off-axis expansion and calculation required less than 1 s [19] to compute values at 11 000 points for the 32-coil system. VI. SUMMARY
AND
CONCLUSIONS
The mathematical techniques and algorithms developed in this paper demonstrate that the off-axis expansion solution to Laplace’s equation is an effective tool for the calculation of magnetic fields. The technique was shown to be accurate, fast, flexible and, with the analytic coil derivatives developed here, both stable and simple to implement. The four cylindrical coil types for which analytic derivatives were developed provide great flexibility in modeling magnetic systems, including those with permanent magnets and ferromagnetic material.
1062
IEEE TRANSACTIONS ON ELECTRON DEVICES, VOL. 46, NO. 5, MAY 1999
Fig. 13. Overlay of on-axis Bz calculated by Maxwell-2-D (points) and expansion solution (line) for an 8-period PPM stack. Note that the Maxwell field data is obtained by differentiation of the magnetic flux and is relatively “noisy.”
The validity of the off-axis expansion covers a surprisingly large fraction of the computation space. This opens up many opportunities for applications in simulation and optimization, and some interesting possibilities for the study of alignment and offset errors (3-D effects) in coil-based (or coil-equivalent) magnetic systems. Although the detailed developments in this paper addressed only cylindrical geometries, it was pointed out that the general equations and methods can be applied in other geometries as well. The approach employed to obtain the analytic derivatives may work with “basic” elements in other geometries also. The utility of this technique is not as a replacement for more general codes, but as a rapid and flexible adjunct. The speed and compactness of the method makes it ideal for direct incorporation into other programs and for interactive design applications. ACKNOWLEDGMENT The author would like to thank his Culham colleagues for many valuable discussions and Dr. W. Arter in particular for several useful references on high-accuracy finite differencing. A debt of gratitude is owed to the Naval Research Laboratory’s sabbatical program and to his colleagues at NRL for the time and opportunity to finish this work. REFERENCES [1] K. R. Spangenberg, Vacuum Tubes. McGraw-Hill, Sect. 13.2 and 14.2, 1948. [2] P. S. Farago, Free-Electron Physics. Baltimore, MD: Penguin, 1970.
[3] W. B. Herrmannsfeldt, “EGUN—An electron optics and gun design program,” SLAC-Report-331, 1988. [4] J. R. Vaughan, IEEE Trans. Electron Devices, vol. ED-19, pp. 144–151, Jan. 1972. [5] D.-o. Jeon, J. Comput. Phys., vol. 117, pp. 55–66, 1995. [6] R. H. Jackson, “High order numerical differentiation revisited,” to be published. [7] A. Ralston and P. Rabinowitz, A First Course In Numerical Analysis, 2nd ed. New York: McGraw-Hill, 1978. [8] W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical Recipes: The Art Of Scientific Computing, 2nd ed. Cambridge: Cambridge Univ. Press, 1992. [9] B. Fornberg, Math. Comput., vol. 51, pp. 699–706, 1988. , “Fast generation of weights in finite difference formulas,” [10] in Recent Developments in Numerical Methods and Software for ODEs/DAEs/PDE’ss, G. D. Byrne and W. E. Schiesser, Eds. New York: World Scientific, 1992, pp. 97–123. [11] J. R. Reitz and F. J. Milford, Foundations Of Electromagnetic Theory, 2nd ed. Reading, MA: Addison-Wesley, 1967. [12] Differentiation and symbolic manipulations were greatly facilitated by the use of the computational mathematics program Theorist, a product of Waterloo Maple Software, Waterloo, Ont., Canada. This product has been renamed MathView. [13] G. Arfken, Mathematical Methods for Physicists, 3rd ed. New York: Academic, 1985. [14] J. D. Jackson, Classical Electrodynamics, 2nd ed. New York: Wiley, 1975. [15] S. J. Sackett, “EFFI—A code for calculating the electromagnetic field, Force, and Inductance in Coil Systems of Arbitrary Geometry,” Lawrence Livermore National Laboratory Rep. UCRL-52402, 1978. [16] SCRIBe is a version of Dr. W. B. Herrmannsfeldt’s EGUN code, ca. 1977, which has been modified since that time by the Vacuum Electronics Branch at the Naval Research Laboratory to meet internal needs for simulation of electron optical systems. (Also see [3]). [17] The author is grateful to Dr. K. Nguyen for providing the data on the gyroklystron superconducting magnet. [18] Maxwell 2-D is a commercial finite-element method magnetics simulation code. It was developed and is available from Ansoft Corp., Four Station Square, Suite 660, Pittsburgh, PA 15219 USA. [19] The computation was performed on a Power Macintosh with an 80-MHz PPC601 CPU. The code which performed this calculation was written in Fortran and compiled with an MPW Fortran77 compiler from Absoft Corp., 2781 Bond St., Rochester Hills, MI 48309 USA.
Robert H. Jackson received the Ph.D. degree in physics from North Carolina State University, Raleigh, in 1984. In 1981, he joined Mission Research Corporation as a Senior Scientist performing research on free-electron lasers and high-power, high frequency microwave generation. In 1985, he joined the Vacuum Electronics Branch at the Naval Research Laboratory (NRL), Washington, DC, where he pursued the development of advanced free-electron lasers and enhanced electromagnetic simulation tools for device design. While at NRL, he served as Technical Program Manager of the tri-service Microwave and Millimeter-Wave Advanced Computational Environment (MMACE) Program, a software framework for electromagnetic CAD. He was a Special Member of the University of Maryland Graduate Faculty for several years and directed two Ph.D. thesis projects at NRL in conjunction with Prof. V. L. Granatstein. In 1994, he was awarded a sabbatical by NRL and spent a year at Culham Laboratory, U.K., Abingdon. Dr. Jackson served as Conference Chairman for the International Conference on Infrared and Millimeter Waves, in 1997. He has authored and coauthored over 70 journal articles, and over 140 contributed papers at major conferences in the areas of high-frequency rf sources and electromagnetic simulation. He recently joined Lucent Technologies, Norcross, GA, to investigate electromagnetic issues in high-speed network interconnects.