# 7: Crystal Planes and X-ray Diffraction¶

## Example number 7.1, Page number 7.12¶

In [9]:
#importing modules
import math
from __future__ import division
from sympy import Symbol
#Variable declaration
R=Symbol('R')
a=2*R

#Results
print"i)Number of atoms per unit area of (100)plane=",1/a**2
print"ii)Number of atoms per unit area of (110)plane=",1/math.sqrt(2)*a**2
print"iii)Number of atoms per unit area of (111)plane=",1/math.sqrt(3)*a**2
i)Number of atoms per unit area of (100)plane= 1/(4*R**2)
ii)Number of atoms per unit area of (110)plane= 2.82842712474619*R**2
iii)Number of atoms per unit area of (111)plane= 2.3094010767585*R**2

## Example number 7.2, Page number 7.13¶

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

#Variable declaration
a=3.61*10**-7
BC=math.sqrt(2)/2
#Result
print"i)Surface area of the face ABCD =",round(a**2*10**14),"*10**-14 mm**2"
print"ii)Surface area of plane (110) =",round((2/(a*math.sqrt(2)*a)/10**13),2),"*10**13 atoms/mm**2"
i)Surface area of the face ABCD = 13.0 *10**-14 mm**2
ii)Surface area of plane (110) = 1.09 *10**13 atoms/mm**2
iii)Surface area of pane(111)= 1.772 *10**13 atoms/mm**2

## Example number 7.3, Page number 7.14¶

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

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

#Calculations
d1=a/(math.sqrt(h1**2+k1**2+l1**2))
d2=a/(math.sqrt(h2**2+k2**2+l2**2))
d3=a/(math.sqrt(h3**2+k3**2+l3**2))

#Result
print"d1 =",d1
print"d2 =",round(d2,3)
print"d3 =",round(d3,3)
print"d1:d2:d3 =",d1,":",round(d2,3),":",round(d3,3)
d1 = 1.0
d2 = 0.707
d3 = 0.577
d1:d2:d3 = 1.0 : 0.707 : 0.577

## Example number 7.4, Page number 7.15¶

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

#Variable declaration
h=2
k=2
l=0
a=450

#Calculations
d=a/(math.sqrt(h**2+k**2+l**2))

#Result
print"d(220) =",round(d,1),"pm"
d(220) = 159.1 pm

## Example number 7.5, Page number 7.15¶

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

#Variable declaration
a=3.615
r=1.278
h=1
k=1
l=1

#Calculations
a=(4*r)/math.sqrt(2)
d=a/(math.sqrt(h**2+k**2+l**2))

#Result
print"a =",round(a,3),"Angstroms"
print"d =",round(d,3),"Angstroms"
a = 3.615 Angstroms
d = 2.087 Angstroms

## Example number 7.7, Page number 7.15¶

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

#Variable declaration
n=1
lamda=1.54
theta=32*math.pi/180
h=2
k=2
l=0

#Calculations
d=(n*lamda*10**-10)/(2*math.sin(theta))   #derived from 2dsin(theta)=n*l
a=d*(math.sqrt(h**2+k**2+l**2))

#Results
print"d =",round(d*10**10,2),"*10**-10 m"
print"a =",round(a*10**10,1),"*10**-10 m"
d = 1.45 *10**-10 m
a = 4.1 *10**-10 m

## Example number 7.8, Page number 7.16¶

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

#Variable declaration
lamda=0.58
theta1=6.45*math.pi/180
theta2=9.15*math.pi/180
theta3=13*math.pi/180

#Calculations
dbyn1=lamda/(2*(math.sin(theta1)))
dbyn2=lamda/(2*math.sin(theta2))
dbyn3=lamda/(2*math.sin(theta3))

#Results
print"i.  d/n =",round(dbyn1,3),"Angstroms"
print"ii. d/n =",round(dbyn2,3),"Angstroms"
print"iii.d/n =",round(dbyn3,3),"Angstroms"
i.  d/n = 2.582 Angstroms
ii. d/n = 1.824 Angstroms
iii.d/n = 1.289 Angstroms

## Example number 7.9, Page number 7.16¶

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

#Variable declaration
d=1.18
theta=90*math.pi/180
lamda=1.540

#Calculations
n=(2*d*math.sin(theta))/lamda

#Result
print"n =",round(n,2)
n = 1.53

## Example number 7.10, Page number 7.17¶

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

#Variable declaration
lamda=0.58
theta=9.5*math.pi/180
n=1
d=0.5           #d200=a/math.sqrt(2**2+0**2+0**2)=0.5a
#Calculations
a=n*lamda/(2*d*math.sin(theta))     #2*d*sin(theta)=n*lamda

#Result
print"a =",round(a,2),"Angstorms"
a = 3.51 Angstorms

## Example number 7.11, Page number 7.17¶

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

#Variable declaration
lamda=0.842
n1=1
q=(8+(35/60))*(math.pi/180)
n2=3
d=1
#Calculations
#n*lamda=2*d*sin(theta)
#n1*0.842=2*d*sin(q)
#n3*0.842=2*d*sin(theta3)
#Dividing both the eauations, we get
#(n2*lamda)/(n1*lamda)=2*d*math.sin(theta3)/2*d*math.sin(q)
theta3=math.asin((((n2*lamda)/(n1*lamda))*(2*d*math.sin(q)))/(2*d))
d=theta3*180/math.pi;
a_d=int(d);
a_m=(d-int(d))*60

#Result
print"sin(theta3) =",a_d,a_m
sin(theta3) = 26 35.9387574495

## Example number 7.12, Page number 7.18¶

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

#Variable declaration
a=3.16
lamda=1.54
n=1
theta=20.3*math.pi/180

#Calculations
d=(n*lamda)/(2*math.sin(theta))
x=a/d                             #let math.sqrt(h**2+k**2+l**2)=x

#Result
print"d =",round(d,2),"Angstorms"
print"sqrt(h**2+k**2+l**2) =",round(x,3)
print"Therefore, h**2+k**2+l**2 =sqrt(2)"
print"h =1, k=1"
d = 2.22 Angstorms
sqrt(h**2+k**2+l**2) = 1.424
Therefore, h**2+k**2+l**2 =sqrt(2)
h =1, k=1

## Example number 7.13, Page number 7.18¶

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

#Variable declaration
n=4
A=107.87
rho=10500
N=6.02*10**26
h=1;
k=1;
l=1;
H=6.625*10**-34
e=1.6*10**-19
theta=(19+(12/60))*math.pi/180
C=3*10**8
#Calculations
a=((n*A)/(rho*N))**(1/3)*10**10
d=a/math.sqrt(h**2+k**2+l**2)
lamda=2*d*math.sin(theta)
E=(H*C)/(lamda*10**-10*e)

#Result
print"a =",round(a,2),"Angstroms"
print"d =",round(d,2),"Angstroms"
print"lamda =",round(lamda,3),"Angstroms"
print"E =",round(E/10**3),"*10**3 eV"
a = 4.09 Angstroms
d = 2.36 Angstroms
lamda = 1.552 Angstroms
E = 8.0 *10**3 eV

## Example number 7.14, Page number 7.19¶

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

#Variable declaration
a=4.57
h=1
k=1
l=1
lamda=1.52
twotheta=33.5*math.pi/180
#Calculations
d=a/(h**2+k**2+l**2)**(1/2)
sintheta=lamda/(2*d)
X=r/math.tan(twotheta)

#Result
print"d =",round(d,2),"Angstorms"
print"sin(theta)=",round(sintheta,3)
print"X =",round(X,3),"cm"
d = 2.64 Angstorms
sin(theta)= 0.288
X = 7.554 cm