Chapter 9:Particle in a Central Force Field

Exampleno:3,Page no:244

In [13]:
#Variable declaration
a0=1
r0=0 

#Calculation
from scipy.integrate import quad
import math
#calculation
def f(r):
    w_100=math.sqrt(1.0/(math.pi*a0**3))*math.exp(-r/a0)
    return((w_100**2)*4*math.pi*(r**2))
P=4*quad(f,r0,a0) 

#Result
print"\n Probability =",round(P[0] ,2)
 Probability = 0.32