6: Crystallography

Example number 1, Page number 207

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

#Variable declaration
n=8;             #number of atoms per unit cell
a=5.6*10**-10;   #lattice constant(m)
M=710.59;        #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)

#Calculation
rho=n*M/(a**3*N);     #density(kg/m**3)    

#Result
print "density is",round(rho/10**4,2),"*10**4 kg/m**3"
density is 5.38 *10**4 kg/m**3

Example number 2, Page number 207

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

#Variable declaration
n=2;             #number of atoms per unit cell
M=55.85;         #atomic weight(amu)
N=6.02*10**23;   #avagadro number(kg/m**3)
rho=7860;        #density(kg/m**3)    

#Calculation 
a=(n*M/(rho*N))**(1/3);     #lattice constant(m)    

#Result
print "lattice constant is",round(a*10**8,2),"angstrom"
lattice constant is 0.29 angstrom

Example number 3, Page number 208

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

#Variable declaration
n=2;             #number of atoms per unit cell
M=6.94;         #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)
rho=530;        #density(kg/m**3)    

#Calculation 
a=(n*M/(rho*N))**(1/3);     #lattice constant(m)    

#Result
print "lattice constant is",round(a*10**10,2),"angstrom"
lattice constant is 3.52 angstrom

Example number 4, Page number 208

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

#Variable declaration
M=55.85;         #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)
rho=7870;        #density(kg/m**3)    
a=2.9*10**-10;   #lattice constant(m)    

#Calculation 
n=a**3*rho*N/M;     #number of atoms per unit cell

#Result
print "number of atoms per unit cell is",int(n)
number of atoms per unit cell is 2

Example number 5, Page number 208

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

#Variable declaration
n=8;             #number of atoms per unit cell
a=5.6*10**-10;   #lattice constant(m)
M=710.59;        #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)

#Calculation
rho=n*M/(a**3*N);     #density(kg/m**3)    

#Result
print "density is",int(rho),"kg/m**3"
density is 53771 kg/m**3

Example number 6, Page number 209

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

#Variable declaration
n=2;             #number of atoms per unit cell
M=55.85;         #atomic weight(amu)
N=6.02*10**23;   #avagadro number(kg/m**3)
rho=7860;        #density(kg/m**3)    

#Calculation 
a=(n*M/(rho*N))**(1/3);     #lattice constant(m)    

#Result
print "lattice constant is",round(a*10**8,4),"angstrom"
lattice constant is 0.2869 angstrom

Example number 7, Page number 209

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

#Variable declaration
n=2;             #number of atoms per unit cell
M=6.94;         #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)
rho=530;        #density(kg/m**3)    

#Calculation 
a=(n*M/(rho*N))**(1/3);     #lattice constant(m)    

#Result
print "lattice constant is",round(a*10**10,3),"angstrom"
print "answer given in the book varies due to rounding off errors"
lattice constant is 3.517 angstrom
answer given in the book varies due to rounding off errors

Example number 8, Page number 209

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

#Variable declaration
M=55.85;         #atomic weight(amu)
N=6.02*10**26;   #avagadro number(kg/mol)
rho=7870;        #density(kg/m**3)    
a=2.9*10**-10;   #lattice constant(m)    

#Calculation 
n=a**3*rho*N/M;     #number of atoms per unit cell

#Result
print "number of atoms per unit cell is",int(n)
number of atoms per unit cell is 2

Example number 9, Page number 210

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

#Variable declaration
r=0.1278*10**-9;   #atomic radius(m)
n=4;               #number of atoms per unit cell
M=63.5;            #atomic weight(amu)
N=6.02*10**26;     #avagadro number(kg/mol)

#Calculation
a=math.sqrt(8)*r;   #lattice constant(m)
rho=n*M/(a**3*N);   #density(kg/m**3)    

#Result
print "density is",round(rho,2),"kg/m**3"
print "answer given in the book is wrong"
density is 8933.25 kg/m**3
answer given in the book is wrong

Example number 10, Page number 210

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

#Variable declaration
r1=1.258*10**-10;     #radius(m)
r2=1.292*10**-10;     #radius(m)
n1=2;                 #number of atoms per unit cell
n2=4;                 #number of atoms per unit cell

#Calculation
a_bcc=4*r1/math.sqrt(3);
v=a_bcc**3;
V1=v/n1;
a_fcc=2*math.sqrt(2)*r2;
V2=a_fcc**3/n2;
V=(V1-V2)*100/V2;           #percent volume change is",V,"%"

#Result
print "percent volume change is",round(V,1),"%"
percent volume change is 0.5 %

Example number 12, Page number 211

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

#Variable declaration
w=23+35.5;           #molecular weight of NaCl(gm/mole)
N=6.023*10**23;      #avagadro number(gm/mol)
rho=2.18;            #density of NaCl(gm/cm**3)
n=2;                 #number of atoms

#Calculation
m=w/N;               #mass of NaCl(gm)
nm=rho/m;            #number of molecules(mole/cm**3)
N_NaCl=n*nm;         #number of atoms per unit volume(atoms/cm**3) 
a=(1/N_NaCl)**(1/3);     #distance between adjacent atoms(cm)


#Result
print "number of atoms per unit volume is",round(N_NaCl/10**22,2),"*10**22 atoms/cm**3"
print "distance between adjacent atoms is",round(a*10**8,2),"angstrom"
number of atoms per unit volume is 4.49 *10**22 atoms/cm**3
distance between adjacent atoms is 2.81 angstrom

Example number 13, Page number 212

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

#Variable declaration
lamda=0.071*10**-9;      #wavelength(m)
h=1;
k=1;
l=0;                     #miller indices
a=0.28*10**-9;           #lattice constant(m)
n=2;                     #order

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

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

Example number 14, Page number 213

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

#Variable declaration
lamda=3*10**-10;      #wavelength(m)
h=1;
k=0;
l=0;                     #miller indices
theta=40*math.pi/180;    #glancing angle(radian)
n=1;                     #order

#Calculation
d=n*lamda/(2*math.sin(theta));      #space of reflecting plane(m)
a=d*math.sqrt(h**2+k**2+l**2);      
V=a**3;                  #volume of unit cell(m**3)

#Result
print "space of reflecting plane is",round(d*10**10,4),"angstrom"
print "volume of unit cell is",round(V*10**29,2),"*10**-29 m**3"
space of reflecting plane is 2.3336 angstrom
volume of unit cell is 1.27 *10**-29 m**3

Example number 15, Page number 213

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

#Variable declaration
lamda=0.82;      #wavelength(m)
theta=75.86*math.pi/180;    #glancing angle(radian)
n=1;                     #order
a=3;                     #lattice constant(angstrom)

#Calculation
d=n*lamda/(2*math.sin(theta));      #space of reflecting plane(angstrom)
#here the value of d comes to 0.422 angstrom which is not equal to the value of a. hence the problem cannot be solved further 

#Result
print "space of reflecting plane is",round(d,2),"angstrom"
print "answer given in the book is wrong"
space of reflecting plane is 0.42 angstrom
answer given in the book is wrong

Example number 16, Page number 214

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

#Variable declaration
a=5.63*10**-10;          #lattice constant(m)
h=1;
k=1;
l=1;                     #miller indices
theta=27.5*math.pi/180;    #glancing angle(radian)
n=1;                     #order
h=6.625*10**-34;         #planck's constant
c=3*10**10;              #velocity of light(m/sec)
e=1.6*10**-19;           #charge of electron(c)

#Calculation
d111=a/math.sqrt(h**2+k**2+l**2);      
lamda=2*d111*math.sin(theta)/n;      #wavelength of X-ray beam(m) 
lamda=int(lamda*10**10);             #wavelength of X-ray beam(angstrom) 
E=h*c/(lamda*10**-10*e);         #energy of X-ray beam(eV)    

#Result
print "wavelength of X-ray beam is",lamda,"angstrom"
print "energy of X-ray beam is",round(E/10**5,2),"*10**5 eV"
print "answer for energy given in the book is wrong"
wavelength of X-ray beam is 3 angstrom
energy of X-ray beam is 4.14 *10**5 eV
answer for energy given in the book is wrong

Example number 17, Page number 215

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

#Variable declaration
h=2;
k=0;
l=2;                     #miller indices
theta=34*math.pi/180;    #glancing angle(radian)
n=1;                     #order
lamda=1.5*10**-10;       #wavelength of X-ray beam(m) 

#Calculation
d=n*lamda/(2*math.sin(theta));      
a=d*math.sqrt(h**2+k**2+l**2);          #lattice constant(m)

#Result
print "lattice constant is",round(a*10**10,4),"angstrom"
print "answer given in the book varies due to rounding off errors"
lattice constant is 3.7935 angstrom
answer given in the book varies due to rounding off errors

Example number 19, Page number 216

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

#Variable declaration
h1=1;
k1=0;
l1=0;                     #miller indices
h2=1;
k2=1;
l2=0;                     #miller indices
h3=1;
k3=1;
l3=1;                     #miller indices
a=1;                      #assume

#Calculation
Dr1=(h1**2+k1**2+l1**2);
Dr2=(h2**2+k2**2+l2**2);
Dr3=(h3**2+k3**2+l3**2);
d100=a/math.sqrt(Dr1);
d110=a/math.sqrt(Dr2);
d111=a/math.sqrt(Dr3);
def lcm(x, y):  
   if x > y:  
       z = x  
   else:  
       z = y  
  
   while(True):  
       if((z % x == 0) and (z % y == 0)):  
           lcm = z  
           break  
       z += 1  
  
   return lcm
lcm=lcm(Dr2,Dr3);
r=math.sqrt(lcm);
r_d100=d100*r;
r_d110=d110*r;
r_d111=d111*r;

#Result
print "ratio of d100:d110:d111 is math.sqrt(",int(round(r_d100**2)),") : math.sqrt(",int(round(r_d110**2)),") : math.sqrt(",int(round(r_d111**2)),")"
ratio of d100:d110:d111 is math.sqrt( 6 ) : math.sqrt( 3 ) : math.sqrt( 2 )

Example number 20, Page number 217

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

#Variable declaration
h=2;
k=2;
l=0;                     #miller indices
a=450;                   #length(nm)  

#Calculation
d220=a/math.sqrt(h**2+k**2+l**2);          #interplanar spacing(nm)

#Result
print "interplanar spacing is",round(d220,1),"nm"
print "answer given in the book is wrong"
interplanar spacing is 159.1 nm
answer given in the book is wrong

Example number 21, Page number 217

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

#Variable declaration
h=1;
k=1;
l=1;                     #miller indices
r=1.278*10**-10;         #radius(m)

#Calculation
a=4*r/math.sqrt(2);       
d111=a/math.sqrt(h**2+k**2+l**2);          #interplanar spacing(m)

#Result
print "interplanar spacing is",round(d111*10**10,2),"*10**-10 m"
interplanar spacing is 2.09 *10**-10 m

Example number 22, Page number 217

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

#Variable declaration
h=1;
k=1;
l=1;                     #miller indices
n=4;
A=107.87;                #atomic weight(amu)
N=10500*6.052*10**26;    #density(kg/m**3)
theta=(19+(12/60))*math.pi/180;      #angle(radian)
r=1.278*10**-10;         #radius(m)
hp=6.625*10**-34;        #plancks constant(Js)
c=3*10**8;               #velocity of light(m/sec)
e=1.6*10**-19;           #charge of electron(coulomb)

#Calculation
a=(n*A/N)**(1/3);        #lattice constant(m)
d=a/math.sqrt(h**2+k**2+l**2);          #interplanar spacing(m)
lamda=2*d*math.sin(theta);       #wavelength of X-rays(m)
E=hp*c/(e*lamda);                    #energy of X-rays(eV) 

#Result
print "wavelength of X-rays is",round(lamda*10**10,3),"angstrom"
print "answer in the book varies due to rounding off errors"
print "energy of X-rays is",int(E/10**3),"*10**3 eV"
wavelength of X-rays is 1.549 angstrom
answer in the book varies due to rounding off errors
energy of X-rays is 8 *10**3 eV

Example number 23, Page number 217

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

#Variable declaration
h=1;
k=1;
l=0;                     #miller indices
d100=0.28;               #lattice constant(nm)
n=2;
lamda=0.071;             #wavelength(nm)

#Calculation
d110=d100/math.sqrt(h**2+k**2+l**2);          #interplanar spacing(m)
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 24, Page number 218

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

#Variable declaration
h=1;
k=1;
l=0;              #miller indices
a=0.38;           #lattice constant(nm)

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);    #distance between the planes(nm)

#Result
print "distance between the planes is",round(d,2),"nm"
distance between the planes is 0.27 nm

Example number 26, Page number 219

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

#Variable declaration
h=2;
k=3;
l=1;              #miller indices
a=0.121;          
b=0.184;
c=0.197;          #parameters(nm)

#Calculation
OB=2*b/3;       #intercept along y axis(nm)
OC=2*c;         #intercept along z axis(nm) 

#Result
print "intercept along y axis is",round(OB,3),"nm"
print "intercept along y axis is",OC,"nm"
intercept along y axis is 0.123 nm
intercept along y axis is 0.394 nm

Example number 27, Page number 219

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

#Variable declaration
h1=1;
k1=2;
l1=3;              #miller indices
h2=2;
k2=4;
l2=6;              #miller indices
a=0.82;          
b=0.94;
c=0.75;            #parameters(nm)

#Calculation
d123=(((h1/a)**2)+((k1/b)**2)+((l1/c)**2))**(-1/2);     #interplanar distance between (123) planes
d246=d123/2;                  #interplanar distance between (246) planes

#Result
print "interplanar distance between (123) planes is",round(d123,3),"nm"
print "interplanar distance between (246) planes is",round(d246,4),"nm"
print "answers given in the book are wrong"
interplanar distance between (123) planes is 0.213 nm
interplanar distance between (246) planes is 0.1066 nm
answers given in the book are wrong

Example number 28, Page number 219

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

#Variable declaration
h=1;
k=1;
l=1;              #miller indices
a=0.2;            #lattice parameter(nm)
theta=(87/2)*math.pi/180;       #angle(radian)

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);
lamda=2*d*math.sin(theta);      #wavelength of Xrays(nm)

#Result
print "wavelength of Xrays is",round(lamda,3),"nm"
wavelength of Xrays is 0.159 nm

Example number 29, Page number 219

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

#Variable declaration
h=1;
k=1;
l=1;              #miller indices
a=0.352;            #lattice parameter(nm)
theta=(28+(30/60))*math.pi/180;       #angle(radian)
hp=6.626*10**-34;       #plancks constant(Js)
m=1.67*10**-27;        #mass of proton(kg)
kB=1.38*10**-23;       #boltzmann constant

#Calculation
d=a/math.sqrt(h**2+k**2+l**2);
lamda=2*d*math.sin(theta);      #wavelength(nm)
T=(hp**2)/(3*m*kB*(lamda*10**-9)**2);           #effective temperature of neutrons(K)

#Result
print "effective temperature of neutrons is",int(round(T)),"K"
effective temperature of neutrons is 169 K

Example number 30, Page number 220

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

#Variable declaration
h=1;
k=1;
l=1;              #miller indices
lamda=0.152;            #wavelength(nm)
D=0.2552;               #diameter(nm)
theta1=21*math.pi/180;       #angle(radian)
theta2=(21+(23/60))*math.pi/180;       #angle(radian)

#Calculation
a=D*math.sqrt(2);            #lattice parameter for regular crystal(nm)
d111_1=lamda/(2*math.sin(theta1));
alpha1=d111_1*math.sqrt(h**2+k**2+l**2);    #lattice parameter for sample A(nm)
d111_2=lamda/(2*math.sin(theta2));
alpha2=d111_2*math.sqrt(h**2+k**2+l**2);    #lattice parameter for sample B(nm)

#Result
print "lattice parameter for regular crystal is",round(a,4),"nm"
print "lattice parameter for sample A is",round(alpha1,4),"nm"
print "lattice parameter for sample B is",round(alpha2,3),"nm"
print "lattice parameter of sample A is 1.75% greater than that of pure copper"
lattice parameter for regular crystal is 0.3609 nm
lattice parameter for sample A is 0.3673 nm
lattice parameter for sample B is 0.361 nm
lattice parameter of sample A is 1.75% greater than that of pure copper

Example number 31, Page number 220

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

#Variable declaration
h=1;
k=1;
l=1;              #miller indices
lamda=0.154;      #wavelength of X-rays(nm)
D=0.228;          #diameter(nm)

#Calculation
x=lamda/2;
y=2*D/(x*math.sqrt(h**2+k**2+l**2));
z=y**2;

#Result
print "the value of h**2+k**2+l**2 is",round(z,2)
print "answer given in the book is wrong"
print "highest possible values of (hkl) are (222)"
the value of h**2+k**2+l**2 is 11.69
answer given in the book is wrong
highest possible values of (hkl) are (222)