#importing modules
import math
from __future__ import division
#Variable declaration
r = 1; #assume value of r as 1
#Calculation
#since 4*r = math.sqrt(3)*a
a = 4*r/math.sqrt(3);
R = (a-(2*r))/2; #since 2*r+2*R = a
R = math.ceil(R*10**3)/10**3; #rounding off to 3 decimals
#Result
print "radius of interstitial sphere is",R,"r"
#importing modules
import math
from __future__ import division
#Variable declaration
r_BCC = 1.258; #atomic radius(Angstrom)
r_FCC = 1.292; #atomic radius(Angstrom)
#Calculation
a_BCC = (4*r_BCC)/math.sqrt(3); #In BCC(Angstrom)
a_BCCm = a_BCC*10**-10; #converting a from Angstrom to m
V_BCC = a_BCCm**3; #volume of unit cell(m^3)
n_BCC = ((1/8)*8)+1; #number of atoms per unit cell
V1_BCC = V_BCC/n_BCC; #volume occupied by 1 atom(m^3)
a_FCC = 2*math.sqrt(2)*r_FCC; #In FCC(Angstrom)
a_FCCm = a_FCC*10**-10; #converting a from Angstrom to m
V_FCC = a_FCCm**3; #volume of unit cell(m^3)
n_FCC = ((1/2)*6) + ((1/8)*8); #number of atoms per unit cell
V1_FCC = V_FCC/n_FCC; #volume occupied by 1 atom(m^3)
delta_V = (V1_BCC - V1_FCC)*100/V1_BCC; #change in volume in %
delta_V = math.ceil(delta_V*10)/10; #rounding off to 1 decimal
#Result
print "decrease of volume during conversion from BCC to FCC is",delta_V,"%"
#importing modules
import math
from __future__ import division
#Variable declaration
a = 0.27; #nearest neighbour distance(nm)
c = 0.494; #height of unit cell(nm)
N = 6.023*10**26; #avagadro number(k/mol)
M = 65.37; #atomic weight(kg)
#Calculation
a_m = a*10**-9; #nearest neighbour distance(m)
c_m = c*10**-9; #height of unit cell(m)
V = 3*math.sqrt(3)*(a_m**2)*c_m/2; #volume of unit cell(m^3)
#if rho is density then mass = V*rho
#V*rho = 6*M/N
rho = (6*M)/(N*V); #density(kg/m^3)
#Result
print "Volume of the unit cell is",round(V/1e-29,2),"*10^-29 m^3"
print "density of Zinc is",round(rho),"kg/m^3"
print "answer for density given in the book differs due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
r = 1; #assume value of r as 1
#Calculation
a = 4*r/math.sqrt(2); #for FCC structure
R = (a/2)-r; #since 2*r+2*R = a
R = math.ceil(R*10**4)/10**4; #rounding off to 4 decimals
#Result
print "maximum radius of the sphere that can fit into the void is",R,"r"
#importing modules
import math
from __future__ import division
#Variable declaration
a = 0.356; #cube edge of diamond(nm)
aw = 12.01; #atomic weight of carbon(kg)
N = 6.023*10**26; #avagadro's number
#Calculation
a_m = a*10**-9; #cube edge of diamond(m)
n = 8/(a_m**3); #number of atoms(per m^3)
n = n/10**29;
n = math.ceil(n*10**3)/10**3; #rounding off to 3 decimals
n = n*10**29;
M = aw/N; #mass of 1 carbon atom(kg)
rho = M*n;
#Result
print "number of atoms per m^3 is",n
print "density of diamond is",int(rho),"kg/m^3"
print "answer for density given in the book differs due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
MW = 23+35.5; #molecular weight of NaCl(gm)
N = 6.023*10**23; #avagadro number(mol-1)
rho = 2.18; #density of NaCl(gm/cm^3)
V = 1; #volume of unit cube(cm^3)
#Calculation
M = MW/N; #mass of NaCl molecule(gm)
n = rho/M; #number of molecules per unit volume
n = 2*n; #since NaCl is diatomic(atoms/cm^3)
#length of edge of unit cube is n*a
#volume V = n^3*a^3 = 1 cm^3
a = (V/n)**(1/3); #distance between two adjacent atoms(cm)
a = a*10**8; #distance between two adjacent atoms(A)
a = math.ceil(a*10**3)/10**3; #rounding off to 3 decimals
#Result
print "distance between two adjacent atoms is",a,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
AW = 63.5; #atomic weight of Cu(gm/mol)
N = 6.023*10**23; #avagadro's number(mol-1)
r = 1.278; #atomic radius(A)
n = 4; #number of atoms in unit cell
#Calculation
r = r*10**-8; #atomic radius(cm)
M = AW/N; #mass of each Copper atom(gm)
a = 4*r/math.sqrt(2); #lattice constant(cm)
m = n*M; #mass of unit cell(gm)
rho = m/a**3; #density of copper crystal(gm/cm^3)
rho = math.ceil(rho*10**3)/10**3; #rounding off to 3 decimals
#Result
print "density of Copper crystal is",rho,"gm/cm^3"
#importing modules
import math
from __future__ import division
#Variable declaration
r = 0.1249; #atomic radius(nm)
PF = 0.68; #packing factor for BCC
#Calculation
a = 4*r/math.sqrt(3); #lattice constant(nm)
a_m = a*10**-9; #lattice constant(m)
V = a_m**3; #volume of unit cell(m^3)
FV = 1-PF; #free volume
FV1 = FV*V; #free volume per unit cell(m^3)
#Result
print "free volume per unit cell is",round(FV1/1e-30,4),"*10^-30 m^3"
#importing modules
import math
from __future__ import division
#Variable declaration
#in (100) plane the total number of atoms are n
n = (1/4)*4;
#Calculation
#in (111) plane, area = (1/2)*base*height = (1/2)*a*sqrt(2)*a*sqrt(2)*cosd(30)
x = math.cos(30);
#area = (1/2)*a*sqrt(2)*a*sqrt(2)*x = 0.866*a^2 = 0.58/a^2
n1 = (1/360)*60*3;
#Result
print "number of atoms in (100) plane are",n;
#A = a^2. number of atoms per mm^2 is n/a^2
print "number of atoms per mm^2 is 1/a^2";
print "number of atoms in (110) plane is 1";
#in (110) plane, area is sqrt(2)*a*a = sqrt(2)*a^2
print "unit area contains 1/(sqrt(2)*a^2) = 0.707/a^2 atoms/mm^2";
print "total number of atoms in (111) plane is",n1
#number of atoms per unit area is 0.5/(0.866*a^2)
print "number of atoms per unit area is 0.58/a^2 atoms/mm^2";
#importing modules
import math
from __future__ import division
#Variable declaration
h1 = 1;
k1 = 1;
l1 = 0; #for (110) plane
h2 = 2;
k2 = 1;
l2 = 2; #for (212) plane
r = 0.1278; #atomic radius(nm)
#Calculation
r = r*10**-9; #atomic radius(m)
x1 = math.sqrt(h1**2+k1**2+l1**2);
a = 4*r/x1; #nearest neighbouring distance(m)
a = a*10**9; #nearest neighbouring distance(nm)
d_110 = a/x1; #interplanar spacing for (110),(nm)
x2 = math.sqrt(h2**2+k2**2+l2**2);
d_212 = a/x2; #interplanar spacing for (212),(nm)
d_212 = math.ceil(d_212*10**4)/10**4; #rounding off to 4 decimals
#Result
print "interplanar spacing for (110) is",d_110,"nm"
print "interplanar spacing for (212) is",d_212,"nm"
#importing modules
import math
from __future__ import division
#Variable declaration
h1 = 1;
k1 = 0;
l1 = 0; #for (100) plane
h2 = 1;
k2 = 1;
l2 = 0; #for (110) plane
h3 = 1;
k3 = 1;
l3 = 1; #for (111) plane
#Calculation
x1 = math.sqrt(1/(h1**2+k1**2+l1**2)); #for (100) plane
x2 = math.sqrt(1/(h2**2+k2**2+l2**2)); #for (110) plane
x3 = math.sqrt(1/(h3**2+k3**2+l3**2)); #for (111) plane
x2 = math.ceil(x2*10**2)/10**2; #rounding off to 2 decimals
x3 = math.ceil(x3*10**2)/10**2; #rounding off to 2 decimals
#Result
print "ratio of the seperation between successive lattice planes is %d:%.2f:%.2f"%(x1,x2,x3)
#importing modules
import math
from __future__ import division
#Calculation
#plane intercepts at a,b/2,3*c
#therefore intercepts are (1 1/2 3)
x = 1;
y = 1/2;
z = 3;
def lcm(x, y):
if y > z:
greater = y
else:
greater = z
while(True):
if((greater % y == 0) and (greater % z == 0)):
lcm = greater
break
greater += 1
return lcm
lcm = lcm(y,z);
x_dash = (1/x)*lcm; #miller index of x plane
y_dash = (1/y)*lcm; #miller index of y plane
z_dash = (1/z)*lcm; #miller index of z plane
#Result
print "miller indices of the plane are (",x_dash,y_dash,z_dash,")"
#importing modules
import math
from __future__ import division
#Variable declaration
d = 0.282; #lattice spacing(nm)
n = 1; #first order
theta = (8+(35/60))*(math.pi/180); #glancing angle(radian)
theeta = 90; #maximum value possible(degrees)
#Calculation
theeta = theeta*math.pi/180; #maximum value possible(radian)
d = d*10**-9; #lattice spacing(m)
lamda = 2*d*math.sin(theta)/n; #wavelength of X-rays(m)
lamda_nm = lamda*10**9; #wavelength of X-rays(nm)
lamda_nm = math.ceil(lamda_nm*10**4)/10**4; #rounding off to 4 decimals
n1 = 2*d*math.sin(theeta)/lamda; #maximum order of diffraction possible
#Result
print "wavelength of X-rays is",lamda_nm,"nm"
print "maximum order of diffraction possible is",int(n1)
#importing modules
import math
from __future__ import division
#Variable declaration
lamda = 1.5; #wavelength(A.U)
d = 1.6; #interplanar spacing(A.U)
theta = 90; #maximum glancing angle possible(degrees)
#Calculation
theta = theta*math.pi/180; #maximum glancing angle possible(radian)
n = 2*d*math.sin(theta)/lamda; #maximum possible diffraction order
#Result
print "maximum possible diffraction order is",int(n)
#importing modules
import math
from __future__ import division
#Variable declaration
h = 1;
k = 1;
l = 1; #for (111) plane
theta = 30; #glancing angle(degrees)
n = 1; #first order
lamda = 1.5418; #wavelength of X-rays(A)
#Calculation
theta = theta*math.pi/180; #glancing angle(radian)
x = math.sqrt(h**2+k**2+l**2);
lamda = lamda*10**-10; #wavelength of X-rays(m)
d = lamda/(2*math.sin(theta));
a = d*x; #interatomic spacing(m)
a = a*10**10; #interatomic spacing(A)
a = math.ceil(a*10**4)/10**4; #rounding off to 4 decimals
#Result
print "the interatomic spacing is",a,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
d100 = 0.28; #lattice constant(nm)
h = 1;
k = 1;
l = 0; #for (110) plane
n = 2; #second order
lamda = 0.071; #wavelength of X-rays(nm)
#Calculation
lamda_m = lamda*10**-9; #wavelength of X-rays(m)
d110 = d100/math.sqrt(h**2+k**2+l**2); #interatomic spacing(nm)
d110 = d110*10**-9; #interatomic spacing(m)
theta = math.asin(n*lamda_m/(2*d110)); #glancing angle(radian)
theta = theta*180/math.pi; #glancing angle(degrees)
#Result
print "the glancing angle is",int(theta),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
a = 0.38; #lattice constant(nm)
h = 1;
k = 1;
l = 0; #for (110) plane
#Calculation
d = a/math.sqrt(h**2+k**2+l**2);
d = math.ceil(d*10**2)/10**2; #rounding off to 2 decimals
#Result
print "the distance between (110) planes is",d,"nm"
#importing modules
import math
from __future__ import division
#Variable declaration
#area of (110) plane is a*sqrt(2)*a = sqrt(2)*a^2
theta = 30; #glancing angle(degrees)
#Calculation
theta = theta*math.pi/180; #glancing angle(radian)
n = (1/4)*4; #number of atoms
x = math.cos(theta);
#area of (111) plane is (a/sqrt(2))*x*a*sqrt(2)
#hence area is (sqrt(3)/2)*a^2
n1 = 3*(1/6); #number of atoms
#Result
print "area of (110) plane contains",n,"atom"
print "density of lattice points is 1/(sqrt(2)*a^2)"
print "area of (111) plane contains",n1,"atom"
#density of lattice points is (1/2)/(sqrt(3)*a^2/2)
print "density of lattice points is 1/(sqrt(3)*a^2)"
#density of lattice points (111) plane : (110) plane is 1/(sqrt(3)*a^2) : 1/(sqrt(2)*a^2) = sqrt(2):sqrt(3)
print "density of lattice points (111) plane : (110) plane is sqrt(2):sqrt(3)"
#importing modules
import math
from __future__ import division
#Variable declaration
n = 2; #second order
h = 1;
k = 1;
l = 0; #plane (110)
lamda = 0.065; #wavelength of X-rays(nm)
a = 0.26; #axial length(nm)
#Calculation
lamda_m = lamda*10**-9; #wavelength of X-rays(m)
a_m = a*10**-9; #axial length(m)
x = math.sqrt(h**2+k**2+l**2);
theta = math.asin(n*lamda_m*x/(2*a_m)); #glancing angle(radian)
theta = theta*180/math.pi; #glancing angle(degrees)
deg = int(theta); #glancing angle(degrees)
t = 60*(theta-deg);
mint = int(t); #glancing angle(minutes)
#Result
print "the glancing angle is",deg,"degrees",mint,"minutes"
#importing modules
import math
from __future__ import division
#Variable declaration
n = 1; #first order
h = 1;
k = 1;
l = 1; #for (111) plane
lamda = 1.54; #wavelength(A.U)
theta = 19.2; #Bragg's angle(degrees)
#Calculation
lamda_m = lamda*10**-10; #wavelength(m)
theta = theta*math.pi/180; #Bragg's angle(radian)
d = n*lamda_m/(2*math.sin(theta)); #interplanar spacing(m)
a = d*math.sqrt(h**2+k**2+l**2); #cube edge(m)
a_AU = a*10**10; #cube edge(A.U)
a_AU = math.ceil(a_AU*10**4)/10**4; #rounding off to 4 decimals
#Result
print "the cube edge is",a_AU,"A.U"
#importing modules
import math
from __future__ import division
#Variable declaration
n = 1; #first order
h = 1;
k = 1;
l = 1; #for (111) plane
lamda = 1.54; #wavelength(A.U)
theta = 19.2; #Bragg's angle(degrees)
#Calculation
lamda_m = lamda*10**-10; #wavelength(m)
theta = theta*math.pi/180; #Bragg's angle(radian)
d = n*lamda_m/(2*math.sin(theta)); #interplanar spacing(m)
a = d*math.sqrt(h**2+k**2+l**2); #cube edge(m)
#Result
print "the cube edge is",round(a/1e-10,3),"*10^-10 m"