from __future__ import division
#given
#bonding characteristics of a material are
n=1
m=9
A=7.56*10**-29 #J m
#initial bond length
r_0=2.3*10**-10 #m
#this bond length exceed by 15 %
#so extension is
e=15/100*r_0 #m
#new bond length will be
r=r_0+e #m
#the axial tensile starin is given by
epsilon_t=e/r_0 #(change in dimension /original dimension)
#according to P-r function we have
B=A*r_0**8/9 #J m**9
#we have double deravative of P as
double_derivative_P=-2*A/r_0**3+90*B/r_0**11 #/J/m**2
#so youngs modulus will be given by
E=double_derivative_P/r_0*10**-9 #GPa (some approximation is done in book)
print "the axial stain is %.2f \nand youngs modulus of elasticity is %0.3e GPa "%(epsilon_t,E)
#given
#according to the data given in the question we can have the graph shown in the fig 9.11 in book
#part(a):- tangent modulus of elasticity at 200 MPa
E_tangent=(222-168)*10**9/(1.90-1.42)/10**9 #G Pa ( values from graph)
#part(b):- secant modulus of elasticity at 180 MPa
E_secant= (180-0)*10**9/(1.46-0)/10**9 #G Pa (values from graph)
#part(c):-youngs modulus of elasticity at 85 MPa
E=(85-0)*10**6/((0.68-0)*10**-3)/10**9 #G Pa (values from graph)
print """tangent modulus of elasticity at 200 MPa is %0.2f Pa
secant modulus of elasticity at 180 MPa is %d Pa
youngs modulus of elasticity at 85 MPa is %d Pa"""%(E_tangent,E_secant,E)
#given
#stress
sigmamean=70 #MPa
#stress range
sigmarange=210 #MPa
#as we know that
#sigmamean=(sigmamax+sigmamin)/2
#from this we get
#sigmamax+sigmamin=140 -----------(1)
#also
#sigmarange=sigmamax-sigmamin
#so we get
#sigmamax-sigmamin=210 ----------(2)
#solving 1 and 2
#we get
sigmamax=(140+210)/2 #MPa
#and
sigmamin=140-sigmamax #MPa
#stress ratio
R=sigmamin/sigmamax
#stress ranges from sigmamin to sigmamax
#so total sum will be
totalsum=-sigmamin+sigmamax #MPa
print """the maximum and minimum stresses are %d MPa and %d MPa resp,
stress ratio is %f
and total sum is %d MPa"""%(sigmamax,sigmamin,R,totalsum)
#given
#temp
T=600 #degree C
#tightenening stress
sigmai=750 #kgf/cm**2
#minimum creep rate
vcr=2.8*10**-8 #cm/cm/hour
#stress
sigma=300 #kgf/cm**2
#young's modulus
E=2*10**6 #kgf/cm**2
#constant
n=3
#we knnow that minimum creep rate
#vcr=A*sigma**n
#so
A=vcr/sigma**n
#total time involved in creep of bolt is 1 year
t=365*24 #hours
#the stress relaxation in bolt due to creep is expresed by:-
#1/(sigmaif)**(n-1)=1/(sigmai)**(n-1)+A*E*(n-1)*t
#we have to find sigmaif
#so
sigmaif=((1/(sigmai)**(n-1)+A*E*(n-1)*t)**(1/(n-1)))**-1
print "the stress relaxation in bolt to creep is %0.3f kgf/cm**2"%(sigmaif)