import math
from sympy import symbols
#Variable declaration
l=0.020 # Length(m)
b=0.100 # Breadth(m)
V=500 # Vertical shear(N)
y=0.060 # Distance(m)
#Calculation
A=l*b # Area(m**2)
Q=A*y # First moment of an area with respect to a given axis
I=(1/12.0)*(0.020)*(0.1**3) + 2*((1/12.0)*(0.1)*(0.02**3) + (0.020*0.1)*(0.06**2)) # Moment of inertia(m**4)
q=(V*Q)/(I)
F=(0.025)*q # Shearing force in each nail(N)
# Result
print ('Shearing force in each nail is = %lf N' %F)
import math
from sympy import symbols
#Variable declaration
Vmax=4.50 # Force maximum(kips)
b=3.5 # Actual width of beam(in)
h=14.55 # Depth(in)
#Calculation
Tmax=(3/2.0)*(Vmax/(b*h)) # Maximum shearing stress(ksi)
# Result
print ('Maximum shearing stress in a narrow rectangular beam = %lf ksi' %Tmax)
import math
from sympy import symbols
#Variable declaration
tw=5.8 # Distance(mm)
d=349 # Distance(mm)
Vmax=58 # Force(kN)
#Calculation
Aweb=d*tw # Area(mm*2)
Tmax=(Vmax/Aweb)*(1000) # Maximum shearing stress(ksi)
# Result
print ('Maximum allowable shearing stress for steel beam = %lf MPa' %Tmax)
import math
#Variable declaration
A=B=1.5 # Force(kN)
V=1.5 # Force(kN)
y1=0.0417 # Distance(m)
y2=0.0583 # Distance(m)
AreaA=0.100*0.020 # Area(m**2)
AreaB=0.060*0.020 # Area(m**2)
I=8.63*(pow(10,-6)) # Moment of inertia(m**2)
t=0.020 # Distance(m)
#Calculation
#Shearing Stress in Joint a
Qa=AreaA*y1
taweA=round((V*Qa)/(I*t),0) # Shearing stress in joint a(kPa)
#Shearing Stress in Joint b
Qb=AreaB*y2
taweB=round((V*Qb)/(I*t),0) # Shearing stress in joint b(kPa)
# Result
print ('Shearing stress in joint a = %lf kPa' %taweA)
print ('Shearing stress in joint b = %lf kPa' %taweB)
import math
from sympy import symbols
#Variable declaration
#Maximum Shear and Bending Moment
I=symbols('I') # Variable declaration
b=symbols('b') # Variable declaration
d=symbols('d') # Variable declaration
c=symbols('c') # Variable declaration
S=symbols('S') # Variable declaration
Mmax=90 # Maximum bending moment(kip.in)
Vmax=3 # Force(kips)
sall=1800 # Stress all(psi)
tall=120 # Shearing stress(psi)
b=3.5 # Width(in)
#Calculation
#Design Based on Allowable Normal Stress
I=(1/12.0)*(b)*(d**3) # Moment of inertia(m**4)
S=round((1/6.0)*(b),4)*(d**2) # Section modulus
d=round(sqrt(((90*(pow(10,3)))/(1800))*(1/0.5833)),2) # Distance(in)
#Check Shearing Stress
Area=(b)*(d) # Area(in**2)
tm=round((3/2.0)*((Vmax*1000)/Area),1) # Allowable shearing stress(psi)
#Design Based on Allowable Shearing Stress
d=round((3*3000)/(2*3.5*120),2) # Distance(in)
# Result
print ('Minimum required depth d of beam = %lf in' %d)
import math
from sympy import symbols
#Variable declaration
l=0.75 # Distance(in)
b=3 # Breadth(in)
V=600 # Vertical shear(lb)
y=1.875 # Distance(in)
#Calculation
Q=l*b*y
I=(1/12.0)*((4.5**4)-(3**4)) # Moment of inertia(in**4)
q=(V*Q)/(I)
F=(1.75)*(46.15) # Shearing force(lb)
# Result
print ('Shearing force in each nail = %lf lb' %F)
import math
from sympy import symbols
#Variable declaration
#Calculation
Q=round((4.31)*(0.770)*(4.815),2)
t=round(((50)*(15.98))/(394*0.770),2) # Normal shearing stress(ksi)
# Result
print ('Horizontal shearing stress = %lf ksi' %t)
import math
#Variable declaration
tf=0.770 # Distance(in)
#Calculation
I=round(394 + 2*((1/12)*(12)*pow(0.75,3) + (12)*(0.75)*(pow(5.575,2))),0) # Centroidal moment of inertia(in**4)
t=2*tf # Distance(in)
Q=round(2*(4.31*0.770*4.815) + (12)*(0.75)*(5.575),1)
t=round(((50)*(82.1))/((954)*(1.54)),2) # Shearing stress(ksi)
# Result
print ('Horizontal shearing stress = %lf ksi' %t)
import math
#Variable declaration
AB=AD=65 # Distance AB(mm)
cosB=12/13.0
#Calculation
#Centroid
Y=round((2*65*3*30)/((2*65*3)+((50)*(3))),2) # Distance y(mm)
#Centroidal Moment of Inertia
b=(3)/(cosB) # Distance(mm)
I=2*((1/12.0)*(3.25)*(pow(60,3)) + (3.25)*(60)*(pow(8.33,2))) + ((1/12.0)*(50)*(pow(3,3)) + (50)*(3)*(pow(21.67,2)))# Moment of inertia(mm**4)
I=(I/(pow(10,12))) # Moment of inertia(m**4)
#Shearing Stress at A
ta=0
#Maximum Shearing Stress
Q=round(3.25*38.33*(38.33/2.0),0)
tE=((5)*(2.387*(pow(10,-6))))/((0.2146*(pow(10,-6)))*(0.003))
tE=round(tE/1000.0,2) # Largest shearing stress
# Result
print ('Case(a) Shearing stress at A = %lf ksi' %ta)
print ('Case(a) Maximum shearing stress = %lf MPa' %tE)
import math
from sympy import symbols
#Variable declaration
b=4 # Distance(in)
h=6 # Distance(in)
t=0.15 # Thickness(in)
s=symbols('s') # Variable declaration
V=symbols('V') # Variable declaration
I=symbols('I') # Variable declaration
b=symbols('b') # Variable declaration
#Calculation
q=(V*s*t*h)/(2.0*I) # First moment
F=integrate(q,(s,0,b)) # Magnitude of shearing force
e=(F*h)/(V) # Distance e from the center line of the web BD to the shear center O
I=((1/12.0)*t*(h**3)) + 2*(((1/12.0)*b*(t**3)) + (b*t*((h/2)**2))) # Moment of inertia
e=(4)/(2+0.5) # Distance(in)
# Result
print ('Shear center O of a channel section of uniform thickness = %lf in' %e)
import math
from sympy import symbols
#Variable declaration
V=2.5 # Force(kips)
b=4 # Distance(in)
t=0.15 # Thickness(in)
h=6 # Height(in)
#Calculation
tB=(6*V*b)/((t*h)*(6.0*b+h)) # Horizontal shearing stress(ksi)
tMAX=(3*(V)*(4*b+h))/(2.0*t*h*(6.0*b+h)) # Shearing stress in web(ksi)
# Result
print ('Shearing stress in flanges = %lf ksi' %tB)
print ('Shearing stress in web = %lf ksi' %tMAX)
import math
from sympy import Symbol
#Variable declaration
V=2.5 # Force(kip)
OC=1.6+1.143 # Distance(in)
a=4+6+4.0 # Distance(in)
b=0.15 # Distance(in)
#Calculation
T=V*OC # Torque(kip.in)
TmaxBend=3.06 # Maximum value of stress(ksi)
c1=(1/3.0)*(1-(0.630*(b/a)))
tmaxTwist=(T/(c1*a*(b**2))) # Stress due to twisting(ksi)
tmax=3.06 + 65.8 # Combined stress(ksi)
# Result
print ('Maximum shearing stress = %lf ksi' %tmax)
import math
from sympy import symbols,cos,factor
#Variable declaration
b=symbols('b') # Variable declaration
h=symbols('h') # Variable declaration
t=symbols('t') # Variable declaration
a=symbols('a') # Variable declaration
y=symbols('y') # Variable declaration
P=symbols('P') # Variable declaration
t1=symbols('t1') # Variable declaration
#Calculation
#Principal Axes
Inn=(1/12.0)*(b)*(pow(h,3)) # Moment of inertia
Imm=(1/3.0)*(b)*(pow(h,3)) # Moment of inertia
Iy=(2)*(1/3.0)*(t/cos((math.pi)/4.0))*(pow((a*cos((math.pi)/4.0)),3)) # Centroidal moment of inertia at y
Iz=(2)*(1/12.0)*(t/cos((math.pi)/4.0))*(pow((a*cos((math.pi)/4.0)),3)) # Centroidal moment of inertia at z
#Shearing Stresses Due to Vy
Y=(1/2.0)*(a+y)*(cos((math.pi)/4.0))-(1/2.0)*(a)*(cos((math.pi)/4.0)) # Distance
Q=(1/2.0)*(t)*(a-y)*(y)*cos((math.pi)/4.0)
Vy=P*(cos((math.pi)/4.0))
t1=(Vy*Q)/(Iz*t) # Stress
#Shearing Stresses Due to Vz
Z=(1/2.0)*(a+y)*cos((math.pi)/4.0)
Q=(1/2.0)*(a**2-y**2)*(t)*(cos((math.pi)/4.0))
Vz=P*(cos((math.pi)/4.0))
t2=(Vz*Q)/(Iy*t) # Stress
#Combined Stresses.
#Along the Vertical Leg
te=factor(t1+t2) # Stress
#Along the Horizontal Leg.
tf=factor(t2-t1) # Stress
# Result
print ('Combined stress along the vertical leg :-' )
print(te)
print ('Combined stress along the horizontal leg :-')
print(tf)