High-order space charge effects using automatic differentiation. Michael F. Reusch and David L. Bruhwiler. Citation: AIP Conf. Proc. 391, 179 (1997); doi: ...
High-order space charge effects using automatic differentiation Michael F. Reusch and David L. Bruhwiler Citation: AIP Conf. Proc. 391, 179 (1997); doi: 10.1063/1.52340 View online: http://dx.doi.org/10.1063/1.52340 View Table of Contents: http://proceedings.aip.org/dbt/dbt.jsp?KEY=APCPCS&Volume=391&Issue=1 Published by the American Institute of Physics.
Additional information on AIP Conf. Proc. Journal Homepage: http://proceedings.aip.org/ Journal Information: http://proceedings.aip.org/about/about_the_proceedings Top downloads: http://proceedings.aip.org/dbt/most_downloaded.jsp?KEY=APCPCS Information for Authors: http://proceedings.aip.org/authors/information_for_authors
Downloaded 18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights_permissions
High-Order Space Charge Effects Using Automatic Differentiation Michael F. Reusch and David L. Bruhwiler Northrop Grumman Corporation, Advanced Technology and Development Center, 4 Independence Way, Princeton NJ 08540 Computer Accelerator Physics Conference Williamsburg, Va. 1996
Abstract The Northrop Grumman Topkark code has been upgraded to Fortran 90, making use of operator overloading, so the same code can be used to either track an array of particles or construct a Taylor map representation of the accelerator lattice. We review beam optics and beam dynamics simulations conducted with TOPKARK in the past and we present a new method for modeling space charge forces to highorder with automatic differentiation. This method generates an accurate, highorder, 6-D Taylor map of the phase space variable trajectories for a bunched, highcurrent beam. The spatial distribution is modeled as the product of a Taylor Series times a Gaussian. The variables in the argument of the Gaussian are normalized to the respective second moments of the distribution. This form allows for accurate representation of a wide range of realistic distributions, including any asymmetries, and allows for rapid calculation of the space charge fields with free space boundary conditions. An example problem is presented to illustrate our approach. * Work supported by Northrop Grumman Corporation
Introduction Since the seminal work of Berz [1] and Forest [2], automatic differentiation has become a staple of accelerator design but the incorporation of space charge effects in such codes has never been easy. Amplifying on ideas in Ryne's Charlie code [3], we are proposing a strategy for computing high order space charge effects for complex particle distributions in a new Fortran 90 Taylor-map version of the Northrop Grumman Topkark code. We are implementing this method and will benchmark it against the ray tracing version of the code under known situations. Ultimately, the method may prove useful in the study of beam halo formation in the 3D bunched beams relevant to APT. It is very difficult to simulate this problem with a ray tracing code since the fraction of particles in the halo is only about one in I 08. In contrast, the collective space charge effects of a 3D bunched beam may be well represented by a properly generated Taylor map. This map and the associated particle distribution function then allow a quasi-analytical study of the halo orbits and halo formation.
© 1997 American Institute of Physics
179
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights
Two versions of Northrop Grumman's Topkark code [4] exist, a ray tracing version that pushes individual particle orbits and a Taylor map version that uses automatic differentiation to do arbitrary order perturbation analysis. Both the raytracing and map versions of Topkark code have recently been rewritten in Fortran 90 to take advantage of the operator overloading capabilities of this language. We have consistently attempted to keep both versions of the code similar in capability and on par with each other in terms of implemented accelerator elements since each code has unique and complementary areas of application in the optical design of a given accelerator. This process has been not always been easy, as rarely was there time to implement a novel diagnostic or accelerator element in both codes. However, using the operator overloading capabilities of Fortran 90 this task is much simplified as the identical routine can often be used in both codes with only minor changes. A second advantage in moving to Fortran 90 is the enormous simplification that it allows in Topkark's automatic differentiation library. The application of automatic differentiation to the treatment of three dimensional space charge forces, using what we believe to be a novel technique, is the main subject of this paper.
Explanation of the technique Any function of compact support can be written as the product of a multivariate Taylor series or, what is equivalent a series of Hermite polynomials, times a Gaussian or Maxwell-Boltzmann distribution, since the Hermite polynomials form a complete set of functions in this space. Thus, we assume that the particle distribution can be written as (1)
Here, ~i = x, Px, Y, Py, z, or Pz as i = 1..... 6, are the 6 independent position and momentum phase space variables and. T(~) is a truncated Taylor series, o "-1 is the inverse of the positive definite and symmetric "sigma" matrix whose entries may be set to the second moments of the distribution. The charge density p(x,y,z) is the elementary charge q times the integral of f(~) over the momentum variables. Evaluating integrals of this type when the distribution is Gaussian or a Gaussian times a Taylor series is made simple by a differentiation-under-the-integral-sign trick. For even n, I
/"--
f a x x"e
x
2
=
(2)
180
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights
For odd n the result is zero. With the boundary condition of vanishing • at infinity, the solution to the Poisson problem is
,x,(~)=__L_tfd~e 0(~') 4raz ° a
(3)
I? - ?'l"
For convenience, we consider coordinates that have been rotated to the frame where ~ is diagonal via an orthogonal transformation. If 9(x,y,z) is as given above, we have to evaluate integrals of monomials times Gaussians of the form
( l(x,Z y,Z Z,Z)) x" Y" z'" exp/-z~'-U + 7 + 7 ) J
z,.... (~)=~d~e
(4)
~/(x_x,) ~ +(Y-Y')'+(z-z') ~
We note that by introducing the linear term tzx'+I~Y'+Tz' into the argument of the exponential, differentiating with respect to ct, ~, and ~', completing the square, making a linear change of variables and taking the appropriate limit, we have
It,..(7) = lim ~----,
''
,..,,,-~ootx O~" t)T" ~exp ~-I'O~
*.
) G(x'y'z'Ot'f3'~l, |
2
where, /
G(x, y,z, ot,~, T) = ~ d3r'
~/x
+(y-
y
+(z_ z,_c2)2
(6)
Since the square root kernel of this integral is symmetric in x and x' etc., the derivatives of G(x,y,zgz,[3?/) with respect to oq ~ and y are simply related to those with respect to x, y, and z, namely = -a(7) a(~ ax In the limit of c~, [~, 7 going to zero, these are the derivatives of the potential for the simple Gaussian distribution
181
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights
( l ( x '2 y2 e x p L - ~ ~-a-T + ~-T + c-7-.JJ
Go(x,y,z)=Id'r' ~(x_x,)2+(y_y,)~+(z_z,) 2
(8)
The required derivatives of Go may be automatically calculated by the automatic differentiation routines of a Taylor mapping code. The extension to treating a distribution function that is a Taylor or Hermite series times a Gaussian is accomplished by forming the appropriate weighted sums of these derivatives. The appropriate sums for a particular monomial integral It~.~ are found from (6). For example, the normalized (a=l) ID forms are
lira
~ ( n'~f(n-m-1)!!, o
n - m even1
.,, ~xGO
n - m o d d l (-1)
.(9)
Having produced the I ~ for an arbitrary monomial times Gaussian distribution, constructing • for the more general charge distribution of the type of Eq. 1 is accomplished by a straightforward summation of terms. Noting that each differentiation of a Taylor series reduces its' order by one, the initial computation of Go and the linear combinations of Eq. 9 must be carried out to twice the order of accuracy desired. Similar remarks apply to the second moments. Of course, this order doubling can be done only where required. Formulas (3) through (9) can be verified to apply to numerical computation of the electric field components, virtually without modification. Above first order, it is more efficient to compute the integral of the potential rather than those for the three components of the electric field. Since the accuracy of the fields produced by differentiation is reduced by one order, one can always compute the potential to one higher order and differentiate.
Pushing the particle distribution The main result of the Taylor map code is the non linear map ~7~(t), six truncated multivariate Taylor series, one for each independent coordinate, that take initial coordinates to final coordinates ~(t)=~7~(t)~(0). As before, { represents the 6 coordinates of phase space. The particle distribution function evolves as f(~,t) = f(~- 1(t)~,0),
(10)
where ~-l(t) is the inverse map. It is not hard to show that moments of the distribution evolve similarly. For example, a second moment evolves as
182
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights
Gxx(t) = < x 2 > (t) =
~d3x d3p (m(t)x)2f(x,p,0).
(11)
As many have observed, the bulk of the space charge force is fairly well represented by models that depend on the second moments of the distribution alone. In recognition of this notion we might make a choice for the distribution function by demanding that the coefficients of the Gaussian's argument are exactly these second moments. Clearly, other choices could be made. In a lattice without misalignments, one can assume f(q) = Ao exp( - 1.-~'~Gi,~gig j-' _ g(g)),
(12)
where g(~) contains terms of third order and higher. The argument of the exponential is convected in time using the inverse map and the quadratic part of the argument is transformed via the linear portion of this map. The terms of cubic order and up in the argument are exponentiated to get the Taylor series multiple.
An Example Problem Here, we present some numerical results from a simple transverse FODO, longitudinal FOFO lattice, supporting a 3D bunched beam. All the focusing forces are idealized as discrete linear kicks, applied at distinct periodic locations along the lattice. For vanishing space charge forces, the linearly matched beam Twiss parameters are easily found for this lattice and, to linear order, any function of the quadratic form calculated from these Twiss parameters and given emittance is a matched periodic solution. The main non linearities in this sample problem arise from space charge forces. We model a relativistic, 10 MeV, electron beam in this lattice. Transverse focusing coefficients are arranged to give a zero current transverse phase advance per cell of 72 degrees per FODO cell and 20 degrees longitudinally. Figure 1 shows the depression of the transverse and longitudinal phase advances with beam current compared to that found with the linear Trace3D code and with that found with Topkark's ray tracing code. The distribution function for this case was constrained to be a simple Gaussian and the space charge depressed phase advance was calculated from the linear part of the one lattice period map.
183
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights
80
7O
X-Y TR3D[ •--O--- Z TR3D I
so
~X-Y
'~
j
~ Z
m
3(] - -
)K
X-Y TK
--.O--Z TK •~
20 ¸ 10 0
0
100
200
300
400
500
Current m A
Fig. 1 - Depression of phase advance with current The greater depression of the tune in the Gaussian cases is due to the stronger radial field near the bunch center which is about three times greater than the uniform bunch Trace 3D model. In conclusion, the technique of this paper may be useful in studying the space charge forces of general particle distributions with applicability to several interesting problems including halo formation. Remaining work includes studies convergence of the method and benchmarking against other methods of treating space charge problems. References
[1] Martin Berz, The Description of Particle Accelerators Using High-Order Perturbation Theory on Maps, AIP Conference Proceedings 184, Physics of Particle Accelerators Volume I, American Institute of Physics, New York 1989. [2]E. Forest et al., Normal Form Methods for Complicated Periodic Systems, Particle Accelerators, 1989, Vol 24, pp 91-107. [3] Lie Algebraic Treatment of Space Charge, Robert D. Ryne, Ph.D. dissertation, Department of Physics, University of Maryland (1987) [4] D. L. Bruhwiler and M. F. Reusch, "High Order Optics with Space Charge: The Topkark code," Computational Accelerator Physics, AIP Conf. Proc. 297 (1993) 524.
184
18 Apr 2013 to 128.138.145.58. This article is copyrighted as indicated in the abstract. Reuse of AIP content is subject to the terms at: http://proceedings.aip.org/about/rights