import math
# Variables
na = 6.023*10**23; #Avagadro's no.
p = 3170.; #density in kg/m**3
# Calculations
mw = 7.9*10**-2; #molecular weight of CaF2
nl = na*p/mw; #calcium ions/cubic m
ni = 2.*nl; # /cubic m
t = 1300.; #in K
ef = 2.7*1.6*10**-19.; #energy of formation of one frenkel defect
k = 1.38*10**-23; #boltzmann constant
nf = math.sqrt(nl*ni)*math.exp(-ef/(2*k*t)); #in /cubic m
# Results
print "No. of Frenkel defect per unit volume of Calcium Fluoride (in /m**3) = %.2e /m**3"%nf
# note: Answers may vary because of rouding error.
import math
# Variables
r = 8.314; # J/mol K
t1 = 300.; #in K
t2 = 1000.; #in K
# Calculations
ent = 168*10**3; #enthalpy of formation of vacancy in J/mol
x1 = math.exp(-ent/(r*t1)); #x1 = n/Na
x2 = math.exp(-ent/(r*t2)); #x2 = n/Na
rt = x1/x2; #ratio
# Results
print "Ratio of no. of vacancies = %.2e"%rt
# Calculations
# for 1/6[121] dislocation
a1 = 1./6 * 1 # x - component
b1 = 1./6 * 2 # y - component
c1 = 1./6 * 1 # z - component
# for 1/6[211] dislocation
a2 = 1./6 * 2 # x - component
b2 = 1./6 * 1 # y - component
c2 = 1./6 * -1 # z - component
a = a1 + a2 # x - component
b = b1 + b2 # y - component
c = c1 + c2 # z - component
# Results
print "X-component a = %.1f"%a
print "Y-component b = %.1f"%b
print "Z-component c = %.1f"%c
print "Thus, [abc] = [%.1f %.1f %.1f] = 1/2[110]"%(a,b,c)
print "Hence, 1/6[121] + 1/6[211] -> 1/2[110] proved"
import math
# Variables
v = 0.31; #poisson's ratio
bv = .25*10**-9; #burger's vector in m
ri = 1.1*10**-9; #in m
# Calculations
r0 = 10.**5*bv; #in m
sm = 45.*10**9; #shear modulous in n/sqm
gb_2 = sm*bv**2;
u_ed = (gb_2/(4*3.14*(1-v)))*math.log(r0/ri);
u_sd = (gb_2/(4*3.14))*math.log(r0/ri);
r = u_ed/u_sd; #ratio
# Results
print "Elastic Strain Energy of Edge dislocation (in J/m) = %.2e J/m"%u_ed
print "Elastic Strain Energy of Screw dislocation (in J/m) = %.2e J/m"%u_sd
print "Ratio of energies of edge dislocation over screw dislocation = %.2f"%r
# Variables
r = 1.7*10**-10; #atomic radius in m
n1 = 10.**-3; #1mm = 10**-3m
# Calculations
a = 2*r; #in m
n = n1/a;
ed = 2.*10**-6; #edge dislocation in m
ns = ed/a;
nv = n*ns;
# Results
print "Total no. of created vacancies = %.2e"%nv
import math
# Variables
c1 = 3.61 # lattice parameter of copper
c2 = 44 # shear modulus of copper
# Calculations
b = c1*math.sqrt(1**2 + 1**2 + 0**2)/2.
U = c2*b**2 * 10**9 * 10**-20/2.
# Results
print "The magnitude of the Burgers vector : %.3f A"%b
print "LIne energy of dislocation U : %.3e J/m"%U
import math
# Variables
a = 3.84 # lattice constant
h = 1
k = 1
l = 0
# calculations
b = a*math.sqrt(h**2 + k**2 + l**2)/2.
h1 = b/math.tan(math.radians(1))
h3 = b/math.tan(math.radians(3))
# Results
print "b = %.3f A"%b
print "Spacing between dislocaitons in a low angle tilt boundary in iridium"
print "When,"
print "Angle of tilts 1 = %.2f A"%h1
print "Angle of tilts 3 = %.2f A"%h3