##Part B Chapter 4 Example 1 pg no 578
##find the Angle of twist and Shear stress at inside surface
import math
R=75.;##mm
G=75.;##GN/m^2
L=3.;##m
tau_s=75.;##MN/m^2
theta=tau_s*L/R/G*180./math.pi;##degree
print"%s %.2f %s"%("Angle of twist is ",theta," degree.");
r=50.;##mm
tau=tau_s*r/R;##MN/m^2
print"%s %.2f %s"%("Shear stress at inside surface is ",tau," MN/m^2");
##Part B Chapter 4 Example 2 pg no 579
##find the Shear stress at inside surface and power
import math
R=125.;##mm
D=250./1000.;##m
d=160./1000.;##m
tau_s=70.;##MN/m^2
IP=math.pi/32.*(D**4-d**4);##m^4
Tmax=tau_s*10**6*IP/(R/1000.);##Nm
Tmin=Tmax/1.40;##Nm
N=60.;##RPM
P=2.*math.pi*N*Tmin/60.;##W
print"%s %.2f %s"%("Power transmitted by the shaft is ",P/1000," kW");
L=5.;##m
G=80.;##GN/m^2
theta=tau_s*L/R/G*180./math.pi;##degree
print"%s %.2f %s"%("Angle of twist is ",theta," degree.");
##Solution is not complete in the book.
##Part B Chapter 4 Example 3 pg no 580
##find the find the Shear stress at inside surface and power
import math
n=12.;##bolts
PCD=300.;##mm
D=50.;##mm
Ddash=90.;##mm
tau_s=60.;##MN/m^2
T=tau_s*10**6*math.pi*(D/1000.)**4/(D/2.*10**-3*32.);##Nm
R=Ddash/2.;##mm
d=(Ddash**4-T*1000.*R*32./60./math.pi)**(1./4.);##mm
print"%s %.2f %s"%("Internal diameter of hollow shaft is ",d," mm");
Tb=T/n;##Nm per bolt
PCrad=150.;##/mm
Fb=Tb/(PCrad/1000.);##N(Force on bolt)
tau_sb=20.;##MN/m^2
Ab=Fb/tau_sb/10**6;##m^2(Area of bolt)
db=math.sqrt(Ab/(math.pi/4.));##m
print"%s %.2f %s"%("Bolt diameter is ",db*1000," mm");
##Part B Chapter 4 Example 4 pg no 581
##find the find the Shear stress at inside surface and power
import math
D=50.;##mm
l=3.;##m
P=60.;##hp
N=250.;##rpm
G=90.;##GN/m^2
Pl=20.;##hp(assumed)
Tl=Pl*746./2./math.pi/N;##Nm
Pr=Pl*2.;##hp(Pr:Pl=1:2)
Tr=Pr*746./2./math.pi/N;##Nm
tau_max=Tr*(D/2.)*10**-3*32./(math.pi*(D/1000.)**4);##MN/m^2
print"%s %.2f %s"%("Maximum shear stress is ",tau_max/10**6," MN/m^2.");
theta_l=Tl*1.5*32./(G*10**9*math.pi*(D/1000.)**4);##radian
theta_r=Tr*1.5*32./(G*10**9*math.pi*(D/1000.)**4);##radian
theta=theta_r-theta_l;##radian
print"%s %.4f %s"%("Angle of twist is ",theta," radian.");
##Part B Chapter 4 Example 5 pg no 582
##find the find the Shear stress at inside surface and power
import math
D=25.;##mm
L=250.;##mm
d=0.120;##mm(stretch)
F=60.;##kN
theta=0.030;##radian
T=0.5;##kNm
epsilon=d/L;
sigma=F*1000.*4./(math.pi*(D/1000.)**2.);##GN/m^2
E=sigma/epsilon/10**9;##GN/m^2
print"%s %.2f %s"%("Value of E is ",E," GN/m^2");
G=T*1000*32*L/1000/(theta*math.pi*(D/1000.)**4)/10**9;##GN/m^2
print"%s %.2f %s"%("Value of G is ",G," GN/m^2");
m=2*G/E/(1-2*G/E);
print"%s %.2f %s"%("Poisson ratio is ",1/m,"");
K=m*E/3/(m-1);##GN/m^2
print"%s %.2f %s"%("Bulk Modulus, K is ",K," GN/m^2");
##Part B Chapter 4 Example 6 pg 583
##find the find the Shear stress at inside surface and power
import math
L=2.5;##m
P=70*1000.;##W
N=250.;##rpm
tau_max=55.*10**6;##N/m^2
theta=1;##degree
theta=theta*math.pi/180.;##radian
G=100.;##GN/m^2
T=P*60./2./math.pi/N;##Nm
d1=(T*16./math.pi/(tau_max))**(1/3.);##m
d2=(T*32./math.pi/(G*10**9*theta/L))**(1/4.);##m(Condidering twist 1 degree)
d=max(d1,d2)*1000;##mm
print"%s %.2f %s"%("Suitable diameter is ",d," mm");
##Part B Chapter 4 Example 7 pg no 584
##find the Suitable diameter
import math
M=2.5*1000.;##Nm
T=3.5*1000.;##Nm
Te=math.sqrt(M**2+T**2)##Nm
Me=(M+math.sqrt(M**2+T**2))/2.##Nm
tau_max=400.*10**6;##N/m^2
d1=(Te*16./math.pi/tau_max)**(1/3.)*1000.;##mm
sigma=750.*10**6;##N/m^2
d2=(Me*32./math.pi/sigma)**(1/3.)*1000.;##mm
d=max(d1,d2);##mm
print"%s %.2f %s"%("Suitable diameter is ",round(d)," mm");
##Part B Chapter 4 Example 8 pg no 585
##find the Maximum torque and Rotation of free end
import math
db=100.;##m
ds=75.;##mm
Lb=1.2*1000.;##mm
Ls=1.2*1000.;##mm
Gb=40.;##kN/mm^2
Gs=80.;##kN/mm^2
tau_s_AB=100.;##N/m^2
T_AB=tau_s_AB*math.pi*db**4./32./(db/2.);##Nmm
tau_s_BC=120.;##N/m^2
T_BC=tau_s_BC*math.pi*ds**4./32./(ds/2.);##Nmm
T=min(T_AB,T_BC);##Nmm(For safety minimum value choosen)
print"%s %.2f %s"%("Maximum torque can be applied is ",T," Nmm");
theta=T*(Lb/(Gb*1000.)/(math.pi/32.*db**4)+Ls/(Gs*1000.)/(math.pi/32.*ds**4));##radian
print"%s %.2f %s"%("Rotation of free end is ",theta," radian");
##ANSWER IN THE BOOK IS WRONG.
##Part B Chapter 4 Example 9 pg no 586
##find the Strength ratio and Weight ratio
import math
d=120.;##mm
D1=120.;##mm
D2=60.;##mm
ThBYTs=(D1**4-D2**4)/d**4;
WhBYWs=math.pi/4.*((D1**2-D2**2)/(math.pi/4.)/d**2);
print"%s %.2f %s"%("Strength ratio, Th/Ts is ",ThBYTs,"");
print"%s %.2f %s"%("Weight ratio, Wh/Ws is ",WhBYWs," ");
##Part B Chapter 4 Example 10 pg no 587
##calculate the Shear Stress in Solid shaft
import math
d=50.;##mm
D1=110.;##mm
D2=70.;##mm
L=1*1000.;##mm
T=1.5*10**6.;##kNmm
G=10**5.;##MPa
tauH_BY_tauS=D1/2./(d/2.);
##tauS=T/(tauH_BY_tauS*%pi*(D1^4-D2^4)/32/D1+%pi*d^4/d/32);##N/mm^2
tauS=T/(tauH_BY_tauS*math.pi*(D1**4.-D2**4.)/(D1*32.)+math.pi*d**4/(32.*d))
tauH=tauH_BY_tauS*tauS;##N/mm^2
print"%s %.2f %s"%("Shear Stress in Solid shaft is ",tauS," N/mm^2");
print"%s %.2f %s"%("Shear Stress in hollow shaft is ",tauH," N/mm^2");
thetaH=tauS/G/(d/2.);##radian
thetaS=thetaH;##radian
print"%s %.6f %s"%("Angle of twist oh both shaft is equal and it is ",thetaS," radian.");
##ANSWER IN THE BOOK IS WRONG.
##Part B Chapter 4 Example 11pg 588
##calculate the Shear Stress for shaft
import math
b=25.;##mm
L=120.;##mm
d=60;##mm
P=100.*1000.;##W
N=120.;##rpm
T=P*60./2./math.pi/N;##Nm
tauS=(T*16./math.pi/d**3)*1000.;##N/mm^2
tauK=(T*2./b/d/L)*1000.;##N/mm^2
print"%s %.2f %s"%("Shear Stress for shaft is ",tauS," N/mm^2");
print"%s %.2f %s"%("Shear Stress for key is ",tauK," N/mm^2");
##Part B Chapter 4 Example 12 pg 589
##calculate the suitable bolt
import math
n=8.;##no. of bolts
d=160.;##mm
F=450.;##kN
T=20.;##kNm
tau_t=120.;##N/mm^2(For tensile load)
tau_s=60.;##N/mm^2(For shear load)
db1=math.sqrt(F*1000./n/(math.pi/4)/tau_t);##mm
db2=math.sqrt(T*10**6/(n*tau_s*math.pi/4.*(d/2.)));##mm
db=max(db1,db2);##mm
print"%s %.2f %s"%("Suitable bolt diameter is ",db," mm");
##Part B Chapter 4 Example 13 pg no 590
##calculate the maximu power
import math
b=30.;##mm(thickness)
l=8.;##m
d=260.;##mm
D=d+2.*b;##mm
N=300.;##rpm
tau_s=16.;##N/mm^2
Gs=8.5*10**4;##N/mm^2
Gb=4.5*10**4;##N/mm^2
Ips=math.pi/32.*d**4;##mm^4
Ipb=math.pi/32.*(D**4-d**4);##mm^4
TsByTb=Ips/Ipb*Gs/Gb;
Ts=math.pi/16.*d**3*tau_s;##Nmm
Tb=Ts/TsByTb;##Nmm
T=Ts+Tb;##Nmm
P=2*math.pi*N*T/60./1000.;##W
print"%s %.2f %s"%("Maximum power is ",P/1000," kW");
##Part B Chapter 4 Example 14 pg no 590
##calculate the Safe diameter of shaft
import math
tau_s=60.;##N/mm^2
##Forces on pulley A, B & C
A1=3000.;##N
A2=1000.;##N
B1=1200.;##N
B2=2200.;##N
C1=1000.;##N
C2=2250.;##N
dA=250.;##mm
dB=250.;##mm
dC=200.;##mm
TA=(A1-A2)*dA/2.;##Nmm
TB=(B2-B1)*dB/2.;##Nmm
TC=(C2-C1)*dC/2.;##Nmm
T=max(TA,TB,TC);##Nmm(Max. Torque)
d=(T/tau_s/(math.pi/16.))**(1/3.);##mm
print"%s %.2f %s"%("Safe diameter of shaft is ",d," mm");
##Part B Chapter 4 Example 15 pg no 592
##calculate the Maximum bending stress
import math
l=3.;##m
d1=85.;##mm
d2=65.;##mm
A=1*0.5;##m^2
Pw=2200.;##N/mm^2
LG=Pw*A##N(Total Wind load at G)
M=LG*(3.+0.25)##Nm(Max BM on pipe)
T=LG*(0.5+0.5);##Nm
I=math.pi/64.*(d1**4.-d2**4.);##mm^4
Z=I/42.5;##mm^3
Zp=2.*Z;##mm^3
sigma_b=M*1000./Z;##N/mm^2
tau_s=T*1000./Zp;##N/mm^2
print"%s %.2f %s"%("Maximum bending stress is ",sigma_b," N/mm^2");
print"%s %.2f %s"%("Maximum shear stress is ",tau_s," N/mm^2");
##Part B Chapter 4 Example 16 pg no 592
##calculate the Angular twist
import math
d1=80.;##mm
b=1.75;##mm
l=1.6;##m
T=80.;##Nm
G=82.;##GN/m^2
d2=d1-2.*b;##mm
Ip=math.pi/32.*(d1**4-d2**4)*10**-12;##m^4
theta=T*l/Ip/(G*10**9.);##radian
print"%s %.4f %s"%("Angular twist is ",theta," radian.");
##Part B Chapter 4 Example 17 pg no 593
##calculate the "Torque required
import math
l=25.;##m
d=0.5;##mm
n=10.;##no. of rounds
G=82.;##GN/m^2
Ip=math.pi/32*d**4*10**-12.;##m^4
theta=2.*math.pi*n;##radian
T=G*10**9.*Ip*theta/l;##Nm
print"%s %.4f %s"%("Torque required is ",T," Nm.");
##Part B Chapter 4 Example 18 pg no 593
##calculate the Maximum torque transmitted
import math
d=3.5/1000.;##m
tau_s=240.*10**6;##N/m^2
Ip=math.pi/32.*d**4;##m^4
T=tau_s*Ip/(d/2.);##Nm
print"%s %.2f %s"%("Maximum torque transmitted is ",T," Nm.");
##Part B Chapter 4 Example 19 pg no 593
##calculate the Outer diameter of hollow shaft
import numpy
import math
d=16.;##cm
As=math.pi/4.*d**2;##cm
deltaD=As/(math.pi/4.);##(let deltaD=D1^2-D2^2)
##USS=1.2*USH
##USS=(D1^2+D2^2)/D1^2*USH
D2BYD1=math.sqrt(0.2);
D1=math.sqrt(deltaD/(1.-D2BYD1**2));##cm
D2=D2BYD1*D1;##cm
D1=17.888544
D2=8
print"%s %.2f %s"%("Outer diameter of hollow shaft is ",D1," cm.");
print"%s %.2f %s"%("Inner diameter of hollow shaft is ",D2," cm.");
##Part B Chapter 4 Example 20 pg no 595
##calculate the uter diameter
import math
tau=82.;##N/mm^2
M=3.5/1000.;##Nm
T=4.5/1000.;##Nm
DoBYDi=2.;
Do=(16.*math.sqrt(M**2.+T**2)/math.pi/tau*16./15.)**(1./3.);##mm
Di=Do/DoBYDi;##mm
print"%s %.2f %s"%("Outer diameter is ",Do*1000," m.");
print"%s %.2f %s"%("Inner diameter is ",Di*1000," m.");