# Chapter8-Direct and bending stresses¶

## Ex1-pg322¶

In [1]:
import math
#calculate p_max and p_min
d = 6.;##inches
b = 3/4.;##inch
P = 18.;##tons
e = 1/8.;##inch
A = b*d;##sq.in
M = P*e;##ton-in
Z = (1./6.)*b*d**2;##in^3
p_0 = P/A;## tons/in^2
p_b = M/Z;## ton/in^2
p_max = p_0+p_b;## tons/in^2
p_min = p_0-p_b;## tons/in^2
print'%s %.1f %s'%('p_max =',p_max,'tons/in^2 tensile')
print'%s %.1f %s'%('p_min = ',p_min,'tons/in^2.,tensile')

p_max = 4.5 tons/in^2 tensile
p_min =  3.5 tons/in^2.,tensile


## Ex2-pg323¶

In [2]:
import math
#calculate p_max and p_min
d1 = 12.;##inches
t = 1.;##inch
d2 = d1-2.*t;##inches
P = 5.;##tons
e = 12.;##inch
A = 0.25*math.pi*(d1**2-d2**2);##sq.in
M = P*e;##ton-in
Z = math.pi*(d1**4-d2**4)/(32*d1);##in^3
p_0 = P/A;## tons/in^2
p_b = M/Z;## ton/in^2
p_max = p_0+p_b;## tons/in^2
p_min = p_0-p_b;## tons/in^2
print'%s %.4f %s'%('p_max =',p_max,'ton/in^2.,cmopressive')
print'%s %.4f %s'%('p_min =',p_min,'ton/in^2., tensile')
print'%s %.4f %s'%('p_min = ',-p_min,'ton/in^2., tensile')

p_max = 0.8278 ton/in^2.,cmopressive
p_min = -0.5384 ton/in^2., tensile
p_min =  0.5384 ton/in^2., tensile


## Ex3-pg324¶

In [3]:
import math
#calculate p_max and p_min
l = 6.;##inches
b = 4.;##inches
d = 1/2.;##inch
P = 10.;##tons
r = 1.5;##inches
A = 4.771;## in^2
J = 0.968;## inches
I_xx = 6.07;## in^4
I_yy = 8.64;## in^4
e = r-J;## inches
M = P*e;## ton-inches
y_t = J;##inches
y_c = b-y_t;##inches
##compressive
p_c = M*y_c/I_xx;## tons/in^2
##tensile
p_t = M*y_t/I_xx;## tons/in^2
##compressive
p_0 = P/A ;## tons/in^2
p_max = p_0+p_c;## tons/in^2
p_min = p_0-p_t;## tons/in^2
print'%s %.3f %s'%('p_max =',p_max,'tons/in^2.,compressive')
print'%s %.3f %s'%('p_min =',p_min,'tons/in^2.,compressive')

p_max = 4.753 tons/in^2.,compressive
p_min = 1.248 tons/in^2.,compressive


## Ex4-pg324¶

In [4]:
import math
#calculate p_max and p_min
b = 5.;##inches
t = 1/2.;##inch
P = 12.;##tons
d = 1/2.;##inch
r = 3/2.;##inch
A = (b-d)*t;## in^2
p_0 = P/A;## tons/in^2
a1 = b*d;## in^2
x1 = 0.;
a2 = d*t;## in^2
x2 = -3/2.;
e = (a1*x1-a2*x2)/(a1-a2);##inches
M = P*e;## ton-inches
y_c = a1-e;## inches
y_t = a1+e;## inches
I_yy = (t*b**3)/12. - ((t*d**3)/12. + 0.5*d*r**2);## in^4
I_GG = I_yy - (a1-a2)*(e**2);## in^4
p_c = M*y_c/I_GG;## tons/in^2
p_t = M*y_t/I_GG;## tons/in^2
p_max = p_0 + p_t;## tons/in^2
p_min = p_0 - p_c;## tons/in^2
print'%s %.1f %s'%('p_max = ',p_max,' tons/in^2., tensile')
print'%s %.2f %s'%('p_min =',p_min,'tons/in^2., tensile')

p_max =  6.5  tons/in^2., tensile
p_min = 4.31 tons/in^2., tensile


## Ex5-pg326¶

In [5]:
import math
#calculate p_max and p_min
h = 20.;## feet
b = 12.;## feet
d = 4.;## feet
p = 30.;## lb. per sq.foot
rho = 140.;## lb. per cubic foot
p_0 = rho*h;## lb-ft^2
P = p*b*h;## lb-wt
M = P*h/2;##lb-ft
Z = b*d**2/6;## ft^3
p_b = M/Z;## lb/ft^2
p_max = p_0 + p_b;## lb/ft^2
p_min = p_0 - p_b;## lb/ft^2
print'%s %.d %s'%('p_max =',p_max,'lb/ft^2., compressive')
print'%s %.d %s'%('p_min =',p_min,'lb/ft^2., compressive')

p_max = 5050 lb/ft^2., compressive
p_min = 550 lb/ft^2., compressive


## Ex6-pg327¶

In [6]:
import math
#calculate The necessary thickness
h = 80.;## feet
p = 28.;## lb. per sq.foot
rho = 126.;## lb. per cubic foot
p_0 = rho*h/2240.;## tons-ft^2
p_max = 7.;## tons/ft^2
d = 4.;## feet
p_b = p_max - p_0;## tons/ft^2
D = math.sqrt(3*p*h**2 /(2*p_b*2240.) +math.sqrt(d**4 + (3*p*h**2 /(2.*p_b*2240.))**2));## feet
t = 0.5*(D-d);## feet
print'%s %.d %s'%('The necessary thickness is, t =',round(t),'feet');

The necessary thickness is, t = 3 feet


## Ex7-pg330¶

In [7]:
import math
#calculate  p_max and p_min
h = 60.;##feet
rho = 130.;## lb. per cubic foot
D = 12.;##feet
d = 5.;##feet
P_h = 24.;## lb. per sq. foot
p_0 = rho*h;## lb-ft^2
P = P_h*D*h;## lb-wt
M = P*h/2;## lb-feet
Z = math.pi*(D**4 - d**4)/(32*D);##lb-ft^3
p_b = M/Z;## lb/ft^2
p_max = p_0 + p_b;## lb/ft^2
p_min = p_0 - p_b;## lb/ft^2
print'%s %.d %s'%('p_max =',p_max,'lb/ft^2., compressive')
print'%s %.d %s'%('p_min =',p_min,'lb/ft^2., compressive')
##there is an error in the answer given in text book

p_max = 10950 lb/ft^2., compressive
p_min = 4649 lb/ft^2., compressive


## Ex8-pg330¶

In [8]:
import math
import scipy
#calculate Bending moment at the foot of the chimney
from scipy import integrate
h = 120.;## feet
d = 5.;## feet
h1 = 49.;## feet
p = 42.;## lb. per square foot
c = 0.6;
k = p/math.sqrt(h1);
##p = k*math.sqrt(x)

def fun(x):
y=18.*x**(3./2.)
return y

M=M[0]
print'%s %.1f %s'%('Bending moment at the foot of the chimney is, M =',M,'lb-ft');
##there is an error in the answer given in text book
print(M)

Bending moment at the foot of the chimney is, M = 1135757.5 lb-ft
1135757.49523


## Ex9-pg331¶

In [9]:
import math
#calculate Bending moment at the foot of the chimney
import scipy
from scipy import integrate
h = 100.;## feet
d = 4.;## feet
p = 50.;## lb. per square foot
c = 2/3.;
def fun(x):
y=(100*x/3.)*(10-(6*x/100.))
return y;

M = M[0]
print'%s %.d %s'%('Bending moment at the foot of the chimney is, M =',M,'lb-feet');

Bending moment at the foot of the chimney is, M = 1000000 lb-feet


## Ex10-pg332¶

In [10]:
import math
#calculate p_max  and p_min
h = 20.;## feet
b = 4.;## feet
d = 12.;## feet
h1 = 18.;## feet
##density of masonary
rho_m = 140.;## lb-ft^3
##density of water
rho_w = 62.5;## lb-ft^3
W = rho_m*0.5*(b+d)*h;## lb-wt
##to locate its line of action divide the dam section into a rectangle and a triangle
x1 = b/2.;##feet
a1 = b*h;## sq. feet
a2 = 0.5*(d-b)*h;## sq. feet
x2 = b+((d-b)/3);## feet
x_bar = (a1*x1+a2*x2)/(a1+a2);## feet
P = rho_w*h1**2/2;## lb-wt
z = x_bar + (h1/3)*(P/W);## feet
e = z - d/2.;## feet
p_0 = W/d;## lb/ft^2
M = W*e;## lb-feet
Z = 1*d**2*1/6.;## ft^3
p_b = M/Z;## lb-ft^2
p_max = p_0 + p_b;## lb-ft^2
p_min = p_0 - p_b;## lb-ft^2
print'%s %.1f %s'%('p_max =',p_max,'lb/ft^2., compressive at B.')
print'%s %.1f %s'%('p_min =',p_min,'lb/ft^2., compressive at A.')

##there is an error in the answer given in text book

p_max = 2842.4 lb/ft^2., compressive at B.
p_min = 891.0 lb/ft^2., compressive at A.