#calculate the magnitude of Pma x based on factory of safety
## initialization of variables
import math
Y=345. ##MPa
S_u=586. ##MPa
d=20. ##mm
R=800. ##mm
##part (a)
SF=1.8
N=1e+07
S_am=290. ##MPa
## P_max not yet known. take it as unity until an equation to be solved is encountered
P_max=1.
c=d/2.
M=SF/2.*P_max*R ##M=T
I=math.pi*c**4./4.
Sigma=M*c/I
J=math.pi*c**4./2.
tau=M*c/J
S_max=315. ##MPa
## P_max^2*(3*(tau/S_max)^2+(Sigmaa/S_max)^2)=1
P_max=math.sqrt(1./((3.*(tau/S_max)**2.)+(Sigma/S_max)**2.))
P_min=-5./6.*P_max
print('part(a)')
print'%s %.2f %s'%('\n P_max = ',P_max,'N')
print'%s %.2f %s'%('\n P_min = ',P_min,'N')
#compute signitficant value of the stres and maximum utilizable stress
## initialization of variables
import math
b=10. ##mm
M=1.
t=50. ##mm
rho=5. ##mm
h=25. ##mm
c=60. ##mm
SF=4.0
##part (a)
S_cc=2.8
q=0.94
S_ce=1.+q*(S_cc-1.)
## M is not known. take it as unity
S_n=3.*M*t/(2.*h*(c**3-t**3))
S_e=S_ce*S_n
print('part (a)')
print'%s %.2f %s'%('\n Effective stress = ',S_e,' M')
##part (b)
S_max=172. ##MPa
S_w=S_max/SF
M=S_w/S_e
print('\n part (b)')
print'%s %.2f %s'%('\n M =',M/10**3,' N.m')
#calculate the siginificant stress at the root of the notch
## initialization of variables
import math
rho=0.75 #mm
S_n=32.97e-06 ## M
S_cc=6.1
q=0.69
S_ce=1.+q*(S_cc-1)
## M is not known. take it as unity
M=1.
S_e=S_ce*S_n
print('part (a)')
print'%s %.2f %s'%('\n Effective stress = ',S_e,' M')
## part (b)
S_w=43. ##MPa
M=S_w/S_e
print('\n part (b)')
print'%s %.2f %s'%('\n M =',M/10**3,' N.m')
#calculate the magnitude of produce fracture of the tension member
## initialization of variables
import math
import numpy
E=72. ##Gpa
v=0.33
S_u=470. ##MPa
Y=330. ##MPa
S_an=190. ##MPa
N=1e+06 ##cycles
T=10. ##mm
D=59. ##mm
d=50. ##mm
t=3. ##mm
rho=t
P_min=20. ##kN
q=0.95
##calculations
P_min=P_min*10**3
S_cc=1.90
S_ce=1.+q*(S_cc-1.)
A=T*d
S_nMin=P_min/A
S_nam=S_an/S_ce
##(S_na/S_nam)+(S_nm/S_u)^2=1
## S_nm^2=S_nMin^2+S_na^2+2*S_na*S_nMin
c=S_nMin**2-S_u**2
a=.1
b=2.*S_nMin+S_u**2./S_nam
S_na=numpy.roots([a ,b ,c])
S_na=S_na[1]
## Solving gives S_na
S_nm=S_nMin+S_na
S_nMax=S_nMin+2.*S_na
P_max=A*S_nMax
S_max=S_nm+S_ce*S_na
S_min=S_nm-S_ce*S_na
print'%s %.2f %s'%('P_max = ',P_max/10**3,' kN')
print'%s %.2f %s'%('\n S_max = ',S_max,' MPa')
print'%s %.2f %s'%('\n S_min = ',S_min,' MPa')
#calculate the total strain and member cycles
## initialization of variables
import math
## Equation given: E_l =E_p + E_e
## E_p = 0.58*(2N)^-0.57
## E_e=0.0062*(2N)^-0.09
## Part (a)
def fun(N):
f = 0.58*(2*N)**(-0.57)+0.0062*(2.*N)**(-0.09)-0.01;
Nc=6390.
N=Nc
E_p = 0.58*(2*N)**-0.57
E_e = 0.0062*(2*N)**-0.09
E_l=E_p+E_e
print('Part (a)')
print'%s %.5f %s'%('\n Total strain = ',E_l,'')
##part (b)
N=1/2.*10**6
E_p = 0.58*(2*N)**-0.57
E_e = 0.0062*(2*N)**-0.09
E_l=E_p+E_e
print('\n Part (b)')
print'%s %.5f %s'%('\n Total strain = ',E_l,'')
## part (c)
E_l=0.01
## In order to solve for N We have to solve a non-linear equation
N = 1.;##initial guess
f = 1.;##inital guess
while(abs(- 0.0000002)>0.000001):
f = fun(N);
if f>0:
N = N+1182;
elif f<0:
N = N-1;
print'%s %.2f %s'%('\n N = ',N,' cycles.');