import math
#Given
#Variable declaration
L=150 #Length of the rod in cm
D=20 #Diameter of the rod in mm
P=20*10**3 #Axial pull in N
E=2.0e5 #Modulus of elasticity in N/sq.mm
#Calculation
A=(math.pi/4)*(D**2) #Area in sq.mm
#case (i):stress
sigma=P/A #Stress in N/sq.mm
#case (ii):strain
e=sigma/E #Strain
#case (iii):elongation of the rod
dL=e*L #Elongation of the rod in cm
#Result
print "Stress =",round(sigma,3),"N/mm^2"
print "Strain =",round(e,6)
print "Elongation =",round(dL,4),"cm"
import math
#Given
#variable declaration
P=4000 #Load in N
sigma=95 #Stress in N/sq.mm
#Calculation
D=round(math.sqrt(P/((math.pi/4)*(sigma))),2) #Diameter of steel wire in mm
#Result
print "Diameter of a steel wire =",D,"mm"
import math
#Given
#Variable declaration
D=25 #Diameter of brass rod in mm
P=50*10**3 #Tensile load in N
L=250 #Length of rod in mm
dL=0.3 #Extension of rod in mm
#Calculation
A=(math.pi/4)*(D**2) #Area of rod in sq.mm
sigma=round(P/A,2) #Stress in N/sq.mm
e=dL/L #Strain
E=(sigma/e) #Young's Modulus in N/sq.m
#Result
print "Young's Modulus of a rod,E =",round(E*(10**-3),3),"GN/m^2" #Young's Modulus in GN/sq.m
import math
#Given
#Variable Declaration
D=3 #Diameter of the steel bar in cm
L=20 #Gauge length of the bar in cm
P=250 #Load at elastic limit in kN
dL=0.21 #Extension at a load of 150kN in mm
Tot_ext=60 #Total extension in mm
Df=2.25 #Diameter of the rod at the failure in cm
#Calculation
A=round((math.pi/4)*(D**2),5) #Area of the rod in sq.m
#case (i):Young's modulus
e=round((150*1000)/(7.0685),1) #stress in N/sq.m
sigma=dL/(L*10) #strain
E=round((e/sigma)*(10**-5),3) #Young's modulus in GN/sq.m
#case (ii):stress at elastic limit
stress=int(round((P*1000)/A,0))*1e-2 #stress at elastic limit in MN/sq.m
#case (iii):percentage elongation
Pe=(Tot_ext*1e2)/(L*10)
#case (iv):percentage decrease in area
Pd=(D**2-Df**2)/D**2*1e2
#Result
print "NOTE:The Young's Modulus found in the book is incorrect.The correct answer is,"
print "Young's modulus,E =",E,"GN/m^2"
print "Stress at the elastic limit,Stress =",stress,"MN/m^2"
print "Percentage elongation = %d%%"%Pe
print "Percentage decrease in area = %.2f%%"%Pd
import math
#Given
#Variable declaration
sigma=125*10**6 #Safe stress in N/sq.m
P=2.1*10**6 #Axial load in N
D=0.30 #External diameter in m
#Calculation
d=round(math.sqrt((D**2)-P*4/(math.pi*sigma)),4)*1e2 #internal diameter in cm
#Result
print "internal diameter =",d,"cm"
import math
#Given
#Variable declaration
stress=480 #ultimate stress in N/sq.mm
P=1.9*10**6 #Axial load in N
D=200 #External diameter in mm
f=4 #Factor of safety
#Calculation
sigma=stress/f #Working stress or Permissable stress in N/sq.mm
d=str(math.sqrt((D**2)-((P*4)/(math.pi*sigma))))[:6] #internal diameter in mm
#Result
print "internal diameter =",d,"mm"
import math
#Given
#Variable declaration
D1=40 #Larger diameter in mm
D2=20 #Smaller diameter in mm
L=400 #Length of rod in mm
P=5000 #Axial load in N
E=2.1e5 #Young's modulus in N/sq.mm
#Calculation
dL=float(str((4*P*L)/(math.pi*E*D1*D2))[:7]) #extension of rod in mm
#Result
print "Extension of the rod =",dL,"mm"
import math
#Given
#Variable declaration
D1=30 #Larger diameter in mm
D2=15 #Smaller diameter in mm
L=350 #Length of rod in mm
P=5.5*10**3 #Axial load in N
dL=0.025 #Extension in mm
#Calculation
E=int((4*P*L)/(math.pi*D1*D2*dL)) #Modulus of elasticity in N/sq.mm
#Result
print "Modulus of elasticity,E = %.5e"%E,"N/mm^2"
import math
#Given
#Variable declaration
L=2.8*10**3 #Length in mm
t=15 #Thickness in mm
P=40*10**3 #Axial load in N
a=75 #Width at bigger end in mm
b=30 #Width at smaller end in mm
E=2e5 #Young's Modulus in N/sq.mm
#Calculation
dL=round((round((P*L)/(E*t*(a-b)),4)*(round(math.log(a)-math.log(b),4))),2) #extension of rod in mm
#Result
print "Extension of the rod,dL =",dL,"mm"
import math
#Given
#Variable declaration
dL=0.21 #Extension in mm
L=400 #Length in mm
t=10 #Thickness in mm
a=100 #Width at bigger end in mm
b=50 #Width at smaller end in mm
E=2e5 #Young's Modulus in N/sq.mm
#Calculation
P=int(dL/(round((L)/(E*t*(a-b)),6)*(round(math.log(a)-math.log(b),4))))*1e-3 #Axial load in kN
#Result
print "Axial load =",P,"kN"
import math
#Given
#Variable declaration
Di_s=140 #Internal diameter of steel tube in mm
De_s=160 #External diameter of steel tube in mm
Di_b=160 #Internal diameter of brass tube in mm
De_b=180 #External diameter of brass tube in mm
P=900e3 #Axial load in N
L=140 #Length of each tube in mm
Es=2e5 #Young's modulus for steel in N/sq.mm
Eb=1e5 #Young's modulus for brass in N/sq.mm
#Calculation
As=round(math.pi/4*(De_s**2-Di_s**2),1) #Area of steel tube in sq.mm
Ab=round(math.pi/4*(De_b**2-Di_b**2),1) #Area of brass tube in sq.mm
sigmab=round(P/(2*As+Ab),2) #Stress in steel in N/sq.mm
sigmas=2*sigmab #Stress in brass in N/sq.mm
Pb=int(sigmab*Ab)*1e-3 #Load carried by brass tube in kN
Ps=(P*1e-3)-(Pb) #Load carried by steel tube in kN
dL=round(sigmab/Eb*(L),4) #Decrease in length in mm
#Result
print "Stress in brass =",sigmab,"N/mm^2"
print "Stress in steel =",sigmas,"N/mm^2"
print "Load carried by brass tube =",Pb,"kN"
print "Load carried by stress tube =",Ps,"kN"
print "Decrease in the length of the compound tube=",dL,"mm"
#Given
#Variable declaration
L=2*10**2 #Length of rod in cm
T1=10 #Initial temperature in degree celsius
T2=80 #Final temperature in degree celsius
E=1e5*10**6 #Young's Modulus in N/sq.m
alpha=0.000012 #Co-efficient of linear expansion
#Calculation
T=T2-T1 #Rise in temperature in degree celsius
dL=alpha*T*L #Expansion of the rod in cm
sigma=int((alpha*T*E)*1e-6) #Thermal stress in N/sq.mm
#Result
print "Expansion of the rod =",dL,"cm"
print "Thermal stress =",sigma,"N/mm^2"
import math
#Given
#Variable declaration
d=3*10 #Diameter of the rod in mm
L=5*10**3 #Area of the rod in sq.mm
T1=95 #Initial temperature in degree celsius
T2=30 #Final temperature in degree celsius
E=2e5*10**6 #Young's Modulus in N/sq.m
alpha=12e-6 #Co-efficient of linear expansion in per degree celsius
#Calculation
A=math.pi/4*(d**2) #Area of the rod
T=T1-T2 #Fall in temperature in degree celsius
#case(i) When the ends do not yield
stress1=int(alpha*T*E*1e-6) #Stress in N/sq.mm
Pull1=round(stress1*A,1) #Pull in the rod in N
#case(ii) When the ends yield by 0.12cm
delL=0.12*10
stress2=int((alpha*T*L-delL)*E/L*1e-6) #Stress in N/sq.mm
Pull2=round(stress2*A,1) #Pull in the rod in N
#Result
print "Stress when the ends do not yield =",stress1,"N/mm^2"
print "Pull in the rod when the ends do not yield =",Pull1,"N"
print "Stress when the ends yield =",stress2,"N/mm^2"
print "Pull in the rod when the ends yield =",Pull2,"N"
from __future__ import division
import math
#Given
#Variable declaration
Ds=20 #Diameter of steel rod in mm
Di_c=40 #Internal diameter of copper tube in mm
De_c=50 #External diameter of copper tube in mm
Es=200*10**3 #Young's modulus of steel in N/sq.mm
Ec=100*10**3 #Young's modulus of copper in N/sq.mm
alpha_s=12e-6 #Co-efficient of linear expansion of steel in per degree celsius
alpha_c=18e-6 #Co-efficient of linear expansion of copper in per degree celsius
T=50 #Rise of temperature in degree celsius
#Calculation
As=(math.pi/4)*(Ds**2) #Area of steel rod in sq.mm
Ac=(math.pi/4)*(De_c**2-Di_c**2) #Area of copper tube in sq.mm
sigmac=float(str(((alpha_c-alpha_s)*T)/(((Ac/As)/Es)+(1/Ec)))[:6]) #Compressive stress in copper
sigmas=round(sigmac*(Ac/As),2) #Tensile stress in steel
#Result
print "Stress in copper =",sigmac,"N/mm^2"
print "Stress in steel =",sigmas,"N/mm^2"
import math
#Given
#Variable declaration
Dc=15 #Diameter of copper rod in mm
Di_s=20 #Internal diameter of steel in mm
De_s=30 #External diameter of steel in mm
T1=10 #Initial temperature in degree celsius
T2=200 #Raised temperature in degree celsius
Es=2.1e5 #Young's modulus of steel in N/sq.mm
Ec=1e5 #Young's modulus of copper in N/sq.mm
alpha_s=11e-6 #Co-efficient of linear expansion of steel in per degree celsius
alpha_c=18e-6 #Co-efficient of linear expansion of copper in per degree celsius
#Calculation
Ac=(math.pi/4)*Dc**2 #Area of copper tube in sq.mm
As=(math.pi/4)*(De_s**2-Di_s**2) #Area of steel rod in sq.mm
T=T2-T1 #Rise of temperature in degree celsius
sigmas=round(((alpha_c-alpha_s)*T)/((round(As/Ac,2)/Ec)+(1/Es)),3)
sigmac=round(sigmas*round(As/Ac,2),2)
#Result
print "NOTE: The answers in the book for stresses are wrong.The correct answers are,"
print "Stress in steel =",sigmas,"N/mm^2"
print "Stress in copper =",sigmac,"N/mm^2"
import math
#Given
#Variable declaration
Dg=20 #Diameter of gun metal rod in mm
Di_s=25 #Internal diameter of steel in mm
De_s=30 #External diameter of steel in mm
T1=30 #Temperature in degree celsius
T2=140 #Temperature in degree celsius
Es=2.1e5 #Young's modulus of steel in N/sq.mm
Eg=1e5 #Young's modulus of gun metal in N/sq.mm
alpha_s=12e-6 #Co-efficient of linear expansion of steel in per degree celsius
alpha_g=20e-6 #Co-efficient of linear expansion of gun metal in per degree celsius
#Calculation
Ag=(math.pi/4)*Dg**2 #Area of gun metal in sq.mm
As=(math.pi/4)*(De_s**2-Di_s**2) #Area of steel in sq.mm
T=T2-T1 #Fall in temperature in degree celsius
sigmag=round(((alpha_g-alpha_s)*T)/(((Ag/As)/Es)+(1/Eg)),2)
sigmas=round(sigmag*(Ag/As),2)
#Result
print "Stress in gun metal rod =",sigmag,"N/mm^2"
print "Stress in steel =",sigmas,"N/mm^2"
import math
#Given
#Variable declaration
P=600e3 #Axial load in N
L=20e3 #Length in mm
w=0.00008 #Weight per unit volume in N/sq.mm
A2=400 #Area of bar at lower end in sq.mm
#Calculation
sigma=int(P/A2) #Uniform stress on the bar in N/sq.mm
A1=round(A2*round(math.exp(round(w*L/sigma,7)),5),3)
#Result
print "Area of the bar at the upper end =",A1,"mm^2"