# Chapter 7: Analysis of Stress and Strain¶

## Example 7.1, page no. 472¶

In [1]:
import math

sx = 16000                          # Direct stress in x-direction in psi
sy = 6000                           # Direct stress in y-direction ""
txy = 4000                          # Shear stress in y-direction ""
tyx = txy                           # Shear stress in x-direction ""
t = 45                              # Inclination pf plane in degree

#calculation
sx1 = (sx+sy)/2 + ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) + txy*math.sin(math.radians(2*t))       # Direct stress in x1-direction in psi
sy1 = (sx+sy)/2 - ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) - txy*math.sin(math.radians(2*t))       # Direct stress in y1-direction in psi

print "The direct stress on the element in x1-direction is", sx1, "psi"
print "The direct stress on the element in y1-direction is", sy1, "psi"
print "The shear stress on the element", tx1y1, "psi"

The direct stress on the element in x1-direction is 15000.0 psi
The direct stress on the element in y1-direction is 7000.0 psi
The shear stress on the element -5000.0 psi


## Example 7.2, page no. 473¶

In [2]:
import math

sx = -46e06                     # Direct stress in x-direction in Pa
sy = 12e06                      # Direct stress in y-direction ""
txy = -19e06                    # Shear stress in y-direction ""
t = -15                         # Inclination of plane in degree

#calculation
sx1 = (sx+sy)/2.0 + ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) + txy*math.sin(math.radians(2*t))   # Direct stress in x1-direction in Pa
sy1 = (sx+sy)/2.0 - ((sx-sy)*(math.cos(math.radians(2*t))/2.0)) - txy*math.sin(math.radians(2*t))   # Direct stress in y1-direction in Pa

print "The direct stress on the element in x1-direction is", sx1, "Pa"
print "The direct stress on the element in y1-direction is", sy1, "Pa"
print "The shear stress on the element", tx1y1, "Pa"

The direct stress on the element in x1-direction is -32614736.7097 Pa
The direct stress on the element in y1-direction is -1385263.29025 Pa
The shear stress on the element -30954482.6719 Pa


## example 7.3, page no. 481¶

In [53]:
import math

ax = 12300.0
ay = -4200.0
txy = -4700.0

tan_2p = round((2*txy)/(ax-ay), 4)

theta_p1 = 150.3
theta_p2 = 330.3

stress1 = (ax+ay)/2.0
stress2 = (ax-ay)/2.0
a1 = stress1 + math.sqrt((stress2**2.0)+(txy**2.0))
a2 = stress1 - math.sqrt((stress2**2.0)+(txy**2.0))

#python calculations differ a bit. hence, differences in the answer
print "Principal stesses are ", round(a1), "psi and ", round(a2), " psi"

tmax = math.sqrt((stress2**2.0)+(txy**2.0))
print "Maximum shear stress is ", round(tmax), " psi"

a_aver = (ax+ay)/2.0

print "Normal stress acting at maximum shear stress = ", round(a_aver), "psi"

Principal stesses are  13545.0 psi and  -5445.0  psi
Maximum shear stress is  9495.0  psi
Normal stress acting at maximum shear stress =  4050.0 psi


## Example 7.4, page no. 492¶

In [3]:
import math

#initialisation
sx = 90e06                      # Direct stress in x-direction in Pa
sy = 20e06                      # Direct stress in y-direction in Pa
t = 30                          # Inclination of element in degree

#calculation
savg = (sx+sy)/2.0                                  # Average in-plane direct stress
txy = 0
R = math.sqrt(((sx-sy)/2)**2+(txy)**2)              # Radius of mohr circle

# Point D  at 2t = 60
sx1 = savg + R*math.cos(math.radians(2*t))          # Direct stress at point D
tx1y1 = -R*math.sin(math.radians(2*t))              # shear stress at point D
print "The direct stress at point D is", sx1, "Pa"
print "The shear stress at point D is", tx1y1, "Pa"

# Point D  at 2t = 240
sx2 = savg + R*math.cos(math.radians(90 + t))       # Direct stress at point D
tx2y2 = R*math.sin(math.radians(90 + t))            # shear stress at point D
print "The direct stress at point D_desh is", sx2, "Pa"
print "The shear stress at point D_desh is", tx2y2, "Pa"

The direct stress at point D is 72500000.0 Pa
The shear stress at point D is -30310889.1325 Pa
The direct stress at point D_desh is 37500000.0 Pa
The shear stress at point D_desh is 30310889.1325 Pa


## Example 7.5, page no. 494¶

In [1]:
import math
import numpy

#initialisation
sx = 15000                              # Direct stress in x-direction in psi
sy = 5000                               # Direct stress in y-direction ""
txy = 4000                              # Shear stress in y-direction ""
savg = (sx+sy)/2.0                        # Average in-plane direct stress
sx1 = 15000                             # Stress acting on face at theta = 0 degree
tx1y1 = 4000                            # Stress acting on face at theta = 0 degree
sx1_ = 5000
tx1y1_ = -4000

#calculation
R = math.sqrt(((sx-sy)/2)**2+(txy)**2)              # Radius of mohr circle

# Part (a)
t = 40                                              # Inclination of the plane in degree
f1 = numpy.degrees(numpy.arctan((4000.0/5000.0)))     # Angle between line CD and x1-axis
f2 = 80 - f1                                        # Angle between line CA and x1-axis

# Point D
sx1 = savg + R*math.cos(math.radians(f2))       # Direct stress at point D
tx1y1 = -R*math.sin(math.radians(f2))           # shear stress at point D
print "The shear stress at point D", round(tx1y1), "psi"

# Point D'
sx2 = savg - R*math.cos(math.radians(f2))       # Direct stress at point D'
tx2y2 = R*math.sin(math.radians(f2))            # shear stress at point D'
print "The direct stres at point D_desh", round(sx2), "psi"

#Part (b)
sp1 = savg + R                                      # Maximum direct stress in mohe circle (at point P1)
tp1 = f1/2                                          # Inclination of plane of maximum direct stress
print "with angle",round(tp1,2) , "degree The maximum direct stress at P1 is ",sp1 , "psi"
sp2 =  savg - R  # Minimum direct stress in mohe circle (at point P2)
tp2 = (f1+180)/2  # Inclination of plane of minimum direct stress
print "with angle", round(tp2,2), "degree The maximum direct stress at P2 is ",sp2 , "psi"

# Part (c)
tmax = R                                            # Maximum shear stress in mohe circle
ts1 = -(90 - f1)/2.0                                # Inclination of plane of maximum shear stress
print "with plane incilation of", tmax, "psi The Maximum shear stress is ", round(ts1,2), "deegree"

The shear stress at point D -4229.0 psi
The direct stres at point D_desh 5193.0 psi
with angle 19.33 degree The maximum direct stress at P1 is  16403.1242374 psi
with angle 109.33 degree The maximum direct stress at P2 is  3596.87576257 psi
with plane incilation of 6403.12423743 psi The Maximum shear stress is  -25.67 deegree


## Example 7.6, Page number 497¶

In [11]:
import math
import numpy

sx = -50e06                                 # Direct stress in x-direction in psi
sy = 10e06                                  # Direct stress in y-direction ""
txy = -40e06                                # Shear stress in y-direction ""
savg = (sx+sy)/2                            # Average in-plane direct stress
sx1 = -50e06
tx1y1 = -40e06                              # Stress acting on face at theta = 0 degree
sx1_ = 10e06
tx1y1_ = 40e06                              # Stress acting on face at theta = 0 degree

#calculation
R = math.sqrt(((sx-sy)/2)**2+(txy)**2)      # Radius of mohr circle

# Part (a)
t = 45                                                  # Inclination of the plane in degree
f1 = numpy.degrees(numpy.arctan((40e06/30e06)))       # Angle between line CD and x1-axis
f2 = 90 - f1  # Angle between line CA and x1-axis

# Point D
sx1 = savg - R*math.cos(math.radians(f2))           # Direct stress at point D
tx1y1 = R*math.sin(math.radians(f2))                # shear stress at point D
print "The direct stres at point D", sx1, "Pa"
print "The shear stress at point D", tx1y1, "Pa"

# Point D'
sx2 = savg + R*math.cos(math.radians(f2))           # Direct stress at point D'
tx2y2 = -R*math.sin(math.radians(f2))               # shear stress at point D'
print "The direct stres at point D_desh", sx2, "Pa"
print "The shear stress at point D_desh", tx2y2, "Pa"

#Part (b)
sp1 =  savg + R                                         # Maximum direct stress in mohe circle (at point P1)
tp1 =(f1+180)/2                                         # Inclination of plane of maximum direct stress
print "with angle", round(tp1,2), "degree", "The maximum direct stress at P1 is ",  sp1, "Pa"
sp2 =  savg - R                                         # Minimum direct stress in mohe circle (at point P2)
tp2 = f1/2                                              # Inclination of plane of minimum direct stress
print "with angle", round(tp2,2), "degree", "The maximum direct stress at P2 is ", sp2, "Pa"

# Part (c)
tmax = R                                                # Maximum shear stress in mohe circle
ts1 = (90 + f1)/2                                       # Inclination of plane of maximum shear stress
print "with plane incilation of", round(ts1,2), "degree", "The Maximum shear stress is ", tmax, "Pa"

The direct stres at point D -60000000.0 Pa
The shear stress at point D 30000000.0 Pa
The direct stres at point D_desh 20000000.0 Pa
The shear stress at point D_desh -30000000.0 Pa
with angle 116.57 degree The maximum direct stress at P1 is  30000000.0 Pa
with angle 26.57 degree The maximum direct stress at P2 is  -70000000.0 Pa
with plane incilation of 71.57 degree The Maximum shear stress is  50000000.0 Pa


## Example 7.7, page no. 520¶

In [5]:
import math
import numpy

#initialisation

ex = 340e-06                            # Strain in x-direction
ey = 110e-06                            # Strain in y-direction
txy = 180e-06                           # shear strain

# Part (a)
t = 30                                      # Inclination of the element in degree
ex1 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*t)) + (txy/2.0)*(math.sin(math.radians(2*t)))         # Strain in x1 direction (located at 30 degree)
ey1 = ex+ey-ex1                             # Strain in y1 direction (located at 30 degree)
print "Strain in x1 direction (located at 30 degree) is", round((ex1/1E-6),2),"* 10^-6"
print "shear strain is", round((tx1y1/1E-6),2),"* 10^-6"
print "Strain in y1 direction (located at 30 degree) is", ey1

# Part (b)
e1 = (ex+ey)/2.0 + math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress
e2 = (ex+ey)/2.0 - math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress
tp1 = (0.5)*numpy.degrees(numpy.arctan((txy/(ex-ey)))) # Angle to principle stress direction
tp2 = 90 + tp1  # Angle to principle stress direction
e1 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*tp1)) + (txy/2.0)*(math.sin(math.radians(2*tp1)))      # Principle stress via another method
e2 = (ex+ey)/2.0 + ((ex-ey)/2.0)*math.cos(math.radians(2*tp2)) + (txy/2.0)*(math.sin(math.radians(2*tp2)))      # Principle stress via another method
print "with angle", round(tp1,2), "degree","The Principle stress is ", round(e1,4)
print "with angle",round(tp2,2), "degree","The Principle stress is ",round(e2,4)

# Part (c)
tmax = 2*math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2)         # Maxmum shear strain
ts = tp1 + 45                                               # Orientation of element having maximum shear stress
tx1y1_ =  2*( -((ex-ey)/2)*math.sin(math.radians(2*ts)) + (txy/2)*(math.cos(math.radians(2*ts))))  # Shear starin assosiated with ts direction
print "with angle",round(ts,2), "degree","The Maximum shear strain is ",round(tx1y1_,4)
eavg = (e1+e2)/2.0                                          # Average atrain
print "The average strain is", eavg

Strain in x1 direction (located at 30 degree) is 360.44 * 10^-6
shear strain is -109.19 * 10^-6
Strain in y1 direction (located at 30 degree) is 8.95577136594e-05
with angle 19.02 degree The Principle stress is  0.0004
with angle 109.02 degree The Principle stress is  0.0001
with angle 64.02 degree The Maximum shear strain is  -0.0003
The average strain is 0.000225