summaryrefslogtreecommitdiff
path: root/Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_9.ipynb
blob: 898a6e794d12376a7d63eaf58b4b1e0fe2be1386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chaper 3:Generalized hooke's law, Pressure vessels and Thick walled cylinders"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.1 page number 141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the stiffness constant is  64.0 N/mm\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "from numpy.random import randn\n",
    "th = 8     #mm - thickness \n",
    "G =  0.64  #N/mm2 -shear modulus\n",
    " \n",
    "a = 40     #mm length\n",
    "b = 20     #mm width \\\n",
    "Area = a*b #mm2\n",
    "e =  randn()   # lets say any random vale\n",
    "strain =  e/th # strain in shearing case\n",
    "#caliculations\n",
    "\n",
    "stress =G*strain\n",
    "F = stress*Area\n",
    "#stiffness =  froce/displacement\n",
    "k = F/e #N/mm\n",
    "print \"the stiffness constant is \",k,\"N/mm\"\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.2 page number 149"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The change in the dimension between parallel faces is  -0.025 mm\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "a = 50          #mm - length of a cube\n",
    "E =  200        # Gpa - the youngs modulus \n",
    "v =  0.25       # no units- poissions ratio \n",
    "pressure =  200 # Mpa - pressure acting on all sides \n",
    "#pressure is a compressive stress \n",
    "S_x = -200 # Gpa - The stress in X direction \n",
    "S_y = -200 # Gpa - The stress in Y direction\n",
    "S_z = -200 # Gpa - The stress in Z direction\n",
    "#Caliculations\n",
    "\n",
    "e = S_x*pow(10,-3)/E - v*S_y*pow(10,-3)/E-v*S_z*pow(10,-3)/E#mm - considering all three directions \n",
    "x = e*a #mmThe change in the dimension between parallel faces\n",
    "print \"The change in the dimension between parallel faces is \",x,\"mm\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.3 page number 154"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Hoop stress is  80.0 mm\n",
      "The longitudinal stress is  40.0 mm\n",
      "The change in daimeter of the cylinder is 0.35 mm\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "R = 1000    # mm - radius of the cylinder \n",
    "t =  10     #mm - thickness of the cylinder\n",
    "p_in = 0.80 #Mpa- Internal pressure \n",
    "E = 200     #Mpa- youngs modulus \n",
    "v = 0.25    # poission ratio\n",
    "#caliculations\n",
    "\n",
    "Stress_1 = p_in*R/t     #Mpa -Hoop stress                    #From derived expressions \n",
    "Stress_2 = p_in*R/(2*t) #Mpa- Longitudinal stress \n",
    "e = Stress_1*pow(10,-3)/E-v*Stress_2*pow(10,-3)/E\n",
    "dia_change = e*R        #mm- The change in daimeter of the cylinder \n",
    "print \"The Hoop stress is \",Stress_1,\"mm\"\n",
    "print \"The longitudinal stress is \",Stress_2, \"mm\"\n",
    "print \"The change in daimeter of the cylinder is\",dia_change,\"mm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.4 page number 156"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The maximum stress is  40.0 mm\n",
      "The change in daimeter of the cylinder is 0.15 mm\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "R = 1000             #mm - radius of the cylinder\n",
    "th = 10              #mm - thickness of the cylinder\n",
    "E = 200              #Mpa- youngs modulus \n",
    "v = 0.25             # poission ratio\n",
    "p_in = 0.80          #Mpa- Internal pressure\n",
    "t =  10               #mm - thickness of the cylinder\n",
    "#caliculations\n",
    "\n",
    "Stress_1 = p_in*R/(2*t) #Mpa -Hoop stress                    #From derived expressions \n",
    "Stress_2 = p_in*R/(2*t) #Mpa- Longitudinal stress\n",
    "# Hoop stress and Longitudinal stress are same in this case\n",
    "e = Stress_1*pow(10,-3)/E-v*Stress_2*pow(10,-3)/E\n",
    "dia_change = e*R        #mm- The change in daimeter of the cylinder\n",
    "print \"The maximum stress is \",Stress_2, \"mm\"\n",
    "print \"The change in daimeter of the cylinder is\",dia_change,\"mm\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.5 page number 156"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The diameter of each bolt is 1.41985914794 mm\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "p_in = 0.7   #Mpa - internal pressure \n",
    "n_bolts = 20 # number of bolts \n",
    "dia = 650    #mm - bolt circle diameter \n",
    "stress_allow = 125 #mm Maximum alowable stress\n",
    "Stress_conc = 2    #stress concentration\n",
    "d = 25             #mm \n",
    "#caliculations\n",
    "\n",
    "F = p_in*3.14*pow(((dia-2*d)/2),2)*pow(10,6) #N\n",
    "F_each = F/n_bolts #N- force per each Bolt\n",
    "A = Stress_conc*F_each/(stress_allow*pow(10,-6)) #mm2 The bolt area \n",
    "Bolt_dia = 2*pow((round(A,3)/3.14),0.5)*pow(10,-7) #mm the bolt daimeter\n",
    "print \"The diameter of each bolt is\",Bolt_dia,\"mm\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3.6 page number 166"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The average stress in case a is 10.0238095238 p\n",
      "The average stress in case b is 0.133333333333 p\n"
     ]
    }
   ],
   "source": [
    "#Given\n",
    "from numpy.random import randn\n",
    "r_1 = randn()# let r_1 is a random number \n",
    "t =  0.1*r_1 #Thickness\n",
    "r_2 = r_1+t  #Outer Radius\n",
    "#caliculations\n",
    "\n",
    "stress_1_a=  ((r_1**2)/((r_2**2)-(r_1**2)))*(1+((r_2**2)/(r_1**2)))#p -r =r_2\n",
    "stress_2_a=  ((r_1**2)/((r_2**2)-(r_1**2)))*(1+((r_2**2)/(r_2**2)))#p -r =r_1\n",
    "stress_avg_a=(stress_1_a+stress_2_a)/2 #p\n",
    "print \"The average stress in case a is\",stress_avg_a,\"p\"\n",
    "\n",
    "#Case-B\n",
    "#Given\n",
    "r_1 = randn()# let r_1 is a random number \n",
    "r_2_b= 4*r_1 \n",
    "#caliculations\n",
    "\n",
    "stress_1_b =  ((r_1**2)/((r_2_b**2)-(r_1**2)))*(1+((r_2_b**2)/(r_1**2)))#p -r =r_2\n",
    "stress_2_b=  ((r_1**2)/((r_2_b**2)-(r_1**2)))*(1+((r_2_b**2)/(r_2_b**2)))#p -r =r_1\n",
    "stress_avg_b=(stress_1_b+stress_2_b)/2 #p\n",
    "print \"The average stress in case b is\",stress_2_b,\"p\"\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}