#Example 1.1
#Find the miller indices for a plane.
#Given
#Length of intercept
l1=2.0
l2=3.0
l3=2.0
#Calcuation
#reciprocal of intercept
r1=1/l1
r2=1/l2
r3=1/l3
m1=6*r1
m2=6*r2
m3=6*r3
#Result
print"Miller indices of the given plane are",m1,m2,m3
#Example 1.2
#Find the miller indices for a plane.
#Given
#Length of intercept
l1=1.0
l2=2.0
l3=0
#Calcuation
#reciprocal of intercept
r1=1/l1
r2=1/l2
r3=0
m1=2*r1
m2=2*r2
m3=2*r3
#Result
print"Miller indices of the given plane are",m1,m2,m3
#Example 1.3
#Obtain lattice constant and radius of the atom.
#Given
V=3*(10**22) #kg/m**3, density of SCC lattice
p=(1/3.0)*10**-22
#Calculation
n=1 #no. of lattice point
a=(n*p)**(1/3.0) #lattice constant
r=(a*10**8/2)
#Result
print"Lattice constant is",round(a*10**8,2),"A"
print"radius of simple lattice is",round(r,2),"A"
#Exampe 1.4
#Determine the density of crystal
#given data
import math
r=1.278 #in Angstrum
AtomicWeight=63.5 #constant
AvogadroNo=6.023*10**23 #constant
#Calculation
#For FCC structure a=4*r/math.sqrt(2)
a=4*r*10**-10/math.sqrt(2) #in meter
V=a**3 #in meter**3
#mass of one atom = m
m=AtomicWeight/AvogadroNo #in gm
m=m/1000 #in Kg
n=4 # no. of atoms per unit cell for FCC structure
rho=m*n/V #in Kg/m**3
#Result
print "Density of crystal is",round(rho,2),"Kg/m**3"
#Example 1.5
#What is Density of silicon crystal .
#given data
n=4 # no. of atoms per unit cell of silicon
AtomicWeight=28 #constant
AvogadroNo=6.021*10**23 #constant
#calculation
m=AtomicWeight/AvogadroNo #in gm
m=m/1000 #in Kg
a=5.3 #lattice constant in Angstrum
a=a*10**-10 #in meter
V=a**3 #in meter**3
rho=m*n/V #in Kg/m**3
#result
print"Density of silicon crystal is",round(rho,0),"Kg/m**3"
#Example 1.5
#What is Surface density in FCC .
#given data
a=4.75 #lattice constant in Angstrum
a=a*10**-10 #in meter
#Calculation
dp=2.31/a**2 #in atom/m**2
dp=dp/10**6 #in atom/mm**2
#Result
print "Surface density in FCC on (111)Plane is %.e",dp,"atoms/mm**2"
#Example 1.7
#find the Interpolar distance
#given data
import math
l=1.539 #in Angstrum
theta=22.5 #in degree
n=1 #order unitless
#Calculation
d=n*l/(2*math.sin(theta*math.pi/180)) #in Angstrum
#result
print "Interpolar distance in Angstrum ",round(d,2),"A"
#Example 1.8
#Find the wavelength of X-rays
#given data
import math
theta=16.8/2.0 #in degree
n=2.0 #order unitless
d=0.4 #in nm
#Calculation
l=(2*d*10**-9*sin(theta*math.pi/180.0))/n #in Angstrum
#result
print "wavelength of X-rays in Angstrum ",round(l*10**10,3),"A"