space charge simulation in rings

Moderators: cyao, michael_borland

li.chao
Posts: 55
Joined: 18 Aug 2021, 08:59

space charge simulation in rings

Post by li.chao » 05 Nov 2025, 12:02

Dear Michael,

I am studying space-charge effects in rings and would appreciate your advice on a surprising result from an element-by-element tracking test.

I attached the input file that shows how I set up the simulation. In the run I apply a space-charge kick at every quadrupole (element-by-element tracking). For the test I used a flat beam with horizontal emittance emitx=20 pm, and vertical emittance emity=2 pm. I therefore expected stronger emittance growth in the vertical plane.

With a bunch charge of 7.6 nC the attached figure shows the result: contrary to my expectation, the horizontal emittance starts to increase first and more rapidly.
sc_res.png
sc_res.png (6.01 KiB) Viewed 662 times
Could you please help me check what might cause this behaviour?

Yours Chao
Attachments
elegant_space_charge.zip
(500.14 KiB) Downloaded 20 times

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 12 Nov 2025, 18:29

Chao,

I see that the emittance initially increases, then goes down. Can you check to see if particles are lost from the simulation?

--Michael

li.chao
Posts: 55
Joined: 18 Aug 2021, 08:59

Re: space charge simulation in rings

Post by li.chao » 13 Nov 2025, 07:55

Dear Michael,

Many thanks for your reply. I checked the data of transmission in this simulation, and there is no particle loss.

Meanwhile, I did a simple scan on beam current from 0.1 mA to 1mA, the results is shown below
elegant_currScan.png
There are two groups of curves, each including 10 (0.1 mA to 1 mA with a 0.1 mA scan step).
The group with an initial growth corresponds to x-plane.

Even in 0.1 mA beam current, there exits initial emittance growth in the x plane
It seems like the initial emittance growth comes from somewhere else rather than the space-charge kicks.

Could you please confirm this and help me figure out where it comes from?

Many thanks.

Yours Chao

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 13 Nov 2025, 10:27

Chao,

The problem is that the beam is not matched to the lattice at the injection point. You can fix this with

Code: Select all

sddsmatchtwiss train.sdds rematched.sdds -xplane=filename=lattice.twi -yplane=filename=lattice.twi
mv train.sdds old-train.sdds
mv rematched.sdds train.sdds
where "lattice.twi" is a file with the twiss parameters computed for the full ring.

When I do this, I don't see the emittance jump at the beginning.

--Michael

li.chao
Posts: 55
Joined: 18 Aug 2021, 08:59

Re: space charge simulation in rings

Post by li.chao » 14 Nov 2025, 10:36

Dear Michael,

Thank you for your quick reply. I understand now that when space-charge effects are included in the simulation, and one is interested in the emittance evolution over the tracking turns before reaching the final equilibrium state, it is essential that the initial beam be matched to the lattice.

To gain a better understanding of the results that include space charge, I performed an additional benchmarking simulation. For this purpose, I used an unphysical one-turn linear ILMatrix to represent the lattice. The Elegant setup file is attached for your reference. In this simulation, both radiation damping and excitation are included.

The figure below shows a comparison between Elegant and my code. In our space-charge solver, the kicks are computed using a bin-based method: the bunch is longitudinally divided into many bins, and within each bin the Bassetti–Erskine formula is used to compute the transverse space-charge kick for each particle.
elegant_cetasim_para.png
As you can see, in the vertical plane around 5k turns, the tracking shows an emittance increase with a “noise-like” pattern caused by halo particles. The particle distribution at 5k turns is shown below:
elegant_cetasim_cord.png
These halo particles persist, or regenerated, in the subsequent turns.

Could you please take a moment to check this behavior again? I am trying to understand why, in my simulation, halo-induced emittance noise appears around 5k turns, and why—given that my lattice is essentially a linear map—these halo particles are not damped out in later turns.

Many thanks for your help.

Best regards,
Chao
Attachments
elegant_space_charge_ilmatrix.zip
(5.95 KiB) Downloaded 2 times

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 14 Nov 2025, 10:55

Chao,

I'm running some tests now. I wonder if you using the latest version of elegant. In version 2025.2 we fixed several bugs related to space charge. In addition, we added longitudinal slicing.

--Michael

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 14 Nov 2025, 11:09

Chao,

Here's what I get. No sign of the "noisy" behavior. I think this was a result of the above-mentioned bug in the older versions of the code.
spaceChargeResults.png
--Michael

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 14 Nov 2025, 16:34

Chao,

This plot compares results with and without space charge, using 1ps longitudinal slices. Seems that space charge has a significant impact on the vertical plane.

Since the runs don't take much time, I increased the number of particles to 10 million, but it's excessive.
comparison.png
--Michael

li.chao
Posts: 55
Joined: 18 Aug 2021, 08:59

Re: space charge simulation in rings

Post by li.chao » 14 Nov 2025, 17:56

Dear Michael.

I have checked the results from the new version of elegant, the results are shown here
elegant_cetasim_para.png
particle coordinates at the 5K turn.
elegant_cetasim_cord.png
After enough damping time, these two solvers show good agreement. Although there still exist discrepancies in the emittance curve in the first 1K turns, especially in the horizontal plane. I guess this could be from bin method applied in my space charge solver and "nonlinear" method applied in Elegnat. Do you agree ?

By the way, I also tested the solver with 2.5D particle-in-cell method. beam is cut in bins and in each bin, the 2D PIC is applied to get the transverse space charge kick. With this simple case, the PIC method and Bassetti–Erskine method agrees.


One more thing, in the particle_tune namelist.
-----
segment_length— The length of the segment for tune analysis. A tune value is produced for every segment_length turns
-----
Tracking 10000K turns and set segment_length=1000, then 10 pages of data will be generated. How are particle tunes calculated in each page?

At this moment, I calculate the accumulated phase advance in the eigen-frame along tracking turns. Then tunes can be found from there.
What is the method used in elegnat?



Yours Chao

michael_borland
Posts: 2030
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: space charge simulation in rings

Post by michael_borland » 14 Nov 2025, 18:31

Chao,

The "nonlinear" method in elegant is just Bassetti-Erskine, which I think is what you are using as well. The linear method is just the linear term of B-E.

You can use longitudinal slicing in elegant for comparison with your code, since it does that as well.

The particle_tune command uses NAFF to determine the tunes, separately for x and y. It isn't finding the normal mode frequencies, so for strongly coupled systems it might be misleading. It implicitly assumes that there is enough noise to drive some betatron oscillations.

I've found it informative even for our ring, which is run on the coupling resonance. For example, I can see how the depression of the vertical tune moves the beam off the resonance, resulting in *smaller* vertical emittance.

--Michael

Post Reply