import math
#Given
#Variable declaration
P=60*10**3 #Load in N
d=4*10 #diameter in mm
L=5*10**3 #Length of rod in mm
E=2e5 #Young's Modulus in N/sq.mm
#Calculation
A=(math.pi/4)*d**2 #Area in sq.mm
V=int(A*L) #Volume of rod in cubic.mm
#case (ii):stress in the rod
sigma=round(P/A,3) #stress in N/sq.mm
#case (i):stretch in the rod
x=round((sigma/E)*L,2) #stretch or extension in mm
#case (iii):strain energy absorbed by the rod
U=round((sigma**2/(2*E)*V),-1)*1e-3 #strain energy absorbed by the rod in Nm
#Result
print "stress in the rod =",sigma,"N/mm^2"
print "stretch in the rod =",x,"mm"
print "strain energy absorbed by the rod =",U,"N-m"
#Given
#Variable declaration
A=10*10**2 #Area of bar in sq.mm
L=3*10**3 #Length of bar in mm
x=1.5 #Extension due to suddenly applied load in mm
E=2e5 #Young's Modulus in N/sq.mm
#Calculation
sigma=int(x*E/L) #Instantaneous stress due to sudden load in N/sq.mm
P=int((sigma*A)/2*1e-3) #Suddenly applied load in kN
#Result
print "Instantaneous stress produced by a sudden load =",sigma,"N/mm^2"
print "Suddenly applied load =",P,"kN"
import math
#Given
#Variable declaration
L=2*10**3 #Length in mm
d=50 #Diameter in mm
P=100*10**3 #Suddenly applied load in N
E=200e3 #Young's Modulus in N/sq.mm
#Calculation
A=(math.pi/4)*d**2 #Area in sq.mm
sigma=round(2*P/A,2) #Instantaneous stress induced in N/sq.mm
dL=(sigma*L)/E #Elongation in mm
#Result
print "Instantaneous stress induced =",sigma,"N/mm^2"
print "Instantaneous elongation =",dL,"mm"
#Given
#Variable declaration
A=700 #Area in sq.mm
L=1.5*10**3 #Length of a metal bar in mm
sigma=160 #Stress at elastic limit in N/sq.mm
E=2e5 #Young's Modulus in N/sq.mm
#Calculation
V=A*L #Volume of bar in sq.mm
Pr=(sigma**2/(2*E)*V)*1e-3 #Proof resilience in N-m
P=int(sigma*A/2*1e-3) #Suddenly applied load in kN
P1=int(sigma*A*1e-3) #gradually applied load in kN
#Result
print "Proof resilience =",Pr,"N-m"
print "Suddenly applied load =",P,"kN"
print "Gradually applied load =",P1,"kN"
import math
#Given
#Variable declaration
P=10*10**3 #Falling weight in N
h=30 #Falling height in mm
L=4*10**3 #Length of bar in mm
A=1000 #Area of bar in sq.m
E=2.1e5 #Young's modulus in N/sq.mm
#Calculation
sigma=float(str((P/A)*(1+(math.sqrt(1+((2*E*A*h)/(P*L))))))[:5])
delL=round(sigma*L/E,3)
#Result
print "Instantaneous elongation due to falling weight =",delL,"mm"
import math
#Given
#Variable declaration
P=100 #Impact load in N
h=2*10 #Height in mm
L=1.5*1000 #Length of bar in mm
A=1.5*100 #Area of bar in sq.mm
E=2e5 #Modulus of elasticity in N/sq.mm
#Calculation
V=A*L #Volume in mm^3
#case(i):Maximum instantaneous stress induced in the vertical bar
sigma=round((P/A)*(1+(math.sqrt(1+((2*E*A*h)/(P*L))))),2)
#case(ii):Maximum instantaneous elongation
delL=round(sigma*L/E,3)
#case(iii):Strain energy stored in the vertical rod
U=round(sigma**2/(2*E)*V*1e-3,3)
#Result
print "NOTE:The answer in the book for instantaneous stress is incorrect.The correct answer is,"
print "Maximum instantaneous stress =",sigma,"N/mm^2"
print "Maximum instantaneous elongation =",delL,"mm"
print "Strain energy =",U,"N-m"
import math
#Given
#Variable declaration
delL=2.1 #Instantaneous extension in mm
L=3*10**3 #Length of bar in mm
A=5*100 #Area of bar in mm
h=4*10 #Height in mm
E=2e5 #Modulus of elasticity in N/sq.mm
#Calculation
V=A*L #Volume of bar in mm^3
#case(i):Instantaneous stress induced in the vertical bar
sigma=int(E*delL/L)
#case(ii):Unknown weight
P=round(((sigma**2)/(2*E)*V)/(h+delL),1)
#Result
print"Instantaneous stress =",sigma,"N/mm^2"
print"Unknown weight =",P,"N"
import math
#Given
#Variable declaration
d=12 #Diameter of bar in mm
delL=3 #Increase in length in mm
W=8000 #Steady load in N
P=800 #Falling weight in N
h=8*10 #Vertical distance in mm
E=2e5 #Young's modulus in N/sq.mm
#Calculation
A=round((math.pi/4)*d**2,1) #Area of bar in sq.mm
L=round(E*A*delL/W,1) #Length of the bar in mm
sigma=round(round(P/A,4)*float(str(1+(math.sqrt(1+round((2*E*A*h)/(P*L),2))))[:7]),4)
sigma=float(str(sigma)[:7]) #Stress produced by the falling weight in N/sq.mm
#Result
print "Stress produced by the falling weight =",sigma,"N/mm^2"
import math
#Given
#Variable declaration
d=12.5 #Diameter of the rod in mm
delL=3.2 #Increase in length in mm
W=10*1000 #Steady load in N
P=700 #Falling load in N
h=75 #Falling height in mm
E=2.1e5 #Young's modulus in N/sq.mm
#Calculation
A=round((math.pi/4)*d**2,2) #Area of rod in sq.mm
L=round(E*A*delL/W,1) #Length of the rod in mm
sigma=round((P/A)*(1+(math.sqrt(1+((2*E*A*h)/(P*L))))),2) #Stress produced by the falling weight in N/mm^2
#Result
print "NOTE:The given answer for stress is wrong.The correct answer is,"
print "Stress = %.2f N/mm^2"%sigma
import math
#Given
#Variable declaration
L=1.82*1000 #Length of rod in mm
h1=30 #Height through which load falls in mm
h2=47.5 #Fallen height in mm
sigma=157 #Maximum stress induced in N/sq.mm
E=2.1e5 #Young's modulus in N/sq.mm
#Calculation
U=sigma**2/(2*E) #Strain energy stored in the rod in N-m
delL=sigma*L/E #Extension of the rod in mm
Tot_dist=h1+delL #Total distance in mm
#case(i):Stress induced in the rod if the load is applied gradually
sigma1=round((U/Tot_dist)*L,1)
#case(ii):Maximum stress if the load had fallen from a height of 47.5 mm
sigma2=round((sigma1)*(1+(math.sqrt(1+((2*E*h2)/(sigma1*L))))),2)
#Result
print "Stress induced in the rod = %.1f N/mm^2"%sigma1
print "NOTE:The given answer for stress(2nd case) in the book is wrong.The correct answer is,"
print "Maximum stress if the load has fallen = %.2f N/mm^2"%sigma2
import math
#Given
#Variable declaration
L=4*10**3 #Length of bar in mm
A=2000 #Area of bar in sq.mm
P1=3000 #Falling weight in N(for 1st case)
h1=20*10 #Height in mm(for 1st case)
P2=30*1000 #Falling weight in N(for 2nd case)
h2=2*10 #Height in mm(for 2nd case)
E=2e5 #Young's modulus in N/sq.mm
#Calculation
V=A*L #Volume of bar in mm^3
#case(i):Maximum stress when a 3000N weight falls through a height of 20cm
sigma1=round(((math.sqrt((2*E*P1*h1)/(A*L)))),1)
#case(ii):Maximum stress when a 30kN weight falls through a height of 2cm
sigma2=round((P2/A)*(1+(math.sqrt(1+((2*E*A*h2)/(P2*L))))),2)
#Result
print"Maximum stress induced(when a weight of 3000N falls through a height of 20cm)=",sigma1,"N/mm^2"
print"Maximum stress induced(when a weight of 30kN falls through a height of 2cm)=",sigma2,"N/mm^2"
from __future__ import division
import math
#Given
#Variable declaration
A=6.25*100 #Area in sq.mm
W=10*10**3 #Load in N
V=(40/60) #Velocity in m/s
L=10000 #Length of chain unwound in mm
E=2.1e5 #Young's modulus in N/sq.mm
g=9.81 #acceleration due to gravity
#Calculation
K_E=round(((W/g)*(V**2))/2,1)*1e3 #K.E of the crane in N mm
sigma=round(math.sqrt(K_E*E*2/(A*L)),2) #Stress induced in the chain in N/sq.mm
#Result
print "Stress induced in the chain due to sudden stoppage =",sigma,"N/mm^2"
import math
#Given
#Variable declaration
W=60*10**3 #Weight in N
V=1 #Velocity in m/s
L=15*10**3 #Free length in mm
A=25*100 #Area in sq.mm
E=2e5 #Young's modulus in N/sq.mm
g=9.81 #acceleration due to gravity
#Calculation
K_E=((W/g)*(V**2))/2*1e3 #Kinetic Energy of the cage in N mm
sigma=round(math.sqrt(K_E*E*2/(A*L)),2) #Maximum stress in N/sq.mm
#Result
print"Maximum stress produced in the rope =",sigma,"N/mm^2"
#Given
#Variable declaration
tau=50 #Shear stress in N/sq.mm
C=8e4 #Modulus of rigidity in N/sq.mm
#Calculation
ste=(tau**2)/(2*C) #Strain energy per unit volume in N/sq.mm
#Result
print"Strain energy per unit volume =",ste,"N/mm^2"