Oleg Zabluda's blog
Wednesday, April 18, 2018
 
Javascript Geiger Counter simulator | Poisson/Exponential distribution
Javascript Geiger Counter simulator | Poisson/Exponential distribution

Works for λ<10 (CPM<600), which is a safe radiation level, because then the probability of overlapping 1ms clicks is 1 − exp(−λ*1ms) = 0.01

"""
var snd = new Audio("data:audio/wav;base64,UklGRnwAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YVgAAAAAAEsAKQFlAooD+wMhA5cAZvwY98rx/+1r7Y/xZ/sUC7wfgTfIT5NlBXbcftx+BXaTZchPgTe8HxQLZ/uP8Wvt/+3K8Rj3ZvyXACED+wOKA2UCKQFLAAAA");
var lambda = 10; // Produces lambda events per second.
function tick()
{
var next = -Math.log(1 - Math.random()) / lambda;
setTimeout(function() {tick()}, next*1000);
snd.play();
}
tick()
"""
http://js.do/code/geigercountersimulator
https://js.do/code/210071

https://js.do/code/210071

Labels:


| |

Home

Powered by Blogger