n_bins in WAKE element

Moderators: cyao, michael_borland

Post Reply
Posts: 14
Joined: 01 Mar 2018, 08:20

n_bins in WAKE element

Post by WEI-HOU » 22 Jul 2020, 16:24


I am working on the simulation of a beam passing through waveguides, where the effect of wakefield is modeled using WAKE element.
My distribution is generated from a well-order grid, where I carefully put required number of particles in each bin to avoid unwanted noises, as shown below
Annotation 2020-07-22 160753.jpg
Depending on the number of bins, the histogram can be drastically different than its true histogram, as shown below
Annotation 2020-07-22 160713.jpg
Since it is recommended to set n_bins=0 for WAKE element, is there a way that I can check the exact number of bins used in ELEGANT during the simulation ?
I would like to check if ELEGANT uses improper number of bins during the simulation.


Philippe Piot
Posts: 79
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory

Re: n_bins in WAKE element

Post by Philippe Piot » 29 Jul 2020, 11:24

To further comment on Wei Hou's post, is there a way to dump the binned current distribution being used by ELEGANT in the wakefield calculation? Such a feature would be very helpful to have especially when the number of bins is automatically set by ELEGANT. This would also give an idea of how the filter affects the distribution (I think such a feature is available in the CSR calculations). Thank you, -- Philippe.

Posts: 1811
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory

Re: n_bins in WAKE element

Post by michael_borland » 06 Oct 2020, 14:33

Output of the binned distributions is not available for the WAKE element. The number of bins used is Floor[(tmax-tmax)/dt + 3], where tmax (tmin) is the maximum (minimum) value of the t coordinate, and dt is the interval between time points in the wake input file. If your wake time spacing is small compared to the typical spacing of particles in time, you may well get some noisy results.

One way to reduce noise in the distributions is to use a Halton sequence to rather than random numbers. This also provides more random-looking distribution that simpler deterministic methods of filling in the coordinates. The program sddssampledist allows sampling arbitrary distributions using Halton sequences. Combined with sddsmatchtwiss, it allows making fairly general beam distributions.


Post Reply