# Variables
L = 20. #ft
b1 = 12. #in
h1 = 4. #in
b2 = 4. #in
h2 = 12. #in
Fs = 1200. #psi
La = 5. #ft
Lb = 15. #ft
# Calculations
Ina = b1*h1**3/12
P1 = (Fs*Ina*4)/((h1/2)*12*La*3)
Ina1 = b2*h2**3/12
P2 = (Fs*Ina1*4)/((h2/2)*12*La*3)
# Results
print 'P max in first case = %.0f lb'%(P1)
print 'P max in second case = %.2f lb'%(P2)
# Variables
b = 0.5 #in
h = 1./32 #in
d = 4. #ft
E = 30.*10**6
# Calculations
stress = E*(h/2)/((d/2)*12)
Ina = b*h**3/12
M = stress*Ina/(h/2)
# Results
print 'maximum stress = %.2f psi'%(round(stress,-2))
print 'internal moment = %.2f lb in'%(M)
# Variables
W = 1000. #lb/ft
L = 10. #in
b1 = 4. #in
h1 = 1. #in
b2 = 1. #in
h2 = 6. #in
# Calculations
Mmax = 12500 #lb ft
y = ((b1*h1*h1/2)+(b2*h2*((h2/2)+h1)))/(b1*h1+b2*h2)
Ina = round((b1*h1**3/12)+b1*h1*(y-h1/2)**2+(b2*h2**3/12)+b2*h2*(h1+h2-y-(h2/2))**2,1)
sigmat = Mmax*12*y/Ina
sigmac = Mmax*12*(h1+h2-y)/Ina
# Results
print 'maximum tensile stress = %.2f psi'%(round(sigmat,-1))
print 'maximum compressive bending stress = %.2f psi'%(round(sigmac,-2))
# Variables
st = 1200. #psi
sc = 100. #psi
h = 12. #in
b = 4. #in
# Calculations
I = b*h**3/12
P1 = st*I/(b*12*(h/2))
P2 = 2*sc*b*12/3
if (P1<P2):
print 'Safe value of p = %.f lB'%(P1)
else:
print 'Safe value of p = %.f lB'%(P2)
# Variables
W = 600. #lb/ft
L1 = 8. #in
L2 = 4. #in
b = 6. #in
h = 8. #in
t = 1. #in
# Calculations
R1 = W*(L1+L2)*((L1+L2)/2)/L1
R2 = W*(L1+L2)*(L1-(L1+L2)/2)/L1
Vmax = 3000 #lb
I = (b*h**3/12)-(L2*b**3/12)
Ay = b*L2*(L2/2)-L2*b/2*b/4
b = t+t
Tmax = Vmax*Ay/(I*b)
# Results
print 'maximum shear stress = %.0f psi'%(Tmax)
import math
# Variables
w = 4000. #lb/ft
l = 20. #ft
y = 0.96
A = 4.18 #in**2
Icq = 5.6 #in**4
d = 28. #in
b = 0.5 #in
T = 8000. #psi
d1 = 0.75 #in
# Calculations
V = w*l/2
Ay = 2*A*((d/2)-y)
I = b*d**3/12+4*(Icq+A*((d/2)-y)**2)
p = (2*T*(math.pi/4)*d1**2*I)/(V*Ay)
# Results
print 'Rivet spacing = %.2f in'%(p)
# Variables
Es = 30.*10**6
Ew = 1.5*10**6
w = 500. #lb per ft
span = 12. #ft
t = 0.25 #in
h = 12. #in
n = 3.
b = 5. #in
# Calculations
bw = Es*t/Ew
Ina = n*b*h**3/12
M = (w*span*(h/2)*12)/4
S = M*(h/2)/I
Ss = Es*S/Ew
bs = Ew*bw/Es
Ina1 = n*t*h**3/12
Ss1 = M*(h/2)/Ina1
Sw = Ew*Ss1/Es
# Results
print 'Maximum bending stress in steel = %.3f psi'%(Ss1)
print 'Maximum bending stress in wood = %.2f psi'%(Sw)
import math
# Variables
Ss = 15000. #psi
Sa = 6000. #psi
Es = 30.*10**6
Ea = 10.*10**6
Sl = 16. #ft
ba = 3. #in
ha = 8. #in
hs = 1. #in
b = 1. #in
# Calculations and Resuls
bs = (Ea/Es)*ba
Y = ((ba-b)*b*(hs/2)+(ha+b)*b*((ha/2)+(hs/2)))/(ba*b+ha*b)
I = (ba*hs**3/12)+ba*hs*(Y-(hs/2))**2+((b*ha**3/12)+b*ha*(ha-Y-(ha/2))**2)
w1 = Ss*I/(Y*(1./2)*ha*(ha)*12)
Ss = Es*Sa/Ea
w2 = Ss*I/((ha-Y)*(1./2)*ha*(ha)*12)
if (w1<w2):
print 'Greatest uniformly distributed load = %d lb per ft'%(w1)
else:
print 'Greatest uniformly distributed load = %d lb per ft'%(w2)
# note : rounding off error
import math
# Variables
M = 500000. #lb in
r = 15.
n = 3.
b = 20. #in
l = 12. #in
As = 1. #in**2
# Calculations
At = r*As*n
x = (-2*At+math.sqrt((2*At)**2+8*At*b*l))/(2*l)
Ina = ((l*x**3)/3)+At*(b-x)**2
Scmax = M*x/Ina
Ssmax = r*M*(b-x)/Ina
# Results
print 'Maximum bending stress in concrete = %.0f psi'%(Scmax)
print 'Maximum bending stress in steel = %.2f psi'%(Ssmax)
# note : answer is accurate. please check with calculator.
import math
# Variables
Sc = 800. #psi
Ss = 18000. #psi
ratio = 15.
d = 5/8. #in
l = 20. #in
b = 10. #in
# Calculations
x = Sc*ratio*l/(Ss+Sc*ratio)
As = b*x*(x/2)/((l-x)*ratio)
Ina = (b*x**3/3)+ratio*As*(l-x)**2
M = Sc*I/x
N = As/(math.pi*(d/2)**2)
# Results
print 'Number of steel bars required = %.2f'%(N)
print ("it rounds to 6 bars")