# Variables
E = 1.5*10**6
F1 = -100. #lb
F2 = -100. #lb
x1 = 6 #in
x2 = 6 #in
Ina = 64 #in**4
h1 = -600 #lb ft
h2 = -1200 #lb ft
xa1 = 10 # in
xa2 = 8 #in
# Calculations
deltamax = ((1./2)*x1*xa1*h1+(1./2)*(x1+x2)*h2*xa2)*(1728)/(E*Ina)
# Results
print 'maximum deflection = %.2f in'%(deltamax)
# Variables
E = 1.5*10**6
I = 50. #in**4
delta = -1. #in
l = 8. #ft
# Calculations
w = -delta*8*E*I/(l**4*1728)
# Results
print 'distributed weight = %.1f lb per ft'%(w)
# Variables
W = 50. #lb/ft
x = 5. #ft
x1 = 2. #ft
# Calculations
V = W*x
M = W*((x/2)+x1)*x
M1 = W*x*(x+x1)
M2 = -M
M3 = -W*x*x/2
EIdeltamax = ((1./2)*(x+x1)*M1*((x+x1)/3))+(x+x1)*M2*((x+x1)/2)+(1./3)*x*M3*(x/4)
# Results
print 'maximum value of EIdeltax = %.1f lb ft**3'%(round(EIdeltamax,-2))
# Variables
w = 180. #lb/ft
l = 8. #ft
P = 1200. #lb
b = 6. #ft
E = 3*10.**6
I = 64. #in**4
# Calculations
delta = ((w*l**4)/(8))+((P*b**2)*(3*l-b)/(6))
# Results
print 'deflection of the free end = %.1fbyEI ft'%(round(delta,-3))
# Variables
P = 6. #kips
w = 3. #kips/ft
L1 = 8. #ft
L2 = 8. #ft
# Calculations
delta = (P*(L1+L2)**3/192)+(w*(L1+L2)**4/768)
# Results
print 'midspan value of deflection = %.1f kip ft**3'%(delta)
# Variables
x1 = 3. #ft
x2 = 3. #ft
x3 = 3. #ft
x4 = 3. #ft
W1 = 4. #kips
W2 = 8. #kips
l = x1+x2+x3+x4
# Calculations
b = x2+x3+x4
b1 = x4
a = x1
x = l/2
P = (((W1*b*(l/b*(x-a)**3+(l**2-b**2)*x-x**3))/(6*l))+((W2*b1*x*(l**2-x**2-b1**2))/(6*l)))*(48/l**3)
R1 = 3+2-(P/2)
R2 = P
R3 = 1+6-(P/2)
# Results
print 'R1 = %.3f kips'%(R1)
print 'R2 =%.2f kips'%(R2)
print 'R3 =%.3f kips'%(R3)
from numpy import linalg
# Variables
P = 680. #lb
K = 1000. #lb/in
L = 6. #ft
E = 30.*10**6
Ina = 1.728 #in**4
# Calculations
A = [[((L*12)**3/(3*E*Ina)),-(1/K)],[1,1]]
b = [0,P]
c = linalg.solve(A,b)
Pb = c[0]
Ps = c[1]
# Results
print 'Force in the spring = %.2f psi'%(Ps)
# Variables
I = 1.5 #in**4
Da = 0.5 #in
E = 30.*10**6
l = 60. #in
# Calculations
F = 6*Da*E*I/(l**3)
# Results
print 'F = %.2f lb'%(F)