Residual stress
Program to plot the graph of Hole depth v/s strain
from math import*
import matplotlib.pyplot as plt
#program to plot hole depth vs residual stress
#inputs
# assuming strain values (s)
s1=[5,10,15,20,25,30]
s2=[5,15,25,35,45,55]
s3=[5,20,35,50,65,80]
#holedepth
x_start=0
#number of hole depths (n)
n=6
holedepth=[]
for i in range(0,n):
tmp_x=x_start+i
holedepth.append(tmp_x)
#printing the results
print(holedepth)
print(s1)
print(s2)
print(s3)
#To show the graph results
plt.plot(holedepth,s1)
plt.plot(holedepth,s2)
plt.plot(holedepth,s3)
plt.xlabel('Hole depth')
plt.ylabel('Strain')
plt.show()
Note:
- This program is compiled in Pycharm software.
- Strain values are assumed.