Project

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:

  1. This program is compiled in Pycharm software.
  2. Strain values are assumed.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.