Possible low-pass filter
Moderators: cyao, michael_borland
-
headdoggy64
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Possible low-pass filter
Dear all elegant users,
Are there any low-pass density modulation filters built in elegant lattice element DRIFT and/or distribution generation routine?
Thanks,
Alex
Are there any low-pass density modulation filters built in elegant lattice element DRIFT and/or distribution generation routine?
Thanks,
Alex
-
michael_borland
- Posts: 2030
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Possible low-pass filter
Alex,
No, this has to be done ahead of time. There's a script called smoothDist6 that does it.
--Michael
No, this has to be done ahead of time. There's a script called smoothDist6 that does it.
--Michael
-
headdoggy64
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Possible low-pass filter
Thanks, Michael!
I meant a different thing. If I compute bunching factor and plot it versus energy, I persistently see a cut-off at a given frequency (see attached). This exists with both LSC on and off and also does not change for different bunch parameters. To me it looks like there is a limiting low-pass filter of some sort or round-off issue. By the way, does elegant use full 64-bit double precision everywhere? Can you please comment on this?
Here is the script I am using to generate data file for the plot attached.
Thank you for your time!
Output format: log(w) | beta*gamma | n(w).
Then all output files are combined together and plotted in gnuplot.
I meant a different thing. If I compute bunching factor and plot it versus energy, I persistently see a cut-off at a given frequency (see attached). This exists with both LSC on and off and also does not change for different bunch parameters. To me it looks like there is a limiting low-pass filter of some sort or round-off issue. By the way, does elegant use full 64-bit double precision everywhere? Can you please comment on this?
Here is the script I am using to generate data file for the plot attached.
Thank you for your time!
Code: Select all
#!/usr/bin/tclsh
set i 14
set input [lindex $argv 0]
set output [lindex $argv 1]
exec rm -rf $output
while {$i < 16} {
for {set j 1} {$j < 100} {incr j} {
set logw [ expr $i + log10($j/10.0)];
exec echo -n $logw >> $output
exec echo -n " " >> $output
set pcentral [exec sddsprintout $input -par=pCentral -noLabel -notitle -formatDefaults=double=%16.16e | grep .]
exec echo -n $pcentral >> $output
exec echo -n " " >> $output
set w [ expr $j/10.0*pow(10,$i)];
exec sddsprocess $input -pipe=out "-redef=parameter,omega,$w" "-redef=col,CosWt,omega t * cos n_rows /" "-redef=col,SinWt,omega t * sin n_rows /" "-process=CosWt,sum,ReB" "-process=SinWt,sum,ImB" "-redef=par,bfactor,ReB ReB * ImB ImB * +" | sddsprintout -pipe -parameter=bfactor -noTitle -nolabel -formatDefaults=double=%16.16e >> $output | grep .
}
incr i
}
Then all output files are combined together and plotted in gnuplot.
-
headdoggy64
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Possible low-pass filter
I made another scan for higher beta*gamma values to further illustrate the issue.
-
michael_borland
- Posts: 2030
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Possible low-pass filter
Alex,
I'm looking into this but might not get back to you for a week because of travel.
--Michael
I'm looking into this but might not get back to you for a week because of travel.
--Michael
-
headdoggy64
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Possible low-pass filter
Thanks, Michael!
I have been struggling with this for a long time and your help will be very appreciated.
Alex
I have been struggling with this for a long time and your help will be very appreciated.
Alex
-
michael_borland
- Posts: 2030
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Possible low-pass filter
Alex,
I'm looking at it today. While elegant does all computations in double-precision floating point, the random number generator is limited to 48 bits. Whether that affects the results I don't know. Hope to have more later today.
--Michael
I'm looking at it today. While elegant does all computations in double-precision floating point, the random number generator is limited to 48 bits. Whether that affects the results I don't know. Hope to have more later today.
--Michael
-
michael_borland
- Posts: 2030
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Possible low-pass filter
Alex,
I've done simulations with various numbers of particles, just taking the t coordinates from the bunched_beam command without any tracking. The bunching factor gets noisy above a certain frequency, which increases slowly as the number of particles increases. Better results are obtained using Halton sequences (i.e., "quiet start").
Here's my result when I use the random number generator Here's my result when I use Halton sequences I'm uncertain still if the cause of the problem is the use of 48-bit random numbers. I'd need to implement a new set of random number generators to test this.
--Michael
I've done simulations with various numbers of particles, just taking the t coordinates from the bunched_beam command without any tracking. The bunching factor gets noisy above a certain frequency, which increases slowly as the number of particles increases. Better results are obtained using Halton sequences (i.e., "quiet start").
Here's my result when I use the random number generator Here's my result when I use Halton sequences I'm uncertain still if the cause of the problem is the use of 48-bit random numbers. I'd need to implement a new set of random number generators to test this.
--Michael
-
headdoggy64
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Possible low-pass filter
Michael,
Thanks for the reply!
I included these lines in my bunched_beam section
and ran the same configuration again. I am still running into the issue.
Can this come from the implementation of the longitudinal space-charge algorithm?
Is the wavenumber k in the impedance Z(k) limited from above by some large value?
Thanks for your help!
P.S. The plot represents the bunching factor n(w). Y-axis is beta*gamma and X-axis is log w.
Thanks for the reply!
I included these lines in my bunched_beam section
Code: Select all
halton_sequence[0] = 1,
halton_sequence[1] = 1,
halton_sequence[2] = 1,
Can this come from the implementation of the longitudinal space-charge algorithm?
Is the wavenumber k in the impedance Z(k) limited from above by some large value?
Thanks for your help!
P.S. The plot represents the bunching factor n(w). Y-axis is beta*gamma and X-axis is log w.
-
michael_borland
- Posts: 2030
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Possible low-pass filter
Alex,
I think you need to give a few more parameters for the Halton sequence to work. I suggest adding
This isn't going to cure the problem but may extend the smooth region of the spectrum out to slightly higher frequencies.
--Michael
I think you need to give a few more parameters for the Halton sequence to work. I suggest adding
Code: Select all
symmetrize = 0,
enforce_rms_values[2] = 0
halton_sequence[2] = 1,
halton_radix[4] = 2,3
optimized_halton = 1
--Michael