from __future__ import division
from math import sqrt
#given
#applied stress
sigmax=3.5 #MPa
#aluminium crystal slips from (111) plane in the direction (110) when the stess is applied to (1-11)
#so
h1=1
k1=1
l1=1
h2=1
k2=-1
l2=1
#magnitude of plane (111)
M1=sqrt(h1**2+k1**2+l1**2)
#magnitude of (1-11)
M2=sqrt(h2**2+k2**2+l2**2)
#direction (110)
h3=1
k3=1
l3=0
#magnitude of direction(110)
M3=sqrt(h3**2+k3**2+l3**2)
#the angle between the planes (111) and (1-11) is
cosphie=((h1*h2+k1*k2+l1*l2)/(M1*M2))
sinphie=sqrt(1-(cosphie)**2)
#similarly angle between the plane (111) and the direction (110) is given by
costheta=((h1*h3+k1*k3+l1*l3)/(M1*M3))
#critical resolved shear stress
taucr=sigmax*2*sinphie*cosphie*costheta/2 #MPa
print "the critical resolved shear stress is %0.3f MPa"%(taucr)
#given
#shera stress
tau=715*10**6 #Pa
#shear modulus
G=25*10**9 #Pa
#atomic radius
b=4.05*10**-10 #m
#as we know that
#tau=G*b/l
#so
l=G*b/tau #m
print "the length of frank- read source in aluminium crystal is %.10f m"%(l)
#given
#shear modulous
G=25*10**9 #Pa
#shear stress
tau=50*10**6 #Pa
#lattice constant of aluminium is
a=4.05*10**-10 #m
#burger's vector for aluminium is 1/2(110)
h=1
k=1
l=0
#atomic radius of aluminium
b=a/sqrt(h**2+k**2+l**2) # m
#as we know that
#tau=G*b/L
#so
L=G*b/tau #m
#disloaction density is rhoD (let)
rhoD =1/L**2 # per m**2 (calculation mistake, there in book formula written is correct but calculation is wrong)
print "the dislocation density is %0.3e per m**2"%(rhoD)
#given
#burger vector
b=4*10**-10 #m
#density
N=10**13 #lines/m**2
#velocity
v=10**-5 #m/s
#rate of straining
epsilonP=N*b*v #lines/sec
print "the rate of starining is %0.3f lines/sec"%(epsilonP)
from math import log, exp
#given
#conventional stress
sigmac=98.9 #MPa
#conventional strain
epsilonc=0.35 #mm/mm
#as we know that
epsilont=log(1+epsilonc) #mm/mm
#also
#sigmac=sigmat*exp(-epsilont)
#so
sigmat=sigmac/exp(-epsilont) #MPa
print "the true strees is %0.3f MPa\n and true strain is %0.3f mm/mm"%(sigmat,epsilont)
#given
#material constant
K=500 #MPa
#strain hardenening coefficient
n=0.20
#according to true stress-strain relation
#sigmat=d sigmat/d epsilont=d(Kepsilont**n)/d epsilont
#so we get
#sigmat=n*K*epsilont**(n-1) -----(1)
#also we know that
#sigmat=K*epsilont**n ------------(2)
#equating (1) and (2)
epsilont=n
#also we know that
#epsilont=log (1+epsilonc)
#so
epsilonc=exp(epsilont)-1
#now
sigmat=K*epsilont**n #MPa
print """the maximum tensile strength %0.3f
the linear strain are %0.3f MPa"""%(epsilonc,sigmat)
#given
#applied strain
epsilon=0.4
#immediate stress
sigmai=10*10**9 #Pa
#after 42 days stress is
sigma=5*10**9 #Pa
t=42 #days
#as we know that
#sigma=sigmai*exp(-t/tr)
#so
tr=t/log(sigmai/sigma) #days
#stress after 90 days
t90=90 #days
sigma90=sigmai*exp(-t90/tr)*10**-9 #MPa
print """relaxation time for the tensile stress to decrease from 10 to 5 MPa is %0.3f days
the stress after 90 days is %0.3f MPa"""%(tr,sigma90)
from math import pi
#given
#crack length of glass piece
l=3*10**-6/2 #m divided by 2 because min general we consider 2*l be the length of crack
#young modulus
E=70*10**9 #Pa
#specific surface energy
gammae=1.05 #/J/m**2
#fracture strength
sigmaf=sqrt(2*E*gammae/(pi)/l) #N/m**2
#ratio of strength and young's modulus
R=sigmaf/E
print """fracture strength is %0.3e N/m**2
the ratio of strength and youngs modulus is %0.3f"""%(sigmaf,R)
#given
#young's modulus
E=71*10**9 #Pa
#fracture strength
sigmaf=115*10**6 #Pa
#lenght of crack
#2l=6 micro m
#so
l=6/2*10**-6 #m
#as we know that
#sigmaf=sqrt(2*E*sigmac/(pi)/l)
#so
sigmac=(sigmaf)**2*(pi)*l/2/E #J/m**2
print "surface energy of the etched glass is %0.3f J/m**2"%(sigmac)
#given
E=70*10**9 #Pa
gammae=0.85 #J/m**2
l=2*10**-6 #m
#necessary stress to satisfy the griffith's energy
sigmaf=sqrt(2*E*gammae/(pi)/l)/10**6 #Pa
print "the necessary stress is %0.3f MPa"%(sigmaf)
#given
E=72*10**9 #Pa
gammae=0.9 #J/m**2
sigmaf=17.5*10**6 #Pa
#as we know that
#sigmaf=sqrt(2*E*gammae/(pi)/l) #N/m**2
#so
l=2*E*gammae/(pi)/(sigmaf)**2*1000 #mm
#length of intenal crack
L=2*l #m
print """length of crack on the outer surface is %0.3f mm
length of crack internally %0.3f mm"""%(l,L)