from __future__ import division
from sympy import solve, symbols, pprint
import math
y=symbols('y')
B1=B6=2580
B2=B5=3880 #Boom areas (mm^2)
B3=B4=3230
l1=200
l2=230 #dimensions shown in Fig 23.3 (mm)
l3=165
Mx=300*10**6 #bending moment (N.mm)
My=0
Ixx=2*(B1*l3**2+B2*l2**2+B3*l1**2)
sigma_z=Mx/Ixx*y
print "direct stress in booms sigma_z = %s" %(sigma_z)
from __future__ import division
from sympy import solve, symbols, pprint
import math
import numpy as np
T=11.3*10**6 # torque applied (N.mm)
G_REF=27600 #(N/mm^2)
A1=258000
A2=355000 #areas in table
A3=161000
#t*12=G/G_REF*t
t12=24200/G_REF*1.22
t12i=27600/G_REF*2.03
t13=t24=24200/G_REF*1.22 #G and thickness taken from table ex23.2 Pg.No.612
t35=t46=t56=20700/G_REF*0.92
t34=27600/G_REF*1.63
# del12=ds/t*12
del12=1650/t12
del12i=508/t12i
del13=del24=775/t13
del34=380/t34 #lengths taken from table
del35=del46=508/t35
del56=254/t56
a=np.array([[del12+del12i,-del12i,0,-2*A1*G_REF],[-del12i,del12i+del13+del24+del34,-del34,-2*A2*G_REF],[0,-del34,del35+del46+del34+del56,-2*A3*G_REF],[A1,A2,A3,0]])
b=np.array([0,0,0,5.65*10**6])
x=np.linalg.solve(a,b)
print "shear stress distribution is as follows"
print "q1=%1.1f N/mm"%(x[0])
print "q2=%1.1f N/mm"%(x[1])
print "q3=%1.1f N/mm\n"%(x[2])
print "dO_dz=%1.2e "%(x[3])
from __future__ import division
from sympy import solve, symbols, pprint
import math
import numpy as np
A1=265000
A2=213000
A3=413000
G_REF=27600
Sy=86.8*10**3
t78=3*27600/27600*1.22
del78=1270/t78
t12=t56=1.22
del12=del56=1023/t12
t23=1.63
del23=1274/t23
t34=2.03
del34=2200/t34
del38=57
del84=95
del87=347
del27=68
del75=106
del16=330/1.63
Ixx=809*10**6 #From example 23.1
qb27=-99.4;qb16=-45.5;qb65=0;qb57=95.5;qb38=-69.8;qb48=69
a=np.array([ [del34+del84+del38,-del38,0,-2*A1*G_REF], [-del38,del23+del38+del87+del27,-del27,-2*A2*G_REF], [0,-del27,del56+del27+del75+del12+del16,-2*A3*G_REF], [2*A1,2*A2,2*A3,0] ])
b=np.array([-10488,-2561,7426,19736700])
x=np.linalg.solve(a,b)
qs01=5.5
qs02=10.2
qs03=16.5
q34=qs01
q23=qs02
q12=qs03
q61=-qb16+qs03
q57=qb57-qs03
q72=-qb27-qs02
q48=qb48+qs01
q83=-qb38-qs01
print "shear flows distribution is as follows :"
print "q34=%1.2f N/mm"%(q34)
print "q23=q87=%1.2f N/mm"%(q23)
print "q12=q56=%1.2f N/mm"%(q12)
print "q61=%1.2f N/mm"%(q61)
print "q57=%1.2f N/mm"%(q57)
print "q72=%1.2f N/mm"%(q72)
print "q48=%1.2f N/mm"%(q48)
print "q83=%1.2f N/mm\n"%(q83)
print "rate of twist = %1.1e rad/mm"%(x[3])
from __future__ import division
from sympy import solve, symbols, pprint
import math
import numpy as np
#Boom areas
B=[600,900,600,600,900,600]
Pz=[0,0,0,0,0,0]
y=[54.56,54.56,54.56,-54.56,-54.56,-54.56]
Ixx=4*600*90**2+2*900*90**2
Ixy=0
Mx=1.65*10**6
My=0
a=np.array([[1700,-1520],[72000,144000]])
b=np.array([3942,690726])
x=np.linalg.solve(a,b)
print "\nqs0I = %2.1f N/mm\n"%(x[0])
print "\nqs0II = %2.1f N/mm\n"%(x[1])
from __future__ import division
from sympy import solve, symbols, pprint
import math
import numpy as np
from sympy import integrate
z=symbols('z')
E=69000 #youngs modulus (N/mm^2)
G=25900 #shear modulus (N/mm^2)
t=2 #thickness (mm)
B=[650,1300,650,650,1300,650] #boom area
q0=[9.6,-5.8,50.3,-5.8,9.6,54.1,73.6]
Sy0=44.5*10**3
Sy1=1
Mx0=-44.5*10**3*(2000-z)
Mx1=-(2000-z)
Ixx=81.3*10**6
int_q0q1_Gt=1/G/t/Sy0*(q0[0]**2*250*t+q0[1]**2*500*t+q0[2]**2*250+q0[5]**2*250+q0[6]**2*250)
delta=integrate(Mx0*Mx1/E/Ixx,(z,0,2000))+integrate(int_q0q1_Gt,(z,0,2000))
print "deflection at free end of the two cell = %2.2f mm"%(delta)
from sympy import solve, symbols, pprint
import math
import numpy as np
from sympy import integrate
T=10*10**6 #torque subjected (N.mm)
l1=800
l2=200 #lengths shown in Fig23.17 (mm)
l3=1500
A=l2*l1
q=T/2/A
S=T/l1
q1=S/l2
P=S*l3/2/l2
a=np.array([[1,-1],[1,1]])
b=np.array([31.3,62.5])
q=np.linalg.solve(a,b)
print "shear flow :"
print "q1=%2.2f N/mm"%(q1)
print "q2=%2.2f N/mm"%(q[0])
print "q3=%2.2f N/mm\n"%(q[1])
print "flange loads :"
print "P(st.4500) = 0"
print "P(st.3000) = %2.2f N (compression)"%(l3*q[0]-l3*q[1])
print "P(st.2250) = %2.1f"%(46875-l3/2*q1)