logo

Calculation algorithm for the space charge force of a train with infinite bunches

ACCELERATOR, RAY TECHNOLOGY AND APPLICATIONS

Calculation algorithm for the space charge force of a train with infinite bunches

San-Hai Ren
Hong-Yu Li
Jia-Ru Shi
Hao Zha
Wei-Hang Gu
Qiang Gao
Qian Tan
Huai-Bi Chen
Nuclear Science and TechniquesVol.36, No.6Article number 96Published in print Jun 2025Available online 18 Apr 2025
9600

Industrial linear accelerators often contain many bunches when their pulse widths are extended to microseconds. As they typically operate at low electron energies and high currents, the interactions among bunches cannot be neglected. In this study, an algorithm is introduced for calculating the space charge force of a train with infinite bunches. By utilizing the ring charge model and the particle-in-cell (PIC) method and combining analytical and numerical methods, the proposed algorithm efficiently calculates the space charge force of infinite bunches, enabling the accurate design of accelerator parameters and a comprehensive understanding of the space charge force. This is a significant improvement on existing simulation software such as ASTRA and PARMELA that can only handle a single-bunch or a small number of bunches. The PIC algorithm is validated in long-drift space transport by comparing it with existing models, such as the infinite-bunch, ASTRA single-bunch, and PARMELA several-bunch algorithms. The space charge force calculation results for the external acceleration field are also verified. The reliability of the proposed algorithm provides a foundation for the design and optimization of industrial accelerators.

Particle-in-cell methodSpace charge forceAlgorithmInfinite bunches.
1

Introduction

Linear accelerators have gained significant attention in industry [1-7] owing to their diverse applications, including radiation sterilization [8, 9], FLASH radiotherapy [10-17], and neutron generation [18-20]. In high-current electron linear accelerators, where pulse currents often reach 300 mA or higher [21], the space charge force exerted by the beam significantly affects its transport [22, 23]. An accurate calculation of the space charge force is essential, particularly for effectively designing linac RF accelerators, enabling the precise determination of the capture rate and beam spot size [24, 25].

Current electromagnetic field simulation software typically focuses on calculating a single-bunch [26-29]. However, in industrial accelerators, where the pulse width reaches microseconds, thousands of bunches can interact [30]. This interaction becomes more significant for electrons with lower energies, which is often the case for industrial accelerators. Ignoring these effects can lead to inaccurate results [31]. For example, the space charge forces of adjacent bunches can intensify the radial expansion of the central bunch and suppress its longitudinal length, which may affect the calculation of capture rates.

Software such as PARMELA provides methods for calculating several bunches [26]. Alternatively, a multi-bunch particle distribution file can be manually generated, and a single-bunch algorithm, such as ASTRA, can be utilized for calculation [27]. However, it is important to note that using a large grid to cover all bunches can significantly reduce the calculation speed.

Under the assumption of infinite bunches with uniform spacing, it is possible to calculate the effects of multi-bunch accumulation using an analytical method. Furthermore, exploiting axisymmetric symmetry allows for a significant simplification of the problem, reducing it to a two-dimensional issue and significantly accelerating calculations [32]. Industrial accelerators often exhibit this characteristic when represented using cylindrical coordinate systems [33]. This symmetry extends to various components, such as acceleration structures and solenoids.

This study proposes an algorithm for handling infinite bunches. By employing analytical methods and considering the axisymmetric nature of industrial accelerators, this study aims to provide efficient calculations of multi-bunch effects.

2

Principles

2.1
Calculation process

For infinite bunches, the space charge forces on each bunch can be calculated based on the reference bunch. Owing to the space symmetry, the forces on other bunches are identical to those on the reference bunch. In the axial direction, the space charge forces cancel each other. However, in the radial direction, the forces superimpose, leading to faster bunch radius growth compared with a single-bunch.

First, an analytical expression was determined for the single-bunch space charge forces which was then solved for infinite bunches. Furthermore, when the bunch train expanded so that adjacent bunches overlapped, a mirror folding method was employed to confine it to the original spacing. To improve the computing performance, the macroparticle and PIC methods were used. Additionally, the six-dimensional phase space was simplified into a four-dimensional phase space, according to the axial symmetry of the bunches. The calculation process of the algorithm is shown in Fig. 1.

Fig. 1
Calculation process
pic

A brief description of the calculation process is as follows:

(1) Input file and reference particle Using the input initial six-dimensional phase space of N macroparticles, convert the x, y, z coordinates to r,z coordinates in the polar coordinate system, ignoring the position and velocity in the ϕ direction. Define a reference particle at the average position of the bunch.

(2) Transport time and iteration steps As the reference particle is in the center of the bunch, it is not affected by space charge forces. Considering its initial speed and the external electromagnetic fields, solve its total transport time and then divide it into iteration time steps. For the calculation of the entire bunch, the computing ends only if the total transport time is reached.

(3) First system conversion Before each iteration, convert the laboratory system into the bunch system, as the calculation of space charge forces is easier.

(4) Grid division According to the position distribution of particles, determine the upper and lower bounds of the uniform grid by considering their maximum value, average value, and standard deviation. Distribute macro-particle charges to each lattice point of the grid by linear interpolation. Extreme macro-particles with positions exceeding the grid range are assigned to the nearest grid boundary point.

(5) Space charge forces calculation Calculate the total space charge forces on (Nr+1)× (Nz+1) grid points based on the ring-charge model. Each macroparticle uses the value of the closest grid point.

(6) Second system conversion Convert the space charge forces in the bunch system back into the laboratory system.

(7) Iteration update Considering both the space charge forces and external electromagnetic fields, for each macroparticle, solve their acceleration and update their positions and velocities to obtain their new phase space in the laboratory system.

(8) Repeat steps (3) to (7) iteratively until the results are obtained.

The algorithm uses the Euler method for iterations because the relationship between the accelerations and positions is sufficiently complex that the commonly used fourth-order Runge-Kutta method [34, 35] is unsuitable. Although the Euler method is known to have relatively large errors [36], the overall error of the PIC algorithm was found to be acceptable, as shown in the results and discussion sections.

2.2
PIC method and grid division

To simplify the computational process, a macroparticle approach was employed in which a certain number of electrons were treated as a single entity.

Owing to the interdependence between the positions and the resulting space charge forces, ordinary differential equations (ODEs) could not be used directly. Numerical calculations and time-based iterations are typically used to address this issue. Within each iteration, a single macroparticle receives space charge forces from the other (N-1) macroparticles. Consequently, the complexity of the algorithm for each iteration is approximately N2.

The PIC method was utilized to effectively reduce algorithm complexity [37, 38]. It divides the spatial region into a grid and allocates the quantities of particles, such as the charge and force, to the grid points for calculation. This reduces the computational complexity of each iteration from N2 to N12N22, where N1 and N2 represent the number of grids in both directions.

In the multi-bunch model, a key assumption is that the bunch exhibits angular symmetry, allowing the velocity of the bunch in the azimuthal direction (ϕ) to be neglected. This simplification enables the establishment of an r-z grid in a cylindrical coordinate system. The radial direction (r) represents the transverse dimensions of the bunch, and the vertical axis (z) represents the longitudinal dimensions. The radial grid starts at r=0 and does not include negative parts.

In this study, uniform grid division was employed. When a macroparticle charged q fell within the grid region, its charge was linearly distributed to four nearby lattice points, and the space charge forces were calculated using only the parameters on the grid. Note that as the bunches expanded over time, it was necessary to update the grid.

2.3
Analytical calculation of a single-bunch

In this section, analytical expressions are obtained for the space charge forces of a single-bunch. Each point in the r-z grid represents a ring charge (except r=0, which is a point charge). In this model, the Coulomb repulsion of the ring charge q2 toward the point particle q1 is solved, as shown in Fig. 2. The left side shows the projection on the plane z=0, and the right side shows the relationship in space.

Fig. 2
(Color online) Repulsion between the microelement dq2 and particle q1
pic

Taking r1 as the positive direction of the axis x, the cylindrical coordinate system can be transformed into a spatial rectangular coordinate system. In Fig. 2, the microelement dq2=q2dl/2πr2=q2dθ/2π, where dl is the length of the microelement. The coordinate of the microelement is (r2, r2, z2), whereas the coordinate of the point particle is (r1, 0, z1). The distance between them is: d=(r1r2cosθ)2+(r2sinθ)2+(z1z2)2 (1) The Coulomb repulsions in the r and z directions, respectively, are as follows: dFr=q1dq24πε01d2(r1r2cosθ)d (2a) dFz=q1dq24πε01d2(z1z2)d (2b) By integrating along the ring, the forces in both directions are obtained as follows: Fr=q1q24πε0I1 (3a) Fz=q1q24πε0I2 (3b) where I1 =0π(r1r2cosθ)π[Ar+(z1z2)2]32dθ (3c) I2=0π(z1z2)π[Ar+(z1z2)2]32dθ (3d) Ar=(r1r2cosθ)2+(r2sinθ)2 The integrations are used in the subsequent calculation of infinite bunches. The results are as follows: I1=A2ellipticE(A1)+A3ellipticK(A1)πA4 (4) I2=2(z1z2)ellipticE(A1)πA4 (5) where A1=4r1r2(r1+r2)2+(z1z2)2A2=r12r22(z1z2)2A3=(r1r2)2+(z1z2)2A4=r1A3(r1+r2)2+(z1z2)2 ellipticE and ellipticK are elliptic integral functions which are time-consuming to calculate. The approximation methods are discussed subsequently in this paper.

2.4
Analytical calculation of infinite bunches

To calculate the space charge forces in the radial direction for infinite bunches, the ring charges are divided into groups. In each group, the r coordinates of the ring charges are the same, whereas their z coordinates differ by distance D, which is equal to the spacing between adjacent bunches.

By replacing Δz=z1z2 in equations 3(c) and (d) with Δz=z1z2+kD(k=0,1,2,), the space charge force of any ring charge group towards the point charge in the reference bunch can be obtained. By adding the forces of each group, the following expression for the radical force is obtained: Er,k=k=+q1q24πε022π0π(r1r2cosθ)[Ar+Δzk2]3/2dθ (6) This expression can be simplified as follows: Er,k=q1q24π2ε00πk=+c[a+(kb)2]32dθ (7) where a=Ar/D20b=(z2z1)/D[1,1]c=(r1r2cosθ)/D3z1,z2[D/2,D/2] The sum of the infinite series is calculated as follows: Stotal=k=+c[a+(kb)2]32 (8) where a >0, b∈[-1,1]. This summation can be proven to converge using the following method: |Stotalc|=k=+1[a+(kb)2]32k=+1(kb)31{b}3+k=1+2k3<1{b}3+52 where {b} denotes the fractional proportion of b.

Equation (8) does not have an analytical solution. However, if this summation is approximated as its corresponding integral, the following simple solution can be obtained: Sint=+c[a+(kb)2]32dk=2ca (9) When |k| is small, the relative error between the series and integral is large. Therefore, rather than directly using the entire integral for the approximation, it is only used when |k| is large. For |k|k0, the original series is used. The final expression of the approximation is: Sap=k=k0+0.5k00.5c[a+(kb)2]32+Sintk0+k0c[a+(kb)2]32dk (10) where k0 is a half integer. For example, when k0=2.5, the interval to be eliminated by the integral approximation is [-2.5, 2.5], which is replaced by the original series of the region k[2, 2].

The approximation error is determined using the following method. In the bunch system, the bunch shape factor A=R/γLlab. Suppose that the radius and length of a single-bunch are comparable; A is close to 1 thus, in equation (11), a[0, 1] and b[1, 1]. Under such circumstances, when k0=1.5, the maximum relative error between Sap and Stotal is 3%; when k0=2.5, it is reduced to 0.5%. It is important to note that when θ varies from 0 to π, a and b change within their respective ranges and the average relative error is significantly smaller than the maximum error. Therefore, after integrating θ into [0, π], the relative error in the integral approximation is small. As k0 increases, the relative error of the algorithm decreases significantly. However, the computational workload for series summation increases. For example, when k0=2.5, the computational workload of the multi-bunch PIC algorithm is approximately 2k0+2=7 times that of the single-bunch algorithm.

In equation (10), Sint is a simple expression derived from equation (9), and the series part of [k0+0.5, k00.5] can be obtained by applying the single-bunch algorithm 2k0 times. Thus, the focus of the calculation is the integration of the last term. Integrating θ yields: Ik=0πk0+k0ca+(kb)232 dkdθ=0πcak0ba+(k0b)2+k0+ba+(k0+b)2dθ Substituting a, b, c yields: Ik=i=120π(r1r2cosθ)ΔziArD[Ar+Δzi2]1/2dθ=Ik1+Ik2 The calculation result of the integral is: Ik={ 1Di=12Δzi4r2+Δzi2ellipticK(4r24r2+Δzi2)r, r1=r2=r;1Di=12Δzi(r1+r2)ellipicK4r1r2(r1+r2)2+Δzi2+(r1r2)ellipicPi[ 4r1r2(r1+r2)2, 4r1r2(r1+r2)2+Δzi2 ]r1(r1+r2)(r1+r2)2+Δzi2,r1r2 (11) where Δz1=z1z2+k0D, Δz2=z1z2k0D.

Utilizing equations (7)-(11), the radial analytical expressions of the space charge forces are obtained for infinite bunches in the bunch system.

In the radial direction, the space charge forces from different bunches are in the same orientation, so each term in the sum of the series is positive, which would be suitable for approximation by integration. However, in the longitudinal direction, these forces cancel. Consequently, this integration is zero, which may lead to unacceptable errors. Therefore, an alternative method was used to approximate the summation. In the longitudinal direction, equation (8) becomes: Stotalz=k=+kb[a+(kb)2]32 (12) where a>0, b1,1. When k≥2, equation (12) is expanded based on 1/k as follows: Sk=1k2(1bk)[(1bk)2+ak2]32 Sk=1k2(1+bk)[(1+bk)2+ak2]32 S±k=Sk+Sk=4bk3+4(3ab+3b3)k5+32(15a2b4ab3+8b5)k7+O(1k9) (13) where a=(r12+r222r1r2)/D20. As a only appears in the numerators, after substituting a and b, equation (13) can be simply integrated with θ on 0, π. Similar to the previous section, the original series is used when |k| <k0 and its Taylor expansions are used for the remaining part. Considering that k=1+1ki , i=3, 5, 7 are mathematically known constants, after summing k on [k0,+) for equation (13), the approximate expression of equation (12) is obtained.

Calculations are conducted in the bunch system, where Dbunch=γDlab, such that amax=(RγDlab)2=AD2. When a0, 1, b[1, 1], a uniform sample is taken to evaluate the approximation effect, and the results validate the approximation method. When k0=2.5, rms(Ikz)=35.72 whereas rms(ΔIkz)=0.0035, where Ikz is the value after integrating equation (12) with θ, summed by k cutting at |k|=100. ΔIkz is the error between Ikz and its approximation. When k0 becomes 3.5, rms(ΔIkz) decreases to 0.00048. However, by analyzing quation (13), such an approximation is sensitive to a and k0. A large a may significantly reduce the accuracy. Consequently, k02AD to maintain the approximation effect.

When calculating the space charge forces, k0 is taken as k0x and k0z, respectively, in different directions to balance the accuracy and efficiency of the algorithm.

2.5
Acceleration in a laboratory system with space charge forces and external fields

Thus far, the radial and longitudinal space charge forces have been determined in the bunch system. Before converting from a bunch to a laboratory system, the infinite-bunch model is considered, in which the Lorentz force in the radial direction is opposite to the Coulomb repulsion and differs in size by a factor β2. Therefore, the total radial force in the laboratory system is 1/γ2 times the Coulomb repulsion in the bunch system [39]. The expression for the radial force is: Fr=qIr2πε0βca2(1β2)=qIr2πε0βca21γ2 (14) This result is used in the subsequent Results and Discussion sections. It is assumed that the laboratory system is a S system, whereas the bunch system is a S' system, which moves at a speed u=βc in direction z. According to the relativistic transformation, the forces in the laboratory system are as follows: {Fr=Frγ+Fr,ex Fz=Fz+Fz,ex (15) where Fr,ex,Fz,ex are the external electromagnetic field forces; Fr,Fz are the space charge forces in the bunch system; and Fr,Fz are the total forces in the laboratory system.

The expression for the acceleration in the case of relativity is: a=Fγm0v(vF)γm0c2 (16) Using the acceleration in equation (16), the particle phase space is updated after each iteration.

2.6
Mirror method for overlapping bunches

As the bunches expand such that adjacent bunches overlap, a mirroring technique is used, as shown in Fig. 3. The overflowing part outside the bunch interval is folded back into the original bunch range using mirror symmetry. This ensures consistency in the grid and the algorithm used in the previous sections. The mirroring process involves reflecting macroparticle positions longitudinally and reversing their longitudinal velocities, while keeping their transverse positions and velocities constant. After updating the phase spaces of macroparticles in each iteration, a mirror operation is performed.

Fig. 3
(Color online) Mirror Method
pic

This operation serves two purposes. First, it restricts the longitudinal length of the bunches to the bunch interval D, simplifying the longitudinal grid update. Second, it focuses on the calculation of a single reference bunch rather than computing the complex effects of overlapping bunches.

2.7
Approximation of elliptic integral functions

The analytical expressions for the space charge forces involve three elliptic integral functions: ellipticE(x), ellipticK(x), and ellipticPi(x,y). However, their computational complexity is high, and existing approximations often rely on iterative methods, resulting in a significant computation time [40, 41]. This section introduces simple and fast approximation methods for elliptical integrals with improved accuracy.

For convenience: x=4r1r2(r1+r2)2+(z1z2+kD)2 (17) where x is the argument of the functions ellipticE and ellipticK. Note that when calculating the space charge forces on the grid points, the macroparticle under the forces is treated as a point charge. Therefore, the self-force of one grid point is neglected, which means that in equation (17), (r1r2)2+(z1z2)20.

The function ellipticE is a complete elliptic integral of the second type, which is smooth when x[0,1]. Consequently, a fourth-order polynomial can be used to approximate the function. As shown in Fig. 4(a), the blue line depicts the function ellipticE in its defined domain. The orange line describes the relative error of the polynomial approximation and original function, which mainly ranges from 0.2%. Only when x is close to 1, the relative error increases to 1%. The approximation has a root mean square error (RMSE) of 0.0012.

Fig. 4
(Color online) Fit of elliptic integrals
pic

The function ellipticK cannot be directly approximated by polynomials, because when x1,ellipticK(x)+. Thus, a sixth-order polynomial is used to fit it when x[0,0.9], which has a RMSE of 0.00089. As shown in Fig. 4(b), the blue line represents the value of the function on [0,0.9], whereas the orange line represents the relative error of the approximation, which varies within 0.2%. Subsequently, a separate method is used for the function ellipticK when x[0.9,1].

In equation (17), x cannot reach the upper limit 1. Deriving the maximum value of x is conducive to constructing an approximation. When calculating the space charge forces on uniform grid points: r1=N1Δr, r2=N2Δr, N1, N2=0, 1, 2, , Nrz1=N3Δz, z2=N4Δz, N3, N4=0, 1, 2, , Nz where Nr,Nz are the number of grids in both directions, Δr and Δz are their unit lengths, m=Δr/Δz. To estimate the maximum value of x, k=0 is included in equation (17): x=4N1N2(N1+N2)2+(N3N4)2m2 (18) Variable substitution is then performed as follows: x1=11x=(N1+N2)2+(N3N4)2m2(N1N2)2+(N3N4)2m2 (19) When x1,x1,ellipticK(x), the variable can be changed from x to x1 and the function K(x) can be constructed for approximation. Note that (N1N2)2+(N3N4)20. To let x1 reach its maximum value, there are only two possible situations:

(a) N1=N2=Nr,   |N3N4|=1x1=11x=(2Nrm)2+1

(b) N3=N4, |N1N2|=1, min(N1, N2)=Nrx1=11x=(2Nr1)2+1

For simplicity, m=1 is considered when: max(x1)=(2Nr)2+14Nr2 (20) Taking Nr=30, max(x1)3600. If max(x1)106, then Nr can be set to 500, which is sufficient for most PIC algorithms.

After converting the variable from x to x1, the function ellipticK(x)x1 is fitted well with the power function. It follows that: x2=lg(x1)=lg[1/(1x)] (21) Consequently, x[110a,110b]x2[a, b]. x2[1, 9] is used with evenly spaced x2 sequences as independent variables. Although the function ellipticK(x)x is difficult to approximate directly, the function ellipticK(x)x2 is close to a straight line, as shown by the blue line in Fig. 4(c). Therefore, a second-order polynomial is used for the approximation, which has a RMSE of 0.0041. The orange line indicates the relative error.

The total expression of this approximation is: K(x)=i=13pi*lg[1/(1x)]3i If a finer grid is required, a further approximation can be achieved by involving a larger x2 using the same method.

The third function ellipticPi is approximated in a manner similar to that for ellipticK. ellipticPi is the complete elliptic integral of the third type, which is expressed as: ellipticPi(x, y)=Pi(x, y)=Pi(x, π2|y)=0π/21(1xsin2θ)1ysin2θdθ The function Pi(x, y) is constructed to approximate ellipticPi(x, y). After converting the parameters from x, y, Pi(x, y) to x2, y2, Z, the function Z(x, y)x2, y2 can be fitted well with the following polynomials: x2=lg(x1)=lg[1/(1x)]y2=lg(y1)=lg[1/(1y)]Z=lg[Pi(x, y)]x=4r1r2(r1+r2)2, r1r2y=4r1r2(r1+r2)2+(z1z2+k0D)2<x<1 (22) Considering that k0D in the denominator restricts the maximum value of y, max(x2)=6 and max(y2)=2 are used, when the function Z(x,y)x2,y2 is close to a flat surface, as shown in Fig. 4(d). This can be fitted well by a third-order polynomial with a RMSE of 0.0021.

By replacing the time-consuming calculations of the three elliptic integrals with simpler and faster approximation computations, the algorithm significantly improves the computational efficiency while providing reasonably accurate results. Before the approximation, the algorithm has an excessive computational time, which is significantly shortened by the approximation, although it remains slower than that of ASTRA. The accuracy and calculation time of the algorithm are presented in the Results section.

3

Results and Discussion

After approximating the elliptic integrals and other analytic calculations, an algorithm was constructed to calculate the space charge forces for infinite bunches. In the subsequent analysis, the results of the algorithm under special circumstances are compared with those of existing algorithms to confirm its accuracy. These algorithms include the infinite-bunch, ASTRA single-bunch, and PARMELA several-bunch algorithms. In the first three parts, different models are used to compare these algorithms in a long drift space; including an infinite–bunch model, different numbers of bunches, and bunches with different spacings. In the last section, the results of the PIC algorithm and ASTRA are compared in an external electromagnetic field. For simplicity, bunches with an initially uniform transverse distribution are used in all sections.

3.1
Comparison with infinite-bunch model results

The proposed algorithm is designed to calculate the space charge forces exerted by infinite bunches with uniform spacing. First, a special situation is considered. When the bunches are simplified uniform cylinders, and the distance between them is equal to their length, the adjacent bunches are connected end-to-end, forming a uniform, infinite-bunch, as shown in Fig. 5(a). In this section, the bunch spacing D of the proposed algorithm is equal to the bunch length L0 and its results are compared with the infinite uniform bunch model.

Fig. 5
(Color online) Comparison between multi-bunch and single-bunch algorithms
pic

The analytical expression of the space charge forces for this model is shown in Eq. (14). As the bunch length of this model is infinite, the bunch does not expand longitudinally because of the symmetry. Thus, its equivalent current can be used as a constant parameter to describe the space charge forces. During the transverse expansion, the particle accelerations are proportional to their radii. If the particles in the bunch have no initial transverse velocities, the ratio of radii among the particles remains constant and the bunch remains uniform after the action of space charge forces. Therefore, the calculation results of this model can be simply verified.

The results for an infinite uniform bunch can also be obtained by utilizing the ASTRA single-bunch algorithm. In the proposed algorithm, a case in which infinite bunches are concatenated is calculated. In ASTRA, the number of bunches can be reduced from infinity to 100 and spliced into a long bunch. When the length of the entire bunch is such that its longitudinal expansion under space charge forces can be neglected, the equivalent current remains constant during transport. Under these circumstances, the transverse expansion is approximately equal to that of an infinite uniform bunch model.

The proposed algorithm took 380 s to calculate 6000 macroparticles, with iteration steps of 4000 and k0r=2.5, k0z=3.5, Nr=25, Nz=30. When the same parameters were used, including macroparticle numbers for each single bunch, iteration steps, and mesh density, the calculation of a long bunch containing 100 single bunches using ASTRA would take 2460 s. However, such a long uniform bunch would have limited longitudinal expansion, making longitudinal calculations unimportant. Finally, 6000 macroparticles and 30 longitudinal meshes were used for the entire long bunch in ASTRA, which shortened the calculation time to 17 s.

The comparison results are summarized in Table 1, where R0 and L0 are the initial radius and length of a single bunch, respectively, and γ is the Lorentz factor. The charge within the length L0 is q0 = -5 nC. The distance D between different bunches is equal to L0, such that AD=R0/(γD)=A. Nr and Nz are the numbers of grids and A is the shape factor of the bunch in the bunch system. For convenience of comparison, the algorithm takes k0z=3.5 in all calculations. If A is larger, then k0z must be increased to satisfy k0z>2AD=2A.

Table 1
Multi-bunch algorithm compared with an infinite uniform bunch
A Nr Nz R0 (mm) L0 (mm) γ L (m) R0 (mm) RE(R1) (%) RE(R2) (%) L0 (mm) RE(L1) (%)
0.0125 10 160 5 20 20 50 50.83 -0.10 +0.61 5.774 -0.59
0.025 20 80 5 20 10 10 24.62 +1.46 +0.93 5.774 -0.33
0.067 20 80 20 30 10 50 101.3 +0.59 +0.69 8.662 +0.58
0.067 20 80 20 60 5 10 32.82 +0.64 +0.98 17.32 -0.06
0.167 25 30 50 60 5 50 194.2 +0.46 +0.41 17.33 +0.69
0.167 25 30 50 30 10 50 80.82 +0.54 +0.68 8.662 -0.51
0.167 25 30 50 6 50 300 99.65 +0.45 +0.65 1.732 -0.35
0.167 25 30 10 6 10 10 43.86 +0.78 +0.59 1.733 +2.48
Show more

A is related to the grid division. For example, a large A indicates that the transverse length of the bunch is greater than its longitudinal length. Therefore, the grid in the r direction should be divided finer than that in the z direction to increase the accuracy of the PIC algorithm. Considering that the space charge forces were calculated in the bunch system, γ is also included in the expression for A. L is the transport distance of the bunch. R0 is the root mean square (RMS) radius of the final bunch, which is calculated using the ASTRA long bunch. RE(R1) and RE(R2) are the relative errors with R0 from the multi-bunch PIC algorithm and infinite uniform bunch model, respectively. L0 is the ASTRA RMS length result and RE(L1) is the multi-bunch PIC algorithm relative error. The analytical model only calculates transversely; therefore, there is no length result. As shown in Table 1, although the PIC algorithm adopts a rough mesh division because Nr and Nz are small, most relative errors with an infinite uniform bunch model are approximately 1%, validating the PIC algorithm.

3.2
Comparison with ASTRA single-bunch model results

The PIC algorithm was further validated by varying the spacing of the bunches while maintaining the constant parameters of a single-bunch. By gradually expanding the spacing of the bunches, the behavior of the multi-bunch algorithm is compared with the results obtained from ASTRA's single-bunch method. As the spacing of the bunches increases, the infinite-bunch model gradually degenerates into a single-bunch model. Hence, if the PIC algorithm results ultimately converge with those of ASTRA, this provides further evidence for the validity and rationality of the PIC algorithm.

Using the same parameters as in Section A, the multi-bunch calculation time of the proposed algorithm is 380 s, whereas that of the ASTRA single-bunch model is 20 s.

The comparison results between ASTRA and the multi-bunch algorithm with different bunch spacings are presented and discussed in Fig. 5.

The initial parameters of the single-bunch algorithm are q0 = -5 nC,R0 = 50 mm,L0 = 60 mm, and γ = 5, L = 50 m. D represents the spacing between bunches used in the multi-bunch algorithm, and R represents the RMS value of the radius of the bunches. As shown in Fig. 5(a), when the spacing between the bunches is equal to the length of the bunches, the multi-bunch algorithm result is equal to that of the infinite-bunch model, as shown by the blue line in Fig. 5(b)(c). The results of different D values from the multi-bunch algorithm are shown as purple points, where R decreases as D increases, whereas Lz increases. When D reaches double that of L0, the transverse expansion of the bunches due to space charge forces is reduced by approximately 20% compared to the infinite-bunch model. When D reaches triple that of L0, the result of the multi-bunch algorithm is sufficiently close to that of the ASTRA single-bunch algorithm, as shown by the yellow line. The orange line shows the fitted trend as D increases. The position relationship of the three lines indicates that the multi-bunch algorithm and ASTRA single-bunch algorithm agree well. Moreover, it should be noted that if another set of parameters is used, when the results of the multi-bunch algorithm are close to those of the single-bunch algorithm, the requirement for D/L0 may be different. One purpose of the PIC algorithm is to estimate such differences.

3.3
Comparison with PARMELA and ASTRA several-bunch results

PARMELA can calculate the space charge forces for several bunches, whereas ASTRA can only handle a single-bunch. However, if a file is input with an initial phase space of several bunches, ASTRA can also calculate their space charge forces, even though they are treated as a long bunch. Consequently, the mesh division of ASTRA is relatively approximate, which may result in slightly larger errors.

By utilizing ASTRA and PARMELA, the space charge forces of several bunches can be calculated. As the number of bunches gradually increases, their results gradually approach those of infinite bunches. This confirms the reliability of the PIC algorithm.

Using the same parameters as in Section A, the multi-bunch calculation time of the proposed algorithm is 380 s. When keeping the macroparticle numbers for each bunch and the mesh density constant, as the number of bunches increases from 1 to 19, the calculation times of ASTRA are 14, 36, 57, 79, 102, 125, 149, 173, 213, 241 s.

The results obtained using the three algorithms are shown in Fig. 6. The initial parameters of a single-bunch were q0 = -2 nC,R0 = 50 mm,L0 = 10 mm, γ = 8, L = 50 m, and D=15 mm. R represents the final RMS value of the radius of the bunches, and N represents the number of bunches used in the PARMELA and ASTRA simulations. For example, N=5 indicates the existence 2 bunches on each side of the reference bunch. To ensure symmetry, N=1, 3, 5, … Fig. 6(a) shows the ASTRA results for N=5. As indicated by the green points, the longitudinal expansion of the central bunch is suppressed compared to that of the bunches at the edge. Therefore, to unify the standards, the ASTRA RMS results used subsequently were all obtained from the central bunch, rather than the entire bunch train.

Fig. 6
(Color online) Comparison between infinite-bunch and finite-bunch models
pic

As the number of bunches (N) increases, the results of ASTRA and PARMELA are indicated by green and red points, respectively, as shown in Fig. 6(b)(c). The trends are represented by the curves of the corresponding colors. When N=1, both results fit well with the single-bunch results of the proposed algorithm by setting D to be sufficiently large, as indicated by the pink line. When the number of bunches N9, both results approach those obtained from the PIC algorithm, which sets the number of bunches to infinity (∞), as shown by the blue line.

The overall convergence between the finite- and infinite-bunch models validates the capability of the latter algorithm to predict space charge forces for industrial accelerator systems.

3.4
Comparison with ASTRA external field results

In this section, by setting D to be sufficiently large, the PIC multi-bunch algorithm is degraded to a single-bunch algorithm. Subsequently, the single- and multi-bunch results of the PIC algorithm are compared with those of ASTRA in the field of an S-band standing wave accelerator, with an axial electric field as shown in Fig. 7(a). The field has a frequency of 2856 MHz and its maximum electric field strength is 18.087 MV/m.

Fig. 7
(Color online) Comparison with ASTRA in an external field. (a): External electric field along the z axis; (b)-(f): rms-x, rms-divergence, average kinetic energy, rms-length and capture rate, and the energy spread of the beam during transport, respectively
pic

A uniform bunch was used to calculate the transport process. When a low energy bunch was used in the S-band field, its length increased so much that it exceeded the range of the accelerating tube, which caused significant problems in the longitudinal calculation. Hence, a higher energy bunch was used to validate the calculation capabilities of the proposed algorithm in an external field. The initial parameters of the single-bunch were q0=-4 pC,R0=0.1 mm,L0=0.5 mm, and γ=1.3, L=Lcell=0.5255 m. D=1×103 m was used to degrade the bunch train with infinite bunches into a single-bunch. In this section, the number of iteration steps was 4000, the number of macroparticles was 10000, and k0r=2.5, k0z=5.5, Nr=30, Nz=40. It took the proposed algorithm 780 s and ASTRA 42 s to complete the single-bunch calculations.

For the multi-bunch calculations of the standing-wave accelerating field, a bunch train with a spacing equal to its RF period should be used, which is 67.1 mm for 2856 MHz and γ=1.3. However, such a bunch train is not suitable for validation because the RF period is too long compared with the bunch length. Considering the same mesh density as a single-bunch, calculating 11 bunches in ASTRA would require more than 50000 meshes longitudinally, which is unrealistic. Experimentally, ASTRA was used to calculate 11 bunches with 5000 longitudinal meshes, which required more than 14 h. The results showed that the bunch train expands to over 1000 mm longitudinally, which is almost double the accelerating field length. Finally, a small D as 2 times L0 was used, which indicated that the bunch spacing was equal to the bunch initial length. Such a parameter would be convenient for validating the ability of the proposed algorithm to calculate in an external field, as fewer longitudinal meshes are needed. For high-frequency accelerators, it is more practical to adopt D as the RF period.

Furthermore, the π-mode S-band field contains only 11 cells, which is fewer than six RF periods. Consequently, when the number of bunches exceeds seven, some bunches would exit the field before others have entered. When the bunch train has only a few bunches, such as five bunches, the proposed algorithm can help provide the upper limit of the space charge force. When the field has an adequate number of cavities, such as 30, the proposed algorithm has additional computational advantages.

A comparison of the results of the three algorithms is presented in Fig. 7(b)-(f).

Figure 7(b) shows the RMS values of the bunches in the x direction. The PIC single-bunch results agreed well with those of ASTRA, with a relative error of less than 0.5%. The blue dashed line shows the results of the multi-bunch algorithm, under which circumstances the expansion of the bunches is more obvious because of the increased space charge forces.

Figure 7(c) shows the beam divergences of the three algorithms. The two single-bunch results fit well. The multi-bunch divergence is larger when the radius is small. When the multi-bunch radius is much larger than that of the single-bunch, its divergence decreases.

Figure 7(d) compares the beam energies of the three algorithms, all of which were accelerated from 153 keV to approximately 3.33 MeV. The relative error between the two single-bunch algorithms is less than 0.6%.

Figure 7(e)(f) depicts the RMS length and capture rate when a simple circular aperture with a radius of 1.5 mm was added and the energy divergence of the three algorithms. The two single-bunch results fit well. As indicated by the solid lines in Fig. 7(e), the bunch length exhibits a maximum relative error of 1%, whereas in Fig. 7(f), the energy spread is 5% at certain points. As indicated by the dashed lines in Fig. 7(e), the final capture rates of ASTRA and the single-bunch of the proposed algorithm were 71.5% and 71.7%, respectively, whereas the multi-bunch capture rate was 59.9%. The blue line shows the results of the multi-bunch, where the longitudinal expansion of the bunches is suppressed.

In this case, the multi-bunch space charge forces have a significant impact on the transverse and longitudinal evolutions of the bunches. The transverse expansion was intensified, whereas the longitudinal expansion was suppressed. Both effects interfere with the capture rate, which is reduced by approximately 10%. After this comparison with ASTRA, the ability of the proposed algorithm to calculate multi-bunch space charge forces in accelerating fields was demonstrated.

However, it should also be noted that in this example, to reduce the burden of the longitudinal calculation, D was not considered as the S-band RF period because it was too long. As a result, the accelerating phase of each bunch is different, which is not considered in the proposed algorithm; hence, the capture ratio in Fig. 7(e) includes only the loss on the aperture owing to the large beam radius. If the external field has higher frequency or adequate cavities, the proposed algorithm would be able to take D as the RF period and provide more valuable results. In future studies, work should focus on optimizing the longitudinal calculation capabilities of the algorithm until it can calculate the bunching process of low energy beams more accurately.

4

Conclusion

The proposed multi-bunch algorithm, based on the ring charge model and the PIC method, offers a reliable approach for calculating the space charge forces of infinite interacting bunches in industrial accelerator systems. A reasonable approximation of the three elliptic integrals effectively increases the operational speed of the algorithm. By comparing the algorithm with existing models, such as infinite bunches, the ASTRA single-bunch algorithm, and the PARMELA several-bunch algorithm in both long drift spaces and accelerating fields, its acceptable accuracy was verified and its applicability to accelerator design and optimization was demonstrated. This study provides a valuable reference for understanding the space charge forces in industrial accelerators, facilitating enhanced performance and efficiency in various applications. In the future, work should focus on optimizing the approximation method and computing capability, particularly in the longitudinal direction.

References
1.C.X. Tang, H.B. Chen, Y. Liu et al.,

Low-energy linacs and their applications in Tsinghua university

. in Proceedings of the 23rd International Linear Accelerator Conference, Knoxville, USA (2006)
Baidu ScholarGoogle Scholar
2.X.C. Lin, H. Zha, J.R. Shi et al.,

Fabrication, tuning, and high-gradient testing of an X-band traveling-wave accelerating structure for VIGAS

. Nucl. Sci. Tech. 33, 102 (2022). https://doi.org/10.1007/s41365-022-01086-y
Baidu ScholarGoogle Scholar
3.X. Li, J.Q. Zhang, G.Q. Lin et al.,

Performance of an electron linear accelerator for the first photoneutron source in China

. Nucl. Sci. Tech. 30, 53 (2019). https://doi.org/10.1007/s41365-019-0576-4
Baidu ScholarGoogle Scholar
4.J. Gao, H. Zha, J.R. Shi et al.,

Design, fabrication, and testing of an X-band 9-MeV standing-wave electron linear accelerator

. Nucl. Sci. Tech. 34, 110 (2023). https://doi.org/10.1007/s41365-023-01254-8
Baidu ScholarGoogle Scholar
5.C. Meng, X. He, Y. Jiao et al.,

Physics design of the HEPS LINAC

. Radiat Detect Technol Methods. 4, 497 (2020). https://doi.org/10.1007/s41605-020-00205-w
Baidu ScholarGoogle Scholar
6.W. Zhao, I. Patil, B. Han et al.,

Beam data modeling of linear accelerators (linacs) through machine learning and its potential applications in fast and robust linac commissioning and quality assurance

. Radiother Oncol. 153, 122 (2020). https://doi.org/10.1016/j.radonc.2020.09.057
Baidu ScholarGoogle Scholar
7.Y.P. Wu, J.F. Hua, Z. Zhou et al.,

High-throughput injection–acceleration of electron bunches from a linear accelerator to a laser wakefield accelerator

. Nat. Phys. 17, 801 (2021). https://doi.org/10.1038/s41567-021-01202-6
Baidu ScholarGoogle Scholar
8.C.X. Tang, H.B. Chen, Y.H. Liu et al.,

Electron linacs for cargo inspection and other industrial applications

. in International topical meeting on nuclear research applications and utilization of accelerators, Vienna, Austria (2009)
Baidu ScholarGoogle Scholar
9.V.V. Bezuglov, A.A. Bryazgin, L.A. Voronin et al.,

Sterilization complexes based on ILU-type electron accelerators

. Nucl. Sci. Tech. 22, 13 (2011). https://doi.org/10.13538/j.1001-8042/nst.22.13-17
Baidu ScholarGoogle Scholar
10.Y.F. Wu, D.J. No, D.Y. Breitkreutz et al.,

Technological Basis for clinical trials in FLASH radiation therapy: a review

. Appl Rad Oncol. 10, 6 (2021). https://doi.org/10.37549/aro1280
Baidu ScholarGoogle Scholar
11.F.C. Liu, J.R. Shi, H. Zha et al.,

Development of a compact linear accelerator to generate ultrahigh dose rate high‐energy X‐rays for FLASH radiotherapy applications

. Med Phys. 50, 1680 (2023). https://doi.org/10.1002/mp.16199
Baidu ScholarGoogle Scholar
12.Y. Gao, R.R. Liu, C.W. Chang et al.,

A potential revolution in cancer treatment: A topical review of FLASH radiotherapy

. J. Appl. Clin. Medical Phys. 23, e13790 (2022). https://doi.org/10.1002/acm2.13790
Baidu ScholarGoogle Scholar
13.D.H. Xie, Y.C. Li, S. Ma et al.,

Electron ultra‐high dose rate FLASH irradiation study using a clinical linac: linac modification, dosimetry, and radiobiological outcome

. Med. Phys. 49, 6728 (2022). https://doi.org/10.1002/mp.15920
Baidu ScholarGoogle Scholar
14.Y.W. Yang, J. X. Wang, F. Gao et al.,

FLASH radiotherapy using high-energy X-rays: Current status of PARTER platform in FLASH research

. Radiother Oncol. 190, 109967 (2024). https://doi.org/10.1016/j.radonc.2023.109967
Baidu ScholarGoogle Scholar
15.G.L. Zhang, Z.Z. Zhang, W.C. Gao et al.,

Treatment planning consideration for very high-energy electron FLASH radiotherapy

. Phys. Med. 107, 102539 (2023). https://doi.org/10.1016/j.ejmp.2023.102539
Baidu ScholarGoogle Scholar
16.F. Gao, Y. Yang, H. Zhu et al.,

First demonstration of the FLASH effect with ultrahigh dose rate high-energy X-rays

. Radiother Oncol, 166, 44 (2022). https://doi.org/10.1016/j.radonc.2021.11.004
Baidu ScholarGoogle Scholar
17.B. Lin, F. Gao, Y. Yang et al.,

FLASH radiotherapy: history and future

. Front. Oncol. 11, 1890 (2021). https://doi.org/10.3389/fonc.2021.644400
Baidu ScholarGoogle Scholar
18.N. Baltateanu, M. Jurba, V. Calian et al.,

Optimal fast neutron sources using linear electron accelerators

. in Proceedings of the 7th European Particle Accelerator Conference, Vienna, Austria (2000)
Baidu ScholarGoogle Scholar
19.A. Murata, S. Ikeda, N. Hayashizaki,

Design of an electron-accelerator-driven compact neutron source for non-destructive assay

. Nucl. Instrum. Methods Phys. Res. B: Beam Interact. Mater. At. 406, 260 (2017). https://doi.org/10.1016/j.nimb.2016.12.024
Baidu ScholarGoogle Scholar
20.H.P. Li, Z. Wang, Y.R. Lu et al.,

Design of a CW linac for the compact intense fast NEutron facility

. Nucl. Instrum. Meth. A 930, 156-166(2019). https://doi.org/10.1016/j.nima.2019.03.086
Baidu ScholarGoogle Scholar
21.D.A. Zavadtsev, A.I. Fadin, A.A. Krasnov et al.,

Compact electron linear accelerator RELUS-5 for radiation technology application

. in Proceedings of the 10th European Particle Accelerator Conference, Edinburgh, UK (2006).
Baidu ScholarGoogle Scholar
22.S.V. Kutsaev, R. Agustsson, A. Arodzero et al.,

Linear accelerator for security, industrial and medical applications with rapid beam parameter variation

. Radiat. Phys. Chem. 183, 109398 (2021). https://doi.org/10.1016/j.radphyschem.2021.109398
Baidu ScholarGoogle Scholar
23.G. Stupakov, Z. Huang.

Space charge effect in an accelerated beam

. Phys. Rev. ST Accel. Beams, 11, 014401 (2008). https://doi.org/10.1103/PhysRevSTAB.11.014401
Baidu ScholarGoogle Scholar
24.J. Amundson, P. Spentzouris, J. Qiang et al.,

Synergia: An accelerator modeling tool with 3-D space charge

. J. Comput. Phys. 211, 229 (2006). https://doi.org/10.1016/j.jcp.2005.05.0248
Baidu ScholarGoogle Scholar
25.G. Poplau, U. Vanrienen, B. Vandergee et al.,

Multigrid algorithms for the fast calculation of space-charge effects in accelerator design

. IEEE Trans. Magn. 40, 714 (2004). https://doi.org/10.1109/TMAG.2004.825415
Baidu ScholarGoogle Scholar
26.H. Takeda, J.H. Billen,

Recent Improvements in the PARMILA code

. in Proceedings of the 2003 Particle Accelerator Conference, Portland, OR, USA (2003). https://doi.org/10.1109/PAC.2003.1289967
Baidu ScholarGoogle Scholar
27.https://www.desy.de/mpyflo/
28.https://www.cst.com
29.https://www.pulsar.nl/gpt/
30.A.A. Bryazgin, N.K. Kuksanov, R.A. Salimov,

Industrial electron accelerators developed at the Budker Institute of Nuclear Physics

. SB RAS, PHYS-USP+. 61, 601 (2018). https://doi.org/10.3367/UFNe.2018.03.038344
Baidu ScholarGoogle Scholar
31.S.V. Kutsaev,

Electron bunchers for industrial RF linear accelerators: theory and design guide

. EPJ Plus, 136, 446 (2021). https://doi.org/10.1140/epjp/s13360-021-01312-3
Baidu ScholarGoogle Scholar
32.A.A. Kulikovsky,

The structure of streamers in N2. I. fast method of space-charge dominated plasma simulation

. J. Phys. D, 27, 2556 (1994). https://doi.org/10.1088/0022-3727/27/12/017
Baidu ScholarGoogle Scholar
33.S.Y. Lee, Accelerator physics. 4th edn, (World Scientific, Singapore, 2018), p. 7
34.J.C. Butcher, G. Wanner,

Runge-Kutta methods: some historical notes

. Appl Numer Math. 11, 113 (1996). https://doi.org/10.1016/S0168-9274(96)00048-7
Baidu ScholarGoogle Scholar
35.M.T. Tang, L.J. Mao, H.J. Lu et al.,

Design of an efficient collector for the HIAF electron cooling system

. Nucl. Sci. Tech. 32, 116 (2021). https://doi.org/10.1007/s41365-021-00949-0
Baidu ScholarGoogle Scholar
36.R.L. Burden, J.D. Faires, A.M. Burden, Numerical analysis. 10th edn, (Cengage learning, USA, 2015), pp. 266-267
37.J. Qiang, R.D. Ryne, S. Habib et al.,

An object-oriented parallel particle-in-cell code for beam dynamics simulation in linear accelerators

. in Proceedings of the 12th International Conference for High Performance Computing, Networking, Storage and Analysis, Portland, Oregon, USA (1999). https://doi.org/10.1109/SC.1999.10013
Baidu ScholarGoogle Scholar
38.X.M. Wan, X.J. Pu, Z.Q. Ren et al.,

Discussion of 90° stopband in low-energy superconducting linear accelerators

. Nucl. Sci. Tech. 33, 121 (2022). https://doi.org/10.1007/s41365-022-01104-z
Baidu ScholarGoogle Scholar
39.K. Schindl, in Joint US-CERN-Japan-Russia Particle Accelerator School on Beam Measurement. ed. by S.I. Kurokawa (Montreux, Switzerland, 1998), pp. 127-151. https://doi.org/10.1142/9789812818003_0004
40.B.C. Carlson,

Numerical computation of real or complex elliptic integrals

. Numer Algorithms. 10, 13 (1995). https://doi.org/10.1007/BF02198293
Baidu ScholarGoogle Scholar
41.B.C. Carlson,

Computing elliptic integrals by duplication

. Numer Math (Heidelb). 33, 1 (1979). https://doi.org/10.1007/BF01396491
Baidu ScholarGoogle Scholar
Footnote

Jia-Ru Shi is an editorial board member for Nuclear Science and Techniques and was not involved in the editorial review, or the decision to publish this article. All authors declare that there are no competing interests.