Bunch shape evolution in presence of longitudinal wake potentials

Moderators: cyao, michael_borland

Post Reply
SDastan
Posts: 38
Joined: 21 May 2018, 07:08

Bunch shape evolution in presence of longitudinal wake potentials

Post by SDastan » 26 Jun 2018, 07:28

Dear all,

I intend to track the electron bunch in the longitudinal plane in the presence of wake potentials for calculating PWD. It is obvious that the bunch shape will have deviations from its initial Gaussian distribution when longitudinal wake potentials are added to the storage ring. I want to plot the bunch shape in different turns to see whether this distortion happens in the bunch distribution and how much it deviates from Gaussian form. Is there any way I could do this by ELEGANT?

Thanks in advance!
Sara

petrenko
Posts: 43
Joined: 09 Jun 2008, 02:53
Contact:

Re: Bunch shape evolution in presence of longitudinal wake potentials

Post by petrenko » 26 Jun 2018, 11:37

Dear Sara,

I did a similar tracking for the CERN SPS beam using Elegant.
movie.gif
Longitudinal dynamics
Please see the attached files for details -- I hope some of it could be useful to you.

Best regards,
/Alexey
Attachments
SPS_High_Charge_Elegant.zip
Elegant config. files and scripts
(148.14 KiB) Downloaded 247 times
Last edited by petrenko on 29 Jun 2018, 03:04, edited 1 time in total.

SDastan
Posts: 38
Joined: 21 May 2018, 07:08

Re: Bunch shape evolution in presence of longitudinal wake potentials

Post by SDastan » 28 Jun 2018, 07:50

Dear Alexey,

Thanks for your perfect, straightforward and useful response. That was what I was already seeking for. I checked the attached file for calculating I. Actually, I am a bit confused with "sddshist" and "sddsprocess" commands.

I couldn't understand how "sddshist" can calculate the frequency column. Also how can I convert a formula with "sddsprocess" (as you did for calculating I)? I had a look in sdds manuals but I couldn't find my answer.

I tried to do the same for our storage ring. Are there any points I should consider for adjusting the values of s_min, s_max and bin_size_ds?

Best Regards,
Sara

petrenko
Posts: 43
Joined: 09 Jun 2008, 02:53
Contact:

Re: Bunch shape evolution in presence of longitudinal wake potentials

Post by petrenko » 28 Jun 2018, 09:28

Dear Sara,

I'm glad my example was useful!

To understand the beam current calculation you can unfold this sequence of commands and do it step-by-step:

Code: Select all

exec \
    sddshist $w -pipe=out \
            -dataColumn=dt -sizeOfBins=[expr {$bin_size_ds/3.0e8}] -statistics \
        -lowerLimit=[expr {$s_min/3.0e8}] -upperLimit=[expr {$s_max/3.0e8}] | \
    sddsprocess -pipe \
            "-define=column,I,Charge Particles / frequency * sddshistBinSize / ,units=A" \
            "-define=column,s,dt c_mks * -1 *,units=m" | \
    sddsprocess -pipe=in $I \
        "-process=I,maximum,I_max"
sddshist w1.sdds w1_hist.sdds -dataColumn=dt -statistics
-- this command will produce the histogram of particles with respect to dt column of w1.sdds watchpoint output. You can plot it typing
sddsplot w1_hist.sdds -col=dt,frequency -split=page -sep=page
hist.png
hist.png (5.77 KiB) Viewed 4714 times
(press N or P to move between different turns saved in a separate pages of sdds file).

This is a longitudinal distribution of your beam with automatic binning. If you want to use a custom binning it can be specified in the -sizeOfBins, -lowerLimit and -upperLimit arguments of sddshist. But first it might be a good idea to use automatic binning.

To get the longitudinal position along the bunch instead of the time delay dt you need to multiply the dt by the speed of particles (i.e. 3e8 m/s). This can be done by typing
sddsprocess w1_hist.sdds "-define=column,s,dt -3e8 *,units=m" (please note that sddsprocess uses rpn notation).
"-" sign is needed because the particles with dt>0 are the particles from the beam tail and with dt<0 -- from the beam head.

In order to calculate the beam current you need to divide the beam charge in a bin by the size of the bin in seconds:
sddsprocess w1_hist.sdds "-define=column,I,Charge Particles / frequency * sddshistBinSize /,units=A"
The human-readable formula would be I = Charge*(frequency/Particles)/sddshistBinSize
Parameters Charge (bunch charge), Particles (number of macro-particles) are already in the w1.sdds file and sddshistBinSize parameter is written by the sddshist command. (frequency is the number of particles per bin).

Now sddsplot w1_hist.sdds -col=s,I -split=page -sep=page can plot the bunch current profile:
I.png
I.png (5.19 KiB) Viewed 4714 times
Best regards,
/Alexey

SDastan
Posts: 38
Joined: 21 May 2018, 07:08

Re: Bunch shape evolution in presence of longitudinal wake potentials

Post by SDastan » 02 Jul 2018, 06:42

Dear Alexey,
I really appreciate your helpful detailed answer. I totally understood the procedure. Thanks for helping me out!

Wish you the bests,
Sara

Post Reply