• Keine Ergebnisse gefunden

Benchmarking results Symplecticity errorsSymplecticity errors

Space charge codes

3.3 Symplecticity checks

3.3.3 Benchmarking results Symplecticity errorsSymplecticity errors

Before we are going to benchmark the codes on our test ring, let us address the question about which of the codes we can regard as ’symplectic’, in the sense that its approximated derivative, given by one of the methods in the previous subsection, has an error which is so small that the no-space charge case leads to a similar error.

For this purpose we considered the case of a basic FODO cell having just 4 space charge nodes. Table 3.3summarizes our findings: It shows that the symplecticity error with respect to 16 macroparticles is nearly the same for the Bassetti-Erskine model and the plain tracking. On the other hand, we see a rather significant error for the 2.5D case, which means that the code can hardly be symplec-tic. Note that we were working in ’ordinary’ phase space, in which the proportions of the spatial and the momentum are different. For this reason we used two different families of step sizes: one for the spatial directions and one for the momentum directions of the canonical coordinates (here ϵq = 4·10−4,ϵp = 1·10−5).

We will now turn to our model of a 1km ring with several space charge nodes. First we switched off space charge. In this case we found, again by using 16 macroparticles, a deviation of |R2D|= 8.9790·10−5 for the 2D-fit method and a deviation of |RN D|= 3·10−4 in case of the ND-method, so the 2D-fit method gives slightly better results. In case of pure MAD-X tracking, we obtained for both modes |R2D| = 2.4907·10−6 and |RND| = 3.0440·10−6 respectively, so both methods have almost the same precision here. As we expect PyOrbit to have the same performance than MAD-X in regards of pure tracking, we conclude that it was worthwhile to introduce the 2D-fit method. Fig. 3.13shows a typical example of the error matrixR2D obtained with PyOrbit for the case without space charge, by using the 2D-fit method.

If we switch on space charge, the situation will change: Fig. 3.14 shows fits for both methods for pairs of directions in which the residuals (the entries ofR) towards symplecticity were largest,

3.3. Symplecticity checks 89

Figure 3.13: Visualization of the individual entries belonging toR2D, by tracking around the 1km ring using PyOrbit without space charge, as described in the main text. Since we were using 16 macroparticles, we have 96×96 entries, where the horizontal and vertical axis are given with respect to the ordering

(x1, y1, z1, x2, y2, z2,· · ·, px,1, py,1, pz,1, px,2, py,2, pz,2· · ·). The enumeration of the components start at zero. Red areas indicate regions with large error towards symplecticity.

and by which we were able to check if the step sizes were chosen appropriately. As before, we have used 16 macroparticles, the 2.5D space charge solver and K = 5 different values to determine the slopes at the midpoint. The outcome of the corresponding symplecticity checks with space charge

Figure 3.14: Principle of the fit methods with respect to the 1km test ring in the 2.5D case. Left: Third-order fit of the ND method to obtain the derivative at specific bunch coordinates. Shown here is the outcome if varying component 17 in direction 90, which translates to looking at the finaly-component of particle 6 if varying the initialpz-component of particle 14. Right: 2D-fit method which fits a polynomial of the form p0+pijϵϵ˜ to the given 2D grid of data points from the code, here shown with respect to the (i, j) = (92,89)-plane. The vectorsvj correspond to the directional vectors µbj described in the main text (for varyingµZ), hence the fit coefficientpij provides an approximation of the valueM(x)vi, M(x)vjJ. are shown in Fig. 3.15for the analytical- and the 2.5D solver.

Emittance growth in the sandbox model

While starting some tracking simulations for 104 turns, we observed that our sandbox ring mimics roughly the behavior of the ’large scale’ scenario, if parameters are adjusted properly. This means

Figure 3.15: Left: Bassetti-Erskine model with|R2D|= 0.0118. Right: 2.5D solver with|R2D|= 0.14461. Both symplecticity residuals have grid sizes of 96×96, belonging to 16 particles. The ordering of the axis were described in Fig. 3.13.

Number of particles |RN D| |R2D|

8 3.1370 1.4629

12 0.8866 0.4711

16 0.3293 0.1950

20 0.2100 0.1063

24 0.1673 0.0877

Table 3.4: Mean values of initial error matrices with space charge.

that the growth in the mean of the horizontal and vertical emittances increases as in the large-scale case, and slows down when adding more particles.

However there is also a drawback: Namely, a small number of macroparticles leads to a larger fluctuation of the outcome in dependence on the initially generated distributions. This means that we had to perform tracking experiments repetitively for different start-seeds to improve the relia-bility of the results. This was especially the case for particle numbers below approximately 25.

Our first goal was to determine, in dependency of randomly chosen initial coordinates, a possible correlation between the symplecticity error and the number of macroparticles. The result can be found in Tab. 3.4. As one can see from this table, the error reduces by adding more macroparticles.

Furthermore, we were looking at how the error in symplecticity evolves with the number of turns.

Our results are summarized in Figure3.16, in which we were tracking a system of particles over 104 turns in the 2.5D case. The green curves depict the general evolution of the transverse emittances.

At every 500 turns we wrote the coordinates of the beam to a file and determined the error of the derivative of the ’one-turn map’ at the current point (i.e. beam) towards symplecticity (blue curves). The straight lines indicate regression fits of the green and blue data points, respectively.

These benchmarking results indicate that there might be a correlation between the slopes of the emittance growth and the symplecticity errors. Our current explanation is that the more the parti-cles are spread out in phase space, the less interaction happens in between them, and so over time the reference point start to move more and more into (symplectic) single-particle tracking. In Fig.

3.17we have plotted the slopes against each other, using 95% confidence intervals of the regression

3.3. Symplecticity checks 91

Figure 3.16: Clockwise from top left: Mean emittance growth with 8, 12, 20 and 16 particles in the 2.5D case. The quantity (green)ϵ2x+ϵ2y on the left-hand axis is motivated in Example II.13, Ref. [Tit19]. The right-hand axis shows the momentary error towards symplecticity (blue) which decreases in the course of the tracking, whereas the emittance grows. The orange and brown lines indicate first-order regression fits.

fits as error bars.

Figure 3.17: Slopes of the regression fits of Fig. 3.16, namely those related to ϵ2x+ϵ2y, versus those of the respective symplecticity-error regression fits, all with respect to the 2D-fit method. The data indicates that larger growth rates of the emittances come along with a trend towards symplecticity.

Overall we conclude that, by using numeric differentiation methods, we were able to obtain indi-cations regarding the symplectic – respectively – non-symplectic nature of two of our space charge

solvers. The 2.5D solver seems to be non-symplectic, while the analytical solver has a much better performance. If we assume that the resolution of the symplecticity check is sufficient in case of the FODO cell, then the analytic model seems to be fairly symplectic, see Tab. 3.3. However, there might still be some small deviations, for example a possible non-symplectic treatment in regards of the longitudinal coordinate, because the kick-strengths are weighted with respect to the line charge density. Furthermore we found numeric indication of correlations between the error towards symplecticity of the 2.5D ring-map and the emittance evolution of the beam.

3.4 Performance

In this section we are addressing two questions. i) What is the emittance evolution of the two PIC codes in a long-term tracking scenario in dependency on the number of macroparticles and grid sizes? ii) what is their performance in regards of required CPU time in dependency on these two parameters?