# Finding Density of silicon crystal
#initialisation of variables
a=5.3 #in Å
a=a*10**-10 #in m
N_A=6.023*10**23
At_Si=28 #atomic weight of Si
n = 4
m=At_Si/N_A #in gm
m= m*10**-3 #in kg
V=a**3 #in m^3
#CALCULATIONS
Rho=((m*n)/V)/1000 #in kg/m^3
# Note: There is calculation error to find the value of density. So the answer in the book is wrong.#RESULTS
#RESULTS
print('Density of silicon crystal in kg/m^3 is = %.2f kg/m^3' %Rho)
import math
# Finding Density of the crystal
#initialisation of variables
n = 4
r = 1.278 #in Å
#CALCULATIONS
a = (4*r)/(math.sqrt(2)) #inÅ
a = a * 10**-10 #in m
V = (a)**3 #in m^3
At_W = 63.5 #atomic weight
N_A = 6.023*10**23
m = At_W /N_A #in gm
m = m*10**-3 #in kg
Rho = ((m*n)/V)/1000 #in kg/m^3
#RESULTS
print('Density of the crystal in kg/m^3 is =%.2f kg/m^3' %Rho)
# Finding Wavaelength of X ray
import math
from numpy import *
#initialisation of variables
d=2.82 #in Å
d=d*10**-10 #in m
n=1
theta1=10 #n degree
#CALCULATIONS
lembda=2*d*math.sin(math.radians(theta1)) #in m
lembda=lembda*10**10 #in Å
#RESULTS
print('Wavaelength of X ray is =%.2f Å degrees' %lembda)
# Finding The spacing of atomic layer
import math
#initialisation of variables
lembda = 1.6 #in Å
theta = 14.2 #in degree
n = 1
#CALCULATIONS
d = (n*lembda)/(2*math.sin(math.radians(theta))) #in Å
#RESULTS
print('The spacing of atomic layer in crystal is =%.2f in Å degrees' %d)
#Finding The interplanner spacing
import math
#initialisation of variables
n = 1
theta1 = 30 #in degree
lembda = 1.78 #in Å
#CALCULATIONS
d = (n*lembda)/(2*math.sin(math.radians(theta1))) #in Å
#RESULTS
print('The interplanner spacing is =%.2f in Å degrees' %d)
#Finding Interplaner spacing of the crystal
import math
#initialisation of variables
lembda = 0.58 #in Å
n = 1;
theta1 = 6.45 # in degree
#CALCULATIONS
d = (n*lembda)/(2*math.sin(math.radians(theta1))) #in Å
print('Part (i) : At angle of 6.45°, Interplaner spacing of the crystal is =%.2f Å' %d)
theta2 = 9.15 #in degree
d1 = (n*lembda)/(2*math.sin(math.radians(theta2))) #in Å
print('Part (ii) : At angle of 9.15°, Interplaner spacing of the crystal is =%.2f Å' %d1)
theta3 = 13 #in degree
n2 = 1
d2 = (n2*lembda)/(2*math.sin(math.radians(theta3))) #in Å
print('Part (iii) : At angle of 13°, Interplaner spacing of the crystal is =%.2f Å' %d2)
n=2
d2 = (n*lembda)/(2*math.sin(math.radians(theta3))) #in Å
#RESULTS
print('Part (iv) : : The interplaner spacing is : =%.4f Å' %d2)
print('The interplaner spacing for some other set of reflecting is : =%.2f Å' %d1)
#Finding The glancing angle for a cubic in degree
import math
from sympy.mpmath import *
import cmath
#initialisation of variables
a = 2.814 #in Å
l = 0
h = l
k = 0
d=a #in Å
n = 2
#CALCULATIONS
lembda=0.710 #in Å
theta = math.degrees(math.asin(n*lembda/(2*d)))
#RESULTS
print('The glancing angle for a cubic in degree is : =%.2f Å degrees' %theta)
print('Anwser is in points i.e = 14 36"40"..')
#Finding Wavelength of X ray
import math
#initialisation of variables
a = 3.65 #in Å
a = 3.65*10**-10 #in m
h = 1
k = 0
l = 0
#CALCULATIONS
d= a/(math.sqrt(h**2+k**2+l**2)) #in m
n = 1
theta=60 #in degree
lembda = 2*d*math.sin(math.radians(theta)) #in m
lembda = lembda * 10**10 #in Å
#RESULTS
print('Wavelength of X ray is : =%.2f Å' %lembda)
#Finding The glancing angle in degree
import math
#initialisation of variables
lembda = 1.54 #in Å
density = 9.024 #in gm/cc
n = 1
MI = 100
At_W = 63.54 #atomic weight
N_A = 6.023*10**23
m = At_W/N_A #in gm
a =(density*m)**(1.0/3) #in cm
h = 1
k = 0
l = 0
#CALCULATIONS
d= a/(math.sqrt(h**2+k**2+l**2))
theta =math.degrees((lembda*10**-8)/(2*d)) #in degree
#RESULTS
print('The glancing angle is = %.2f degrees' %theta)
#Finding To get the 2nd order spectrum the position of the detector in degree
import math
#initialisation of variables
a = 3.615 #in Å
theta=22 #in degree
n=1
h=1
k=h
l=k
#CALCULATIONS
d = a/(math.sqrt( ((h)**2) + ((k)**2) + ((l)**2) )) #in Å
lembda = 2*d*math.sin(math.radians(theta)) #in Å
print('The wavelength of X ray is = %.2f Å ' %lembda)
theta2 =math.degrees(math.asin(lembda/d)) #in degree
#in degree
#RESULTS
print('To get the 2nd order spectrum the position of the detector is = %.2f degrees ' %theta2)
import math
#initialisation of variables
n = 1
lembda = 1.54 # in Å
theta = 21.7 # in degree
#CALCULATIONS
d = lembda/(2*math.sin(math.radians(theta))) # in Å
h = 1
k = h
l = k
a = d*math.sqrt(h**2+k**2+l**2) # in Å
#RESULTS
print('Lattice constant is = %.2f in Å ' %a)
import math
#initialisation of variables
h = 2
k = 1
l = 1
a = 4.8 # in Å
#CALCULATIONS
d_211 = a/(math.sqrt(h**2+k**2+l**2)) #in Å
#RESULTS
print('The distance between planes is =%.2f Å ' %d_211)
import math
#initialisation of variables
r = 1.28 # in Å
n = 4
M = 63.5
#CALCULATIONS
a = (4*r)/(math.sqrt(2)) #in Å
a = a * 10**-8 # in cm
N_A = 6.023*10**23
Rho = (n*M)/( N_A*((a)**3) ) # in gm/cc
#RESULTS
print('Density is =%.2f gm/cc ' %Rho)
#initialisation of variables
M = 55.85
a = 2.9 # in Å
Rho = 7.87 #in gm/cc
#CALCULATIONS
a = a * 10**-8 # in cm
N_A = 6.023*10**23
n = (Rho*N_A*((a)**3))/M # atom per unit
#RESULTS
print('A lattice having =%.2f atom per unit cell is a BCC structure ' %n)
import math
#initialisation of variables
M = 60.0 # in gm/mole
Rho = 6.23 # in gm/cc
n = 4
N_A = 6.023*10**23
#CALCULATIONS
a = ((n*M)/(N_A * Rho))**(1.0/3) # in cm
r = (a*math.sqrt(2))/n #radius of atom in cm
r = r * 10**8 # in Å
#RESULTS
print('Radius of atom is =%.2f Å ' %r)
import math
#initialisation of variables
Rho = 5.96 # in gm/cc
M = 50.0
n = 2
N_A = 6.023*10**23
#CALCULATIONS
a =((n*M)/(Rho*N_A))**(1.0/3) # in cm
r = (a*math.sqrt(3))/4 # in cm
P_f = (2*(4.0/3)*math.pi*((r)**3))/((a)**3) # packing factor
#RESULTS
print('Packing factor is =%.2f ' %P_f)
#initialisation of variables
M = 120.0
n = 2.0
N_A = 6.023*10**23
#CALCULATIONS
m1 = M/N_A #mass of 1 atom in gm
m2 = n*m1 #mass of unit cell in gm
#RESULTS
print('Number of unit cell in 20 gms of element is : =%.2f X 10^22 unit cells ' %((20/m2)/(10**22)))
import math
#initialisation of variables
Rho = 2.48 # in gm/c.c
n = 4.0
M = 58
N_A = 6.023*10**23
#CALCULATIONS
a = ( (n*M)/(Rho*N_A) )**(1.0/3) # in cm
a = a * 10**8 # in Å
r = (a*math.sqrt(2))/n # in Å
r = 2*r # in Å
#RESULTS
print('The center to center distance between ions is =%.2f Å' %r)