from __future__ import division
# Given data
At = 28;# Atomic weight
n = 4;
N_A = 6.023*10**23;
a = 5.3;# in Å
a = a * 10**-10;# in m
m = At/N_A;# in gm
m = m*10**-3;# in kg
V = (a)**3;# in m**3
Rho = (m*n)/V;# in gm/m**3
Rho = Rho * 10**-3;# in kg/m**3
print "The volume density = %0.3f kg/m**3 " %Rho
from math import sqrt
# Given data
r = 1.278;# in Å
a = (4*r)/(sqrt(2));# in Å
a = a * 10**-10;# in m
V = (a)**3;# in m**3
At = 63.5;# atomic weight
N_A = 6.023*10**23;
m = At/N_A;# in gm
m = m * 10**-3;# in kg
n = 4;
Rho = (m*n)/V;# in gm/m**3
Rho = Rho * 10**-3;# in kg/m**3
print "The density of copper crystal = %0.3f kg/m**3" %Rho
from math import sin, pi
# Given data
d = 2.82;# in Å
d = d * 10**-10;# in m
n = 1;
theta = 10;# in degree
#Formula 2*d*sin(theta) = n*lembda;
lembda = 2*d*sin(theta*pi/180);# in m
lembda = lembda * 10**10;# in Å
print "The wavelength of X-ray = %0.3f Å" %lembda
from math import sin
from numpy import pi
# Given data
lembda = 1.6;# in Å
lembda = lembda * 10**-10;# in m
theta = 14.2;# in degree
n = 1;
#Formula 2*d*sin(theta) = n*lembda;
d = (n*lembda)/(2*sin(theta*pi/180));# in m
d = d * 10**10;# in Å
print "The spacing of atomic layer in the crystal = %0.2f Å" %d
# Note : In the book the unit of the answer is wrong.
from math import sin
# Given data
n = 1;
theta = 30;# in degree
lembda = 1.78;# in Å
lembda = lembda * 10**-10;# in m
#Formula 2*d*sin(theta) = n*lembda;
d = (n*lembda)/(2*sin(theta*pi/180));# in m
d = d * 10**10;# in Å
print "The interplaner spacing = %0.2f Å" %d
from math import sin
# Given data
lembda = 0.58;# in Å
n = 1;
theta1 = 6.45;# in degree
d = (n*lembda)/(2*sin(theta1*pi/180));# in Å
print "Part (i) : At angle of 6.45°, Interplaner spacing of the crystal = %0.3f Å" %d
theta2 = 9.15;# in degree
d1 = (n*lembda)/(2*sin(theta2*pi/180));# in Å
print "Part(ii) : At angle of 9.15°, Interplaner spacing of the crystal = %0.3f Å" %d1
theta3 = 13;# in degree
n2 = 1;
d2 = (n2*lembda)/(2*sin(theta3*pi/180));# in Å
print "Part(iii) : At angle of 13°, Interplaner spacing of the crystal = %0.3f Å" %d2
# For
n=2;
d2 = (n*lembda)/(2*sin(theta3*pi/180));# in Å
print "Part (iv) : The interplaner spacing = %0.3f Å" %d2
print "The interplaner spacing for some other set of reflecting = %0.3f Å" %d1
from math import sqrt
from math import asin
# Given data
a = 2.814;# in Å
h = 1;
k = 0;
l = 0;
d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in Å
n = 2;
lembda = 0.710;# in Å
#Formula 2*d*sin(theta) = n*lembda;
theta = asin(n*lembda/(2*d) )*180/pi;# in degree
print "The glacing angle = %0.2f degree" %theta
from numpy import pi
# Given data
a = 3.65;# in Å
h = 1;
k = 0;
l = 0;
d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in Å
n = 1;
theta = 60;# in degree
#Formula 2*d*sin(theta) = n*lembda;
lembda = 2*d*sin(theta*pi/180);# in Å
print "Wavelength of X ray = %0.4f Å" %lembda
from math import sqrt
# Given data
lembda = 1.54;# in Å
lembda= lembda*10**-8;# in cm
At = 63.54;# atomic weight
density = 9.024;# in gm/cc
n = 1;
N_A = 6.023*10**23;
m = At/N_A;# mass
a =(density*m)**(1/3);# in cm
h = 1;
k = 0;
l = 0;
d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in cm
n = 1;
#Formula 2*d*sin(theta) = n*lembda;
theta = asin( (lembda)/(2*d) )*180/pi;# in degree
print "The glancing angle = %0.4f degree" %theta
from math import sqrt
# Given data
a = 3.615;# in Å
theta = 22;# in degree
n = 1;
h = 1;
k = 1;
l = 1;
d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in Å
# 2*d*sin(theta) = n*lembda;
lembda = 2*d*sin(theta*pi/180);# in Å
print "The wavelength = %0.3f Å" %lembda
n = 2;
#Formula 2*d*sin(theta) = n*lembda;
theta = asin(n*lembda/(2*d) )*180/pi;# in degree
print "The glacing angle for second order = %0.2f degree" %theta
print "To get the 2nd order spectrum the position of the detector should be %0.2f °" %(2*theta)
from math import sin
# Given data
n = 1;
lembda = 1.54;# in Å
theta = 21.7;# in degree
#Formula 2*d*sin(theta) = n*lembda;
d = (lembda*n)/(2*sin(theta*pi/180));# in Å
h = 1;
k = 1;
l = 1;
# Formula d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));
a = d*(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in Å
print "Lattice constant = %0.3f Å" %a
from math import sqrt
# Given data
a = 4.8;# in Å
h = 2;
k = 1;
l = 1;
d = a/(sqrt( ((h)**2) + ((k)**2) + ((l)**2) ));# in Å
print "The distance between d_211 plains = %0.2f Å" %d
from math import sqrt
# Given data
r = 1.28;# in Å
#Formula r = (a*sqrt(2))/4;
a = (4*r)/(sqrt(2));# in Å
a = a * 10**-8;# in cm
n = 4;
M = 63.5;
N_A = 6.023*10**23;
Rho = (n*M)/(N_A*((a)**3));# in gm/cc
print "The density = %0.2f gm/cc" %Rho
# Given data
a = 2.9;# in Å
a = a * 10**-8;# in cm
Rho = 7.87;# in gm/cc
N_A = 6.023*10**23;
M = 55.85
# Rho = (n*M)/(N_A*((a)**3))
n = (Rho*N_A*((a)**3))/M;# in atoms per unit cell
print "The number of atoms per unit cell = %0.f " %n
from math import sqrt
# Given data
M =60;# in gm/mole
Rho = 6.23;# in gm/cc
n = 4;
N_A = 6.023*10**23;
# Rho = (n*M)/(N_A*((a)**3));
a = ( (n*M)/(N_A*Rho) )**(1/3);# in cm
r = (a*sqrt(2))/4;# in cm
r = r * 10**8;# in Å
print "The radius = %0.3f Å" %r
from math import sqrt
# Given data
Rho = 5.96;# in gm/cc
M = 50;
n = 2;
N_A = 6.023*10**23;
#Formula Rho = (n*M)/(N_A*((a)**3));
a = ( (n*M)/(N_A*Rho) )**(1/3);# in cm
r = (a*sqrt(3))/4;# in cm
P_F = (2*(4/3)*pi*((r)**3))/((a)**3);# Packing factor
print "The Packing factor = %0.2f" %P_F
# Given data
d = 5.2;# in gm/cc
n = 2;
M = 120;
N_A = 6.023*10**23;
m = M/N_A;#mass of 1 atom in gm
m = n*m;#mass of unit cell in gm
g = 20;# in gm
m = g/m;# in unit cells
print "The number of unit cell in its 20 gm = %0.3e" %m
from math import sqrt
# Given data
Rho = 2.48;# in gm/cc
K = 39;# molecular weight of K
F = 19; # molecular weight of F
M = K+F;# molecular weight of KF
n = 4;
N_A = 6.023*10**23;
#Formula Rho = (n*M)/(N_A*((a)**3));
a = ( (n*M)/(N_A*Rho) )**(1/3);# in cm
a = a * 10**8;# in Å
r = (a*sqrt(2))/4;# in Å
r = 2*r;# in Å
print "The distance between ions = %0.1f Å" %r