how to plot mohr circle in python?

from matplotlib.pyplot import *
from numpy import *
t =20 #eval(input('enter the value of shear strees in N/m^2'))
s1 = -30#eval(input('enter the value of minimum stress in N/m^2'))
s2= 50#eval(input('enter the value of minimum stress in N/m^2'))
s = linspace(0,360,360)
r = sqrt(((s2-s1)/2)**2+t**2)
x = (s2+s1)/2+r*cos(radians(s))
y = r*sin(radians(s))
a=([s1,s1,s2,s2])
b=([0,t,-t,0])
plot(a,b,x,y)
xlabel(r"$\sigma$", size=18)
ylabel(r"$\tau$", size=18)
axis('equal')
show()

Post a Comment

0 Comments