#initiation of variable
from math import sqrt
R = 1.0 # let radius of an atom is unity
#calculation
#For FCC a=2*R*sqrt(2)
a=2.0*R*sqrt(2.0) #Edge Length
V=a**3 #Volume determination
#result
print" Volume of an FCC unit cell is %fR^3 " %V
#initiation of variable
from math import sqrt, pi
R = 1.0 # let radius of an atom to be unity
n=4.0 # no. of atoms for FCC are 4
#calculation
a=2.0*R*sqrt(2.0) # edge length for FCC
Vc=a**3 #Volume of cube
Vs=n*4*pi*R**3/3 #Volume of sphere
APF=Vs/Vc #Atomic packing Fraction
#result
print" Atomic packing factor is %.2f" %APF
#initiation of variable
from math import sqrt, pi
R=1.28e-08#Atomic radius in cm
A_Cu=63.5 #Atomic wt of copper
n=4.0 #For FCC
Na=6.023e23 #Avogadro no.
#calculation
a=2*R*sqrt(2.0)
Vc=a**3
rho=n*A_Cu/(Vc*Na)
#result
print" Density of copper is %.2f g/cm^3." %rho
#initiation of variable
from math import sqrt, pi, cos
theta = 30.0 # angle between a line joining centres of anion with their median in degree
#calculation
r_ratio = (1- cos(theta*pi/180))/ cos(theta*pi/180)
#result
print" Minimum cation to anion radius ratio is %.3f" %r_ratio
#initiation of variable
from math import sqrt, pi, cos
r_fe2 = 0.077 # radius of Iron ion in nm
r_o2 = 0.14 # radius of oxygen ion in nm
r_ratio = r_fe2 /r_o2 # cation - anion radius ratio for FeO
#calculation
if r_ratio > 0.414 and r_ratio < 0.732 :
print" As ratio lies between 0.414 and 0.732 and coordination number 6, so it is of AX crystal structure."
print "coordination number 6 is taken from table"
#initiation of variable
from math import sqrt, pi, cos
n = 4.0 # number of crystals per unit cell
A_c = 22.99 # molar mass of cation i.e. sodium
A_a = 35.45 # molar mass of cation i.e. chlorine
r_c = 1.02e-8 # radius of sodium atom in cm
r_a = 1.81e-8 # radius of sodium atom in cm
N_a = 6.023e23 # Avogadro constant
#result
a = 2*(r_c+r_a)# edge length of Nacl molecule
V_c = a**3 # Volume of unit cell
rho = (n*(A_c+A_a))/(V_c*N_a)
#result
print" Theoretical density of crystal is %0.2f g/cm^3 ." %rho
print" This result compares very favourable with experimental value of 2.16 g/cm^3 ."
#initiation of variable
from math import sqrt, pi, cos
n = 2 # number of repeated units within unit cell
A_c = 12.01 # molar mass of carbon
A_h = 1.008 # molar mass of hydrogen
a = 0.741 # edge length in x axis in nm
b = 0.494 # edge length in y axis in nm
c = 0.255 # edge length in z axis in nm
N_a = 6.023e23 # Avogadro constant
rho_s = 0.925 # density of branched polyethylene in g/cm^3
rho_a = 0.870 # density of totally amorphous polyethylene in g/cm^3
# Part A
#calculation
A = 2*A_c+4*A_h # Molar mass of polyethylene
V_c = a*b*c*(1.0e-7)**3 # Volume of unit cell
rho_c = (n*A)/(V_c*N_a)
print" Density of totally crystalline polyethylene is %0.3f g/cm^3 ." %rho_c
#part B
per_cry = (rho_c*(rho_s-rho_a))*100/(rho_s*(rho_c-rho_a))
#result
print" Percentage crystallinity is %0.1f percent" %per_cry
#initiation of variable
from math import sqrt, pi, cos, asin
a = 0.2866 # lattice parameter in nm
h = 2.0 # component of set of plane
k = 2.0# component of set of plane
l = 0.0# component of set of plane
n = 1.0 # order of detraction
Lambda = 0.1790 # wavelength of light in nm
#part A
#calculation
d_hkl=a/(sqrt(h**2+k**2+l**2))
theta=asin(n*Lambda/(2*d_hkl))
#result
print" Interplanar spacing is %.4f nm." %d_hkl
# Part B
print " Diffraction angle is %0.2f degree." %(2*theta*180/pi)
print "Answer in book is 124.26 degree. It is so because of consideration of different number of significant figures in calculation."