Wednesday, January 12, 2011

Recentering fixed

I have modified my code that generates the density plots.  Whereas before, the scheme was

1) Bin up so that there are N particles per bin
2) Compute the density
3) Find the position of the density maximum
4) shift all the particle positions so that the density maximum is at x=0
5) Bin up again with N particles per bin
6) Compute the density and plot

This worked relatively well for the runs where the particles began in an equally spaced configuration, but once I started the initial conditions with a power law, suddenly a much higher fraction of the particles wind up in the middle, but the offset from 0 was a similar magnitude as the equally spaced case.  Therefore, for the power law runs, when I got to step 5, sometimes with the new binning, the density maximum was again off-shifted from zero by some number of bins.  I have solved this issue by iterating the process until the shift is at most only one bin, then I stop.   Here are the plots for the warm runs, I think they are significantly improved, and I am also relieved to see the appearance of the flattening in the center of the -0.8 run.  I am somewhat surprised that it did not show up in the center of the -0.5 run.


I think it is advisable to remake several of the key plots using the new algorithm, even for the runs that were of constant initial density.  I will do so, and post them in the next post.

No comments:

Post a Comment