summaryrefslogtreecommitdiff
path: root/Mechanics_of_Structures/Chapter1.ipynb
blob: 339836e54bec9ea21e478370c6f2ad6c1a5f5120 (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
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
{
 "metadata": {
  "name": "",
  "signature": "sha256:9ca9b2e0d1cc4391d74881e14e5e9fe9e8aa0cd9b6ad3418d2abbf628f065e94"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter1-Simple stresses and strains"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg 5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "#calculate the elongnation of the bar \n",
      "P = 5.5 ;##Axial pull in tons\n",
      "E = 13000 ;##modulus of elasticity tons/in^2\n",
      "l = 120 ;##length in inches\n",
      "A = math.pi/4. ;##Area of resisting section in^2\n",
      "p = P/A ;##Intensity of stress in tons/in^2\n",
      "e = p/E ;##strain\n",
      "delta_l =  l*e;##elongation of the bar in inches\n",
      "print'%s %.4f %s'%('The elongation of the bar is',delta_l,'inch');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elongation of the bar is 0.0646 inch\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the minimum diameter d of each stay bolt\n",
      "s_p = 200.;##steam pressure in lb/in^2\n",
      "l = 4.;##length in inches\n",
      "b = 4.;##breadth in inches\n",
      "p = 14000.;##permissible streaa in lb/in^2\n",
      "P = s_p*l*b;##Pull on each bolt in lb-wt\n",
      "A = P/p ;##necessary area of bolt-section\n",
      "d = math.sqrt(4*A/math.pi) ;##minimum diameter in inches\n",
      "print'%s %.2f %s'%('The minimum diameter d of each stay bolt =',d,'inch');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum diameter d of each stay bolt = 0.54 inch\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the safe load in tons\n",
      "D = 8.;##external diameter in inches \n",
      "d = 6.;##internal diameter in inches\n",
      "sigma = 36.;##ultimate stress in tons/in^2\n",
      "n = 6.;##safety factor\n",
      "A = 0.25*math.pi*(D**2 - d**2);##Area of section in in^2\n",
      "P =  sigma*A; ##crushing load for the column in tons \n",
      "P_safe = P/n ;##safe load in tons\n",
      "print'%s %.2f %s'%('Safe load =',P_safe,'tons'); \n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Safe load = 131.95 tons\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate compressive stress of the punch\n",
      "sigma = 20.;##ultimate sheat stress in tons/in^2\n",
      "d = 1./2.;##diameter of the hole in inches\n",
      "t = 3./8.;##thickness of the plate in inches\n",
      "A = 0.25*math.pi*d**2;##area of the cross-section of the punch in^2\n",
      "P = math.pi*d*t*sigma;##necessary force in tons\n",
      "sigma_comp = P/A;##compressive stress on the punch\n",
      "print'%s %.1f %s'%('The compressive stress of the punch =',sigma_comp,'tons/in^2');\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The compressive stress of the punch = 60.0 tons/in^2\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate change in volume \n",
      "b = 8.;##width in inches\n",
      "t = 3./8.;##thickness in inches\n",
      "l = 20.;##length in feets\n",
      "P = 22.;##pull in tons\n",
      "E = 13500.;##modulus of elasticity in tons/in^2\n",
      "sigma = 0.3;##poisson/s ratio\n",
      "A = b*t;##in in^2\n",
      "V = l*A*12;##in cub.inch\n",
      "p = P/A;##in tons/in^2\n",
      "e = p/E;\n",
      "delta_l = e*l*12;##stretch of the bar in inches\n",
      "Lateral_strain = e*sigma ;##lateral strain\n",
      "del_b = b*Lateral_strain;##in inches\n",
      "del_t = t*Lateral_strain;##in inches\n",
      "k = e*(1-2*sigma);##(del_V)/(V)\n",
      "del_V = k*V;##change in volume in cub.inch\n",
      "print'%s %.3f %s'%('The change in volume is',del_V,'cub.inch');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in volume is 0.156 cub.inch\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate contraction in diameter and change in volume and work done in streching the bar \n",
      "d = 7./8.;##diameter of the bar in inches\n",
      "l = 10.;##length in feets\n",
      "P = 6.;##axial pull in tons\n",
      "E = 13000.;##modulus of elsticity in tons/in^2\n",
      "m = 4.;\n",
      "A = 0.25*math.pi*d**2;##in in^2\n",
      "V = 0.25*math.pi*d**2*l*12;##volume in cub.inches\n",
      "p = P/A;##in tons/in^2\n",
      "e = p/E;\n",
      "del_l = e*l*12;##stretchof the bar in inches\n",
      "Lateral_strain = e/m ;##lateral strain\n",
      "del_d = Lateral_strain*d;##Contraction in diameter in inches\n",
      "print'%s %.4f %s'%('The Contraction in diameter is',del_d,'inches');\n",
      "k = e*(1-2/m);##(del_V)/(V)\n",
      "del_V = k*V;##change in volume in cub.inch\n",
      "print'%s %.4f %s'%('The change in volume is',del_V,'cub. inch');\n",
      "W = 0.5*P*del_l;##work done in stretching the bar in in-ton\n",
      "print'%s %.4f %s'%('The work done in stretching the bar is',W,'in-ton');\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Contraction in diameter is 0.0002 inches\n",
        "The change in volume is 0.0277 cub. inch\n",
        "The work done in stretching the bar is 0.2763 in-ton\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate total change in length of the bar and energy stored in bar \n",
      "L = 24.;##length of the bar in ft\n",
      "d1 = 9./8.;##diameter of the bar in inches\n",
      "l1 = 6.;##in ft\n",
      "d2 = 1.;##in inches\n",
      "l2 = 12.;##in ft\n",
      "d3 = 5./4.;##in inches\n",
      "l3 = L-l1-l2;##in ft\n",
      "P = 10000.;##axial compression in lb-wt\n",
      "E = 28.*10**6;##modulus of elasticity in lb/in^2\n",
      "A1 = 0.25*math.pi*d1**2;##in in^2\n",
      "A2 = 0.25*math.pi*d2**2;##in in^2\n",
      "A3 = 0.25*math.pi*d3**2;##in in^2\n",
      "p1 = P/A1 ;##in lb/in^2\n",
      "e1 = p1/E;\n",
      "p2 = P/A2 ;##in lb/in^2\n",
      "e2 = p2/E;\n",
      "p3 = P/A3 ;##in lb/in^2\n",
      "e3 = p3/E;\n",
      "del_l1 = e1*l1*12;##in inches\n",
      "del_l2 = e2*l2*12;##in inches\n",
      "del_l3 = e3*l3*12;##in inches\n",
      "del_l = del_l1+del_l2+del_l3;##total change in length in ft\n",
      "W = 0.5*P*del_l/12;##energy stored in the bar in ft-lbs\n",
      "print'%s %.3f %s'%('Total change in length of the bar is',del_l,'inches');\n",
      "print'%s %.f %s'%('The energy stored in the bar is',W,'ft-lbs');\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total change in length of the bar is 0.112 inches\n",
        "The energy stored in the bar is 47 ft-lbs\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate change in lenght of the rod \n",
      "P = 1200.;##axial pull in lb-wt\n",
      "d1 = 1.;##diameter of one end in inches\n",
      "d2 = 0.5;##diameter of other end in inches\n",
      "l = 10.;##length of the rod in inches\n",
      "E = 14.*10**6;##modulus of elsticity in lb/in^2\n",
      "del_l = 4*P*l/(math.pi*E*d1*d2);##change in length in inches \n",
      "print'%s %.4f %s'%('The change in length of the rod is',del_l,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in length of the rod is 0.0022 inches\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the strain and extension of the bar and the work done in streching \n",
      "d = 1.;##diameter of the steel bar in inches\n",
      "l = 12.;##length of the steel bar in inches\n",
      "d1 = 3./2.;##external diameter in inches\n",
      "d2 = 1.;##internal diameter in inches\n",
      "P = 5.;##axial pull in tons\n",
      "E_s = 30.*10**6;##modulus of elasticity of steel in lb/in^2\n",
      "E_b = 14.*10**6;##modulus of elasticity of brass in lb/in^2\n",
      "A_s = 0.25*math.pi*d**2;##area of the steel section in in^2\n",
      "A_b = 0.25*math.pi*(d1**2-d2**2);##area of the brass section in in^2\n",
      "P_b = (P/((E_s/E_b)*A_s+A_b))*A_b;##load resisted by the brass tube in tons\n",
      "P_s = P-P_b;##bal;ance load resisted by the steel tube\n",
      "e = (P_b/A_b)*2240./E_b ;##strain\n",
      "print'%s %.4f %s'%('The strain e =',e,'');\n",
      "del_l = e*l ;##extension of the bar in inches\n",
      "print'%s %.4f %s'%('The extension of the bar =',del_l,'inches');\n",
      "W = 0.5*P*del_l;##work done in stretching in inch-ton\n",
      "print'%s %.3f %s'%('The work done in stretching is',W,'inch-ton');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The strain e = 0.0003 \n",
        "The extension of the bar = 0.0036 inches\n",
        "The work done in stretching is 0.009 inch-ton\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate safe central load and the reinforcing bar\n",
      "a = 12.;##length of each side in inches\n",
      "d = 9./8.;##diameter of each reinforced bar in inches\n",
      "r = 3.;##distance of centre from the edges in inches\n",
      "p_c = 600.;##in lb/in^2\n",
      "n = 18.;##modular ration E_s/E_c\n",
      "A_s = 4.*0.25*math.pi*d**2;##in in^2\n",
      "A_c = a**2 - A_s;##in in^2\n",
      "p_s = n*p_c;##in lb/in^2\n",
      "P = p_s*A_s+p_c*A_c;##safe central load in lb-wt\n",
      "print'%s %.f %s'%('Safe central load =',P,'lb-wt');\n",
      "print'%s %.d %s'%('Of this, the reinforcing bars carry',p_s*A_s,'lb-wt',);\n",
      "\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Safe central load = 126956 lb-wt\n",
        "Of this, the reinforcing bars carry 42941 lb-wt\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate P_sand p_b and x\n",
      "l = 8.;##length in feet\n",
      "d = 0.5;##diameter in inches\n",
      "r = 30.;##distance between two rods in inches\n",
      "P = 2000.;##load in lb-wt\n",
      "E_s = 30.*10**6;##modulus of elsticity of steel rod\n",
      "E_b = 16.*10**6;##modulus of elsticity of brass rod\n",
      "A_s = 0.25*math.pi*d**2;##section area in in**2\n",
      "p_b = P/(A_s*(1+(E_s/E_b)));\n",
      "p_s = (P/A_s) - p_b ;\n",
      "P_b = A_s*p_b;\n",
      "P_s = A_s*p_s;\n",
      "print'%s %.1f %s'%('P_s =',P_s,'lb/in**2')\n",
      "print'%s %.1f %s'%('and P_b =',P_b,'lb/in**2');\n",
      "x = r*P_b/P ;##\n",
      "print'%s %.2f %s'%('x =',x,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "P_s = 1304.3 lb/in**2\n",
        "and P_b = 695.7 lb/in**2\n",
        "x = 10.43 inches\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12-pg17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#calculate tensile strain imposed by end grips and p and P\n",
      "alpha = 0.0000062 ;##co-efficient of the expansion in \"per F\"\n",
      "t = 100.;##in F\n",
      "d = 3/4.;##in inches\n",
      "D = 0.02;##in inches\n",
      "l = 15.;##in ft\n",
      "E = 13000.;##in tons/in**2\n",
      "e = alpha*t - (D/(l*12));\n",
      "p = E*e;##in tons/in**2\n",
      "A = 0.25*math.pi*d**2;##in in**2\n",
      "P = p*A ;##in tons\n",
      "print'%s %.4f %s'%('Tensile strain imposed by end-grips,e =',e,'');\n",
      "print'%s %.2f %s'%('p =',p,'tons/in**2')\n",
      "print'%s %.4f %s'%('P =',P,'tons');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Tensile strain imposed by end-grips,e = 0.00051 \n",
        "p = 6.62 tons/in**2\n",
        "P = 2.9227 tons\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex13-pg18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the stresses induced in each metal and p_s\n",
      "d = 1.;##diameter of steel bar in inches\n",
      "d1 = 3./2.;##external diameter of brass tube in inches\n",
      "d2 = 1.;##internal diameter of brass tube in inches\n",
      "t = 100.;##in F\n",
      "alpha_s = 0.0000062;##alpha of steel in \"per F\"\n",
      "alpha_b = 0.000010;##alpha of brass in \"per F\"\n",
      "E_s = 30.*10**6;##in lb/in^2\n",
      "E_b = 14.*10**6;##in lb/in^2\n",
      "A_s = 0.25*math.pi*d**2;##section area of steel bar in in^2\n",
      "A_b = 0.25*math.pi*(d1**2-d2**2);##section area of brass tube in in^2\n",
      "p_b = t*(alpha_b-alpha_s)*E_s/((A_b/A_s)+(E_s/E_b));\n",
      "p_s = (A_b/A_s)*p_b;\n",
      "print'%s %.d %s'%('The stresses induced in each metal are, p_b =',p_b,'lb/in^2')\n",
      "print'%s %.d %s'%('p_s =',p_s,'lb/in^2');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stresses induced in each metal are, p_b = 3360 lb/in^2\n",
        "p_s = 4200 lb/in^2\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14-pg19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the least temperature the tube must be heated\n",
      "D = 4.;##diameter of the wheel in ft\n",
      "p = 6. ;##hoop stress in tons/in^2\n",
      "alpha = 0.0000062;##in \"per F\" \n",
      "E = 13000.;##in tons/in^2\n",
      "d = (1./(1.+(p/E)))*D*12.;##internal diameter in inches\n",
      "t = (D*12.-d)/(d*alpha);\n",
      "print'%s %.1f %s'%('The least temperature the tube must be heated is, t =',t,'F');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The least temperature the tube must be heated is, t = 74.4 F\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex15-pg21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Resultant stress intensity and normal stress intensity and tangential stress intensity  and The maximum possible shear on any plane  and these planes are inclined at',angle,'degrees to the normal section.\n",
      "p = 8.;##normal stress intensity in tons/in^2\n",
      "theta = 35.*math.pi/180.;##inclination of the section in degrees\n",
      "P = p*math.cos(theta);##resultant stress intensity in tons/in^2\n",
      "p_n = P*math.cos(theta);##normal stress intensity in tons/in^2\n",
      "p_t = P*math.sin(theta);##tangential stress intensity in tons/in^2\n",
      "p_max = 0.5*p;##maximum possible shear in tons/in^2\n",
      "angle = 45.;##inclination of these planes in degrees\n",
      "print'%s %.2f %s'%('Resultant stress intensity =',P,'tons/in^2');\n",
      "print'%s %.2f %s'%('normal stress intensity =',p_n,'tons/in^2');\n",
      "print'%s %.2f %s'%('tangential stress intensity =',p_t,'tons/in^2');\n",
      "print'%s %.d %s'%('The maximum possible shear on any plane is',p_max,'tons/in^2');\n",
      "print'%s %.d %s'%('and these planes are inclined at',angle,'degrees to the normal section.');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resultant stress intensity = 6.55 tons/in^2\n",
        "normal stress intensity = 5.37 tons/in^2\n",
        "tangential stress intensity = 3.76 tons/in^2\n",
        "The maximum possible shear on any plane is 4 tons/in^2\n",
        "and these planes are inclined at 45 degrees to the normal section.\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex16-pg28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate poisson ratio and E,N,K,\n",
      "d = 9./8.;##diameter of the steel bar in inches\n",
      "P = 6.;##tensile load in tons\n",
      "del_l = 0.0036 ;##extension of length inches\n",
      "l = 8.;##gauge length in inches\n",
      "del_d = 0.00015;##change in diameter in inches\n",
      "A = 0.25*math.pi*d**2;##section area in in^2\n",
      "p = P/A;##stress in tons/in^2\n",
      "e = del_l/l;##strain\n",
      "E = p/e;##modulus of elasticity in tons/in^2\n",
      "LS = del_d/d;##lateral strain \n",
      "PR = LS/e;##poisson's ratio \n",
      "N = E/(2.*(1.+PR));##rigidity modulus in tons/in^2\n",
      "K = E/(3.*(1.-2.*PR));##bulk modulus in tons/in^2\n",
      "print'%s %.4f %s'%('Poisson ratio 1/m =',PR,'');\n",
      "print'%s %.d %s'%('E =',E,'tons/in^2');\n",
      "print'%s %.d %s'%('N =',N,'tons/in^2');\n",
      "print'%s %.d %s'%('K =',K,'tons/in^2');\n",
      "\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Poisson ratio 1/m = 0.2963 \n",
        "E = 13413 tons/in^2\n",
        "N = 5173 tons/in^2\n",
        "K = 10974 tons/in^2\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex17-pg29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Poisson ratio and E\n",
      "N = 2640.;##rigidity modulus in tons/in^2\n",
      "d = 3./8.;##diameter of the rod in inches\n",
      "P = 1./2.;##axial pull in tons\n",
      "del_d = 0.000078;##change in diameter in inches\n",
      "A = 0.25*math.pi*d**2;##section area in in^2\n",
      "p = P/A ;##stress tons/in^2\n",
      "LS = del_d/d;##lateral strain\n",
      "m = p/(LS*2.*N) - 1.;\n",
      "E = 2.*N*(1. + 1./m);##modulus of elasticity in ton/in^2\n",
      "PR = 1./m;##poisson's ratio \n",
      "print'%s %.3f %s'%('Poisson ratio 1/m =',PR,'');\n",
      "print'%s %.d %s'%('E =',E,'ton/in^2');\n",
      "\n",
      "##there is an error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Poisson ratio 1/m = 0.320 \n",
        "E = 6971 ton/in^2\n"
       ]
      }
     ],
     "prompt_number": 28
    }
   ],
   "metadata": {}
  }
 ]
}