import math
#calculate maximum intensity of stress
b = 6.;## inches
t = 1./2.;## inch
R = 40.;## feet
E = 13000.;## tons/in^2
y = t/2.;## inch
f = (E/(R*12.))*(y);## tons/in^2
print'%s %.2f %s'%('The maximum intensity of stress induced is f =',f,'tons/in^2')
import math
#calculate moment of resistance and The radius to which it should be bent
d = 14.;## inches
I = 442.57;##inch units
f = 8.;## tons/in^2
E = 13000.;## tons/in^2
R = E*d/(2.*f);## inches
M_r = f*(I/(d/2.));## ton-inches
print'%s %.d %s'%('The radius to which it should be bent is R =',R,'inches')
print'%s %.1f %s'%('The radius to which it should be bent is R =',R/12,'feet');
print'%s %.1f %s'%('The moment of resistance is M_r =',M_r,'ton-inches');
import math
#calculate the load is uniformly spread over its span and the load is concentrated at the centre
d = 16.;## inches
I = 618.;## inch units
l = 24.;## feet
f = 15./2.;## tons/in^2
Z = I/(d/2.);## inch-units
M_r = f*Z;## ton-inches
##If the load is uniformly spread over its span,BM = W*l/8
W1 = 8.*M_r/(12.*l);##tons
##If the load is concentrated at the centre,BM = W*l/4
W2 = 4.*M_r/(12.*l);##tons
print'%s %.1f %s'%('If the load is uniformly spread over its span, then W is given by W1=',W1,'tons')
print'%s %.3f %s'%('If the load is uniformly spread over its span, then W is given by W1 =',W1/l,'ton per foot run');
print'%s %.2f %s'%('If the load is concentrated at the centre, then W is given by W =',W2,'tons')
import math
#calculalte The maximum permissible span for this beam
d = 20.;## inches
I = 1673.;## inch units
W = 3./4.;## ton per foot run
f = 8.;## tons/in^2
Z = I/(d/2.);## inch-units
M_r = f*Z;## ton-inches
l = math.sqrt(M_r*32/(3*12));##feet
print'%s %.2f %s'%('The maximum permissible span for this beam is l =',l,'feet')
import math
#calculate X
w = 160.;## lb. per sq. foot
b = 3.;## inches
d = 9.;## inches
l = 15.;## feet
f = 1200.;## lb. per sq. inch
Z = (1./6.)*b*d**2;## in^3
M_r = f*Z;## lb-inches
x = M_r/(w*l**2*12./8.);## feet
print'%s %.1f %s'%('x =',x,'feet');
##The answer is correct only, but it is approximated in the text book
import math
#calculate area of cross section of beam
l = 20.;## feet
b = 9.;## inches
h = 10.;## feet
w = 120.;## lb. per cub. foot
f = 1100.;## lb/in^2
W = w*(3./4.)*l*h;## lb-wt
BM_max = W*l*12./8.;## lb-inches
##assumnig d = 2b
b = (6.*BM_max/(f*4.))**(1/3.);## inches
d = 2.*b;## inches
print'%s %.3f %s'%('b =',b,'inches')
print'%s %.2f %s'%('d =',d,'inches',)
print'%s %.d %s'%('A section',b,'')
print'%s %.d %s'%('X',d,'will therfore do.')
import math
#calculate beam of area
B = 5.;## inches
D = 12.;## inches
t1 = 0.55;## inches
t2 = 0.35;## inches
f = 15./2.;## tons/in^2
l = 16.;## feet
b = B-t2;## inches
d = D-2.*t1;## inches
I_xx = (B*D**3 - b*d**3)/12.;## in^4
Z = I_xx/6.;## in^3
M_r = f*Z;## ton-inches
W = M_r/(l*12./8.);## tons
w = W/l;## ton per foot run
print'%s %.2f %s'%('W =',W,'tons')
print'%s %.2f %s'%('w =',w,'ton per foot run')
import math
#calculate maximum stress
D = 19.5;## inches
d = 18.;## inches
l = 30.;## feet
t1 = 3./4.;## inch
rho1 = 450.;## lb. per cub. foot
rho2 = 62.5;## lb. per cub. foot
A = 0.25*math.pi*(D**2 - d**2);## sq. in
DW = rho1*l*A/144.;## lb-wt
WW = rho2*0.25*math.pi*(D-d)**2*l;## lb-wt
W = DW+WW;## lb-wt
BM_max = W*l*0.0004467202*12./8.;## ton-inches
I_xx = (math.pi/64)*(D**4 - d**4);## in^4
Z_xx = I_xx/(0.5*d+t1);## ton/in^2
f = BM_max/Z_xx;## ton/in^2
print'%s %.3f %s'%('The maximum stress f =',f,'ton/in^2');
##there is an error in the answer given in text book
import math
#calculate The maximum permissible span for this beam
b = 6.;## inches
d = 12.;## inches
t1 = 7./8;## inch
t2 = 1./2.;## inch
I_xx = (1./12.)*(b*d**3 - (b-t2)*(d-2*t1)**3);## in^4
Z1 = I_xx/b;## in ^3
A = 2*b*t1 + 0.5*(d-2*t1);## in^2
b = math.sqrt(A/2);## inches
d = 2.*b;## inches
Z2 = (1./6.)*b*d**2;## in^3
k = Z1/Z2 ;
print'%s %.2f %s'%('The ratio of strengths Z1/Z2 =',k,'');
##there is an error in the answer given in text book
import math
#calculate the strength of the solid circular section is taken as unity
A = 15.625;## in**2
Z1 = 61.75;## in**3
Z2 = 14.63;## in**3
d = math.sqrt(4.*A/math.pi);## inches
Z3 = (math.pi/32.)*d**3.;## in**3
R1 = Z1/Z3;
R2 = Z2/Z3;
print('If the strength of the solid circular section is taken as unity')
print'%s %.2f %s %.2f %s'%('that of the rectangular section is',R1,' and of the I-section it is ',R2,'')
import math
#calculate Position of the c.g of the sections
D = 8.;##h inches
B = 3.;## inches
t1 = 1/2.;## inch
t2 = 3/8.;## inch
b = B-t2;## inches
d = D-2.*t1;## inches
a1 = t1*B;## in**2
x1 = 0.5*B;## inches
a2 = t2*(D-2.*t1);## in**2
x2 = 0.5*t2;## inches
a3 = B*t1;## in**2
x3 = 0.5*B;## inches
a = a1+a2+a3;## in**2
P = (a1*x1+a2*x2+a3*x3)/(a1+a2+a3);## inches
I_xx = (1/12.)*(B*D**3. - b*d**3.);## in**4
I_AB = (1/3.)*t1*B**3. + (1/3.)*d*t2**3. + (1/3.)*t1*B**3.;## in**4
I_yy = I_AB - a*P**2.;## in**4
print'%s %.3f %s'%('Position of the c.g of the section P = ',P,' inches');
print'%s %.4f %s'%('I_xx = ',I_xx,'in**4')
print'%s %.3f %s' %('I_yy =',I_yy,'in**4');
##there is an error in the answer given in text book
import math
#calculate The position of the c.g and Maximum stresses induced
b = 6.;## inches
d = 4.;## inches
t = 5/8.;## inch
a1 = d*t;## in^2
y1 = d/2.;## inches
a2 = (b-t)*t;## in^2
y2 = t/2.;## inch
a = a1+a2;## in^2
J = (a1*y1+a2*y2)/(a1+a2);## inches
I_AB = (1/3.)*t*d**3 + (1/3.)*(b-t)*t**3;## in^4
I_xx = I_AB - a*J**2.;## in^4
I_yy = (1/12.)*t*b**3. + (1/12.)*(d-t)*t**3.;## in^4
print'%s %.1f %s'%('The position of the c.g is J = ',J,' inches');
print'%s %.2f %s %.2f %s'%(' I_xx =',I_xx,' in^4,'' I_yy = ',I_yy,'in^4');
##14(a)
H = 18.;## feet
l = 10.;## feet
w = 3/2.;## cwt/ per .sq. foot
y_c = 2.97;## inches
y_t = 1.03;## inches
W = (3/40.)*(w*l);## tons
BM_max = W*l*12./8.;## ton-inches
M_r = BM_max;## ton-inches
f_c = M_r*y_c/I_xx ;## tons/in^2
f_t = M_r*y_t/I_xx ;## tons/in^2
print'%s %.2f %s %.2f %s'%(' Maximum stresses induced are f_c = ',f_c,' tons/in^2,''f_t = ',f_t,' tons/in^2');
import math
#calculate The position of c.g is x_bar and Total uniformly distribute load over the span
b = 5.;## inches
d = 4.;## inches
t = 1/2.;## inches
a1 = b*t;## in**2
x1 = t/2.;## inches
y1 = b/2.;## inches
a2 = (d-t)*t;## in**2
y2 = t/2.;## inch
x2 = t + 0.5*(d-t);## inches
x_bar = (a1*x1+a2*x2)/(a1+a2);## inches
y_bar = (a1*y1+a2*y2)/(a1+a2);## inches
I_AB = (1/3.)*t*b**3. + (1/3.)*(d-t)*t**3.;## in**4
I_xx = I_AB - (a1+a2)*y_bar**2.;## in**4
I_yy = (1/3.)*t*d**3. + (1/3.)*(b-t)*t**3. - (a1+a2)*x_bar**2.;## in**4
print'%s %.3f %s %.2f %s'%('The position of c.g is x_bar = ',x_bar,'inches'and'y_bar = ',y_bar,'inches');
print'%s %.3f %s %.2f %s'%('I_xx = ',I_xx,'in**4'and 'I_yy = ',I_yy,' in**4');
##Example 15(a)
l = 12.;## feet
y_c = y_bar;##inches
y_t = b - y_c;##inches
f_t_max = 7.;## tons/in**2
f_c = y_c*f_t_max/y_t;## tons/in**2
M_r = f_t_max*I_xx/y_t;## ton-inches
W = M_r/(l*12./8.);## tons
print'%s %.2f %s'%(' Total uniformly distribute load over the span is W = ',W,' tons');
import math
#calculate The c.g of the section is y_bar and Load required
b1 = 6.;##inches
d1 = 1.;##inch
b2 = 9.;##inches
d2 = 1.;##inch
b3 = 10.;##inches
d3 = 2.;##inch
a1 = b3*d3;## in**2
y1 = d3/2.;## inches
a2 = b2*d2;## in**2
y2 = d3 + b2/2.;## inches
a3 = b1*d1;## in**2
y3 = b2+d3+d1/2.;## inches
y_bar = (a1*y1+a2*y2+a3*y3)/(a1+a2+a3);##inches
I_AB = (1/3.)*b3*d3**3 + (1/12.)*d2*b2**3. +b2*(d3+b2/2.)**2 + (1/12.)*b1*d1**3 + b1*(b2+d3+d1/2.)**2.;## in**4
I_xx = I_AB - (a1+a2+a3)*y_bar**2;## in**4
I_yy = (1/12.)*(d3*b3**3 + b2*d2**3 +d1*b1**3.);## in**4
print'%s %.3f %s'%('The c.g of the section is y_bar = ',y_bar,' inches');
print'%s %.2f %s %.2f %s'%(' I_xx = ',I_xx,' in**4' 'I_yy = ',I_yy,' in**4');
##Example 16(a)
l = 20.;## feet
y_t = y_bar;## inches
y_c = d1+b2+d3-y_t;## inches
f_t = 1.5;## tons/in**2
f_c = y_c*f_t/y_t;## tons/in**2
M_r = f_c*I_xx/y_c;## ton-inches
W = M_r*8./(l*12.);## tons
w = W/l;## ton per foot run
print'%s %.2f %s'%('Load required is w = ',w,' ton per foot run');
import math
#calculate stresses
b = 12.;## inches
d = 6.;## inches
h = 14.;## inches
t = 1/2.;## inch
A = 12.94;## in^2
##section moment of inertia
I_xx_s = 315.3;## in^4
I_yy_s = 22.27;## in^4
I_xx = 2.*I_xx_s + 2.*((1./12.)*h*(2.*t)**3 + h*2.*t*(d+t)**2.);## in^4
I_yy = 2.*(I_yy_s + A*(d/2.)**2.) + 2.*((1/12.)*2*t*h**3.);## in^4
print'%s %.2f %s %.2f %s'%('I_xx = ',I_xx,' in^4 I_yy = ',I_yy,' in^4');
import math
#calculate maximum loads
b = 15.;## inches
d = 15/2.;## inches
h = 16.;## inches
t = 1/2.;## inch
P = 0.935;## inches
A = 12.33;## in**2
##section moment of inertia
I_xx_s = 377.;## in**4
I_yy_s = 14.55;## in**4
I_xx = 2.*I_xx_s + 2.*((1/12.)*h*(2.*t)**3. + h*2.*t*(d+t)**2.);## in**4
I_yy = 2.*(I_yy_s + A*(d/2. + P)**2.) + 2.*((1/12.)*2.*t*h**3.);## in**4
print'%s %.2f %s %.2f %s'%('I_xx = ',I_xx,'in**4 I_yy = ',I_yy,'in**4')
import math
#calculate maximum stresses
b1 = 16.;## inches
d1 = 6.;## inches
b2 = 9.;## inches
d2 = 7.;## inches
A = 14.71;## in**2
I_xx1 = 618.09;## in**4
I_yy1 = 22.47;## in**4
I_xx2 = 208.13;## in**4
I_yy2 = 40.17;## in**4
I_xx = I_xx1 + 2.*I_yy2;## in**4
I_yy = I_yy1 + 2.*(I_xx2 + A*(b2/2. + 0.5*0.4)**2.);## in**4
k_xx = math.sqrt(I_xx/(3.*A));## inches
k_yy = math.sqrt(I_yy/(3.*A));## inches
print'%s %.2f %s %.2f %s %.2f %s %.2f %s'%('I_xx =',I_xx,' in**4 I_yy = ',I_yy,' in**4' 'k_xx =',k_xx,' inches'' k_yy = ',k_yy,' inches');
import math
#calculate maximum load stresses
b1 = 7/2.;## inches
d1 = 7/2.;## inches
t1 = 3/8.;## inches
l = 18.;## inches
I_xx1 = 2.80;## in^4
I_yy1 = 2.80;## in^4
J = 1.;## inch
A = 2.49;## in^2
I_xx = 4.*(I_xx1 + A*(l/2. - J)**2);## in^4
k_xx = math.sqrt(I_xx/(4.*A));## inches
print'%s %.2f %s %.1f %s'%('I_xx = ',I_xx,' in^4'' k_xx = ',k_xx,' inches');
import math
#calculate maximum stresses
b1 = 12.;## inches
d1 = 4.;## inches
A = 9.21;## in^2
I_xx1 = 200.1;## in^4
P = 1.055;## inches
I_yy1 = 12.12;## in^4
I_xx = 2.*I_xx1;
##for equal strength I_xx = I_yy
x = 2.*(math.sqrt(((I_xx/2.)-I_yy1)/A) - P);## in^4
print'%s %.2f %s'%('x = ',x,' inches');
##answer is corrct only, but it is approximated in the text book.
import math
#calculate The moment of resistance offered by the flanges and The moment of resistance offered by the flanges
import scipy
from scipy import integrate
d =10.;## inches
b = 8.;## inches
t1 = 1.;## inch
t2 = 0.6;## inch
I = (1./12.)*(b*d**3. - (b-t2)*b**3.);## in^4
##(i) Resistance to M
def fun(y):
x=(t2/I)*y**2.
return x
R1 = scipy.integrate.quad(fun,-4.,4.);
R1=R1[0]
##(ii) Resistance to F
def fun(y):
z=(4./I)*(25.-y**2.)
return z
R2 = scipy.integrate.quad(fun,4.,5.);
R2=R2[0]
print'%s %.2f %s %.2f %s %.1f %s '%('The moment of resistance offered by the flanges is',1-R1,'M' 'The flanges take up ',(1-R1)*100,'percentage of the B.M.,''the web resisting only ',R1*100,'percentage of the B.M');
print'%s %.3f %s %.3f %s %.3f %s '%(' The shear borne by the web is',(1-2*R2),'F' and ' The web thus takes up ',(1-2*R2)*100,' ' and 'percentage of the shear force.'and 'the flanges resisting only',2*R2*100,' percentage of the shear force');
import math
#calculate The maximum intensity of shear stress
b = 14.;## inches
d = 6.;## inches
t1 = 0.7;## inch
t2 = 0.4;## inch
F = 20.;## tons
I = (1./12.)*(d*b**3. - (d-t2)*(b-2.*t1)**3.);## in^4
q = F*t1*0.5*(0.5*b + (0.5*b-t1))/I;## ton/in^2
q_max = (F/(I*t2))*(d*t1*0.5*(0.5*b + (0.5*b-t1)) + t2*(0.5*b-t1)*(0.5*b-t1)*0.5);## tons/in^2
print'%s %.2f %s'%('The maximum intensity of shear stress is q_max = ',q_max,' tons/in^2');
import math
#calculate The maximum intensity of shear stress
b = 4.;## inches
d = 13/2.;## inches
t = 1/2.;## inch
a = 4.;## inches
F = 10.;## tons
a1 = b*t;## in^2
y1 = t/2.;## inch
a2 = (d-t)*t;## in^2
y2 = t+0.5*(d-t);## inches
y_bar = (a1*y1+a2*y2)/(a1+a2);## inches
I_AB = (1/3.)*b*t**3. + (1./12.)*t*(d-t)**3 + (b-2*t)*(b-t)**2.;## in^4
I_xx = I_AB - (a1+a2)*y_bar**2.;## in^4
q = (F/(b*I_xx))*b*t*(y_bar-0.5*t);## ton/in^2
q_max = (F/(t*I_xx))*(b*t*(y_bar-0.5*t) + 0.5*t*(y_bar-t)*(y_bar-t));## tons/in^2
print'%s %.2f %s'%('The maximum intensity of shear stress at the N.A is q_max = ',q_max,' tons/in^2');
#calculate tensile and compressive various inches at 2,4, 6 and at N.A points
import math
def func(p,q):
p1 = 0.5*p + math.sqrt(q**2. + 0.25*p**2);
p2 = 0.5*p - math.sqrt(q**2. + 0.25*p**2);
theta = 0.5*math.atan(2.*q/p) * 180/math.pi;
return p1,p2,theta
b = 5.;## inches
d = 12.;## inches
F = 4800. ;## lb-wt
M = 192000.;## lb-inches
I = (1/12.)*b*d**3.;## in**4
##At 6 inches above the N.A
p6 = M*6./I ; ## lb/in**2
q6 = 0;
[p1_6,p2_6,theta6] = func(p6,q6);
##At 4 inches above the N.A
p4 = M*4/I;## lb/in**2
q4 = (F/(I*b))*b*(0.5*d-4)*b;
[p1_4,p2_4,theta4] = func(p4,q4);
##At 2 inches above the N.A
p2 = M*2./I;## lb/in**2
q2 = (F/(I*b))*b*(0.5*d-2)*4.;
[p1_2,p2_2,theta2] = func(p2,q2);
##At the N.A
p = 0.;##
q = F*b*0.5**3*d**2./(I*b);## lb/in**2
p1 = q;## lb/in**2
p2 = -q;## lb/in**2
print'%s %.2f %s %.2f %s '%('At 6 inches above the N.A, p1 =',p1_6,' lb/in**2.'and 'compressive, and p2 = ',p2_6,'');
print'%s %.2f %s %.2f %s %.2f %s %.2f %s '%(' At 4 inches above the N.A, p1 =',p1_4,' lb/in**2.'and ' compressive, and p2 = ',-p2_4,' lb/in**2 'and'tensile theta1 = ',theta4,' degrees' 'theta2 = ',theta4+90,' degrees');
print'%s %.2f %s %.2f %s %.2f %s %.2f %s'%(' At 2 inches above the N.A, p1 = ',p1_2,' lb/in**2.'and' compressive' and 'p2 = ',-p2_2,' lb/in**2.,'and 'tensile theta1 = ',theta2,' degrees 'and ' theta2 = ',theta2+90,' degrees');
print'%s %.2f %s %.2f %s'%(' At the N.A, p1 = ',p1,' lb/in**2.,'and ' compressive, and p2 = ',-p2,'.,tensile ');
##there is an error in the answer given in text book
import math
#calculate At the top, principal stresses and The principal stresse across the diagonal and compressive on one plane
b = 10.;## inches
d = 8.;## inches
t1 = 1.;## inch
t2 = 0.6;## inch
M = 500.;## ton-inches
F = 25.;## tons
I = (1./12.)*(d*b**3. - (d-t2)*d**3.);## in**4
##At the top
p = M*b/(2.*I);## tons/in**2
q = 0.;
p1 = p;## tons/in**2
p2 = 0.;
print'%s %.1f %s %.1f %s'%('At the top, principal stresses are p1 =',p1,'tons/in**2'' p2 = ',p2,' tons/in**2')
##In the web, 4 inches from the N.A
p = M*d/(2.*I);## tons/in**2
q = F*d*t1*0.5*(d+t1)/(I*t2);## tons/in**2
theta = 0.5*math.atan(2*q/p);
theta1 = theta*180/math.pi;
theta2 = theta1+90;
p1 = 0.5*p + math.sqrt(q**2 + 0.25*p**2);## tons/in**2
p2 = 0.5*p - math.sqrt(q**2 + 0.25*p**2);## tons/in**2
print'%s %.3f %s %.1f %s %.1f %s %.1f %s '%(' In the web, 4 inches from the N.A.:'' The principal stresse are p1 = ',p1,' tons/in**2.,compressive\n p2 = ',-p2,' tons/in**2.,tensile\n theta1 =',theta1,' degrees\n theta2 = ',theta2,' degrees')
##At the N.A
p = 0.;
q = (F/(I*t2))*(d*t1*0.5*(d+t1) + t2*0.5*d*2*t1);
p1 = q;## tons/in**2
p2 = -q;##tons/in**2
print'%s %.1f %s %.1f %s'%(' The principal stresse across the diagonal are ',q,' tons/in**2., compressive on one plane and',q,' tons/in**2., tensile on the other.');
##there is an error in the answer given in text book
import math
#calculate maximum intensity of shear stress
W = 10.;## tons
l = 16.;## feet
f = 15/2.;## tons/in^2
##section modulus required
SM = W*l*12./(8.*f);## in^3
##for this section modulus
l1 = 12.;## inches
b1 = 5.;## inches
t1 = 0.55;## inches
t2 = 0.35;## inches
I_xx = 220.;## in^4
F_max = 5.;## tons
q_max = (F_max/(I_xx*t2))*(F_max*t1*(0.5*l1-0.5*t1) + t2*0.5*(0.5*l1-t1)**2);## tons/in^2
print'%s %.2f %s'%('The maximum intensity of shear stress is q_max = ',q_max,' tons/in^2');
import math
#calculate Skin stresse in steel plate and The total moment of resistance
b = 9/2.;## inches
D = 12.;## inches
d = 10.;## inches
t = 1/2.;## inches
f_w = 1000.;## lb/in**2
m = 18.;##m = E_s/E_w
f_t = m*d*f_w/D ;## lb/in**2
M_w = f_w*(1./6.)*2.*b*D**2.;## lb-inches
M_s = f_t*(1/6.)*t*d**2;## lb-inches
M = M_w + M_s;## lb-inches
print'%s %.1f %s %.1f %s'%('Skin stresse in steel plate is, M_s = ',M_s,' lb-inches'' The total moment of resistance is M =',M,' lb-inches')