improving the generation of random numbers in placet

23
Improving the Generation of Random Numbers in PLACET Comparision of RNG replacements Martin Blaha University of Vienna AT CERN 31.07.2013

Upload: quang

Post on 24-Feb-2016

29 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Improving the Generation of Random Numbers in PLACET

Improving the Generation of Random Numbers in PLACET

Comparision of RNG replacements

Martin BlahaUniversity of Vienna AT

CERN 31.07.2013

Page 2: Improving the Generation of Random Numbers in PLACET

Random Number Generators

Current state

37 functions to run RNGs~3 functions per RNGredundancydanger of confusion

Page 3: Improving the Generation of Random Numbers in PLACET

Random Number Generatorsrndmst5b rndm1 rndm5 rndm7 gasdev2 RANDOM_GAUSS

rndm5b rndmst2 rndmst5a rndmst8 rndmst RandomSelect

rndm5b_copy_data rndm2 rndm5a rndm8 rndm_save RndmSelect

rndmst0 rndmst3 rndmst6 expdev rndm_load gasdev8_select

rndm0 rndm3 rndm6 gasdev_0 RANDOM rndmst8_select

rndmst1 rndmst5 rndmst7 gasdev RANDOM8 rndm8_select

Page 4: Improving the Generation of Random Numbers in PLACET

new implementation

one class for RNGsuse of gsl library - up to datemore functionalityprovidence of different RNGs as "streams"

Random Number Generators

Page 5: Improving the Generation of Random Numbers in PLACET

New class

Functionalityset seeds and generatorsreset RNGsstorage of stateuniform/gaussian/discrete distributions

7 global “streams”Misalignments CavityRadiation GroundmotionInstrumentation SelectUser

Page 6: Improving the Generation of Random Numbers in PLACET

Testing Random Numbers

Problem of comparision

→ numdiff tests not working

Kolmogorov Sminorv Test76% probability for same function

→ still good idea to compare distances

Page 7: Improving the Generation of Random Numbers in PLACET

Performed Tests

1. Random Numbers from normal distribution

2. Emittance growth without correction

3. Emittance growth with simple correction

4. Beamtracking without correction

5. Beamtracking with correction

6. Radiation in beam delivery system

7. Groundmotion ATL law

8. Groundmotion Generator

Page 8: Improving the Generation of Random Numbers in PLACET

1. Random Number Generators

Comparision between old and new Placet implementation of 100 and 10 000 sorted random numbers, weight by a gaussian distribution

Page 9: Improving the Generation of Random Numbers in PLACET

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

1. Random Number Generators

Page 10: Improving the Generation of Random Numbers in PLACET

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

Page 11: Improving the Generation of Random Numbers in PLACET

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

Page 12: Improving the Generation of Random Numbers in PLACET

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

Page 13: Improving the Generation of Random Numbers in PLACET

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

Page 14: Improving the Generation of Random Numbers in PLACET

6. Radiation in Beam delivery system

Radiation is single particle effect

→ difficult to compare→ needs many particles - 30 000

Tracking and Radiation

Page 15: Improving the Generation of Random Numbers in PLACET

6. Radiation in Beam delivery system

Comparision of radiationAll distributions show distances below 1% of the total range

Page 16: Improving the Generation of Random Numbers in PLACET

6. RadiationComparision of covariance matrices

Covariance matrix of new code

Covariance matrix of old code

Page 17: Improving the Generation of Random Numbers in PLACET

6. RadiationComparision of covariance matrices

Squareroot of covariance matrix of new code

Squareroot of covariance matrix of old code

Frobenius norm:

Page 18: Improving the Generation of Random Numbers in PLACET

7. Groundmotion ATL law

Beam trackingNumbers 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

Page 19: Improving the Generation of Random Numbers in PLACET

7. Groundmotion ATL law

Beam tracking in measure station 1Numbers 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

Page 20: Improving the Generation of Random Numbers in PLACET

8. Groundmotion Generator

Beam trackingNumbers are distributed between (0,2,0.205)Distance for 100 machines 7.4e-5 <1% of the total rangeDistance for 1000 machines 1.6e-5 <1% of total range

5 timesteps, no filters, no bpm noise, no feedback

Page 21: Improving the Generation of Random Numbers in PLACET

8. Groundmotion Generator

Beam tracking in measure Station 1Numbers are distributed between (2033.65,2033.95)Distance for 100 machines 0.09174 ~30% of the total rangeDistance for 1000 machines 0.013082 ~3% of total range

5 timesteps, no filters, no bpm noise, no feedback

Page 22: Improving the Generation of Random Numbers in PLACET

8. Groundmotion Generatorfunction behaviour

Beam Tracking in Measure Station 1 Conclusion: 1000 machines are not enough

Standarddeviation for 100 machinesStandarddeviation for 1000 machines

Page 23: Improving the Generation of Random Numbers in PLACET

What has been done - Outlook# changed lines ~ 2500# removed lines ~ 900# headers and files ~ 30Testing: Results show similar behaviour

Conclusion:results are reproduceable

ready to make code parallel

new TCL implimentations allow more flexibility