import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
sigma1=30 #N/mm**2 #Stress in tension
d=20 #mm #Diameter
sigma2=90 #N/mm**2 #Max compressive stress
sigma3=25 #N/mm**2
#Calculations
#In TEnsion
#Corresponding stress in shear
P=sigma1*2**-1 #N/mm**2
#Tensile force
F=pi*4**-1*d**2*sigma1
#In Compression
#Correspong shear stress
P2=sigma2*2**-1 #N/mm**2
#Correspong compressive(axial) stress
p=2*sigma3 #N/mm**2
#Corresponding Compressive force
P3=p*pi*4**-1*d**2 #N
#Result
print"Failure Loads are:",round(F,2),"N"
print" :",round(P3,2),"N"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=25 #mm #Diameter of circular bar
F=20*10**3 #N #Axial Force
theta=30 #Degree #angle
#Calculations
#Axial stresses
p=F*(pi*4**-1*d**2)**-1 #N/mm**2
#Normal Stress
p_n=p*(cos(30*pi*180**-1))**2
#Tangential Stress
p_t=p*2**-1*sin(2*theta*pi*180**-1)
#Max shear stress occurs on plane where theta2=45
theta2=45
sigma_max=p*2**-1*sin(2*theta2*pi*180**-1)
#Result
print"Stresses developed on a plane making 30 degree is:",round(p_n,2),"N/mm**2"
print" :",round(p_t,2),"N/mm**2"
print"stress on max shear stress is",round(sigma_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
theta=30 #degree
#Stresses acting on material
p1=120 #N/mm**2
p2=80 #N/mm**2
#Calculations
#Normal Stress
P_n=(p1+p2)*2**-1+(p1-p2)*2**-1*cos(2*theta*pi*180**-1) #N/mm**2
#Tangential stress
P_t=(p1-p2)*2**-1*sin(2*theta*pi*180**-1)
#Resultant stress
P=(P_n**2+P_t**2)**0.5 #N/mm**2
#Inclination to the plane
phi=np.arctan(P_n*P_t**-1)*(180*pi**-1)
#Angle made by resultant with 120 #N/mm**2 stress
phi2=phi+theta #Degree
#Result
print"Normal Stress is",round(P_n,2),"N/mm**2"
print"Tangential Stress is",round(P_t,2),"N/mm**2"
print"Angle made by resultant",round(phi2,2),"Degree"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#Direct Stresses
P1=60 #N/mm**2
P2=100 #N/mm**2
Theta=25 #Degree #Angle
#Calculations
#Normal Stress
P_n=(P1-P2)*2**-1+(P1+P2)*2**-1*cos(2*Theta*pi*180**-1) #N/mm**2
#Tangential Stress
P_t=(P1+P2)*2**-1*sin(Theta*2*pi*180**-1) #N/mm**2
#Resultant stress
P=(P_n**2+P_t**2)**0.5 #N/mm**2
theta2=np.arctan(P_n*P_t**-1)*(180*pi**-1)
#Result
print"Stresses on the plane AC is:",round(P_n,2),"N/mm**2"
print" ",round(P_t,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#Stresses acting on material
p_x=180 #N/mm**2
p_y=120 #N/mm**2
q=80 #N/mm**2
#Calculations
theta=np.arctan(2*q*(p_x-p_y)**-1)*(180*pi**-1) #degrees
theta2=theta*2**-1 #Degrees
theta3=theta+180 #Degrees
theta4=theta3*2**-1 #Degrees
#Stresses
p_1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
p_2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Result
print"Magnitude of Principal stress is:",round(p_1,2),"N/mm**2"
print" ",round(p_2,2),"N/mm**2"
print"Magnitude of max shear stress is",round(q_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#stresses
p_x=60 #N/mm**2
p_y=-40 #N/mm**2
q=10 #N/mm**2 #shear stress
#Calculations
#Principal Stresses
p1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
p2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Inclination of principal stress to plane
theta=np.arctan(2*q*(p_x-p_y)**-1)*(180*pi**-1)#Degrees
theta2=(theta)*2**-1 #degrees
theta3=(theta+180)*2**-1 #degrees
#Result
print"Principal Stresses are:",round(p1,2),"N/mm**2"
print" :",round(p2,2),"N/mm**2"
print"Max shear stresses",round(q_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#stresses
p_x=-120 #N/mm**2
p_y=-80 #N/mm**2
q=-60 #N/mm**2 #shear stress
#Calculations
#Principal Stresses
p1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
p2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Inclination of principal stress to plane
theta=np.arctan(2*q*(p_x-p_y)**-1)*(180*pi**-1)#Degrees
theta2=(theta)*2**-1 #degrees
theta3=(theta+180)*2**-1 #degrees
#Result
print"Principal Stresses are:",round(p1,2),"N/mm**2"
print" :",round(p2,2),"N/mm**2"
print"Max shear stresses",round(q_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#stresses
p_x=-40 #N/mm**2
p_y=80 #N/mm**2
q=48 #N/mm**2 #shear stress
#Calculations
#Max shear stress
q_max=((((p_x-p_y)*2**-1)**2)+q**2)**0.5 #N/mm**2
#Inclination of principal stress to plane
theta=np.arctan(2*q*(p_x-p_y)**-1)*(180*pi**-1)#Degrees
theta2=(theta)*2**-1 #degrees
theta3=(theta+180)*2**-1 #degrees
#Normal Corresponding stress
p_n=(p_x+p_y)*2**-1+(p_x-p_y)*2**-1*cos(2*(theta2+45)*pi*180**-1)+q*sin(2*(theta2+45)*pi*180**-1) #Degrees
#Resultant stress
p=((p_n**2+q_max**2)**0.5) #N/mm**2
phi=np.arctan(p_n*q_max**-1)*(180*pi**-1) #Degrees
#Inclination to the plane
alpha=round((theta2+45),2)+round(phi ,2)#Degree
#Answer in book is incorrect of alpha ie41.25
#Result
print"Planes of max shear stress:",round(p_n,2),"N/mm**2"
print" ",round(q_max,2),"N/mm*2"
print"Resultant Stress is",round(p,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
#Stresses
p_x=50*cos(35*pi*180**-1)
q=50*sin(35*pi*180**-1)
p_y=0
theta=40 #Degrees #Plane AB inclined to vertical
#Calculations
#Normal Stress on AB
p_n=(p_x+p_y)*2**-1+(p_x-p_y)*2**-1*cos(2*theta*pi*180**-1)+q*sin(2*theta*pi*180**-1)
#Tangential Stress on AB
p_t=(p_x-p_y)*2**-1*sin(2*theta*pi*180**-1)-q*cos(2*theta*pi*180**-1) #N/mm**2
#Resultant stress
p=(p_n**2+p_t**2)**0.5 #N/mm**2
#Angle of resultant
phi=np.arctan(p_n*p_t**-1)*(180*pi**-1) #degrees
phi2=phi+theta #Degrees
#Result
print"Magnitude of resultant stress is",round(p,2),"N/mm**2"
print"Direction of Resultant stress is",round(phi2,2),"Degrees"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#Direct stresses
p_x=120 #N/mm**2 #Tensile stress
p_y=-100 #N/mm**2 #Compressive stress
p1=160 #N/mm**2 #Major principal stress
#Calculations
#Let q be the shearing stress
#p1=(p_x+p_y)*2**-1+((((p_x+p_y)*2**-1)**2)+q**2)**0.5
#After further simplifying we get
q=(p1-((p_x+p_y)*2**-1))**2-((p_x-p_y)*2**-1)**2 #N/mm**2
q2=(q)**0.5 #N/mm**2
#Minimum Principal stress
p2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q2**2)**0.5 #N/mm**2
#Max shearing stress
q_max=(((p_x-p_y)*2**-1)**2+q2**2)**0.5 #N/mm**2
#Result
print"Shearing stress of material",round(q,2),"N/mm**2"
print"Min Principal stress",round(p2,2),"N/mm**2"
print"Max shearing stress",round(q_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
F=40*10**3 #N #Shear Force
M=20*10**6 #Bending Moment
#Rectangular section
b=100 #mm #Width
d=200 #mm #Depth
x=20 #mm #Distance from Top surface upto point
y=80 #mm #Distance from point to Bottom
#Calculations
I=1*12**-1*b*d**3 #mm**4 #M.I
#At 20 mm Below top Fibre
f_x=M*I**-1*y #N/mm**2 #Stress
#Assuming sagging moment ,f_x is compressive p_x=f_x=-24 #N/mm**2
p_x=f_x=-24 #N/mm**2
#Shearing stress
q=F*(b*I)**-1*(b*x*(b-x*2**-1)) #N/mm**2
#Direct stresses
p_y=0 #N/mm**2
p1=(p_x+p_y)*2**-1+(((p_x+p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
p2=(p_x+p_y)*2**-1-(((p_x+p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Result
print"Directions of principal stresses at a point below 20mm is:",round(p1,2),"N/mm**2"
print" ",round(p2,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
import numpy as np
#Initilization of Variables
L=4000 #mm #Span
W1=W2=W3=2*10**3 #N #Load
#SEction of beam
b=100 #mm #Width
d=240 #mm #Dept
#Calculations
#Let R_A and R_B be the reactions
R_A=R_B=(W1+W2+W3)*2**-1 #KN
#Now at the section 1.5m from left support A
#Shear Force
F=R_A-W1 #KN
#B.M
M=R_A*1.5-W1*0.5 #KN-m
#M.I
I=1*12**-1*b*d**3 #mm**4
#Bending stress
#f=M*I**-1*y
#After Sub values and further simplifying we get
#f=3.04*10**-2*y
#As it varies Linearly
#at distance 0 From NA
f1=0
#at distance 60 mm from NA
f2=1.823 #N/mm**2
#at distance 120 mm from NA
f3=3.646 #N/mm**2
#Shearing stress
q=F*b*d*2**-1*d*4**-1*(b*I)**-1
#At 60 mm above NA
q2=F*b*d*4**-1*(d*2**-1-d*8**-1)*(b*I)**-1
#At 120 mm above NA
q3=0
#At NA element is under pure shear
p1=q #N/mm**2
p2=-q #N/mm**2
#Inclination of principal plane to vertical
#theta=2*q*0**-1
#Further simplifying we get
#theta=infinity
#therefore
theta=90*2**-1 #degrees
theta2=270*2**-1 #degrees
#At 60 mm From NA
p_x=-1.823 #N/mm**2
p_y=0
q=0.0469 #N/mm**2
#principal planes
P1=(p_x+p_y)*2**-1+(((p_x+p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
P2=(p_x+p_y)*2**-1-(((p_x+p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Principal planes inclination to hte plane of p_x is given by
theta3=(np.arctan(2*q*(p_x-p_y)**-1)*(180*pi**-1))
theta4=theta3*2**-1#degrees
theta5=theta3+180 #Degrees
#At 120 mm From N-A
p_x2=3.646 #N/mm**2
p_y2=0 #N/mm**2
q2=0 #N/mm**2
P3=p_x2 #N/mm**2
P4=0 #N/mm**2
#Answer for P2 at 60 mm from NA is incorrect
#Result
print"Principal Planes at 60 mm from NA:",round(p_x,2),"N/mm**2"
print" ",round(p_y,2),"N/mm**2"
print"Principal Stresses at 60 mm From NA",round(P1,4),"N/mm**2"
print" ",round(P2,4),"N/mm**2"
print"Principal Planes at 60 mm from NA:",round(p_x2,4),"N/mm**2"
print" ",round(p_y2,4),"N/mm**2"
print"Principal Stresses at 60 mm From NA",round(P3,4),"N/mm**2"
print" ",round(P4,4),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
L=8000 #mm #Span of beam
w=40*10**6 #N/mm #udl
#I-section
#Flanges
b=100 #mm #Width
t=10 #mm #Thickness
D=400 #mm #Overall Depth
t2=10 #mm #thickness of web
#Calculations
#Let R_A and R_B be the Reactions at A & B respectively
R_A=w*2**-1*L*10**-9 #KN
#Shear force at 2m for left support
F=R_A-2*w*10**-6 #KN
#Bending Moment
M=R_A*2-2*w*10**-6 #KN-m
#M.I
I=1*12**-1*b*D**3-1*12**-1*(b-t)*(D-2*t2)**3 #mm**4
#Bending stress at 100 mm above N_A
f=M*10**6*I**-1*b
#Shear stress
q=F*10**3*(t*I)**-1*(b*t*(D-t)*2**-1 +t2*(b-t2)*145) #N/mm**2
p_x=-197.06 #N/mm**2
p_y=0 #N/mm**2
q=21.38 #N/mm**2
#Principal Stresses
P1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
P2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Result
print"Principal Stresses are:",round(P1,2),"N/mm**2"
print" ",round(P2,2),"N/mm**2"
print"Max shear stress",round(q_max,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=100 #mm #Diameter of shaft
M=3*10**6 #N-mm #B.M
T=6*10**6 #N-mm #Twisting Moment
mu=0.3
#Calculations
#Max principal Stress
P1=16*(pi*d**3)**-1*(M+(M**2+T**2)**0.5) #N/mm**2
P2=16*(pi*d**3)**-1*(M-(M**2+T**2)**0.5) #N/mm**2
#Direct stress
P=round(P1,2)-mu*round(P2,2) #N/mm**2
#Result
print"Principal stresses are:",round(P1,2),"N/mm**2"
print" :",round(P2,2),"N/mm**2"
print"Stress Producing the same strain is",round(P,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=75 #mm #diameter
P=30*10**6 #W #Power transmitted
W=6 #N-mm/sec #Load
L=1000 #mm
N=300 #r.p.m
#Calculations
#B.M
M=W*L*4**-1 #N-mm
T=P*60*(2*pi*N)**-1 #Torque transmitted
#M.I
I=pi*64**-1*d**4 #mm**4
#Bending stress
f_A=M*I**-1*(d*2**-1) #N/mm**2
#At A
p_x=f_A
p_y=0
#Polar Modulus
J=pi*32**-1*d**4 #mm**4
#Shearing stress
q=T*J**-1*(d*2**-1) #N/mm**2
#Principal Stresses
P1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
P2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Bending stress
p_x2=0
p_y2=0
#Shearing stress
q2=T*J**-1*d*2**-1 #N/mm**2
#Principal stresses
P3=(p_x2+p_y2)*2**-1+(((p_x2-p_y2)*2**-1)**2+q2**2)**0.5 #N/mm**2
P4=(p_x2+p_y2)*2**-1-(((p_x2-p_y2)*2**-1)**2+q2**2)**0.5 #N/mm**2
#Max shear stress
q_max2=(((p_x2-p_y2)*2**-1)**2+q2**2)**0.5 #N/mm**2
#Answer for Principal Stresses P1,P2 and Max stress i.e q_max is incorrect in Book
#Result
print"Principal Stresses at vertical Diameter:P1",round(P1,2),"N/mm**2"
print" :P2",round(P2,2),"N/mm**2"
print"Max stress at vertical Diameter : ",round(q_max,2),"N/mm**2"
print"Principal Stresses at Horizontal Diameter:P3",round(P3,2),"N/mm**2"
print" :P4",round(P4,2),"N/mm**2"
print"Max stress at Horizontal Diameter : ",round(q_max2,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d1=100 #mm #External Diameter
d2=50 #mm #Internal Diameter
N=500 #mm #r.p.m
P=60*10**6 #N-mm/sec #Power
p=100 #N/mm**2 #principal stress
#Calculations
#M.I
I=pi*(d1**4-d2**4)*64**-1 #mm**4
#Bending Stress
#f=M*I*d1*2**-1 #N/mm**2
#Principal Planes
#p_x=32*M*(pi*(d1**4-d2**4))*d1
#p_y=0
#Shear stress
#q=T*J**-1*(d1*2**-1)
#After sub values and further simplifying we get
#q=16*T*d1*(pi*(d1**4-d2**4))*d1
#Principal stresses
#P1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#After sub values and further simplifying we get
#P1=16*(pi*(d1**4-d2**4))*d1*(M+(M**2+t**2)**0.5) ...............(1)
#P=2*pi*N*T*60**-1
#After sub values and further simplifying we get
T=P*60*(2*pi*N)**-1*10**-6 #N-mm
#Again Sub values and further simplifying Equation 1 we get
M=(337.533)*(36.84)**-1 #KN-m
#Min Principal stress
#P2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Sub values and further simplifying we get
P2=16*(pi*(d1**4-d2**4))*d1*(M-(M**2+T**2)**0.5)*10**-11
#Result
print"Bending Moment safely applied to shaft is",round(M,2),"KN-m"
print"Min Principal Stress is",round(P2,3),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
d=150 #mm #Diameter
T=20*10**6 #N #Torque
M=12*10**6 #N-mm #B.M
F=200*10**3 #N #Axial Thrust
#Calculations
#M.I
I=(pi*64**-1*d**4)
#Bending stress
f_A=M*I**-1*(d*2**-1) #N/mm**2
f_B=-f_A #N/mm**2
#Axial thrust due to thrust
sigma=F*(pi*4**-1*d**2)**-1
#At A
p_x=f_A-sigma #N/mm**2
#At B
p_x2=f_B-sigma #N/mm**2
p_y=0 #At A and B
#Polar Modulus
J=pi*32**-1*d**4 #mm**4
#Shearing stress at A and B
q=T*J**-1*(d*2**-1) #N/mm**2
#Principal Stresses
#At A
P1=(p_x+p_y)*2**-1+(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
P2=(p_x+p_y)*2**-1-(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max1=(((p_x-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#At B
P1_2=(p_x2+p_y)*2**-1+(((p_x2-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
P2_2=(p_x2+p_y)*2**-1-(((p_x2-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Max shear stress
q_max2=(((p_x2-p_y)*2**-1)**2+q**2)**0.5 #N/mm**2
#Result
print"MAx Principal Stresses:P1",round(P1,2),"N/mm**2"
print" :P2",round(P2,2),"N/mm**2"
print"Min Principal Stresses:P1_2",round(P1_2,2),"N/mm**2"
print" :P2_2",round(P2_2,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#strains
e_A=500 #microns
e_B=250 #microns
e_C=-150 #microns
E=2*10**5 #N/mm**2 #Modulus of Elasticity
mu=0.3 #Poissoin's ratio
theta=45 #Degrees
#Calculations
e_x=e_A=500
e_45=e_B=250
e_y=e_C=-150
#e_45=(e_x+e_y)*2**-1+(e_x-e_y)*2**-1*cos(2*theta)+rho_x_y*2**-1*sin(2*theta)
#After sub values and further simplifying we get
rho_x_y=(e_45-(e_x+e_y)*2**-1-(e_x-e_y)*2**-1*cos(2*theta*pi*180**-1))*(sin(2*theta*pi*180**-1))**-1*2
#Principal strains are given by
e1=(e_x+e_y)*2**-1+(((e_x-e_y)*2**-1)**2+(rho_x_y*2**-1)**2)**0.5 #microns
e2=(e_x+e_y)*2**-1-(((e_x-e_y)*2**-1)**2+(rho_x_y*2**-1)**2)**0.5 #microns
#Principal Stresses
sigma1=E*(e1+mu*e2)*(1-mu**2)**-1*10**-6 #N/mm**2
sigma2=E*(e2+mu*e1)*(1-mu**2)**-1*10**-6 #N/mm**2
#Result
print"Principal Strains are:e1",round(e1,2),"N/mm**2"
print" :e2",round(e2,2),"N/mm**2"
print"Principal Stresses are:sigma1",round(sigma1,2),"N/mm**2"
print" :sigma2",round(sigma2,2),"N/mm**2"
import math
from math import sin, cos, tan, pi, radians
#Initilization of Variables
#Strains
e_A=600 #microns
e_B=-450 #microns
e_C=100 #micron
E=2*10**5 #N/mm**2 #Modulus of Elasticity
mu=0.3 #Poissoin's ratio
theta=240
#Calculations
e_x=e_A=600
#e_A=(e_x+e_y)*2**-1+(e_x-e_y)*2**-1*cos(theta)+rho_x_y*2**-1*sin(theta)
#After sub values and further simplifying we get
#-450=(e_x+e_y)*2**-1-(e_x-e_y)*2**-1*(0.5)-0.866*2**-1*rho_x_y .....................(1)
#e_C=(e_x+e_y)*2**-1+(e_x-e_y)*2**-1*cos(2*theta)+rho_x_y*2**-1*sin(2*theta)
#After sub values and further simplifying we get
#100=(e_x+e_y)*2**-1-0.5*(e_x-e_y)*2**-1*(0.5)-0.866*2**-1*rho_x_y .....................(2)
#Adding Equation 1 and 2 we get equations as
#-350=e_x+e_y-(e_x-e_y)*2**-1 ...............(3)
#Further simplifying we get
e_y=(-700-e_x)*3**-1 #micron
rho_x_y=(e_C-(e_x+e_y)*2**-1-(e_x-e_y)*2**-1*cos(2*theta*pi*180**-1))*(sin(2*theta*pi*180**-1))**-1*2 #micron
#Principal strains
e1=(e_x+e_y)*2**-1-(((e_x-e_y)*2**-1)**2+(rho_x_y*2**-1)**2)**0.5 #microns
e2=(e_x+e_y)*2**-1+(((e_x-e_y)*2**-1)**2+(rho_x_y*2**-1)**2)**0.5 #microns
#Principal Stresses
sigma1=E*(e1+mu*e2)*(1-mu**2)**-1*10**-6 #N/mm**2
sigma2=E*(e2+mu*e1)*(1-mu**2)**-1*10**-6 #N/mm**2
#Result
print"Principal Stresses are:sigma1",round(sigma1,2),"N/mm**2"
print" :sigma2",round(sigma2,2),"N/mm**2"