3: Crystal Planes and X-ray Diffraction

Example number 3.1, Page number 3.4

In [1]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=4;
b=2;
c=2;      #intercepts

#Calculation
h=int(a/a);
k=int(a/b);
l=int(a/c);     #miller indices

#Result
print "miller indices are (",h,k,l,")"
miller indices are ( 1 2 2 )

Example number 3.2, Page number 3.4

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=6;
b=2;
c=2;      #intercepts

#Calculation
h=int(a/a);
k=int(a/b);
l=int(a/c);     #miller indices

#Result
print "miller indices are (",h,k,l,")"
miller indices are ( 1 3 3 )

Example number 3.3, Page number 3.4

In [3]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=3;
b=3;
c=3;      #intercepts

#Calculation
h=int(c/a);
k=int(c/b);
l=int(c/c);     #miller indices

#Result
print "miller indices are (",h,k,l,")"
miller indices are ( 1 1 1 )

Example number 3.4, Page number 3.5

In [5]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=2;
b=3;
c=6;      #intercepts

#Calculation
h=int(c/a);
k=int(c/b);
l=int(c/c);     #miller indices

#Result
print "miller indices are (",h,k,l,")"
miller indices are ( 3 2 1 )

Example number 3.5, Page number 3.5

In [8]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=0.212;
b=1;
c=0.183;      #intercepts
ac=0.424;
bc=1;
cc=0.366;     #axial units

#Calculation
h=int(ac/a);
k=int(bc/b);
l=int(cc/c);     #miller indices

#Result
print "miller indices are (",h,k,l,")"
miller indices are ( 2 1 2 )

Example number 3.6, Page number 3.6

In [9]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=2;
k=3;
l=1;     #intercepts
a=1.2;
b=1.8;
c=2;     #primitives(angstrom)
p=1.2;    #intercept along X-direction

#Calculation
q=b/k;
r=2*p/q;

#Result
print "intercepts along x,y,z directions are",p,"angstrom",2*q,"angstrom",r,"angstrom"
intercepts along x,y,z directions are 1.2 angstrom 1.2 angstrom 4.0 angstrom

Example number 3.7, Page number 3.11

In [11]:
#importing modules
import math
from __future__ import division
from sympy import Symbol

#Variable declaration
a=Symbol('a');
h1=1;
k1=0;
l1=0;    #intercepts of 1st plane
h2=1;
k2=1;
l2=0;    #intercepts of 2nd plane
h3=1;
k3=1;
l3=1;    #intercepts of 3rd plane

#Calculation
d100=a/math.sqrt(h1**2+k1**2+l1**2);    #interplanar separation for 1st plane
d110=a/math.sqrt(h2**2+k2**2+l2**2);    #interplanar separation for 2nd plane
d111=a/math.sqrt(h3**2+k3**2+l3**2);    #interplanar separation for 3rd plane

#Result
print "interplanar separation for 1st plane is",d100
print "interplanar separation for 2nd plane is",round(d110/a,3),"*a"
print "interplanar separation for 3rd plane is",round(d111/a,3),"*a"
interplanar separation for 1st plane is 1.0*a
interplanar separation for 2nd plane is 0.707 *a
interplanar separation for 3rd plane is 0.577 *a

Example number 3.8, Page number 3.12

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=3;
k=4;
l=5;     #miller indices
a=2;
b=2;
c=1;     #parameters

#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2));     #interplanar separation(angstrom)

#Result
print "interplanar separation is",round(d,3),"angstrom"
interplanar separation is 0.179 angstrom

Example number 3.9, Page number 3.12

In [4]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=6;     #lattice parameter(angstrom)
h=1;
k=1;
l=1;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)

#Result
print "interplanar distance is",round(d,3),"angstrom"
interplanar distance is 3.464 angstrom

Example number 3.10, Page number 3.12

In [6]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=6.3;     #lattice parameter(angstrom)
h=2;
k=2;
l=1;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)

#Result
print "interplanar distance is",round(d,1),"angstrom"
interplanar distance is 2.1 angstrom

Example number 3.11, Page number 3.12

In [11]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=5;     #lattice parameter(angstrom)
h=4;
k=3;
l=0;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)

#Result
print "interplanar distance is",int(d),"angstrom"
interplanar distance is 1 angstrom

Example number 3.12, Page number 3.13

In [12]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=1;
k=2;
l=3;      #miller indices

#Calculation
p=int(k*l/h);
q=int(k*l/k);
r=int(k*l/l);       #ratio of intercepts on axes

#Result
print "ratio of intercepts on axes is",p,":",q,":",r
ratio of intercepts on axes is 6 : 3 : 2

Example number 3.13, Page number 3.13

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=4.2*10**-10;     #lattice parameter(m)
h=3;
k=2;
l=1;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(m)

#Result
print "interplanar distance is",round(d*10**10,2),"*10**-10 m"
interplanar distance is 1.12 *10**-10 m

Example number 3.14, Page number 3.13

In [17]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=1;
k=1;
l=1;     #miller indices
a=2.5;
b=2.5;
c=1.8;     #parameters

#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2));     #interplanar separation(angstrom)

#Result
print "interplanar separation is",round(d,2),"angstrom"
interplanar separation is 1.26 angstrom

Example number 3.15, Page number 3.14

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
r=1.744;       #atomic radius(angstrom)
h1=2;
k1=0;
l1=0;    #intercepts of 1st plane
h2=2;
k2=2;
l2=0;    #intercepts of 2nd plane
h3=1;
k3=1;
l3=1;    #intercepts of 3rd plane

#Calculation
a=4*r/math.sqrt(2);
d200=a/math.sqrt(h1**2+k1**2+l1**2);    #interplanar separation for 1st plane(angstrom)
d220=a/math.sqrt(h2**2+k2**2+l2**2);    #interplanar separation for 2nd plane(angstrom)
d111=a/math.sqrt(h3**2+k3**2+l3**2);    #interplanar separation for 3rd plane(angstrom)

#Result
print "interplanar separation for 1st plane is",round(d200,3),"angstrom"
print "interplanar separation for 2nd plane is",round(d220,2),"angstrom"
print "interplanar separation for 3rd plane is",round(d111,2),"angstrom"
interplanar separation for 1st plane is 2.466 angstrom
interplanar separation for 2nd plane is 1.74 angstrom
interplanar separation for 3rd plane is 2.85 angstrom

Example number 3.16, Page number 3.14

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
h1=1;
k1=1;
l1=1;    #intercepts of 1st plane
h2=1;
k2=1;
l2=0;    #intercepts of 2nd plane
a=1;

#Calculation
d111=a/math.sqrt(h1**2+k1**2+l1**2);    #interplanar separation for 1st plane(angstrom)
d110=a/math.sqrt(h2**2+k2**2+l2**2);    #interplanar separation for 2nd plane(angstrom)

#Result
print "ratio of densities is",round(1/d110,3),":",round(1/d111,3)
ratio of densities is 1.414 : 1.732

Example number 3.17, Page number 3.21

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=2.814;     #lattice parameter(m)
h=1;
lamda=0.71;     #wavelength(angstrom)
k=0;
l=0;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)
theta=math.asin(lamda/d);     #glancing angle(radian)
theta=theta*180/math.pi;      #glancing angle(degrees)

#Result
print "glancing angle is",round(theta,2),"degrees"
glancing angle is 14.61 degrees

Example number 3.18, Page number 3.21

In [3]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=4.5;     #lattice parameter(m)
h=2;
k=2;
theta=30*math.pi/180;    #angle(radian)
l=1;      #miller indices
n=2;

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)
lamda=2*d*math.sin(theta);     #wavelength(angstrom)
theta=math.asin(lamda/d);     #glancing angle(radian)
theta=theta*180/math.pi;      #glancing angle(degrees)

#Result
print "wavelength is",lamda,"angstrom"
print "glancing angle is",round(theta,2),"degrees"
wavelength is 1.5 angstrom
glancing angle is 90.0 degrees

Example number 3.19, Page number 3.22

In [8]:
#importing modules
import math
from __future__ import division

#Variable declaration
theta=(8+(35/60))*math.pi/180;    #angle(radian)
n2=2;
n3=3;
d=2.82*10**-10;     #lattice spacing(m)

#Calculation
lamda=2*d*math.sin(theta);     #wavelength(m)
theta2=math.asin(n2*lamda/(2*d));     #glancing angle(radian)
theta2=theta2*180/math.pi;      #glancing angle(degrees)
theta3=math.asin(n3*lamda/(2*d));     #glancing angle(radian)
theta3=theta3*180/math.pi;      #glancing angle(degrees)

#Result
print "wavelength is",round(lamda*10**10,3),"*10**-10 m"
print "glancing angle for second order is",round(theta2,2),"degrees"
print "glancing angle for third order is",round(theta3,1),"degrees"
wavelength is 0.842 *10**-10 m
glancing angle for second order is 17.37 degrees
glancing angle for third order is 26.6 degrees

Example number 3.20, Page number 3.23

In [10]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=5;     #lattice parameter(angstrom)
h=3;
lamda=0.5;     #wavelength(angstrom)
k=4;
n=2;
l=0;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)
theta1=math.asin(lamda/(2*d));     #glancing angle(radian)
theta1=theta1*180/math.pi;      #glancing angle(degrees)
theta2=math.asin(2*lamda/(2*d));     #glancing angle(radian)
theta2=theta2*180/math.pi;      #glancing angle(degrees)

#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 1st order is",theta2,"degrees"
glancing angle for 1st order is 14.48 degrees
glancing angle for 1st order is 30.0 degrees

Example number 3.21, Page number 3.23

In [12]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=3;     #lattice parameter(angstrom)
h=1;
k=1;
n=1;
l=1;      #miller indices
theta=45*math.pi/180;    #angle(radian)

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)
lamda=2*d*math.sin(theta);     #wavelength(angstrom)

#Result
print "wavelength is",round(lamda,2),"angstrom"
wavelength is 2.45 angstrom

Example number 3.22, Page number 3.24

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.5;     #wavelength(angstrom)
d=2;       #seperation(angstrom)
n=2;

#Calculation
theta1=math.asin(lamda/(2*d));     #glancing angle(radian)
theta1=theta1*180/math.pi;      #glancing angle(degrees)
theta2=math.asin(n*lamda/(2*d));     #glancing angle(radian)
theta2=theta2*180/math.pi;      #glancing angle(degrees)

#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 2nd order is",round(theta2,2),"degrees"
glancing angle for 1st order is 22.02 degrees
glancing angle for 2nd order is 48.59 degrees

Example number 3.23, Page number 3.24

In [17]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.25;     #wavelength(angstrom)
theta=45*math.pi/180;    #angle(radian)
n=1;

#Calculation
d=n*lamda/(2*math.sin(theta));      #interplanar separation(angstrom)

#Result
print "interplanar separation is",round(d,2),"angstrom"
interplanar separation is 0.88 angstrom

Example number 3.24, Page number 3.25

In [20]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1;     #wavelength(angstrom)
d=5;       #seperation(angstrom)
n1=1;
n2=2;
n3=3;
n4=4;     #order

#Calculation
theta1=math.asin(n1*lamda/(2*d));     #glancing angle(radian)
theta1=theta1*180/math.pi;      #glancing angle(degrees)
theta2=math.asin(n2*lamda/(2*d));     #glancing angle(radian)
theta2=theta2*180/math.pi;      #glancing angle(degrees)
theta3=math.asin(n3*lamda/(2*d));     #glancing angle(radian)
theta3=theta3*180/math.pi;      #glancing angle(degrees)
theta4=math.asin(n4*lamda/(2*d));     #glancing angle(radian)
theta4=theta4*180/math.pi;      #glancing angle(degrees)

#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 2nd order is",round(theta2,2),"degrees"
print "glancing angle for 1st order is",round(theta3,2),"degrees"
print "glancing angle for 2nd order is",round(theta4,2),"degrees"
glancing angle for 1st order is 5.74 degrees
glancing angle for 2nd order is 11.54 degrees
glancing angle for 1st order is 17.46 degrees
glancing angle for 2nd order is 23.58 degrees

Example number 3.25, Page number 3.26

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
theta=30*math.pi/180;      #angle(radian)
#assume that sin(theta)=x
x1=1;
x2=2;
x3=3;
x4=4;

#Calculation
theta1=math.asin(x1*math.sin(theta)/x4);        #1st bragg reflection angle(radian)
theta1=theta1*180/math.pi;       #1st bragg reflection angle(degrees)
theta2=math.asin(x2*math.sin(theta)/x4);        #1st bragg reflection angle(radian)
theta2=theta2*180/math.pi;       #1st bragg reflection angle(degrees)
theta3=math.asin(x3*math.sin(theta)/x4);        #1st bragg reflection angle(radian)
theta3=theta3*180/math.pi;       #1st bragg reflection angle(degrees)

#Result
print "1st bragg reflection angle is",round(theta1,2),"degrees"
print "2nd bragg reflection angle is",round(theta2,2),"degrees"
print "3rd bragg reflection angle is",round(theta3,2),"degrees"
1st bragg reflection angle is 7.18 degrees
2nd bragg reflection angle is 14.48 degrees
3rd bragg reflection angle is 22.02 degrees

Example number 3.26, Page number 3.27

In [25]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.25;     #wavelength(angstrom)
d=2.5;       #seperation(angstrom)

#Calculation
n=2*d/lamda;       #maximum order of bragg reflection

#Result
print "maximum order of bragg reflection is",int(n)
maximum order of bragg reflection is 4

Example number 3.27, Page number 3.27

In [26]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.5;     #wavelength(angstrom)
d=2.8;       #seperation(angstrom)

#Calculation
n=2*d/lamda;       #maximum order of bragg reflection

#Result
print "maximum order of bragg reflection is",int(n)
maximum order of bragg reflection is 3

Example number 3.28, Page number 3.27

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
theta1=15*math.pi/180;    #angle(radian)
theta2=16*math.pi/180;    #angle(radian)
d=2.8;     #lattice spacing(angstrom)

#Calculation
lamda1=2*d*math.sin(theta1);     #wavelength for 1st angle(angstrom)
lamda2=2*d*math.sin(theta2);     #wavelength for 2nd angle(angstrom)

#Result
print "wavelength for 1st angle is",round(lamda1,2),"angstrom"
print "wavelength for 2nd angleis",round(lamda2,3),"angstrom"
wavelength for 1st angle is 1.45 angstrom
wavelength for 2nd angleis 1.544 angstrom

Example number 3.29, Page number 3.31

In [4]:
#importing modules
import math
from __future__ import division

#Variable declaration
x=1;
y=3;
z=-2;

#Calculation
h=-y*z/x;
k=-y*z/y;
l=y*z/z;       #miller indices

#Result
print "miller indices are (",int(h),int(k),int(l),")"
miller indices are ( 6 2 3 )

Example number 3.30, Page number 3.32

In [5]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=1;
k=1;
l=1;     #miller indices
a=2.5;
b=2.5;
c=1.8;     #parameters

#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2));     #interplanar separation(angstrom)

#Result
print "interplanar separation is",round(d,2),"angstrom"
interplanar separation is 1.26 angstrom

Example number 3.31, Page number 3.32

In [7]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=2.814;     #lattice parameter(m)
h=1;
lamda=0.78;     #wavelength(angstrom)
k=0;
l=0;      #miller indices

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);      #interplanar distance(angstrom)
theta=math.asin(lamda/d);     #glancing angle(radian)
theta=theta*180/math.pi;      #glancing angle(degrees)

#Result
print "glancing angle is",round(theta,1),"degrees"
glancing angle is 16.1 degrees

Example number 3.32, Page number 3.32

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
n1=1;
n2=2;
d=2.82;       #seperation(angstrom)

#Calculation
lamda_max1=2*d/n1;        #longest wavelength in 1st order(angstrom)
lamda_max2=2*d/n2;        #longest wavelength in 2nd order(angstrom)

#Result
print "longest wavelength in 1st order is",lamda_max1,"angstrom"
print "longest wavelength in 2nd order is",lamda_max2,"angstrom"
longest wavelength in 1st order is 5.64 angstrom
longest wavelength in 2nd order is 2.82 angstrom

Example number 3.33, Page number 3.33

In [10]:
#importing modules
import math
from __future__ import division

#Variable declaration
theta=(8+(35/60))*math.pi/180;    #angle(radian)
n1=1;
n2=2;
n3=3;
d=2.82*10**-10;     #lattice spacing(m)

#Calculation
lamda=2*d*math.sin(theta)/n1;     #wavelength(m)
theta2=math.asin(n2*lamda/(2*d));     #glancing angle(radian)
theta2=theta2*180/math.pi;      #glancing angle(degrees)
theta2_m=60*(theta2-int(theta2));
theta3=math.asin(n3*lamda/(2*d));     #glancing angle(radian)
theta3=theta3*180/math.pi;      #glancing angle(degrees)
theta3_m=60*(theta3-int(theta3));

#Result
print "wavelength is",round(lamda*10**10,3),"angstrom"
print "glancing angle for second order is",int(theta2),"degrees",int(theta2_m),"minutes"
print "glancing angle for third order is",int(theta3),"degrees",round(theta3_m),"minutes"
wavelength is 0.842 angstrom
glancing angle for second order is 17 degrees 22 minutes
glancing angle for third order is 26 degrees 36.0 minutes

Example number 3.34, Page number 3.33

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=0.071*10**-9;     #wavelength(angstrom)
d100=0.28*10**-9;       #seperation(angstrom)
n=2;

#Calculation
d110=d100/math.sqrt(2);     
theta=math.asin(n*lamda/(2*d110))*180/math.pi;     #glancing angle(degrees)      

#Result
print "glancing angle is",int(theta),"degrees"
glancing angle is 21 degrees

Example number 3.35, Page number 3.34

In [19]:
#importing modules
import math
from __future__ import division

#Variable declaration
theta=(8+(35/60))*math.pi/180;    #angle(radian)
n=1;
d=0.282;     #lattice spacing(nm)

#Calculation
lamda=2*d*math.sin(theta)/n;     #wavelength(nm)
n_max=2*d/lamda;         #maximum order of diffraction

#Result
print "wavelength is",round(lamda,4),"nm"
print "maximum order of diffraction is",int(n_max)
wavelength is 0.0842 nm
maximum order of diffraction is 6

Example number 3.36, Page number 3.34

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.5418*10**-10;     #wavelength(m)
theta=30*math.pi/180;    #angle(radian)
n=1;
h=1;
k=1;
l=1;

#Calculation
d=n*lamda/(2*math.sin(theta));      #interplanar separation(m)
a=d*math.sqrt(h**2+k**2+l**2);      #interatomic spacing(m)

#Result
print "interatomic spacing is",round(a*10**10,2),"*10**-10 m"
interatomic spacing is 2.67 *10**-10 m