#pg 290
#calculate the miller indices
#Given :
#Intercepts
ix = 1./3 ; #along x-axis
iy = 2./3; # along y-axis
iz =1.; # along z-axis
#calculations
#Reciprocals
rx = 1./ix;
ry = 1./iy;
rz = 1./iz;
#Conversion
x = rx*2;
y = ry*2;
z = rz*2;
#results
print "Miller indices of the plane are : ",x,y,z
#pg296
#calculate the r/a and Crystal Structure
#Given:
import math
n = 1.;
theta = 30.; # angle in degrees
lambd = 1.67; # wavelength in A
r = 1.25; # atomic radius in A
#calculations
#Bragg's Law : 2*d*sin(theta) = n*lambd , d= d111
d111 = (n*lambd)/(2*math.sin(theta/57.3));
#plane (111)
h =1;k=1;l=1;
#dhkl = a/sqrt(h**2 + k**2 + l**2)
a = d111*math.sqrt(h**2 + k**2 + l**2); # in A
ratio = r/a;
#results
print" Since, r/a =",round(ratio,3)," and r =",round(ratio,3),"*a Crystal Structure : BCC"
#pg 297
#calculate the density of silver
#Given:
import math
n = 1.;
theta = 30.; #angle in degrees
lambd = 2.88 ; # wavelength in A
M = 108.; # atomic weight in kg
Z = 4.; # unit cell of silver is FCC
Na = 6.023*10**26 ;# Avogadro constant in kmole
#calculations
#Bragg's Law : 2*d*sin(theta) = n*lambd , d = d110
d110 = (n*lambd)/(2*math.sin(theta/57.3)); # in A
#plane (110)
h =1;k=1;l=0;
#dhkl = a/sqrt(h**2 + k**2 + l**2)
a = d110*math.sqrt(h**2 + k**2 + l**2); # in A
#1 A = 1.0*10**-10 m
rho = (Z*M)/(Na*(a*10**-10)**3); # density in kg/m**3
#results
print" Density of silver (kg/m^3) = ",round(rho,2)