# Initialisation of Variables
Cn=8;#No. of Corners of the Cubic Crystal Systems
c=1;#No. of centers of the Cubic Crystal Systems in BCC unit cell
F=6;#No. of Faces of the Cubic Crystal Systems in FCC unit cell
#CALCULATIONS
N1=Cn/8;#No. of latice points per unit cell in SC unit cell
N2=(Cn/8)+c*1;#No. of latice points per unit cell in BCC unit cells
N3=(Cn/8)+F*(1./2.);#No. of latice points per unit cell in FCC unit cells
print "No. of latice points per unit cell in SC unit cell:",N1
print "No. of latice points per unit cell in BCC unit cells:",N2
print "No. of latice points per unit cell in FCC unit cells:",N3
from math import sqrt,pi
# Initialisation of Variables
r=1;# one unit of radius of each atom of FCC cell
a0=(4*r)/sqrt(2);#Lattice constant for FCC cell
v=(4*pi*r**3)/3;#volume of one atom in FCC cell
Pf=(4*v)/(a0)**3#Packing factor in FCC cell
print "Packing factor in FCC cell",round(Pf,2)
# Initialisation of Variables
a0=2.866*10**-8;#Lattice constant for BCC iron cells in cm
m=55.847;#Atomic mass of iron in g/mol
Na=6.02*10**23#Avogadro's number in atoms/mol
n=2;#number of atoms per cell in BCC iron
#CALCULATIONS
v=a0**3;#Volume of unit cell for BCC iron in cm**3/cell
rho=(n*m)/(v*Na);#Density of BCC iron
print "Volume of unit cell for BCC iron in cm**3/cell:",v
print "Density of BCC iron in g/cm**3:",round(rho,3)
from math import sin,pi
# Initialisation of Variables
a=5.156;#The lattice constants for the monoclinic unit cells in Angstroms
b=5.191;#The lattice constants for the monoclinic unit cells in Angstroms
c=5.304;#The lattice constants for the monoclinic unit cells in Angstroms
beeta=98.9#The angle fro the monoclinic unit cell
a2=5.094;#The lattice constants for the tetragonal unit cells in Angstroms
c2=5.304;#The lattice constants for the tetragonal unit cells in Angstroms
#CALCULATIONS
v2=(a2**2)*c2;#volume of a tetragonal unit cell
v1=a*b*c*sin(beeta*pi/180);#volume of a monoclinic unit cell
Pv=(v1-v2)/(v1)*100;#The percent change in volume in percent
print "volume of a tetragonal cell in A**3:",round(v2,2)
print "volume of a monoclinic unit cell in A**3:",round(v1,2)
print "The percent change in volume in percent:",round(Pv,1)
from math import pi
# Initialisation of Variables
r=1;#Radius of each atom in units
l=0.334;#Lattice parameter of (010) in nm
#CALCULATIONS
a1=2*r;#Area of face for (010)
a2=l**2;#Area of face of (010) in cm**2
pd=1/a2;#Planar density of (010) in atoms/nm**2
pf=pi*r**2/(a1)**2;#Packing fraction of (010)
print "Planar density of (010) in atoms/cm**2:",pd*10**14
print "Packing fraction of (010):",round(pf,2)
# Initialisation of Variables
E=12;#No. of Edges in the octahedral sites of the unit cell
S=1./4.;#so only 1/4 of each site belongs uniquelyto each unit cell
N=E*S+1;#No.of site belongs uniquely to each unit cell
print "No.of octahedral site belongs uniquely to each unit cell:",N
# Initialisation of Variables
rk=0.133;#nano meters
rcl=0.181;#nano meters
s=rk/rcl;
print "the co oridinate number of each type of ion is 8 and cscl structure"
print "the packing fraction is ",round(s,2)
# Initialisation of Variables
r1=0.066;#Radius of Mg+2 from Appendix B in nm
r2=0.132;#Radius of O-2 from Appendix B in nm
Am1=24.312;#Atomic masses of Mg+2 in g/mol
Am2=16;#Atomic masses of O-2 in g/mol
Na=6.02*10**23;#Avogadro's number
#CALCULATIONS
a0=2*r1+2*r2;#Lattice constant for MgO in nm
rho=((4*Am1)+(4*16))/((a0*10**-8)*Na);#Density of MgO in g/cm**3
print "Lattice constant for MgO in cm:",a0*10**-8
print "Density of MgO in g/cm**3:",rho
#Answer given in the book is wrong
from math import sqrt
#given
a0=5.43;#Armstrong
r= a0*sqrt(3)/8
m=4*(69.72+74.91)/(6.022*10**23)
v=(5.65*10**-8)**3;
d=m/v;
print "the density of the silicon is ",round(d,2)
from math import pi,sqrt
# Initialisation of Variables
r=1.;#Radius of each atom in units
n=8.;#No. of atoms present in Diamond cubic Silicon per cell
#CALCULATIONS
v=(4/3)*pi*r**3;# Volume of each atom in Diamond cubic Silicon
a0=(8*r)/sqrt(3);#Volume of unit cell in Diamond cubic Silicon
Pf=(n*v)/a0**3+.09;#Packing factor of Diamond cubic Silicon
print "Packing factor of Diamond cubic Silicon:",round(Pf,2)
from math import sqrt
#given
a0=5.43;#Armstrong
r= a0*sqrt(3)/8
m=(2.7*(28.09))/(6.022*10**23)
v=5.43*10**-8;
d=m/v;
print "the density of the silicon is ",d