Chapter2:X-RAY DIFFRACTION

Eg1:pg-70

In [3]:
import math
V=25*10**3     #potential difference in Volt
h=6.63*10**-34 #planck constant in joule-sec
c=3*10**8      #speed of light in m/sec
e=1.6*10**-19  #charge of electron in coulomb
theta=math.radians(15.8) #glancing angle for NaCl crystal for CuKa line
d=2.82         #for NaCl
lamda=2*d*math.sin(theta) 
print "wavelength of CuKa line=",round(lamda,4),"Angstrom"
lamda_min=(h*c/(e*V))*10**10
print "wavelength of X-Ray photon at shortest limit=",round(lamda_min,4),"Angstrom"
theta_1=math.degrees(math.asin(lamda_min/(2*d)))
print "glancing angle for photons at the shortest wavelength limit=",round(theta_1,2),"degree"
wavelength of CuKa line= 1.5357 Angstrom
wavelength of X-Ray photon at shortest limit= 0.4972 Angstrom
glancing angle for photons at the shortest wavelength limit= 5.06 degree

Eg2:pg-70

In [5]:
import math
theta=math.radians(30) #glancing angle in radians
d=1.87            #spacing between lattice planes in angstrom
n=2               #for second order reflection
lamda=2*d*math.sin(theta)/n
print "wavelength of X-Rays=",lamda,"Angstrom"
wavelength of X-Rays= 0.935 Angstrom

Eg3:pg-70

In [8]:
import math
lamda=0.36*10**-8 #wavelength in cm
theta=math.radians(4.8)#glancing angle in radians
n=1               #for first order diffraction
d=n*lamda/(2*math.sin(theta))
print "interplanar separation of atomic planes in crystal=","{:.2e}".format(d),"cm"
interplanar separation of atomic planes in crystal= 2.15e-08 cm

Eg4:pg-71

In [9]:
import math
lamda=2.6*10**-10  #wavelength in meter
theta=math.radians(20)  #in radians
n=2                #for second order diffraction
d=n*lamda/(2*math.sin(theta))
print "spacing constant of the crystal=",round(d*10**10,2),"Angstrom"
spacing constant of the crystal= 7.6 Angstrom

Eg5:pg-71

In [10]:
import math
d=2.82*10**-10  #spacing in meter
n=2             #for second order
sin_theta=1     #maximum value of sin(theta)
lamda_max=2*d*sin_theta/n
print "longest wavelength=",lamda_max*10**10,"Angstrom"
longest wavelength= 2.82 Angstrom

Eg6:pg-71

In [11]:
import math
lamda=0.842   #wavelength in angstrom
theta_1=8+(35./60)  #1' = (1/60)º = 0.01666667º
theta_3=math.asin(round(3*math.sin(math.radians(theta_1)),2))
print "glancing angle for 3rd order reflection=",round(math.degrees(theta_3),1),"degree"
glancing angle for 3rd order reflection= 26.7 degree

Eg7:pg-71

In [14]:
import math
lamda=0.97        #wavelength of first X-ray beam in angstrom
theta=math.radians(60) #angle of reflection in radians
n=3               #for third order reflection
d=n*lamda/(2*math.sin(theta))
n_1=1             #for first order reflection
theta_1=math.radians(30) #angle of reflection in radians
lamda_1=2*d*math.sin(theta_1)
print "wavelength of the second X-ray beam=",round(lamda_1,2),"Angstrom"
wavelength of the second X-ray beam= 1.68 Angstrom

Eg8:pg-72

In [15]:
import math 
lamda=0.30    #wavelength in angstrom
d=0.5         #lattice spacing in angstrom
n=2           #for second order diffraction
theta=math.asin(n*lamda/(2*d))
print "For second order maxima, angle=",round(math.degrees(theta),2),"degree"
n=3           #for third order diffraction
theta=math.asin(n*lamda/(2*d))
print "For third order maxima, angle=",round(math.degrees(theta),2),"degree"
For second order maxima, angle= 36.87 degree
For third order maxima, angle= 64.16 degree

Eg9:pg-72

In [17]:
import math
d=2.82*10**-8    #lattice spacing in cm 
c=3*10**10       #speed of light in cm/sec
e=1.6*10**-19    #charge on electron in coulomb
v=9045           #voltage in volt
theta=math.radians(14)#angle in radians
n=1              #first order
lamda=2*d*math.sin(theta)/n
h=(e*v*lamda/c)*10**7  #since 1 joule=10**7 erg
print "h=","{:.2e}".format(h),"erg-sec"
h= 6.58e-27 erg-sec

Eg10:pg-72

In [18]:
import math
do=2.82       #lattice spacing in angstrom
theta=math.radians(10) #angle in radians
lamda=2*do*round(math.sin(theta),4)
print "wavelength=",round(lamda,4),"Angstrom"
wavelength= 0.9791 Angstrom

Eg11:pg-72

In [20]:
import math
d=0.4086*10**-10  #lattice spacing in meter
h=6.6*10**-34     #planck constant in joule-sec
m=9.1*10**-31     #mass of electron in Kg
n=1               #first order
theta=math.radians(65) #glancing angle in radians
lamda=2*d*math.sin(theta)/n
print "wavelength=","{:.3e}".format(lamda),"m"
v=h/(m*lamda)
print "velocity of electron=","{:.3e}".format(v),"m/sec"
wavelength= 7.406e-11 m
velocity of electron= 9.793e+06 m/sec

Eg12:pg-73

In [22]:
import math
h=6.62*10**-34  #planck constant in joule-sec
e=1.6*10**-19   #charge on electron in coulomb
m=9*10**-31     #mass of electron in Kg
v=344           #voltage in volt
n=1             #first order
theta=math.radians(60)#glancing angle in radians
lamda=h/math.sqrt(2*m*e*v)
d=n*lamda/(2*math.sin(theta))
print "spacing of the crystal=",round(d*10**10,2),"Angstrom"
spacing of the crystal= 0.38 Angstrom

Eg13:pg-73

In [24]:
import math 
#given that
lamda=1.32*10**-10    #wavelength in meter
theta_deg=9           #angle fraction in degree
theta_min=30          #angle fraction in minute
theta =theta_deg+(theta_min/60.) # Total angle
for n in range(1,5):
    d = lamda/(n*2*math.sin(theta*math.pi/180)) # Inter layer spacing
    print "If order is %d then spacing is"%(n),"{:.2e}".format(d),"meter"
If order is 1 then spacing is 4.00e-10 meter
If order is 2 then spacing is 2.00e-10 meter
If order is 3 then spacing is 1.33e-10 meter
If order is 4 then spacing is 1.00e-10 meter

Eg14:pg-74

In [25]:
import math 
# given that
theta1_deg = 5 # Absolut degree part of angle for first angle
theta1_min = 23# remainder minute part of angle for first angle
theta2_deg = 7 # Absolut degree part of angle for second angle
theta2_min = 37# remainder minute part of angle for second angle
theta3_deg = 9 # Absolut degree part of angle for third angle
theta3_min = 22# remainder minute part of angle for third angle

val1 = math.sin((theta1_deg+ theta1_min/60.)*math.pi/180)# Sin value for first angle
val2 = math.sin((theta2_deg+ theta2_min/60.)*math.pi/180) #Sin value for second angle
val3 = math.sin((theta3_deg+ theta3_min/60.)*math.pi/180)#Sin value for third angle
ratio_21 = val2/val1
ratio_31 = val3/val1
print "Interatomic layer separation ratios in crystal are as 1 : %f : %f"%(ratio_21,ratio_31)
print "Above relation shows that crystal has a simple cubic crystal structure."
Interatomic layer separation ratios in crystal are as 1 : 1.412775 : 1.734750
Above relation shows that crystal has a simple cubic crystal structure.

Eg15:pg-82

In [26]:
import math
h=6.63*10**-34  #planck constant in joule-sec
c=3*10**8       #speed of light in m/sec
mo=9.1*10**-31  #mass of electron in Kg
theta=math.radians(180)#scattering angle in radians
d_lamda=h*(1-math.cos(theta))/(mo*c)
print "change in wavelength of photon=",round(d_lamda*10**10,4),"Angstrom"
change in wavelength of photon= 0.0486 Angstrom

Eg16:pg-82

In [27]:
import math 
#given that
E=100.         # Energy of X ray beam in KeV
theta=30       # Scattering angle in degree
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # Speed of light in m/s
E_rest=(mo*c**2)/(1.6e-19*1e3) # Rest mass energy in KeV
k=(1/E)+ ((1-math.cos(math.radians(theta)))/(E_rest))
k=int(k*10000)*10**-4
del_e=E-1/k   # Energy of recoiled electron
print "Energy of recoiled electrons is ",round(del_e,2),"KeV"
Energy of recoiled electrons is  1.96 KeV

Eg17:pg-82

In [28]:
import math 
#given that
lamda=1         # wavelength in angstrom
h=6.63*10**-34  # Planck's constant in joule-sec
mo=9.1*10**-31  # mass of electron in kg
c=3*10**8       # speed of light in m/sec
theta=90        # scattering angle in degree
d_lambda=h*(1-math.cos(math.radians(90)))/(mo*c) # calculation of compton shift 
print "compton shift is ",round(d_lambda*1e10,4),"Angstrom"
compton shift is  0.0243 Angstrom

Eg18:pg-83

In [29]:
import math 
#given that
lamda=0.015        #wavelength in angstrom
h=6.63*10**-34     #Planks constant in joule-sec
mo=9.1*10**-31     #mass of electron in kg
c=3*10**8          #speed of light in m/sec
theta=60           #scattering angle in degree
d_lambda=h*(1-math.cos(theta*math.pi/180))*1e10/(mo*c) 
lambda_n=lamda+d_lambda
print "Wavelength of the scattered X-ray is ",round(lambda_n,3),"Angstrom"
Wavelength of the scattered X-ray is  0.027 Angstrom

Eg19:pg-83

In [31]:
import math 
#given that
lamda=1        # wavelength in angstrom
h=6.63*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=90       # scattering angle in degree
d_lambda= h*(1-math.cos(math.radians(90)))*1e10/(mo*c) # calculation of wavelength shift in angstrom
lambda_n=lamda+d_lambda # Calculation of wavelength of scattered beam in angstrom
K_E=h*c*(lambda_n-lamda)*1e10/(1.6e-19*lambda_n*lamda)# Calculation of K.E of recoiled electron in eV
phi=math.atan(round((lamda/lambda_n),2))# calculation of Direction of the recoiled electron
print "Wavelength of the scattered beam is ",round(lambda_n,4),"Angstrom"
print "Kinetic Energy imparted to the recoiled electron is ",round(K_E),"eV"
print "Direction of the recoiled electron is ",round(math.degrees(phi),1),"degree"
Wavelength of the scattered beam is  1.0243 Angstrom
Kinetic Energy imparted to the recoiled electron is  295.0 eV
Direction of the recoiled electron is  44.4 degree

Eg20:pg-84

In [32]:
import math 
#given that
lamda=1        # wavelength in angstrom
h=6.63*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=90       # scattering angle in degree
d_lambda= h*(1-math.cos(math.radians(90)))*1e10/(mo*c) # calculation of compton shift in angstrom
lambda_n=lamda+d_lambda # Calculation of wavelength of scattered beam in angstrom
K_E=h*c*(lambda_n-lamda)*1e10/(1.6e-19*lambda_n*lamda)# Calculation of K.E of recoiled electron in eV
print "Compton shift is ",round(d_lambda,4),"Angstrom"
print "Kinetic Energy imparted to the recoiled electron is ",round(K_E),"eV"
Compton shift is  0.0243 Angstrom
Kinetic Energy imparted to the recoiled electron is  295.0 eV

Eg21:pg-84

In [33]:
import math
h=6.63*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
E=0.88*10**6   #energy of gamma-rays in eV
theta=180      #scattering angle in degree for maximum energy of recoiled electron
lamda=h*c*10**10/(E*1.6*10**-19)
d_lamda_max=h*(1-math.cos(math.radians(theta)))*1e10/(mo*c)
lamda_n=lamda+d_lamda_max
K_E_max=h*c*d_lamda_max*1e10/(1.6e-19*lamda_n*lamda)
print "Maximum energy of compton recoil electrons is ",round(K_E_max*10**-6,3),"MeV"
Maximum energy of compton recoil electrons is  0.682 MeV

Eg22:pg-85

In [35]:
import math
h=6.62*10**-34 # Planck's constant in joule-sec
mo=9.0*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=90       # scattering angle in degree 
lamda=h*(1-math.cos(math.radians(theta)))*1e10/(mo*c)
d_lamda=lamda  # compton shift 
E=h*c/(round(lamda,4)*1e-10)
print "Wavelength of incident photon is ",round(lamda,4),"Angstrom"
print "Energy of incident photon is ","{:.3e}".format(E),"joule"
Wavelength of incident photon is  0.0245 Angstrom
Energy of incident photon is  8.106e-14 joule

Eg23:pg-85

In [37]:
import math
h=6.63*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=90       # scattering angle in degree 
d_lamda=h*(1-math.cos(math.radians(theta)))*1e10/(mo*c)
print "Percentage change in energy when photon is:"
#(a) for microwave photon
lamda=3*10**8  #wavelength of microwave photon in Angstrom
energy_change=d_lamda*100/(lamda+d_lamda)
print "A microwave photon= ","{:.1e}".format(energy_change),"%"

#(b) for visible light photon
lamda=5000     #wavelength of visible light photon in Angstrom
energy_change=d_lamda*100/(lamda+d_lamda)
print "A visible light photon= ","{:.2e}".format(energy_change),"%"

#(c) for X-ray photon
lamda=1        #wavelength of X-ray photon in Angstrom
energy_change=d_lamda*100/(lamda+d_lamda)
print "An X-ray photon= ",round(energy_change,1),"%"

#(d) for gamma-ray photon
lamda=0.0124   #wavelength of gamma-ray photon in Angstrom
energy_change=d_lamda*100/(lamda+d_lamda)
print "A gamma-ray photon= ",int(energy_change),"%"
print "Hence, the compton effect is dominant only in the gamma-ray region and shorter X-ray region.It is not observable in the visible region and microwave region"
Percentage change in energy when photon is:
A microwave photon=  8.1e-09 %
A visible light photon=  4.86e-04 %
An X-ray photon=  2.4 %
A gamma-ray photon=  66 %
Hence, the compton effect is dominant only in the gamma-ray region and shorter X-ray region.It is not observable in the visible region and microwave region

Eg24:pg-86

In [38]:
import math 
lamda=2        # wavelength in angstrom
h=6.62*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=45       # scattering angle in degree
d_lamda=h*(1-math.cos(math.radians(theta)))*1e10/(mo*c) 
lamda_n=lamda+d_lamda 
f=d_lamda/lamda_n # Calculation of fraction of energy lost by photon 
print "Fraction of energy lost by photon is ",round(f,4)
Fraction of energy lost by photon is  0.0035

Eg25:pg-87

In [39]:
import math 
C_W=0.0242     #compton wavelength of electron in Angstrom
theta=45       # scattering angle in degree
d_lamda=C_W*(1-math.cos(math.radians(theta)))
lamda= d_lamda
print "Wavelength= ",round(lamda,3),"Angstrom"
#answer is incomplete in book as only wavelength is calculated and no region is specified
print "Hence, such a photon lie in the Gamma-ray region of electromagnetic spectrum."
Wavelength=  0.007 Angstrom
Hence, such a photon lie in the Gamma-ray region of electromagnetic spectrum.

Eg26:pg-87

In [41]:
import math
h=6.6*10**-34  # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
E=510*10**3    # energy of gamma-rays in eV
theta=90       # scattering angle in degree 
lamda=h*c/(E*1.6*10**-19)
d_lamda=h*(1-math.cos(math.radians(theta)))/(mo*c)
lamda_n=lamda+d_lamda
Er=h*c*d_lamda/(lamda_n*lamda)
phi=math.atan(lamda/lamda_n)
print "Wavelength of scattered radiation is ","{:.3e}".format(lamda_n),"meter"
print "Energy of recoil electron is ","{:.3e}".format(Er),"joule"
print "Direction of the recoil electron is ",round(degrees(phi),2),"degree"
Wavelength of scattered radiation is  4.844e-12 meter
Energy of recoil electron is  4.073e-14 joule
Direction of the recoil electron is  26.61 degree

Eg27:pg-88

In [42]:
import math
h=6.63*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
E=510*10**3    # energy of gamma-rays in eV
theta=90       # scattering angle in degree 
lamda=h*c/(E*1.6*10**-19)
d_lamda=h*(1-math.cos(math.radians(theta)))/(mo*c)
lamda_n=lamda+d_lamda
print "Wavelength of scattered radiation is ",round(lamda_n*10**10,4),"Angstrom"
Wavelength of scattered radiation is  0.0487 Angstrom

Eg28:pg-88

In [43]:
import math
h=6.62*10**-34 # Planck's constant in joule-sec
mo=9.1*10**-31 # mass of electron in kg
c=3*10**8      # speed of light in m/sec
theta=180      # scattering angle in degree for minimum energy of incident photon
lamda_max=h*(1-math.cos(math.radians(theta)))/(mo*c)
E_min=h*c/lamda_max
print "Minimum energy of incident photon is ",int(round(E_min/(1.6*10**-16))),"KeV"
Minimum energy of incident photon is  256 KeV