#exa 1.4
from math import pi
a=1.
print "a= ",a # initializing value of lattice constant(a)=1.
r=a/2.
print "r=a/2 = ",r # initializing value of radius of atom for simple cubic .
v=((4*pi*(r**3))/3)
print "Volume of one atom ,v=((4∗%pi∗(rˆ3))/3)= ",v # calcuation .
V=a**3
print "Total Volume of the cube ,V=aˆ3 = ",V # calcuation .
Fp=(v*100/V)
print "Fp(S.C)=(v∗100/V)= ",Fp,# calculation
#exa 1.5
from math import sqrt
a=1.
print "a= ",a # initializing value of lattice constant(a)=1.
r=(sqrt(3)*(a**2/4))
print "Radius of the atoms,r=(sqrt(3)∗(aˆ2/4)) = ",r # initializing value of radius of atom for BCC.
v=((4*pi*(r**3))/3)*2
print "Volume of two atom,v=((4∗pi∗(rˆ3))/3)∗2 = ",v # calcuation
V=a**3
print "Total Volume of the cube ,V=aˆ3 = ",V # calcuation .
Fp=(v*100/V)
print "Fp(B.C.C)=(v∗100/V)= ",Fp,"%" # calculation
#exa 1.6
a=1
print "a= ",a # initializing value of lattice constant(a)=1.
r=(a/(2*sqrt(2)))
print "Radius of the atom,r=(a/(2∗sqrt(2)))= ",r # initializing value of radius of atom for FCC .
v=(((4*pi*(r**3))/3)*4)
print "Volume of the four atom,v=(((4∗pi∗(rˆ3))/3)∗4)= ",v # calcuation
V=a^3
print "Total volume of the cube ,V=aˆ3= ",V # calcuation .
Fp=(v*100/V)
print "Fp(F.C.C)=(v∗100/V)= ",Fp,"%" # calculation
#Exa 1.8
a=1
print "a= ",a # initializing value of lattice constant(a)=1.
r=((sqrt(3)*a/8))
print "Radius of the atom , r=(sqrt (3)∗a/8))= ",r # initializing value of radius of atom for diamond .
v=(((4*pi*(r**3))/3)*8)
print "v=(((4∗pi∗(rˆ3))/3)∗8) = ",v # calcuation .
V=a^3
print "V=aˆ3= ",V # calcuation .
Fp=(v*100/V)
print "Fp(Diamond)=(v∗100/V) = ",Fp,"%" # calculation
#exa 1.9
a=5*10**-8
print "a = ",a," cm" # initializing value of lattice constant .
r=(sqrt(3)*(a/4))
print "Radius of the atom,r=(sqrt(3)∗(a/4))= ",r # initializing value of radius of atom for BCC.
v=((4*pi*(r**3))/3)*2
print "Volume of the two atoms ,v=((4∗pi∗(rˆ3))/3)∗2= ",v # calcuation .
V=a**3
print "Total Volume of the cube ,V=aˆ3 = ",V # calcuation .
Fp=(v*100/V)
print "Fp(B.C.C)=(v∗100/V) = ",Fp,"%" # calculation
#exa 1.10
x=1
print "x intercept = ",x # initializing value of x intercept .
y=float('inf')
print "y intercept = ",y # initializing value of y intercept .
z=float('inf')
print "z intercept = ",z # initializing value of z intercept .
h=[1/x]
print "miller indices ,h=(1/x )= ",h # calculation
k=[1/y]
print "k=(1/y)= ",k # calculation
l=[1/z]
print "l=(1/z) = ",l # calculation
#exa 1.11
x=float('inf')
print "x intercept = ",x # initializing of x intercept .
y=float('inf')
print"y intercept = ",y # initializing of Y intercept .
z=1
print "z intercept = ",z # initializing of Z intercept .
h=[1/x]
print "miller indices ,h=[1/x] = ",h # calculation
k=[1/y]
print "k=[1/y] = ",k # calculation
l=[1/z]
print "l=[1/z] = ",l # calculation
#exa 1.12
x=float('inf')
print "x intercept = ",x # initializing of X intercept .
y=1
print "y intercept = ",y # initializing of X intercept .
z=float('inf')
print "z intercept = ",z # initializing of X intercept .
h=[1/x]
print "miller indices ,h=[1/x] = ",h # calculation
k=[1/y]
print "k=[1/y] = ",k # calculation
l=[1/z]
print "l=[1/z] = ",l #calculation
#exa 1.13
x=1
print "x intercept = ",x # initializing of X intercept .
y=1
print "y intercept = ",y # initializing of X intercept .
z=float('inf')
print "z intercept = ",z # initializing of X intercept .
h=[1/x]
print "miller indices ,h=[1/x] = ",h # calculation
k=[1/y]
print "k=[1/y] = ",k # calculation
l=[1/z]
print "l=[1/z] = ",l #calculation
#exa 1.14
x=float('inf')
print "x intercept = ",x # initializing of X intercept .
y=1
print "y intercept = ",y # initializing of X intercept .
z=1
print "z intercept = ",z # initializing of X intercept .
h=[1/x]
print "miller indices ,h=[1/x] = ",h # calculation
k=[1/y]
print "k=[1/y] = ",k # calculation
l=[1/z]
print "l=[1/z] = ",l #calculation
x=2
print "x intercept = ",x # initializing of X intercept .
y=2
print "y intercept = ",y # initializing of X intercept .
z=2
print "z intercept = ",z # initializing of X intercept .
c=2
print "common factor of all the intercept= ",c # initializing value of common factor of all the intercepts .
h=[c/x]
print "miller indices ,h=[c/x] = ",h # calculation
k=[c/y]
print "k=[c/y] = ",k # calculation
l=[c/z]
print "l=[c/z] = ",l #calculation
#exa 1.16
Wa =28.1
print "Wa = ",Wa # initializing value of atomic weight .
D=2.33
print "D = ",D,"ram/cmˆ3" # initializing value of density .
Na=6.02*10**23
print "Na = ",Na,"atoms/mole" # initializing value of avagadro number .
na =(Na*D)/(Wa)
print "na =(Na∗D)/(Wa)= ",na," atoms/cmˆ3" # calculation
# the value of na (number of atoms in 1 cmˆ3 of silicon ) , provided after calculation in the book is wrong.
#exa 1.17
a=5*10**-8
print "a= ",a,"cm" # initializing value of lattice constant .
N=2
print "N= ",N # initializing value of no. of atoms in unit cell .
V=a**3
print "V=aˆ3 = ",V,"cmˆ3" # initializing value of total Volume of the unit cell.
na =(N/(V))
print "na=(no.of atoms in unit cell/Volume of theunit cell) =(N/(V))= ",na # calculation
#exa 1.18
a=5.43*10**-8
print "a = ",a,"cm" # initializing value of lattice constant .
N=8
print "N = ",N # initializing value of no. of atoms in a unit cell .
ns =(N/(a**3))
print "Number of atom in the cmˆ3,ns =(N/(aˆ3))= ",ns # calculation
#exa 1.19
a=5.43*10**-8
print "a = ",a,"cm" # initializing value of lattice constant .
Wa =28.1
print "Wa = ",Wa # initializing value of atomic weight .
Na=6.02*10**23
print "Na = ",Na # initializing value of avagdro number .
ns =5*10**22
print "ns = ",ns,"atoms/cmˆ3" # initializing value of atoms/cmˆ3.
D =(ns*Wa)/(Na)
print "Density of silicon ,D =(ns∗Wa)/(Na)= ",D," gm/cmˆ2" # calculation
#exa 1.20
a=4.75*10**-8
print "a = ",a,"cm" # initializing value of lattice constant .
N=4
print "N = ",N # initializing value of number of atoms in the unit cell .
na =(N/(a**3))
print "na =(N/(aˆ3))=",na # calculation