/ Published in: Python
A simple algorithm for counting particles emitted by radio active matter assumed to be described by a Poisson process
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# -*- coding: utf-8 -*- """ Created on Sun Aug 10 16:27:16 2014 @author: Anish """ #Spyder Editor # Importing libraries import os os.system('cls') import numpy as np import matplotlib.pyplot as plt #clf() Nlim = 100 a = 1 b = 2 l = 10 x = 0 s = np.random.poisson(l, 1) plt.plot(x,s,'-r') plt.show() # redraw the canvas plt.xlabel('Time Lapsed (ms)') plt.ylabel('Particle Counts') # for loop for recursive plotting of poisson process while x < Nlim: x = x+1 s = np.random.poisson(l, 1) plt.plot(x,s,'or') plt.show() # redraw the canvas pause(.2)
URL: Poisson Process: Counting