summaryrefslogtreecommitdiff
path: root/Mechanics_of_Materials_by_Pytel_and_Kiusalaas/Chapter02_3.ipynb
blob: cd669b4ff82260ee086224f44a6320b54be18fc2 (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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
{
 "metadata": {
  "name": "",
  "signature": "sha256:3cb8e8b65ee50988938562d2f6cd882ccb93a3ca89c523d4423804cd1b6898ff"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 02:Strain"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Examples No:2.2.1, Page No:36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "#Axial Forces in lb in member AB, BC and CD\n",
      "P_AB=2000 \n",
      "P_BC=2000\n",
      "P_CD=4000\n",
      "#Other Variables\n",
      "E=29*10**6 #Modulus of Elasticity in psi\n",
      "#Length of each member in inches\n",
      "L_AB=5*12\n",
      "L_BC=4*12\n",
      "L_CD=4*12\n",
      "#Diameter of each member in inches\n",
      "D_AB=0.5\n",
      "D_BC=0.75\n",
      "D_CD=0.75\n",
      "\n",
      "#Calculation\n",
      "#Area Calculation of each member in square inches\n",
      "A_AB=(pi*D_AB**2)/4\n",
      "A_BC=(pi*D_BC**2)/4\n",
      "A_CD=(pi*D_CD**2)/4\n",
      "\n",
      "#Using relation delta=(PL/AE) to compute strain\n",
      "#As stress in Member CD is compression\n",
      "delta=(E**-1)*((P_AB*L_AB*A_AB**-1)+(P_BC*L_BC*A_BC**-1)-(P_CD*L_CD*A_CD**-1))\n",
      "\n",
      "#Result\n",
      "print \"The elongation in the total structure is\",round(delta,5),\"in\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elongation in the total structure is 0.01358 in\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.2, Page No:36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from scipy.integrate import quad\n",
      "\n",
      "#Variable Decleration\n",
      "E=200*10**9 #Modulus of elasticity in Pa\n",
      "P=10**5 #Force acting in N\n",
      "\n",
      "#Calculations\n",
      "#Using quad integration\n",
      "#Area has been defined as a quadratic equation to integrate\n",
      "def integrand(x, a, b):\n",
      "    return 1/(a * x + b)\n",
      "a = 160\n",
      "b = 800\n",
      "I = quad(integrand, 0, 10, args=(a,b))\n",
      "#Using delta=(P/E)*I    where I is the integrand\n",
      "delta=(P*E**-1)*10**6*I[0]\n",
      "\n",
      "#Result\n",
      "print \"The elongation in the member is\",round(delta*1000,2),\"mm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elongation in the member is 3.43 mm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.3, Page No:37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decelration\n",
      "A_AC=0.25 #Cross Sectional Area in square inch\n",
      "Load=2000 #Load at point C in lb\n",
      "E=29*10**6 #Modulus of elasticity in psi\n",
      "theta=(pi*40)/180 #Angle in radians\n",
      "L_BC=8 #Length in ft\n",
      "\n",
      "#Calculations\n",
      "#Using sum of forces \n",
      "P_AC=Load/sin(theta) #Force in cable AC in lb\n",
      "L_AC=(L_BC*12)/cos(theta) #Length of cable AC in in\n",
      "\n",
      "delta_AC=(P_AC*L_AC)/(E*A_AC) #elongation in inches\n",
      "\n",
      "delta_C=delta_AC/sin(theta) #displacement of point C in inches\n",
      "\n",
      "#Result\n",
      "print \"The displacement of point C is\",round(delta_C,4),\"in\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The displacement of point C is 0.0837 in\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.4, Page No:46"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "d=0.05 #Diameter of the rod in mm\n",
      "P=8000 #Load on the bar in N\n",
      "E=40*10**6 #Modulus of elasticity in Pa\n",
      "v=0.45 #Poisson Ratio\n",
      "L=300 #Length of the rod in mm\n",
      "\n",
      "#Calculation\n",
      "A=((pi*d**2)/4) #Area of the bar in mm^2\n",
      "sigma_x=-P/A #Axial Stress in the bar in Pa\n",
      "#As contact pressure resists the force\n",
      "p=(v*sigma_x)/(1-v)\n",
      "#Using Axial Strain formula\n",
      "e_x=(sigma_x-(v*2*p))/E\n",
      "#Corresponding change in length\n",
      "delta=e_x*L #contraction in mm\n",
      "#Without constrains of the wall\n",
      "delta_w=(-P*(L*10**-3))/(E*A) #Elongation in m\n",
      "\n",
      "#Result\n",
      "print \"The elongation in the bar is\",-round(delta,2),\"mm contraction\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elongation in the bar is 8.06 mm contraction\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.5, Page No:47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "E=500 #Modulus of elasticity in psi\n",
      "v=0.48 #Poisson ratio\n",
      "V=600 #Force in lb\n",
      "w=5 #Width of the plate in inches\n",
      "l=9 #Length of the plate in inches\n",
      "t=1.75 #Thickness of the rubber layer in inches\n",
      "\n",
      "#Calculations\n",
      "tau=V*(w*l)**-1 #Shear stress in rubber in psi\n",
      "G=E/(2*(1+v)) #Bulk modulus in psi\n",
      "gamma=tau/G #Shear Modulus \n",
      "disp=t*gamma #Diplacement in inches\n",
      "\n",
      "#Result\n",
      "print \"The displacement of the rubber layer is\",round(disp,4),\"in\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The displacement of the rubber layer is 0.1381 in\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.6, Page No:52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "P=10**6 #Force on the member in N\n",
      "Es=200 #Modulus of elasticity of steel in GPa\n",
      "Ec=14 #Modulus of elasticity concrete in GPa\n",
      "As=900*10**-6 #Area of steel in m^2\n",
      "Ac=0.3**2 #Area of concrete block in m^2\n",
      "\n",
      "#Calculation\n",
      "#Cross Sectional Areas\n",
      "Ast=4*As #Cross Sectional Area in m^2 of Steel\n",
      "Act=Ac-Ast #Cross Sectional Area of Concrete in m^2\n",
      "\n",
      "#Applying equilibrium to the structure\n",
      "#Using the ratio of stress and modulii of elasticity we obtain the following eq\n",
      "sigma_ct=P/(((Es*Ec**-1)*Ast)+Act) #Stress in Concrete in Pa\n",
      "sigma_st=sigma_ct*Es*Ec**-1 #Stress in Steel in Pa\n",
      "\n",
      "#Result\n",
      "print \"The stress in steel and concrete is as follows\",round(sigma_st*10**-6,1),\"MPa and\",round(sigma_ct*10**-6,3),\"Mpa respectively\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress in steel and concrete is as follows 103.6 MPa and 7.255 Mpa respectively\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.7, Page No:52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "#Say the ratio of stress in steel to concrete is R\n",
      "R=14.286 \n",
      "sigma_co=6*10**6 #Stress in concrete in Pa\n",
      "Ast=3.6*10**-3 #Area of steel in m^2\n",
      "Aco=86.4*10**-3 #Area of Concrete in m^2\n",
      "\n",
      "#Calculation\n",
      "sigma_st=R*sigma_co #Stress in steel in Pa\n",
      "#Here stress is below the allowable hence safe\n",
      "P=sigma_st*Ast+sigma_co*Aco #Allowable force in N\n",
      "\n",
      "#Result\n",
      "print \"The maximum allowable force is\",round(P*10**-3),\"kN\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum allowable force is 827.0 kN\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.8, Page No:53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#NOTE:The NOtation has been changed to ease coding\n",
      "#Variable Decleration\n",
      "d=0.005 #difference in length in inch\n",
      "L=10 #Length in inch\n",
      "#Area of copper and aluminium in sq.in\n",
      "Ac=2 #Area of copper \n",
      "Aa=3 #Area of aluminium \n",
      "#Modulus of elasticity of copper and aluminium in psi\n",
      "Ec=17000000 #Copper\n",
      "Ea=10**7 #Aluminium\n",
      "#Allowable Stress in psi\n",
      "Sc=20*10**3 #Copper\n",
      "Sa=10*10**3 #Aluminium\n",
      "\n",
      "#Calculation\n",
      "#Equilibrium is Pc+Pa=P\n",
      "#Hookes Law is delta_c=delta_a+0.005\n",
      "#Simplfying the solution we have constants we can directly compute\n",
      "A=d*Ec*(L+d)**-1\n",
      "B=Ec*Ea**-1\n",
      "C=L*B*(L+d)**-1\n",
      "sigma_a=(Sc-A)*C**-1\n",
      "\n",
      "#Using equilibrium equation\n",
      "P=Sc*Ac+sigma_a*Aa #Safe load in lb\n",
      "\n",
      "#Result\n",
      "print \"The safe load on the structure is\",round(P),\"lb\"\n",
      "#NOTE:Answer in the textbook has been rounded off and hence the discrepancy"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The safe load on the structure is 60312.0 lb\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.9, Page No:54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy as np\n",
      "\n",
      "#Variable Decleration\n",
      "P=50*10**3 #Load applied in N\n",
      "x1=0.6 #Length in m\n",
      "x2=1.6 #Length in m\n",
      "L1=1 #Length of steel cable in m\n",
      "L2=2 #Length of bronze cable in m\n",
      "L=2.4 #Length in m\n",
      "#Area in m^2\n",
      "Ast=600*10**-6 #Steel\n",
      "Abr=300*10**-6 #Bronze\n",
      "#Modulus of elasticity in GPa\n",
      "Est=200 #Steel\n",
      "Ebr=83 #Bronze\n",
      "\n",
      "#Calculations\n",
      "#Applying the equilibrium and Hookes law we solve by matrix method\n",
      "a=np.array([[x1,x2],[1,-((x1*Est*Ast*L2)/(x2*Ebr*Abr))]])\n",
      "b=np.array([L*P,0])\n",
      "y=np.linalg.solve(a,b)\n",
      "\n",
      "#Stresses in Pa\n",
      "sigma_st=y[0]*Ast**-1 #Stress in steel\n",
      "sigma_br=y[1]/Abr #Stress in bronze\n",
      "\n",
      "#Result\n",
      "print \"The stresses in steel and bronze are as follows\"\n",
      "print round(sigma_st*10**-6,1),\"MPa and\",round(sigma_br*10**-6,1),\"MPa respectively\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stresses in steel and bronze are as follows\n",
        "191.8 MPa and 106.1 MPa respectively\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.10, Page No:62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "L=2.5 #Length in m\n",
      "A=1200 #Cross sectional Area in mm^2\n",
      "delta_T=40 #Temperature drop in degree C\n",
      "delta=0.5*10**-3 #Movement of the walls in mm\n",
      "alpha=11.7*10**-6 #Coefficient of thermal expansion in /degreeC\n",
      "E=200*10**9 #Modulus of elasticity in Pa\n",
      "\n",
      "#Calculation\n",
      "#Part(1)\n",
      "sigma_1=alpha*delta_T*E #Stress in the rod in Pa\n",
      "\n",
      "#Part(2)\n",
      "#Using Hookes Law\n",
      "sigma_2=E*((alpha*delta_T)-(delta*L**-1)) #Stress in the rod in Pa\n",
      "\n",
      "print \"The Stress in part 1 in the rod is\",round(sigma_1*10**-6,1),\"MPa\"\n",
      "print \"The Stress in part 2 in the rod is\",round(sigma_2*10**-6,1),\"MPa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Stress in part 1 in the rod is 93.6 MPa\n",
        "The Stress in part 2 in the rod is 53.6 MPa\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.11, Page No:63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "delta=100 #Increase in the temperature in degreeF\n",
      "Load=12000 #Load on the beam in lb\n",
      "#Length in inch\n",
      "Ls=2*12 #Steel\n",
      "Lb=3*12 #Bronze\n",
      "#Area in sq.in\n",
      "As=0.75 #Steel\n",
      "Ab=1.5 #Bronze\n",
      "#Modulus of elasticity in psi\n",
      "Es=29*10**6 #Steel\n",
      "Eb=12*10**6 #Bronze\n",
      "#Coefficient of thermal expansion in /degree C\n",
      "alpha_s=6.5*10**-6 #Steel\n",
      "alpha_b=10**-5 #Bronze\n",
      "\n",
      "#Calculations\n",
      "#Applying the Hookes Law and equilibrium we get two equations\n",
      "a=np.array([[Ls*(Es*As)**-1,-Lb*(Eb*Ab)**-1],[2,1]])\n",
      "b=np.array([(alpha_b*delta*Lb-alpha_s*delta*Ls),Load])\n",
      "y=np.linalg.solve(a,b)\n",
      "\n",
      "#Stresses\n",
      "sigma_st=y[0]*As**-1 #Stress in steel in psi (T)\n",
      "sigma_br=y[1]*Ab**-1 #Stress in bronze in psi (C)\n",
      "\n",
      "#Result\n",
      "print \"The Stress in steel and bronze are as follows\"\n",
      "print sigma_st,\"psi (T) and\", -sigma_br,\"psi (C)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Stress in steel and bronze are as follows\n",
        "11600.0 psi (T) and 3600.0 psi (C)\n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2.12, Page No:64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable Decleration\n",
      "P=6000 #Force in lb\n",
      "Est=29*10**6 #Modulus of elasticity of steel in psi\n",
      "L1=24 #Length in inches\n",
      "L2=36 #Length in inches\n",
      "alpha_1=6.5*10**-6 #coefficient of thermal expansion in /degree F of steel\n",
      "alpha_2=10**-5 #coefficient of thermal expansion in /degree F of bronze\n",
      "As=0.75 #Area os steel in sq.in\n",
      "\n",
      "#Calculations\n",
      "delta_T=((P*L1)/(Est*As))/(alpha_2*L2-alpha_1*L1) #Change in temperature in degree F\n",
      "\n",
      "print \"The change in the Temperature is\",round(delta_T,1),\"F\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in the Temperature is 32.5 F\n"
       ]
      }
     ],
     "prompt_number": 60
    }
   ],
   "metadata": {}
  }
 ]
}