340 likes | 475 Views
Everyday Statistics in Monte Carlo Shielding Calculations. One Key Statistics: ERROR, and why it can’t tell the whole story Biased Sampling vs. Random Sampling. What is a Monte Carlo Calculation?.
E N D
Everyday Statistics in Monte Carlo Shielding Calculations • One Key Statistics: ERROR, and why it can’t tell the whole story • Biased Sampling vs. Random Sampling
What is a Monte Carlo Calculation? • Monte Carlo methods are a class of computational algorithms that rely on repeated random sampling to compute their results.
Warning Monte Carlo Statistics will help us with answer how precisely we answered our question, but not how accurate our model is.
Bottom Line in an MCNP output tally 2 nps mean error vov slope fom 512000 9.7768E-04 0.0010 0.0002 1.5 519843 nps = number of starting particles run mean = result of the tally error = standard deviation / mean vov = variance of the variance slope = Pareto slope of the history score probability density function fom = figure of merit
MCNP Details • MCNP = Monte Carlo N-Particle Code, developed at Los Alamos National Laboratory since the 1940’s • Actual MCNP outputs contain a lot of detailed data.
Example Monte Carlo (Not MCNP) Run Sampling photons from Am-241 There are 153 photons Sample strategy – random number from 1 to 153 identifies the photon A weighting factor (a very important statistic) is used to adjust for probabilities of these photons, the lowest at 5.5E-10.
Example Monte Carlo (Not MCNP) Run • This is biased sampling because each photon is sampled uniformly, without regard to its probability.
Example Pseudocode Assign a starting value for “dose.” Start a loop. Select a random integer from 1 to 153. Use the random number to select one of the photons. Multiply the photon by its weight. Add this sum to: current dose estimate * number of previous runs. Divide this by the number of current runs. End loop
MCNP includes a lot of operations, such as: • Start a source particle (energy, direction); • Find the distance to the next boundary, cross the surface and enter the next cell; • Find the total photon cross section and process photon collisions producing electrons as appropriate; • Follow electron tracks; • Process tallies.
In our demo, we are only going to: • Start a source particle. • Process tallies.
Example Run -> Switch to live R presentation <- The following slides are samples of the live presentation.
In a well-behaved Monte Carlo run, expect the error to decrease as the square of the number of samples increases. For example to divide error by 2, multiply samples by 4.
Time to Evaluate the Sampling Bias • Did it help or hurt our statistics to bias the sampling? • In the slides that follow, we compare unbiased sampling to biased sampling for two cases.
Comparison to an MCNP run • Simple Model: point source in vacuum. • Tally at a sphere in vacuum. • This is very much like our R model. • Later, we add a twist: a steel shield.
For the Simple Case… • The random sample looks good. All statistical checks were passed. • But if you look at the output in detail… • Many of the low probability particles were not sampled at all. • We ran 10,000,000 particles, but that wasn’t enough to ensure we sampled all the particles.
Summary Statistics Biased Mean error vov slope fom 9.97E-06 0.0028 0.0001 10 3768 Unbiased Mean error vov slope fom 9.92E-06 0.053 0.0079 10 12
Conclusions • How you sample makes a difference. But it depends on the problem what the preferred sampling will be. • MCNP Summary Statistics are a helpful guide, but they do not tell the whole story.