# Chapter 4:Crystal Diffraction¶

## Example 4.1 , Page no:75¶

In :
import math
from __future__ import division

#given
lambda1=2.6; #in Angstrom (wavelength)
theta=20; #in Degree (angle)
n=2;

#calculate
lambda1=lambda1*1E-10; #since lambda is in Angstrom
#Since 2dsin(theta)=n(lambda)
#therefore d=n(lambda)/2sin(theta)

#result
print"The spacing constant is d=",'%.2E'%d,"m";
print"\t\t\td=",round(d*10**10,3),"Angstrom";

The spacing constant is d= 7.60E-10 m
d= 7.602 Angstrom


## Example 4.2 , Page no:75¶

In :
import math
from __future__ import division

#given
h=1;k=1;l=0; #miller indices
a=0.26; #in nanometer (lattice constant)
lambda1=0.065; #in nanometer (wavelength)
n=2; #order

#calculate
d=a/math.sqrt(h**2+k**2+l**2); #calculation of interlattice spacing
#Since 2dsin(theta)=n(lambda)
#therefore we have
theta=math.asin(n*lambda1/(2*d));
theta1=theta*180/3.14;

#result
print"The glancing angle is =",round(theta1,2),"degree";
print "Note: there is slight variation in the answer due to round off error"

The glancing angle is = 20.72 degree
Note: there is slight variation in the answer due to round off error


## Example 4.3 , Page no:75¶

In :
import math
from __future__ import division

#given
d=3.04E-10; #in mm (spacing constant)
lambda1=0.79; #in Angstrom (wavelength)
n=3; #order

#calculate
#Since 2dsin(theta)=n(lambda)
#therefore we have
lambda2=lambda1*1E-10; #since lambda is in angstrom
theta=math.asin(n*lambda2/(2*d));
theta1=theta*180/3.14;

#result
print"The glancing angle is",round(theta1,3),"degree";
print "Note: In question the value of d=3.04E-9 cm but in solution is using d=3.04E-10 m. So I have used d=3.04E-10 cm as used in the solution"

The glancing angle is 22.954 degree
Note: In question the value of d=3.04E-9 cm but in solution is using d=3.04E-10 m. So I have used d=3.04E-10 cm as used in the solution


## Example 4.4 , Page no:76¶

In :
import math
from __future__ import division

#given
d=0.282; #in nanometer (spacing constant)
n=1; #order
theta=8.35; #in degree (glancing angle)

#calculate
d=d*1E-9; #since d is in nanometer
#Since 2dsin(theta)=n(lambda)
#therefore we have
lambda_1=lambda1*1E10; #changing unit from m to Angstrom
theta_1=90; #in degree (for maximum order theta=90)

#result
print"The wavelength  =",'%.2E'%lambda1,"m";
print"\t\t=" ,round(lambda_1,3),"Angstrom";
print"The maximum order possible is n=",round(n_max);
print "Note: In question value of theta=8 degree and 35 minutes but solution uses theta=8.35 degree.So I am using theta=8.35 degree"

The wavelength  = 8.19E-11 m
= 0.819 Angstrom
The maximum order possible is n= 7.0
Note: In question value of theta=8 degree and 35 minutes but solution uses theta=8.35 degree.So I am using theta=8.35 degree


## Example 4.5 , Page no:76¶

In :
import math
from __future__ import division

#given
theta=6; #in degree (glancing angle)
p=2170; #in Kg/m^3 (density)
M=58.46; #Molecular weight of NaCl
n=1; #order
XU=1E-12; #since 1X.U.= 1E-12m

#calculate
d=(M/(2*N*p))**(1/3); #calclation of lattice constant
#Since 2dsin(theta)=n(lambda)
#therefore we have
lambda2=lambda1/XU;

#result
print"The spacing constant is d=",'%.2E'%d,"m";
print"The wavelength is =",'%.2E'%lambda1,"m";
print"\t\t  =",round(lambda2,1),"X.U";

The spacing constant is d= 2.82E-10 m
The wavelength is = 5.89E-11 m
= 58.9 X.U


## Example 4.6 , Page no:77¶

In :
import math
from __future__ import division

#given
h=1;k=1;l=1; #miller indices
a=5.63; #in Angstrom  (lattice constant)
theta=27.5; #in degree (Glancing angle)
n=1; #order
H=6.625E-34; #in J-s (Plank's constant)
c=3E8; #in m/s (velocity of light)
e=1.6E-19; #charge of electron

#calculate
d=a/math.sqrt(h**2+k**2+l**2); #calculation for interplanar spacing
#Since 2dsin(theta)=n(lambda)
#therefore we have
E=H*c/(lambda1*1E-10); #calculation of Energy
E1=E/e; #changing unit from J to eV

#result
print"The lattice spacing is d=",round(d,2),"Angstrom";
print"The wavelength is =",round(lambda1),"Angstrom";
print"The energy of X-rays is E=",'%.2E'%E,"J";
print"\t\t\tE=",'%.3E'%E1,"eV";
print "Note: c=3E8 m/s but in solution c=3E10 m/s "

The lattice spacing is d= 3.25 Angstrom
The wavelength is = 3.0 Angstrom
The energy of X-rays is E= 6.62E-16 J
E= 4.138E+03 eV
Note: c=3E8 m/s but in solution c=3E10 m/s


## Example 4.7 , Page no:77¶

In :
import math
from __future__ import division

#given
V=344; #in V (accelerating voltage)
theta=60; #in degree (glancing angle)
m=9.1E-31; #in Kg (mass of electron)
h=6.625e-34; #in J-s (Plank's constant)
n=1; #order
e=1.6E-19; #charge on electron

#calculate
#Since K=m*v^2/2=e*V
#therefore  v=sqrt(2*e*V/m)
#since lambda=h/(m*v)
#therefore we have lambda=h/sqrt(2*m*e*V)
lambda1=h/math.sqrt(2*m*e*V); #calculation of lambda
lambda2=lambda1*1E10; #changing unit from m to Angstrom
#Since 2dsin(theta)=n(lambda)
#therefore we have

#result
print"The wavelength is =",'%.2E'%lambda1,"m";
print"\t\t  =",round(lambda2,2),"Angstrom";
print"The interplanar spacing  is  d=",round(d,2),"Angstrom";

The wavelength is = 6.62E-11 m
= 0.66 Angstrom
The interplanar spacing  is  d= 0.38 Angstrom


## Example 4.8 , Page no:78¶

In :
import math
from __future__ import division

#given
K=0.02; #in eV (kinetic energy)
d=2.0; #in Angstrom (Bragg's spacing)
m=1.00898; #in amu (mass of neutron)
amu=1.66E-27; #in Kg (1amu=1.66E-27 Kg)
h=6.625e-34; #in J-s (Plank's constant)
n=1; #order
e=1.6E-19; #charge on electron

#calculate
#Since K=m*v^2/2
#therefore  v=sqrt(2*K/m)
#since lambda=h/(m*v)
#therefore we have lambda=h/sqrt(2*m*K)
m=m*amu; #changing unit from amu to Kg
K=K*e; #changing unit to J from eV
lambda1=h/math.sqrt(2*m*K); #calculation of lambda
lambda2=lambda1*1E10; #changing unit from m to Angstrom
theta=math.asin(n*lambda2/(2*d)); #calculation of angle of first order diffraction maximum
theta1=theta*180/3.14;
#result
print"The wavelength is =",'%.2E'%lambda1,"m";
print"\t    \t  =",round(lambda2),"Angstrom";
print"The angle of first order diffraction maximum is ",round(theta1),"Degree";

The wavelength is = 2.02E-10 m
= 2.0 Angstrom
The angle of first order diffraction maximum is  30.0 Degree


## Example 4.9 , Page no:79¶

In :
#given
lambda1=0.586; #in Angstrom (wavelength of X-rays)
n1=1; n2=2; n3=3; #orders of diffraction
theta1=5+(58/60); #in degree (Glancing angle for first order of diffraction)
theta2=12+(01/60); #in degree (Glancing angle for second order of diffraction)
theta3=18+(12/60); #in degree (Glancing angle for third order of diffraction)

#calculate
#Since 2dsin(theta)=n(lambda)
#therefore we have
d1=n1*lambda1/(2*K1);
d2=n2*lambda1/(2*K2);
d3=n3*lambda1/(2*K3);
d1=d1*1E-10; #changing unit from Angstrom to m
d2=d2*1E-10; #changing unit from Angstrom to m
d3=d3*1E-10; #changing unit from Angstrom to m
d=(d1+d2+d3)/3;

#result
print"The value of sine of different angle of diffraction is \nK1=",round(K1,4);
print"K2=",round(K2,4);
print"K3=",round(K3,4);
#Taking the ratios of K1:K2:K3
#We get K1:K2:K3=1:2:3
#Therefore we have
print"Or we have K1:K2:K3=1:2:3";
print"Hence these angles of incidence are for Ist, 2nd and 3rd order reflections respectively";
print"The spacing constants are \nd1=",'%.2E'%d1;
print"d2=",'%.3E'%d2;
print"d3=",'%.3E'%d3;
print"The mean value of crystal spacing is d=",'%.3E'%d,"m";

The value of sine of different angle of diffraction is
K1= 0.1039
K2= 0.2082
K3= 0.3123
Or we have K1:K2:K3=1:2:3
Hence these angles of incidence are for Ist, 2nd and 3rd order reflections respectively
The spacing constants are
d1= 2.82E-10
d2= 2.815E-10
d3= 2.814E-10
The mean value of crystal spacing is d= 2.816E-10 m

In :