Chapter8-SIMPLE STRESSES AND STRAINS

example8.1 Page number243

In [80]:
from math import pi

#variable declaration

P=float(40000)               #Load,N
E=float(200000)              #Modulus of elasticity for steel,N/mm^2
L=500              #length of circular rod,mm
d=float(16)               #diameter of rod,mm
 
A=(pi*(pow(d,2)))/4   #sectional area, mm^2
p=P/A                 #stress, N/mm^2
e=p/E                 #strain
delta=(P*L)/(A*E)     #Elongation,mm

print "sectional area=",round(A,2),"mm^2"
print "stress=",round(p,2),"N/mm^2"
print "strain=",e,"N/mm^2"
print "Elongation=",round(delta,3),"mm"
sectional area= 201.06 mm^2
stress= 198.94 N/mm^2
strain= 0.000994718394324 N/mm^2
Elongation= 0.497 mm

example8.2 Page number243

In [81]:
#variable declaration

P=float(120)              # force applied during measurement,N
E=float(200000)           #Modulus of elasticity for steel,N/mm^2
L=float(30)            #length of  Surveyor’s steel tape,mm
              
 
A=15*0.75             #area, mm^2
delta=((P*L*1000)/(A*E))     #Elongation,mm

print "area=",round(A,2),"mm^2"
print "Elongation=",round(delta,3),"mm"

print "Hence, if measured length is", L,"m."
print "Actual length is" ,round((L+(delta/1000)),6),"m"

print "Actual length of line AB=",round((150*(L+(delta/1000))/30),3),"m."
area= 11.25 mm^2
Elongation= 1.6 mm
Hence, if measured length is 30.0 m.
Actual length is 30.0016 m
Actual length of line AB= 150.008 m.

example 8.3 Page number 244

In [82]:
from math import pi,sqrt

#variable declaration

Y=float(250)                 #Yield stress, N/mm^2
FOS=float(1.75)              #Factor of safety
P=float(160)                 #Load,KN

p=Y/FOS

print "Therefore, permissible stress"
print "p=",round(p,3), "N/mm^2"
print "Load P=",P*1000,"N"

#p=P/A

A=P*1000/p           #area,mm^2

print "A=",round(A),"mm^2"

#For hollow section of outer diameter ‘D’ and inner diameter ‘d’ A=pi*(D^2-d^2)/4
D=float(101.6)        #outer diameter,mm

d=sqrt(pow(D,2)-(4*A/pi))

print "d=",round(d,2),"mm"

t=(D-d)/2
print "t=",round(t,2),"mm"

print "Hence, use of light section is recommended."
Therefore, permissible stress
p= 142.857 N/mm^2
Load P= 160000.0 N
A= 1120.0 mm^2
d= 94.32 mm
t= 3.64 mm
Hence, use of light section is recommended.

example 8.4 page number 245

In [83]:
from math import pi

#variable declaration 

d=float(20)                                       #Diameter ,mm
Loadatelasticlimit=float(102)                  #Load at elastic limit,KN
P=80                                              #Load for extension of o.25mm , KN
delta=float(0.25)                                 #extension in specimen of steel,mm
L=200                                             #gauge length of specimen of steel,mm
Finalextension=float(56)                         #total extension at fracture,mm


A=(pi*pow(d,2))/4                                 #Area,mm^2
print "Area=", round(A,2),"mm^2"

Stressatelasticlimit=Loadatelasticlimit*1000/A    #Stress at elastic limit,N/mm^2 
print "Stress at elastic limit=",round(Stressatelasticlimit,2),"N/mm^2"

E=(P*1000/A)*(delta*L)                            #Young’s modulus ,N/mm^2
print "Young's modulus E=", round(E,2),"N/mm^22"

Percentageelongation=Finalextension*100/L       #percentage elongation,%
print "Percentage elongation=", round(Percentageelongation,2),"%"

Initialarea=(pi*pow(d,2))/4
Finalarea=(pi*pow(15,2))/4                     # total extension at fracture is 56 mm and diameter at neck is 15 mm.
Percentagereductioninarea=(Initialarea-Finalarea)*100/Initialarea

print "Percentage reduction in area=",round(Percentagereductioninarea,2),"%"

UltimateLoad=130                               #Maximum Load=130,kN
UltimateTensileStress=UltimateLoad/A

print"Ultimate Tensile Stress=",round(UltimateTensileStress,2),"N/mm^2"
Area= 314.16 mm^2
Stress at elastic limit= 324.68 N/mm^2
Young's modulus E= 12732.4 N/mm^22
Percentage elongation= 28.0 %
Percentage reduction in area= 43.75 %
Ultimate Tensile Stress= 0.41 N/mm^2

example8.5 Page number247

In [84]:
from math import pi

#variable declaration

P=float(40)                     #Load,KN
L1=150                          #length of 1st portion,mm
A1=pi*pow(25,2)/4               #Area of 1st portion,mm^2
L2=250                          #length of 2nd portion,mm
A2=pi*pow(20,2)/4               #Area of 2nd portion,mm^2
L3=150                          #length of 3rd portion,mm
A3=pi*pow(25,2)/4               #Area of 3rd portion,mm^2

#E,Young's modulus ,N/mm^2

#Total extension= Extension of portion 1+Extension of portion 2+Extension of portion 3

#Extension=(P*1000*L)/(A*E)

E=(P*1000*L1/A1)+(P*1000*L2/A2)+(P*1000*L3/A3)

print "E=",round(E,2),"N/mm^2"
E= 56277.19 N/mm^2

example8.6 Page number247

In [85]:
from math import pi

#variable declaration

P=float(30)                     #Load,KN
L1=600                          #length of 1st portion,mm
A1=40*20                        #Area of 1st portion,mm^2

E1=200000          # material 1  Young’s modulus,N/mm^2
  
E2=100000          # material 2  Young’s modulus,N/mm^2
 

L2=800                          #length of 2nd portion,mm
A2=30*20                        #Area of 2nd portion,mm^2

Extensionofportion1=(P*1000*L1)/(A1*E1)  #mm
Extensionofportion2=(P*1000*L2)/(A2*E2)  #mm

Totalextensionofthebar= Extensionofportion1 + Extensionofportion2

print"Total extension of the bar=",round(Totalextensionofthebar,4),"mm"
Total extension of the bar= 0.5125 mm

example8.7 Page number248

In [86]:
from math import pi

#variable declaration

P=float(30)                                 #Load,KN
L1=600                                      #length of 1st portion,mm
A1=pi*pow(30,2)/4                           #Area of 1st portion,mm^2
L2=400                                      #length of 2nd portion,mm
A2=pi*(pow(30,2)-pow(10,2))/4               #Area of 2nd portion,mm^2

#E,Young's modulus ,N/mm^2

#Total extension= Extension of portion 1+Extension of portion 2

#Extension=(P*1000*L)/(A*E)

T=float(0.222)                              #Total extension of the bar,mm

E=((P*1000*L1/A1)+(P*1000*L2/A2))/T 

print "E=",round(E,2),"N/mm^2"
E= 200735.96 N/mm^2

example 8.10 Page number 251

In [87]:
import math
#variable declaration

t=10                    #steel flat thickness,mm
b1=float(60)                   #tapering from b1 to b2
b2=40
L=600                   #steel flat length
P=float(80)                    #Load,KN
E=2*100000              #Young's Modulus,N/mm^2

#Extension of the tapering bar of rectangular section

delta1=(P*1000*L*math.log((b1/b2),10))/(t*E*(b1-b2))

print "delta1=",round(delta1,4),"mm"
print "there is calculation mistake in book"

#If averages cross-section is considered instead of tapering cross-section, extension is given by 

Aav=(b1+b2)*t/2                    #mm^2

delta2=(P*1000*L)/(Aav*E)                #mm
print"delta2=",round(delta2,3),"mm^2"

P= (delta2-delta1)*100/delta2

print"Percentage error=",round(P,3),"%"

print "there is calculation mistake in book"
delta1= 0.2113 mm
there is calculation mistake in book
delta2= 0.48 mm^2
Percentage error= 55.977 %
there is calculation mistake in book

example8.11 page number251

In [88]:
from math import pi

#variable declaration

P=float(200)                     #loading,KN
E=200*1000
d1=40                #Young's modulus,N/mm^2
A= pi*pow(d1,2)/4         #Area of uniform portion,mm^2 
L1=1500                    #length of uniform portion,mm 
d2=60                      #diameter of tapered section,mm
L2=500                     #length of tapered section,mm
#Extensions of uniform portion and tapering portion are worked out separately and then added to get extension of the given bar. 

#Extension of uniform portion

delta1=(P*1000*L1)/(A*E)

print "delta1=",round(delta1,3),"mm"

delta2=(P*1000*4*L2)/(E*pi*d1*d2)

print "delta2=",round(delta2,3),"mm"

T=delta1 + delta2 
print "Total extension",round(T,3),"mm"
delta1= 1.194 mm
delta2= 0.265 mm
Total extension 1.459 mm

example 8.13 page number259

In [89]:
from math import pi

#variable declaration

P=float(60)               #load,KN
d=float(25)               #diameter,mm
A=pi*pow(d,2)/4    #Area,mm^2
L=float(200)              #gauge length,mm

delta=0.12         #extension,mm
deltad=0.0045      #contraction in diameter,mm
Linearstrain=delta/L
Lateralstrain=deltad/d

Pr=Lateralstrain/Linearstrain

print "Poisson's ratio=",round(Pr,1)

E=(P*1000*L)/(A*delta)

print "E=",round(E,2),"N/mm^2"

G=E/(2*(1+Pr))                      #Rigidity modulus

print "G=",round(G,1),"N/mm^2"

K=E/(3*(1-(2*Pr)))                 #bulk modulus

print "K=",round(K,2),"N/mm^2"
Poisson's ratio= 0.3
E= 203718.33 N/mm^2
G= 78353.2 N/mm^2
K= 169765.27 N/mm^2

example 8.14 page number 260

In [90]:
from math import pi

#variable declaration

E=float(2*100000)               #Young's modulus,N/mm^2
Pr=float(0.3)                   #poisson's ratio

G=E/(2*(1+Pr))           #Rigidity modulus

K=E/(3*(1-2*(Pr)))        #Bulk modulus

print "G=", round(G,1),"N/mm^2"

print "K=", round(K,2), "N/mm^2"

P=60                           #Load,kN
A=pi*pow(25,2)/4               #Area,mm^2

Stress=P*1000/A                     #N/mm^2
#Linear strain,ex

ex=Stress/E
 
#Lateralstrain,ey,ez

ey=-1*Pr*ex
ez=-1*Pr*ex

#volumetric strain,ev=ex+ey+ez

ev=ex+ey+ez

v=pi*pow(25,2)*500/4
Changeinvolume=ev*v

print"change in volume",round(Changeinvolume,2),"mm^3"
G= 76923.1 N/mm^2
K= 166666.67 N/mm^2
change in volume 60.0 mm^3

example 8.15 page number261

In [91]:
#variable declaration
# Let the x, y, z be the mutually perpendicular directions

pr=float(0.3)
PX=float(15)                        #Loading in x-direction,KN
PY=float(80)                        #Loading in Y-direction(compressive),KN
PZ=float(180)                       #Loading in Z-direction,KN

#Area in X-,Y-,Z-Direction is AX,AY,AZ respectively,mm^2

AX=float(10*30)
AY=float(10*400)
AZ=float(30*400)

#stress devoloped in X-,Y-,Z- direction as px,py,pz respectively,N/mm^2

px=PX*1000/AX
py=PY*1000/AY
pz=PZ*1000/AZ

#Noting that a stress produces a strain of p/E in its own direction, the nature being same as that of stress and µ p E in lateral direction of opposite nature, and taking tensile stress as +ve, we can write expression for strains ex, ey, ez.
E=2*100000                       #young's modulus,N/mm^2

ex=(px/E)+(pr*py/E)-(pr*pz/E)
ey=(-pr*px/E)-(py/E)-(pr*pz/E)
ez=(-pr*px/E)+(pr*py/E)+(pz/E)

ev=ex+ey+ez                 #Volumetric strain

volume=10*30*400

Changeinvolume=ev*volume

print "Change in volume=",round(Changeinvolume,2),"mm^3"
Change in volume= 10.8 mm^3

example 8.17 page number 263

In [92]:
#variable declaration

E=float(2.1*100000)         #Young’s modulus of the material,N/mm^2
G=float(0.78*100000)        #modulus of rigidity,N/mm^2

pr=(E/(2*G))-1

print "poisson's Ratio=",round(pr,3)

K=E/(3*(1-2*pr))

print "Bulk modulus=",round(K,3),"N/mm^2" 
poisson's Ratio= 0.346
Bulk modulus= 227500.0 N/mm^2

example 8.18 page number 263

In [93]:
#variable declaration

G=float(0.4*100000)      #modulus of rigidity of material,N/mm^2
K=float(0.8*100000)      #bulk modulus,N/mm^2

E=(9*G*K)/(3*K+G)


print "Young's modulus=",round(E,3),"N"

pr=(E/(2*G))-1

print "Poisson's Ratio",round(pr,4)
Young's modulus= 102857.143 N
Poisson's Ratio 0.2857

example 8.19 page number 264

In [94]:
#variable declaration

L=float(600)                   #compound bar of length,mm
P=float(60)                    #compound bar when axial tensile force ,KN

Aa=float(40*20)                #area of aluminium strip,mm^2
As=float(60*15)                #area of steel strip,mm^2

Ea=1*100000             # elastic modulus of aluminium,N/mm^2
Es=2*100000             # elastic modulus of steel,N/mm^2

#load shared by aluminium strip be Pa and that shared by steel be Ps. Then from equilibrium condition Pa+Ps=P
#From compatibility condition, deltaAL=deltaS
Pa=(P*1000)/(1+((As*Es)/(Aa*Ea)))
Ps=Pa*((As*Es)/(Aa*Ea))

Sias=Pa/Aa
print "Stress in aluminium strip=",round(Sias,2),"N/mm^2"
Siss=Ps/As
print "Stress in steel strip=",round(Siss,2),"N/mm^2"

L=600
#Extension of the compound bar 
deltal=(Pa*L)/(Aa*Ea)
print"Extension of the compound bar=",round(deltal,3),"mm"
Stress in aluminium strip= 23.08 N/mm^2
Stress in steel strip= 46.15 N/mm^2
Extension of the compound bar= 0.138 mm

example 8.20 page number 265

In [95]:
from math import pi

#variable declaration

Es=float(2*100000)              #Young's modulus of steel rod ,N/mm^2
Ec=float(1.2*100000)            #Young's modulus of copper tube,N/mm^2

di=float(25)                           #internal diameter,mm
de=float(40)                           #external diameter,mm

As=pi*pow(di,2)/4               #Area of steel rod,mm^2
Ac=pi*(pow(de,2)-pow(di,2))/4   #Area of copper tube,mm^2
P=120                           #load, KN
#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel rod and Pc is the load shared by the copper tube.
#From compatibility condition,deltaS=deltaC

Pc=(P*1000)/(1+((As*Es)/(Ac*Ec)))
Ps=Pc*((As*Es)/(Ac*Ec))

SIC=Pc/Ac            #stress in copper, N/mm^2
SIS=Ps/As            #stress in steel,N/mm^2

print "stress in Copper=",round(SIC,2),"N/mm^2"
print "stress in Steel=",round(SIS,2),"N/mm^2"
stress in Copper= 75.76 N/mm^2
stress in Steel= 126.27 N/mm^2

example 8.21 page number 266

In [96]:
from math import pi

#variable declaration
#Es/Ec=18(given)
Er=float(18)                #young modulus ratio Er=Es/Ec
d=float(16)                           #steel bar diameter,mm
#8 steel bars
As=8*pi*pow(d,2)/4               #Area of steel bar,mm^2
Ac=(300*500)-As                      #Area of concrete,mm^2

P=800                           #Compressive force, KN
#From equation of equilibrium, Ps+Pc=P,where Ps is the load shared by steel bar and Pc is the load shared by the Concrete
#From compatibility condition,deltaS=deltaC

Pc=(P*1000)/(1+((As*Er)/(Ac)))
Ps=Pc*((As*Er)/(Ac))

SIC=Pc/Ac            #stress in Concrete, N/mm^2
SIS=Ps/As            #stress in steel,N/mm^2

print "stress in Concrete=",round(SIC,2),"N/mm^2"
print "stress in Steel=",round(SIS,2),"N/mm^2"
stress in Concrete= 4.51 N/mm^2
stress in Steel= 81.2 N/mm^2

example 8.22 page number 267

In [97]:
#variable declaration

Es=float(2*100000)              #Young's modulus of steel  ,N/mm^2
Ea=float(1*100000)            #Young's modulus of aluminium,N/mm^2
Ls=240                        #length of steel,mm
La=160                        #length of aluminium,mm
Aa=1200               #Area of aluminium,mm^2
As=1000               #Area of steel,mm^2
P=250                           #load, KN
#From equation of equilibrium, Ps+2Pa=P,et force shared by each aluminium pillar be Pa and that shared by steel pillar be Ps. 
#From compatibility condition,deltaS=deltaC

Pa=(P*1000)/(2+((As*Es*La)/(Aa*Ea*Ls)))
Ps=Pa*((As*Es*La)/(Aa*Ea*Ls))

SIA=Pa/Aa            #stress in aluminium, N/mm^2
SIS=Ps/As            #stress in steel,N/mm^2

print "stress in Aluminium=",round(SIA,2),"N/mm^2"
print "stress in Steel=",round(SIS,2),"N/mm^2"
stress in Aluminium= 66.96 N/mm^2
stress in Steel= 89.29 N/mm^2

example 8.23 page number 268

In [98]:
from math import pi

#variable declaration

# Let the force shared by bolt be Ps and that by tube be Pc. Since there is no external force, static equilibrium condition gives Ps + Pc = 0 or Ps = – Pc i.e., the two forces are equal in magnitude but opposite in nature. Obviously bolt is in tension and tube is in compression.
#Let the magnitude of force be P. Due to quarter turn of the nut

#[Note. Pitch means advancement of nut in one full turn] 

Ls=float(600)                      #length of whole assembly,mm
Lc=float(600)                      #length of whole assembly,mm
delta=float(0.5)
ds=float(20)                       #diameter,mm
di=float(28)                       #internal diameter,mm
de=float(40)                       #external diameter,mm
Es=float(2*100000)                 #Young's modulus, N/mm^2
Ec=float(1.2*100000)
As=pi*pow(ds,2)/4                  #area of steel bolt,mm^2
Ac=pi*(pow(de,2)-pow(di,2))/4      #area of copper tube,mm^2

P= (delta*(1/Ls))/((1/(As*Es))+(1/(Ac*Ec))) #Load,N

ps=P/As                          #stress,N/mm^2
pc=P/Ac                          #copper,N/mm^2

print "ps=",round(ps,2),"N/mm^2"
print "pc=",round(pc,2),"N/mm^2"
ps= 91.73 N/mm^2
pc= 44.96 N/mm^2

example 8.24 page number 271

In [99]:
#variable declaration
E=float(2*100000)               #Young's modulus,N/mm^2
alpha=float(0.000012)       #expansion coeffecient,/°c
L=float(12)                     #length,m
t=float(40-18)                  #temperature difference,°c

delta=alpha*t*L*1000          #free expansion of the rails,mm    
# Provide a minimum gap of 3.168 mm between the rails, so that temperature stresses do not develop
       
# a) If no expansion joint is provided, free expansion prevented is equal to 3.168 mm.

#delta=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area 

p1=(delta*E)/(L*1000)     #stress developed , N/mm^2

print "(a) p=", round(p1,1),"	N/mm^2"

#(b) If a gap of 1.5 mm is provided, free expansion prevented delta2 = 3.168 – 1.5 = 1.668 mm.

delta2=1.668       #mm
#delta2=(P*L)/(A*E) & p=P/A where p is stress, P,A is load,area 

p2=(delta2*E)/(L*1000)     #stress developed , N/mm^2

print "(b) p=", round(p2,1),"	N/mm^2"

# If the stress developed is 20 N/mm2, then p = P/ A
p3=20                      #stress developed,N/mm^2
delta3=delta-(p3*L*1000/E)

print " (iii) delta=",round(delta3,3),"mm"
(a) p= 52.8 	N/mm^2
(b) p= 27.8 	N/mm^2
 (iii) delta= 1.968 mm

example 8.25 page number 272

In [100]:
from math import pi

#variable declaration

# Let D be the diameter of ring after heating and ‘d’ be its diameter before heating
D=float(1.2*1000)                #mm

#Circumference of ring after heating Ca= pi*D & Circumference of ring before heating Cb= pi*d

Ca=pi*D
Cb=pi*d
alphas=float(0.000012)            #coefficient of expansion,/°C
t=150                             #temperature change,°C
Es=2*100000                        #young's modulus,N/mm^2
d=(Ca-Cb)/(alphas*t*pi)

#when it cools expansion prevented
#delta=pi*(D-d)
delta=alphas*t*pi*d

p=(delta*Es)/(pi*d)              #stress,N/mm^2

print "stress p=",round(p,2),"N/mm^2"
stress p= 360.0 N/mm^2

example 8.26 page number 272

In [101]:
#variable declaration

Ea=70*1000              #Young's modulus of aluminium,N/mm^2
Es=200*1000             #Young's modulus of steel,N/mm^2

alphaa=float(0.000011)  #expansion coefficient,/°C
alphas=float(0.000012)  #expansion coefficient,/°C

Aa=600                  #Area of aluminium portion,mm^2
As=400                  #Area of steel, mm^2
La=float(1.5)                  #length of aluminium portion,m
Ls=float(3.0)                  #length of steel portion,m
t=18                           #temperature,°C

delta=(alphaa*t*La*1000)+(alphas*t*Ls*1000)      #mm

P=(delta)/(((La*1000)/(Aa*Ea))+((Ls*1000)/(As*Es)))

print "P=" ,round(P,1),"N"
P= 12907.3 N

example8.27 page number 273

In [102]:
from math import pi

#variable declaration

d1=float(25)                 # variation linearly in diameter from 25 mm to 50 mm 
d2=float(50)
L=float(500)                 #length,mm
alpha=float(0.000012)        #expansion coeffecient,/°C
t=25                  #rise in temperture,°C
E=2*100000            #Young's modulus,N/mm^2

delta=alpha*t*L

#If P is the force developed by supports, then it can cause a contraction of 4*P*L/(pi*d1*d2*E)

P=(delta*pi*d1*d2*E)/(4*L)
Am=pi*pow(d1,2)/4
Ms=P/Am

print "Corresponding maximum stress = ",round(Ms,1),"N/mm^2"
Corresponding maximum stress =  120.0 N/mm^2

example 8.28 page number 275

In [103]:
from math import pi

#variable declaration

Db=float(20)                     #diameter of brass rod,mm
Dse=float(40)                    #external diameter of steel tube,mm
Dsi=float(20)                    #internal diameter of steel tube,mm
Es=float(2*100000 )              #Young's modulus steel, N/mm^2
Eb=float(1*100000 )              #Young's modulus brass, N/mm^2
alphas=float(0.0000116)          #coeffcient of expansion of steel,/°C
alphab=float(0.0000187)          #coeffcient of expansion of brass,/°C
t=60                             #raise in temperature, °C
As=pi*(pow(Dse,2)-pow(Dsi,2))/4  #Area of steel tube, mm^2
Ab=pi*(pow(Db,2))/4                #Area of brass rod,mm^2
L=1200                           #length,mm
#Since free expansion of brass  is more than free expansion of steel , compressive force Pb develops in brass and tensile force Ps develops in steel to keep the final position at CC 

#Horizontal equilibrium condition gives Pb = Ps, say P. 

P=((alphab-alphas)*t*L)/((L/(As*Es))+(L/(Ab*Eb)))

ps=P/As
pb=P/Ab

print "stress in steel=",round(ps,2),"N/mm^2"
print "Stress in brass=",round(pb,2),"N/mm^2"

#the pin resist the force P at the two cross- sections at junction of two bars.

Shearstress=P/(2*Ab)
print "Shear stress in pin",round(Shearstress,2),"N/mm^2"
stress in steel= 12.17 N/mm^2
Stress in brass= 36.51 N/mm^2
Shear stress in pin 18.26 N/mm^2

example 8.29 page number 276

In [104]:
#variable declaration

L=float(1000)                     #length of the bar at normal temperature,mm
As=float(50*10)                   #Area of steel,mm^2
Ac=float(40*5)                    #Area of copper,mm^2
#Ac = Free expansion of copper  is greater than free expansion of steel  . To bring them to the same position, tensile force Ps acts on steel plate and compressive force Pc acts on each copper plate. 
alphas=float(0.000012)                   #Expansion of coeffcient of steel,/°C
alphac=float(0.000017 )                  #Expansion of coeffcient of copper,/°C
t=80                              #raise by temperature, °C
Es=2*100000                       #Young's modulus of steel,N/mm^2
Ec=1*100000                       #Young's modulus of copper,N/mm^2
Pc=((alphac-alphas)*t*L)/((2*L/(As*Es)) +(L/(Ac*Ec)))
Ps=2*Pc

pc=Pc/Ac                          #Stress in copper,N/mm^2
ps=Ps/As                          #Stress in steel, N/mm^2

Changeinlength=alphas*t*L+(Ps*L/(As*Es))


print"Change in length=",round(Changeinlength,2),"mm"
Change in length= 1.07 mm

example 8.30 page number 278

In [105]:
#variable declaration

p=float(2)                   #internal pressure, N/mm^2
t=12                   #thickness of thin cylinder,mm
D=float(1000)                 #internal diameter,mm

f=(p*D)/(2*t)          #Hoop stress,N/mm^2

print "Hoop stress f=",round(f,2),"N/mm^2"
Hoop stress f= 83.33 N/mm^2