230 likes | 339 Views
Improving the Generation of Random Numbers in PLACET. Comparision of RNG replacements. Martin Blaha University of Vienna AT CERN 31.07.2013. Random Number Generators. Current state. 37 functions to run RNGs ~3 functions per RNG redundancy danger of confusion. Random Number Generators.
E N D
Improving the Generation of Random Numbers in PLACET Comparision of RNG replacements Martin Blaha University of Vienna AT CERN 31.07.2013
Random Number Generators Current state 37 functions to run RNGs ~3 functions per RNG redundancy danger of confusion
Random Number Generators new implementation one class for RNGs use of gsl library - up to date more functionality providence of different RNGs as "streams"
New class Functionality set seeds and generators reset RNGs storage of state uniform/gaussian/discrete distributions 7 global “streams” Misalignments Cavity Radiation Groundmotion Instrumentation Select User
Testing Random Numbers Problem of comparision → numdiff tests not working Kolmogorov Sminorv Test 76% probability for same function → still good idea to compare distances
Performed Tests • Random Numbers from normal distribution • Emittance growth without correction • Emittance growth with simple correction • Beamtracking without correction • Beamtracking with correction • Radiation in beam delivery system • Groundmotion ATL law • Groundmotion Generator
1. Random Number Generators Comparision between old and new Placet implementation of 100 and 10 000 sorted random numbers, weight by a gaussian distribution
1. Random Number Generators Distance betwee the random number functions and close up for the first 3500 numbers (2 different tests) Numbers are distributed between +/- 4 Distance for 1000 samples 0.04 <1% of the total range
2. Emittance growth - no correction Comparision of emittance growth without correction Numbers are distributed between (0,7e6) Distance for 3500 samples 1.823e4 <1% of the total range
3. Emittance growth - simple correction Comparision of emittance growth with correction Numbers are distributed between (0,13) Distance for 3500 samples 0.039 <1% of the total range
4. Beamtracking - no correction Comparision of emittance without correction Numbers are distributed between (0,7e5) Distance for 3500 samples 1500,3 <1% of the total range
5. Beamtracking - simple correction Comparision of emittance with correction Numbers are distributed between (0,3) Distance for 3500 samples 0.031 ~1% of the total range
6. Radiation in Beam delivery system Radiation is single particle effect → difficult to compare → needs many particles - 30 000 Tracking and Radiation
6. Radiation in Beam delivery system Comparision of radiation All distributions show distances below 1% of the total range
6. Radiation Comparision of covariance matrices Covariance matrix of new code Covariance matrix of old code
6. Radiation Comparision of covariance matrices Squareroot of covariance matrix of new code Squareroot of covariance matrix of old code Frobenius norm:
Beam tracking Numbers are distributed between (0.2,0.2002) Distance for 100 machines 2.49e-6 ~1% of the total range 5 timesteps, no filters, no bpm noise, no feedback 7. Groundmotion ATL law
7. Groundmotion ATL law Beam tracking in measure station 1 Numbers are distributed between (2033.12,2033.14) Distance for 100 machines 0.001 ~5% of the total range 5 timesteps, no filters, no bpm noise, no feedback
8. Groundmotion Generator Beam tracking Numbers are distributed between (0,2,0.205) Distance for 100 machines 7.4e-5 <1% of the total range Distance for 1000 machines 1.6e-5 <1% of total range 5 timesteps, no filters, no bpm noise, no feedback
8. Groundmotion Generator Beam tracking in measure Station 1 Numbers are distributed between (2033.65,2033.95) Distance for 100 machines 0.09174 ~30% of the total range Distance for 1000 machines 0.013082 ~3% of total range 5 timesteps, no filters, no bpm noise, no feedback
8. Groundmotion Generator function behaviour Beam Tracking in Measure Station 1 Conclusion: 1000 machines are not enough Standarddeviation for 100 machines Standarddeviation for 1000 machines
What has been done - Outlook # changed lines ~ 2500 # removed lines ~ 900 # headers and files ~ 30 Testing: Results show similar behaviour Conclusion: results are reproduceable ready to make code parallel new TCL implimentations allow more flexibility