import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
P=45*10**3 #N #Load
E=200*10**3 #N/mm**2 #Modulus of elasticity of rod
L=500 #mm #Length of rod
d=20 #mm #Diameter of rod
#Calculations
A=pi*d**2*4**-1 #mm**2 #Area of circular rod
p=P*A**-1 #N/mm**2 #stress
e=p*E**-1 #strain
dell_l=(P*L)*(A*E)**-1
#Result
print"The stress in bar due to Load is",round(p,5),"N/mm"
print"The strain in bar due to Load is",round(e,5),"N/mm"
print"The Elongation in bar due to Load is",round(dell_l,2),"mm"
import math
#Initilization of Variables
A=15*0.75 #mm**2 #area of steel tape
P=100 #N #Force apllied
L=30*10**3 #mm #Length of tape
E=200*10**3 #N/m**2 #Modulus of Elasticity of steel tape
AB=150 #m #Measurement of Line AB
#Calculations
dell_l=P*L*(A*E)**-1 #mm #Elongation
l=L+dell_l*10**-3 #mm #Actual Length
AB1=AB*l*L**-1 #m Actual Length of AB
#Result
print"The Actual Length of Line AB is",round(AB1,2),"m"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#Let y be the yield stress
y=250 #N/mm**2 #yield stress
FOS=1.75 #Factor of safety
P=140*10**3 #N #compressive Load
D=101.6 #mm #External diameter
#Calculations
p=y*(FOS)**-1 #N/mm**2 #Permissible stress
A=P*p**-1 #mm**2 #Area of hollow tube
#Let d be the internal diameter of tube
d=-((A*4*(pi)**-1)-D**2)
X=d**0.5
t=(D-X)*2**-1 #mm #Thickness of steel tube
#result
print"The thickness of steel tube is",round(t,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=25 #mm #diameter of steel
d2=18 #mm #Diameter at neck
L=200 #mm #length of stee
P=80*10**3 #KN #Load
P1=160*10**3 #N #Load at Elastic Limit
P2=180*10**3 #N #Max Load
L1=56 #mm #Total Extension
dell_l=0.16 #mm #Extension
#Calculations
A=pi*d**2*4**-1 #Area of steel #mm**2
p=P1*A**-1 #Stress at Elastic Limit #N/mm**2
Y=P*L*(A*dell_l)**-1 #Modulus of elasticity
#Let % elongation be x
x=L1*L**-1*100
#Percentage reduction in area
#Let % A be a
a=((pi*4**-1*d**2)-(pi*4**-1*d2**2))*(pi*4**-1*d**2)**-1*100
#Ultimate tensile stress
sigma=P2*A**-1 #N/mm**2
#result
print"Stress at Elastic limit is",round(p,2),"N/mm**2"
print"Young's Modulus is",round(Y,2),"N/mm**2"
print"Percentage Elongation is",round(a,2)
print"Percentage reduction in area is",round(P2,2)
print"Ultimate tensile stress",round(sigma,2),"N/mm**2"
import math
import matplotlib.pyplot as plt
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=20 #mm #Diameter of bar
d2=14.7 #mm #Diameter at neck
L=200 #mm #guage Length
#Calculations
print "The Shear Force and Bending Moment Diagrams are the results"
#Plotting the Shear Force Diagram
X1=[0,10,20,30,40,50,60]
Y1=[0,32,64,95,127,160,190]
Z1=[0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Extension in divisions")
plt.ylabel("Load in kN")
plt.show()
A=pi*4**-1*d**2 #mm**2 #Area of Bar
A2=pi*4**-1*d2**2
P=45 #KN #Load obtained from graph
dell=0.143 #mm #Divisions
#Modulus of Elasticity
E=P*L*(dell*A)**-1
BL=93*10**3 #N #Breaking Load
#Nominal stress at Breaking point
sigma=BL*A**-1 #KN/mm**2
#True stress at breaking Point
sigma1=BL*A2**-1
#Percentage Elongation
dell_l=(A-A2)*A**-1*100
#Result
print"The Value of ELongation is",round(E,2),"N/mm**2"
print"The Nominal stress at the Breaking Point",round(sigma,2),"KN/mm**2"
print"The True stress at the Breaking Point",round(sigma1,2),"KN/mm**2"
print"The Percentage Reduction in Area is",round(dell_l,2)
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
P=40*10**3 #N #Load
L1=160 #mm #Length of Bar1
L2=240 #mm #Length of bar2
L3=160 #mm #Length of bar3
d1=25 #mm #Diameter of Bar1
d2=20 #mm #diameter of bar2
d3=25 #mm #diameter of bar3
dell_l=0.285 #mm #Total Extension of bar
#Calculations
E=P*4*(dell_l*pi)**-1*(L1*(d1**2)**-1+L2*(d2**2)**-1+L3*(d3**2)**-1)
#Result
print"The Young's Modulus of the material",round(E,2),"N/mm**2"
import math
#Initilization of Variables
E1=2*10**5 #N/mm**2 #modulus of Elasticity of material1
E2=1*10**5 #N/mm**2 #modulus of Elasticity of material2
P=25*10**3 #N #Load
t=20 #mm #thickness of material
b1=40 #mm #width of material1
b2=30 #mm #width of material2
L1=500 #mm #Length of material1
L2=750 #mm #Length of material2
#Calculations
A1=b1*t #mm**2 #Area of materila1
A2=b2*t #mm**2 #Area of material2
dell_l1=P*L1*(A1*E1)**-1 #Extension of Portion1
dell_l2=P*L2*(A2*E2)**-1 #Extension of portion2
#Total Extension of Bar is
dell_l=dell_l1+dell_l2
#Result
print"The Total Extension of the Bar is",round(dell_l,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
L=1000 #mm #Length of Bar
l=400 #mm #Length upto which bire is drilled
D=30 #mm #diameter of bar
d1=10 #mm #diameter of bore
P=25*10**3 #N #Load
dell_l=0.185 #mm #Extension of bar
#Calculations
L1=L-l #Length of bar above the bore
L2=400 #mm #Length of bore
A1=pi*4**-1*D**2 #Area of bar
A2=pi*4**-1*(D**2-d1**2) #Area of bore
E=P*dell_l**-1*(L1*A1**-1+L2*A2**-1)
#Result
print"The Modulus of ELasticity is",round(E,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians, log
#Initilization of Variables
t=10 #mm #Thickness of steel
b1=60 #mm #width of plate1
b2=40 #mm #width of plate2
P=60*10**3 #Load
L=600 #mm #Length of plate
E=2*10**5 #N/mm**2
#Calculations
#Extension of taperong bar of rectangular section
dell_l=P*L*(t*E*(b1-b2))**-1*log(b1*b2**-1)
A_av=(b1*t+b2*t)*2**-1 #Average Area #mm**2
dell_l2=P*L*(A_av*E)**-1
#PErcentage Error
e=(dell_l-dell_l2)*(dell_l)**-1*100
#Result
print"The Percentage Error is",round(e,2)
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
L=1.5 #m #Length of steel bar
L1=1000 #m0 #Length of steel bar 1
L2=500 #m #Length of steel bar 2
d1=40 #Diameter of steel bar 1
d2=20 #diameter of steel bar 2
E=2*10**5 #N/mm**2 #Modulus of Elasticity
P=160*10**3 #N #Load
#Calculations
A1=pi*4**-1*d1**2 #Area of Portion 1
#Extension of uniform Portion 1
dell_l1=P*L1*(A1*E)**-1 #mm
#Extension of uniform Portion 2
dell_l2=4*P*L2*(pi*d1*d2*E)**-1 #mm
#Total Extension of Bar
dell_l=dell_l1+dell_l2
#Result
print"The Elongation of the Bar is",round(dell_l,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#Portion AB
L_AB=600 #mm #Length of AB
A_AB=40*40 #mm**2 #Cross-section Area of AB
#Portion BC
L_BC=800 #mm #Length of BC
A_BC=30*30 #mm #Length of BC
#Portion CD
L_CD=1000 #mm #Length of CD
A_CD=20*20 #mm #Area of CD
P1=80*10**3 #N #Load1
P2=60*10**3 #N #Load2
P3=40*10**3 #N #Load3
E=2*10**5 #Modulus of Elasticity
#Calculations
P4=P1-P2+P3 #Load4
#Now Force in AB
F_AB=P1
#Force in BC
F_BC=P1-P2
#Force in CD
F_CD=P4
#Extension of AB
dell_l_AB=F_AB*L_AB*(A_AB*E)**-1
#Extension of BC
dell_l_BC=F_BC*L_BC*(A_BC*E)**-1
#Extension of CD
dell_l_CD=F_CD*L_CD*(A_CD*E)**-1
#Total Extension
dell_l=dell_l_AB+dell_l_BC+dell_l_CD
#Result
print"The Total Extension in Bar is",round(dell_l,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
L=800 #mm #Length of bar
F1=30*10**3 #N #Force acting on the bar
F2=60*10**3 #N #force acting on the bar
L=800 #mm #Length of bar
d=25 #mm #diameter of bar
L_AC=275 #mm #Length of AC
L_CD=150 #mm #Length of CD
L_DB=375 #mm #Length of DB
E=2*10**5 #Pa #Modulus of elasticity
#Calculations
#Let P be the Reaction on tne Bar from support at A
#Shortening of Portion AC
#dell_l_AC1=P*L_AC*(A*E)**-1
#Shortening of Portion CD
#dell_l_CD1=(30+P)*L_CD*(A*E)**-1
#Extension of Portion DB
#dell_l_DB1=(30-P)*L_DB*(A*E)**-1
#Total Extensions=1*(A*E)**-1*(P*L_AC-(30+P)*L_CD+(30-P)*L_DB)
#As Supports are unyielding,Total Extensions=0
#After substituting values in above equation and Further simplifying we get
P=(30*375-150*30)*800**-1
#Reaction of support A
R_A=P
#Reaction of support B
R_B=30-P
#Cross-sectional Area
A=pi*4**-1*d**2
#Stress in Portion AC
sigma1=P*10**3*A**-1 #N/mm**2
#Stress in Portion CD
sigma2=(30+P)*10**3*A**-1 #N/mm**2
#Stress in Portion DB
sigma3=(30-P)*10**3*A**-1 #N/mm**2
#Shortening of Portion AC
dell_l_AC2=P*10**3*L_AC*(A*E)**-1 #mm
#Shortening of Portion CD
dell_l_CD2=(30+P)*10**3*L_CD*(A*E)**-1 #mm
#Extension of Portion DB
dell_l_DB2=(30-P)*10**3*L_DB*(A*E)**-1 #mm
#result
print"The Reactios at two Ends are:R_A",round(R_A,2),"KN"
print" :R_B",round(R_B,2),"KN"
print"Stress in Portion AC",round(sigma1,2),"N/mm**2"
print"Stress in Portion CD",round(sigma2,2),"N/mm**2"
print"Stress in Portion DB",round(sigma3,2),"N/mm**2"
print"Shortening of Portion AC",round(dell_l_AC2,3),"mm"
print"Shortening of Portion CD",round(dell_l_CD2,3),"mm"
print"Shortening of Portion DB",round(dell_l_DB2,3),"mm"
import math
#Initilization of Variables
h=4 #m #height of Pillars
P=20 #KN #Load at M
#Calculations
#Let P_A,P_B,P_C,P_D be the forces introduced in the Pillars
#Sun of All Vertical Forces
#P_A+P_B+P_C+P_D=20 ....................(1)
#Sum of moment about AB, we get
#P_D+P_C=12 ....................(2)
#Sum of Moment about AD
#P_C+P_B=8 ....................(3)
#Let dell_l_A,dell_l_B,dell_l-C,dell_l_D be the deformations of Pillars A,B,C,D respectively
#Diagonals AC and BD will remain straight Lines even after the Load is applied.
#Deflection of central Point is given by (dell_l_A+dell_l_C)*2**-1 & (dell_l_B+dell_l_D)*2**-1
#dell_l_A+dell_l_C=dell_l_B+ell_l_D
#P_A*L*(A*E)**-1+P_C*L*(A*E)**-1=P_B*L*(A*E)**-1+P_D*L*(A*E)**-1
#Since Pillars are identical in Length,cross-sectional area,material Property
#P_A+P_C=P_B+P_D ..............(4)
#From Equations 1 and 4 we get
#P_B+P_D=10 ....................(5)
#Substracting Equation 3 from Equation 2 we get
#P_D-P_B=4 ....................(6)
#Adding Equation 5 and 6 we get
P_D=14*2**-1
P_C=12-P_D
P_B=8-P_C
#Now substituting values of P_B,P_C,P_D in equation1 we get
P_A=20-(P_B+P_C+P_D)
#Result
print"The Forces Developed in the Pillars are:P_A",round(P_A,2),"KN"
print" :P_B",round(P_B,2),"KN"
print" :P_C",round(P_C,2),"KN"
print" :P_D",round(P_D,2),"KN"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
sigma=150 #N/mm**2 #Stress
P=40*10**3 #N #Load
#Calculations
#LEt P_A.P_B,P_C,P_D be the forces developed in wires A,B,C,D respectively
#Let sum of all Vertical Forces=0
#P_A+P_B+P_C+P_D=40 ..........................(1)
#Let x be the distance between each wires
#sum of all moments=0
#P_B*x+P_C*2*x+P_D*3*x=40*2*x
#After further simplifying we get
#P_B+2*P_C+3*P_D=80 ..........................(2)
#As the equations of statics ae not enough to find unknowns,Consider compatibilit Equations
#Let dell_l be the increse in elongation of wire
#dell_l_B=dell_l_A+dell_l
#dell_l_C=dell_l_A+2*dell_l
#dell_l_D=dell_l_A+3*dell_l
#Let P1 be the force required for the Elongation of wires,then
#P_B=P_A+P1 ]
#P_C=P_A+2*P1 ]
#P_D=P_A+3*P1 ] ................................(3)
#from Equation (3) and (1) we get
#2*P_A+3*P1=20 ................................(4)
#from Equation (3) and (2) we get
#6*P_A+14*P1=80
#subtracting 3 times equation (4) from (3) we get
P1=20*5**-1
#from Equation 4 we get
P_A=(80-14*P1)*6**-1
P_B=P_A+P1
P_C=P_A+2*P1
P_D=P_A+3*P1
#Let d be the diameter required,then
d=(P_D*10**3*4*(pi*150)**-1)**0.5
#result
print"The Required Diameter is",round(d,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
P=20*10**3 #N #Load
d=6 #mm #diameter of wire
E=2*10**5 #N/mm**2
L_BO=4000 #mm #Length of BO
#Calculations
#Let theta be the angle between OA and OB and also between OC and OB
theta=30
#Let P_OA,P_OB,P_OC be the Forces introduced in wires OA,OB,OC respectively
#Due to symmetry P_OA=P_OC (same angles)
#Sum of all Vertical Forces=0
#P_OA*cos(theta)+P_OB+P_OC*cos(theta)=P
#After further simplifyinf we get
#2*P_OA*cos(theta)+P_OB=20 ...............(1)
#Let oo1 be the extension of BO
#oo1=L_A1o1*(cos(theta))**-1
#From relation we get
#P_OB*L_BO=P_OA*L_AO*(cos(theta))**-1
#But L_AO=L_BO*(cos(theta))**-1
#After substituting value of L_AO in above equation we get
#P_OB=0.75*P_OA .......................(2)
#substituting in Equation 1 we get
#2*P_OA*cos(theta)+0.75*P_OA=20
P_OA=20*(2*cos(theta*pi*180**-1)+0.75)**-1
P_OB=0.75*P_OA
A=pi*4**-1*d**2
#Vertical displacement of Load
dell_l_BO=P_OB*10**3*L_BO*(A*E)**-1
#Result
print"Forces in each wire is:P_OA",round(P_OA,2),"KN"
print" :P_OB",round(P_OB,2),"KN"
print"Vertical displacement of Loadis",round(dell_l_BO,2),"mm"
import math
#Initilization of Variables
L_s=L_a=L=500 #mm #Length of bar
A_a=50*20 #mm #Area of aluminium strip
A_s=50*15 #mm #Area of steel strip
P=50*10**3 #N #Load
E_a=1*10**5 #N/mm**2 #Modulus of aluminium
E_s=2*10**5 #N/mm**2 #Modulus of steel
#Calculations
#Let P_a and P_s br the Load shared by aluminium and steel strip
#P_a+P_s=P ..................(1)
#For compatibility condition,dell_l_a=dell_l_s
#P_a*L_a*(A_a*E_a)**-1=P_s*L_s*(A_s*E_s)**-1 .....(2)
#As L_a=L_s we get
#P_s=1.5*P_a .................(3)
#From Equation 1 and 2 we get
P_a=P*2.5**-1
#Substituting in equation 1 we get
P_s=P-P_a
#stress in aluminium strip
sigma_a=P_a*A_a**-1
#stress in steel strip
sigma_s=P_s*A_s**-1
#Now from the relation we get
dell_l_a=dell_l_s=P_s*L_s*(A_s*E_s)**-1
#result
print"Stress in Aluminium strip is",round(sigma_a,2),"N/mm**2"
print"Stress in steel strip is",round(sigma_s,2),"N/mm**2"
print"The Extension of the bar is",round(dell_l_s,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
D_s=20 #mm #Diameter of steel
D_Ci=20 #mm #Internal Diameter of Copper
t=5 #mm #THickness of copper bar
P=100*10**3 #N #Load
E_s=2*10**5 #N/mm**2 #modulus of elasticity of steel
E_c=1.2*10**5 #N/mm**2 #Modulus of Elasticity of Copper
#Calculations
A_s=pi*4**-1*D_s**2 #mm**2 #Area of steel
D_Ce=D_s+2*t #mm #External Diameterof Copper Tube
A_c=pi*4**-1*(D_Ce**2-D_Ci**2) #mm**2 #Area of Copper
#From static Equilibrium condition
#Let P_s and P_c be the Load shared by steel and copper in KN
#P_s+P_c=100 ....................................(1)
#From compatibility Equation,dell_l_s=dell_l_c
#P_s*L*(A_s*E_s)**-1=P_c*L*(A_c*E_c)**-1
#Substituting values in above Equation we get
#P_s=1.3333*P_C
#Now Substituting value of P_s in Equation (1),we get
P_c=100*2.3333**-1 #KN
P_s=100-P_c #KN
#Stress in steel
sigma_s=P_s*10**3*A_s**-1 #N/mm**2
#Stress in copper
sigma_c=P_c*10**3*A_c**-1 #N/mm**2
#Result
print"Stresses Developed in Two material are:sigma_s",round(sigma_s,2),"N/mm**2"
print" :sigma_c",round(sigma_c,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
A_C=230*400 #mm #Area of column
D_s=12 #mm #Diameter of steel Bar
P=600*10**3 #N #Axial compression
#E_s*E_c=18.67
n=8 #number of steel Bars
#Calculations
A_s=pi*4**-1*D_s**2*n #Area of steel #mm**2
A_c=A_C-A_s #mm**2 #Area of concrete
#From static Equilibrium condition
#P_s+P_c=600 .........(1)
#Now from compatibility Equation dell_l_s=dell_l_c we get,
#P_s*L*(A_s*E_s)**-1=P_c*L*(A_c*E_c)**-1
#Substituting values in above Equation we get
#P_s=0.1854*P_c
#Now Substituting value of P_s in Equation (1),we get
P_c=600*1.1854**-1
P_s=600-P_c
#Stress in steel
sigma_s=P_s*10**3*A_s**-1 #N/mm**2
#Stress in copper
sigma_c=P_c*10**3*A_c**-1 #N/mm**2
#Result
print"Stresses Developed in Two material are:sigma_s",round(sigma_s,2),"N/mm**2"
print" :sigma_c",round(sigma_c,2),"N/mm**2"
import math
#Initilization of Variables
P=200*10**3 #N #Load
A_a=1000 #mm**2 #Area of Aluminium
A_s=800 #mm**2 #Area of steel
E_a=1*10**5 #N/mm**2 #Modulus of Elasticity of Aluminium
E_s=2*10**5 #N/mm**2 #Modulus of ELasticity of steel
sigma_a1=65 #N/mm**2 #stress in aluminium
sigma_s1=150 #N/mm**2 #Stress in steel
#Calculations
#Let P_a and P_s be the force in aluminium and steel pillar respectively
#Now,sum of forces in Vertical direction we get
#2*P_a+P_s=200 .........................................(1)
#By compatibility Equation dell_l_s=dell_l_a we get
#P_s=1.28*P_a ..........................................(2)
#Now substituting value of P_s in Equation 1 we get
P_a=200*3.28**-1 #KN
P_s=200-2*P_a #KN
#Stress developed in aluminium
sigma_a=P_a*10**3*A_a**-1 #N/mm**2
#Stress developed in steel
sigma_s=P_s*10**3*A_s**-1 #N/mm**2
#Part-2
#Let sigma_a1 and sigma_s1 be the stresses in Aluminium and steel due to Additional LOad
P_a1=sigma_a1*A_a #Load carrying capacity of aluminium
P_s1=1.28*P_a1
#Total Load carrying capacity
P1=2*P_a1+P_s1 #N
P_s2=sigma_s1*A_s #Load carrying capacity of steel
P_a2=P_s2*1.28**-1
#Total Load carrying capacity
P2=2*P_a2+P_s2
#Additional Load
P3=P1-P
#Result
print"Stresses Developed in Each Pillar is:sigma_a",round(sigma_a,2),"N/mm**2"
print" :sigma_s",round(sigma_s,2),"N/mm**2"
print"Additional Load taken by pillars is",round(P3,2),"N"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
L=500 #mm #Length of assembly
D=16 #mm #Diameter of steel bolt
Di=20 #mm #internal Diameter of copper tube
Do=30 #mm #External Diameter of copper tube
E_s=2*10**5 #N/mm**2 #Modulus of Elasticity of steel
E_c=1.2*10**5 #N/mm**2 #Modulus of Elasticity of copper
p=2 #mm #Pitch of nut
#Calculations
#Let P_s be the Force in bolt and P_c be the FOrce in copper tube
#P_s=-P_s
dell=1*4**-1*2 #Quarter turn of nut total movement
#dell=dell_s+dell_c
#Area of steel
A_s=pi*4**-1*D**2
#Area of copper
A_c=pi*4**-1*(Do**2-Di**2)
#dell=P*L*(A_s*E_s)**-1+P*L*(A_c*E_c)**-1
P=dell*(1*(A_s*E_s)**-1+1*(A_c*E_c)**-1)**-1*L**-1 #LOad
P_s=P*A_s**-1
P_c=P*A_c**-1
#result
print"stress introduced in bolt is",round(P_s,2),"N/mm**2"
print"stress introduced in tube is",round(P_c,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
D=20 #mm #Diameter of Bolts
Di=25 #m #internal Diameter
t=10 #mm #Thickness of bolt
E_s=2*10**5 #N/mm**2 #Modulus of Elasticity
E_c=1.2*10**5 #N/mm**2 #Modulus of copper
p=3 #mm #Pitch
theta=30 #degree
L_c=500 #Lengh of copper
L_s=600 #Length of steel
#Calculations
#Let P_s be the Force in each bolt and P_c be the FOrce in copper tube
#From Static Equilibrium condition
#P_c=2*P_s
#As nut moves by 60 degree.If nut moves by 360 degree its Longitudinal movement is by 3 mm
dell=theta*360**-1*p
#From Compatibility Equaton we get
#dell=dell_c+dell_s
A_s=pi*4**-1*Di**2 #mm**2 #Area of steel
A_c=pi*4**-1*(45**2-Di**2) #mm**2 #Area of copper
#Force introduced in steel
P_s=0.5*(2*L_c*(A_c*E_c)**-1+L_s*(A_s*E_s)**-1)**-1 #N
P_s2=P_s*A_s**-1
#Force introduced in copper
P_c=2*P_s*A_c**-1 #N
#Result
print"Stress introduced in bolt is",round(P_s2,2),"N/mm**2"
print"stress introduced in tube is",round(P_c,2),"N/mm**2"
import math
#Initilization of Variables
L=9 #m #Length of rigid bar
L_b=3000 #Length of bar
A_b=1000 #mm**2 #Area of bar
E_b=1*10**5 #N/mm**2 #Modulus of Elasticity of brasss bar
L_s=5000 #mm #Length of steel bar
A_s=445 #mm**2 #Area of steel bar
E_s=2*10**5 #N/mm**2 #Modulus of elasticity of steel bar
P=3000 #N #Load
#Calculations
#From static equilibrium Equation of the rod after appliying Load is
#P_b+P_s=P ......................(1)
#P_b=1.8727*P_s ..................(2)
#NOw substituting equation 2 in equation 1 we get
P_s=P*2.8727**-1
P_b=P-P_s
d=P_s*L*P**-1
#Result
print"Distance at which Load applied even after which bar remains horizontal is",round(d,2),"m"
import math
#Initilization of Variables
A_b=1000 #MM**2 #Area of brass bar
E_b=1*10**5 #N/mm**2 #Modulus of Elasticity of brass
A_s=600 #N/mm**2 #Area of steel rod
E_s=2*10**5 #N/mm**2 #Modulus of eLasticity of steel bar
P=10*10**2 #N #Load
#Calculations
#Let P_b be the tensile force in brass bar and P_s be the compressive force in steel bar
#Now taking moment about A we get static Equilibrium condition as
#P_b+2*P_s=27500 ......................................(1)
#Now from deformed shape we get
#dell_s=2*dell_b
#P_s*L_s*(A_s*E_s)**-1=P_b*L_b*(A_b*E_b)**-1
#Further simplifying we get
#P_s=1.2*P_b .........................................(2)
#Now substituting equation 1 in equation 2 we get
P_b=27500*3.4**-1
P_s=1.2*P_b
#Tensile stress in brass bar
sigma_b=P_b*A_b**-1
#compressive stress in steel bar
sigma_s=P_s*A_s**-1
#Result
print"Compressive Stress in Bar is",round(sigma_s,2),"N/mm**2"
print"tensile Stress in Bar is",round(sigma_b,2),"N/mm**2"
import math
#Initilization of Variables
L=12.6 #m #Length of rail
t1=24 #Degree celsius
t2=44 #degree celsius
alpha=12*10**-6 #Per degree celsius
E=2*10**5 #N/mm**2 #Modulus of ELasticity
gamma=2 #mm #Gap provided for Expansion
sigma=20 #N/mm**2 #Stress
#Calculations
t=t2-t1 #Temperature Difference
#Free Expansion of the rails
dell=alpha*t*L*1000 #mm
#When no expansion joint is provided then
p=dell*E*(L*10**3)**-1
#When a gap of 2 mm is provided,then free expansion prevented is
dell_1=dell-gamma
p2=dell_1*E*(L*10**3)**-1
#When stress is developed,then gap left is
gamma2=-(sigma*L*10**3*E**-1-dell)
#Result
print"The minimum gap between the two rails is",round(dell,2),"mm"
print"Thermal Developed in the rials if:No expansionn joint is provided:p",round(p,2),"N/mm**2"
print" :If a gap of is provided then :p2",round(p2,2),"N/mm**2"
print"When stress is developed gap left between the rails is",round(gamma2,2),"mm"
import math
#Initilization of Variables
t=20 #degree celsius
E_a=70*10**9 #N/mm**2 #Modulus of Elasticicty of aluminium
alpha_a=11*10**-6 #per degree celsius #Temperature coeff of aluminium
alpha_s=12*10**-6 #Per degree celsius #Temperature coeff of steel
L_a=1000 #mm #Length of aluminium
L_s=3000 #mm #Length of steel
E_a=7*10**4 #N/mm**2 #Modulus of Elasticity of aluminium
E_s=2*10**5 #N/mm*2 #Modulus of Elasticity of steel
A_a=600 #mm**2 #Area of aluminium
A_s=300 #mm**2 #Area of steel
#Calculations
#Free Expansion
dell=alpha_a*t*L_a+alpha_s*t*L_s
#support Reaction
P=dell*(L_a*(A_a*E_a)**-1+L_s*(A_s*E_s)**-1)**-1
#Result
print"Reaction at support is",round(P,2),"N"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
D=25 #mm #Diameter of Brass
De=50 #mm #External Diameter of steel tube
Di=25 #mm #Internal Diameter of steel tube
L=1.5 #m #Length of both bars
t1=30 #degree celsius #Initial Temperature
t2=100 #degree celsius #final Temperature
E_s=2*10**5 #N/mm**2 #Modulus of ELasticity of steel bar
E_b=1*10**5 #N/mm**2 #Modulus of Elasticity of brass bar
alpha_s=11.6*10**-6 #Temperature Coeff of steel
alpha_b=18.7*10**-6 #Temperature coeff of brass bar
d=20 #mm #diameter of pins
#Calculations
t=t2-t1 #Temperature Difference
A_s=pi*4**-1*(De**2-Di**2) #mm**2 #Area of steel
A_b=pi*4**-1*D**2 #mm**2 #Area of brass
#Let P_b be the tensile force in brass bar and P_s be the compressive force in steel bar
#But from Equilibrium of Forces
#P_b=P_s=P
#Let dell=dell_s+dell_b
dell=(alpha_b-alpha_s)*t*L*1000
P=dell*(1*(A_s*E_s)**-1+1*(A_b*E_b)**-1)**-1*(L*1000)**-1
P_b=P_s=P
#Stress in steel
sigma_s=P_s*A_s**-1
#Stress in Brass
sigma_b=P_b*A_b**-1
#Area of Pins
A_p=pi*4**-1*d**2
#Since,the force is resisted by two cross section of pins
tou=P*(2*A_p)**-1
#Result
print"Stress in steel bar is",round(sigma_s,2),"N/mm**2"
print"Stress in Brass bar is",round(sigma_b,2),"N/mm**2"
print"Shear Stresss induced in pins is",round(tou,2),"N/mm**2"
import math
#Initilization of Variables
b_s=60 #mm #width of steel Bar
t_s=10 #mm #thickness of steel Bar
b_c=40 #mm #width of copper bar
t_c=5 #mm #thickness of copper bar
E_s=2*10**5 #N/mm**2 #Modulus of Elasticity of steel bar
E_c=1*10**5 #N/mm**2 #Modulus of Elasticity of copper bar
alpha_s=12*10**-6 #Per degree celsius #Temperature coeff of steel bar
alpha_c=17*10**-6 #Per degree celsius #Temperature coeff of copper bar
L_s=L_c=L=1000 #mm #Length of bar
t=80 #degree celsius
#Calculations
A_s=b_s*t_s #Area of steel bar
A_c=b_c*t_c #Area of copper bar
#Let P_s be the tensile force in steel bar and P_c be the compressive force in copper bar
#The equilibrium of forces gives
#P_s=2*P_c
#Let dell=dell_s+dell_b
dell=(alpha_c-alpha_s)*t
P_c=dell*(2*(A_s*E_s)**-1+1*(A_c*E_c)**-1)**-1
P_s=2*P_c
#Stress in copper
sigma_c=P_c*A_c**-1
#Stress in steel
sigma_s=P_s*A_s**-1
#Change in Length of bar
dell_2=alpha_s*t*L+P_s*L_s*(A_s*E_s)**-1
#result
print"Stress in copper is",round(sigma_c,2),"N/mm**2"
print"Stress in steel is",round(sigma_s,2),"N/mm**2"
print"the change in Length is",round(dell_2,2),"mm"
import math
#Initilization of Variables
P=2*10**5 #N #Weight
L=1 #m #Length of each rod
A_c=A_s=A=500 #mm**2 #Area of each rod
t=40 #degree celsius #temperature
E_s=2*10**5 #N/mm**2 #Modulus of Elasticity of steel rod
E_c=1*10**5 #N/mm**2 #modulus of Elastictiy of copper rod
alpha_s=1.2*10**-5 #Per degree Celsius #temp coeff of steel rod
alpha_c=1.8*10**-5 #Per degree Celsius #Temp coeff of copper rod
#Calculations
#Let P_s be the force in each one of the copper rods and P_s be the force in steel rod
#2*P_c+P_s=P .....................(1)
#Extension of copper bar=Extension of steel bar
#P_s*L*(A_s*E_s)**-1=P_c*L*(A_c*E_c)**-1
#after simplifying above equation we get
#P_s=2*P_c ........................(2)
#Now substituting value of P_s in Equation 1 we get
P_c=P*4**-1
P_s=2*P_c
#Now EXtension due to copper Load
dell_1=P_c*L*1000*(A_c*E_c)**-1
#Part-2
#Due to rise of temperature of40 degree celsius
#As bars are rigidly joined,let P_c1 be the compressive forccesdeveloped in copper bar and P_s1 be the tensile force in steel causing changes
#P_s1=2*P_c1
#dell_s+dell_c=(alpha_c-alpha_s)*t*L .......................................(3)
#P_s1*L*(A_s*E_s)**-1+P_c1*L*(A_c*E_c)**-1=(alpha_c-alpha_s)*t*L ................(4)
#After substituting values in above equation and further simplifying we get,
P_c1=(alpha_c-alpha_s)*t*L*(2*(A_s*E_s)**-1+1*(A_c*E_c)**-1)**-1 #.................(5)
P_s1=2*P_c1
#Extension of bar due to temperature rise
dell_2=alpha_s*t*L+P_s1*L*(A_s*E_s)**-1
#Amount by which bar will descend
dell_3=dell_1+dell_2
#Load carried by steel bar
P_S=P_s+P_s1
#Load carried by copper bar
P_C=P_c-P_c1
#Part-3
#Let P_c1_1=P_c #For convenience
#Rise in temperature if Load is to be carried out by steel rod alone
P_c1_1=P_c
#From equation 5
t=P_c1_1*(2*(A_s*E_s)**-1+1*(A_c*E_c)**-1)*(alpha_c-alpha_s)**-1
#result
print"Extension Due top copper Load",round(dell_1,2),"mm"
print"Load carried by each rod:P_s",round(P_s,2),"N"
print" :P_c",round(P_c,2),"N"
print"Rise in Temperature of steel rod should be",round(t,2),"degree Celsius"
import math
#Initilization of Variables
t=40 #degree celsius #temperature
A_s=400 #mm**2 #Area of steel bar
A_c=600 #mm**2 #Area of copper bar
E_s=2*10**5 #N/mm**2 #Modulus of Elasticity of steel bar
E_c=1*10**5 #N/mm**2 #Modulus of Elasticity of copper bar
alpha_s=12*10**-6 #degree celsius #Temperature coeff of steel bar
alpha_c=18*10**-6 #degree celsius #Temperature coeff of copper bar
L_c=800 #mm #Length of copper bar
L_s=600 #mm #Length of steel bar
#Calculations
#Let P_s be the tensile force in steel bar and P_c be the compressive force in copper bar
#Static Equilibrium obtained by taking moment about A
#P_c=2*P_s
#From property of similar triangles we get
#(alpha_c*Lc-dell_c)*1**-1=(alpha_s*L_s-dell_s)*2**-1
#After substituting values in above equations and further simplifying we get
P_s=(2*alpha_c*L_c-alpha_s*L_s)*t*(L_s*(A_s*E_s)**-1+4*L_c*(A_c*E_c)**-1)**-1
P_c=2*P_s
#Stress in steel rod
sigma_s=P_s*A_s**-1 #N/mm**2
#Stress in copper rod
sigma_c=P_c*A_c**-1 #N/mm**2
#Result
print"Stress in steel rod is",round(sigma_s,2),"N/mm**2"
print"STress in copper rod is",round(sigma_c,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=20 #mm #Diameter of bar
P=37.7*10**3 #N #Load
L=200 #mm #Guage Length
dell=0.12 #mm #Extension
dell_d=0.0036 #mm #contraction in diameter
#Calculations
#Area of bar
A=pi*4**-1*d**2
#Let s and dell_s be the Linear strain and Lateral strain
s=dell*L**-1
dell_s=dell_d*d**-1
mu=dell_s*s**-1 #Poissoin's ratio
#dell=P*L*(A*E)**-1
E=P*L*(dell*A)**-1 #N/mm**2 #Modulus of Elasticity of bar
#Modulus of Rigidity
G=E*(2*(1+mu))**-1 #N/mm**2
#Bulk Modulus
K=E*(3*(1-2*mu))**-1 #N/mm**2
#result
print"Poisson's ratio is",round(mu,2)
print"The Elastic constant are:E",round(E,2)
print" :G",round(G,2)
print" :K",round(K,2)
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=100 #mm #Diameter of circular rod
P=1*10**6 #N #Tensile Force
mu=0.3 #Poisson's ratio
E=2*10**5 #N/mm**2 #Young's Modulus
L=500 #mm #Length of rod
#Calculations
#Modulus of Rigidity
G=E*(2*(1+mu))**-1 #N/mm**2
#Bulk Modulus
K=E*(3*(1-2*mu))**-1 #N/mm**2
A=pi*4**-1*d**2 #mm**2 #Area of Circular rod
#Let sigma be the Longitudinal stress
sigma=P*A**-1 #N/mm**2
s=sigma*E**-1 #Linear strain
e_x=s
#Volumetric strain
e_v=e_x*(1-2*mu)
v=pi*4**-1*d**2*L
#Change in VOlume
dell_v=e_v*v
#Result
print"Bulk Modulus is",round(E,2),"N/mm**2"
print"Modulus of Rigidity is",round(G,2),"N/mm**2"
print"The change in Volume is",round(dell_v,2),"mm**3"
import math
#Initilization of Variables
L=500 #mm #Length of rectangular cross section bar
A=20*40 #mm**2 #Area of rectangular cross section bar
P1=4*10**4 #N #Tensile Force on 20mm*40mm Faces
P2=2*10**5 #N #compressive force on 20mm*500mm Faces
P3=3*10**5 #N #Tensile Force on 40mm*500mm Faces
E=2*10**5 #N/mm**2 #young's Modulus
mu=0.3 #Poisson's Ratio
#Calculations
#Let P_x,P_y,P_z be the forces n x,y,z directions
P_x=P1*A**-1
P_y=P2*A**-1
P_z=P3*A**-1
#Let e_x,e_y,e_z be the strains in x,y,z directions
e_x=1*E**-1*(50+mu*20-15*mu)
e_y=1*E**-1*(-mu*50-20-mu*15)
e_z=1*E**-1*(-mu*50+mu*20+15)
#Volumetric strain
e_v=e_x+e_y+e_z
#Volume
V=20*40*500 #mm**3
#Change in Volume
dell_v=e_v*V #mm**3
#Result
print"The change in Volume is",round(dell_v,2),"mm**3"
import math
#Initilization of Variables
E=2.1*10**5 #N/mm**2 #Young's Modulus
G=0.78*10**5 #N/mm**2 #Modulus of Rigidity
#Calculations
#Now using the relation
#E=2*G*(1+mu)
mu=E*(2*G)**-1-1 #Poisson's ratio
#Bulk Modulus
K=E*(3*(1-2*mu))**-1 #N/mm**2
#Result
print"The Poisson's Ratio is",round(mu,2)
print"The modulus of Rigidity",round(K,2),"N/mm**2"
import math
#Initilization of Variables
G=0.4*10**5 #N/mm**2 #Modulus of rigidity
K=0.75*10**5 #N/mm**2 #Bulk Modulus
#Calculations
#Young's Modulus
E=9*G*K*(3*K+G)**-1
#Now from the relation
#E=2*G(1+2*mu)
mu=E*(2*G)**-1-1 #POissoin's ratio
#result
print"Young's modulus is",round(E,2),"N/mm**2"
print"Poissoin's ratio is",round(mu,2)
import math
#Initilization of Variables
b=60 #mm #width of bar
d=30 #mm #depth of bar
L=200 #mm #Length of bar
A=30*60 #mm**2 #Area of bar
A2=30*200 #mm**2 #Area of bar along which expansion is restrained
P=180*10**3 #N #Compressive force
E=2*10**5 #N/mm**2 #Young's Modulus
mu=0.3 #Poissoin's ratio
#Calculations
#The bar is restrained from expanding in Y direction
P_z=0
P_x=P*A**-1 #stress developed in x direction
#Now taking compressive strain as positive
#e_x=P_x*E**-1-mu*P_y*E**-1 .......................(1)
#e_y=-mu*P_x*E**-1+P_y*E**-1 ....................(2)
#e_z=-mu*P_x*E**-1-mu*P_y*E**-1 ......................(3)
#Part-1
#When it is fully restrained
e_y=0
P_y=30 #N/mm**2
e_x=P_x*E**-1-mu*P_y*E**-1
e_z=-mu*P_x*E**-1-mu*P_y*E**-1
#Change in Length
dell_l=e_x*L #mm
#Change in width
dell_b=b*e_y
#change in Depth
dell_d=d*e_z
#Volume of bar
V=b*d*L #mm**3
#Change in Volume
e_v=(e_x+e_y+e_z)*V #mm**3
#Part-2
#When 50% is restrained
#Free strain in Y direction
e_y1=mu*P_x*E**-1
#As 50% is restrained,so
e_y2=-50*100**-1*e_y1
#But form Equation 2 we have e_y=-mu*P_x*E**-1+P_y*E**-1
#After substituting values in above equation and furthe simplifying we get
P_y=e_y2*E+d
e_x2=P_x*E**-1-mu*P_y*E**-1
e_z2=-mu*P_x*E**-1-mu*P_y*E**-1
#Change in Length
dell_l2=e_x2*L #mm
#Change in width
dell_b2=b*e_y2
#change in Depth
dell_d2=d*e_z2
#Change in Volume
e_v2=(e_x2+e_y2+e_z2)*V #mm**3
#REsult
print"Change in Dimension of bar is:dell_l",round(dell_l,2),"mm"
print" :dell_b",round(dell_b,4),"mm"
print" :dell_d",round(dell_d,2),"mm"
print"Change in Volume is",round(e_v,2),"mm**3"
print"Changes in material when only 50% of expansion can be reatrained:dell_l2",round(dell_l2,2),"mm"
print" :dell_b2",round(dell_b2,4),"mm"
print" :dell_d2",round(dell_d2,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
P=10*10**3 #N #Load
E=2*10**5 #N/mm**2 #Young's Modulus
d2=12 #mm #Diameter of bar1
d1=16 #mm #diameter of bar2
L1=200 #mm #Length of bar1
L2=500 #mm #Length of bar2
#Calculations
#Let A1 and A2 be the cross Area of Bar1 & bar2 respectively
A1=pi*4**-1*d1**2 #mm**2
A2=pi*4**-1*d2**2 #mm**2
#Let p1 and p2 be the stress in Bar1 nad bar2 respectively
p1=P*A1**-1 #N/mm**2
p2=P*A2**-1 #N/mm**2
#Let V1 nad V2 be the Volume of of Bar1 and Bar2
V1=A1*(L1+L1)
V2=A2*L2
#Let E be the strain Energy stored in the bar
E=p1**2*(2*E)**-1*V1+p2**2*V2*(2*E)**-1
#result
print"The Strain Energy stored in Bar is",round(E,2),"N-mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#Bar-A
d1=30 #mm #Diameter of bar1
L=600 #mm #length of bar1
#Bar-B
d2=30 #mm #Diameter of bar2
d3=20 #mm #Diameter of bar2
L2=600 #mm #length of bar2
#Calculations
#Area of bar-A
A1=pi*4**-1*d1**2
#Area of bar-B
A2=pi*4**-1*d2**2
A3=pi*4**-1*d3**2
#let SE be the Strain Energy
#Strain Energy stored in Bar-A
#SE=p**2*(2*E)**-1*V
#After substituting values and simolifying further we get
#SE=P**2*E**-1*0.4244
#Strain Energy stored in Bar-B
#SE2=p1**2*V1*(2*E)**-1+p2**2*V2*(2*E)**-1
#After substituting values and simolifying further we get
#SE2=0.6897*P**2*E**-1
#Let X be the ratio of SE in Bar-B and SE in Bar-A
X=0.6897*0.4244**-1
#Part-2
#When Max stress is produced is same:Let p be the max stress produced
#Stress in bar A is p throughout
#In bar B:stress in 20mm dia.portion=p2=p
#Stress in 30 mm dia.portion
#p1=P*A2*A3**-1
#After substituting values and simolifying further we get
#p1=4*9**-1*p
#Strain Energy in bar A
#SE_1=p**2*(2*E)**-1*A1*L1
#After substituting values and simolifying further we get
#SE_1=67500*p**2*pi*E**-1
#Strain Energy in bar B
#SE_2=p1**2*V1*(2*E)**-1+p2**2*V2*(2*E)**-1
#After substituting values and simolifying further we get
#SE_2=21666.67*pi*p**2*E**-1
#Let Y be the Ratio of SE in bar B and SE in bar A
Y=21666.67*67500**-1
#result
print"Gradually applied Load is",round(X,2)
print"Gradually applied Load is",round(Y,2)
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
W=100 #N #Load
E=2*10**5 #N/mm**2 #Young's Modulus
h=60 #mm #Height through Load falls down
L=400 #mm #Length of collar
d=30 #mm #diameter of bar
#Calculations
A=pi*4**-1*d**2 #mm**2 #Area of bar
#Instantaneous stress produced is
p=W*A**-1*(1+(1+(2*A*E*h*(W*L)**-1))**0.5)
#Now the EXtension of the bar is neglected in calculating work doneby the Load,then
P=(2*E*h*W*(A*L)**-1)**0.5
#Let percentage error be denoted by E1
#Percentage error in approximating is
E1=(p-P)*p**-1*100
#Instantaneous Extension produced is
dell_l=round(P,3)*E**-1*L
#Result
print"The Instantaneous stress is",round(p,2),"N/mm"
print"Percentage Error is",round(E1,2)
print"The Instantaneous extension is",round(dell_l,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=20 #mm #Diameter of steel bar
L=1000 #mm #Length of bar
E=2*10**5 #N/mm**2 #Young's Modulus
p=300 #N/mm**2 #max Permissible stress
h=50 #mm #Height through which weight will fall
w=600 #N #Load
#Calculations
#ARea of steel bar
A=pi*4**-1*d**2
#Instantaneous extension is
dell_l=p*L*E**-1 #mm
#Work done by Load
#W=W1*(h+dell_l)
#Volume of bar
V=round(A,2)*L
#Let E1 be the strain Energy
E1=p**2*(2*E)**-1*V
#Answer in Book for Strain Energy is Incorrect
#Now Equating Workdone by Load to strain Energy
W1=E1*51.5**-1
#Now when w=600 N
#Let W2 be the Work done by the Load
#W2=w(h2*dell_l)
h=E1*w**-1-dell_l
#Result
print"The Max Lodad which can Fall from a height of 50 mm on the collar is",round(W1,2),"N"
print"the Max Height from which a 600 N Load can fall on the collar is",round(h,2),"mm"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
D_s=30 #mm #Diameter of steel rod
d=30 #mm #Internal Diameter of copper tube
D=40#mm #External Diameter of copper tube
E_s=2*10**5 #N/mm**2 #Young's Modulus of Steel rod
E_c=1*10**5#N/mm**2 #Young's Modulus of copper tube
P=100 #N #Load
h=40 #mm #height from which Load falls
L=800 #mm #Length
#Calculations
#Area of steel rod
A_s=pi*4**-1*D_s**2
#Area of copper tube
A_c=pi*4**-1*(D**2-d**2)
#But Dell_s=dell_c=dell
#p_s*E_s**-1*L=p_c*L*E_c
#After simplifying furthe we get
#p_s=2*p_c
#Now Equating internal Energy to Workdone we get
p_c=(2*P*h*L**-1*(4*A_s*E_s**-1+A_c*E_c**-1))**0.5
p_s=2*p_c
#Result
print"STress produced in steel is",round(p_s,2),"N/mm**2"
print"STress produced in copper is",round(p_c,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
dell=0.25 #mm #Instantaneous Extension
#Bar-A
b1=25 #mm #width of bar
D1=500 #mm #Depth of bar
#Bar-B
b2_1=25 #mm #width of upper bar
b2_2=15 #mm #Width of Lower Bar
L2=200 #mm #Length of upper bar
L1=300 #mm #Length of Lower bar
E=2*10**5 #N/mm**2 #Young's Modulus of bar
#Calculations
#Strain
e=dell*D1**-1
#Load
p=e*E
#Area of bar-A
A=pi*4**-1*25**2
#Volume of bar-A
V=A*D1
#Let E1 be the Energy of Blow
#Energy of Blow
E1=p**2*(E)**-1*V
#Let p2 be the Max stress in bar B When this blow is applied.
#the max stress occurs in the 15mm dia. portion,Hence, the stress in 25 mm dia.portion is
#p2*pi*4**-1*b2_2**2*(pi*4**-1*b2_2**2=0.36*p
#Strain Energy of bar B
#E2=p**2*(2*E)**-1*v1+1*(2*E)**-1*(0.36*p2)**2*v2
#After substituting values and Further substituting values we get
#E2=0.1643445*p2**2
#Equating it to Energy of applied blow,we get
p2=(12271.846*0.1643445**-1)**0.5
#Stress in top portion
sigma=0.36*p2
#Extension in Bar-1
dell_1=p2*E**-1*L1
#Extension in Bar-2
dell_2=0.36*p2*E**-1*L2
#Extension of bar
dell_3=dell_1+dell_2
#Result
print"Instantaneous Max stress is",round(sigma,2),"N/mm**2"
print"extension in Bar is",round(dell_3,2),"mm"