summaryrefslogtreecommitdiff
path: root/Mechanics_of_Materials_by_James_M._Gere/chapter7.ipynb
blob: 3bf957bb7696f3e7e0a227d0c55ada152f429464 (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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
{
 "metadata": {
  "name": "",
  "signature": "sha256:79553db761abdf4228d341c670873d408edd8ca0894b0f7f1ee9a5c598382141"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7: Analysis of Stress and Strain"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1, page no. 472"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math \n",
      "\n",
      "sx = 16000                          # Direct stress in x-direction in psi\n",
      "sy = 6000                           # Direct stress in y-direction \"\"\n",
      "txy = 4000                          # Shear stress in y-direction \"\"\n",
      "tyx = txy                           # Shear stress in x-direction \"\"\n",
      "t = 45                              # Inclination pf plane in degree \n",
      "\n",
      "#calculation\n",
      "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\n",
      "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\n",
      "tx1y1 =  - ((sx-sy)*(math.sin(math.radians(2*t))/2.0)) + txy*math.cos(math.radians(2*t))    # Shear stress in psi\n",
      "\n",
      "print \"The direct stress on the element in x1-direction is\", sx1, \"psi\"\n",
      "print \"The direct stress on the element in y1-direction is\", sy1, \"psi\"\n",
      "print \"The shear stress on the element\", tx1y1, \"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The direct stress on the element in x1-direction is 15000.0 psi\n",
        "The direct stress on the element in y1-direction is 7000.0 psi\n",
        "The shear stress on the element -5000.0 psi\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2, page no. 473"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math \n",
      "\n",
      "sx = -46e06                     # Direct stress in x-direction in Pa\n",
      "sy = 12e06                      # Direct stress in y-direction \"\"\n",
      "txy = -19e06                    # Shear stress in y-direction \"\"\n",
      "t = -15                         # Inclination of plane in degree \n",
      "\n",
      "#calculation\n",
      "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\n",
      "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\n",
      "tx1y1 = -((sx-sy)*(math.sin(math.radians(2*t))/2.0)) + txy*math.cos(math.radians(2*t))             # Shear stress in Pa\n",
      "\n",
      "\n",
      "print \"The direct stress on the element in x1-direction is\", sx1, \"Pa\"\n",
      "print \"The direct stress on the element in y1-direction is\", sy1, \"Pa\"\n",
      "print \"The shear stress on the element\", tx1y1, \"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The direct stress on the element in x1-direction is -32614736.7097 Pa\n",
        "The direct stress on the element in y1-direction is -1385263.29025 Pa\n",
        "The shear stress on the element -30954482.6719 Pa\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 7.3, page no. 481"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "ax = 12300.0\n",
      "ay = -4200.0\n",
      "txy = -4700.0\n",
      "\n",
      "tan_2p = round((2*txy)/(ax-ay), 4)\n",
      "\n",
      "theta_p1 = 150.3\n",
      "theta_p2 = 330.3\n",
      "\n",
      "stress1 = (ax+ay)/2.0\n",
      "stress2 = (ax-ay)/2.0\n",
      "a1 = stress1 + math.sqrt((stress2**2.0)+(txy**2.0))\n",
      "a2 = stress1 - math.sqrt((stress2**2.0)+(txy**2.0))\n",
      "\n",
      "#python calculations differ a bit. hence, differences in the answer\n",
      "print \"Principal stesses are \", round(a1), \"psi and \", round(a2), \" psi\"\n",
      "\n",
      "tmax = math.sqrt((stress2**2.0)+(txy**2.0))\n",
      "print \"Maximum shear stress is \", round(tmax), \" psi\"\n",
      "\n",
      "a_aver = (ax+ay)/2.0\n",
      "\n",
      "print \"Normal stress acting at maximum shear stress = \", round(a_aver), \"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Principal stesses are  13545.0 psi and  -5445.0  psi\n",
        "Maximum shear stress is  9495.0  psi\n",
        "Normal stress acting at maximum shear stress =  4050.0 psi\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4, page no. 492"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "sx = 90e06                      # Direct stress in x-direction in Pa\n",
      "sy = 20e06                      # Direct stress in y-direction in Pa\n",
      "t = 30                          # Inclination of element in degree\n",
      "\n",
      "#calculation\n",
      "savg = (sx+sy)/2.0                                  # Average in-plane direct stress\n",
      "txy = 0 \n",
      "R = math.sqrt(((sx-sy)/2)**2+(txy)**2)              # Radius of mohr circle\n",
      "\n",
      "# Point D  at 2t = 60\n",
      "sx1 = savg + R*math.cos(math.radians(2*t))          # Direct stress at point D \n",
      "tx1y1 = -R*math.sin(math.radians(2*t))              # shear stress at point D\n",
      "print \"The direct stress at point D is\", sx1, \"Pa\"\n",
      "print \"The shear stress at point D is\", tx1y1, \"Pa\"\n",
      "\n",
      "# Point D  at 2t = 240\n",
      "sx2 = savg + R*math.cos(math.radians(90 + t))       # Direct stress at point D \n",
      "tx2y2 = R*math.sin(math.radians(90 + t))            # shear stress at point D\n",
      "print \"The direct stress at point D_desh is\", sx2, \"Pa\"\n",
      "print \"The shear stress at point D_desh is\", tx2y2, \"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The direct stress at point D is 72500000.0 Pa\n",
        "The shear stress at point D is -30310889.1325 Pa\n",
        "The direct stress at point D_desh is 37500000.0 Pa\n",
        "The shear stress at point D_desh is 30310889.1325 Pa\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5, page no. 494"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "import numpy\n",
      "\n",
      "#initialisation \n",
      "sx = 15000                              # Direct stress in x-direction in psi\n",
      "sy = 5000                               # Direct stress in y-direction \"\"\n",
      "txy = 4000                              # Shear stress in y-direction \"\"\n",
      "savg = (sx+sy)/2.0                        # Average in-plane direct stress\n",
      "sx1 = 15000                             # Stress acting on face at theta = 0 degree\n",
      "tx1y1 = 4000                            # Stress acting on face at theta = 0 degree\n",
      "sx1_ = 5000                             \n",
      "tx1y1_ = -4000                          \n",
      "\n",
      "#calculation\n",
      "R = math.sqrt(((sx-sy)/2)**2+(txy)**2)              # Radius of mohr circle\n",
      "\n",
      "# Part (a)\n",
      "t = 40                                              # Inclination of the plane in degree\n",
      "f1 = numpy.degrees(numpy.arctan((4000.0/5000.0)))     # Angle between line CD and x1-axis\n",
      "f2 = 80 - f1                                        # Angle between line CA and x1-axis\n",
      "\n",
      "# Point D  \n",
      "sx1 = savg + R*math.cos(math.radians(f2))       # Direct stress at point D \n",
      "tx1y1 = -R*math.sin(math.radians(f2))           # shear stress at point D\n",
      "print \"The shear stress at point D\", round(tx1y1), \"psi\"\n",
      "\n",
      "# Point D'  \n",
      "sx2 = savg - R*math.cos(math.radians(f2))       # Direct stress at point D' \n",
      "tx2y2 = R*math.sin(math.radians(f2))            # shear stress at point D'\n",
      "print \"The direct stres at point D_desh\", round(sx2), \"psi\"\n",
      "\n",
      "#Part (b)\n",
      "sp1 = savg + R                                      # Maximum direct stress in mohe circle (at point P1)\n",
      "tp1 = f1/2                                          # Inclination of plane of maximum direct stress\n",
      "print \"with angle\",round(tp1,2) , \"degree The maximum direct stress at P1 is \",sp1 , \"psi\"\n",
      "sp2 =  savg - R  # Minimum direct stress in mohe circle (at point P2)\n",
      "tp2 = (f1+180)/2  # Inclination of plane of minimum direct stress\n",
      "print \"with angle\", round(tp2,2), \"degree The maximum direct stress at P2 is \",sp2 , \"psi\"\n",
      "\n",
      "# Part (c)\n",
      "tmax = R                                            # Maximum shear stress in mohe circle\n",
      "ts1 = -(90 - f1)/2.0                                # Inclination of plane of maximum shear stress\n",
      "print \"with plane incilation of\", tmax, \"psi The Maximum shear stress is \", round(ts1,2), \"deegree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The shear stress at point D -4229.0 psi\n",
        "The direct stres at point D_desh 5193.0 psi\n",
        "with angle 19.33 degree The maximum direct stress at P1 is  16403.1242374 psi\n",
        "with angle 109.33 degree The maximum direct stress at P2 is  3596.87576257 psi\n",
        "with plane incilation of 6403.12423743 psi The Maximum shear stress is  -25.67 deegree\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6, Page number 497"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math \n",
      "import numpy\n",
      "\n",
      "\n",
      "sx = -50e06                                 # Direct stress in x-direction in psi\n",
      "sy = 10e06                                  # Direct stress in y-direction \"\"\n",
      "txy = -40e06                                # Shear stress in y-direction \"\"\n",
      "savg = (sx+sy)/2                            # Average in-plane direct stress\n",
      "sx1 = -50e06\n",
      "tx1y1 = -40e06                              # Stress acting on face at theta = 0 degree\n",
      "sx1_ = 10e06\n",
      "tx1y1_ = 40e06                              # Stress acting on face at theta = 0 degree\n",
      "\n",
      "#calculation\n",
      "R = math.sqrt(((sx-sy)/2)**2+(txy)**2)      # Radius of mohr circle\n",
      "\n",
      "# Part (a)\n",
      "t = 45                                                  # Inclination of the plane in degree\n",
      "f1 = numpy.degrees(numpy.arctan((40e06/30e06)))       # Angle between line CD and x1-axis\n",
      "f2 = 90 - f1  # Angle between line CA and x1-axis\n",
      "\n",
      "# Point D  \n",
      "sx1 = savg - R*math.cos(math.radians(f2))           # Direct stress at point D \n",
      "tx1y1 = R*math.sin(math.radians(f2))                # shear stress at point D\n",
      "print \"The direct stres at point D\", sx1, \"Pa\"\n",
      "print \"The shear stress at point D\", tx1y1, \"Pa\"\n",
      "\n",
      "# Point D'  \n",
      "sx2 = savg + R*math.cos(math.radians(f2))           # Direct stress at point D' \n",
      "tx2y2 = -R*math.sin(math.radians(f2))               # shear stress at point D'\n",
      "print \"The direct stres at point D_desh\", sx2, \"Pa\"\n",
      "print \"The shear stress at point D_desh\", tx2y2, \"Pa\"\n",
      "\n",
      "#Part (b)\n",
      "sp1 =  savg + R                                         # Maximum direct stress in mohe circle (at point P1)\n",
      "tp1 =(f1+180)/2                                         # Inclination of plane of maximum direct stress\n",
      "print \"with angle\", round(tp1,2), \"degree\", \"The maximum direct stress at P1 is \",  sp1, \"Pa\" \n",
      "sp2 =  savg - R                                         # Minimum direct stress in mohe circle (at point P2)\n",
      "tp2 = f1/2                                              # Inclination of plane of minimum direct stress\n",
      "print \"with angle\", round(tp2,2), \"degree\", \"The maximum direct stress at P2 is \", sp2, \"Pa\"\n",
      "\n",
      "# Part (c)\n",
      "tmax = R                                                # Maximum shear stress in mohe circle\n",
      "ts1 = (90 + f1)/2                                       # Inclination of plane of maximum shear stress\n",
      "print \"with plane incilation of\", round(ts1,2), \"degree\", \"The Maximum shear stress is \", tmax, \"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The direct stres at point D -60000000.0 Pa\n",
        "The shear stress at point D 30000000.0 Pa\n",
        "The direct stres at point D_desh 20000000.0 Pa\n",
        "The shear stress at point D_desh -30000000.0 Pa\n",
        "with angle 116.57 degree The maximum direct stress at P1 is  30000000.0 Pa\n",
        "with angle 26.57 degree The maximum direct stress at P2 is  -70000000.0 Pa\n",
        "with plane incilation of 71.57 degree The Maximum shear stress is  50000000.0 Pa\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7, page no. 520"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "import numpy\n",
      "\n",
      "#initialisation\n",
      "\n",
      "ex = 340e-06                            # Strain in x-direction\n",
      "ey = 110e-06                            # Strain in y-direction\n",
      "txy = 180e-06                           # shear strain\n",
      "\n",
      "\n",
      "# Part (a)\n",
      "t = 30                                      # Inclination of the element in degree\n",
      "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)\n",
      "tx1y1 = 2*(-((ex-ey)/2.0)*math.sin(math.radians(2*t)) + (txy/2.0)*(math.cos(math.radians(2*t))))                # Shear starin\n",
      "ey1 = ex+ey-ex1                             # Strain in y1 direction (located at 30 degree)\n",
      "print \"Strain in x1 direction (located at 30 degree) is\", round((ex1/1E-6),2),\"* 10^-6\"\n",
      "print \"shear strain is\", round((tx1y1/1E-6),2),\"* 10^-6\"\n",
      "print \"Strain in y1 direction (located at 30 degree) is\", ey1\n",
      "\n",
      "# Part (b)\n",
      "e1 = (ex+ey)/2.0 + math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress\n",
      "e2 = (ex+ey)/2.0 - math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2) # Principle stress\n",
      "tp1 = (0.5)*numpy.degrees(numpy.arctan((txy/(ex-ey)))) # Angle to principle stress direction\n",
      "tp2 = 90 + tp1  # Angle to principle stress direction\n",
      "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\n",
      "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\n",
      "print \"with angle\", round(tp1,2), \"degree\",\"The Principle stress is \", round(e1,4)\n",
      "print \"with angle\",round(tp2,2), \"degree\",\"The Principle stress is \",round(e2,4)\n",
      "\n",
      "# Part (c)\n",
      "tmax = 2*math.sqrt(((ex-ey)/2.0)**2 + (txy/2.0)**2)         # Maxmum shear strain\n",
      "ts = tp1 + 45                                               # Orientation of element having maximum shear stress \n",
      "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\n",
      "print \"with angle\",round(ts,2), \"degree\",\"The Maximum shear strain is \",round(tx1y1_,4)\n",
      "eavg = (e1+e2)/2.0                                          # Average atrain\n",
      "print \"The average strain is\", eavg"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Strain in x1 direction (located at 30 degree) is 360.44 * 10^-6\n",
        "shear strain is -109.19 * 10^-6\n",
        "Strain in y1 direction (located at 30 degree) is 8.95577136594e-05\n",
        "with angle 19.02 degree The Principle stress is  0.0004\n",
        "with angle 109.02 degree The Principle stress is  0.0001\n",
        "with angle 64.02 degree The Maximum shear strain is  -0.0003\n",
        "The average strain is 0.000225\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}