#Input data
L=5 #Length of steel bar in m
d=25*10**-3 #Diametr of steel bar in mm
deltaLt=25*10**-3 #Steel
pt=800
pi=3.142 #Power load of steel bar in N
#Calculation
A=(((pi/4)*((deltaLt)**2))) #Cross-section area
sigmat=(pt)/(A) #Stress in steel bar
et=(deltaLt)/L #Strain in steel bar
E=((sigmat)/(et)) #Young's modulus
#Output
print("value of Cross-section area=",round(A,8),"m**2")
print("value of tress in steel bar=",round(sigmat,),"MN/m**2")
print("value of strain in steel bar=",et)
print("value of Young's modulus=",round(E,),"N/m**2")
#Input data
L=300*10**-3 #Length of hexagonal prismatic steel bar in mm
A=500*10**-6 #Area of cross section of steel bar mm**2
Pt=500*10**3 #Load of steel bar in KN
E=210*10**9 #Modulus of elasticity GN/m**2
#Calculation
sigmat=((Pt)/(A)) #Stress in steel bar
et=((sigmat)/(E)) #Strain steel bar is
deltaLt=((et)*(L)) #Therefore,elongation of the steel bar is given by
#Output
print('stress in steel bar=',sigmat,"N/m**2")
print('therefore,strain steel bar is given by=',round(et,6),)
print('therefore,elongation of the steel bar is given by=',round(deltaLt,7),"m")
#Input Data
Pt=600 #Tensils force in N
d=2*10**-3 #Diameter of steel wire in mm
L=15 #Length of wire in m
E=210*10**9 #Modulus of elasticity of the material in GN/M**2
pi=3.1482
#Calculation
A=((pi/4)*((d)**2)) #(1)cross section area
sigmat=(Pt)/(A) #stress in the steel wire
et=((sigmat)/(E)) #(2)Therefore, strain in steel wire is given by
deltaLt=et*L #(3)Enlongation of the steel wire is given by
pe=((deltaLt/L)*100) #(4)Percentage elongation
#Output
print("cross section area= ",A,"m**2")
print("stress in the steel wire=",round(sigmat,),"GN/m**2")
print("modulus of elasticity=",round(et,5),)
print("strain in steel wire=",round(deltaLt,4),"mm")
print("percentage elongation= ",round(pe,3),"%")
#Input data
A=30*30*10**-6 #Area of square rod in mm**2
L=5 #Length of square rod in m
Pc=150*10**3 #Axial comperessive load of a rod in kN
E=215*10**9 #Modulus of elasticity in GN/m**2
#Calculation
sigmac=((Pc)/(A)) #Stress in square rod
ec=((sigmac)/(E)) #Modulusof elasticity is E=sigmac/ec ,therefore strain in square rod is
deltaLc=ec*5 #Therefore shortening of length of the rod
#Output
print ("stress in square rod",sigmac,"N/m**2")
print("strain in square rod ec=",round(ec,6),)
print("shortening of length of the rod=",round(deltaLc,6),"m")
#input data
d=50*10**-6 #Diameter of metalic rod in mm**2
L=220*10**-3 #Length of metalic rod in mm
Pt=40*10**3 #Load of metalic rod in KN
deltaLt=0.03*10**-3 #Elastic enlongation in mm
ypl=160*10**3 #Yield point load in KN
ml=250*10**3 #Maximum load in KN
lsf=270*10**-3 #Length of specimen at fracture in mm
pi=3.1482
#calculation
A=(((pi)/(4)*((d)**2))) #(1)Cross section area
sigmat=(Pt/A) #Stress in metallic rod
et=(deltaLt/L) #Strain n metallic rod
E=(sigmat/et) #Young's modulus
ys=(ypl/A) #(2)Yeild strength
uts=(ml/A) #(3)Ultimate tensile strength
Pebf=((lsf-L)/L)*100 #Percentage elongation before fracture
#output
print("cross section area",A,"m**2")
print("stress in metallic rod",round(sigmat,),"N/m**2")
print("strain n metallic rod",round(et,6),)
print("young's modulus",round(E,8),"GN/m**2")
print("yeild strength",ys,"MN/m**2")
print("ultimate tensile strength",uts,"MN/m**2")
print("percentage elongation before fracture",round(Pebf,3),"%")
#Input data
A=50*50*10**-6 #Area ofsquare metal bar in mm**2
Pc=600*10**3 #Axial compress laod in KN
L=200*10**-3 #Gauge length of metal bar in mm
deltaLc=0.4*10**-3 #Contraction length of metal bar in mm
deltaLlateral=0.05*10**-3 #Lateral length of metal bar in mm
#Calculation
sigmac=((Pc)/(A)) #Stress in square metal bar
ec=((deltaLc)/(L)) #Longitudinal or linear strain in square metal bar
E =((sigmac)/(ec)) #Smodule of elasticity
elateral=((deltaLlateral)/(L)) #Lateral strain in square metal bar
poissonsratio=(elateral)/(ec)
#Output
print("stress in bar=",sigmac,"n/m**2")
print("longitudinal or linear strain in square metal bar=",ec,)
print("module of elasticity=",E,"N/m**2")
print("lateral strain in square metal bar=",elateral,)
print("poissons ratio=",poissonsratio,)