# Variables
h = 6. #in
x1 = 7. #in
x2 = 1. #in
x3 = 2. #in
P = 600. #lb
# Calculations
By = P*(x1+x2+x3)/(x1+x2)
Bx = By*(x1+x2)/h
Fx = Bx
V = By-P
M = -P*(x2+x3)+By*x2
S1 = -Fx/(x3*h)
I = x3*h**3/12
S2 = -M*12*(h/2)/I
Scmax = S1-S2
Stmax = S1+S2
# Results
print 'Maximum tensile stress at = %.1f psi'%(Scmax)
print 'Maximum compressive stress at = %.1f psi'%(Stmax)
# Variables
P = 10000. #lb
A = 11.77 #in**2
Z = 51.9 #in**3
x = 5. #ft
y = 12. #ft
# Calculations
S1 = round(-P/A)
S2 = round(P*x*y/Z,-2)
Sc = S1-S2
St = S1+S2
# Results
print 'Axial stress at c = %.1f psi'%(Sc)
print 'Axial stress at t = %.1f psi'%(St)
# Variables
b = 6. #in
h = 12. #in
l = 20. #ft
P = 100000. #lb
# Calculations
S = -P/(b*h)
S1 = l**2*6*12/(8*b*h**2)
w = -S/S1
# Results
print 'Safe distributed load = %.0f lb per ft'%(w)
# Variables
b = 4. #in
h = 9. #in
l = 6. #in
Mx = 600. #lb
My = 100. #lb
# Calculations
Zx = b*h**3/(12*h/2)
Zy = b**3*h/(12*b/2)
S1 = Mx*l*12/Zx
S2 = My*b*12/Zy
Sb = S1+S2
Sd = -S1-S2
# Results
print 'Maximum stress = %.1f psi tension)'%(Sb)
print ' Maximum stress =%.1f psi compression)'%(Sd)
import math
# Variables
d = 2. #in
Px = -600. #lb
Py = 1200. #lb
x1 = 2. #in
x2 = 2. #in
x3 = 2. #in
Ray = -400. #lb
Rax = 400. #lb
Rbx = 200. #lb
Rby = -800. #lb
# Calculations
Mb = math.sqrt((Rax*x1)**2+(Ray*x1)**2)
Mc =math.sqrt((Rbx*x3)**2+(Rby*x3)**2)
if (Mb<Mc) :
M =Mc
else:
M = Mb
Smax = M*12*64*(d/2)/(math.pi*d**4)
# Results
print 'Maximum normal stress = %.1f psi'%(round(Smax,-2))
# Variables
P = 100. #kips
M = 400. #kip in
A = 14.7 #in**2
Z = 80.7 #in**3
# Calculations
Smax = -(P*10**3)/A-(M*10**3)/Z
Smin = -(P*10**3)/A+(M*10**3)/Z
# Results
print 'Maximum stress = %.1f psi'%(round(Smax,-2))
print 'Minimum stress =%.1f psi'%(round(Smin,-1))
# Variables
As = 1. #in**2
Zs = 0.167 #in**3
Ah = 1. #in**2
Zh = 0.984 #in**3
es = 0.5 #in
eh = 0.5 #in
# Calculations
phbyps = (1/As+es/Zs)/(1/Ah+eh/Zh)
# Results
print 'ratio = %.1f'%(phbyps)
import math
# Variables
Sx = 1800. #psi
Sy = 1000. #psi
angle = 30. #degrees
t = 0.25 #in
t1 = 3. #in
t2 = 5. #in
# Calculations
Sx1 = Sx/(t1*t)
Sy1 = Sy/(t2*t)
S = ((Sx+Sy)/2+((Sx-Sy)/2)*math.cos(math.radians(2*angle)))+(Sx-Sy)*math.cos(math.radians(2*angle))
T = (Sx-Sy)*math.sin(math.radians(2*angle))
# Results
print 'S = %.1f psi'%(S)
print 'T =%.f psi'%(T)
# Variables
Sx = 1800. #lb
Sy = 1000. #lb
angle = 30. #degrees
# Calculations
Sa =-((Sx+Sy)/2+((Sx-Sy)/2)*math.cos(math.radians(2*angle)))*math.cos(math.radians(2*angle))-(Sx-Sy)
Ta = -((Sx+Sy)/2+((Sx-Sy)/2)*math.cos(math.radians(2*angle)))*math.sin(math.radians(2*angle))
Sb =((Sx+Sy)/2+((Sx-Sy)/2)*math.cos(math.radians(2*angle)))*math.cos(math.radians(2*angle))-(Sx-Sy)
Tb = ((Sx+Sy)/2+((Sx-Sy)/2)*math.cos(math.radians(2*angle)))*math.sin(math.radians(2*angle))
# Results
print 'Sa = %.1f psi'%(Sa)
print 'Sb =%.1f psi'%(Sb)
print 'Ta =%.f psi'%(round(Ta,-1))
print 'Tb =%.1f psi'%(round(Tb,-1))
import math
# Variables
angle = 15. #degrees
Tyx = -1000. #psi
Txy = 1000. #psi
# Calculations
Sx = Txy*math.sin(math.radians(2*angle))
Tx = Txy*math.cos(math.radians(2*angle))
Sy = Tyx*math.sin(math.radians(2*angle))
Ty = Tyx*math.cos(math.radians(2*angle))
Sx1 = Txy
Sy1 = Tyx
Txy = 0
# Results
print 'Sx = %.1f psi'%(Sx)
print 'Tx = %.1f psi'%(Tx)
print 'Sy = %.1f psi'%(Sy)
print 'Ty = %.1f psi'%(Ty)
print 'Sx1 = %.1f psi'%(Sx1)
print 'Sy1 = %.1f psi'%(Sy1)
print 'Txy = %.1f psi'%(Txy)
import math
# Variables
d = 4. #in
n = 315. #rpm
Ss = 8000. #psi
Ns = 12000. #psi
# Calculations
T = Ss*d**4/(32*(d/2))
hp = T*math.pi*n/63000
# Results
print 'T = %.1f pi lb in'%(T)
print 'horsepower rating =%.1f hp'%(round(hp,-1))
import math
# Variables
Sx = 9. #ksi
Sy = -5. #ksi
Txy = 4. #ksi
# Calculations
R = math.sqrt(((Sx-Sy)/2)**2+Txy**2)
Smax = ((Sx+Sy)/2)+R
Smin = ((Sx+Sy)/2)-R
ap1 = (1./2)*math.degrees(math.atan(2*Txy/(Sx-Sy)))
ap2 = 90+ap1
Sc = (Sx+Sy)/2
Tc = R
Sd = (Sx+Sy)/2
Td = -R
a1 = (90-2*ap1)/2
a2 = 90+a1
# Results
print 'Smax = %.2f ksi'%(Smax)
print 'Smin = %.2f ksi'%(Smin)
print 'R = %.2f psi'%(R)
print 'palne1 = %.2f degrees'%(ap1)
print 'plane 2 = %.2f degrees'%(ap2)
print 'Sc = %.2f ksi'%(Sc)
print 'Sd = %.2f ksi'%(Sd)
print 'Tc = %.2f ksi'%(Tc)
print 'Td = %.2f ksi'%(Td)
print 'palne1 = %.2f degrees'%(a1)
print 'plane 2 = %.2f degrees'%(a2)
# note : rounding off error.
import math
# Variables
d = 4. #in
T = 40000. #lb in
Th = 20000. #lb in
# Calculations
t = round(T*(d/2)*32/(math.pi*d**4),-1)
S = round(Th/(math.pi*(d/2)**2),-1)
Smax = -(S/2)-math.sqrt(t**2+(S/2)**2)
Tmax = math.sqrt(t**2+(S/2)**2)
# Results
print 'Maximum normal stress = %.f psi'%(Smax)
print 'Maximum shearing stress =%.f psi'%(Tmax)