summaryrefslogtreecommitdiff
path: root/Solid_Mechanics/Chapter6.ipynb
blob: ce9f3b903816aa7a103df0d52e57fcd53f829608 (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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
{
 "metadata": {
  "name": "",
  "signature": "sha256:896289250902762570d264c824478fdd14a2d522b88f8b0060498f7db1b84675"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter6-Torision;Including Non-Circular Sections"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization o variables\n",
      "#find the shear force on each rivet and suitable diameter of rivets\n",
      "p=5. ##cm\n",
      "D=10. ##cm\n",
      "d=2. ##mm\n",
      "T= 10. ##kgm\n",
      "ss= 785. ##kg/cm^2\n",
      "## calculations\n",
      "P= 2.*T/(math.pi*D**2)\n",
      "P=P*5*100.\n",
      "## results\n",
      "print'%s %.2f %s'%('Force per rivet is ',P,' kg')\n",
      "print'%s %.2f %s'%('\\n The diameter of rivet, using a permissible stress of',ss,' kg/cm^2 = 0.227 cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force per rivet is  31.83  kg\n",
        "\n",
        " The diameter of rivet, using a permissible stress of 785.00  kg/cm^2 = 0.227 cm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg189"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#what is maximum torque\n",
      "D=5. ##cm\n",
      "Y=3500. ##kg/cm^2\n",
      "\n",
      "##part (a)\n",
      "Ta=350. ##kg-m\n",
      "tau=Y/2.\n",
      "Ip=Ta*D*100./(2.*tau)\n",
      "d1=Ip*32./math.pi\n",
      "d1=(D**4-d1)**(1/4.)\n",
      "\n",
      "##part (b)\n",
      "Tb= 700. ##kg-m\n",
      "Ip=Tb*D*100./(2.*tau)\n",
      "d2=Ip*32./math.pi\n",
      "d2=(D**4-d2)\n",
      "T=tau*math.pi*(D**4)*2./(32.*D)\n",
      "## results\n",
      "print'%s %.2f %s'%('The maximum diameter corresponding to the case a is ',d1,' cm')\n",
      "print'%s %.2f %s'%('\\n Since the daimeter for the case (b) is coming out to be negative, \\n The maximum torque transmitted is ',T/100,' kg-m')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum diameter corresponding to the case a is  3.28  cm\n",
        "\n",
        " Since the daimeter for the case (b) is coming out to be negative, \n",
        " The maximum torque transmitted is  429.51  kg-m\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg190"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#find the weight of students\n",
      "A=3 ##cm^2\n",
      "E= 2*10**6 ##kg/cm^2\n",
      "nu= 0.25\n",
      "l= 60. ##m\n",
      "L=150. ##cm\n",
      "d=0.5 ##cm\n",
      "dd=10 ##cm\n",
      "D=180 ##cm\n",
      "##calculations\n",
      "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1.+nu)/(E*math.pi*dd**4*2))\n",
      "P=d/K\n",
      "## results\n",
      "print'%s %.2f %s'%('The weight of the students that entered the length is',P,' kg')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The weight of the students that entered the length is 196.31  kg\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg192"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#find the stress in the cable and the shaft\n",
      "## linked to 6_5\n",
      "A=3. ##cm^2\n",
      "E= 2.*10**6 ##kg/cm^2\n",
      "nu= 0.25\n",
      "l= 60. ##m\n",
      "L=150. ##cm\n",
      "d=0.5 ##cm\n",
      "dd=10 ##cm\n",
      "D=180. ##cm\n",
      "##calculations\n",
      "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1+nu)/(E*math.pi*dd**4*2.))\n",
      "P=d/K\n",
      "Ts=P/A\n",
      "fs=dd*D*P*32./(math.pi*4.*dd**4)\n",
      "\n",
      "## results\n",
      "print'%s %.2f %s'%('The tensile stress is ',Ts,'kg/cm^2')\n",
      "print'%s %.2f %s'%('\\n Maximum shear stress is ',fs,' kg/cm^2')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The tensile stress is  65.44 kg/cm^2\n",
        "\n",
        " Maximum shear stress is  89.98  kg/cm^2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg192"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#find the value of x and length of the suspension arm and D\n",
      "F=500. ##kg\n",
      "k=25. ##kg/cm\n",
      "dd=15. ##cm\n",
      "ss=3500. ##kg/cm^2\n",
      "L=2. ##m\n",
      "G=8.*10**5 ##kg/cm^2\n",
      "## calculations\n",
      "x=math.sqrt(math.pi*G/(25.*L*32.*100.))\n",
      "d=x*16.*(F+dd*k)/(ss*math.pi)\n",
      "x2=x*d**2.\n",
      "## results\n",
      "print'%s %.2f %s'%('d=',d,' cm')\n",
      "print'%s %.2f %s'%('\\n x=',x,' cm')\n",
      "\n",
      "## Text: not exact\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "d= 5.05  cm\n",
        "\n",
        " x= 3.96  cm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg201"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the horse power\n",
      "d=5. ##cm\n",
      "rpm1=300. ##rpm\n",
      "rpm2=30000. ##rpm\n",
      "s=1000. ##kg/cm^2\n",
      "##calcuations\n",
      "T=(d/2.)*math.pi*10**2*s/32.\n",
      "hp1= 2*math.pi*rpm1*T/4500.\n",
      "hp2=hp1*100.\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s'%('Horse power at 300 rpm and 30000 rpm are respecively ',hp1/10,''and  '',hp2/10,' h.p.')\n",
      "\n",
      "print('wrong/approximate answers in the text')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Horse power at 300 rpm and 30000 rpm are respecively  1028.08  102808.38  h.p.\n",
        "wrong/approximate answers in the text\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ex12-pg200"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#selct solid transmits and diameter required find\n",
      "hp=300. ##h.p.\n",
      "N1=30. ##rpm\n",
      "N2=30000. ##rpm\n",
      "fs=600. ##kg/cm^2\n",
      "## calculations\n",
      "T1=4500.*hp*100./(2.*math.pi*N1)\n",
      "T2=T1/1000.\n",
      "D1=16.*T1/(math.pi*fs)\n",
      "D1=D1**(1/3.)\n",
      "D2=16.*T2/(math.pi*fs)\n",
      "D2=D2**(1/3.)\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s '%('Diameters required are ',D1,''and '',D2,'cm')\n",
      "\n",
      "print('wrong calculations in the text')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameters required are  18.25  1.83 cm \n",
        "wrong calculations in the text\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex13-pg202"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#find the strain energy per unit volume stored and the energy if the lenght 5cm \n",
      "d=10. ##cm\n",
      "t =1. ##mm\n",
      "T= 100. ##kg-m\n",
      "L=5. ##m\n",
      "G=8*10**5 ##kg/cm^2\n",
      "\n",
      "##calculations\n",
      "r=d/2.\n",
      "fs=T*r*100./(r**2*2*math.pi*L*t*10**-1)\n",
      "U=fs**2/(2*G)\n",
      "U1=U*(math.pi*L*100.)\n",
      "## results\n",
      "print'%s %.2f %s'%('Energy per unit volume = ',U,' kg-cm/cm^3')\n",
      "print'%s %.2f %s'%('\\n Total strain energy= ',U1,' kg-cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy per unit volume =  0.25  kg-cm/cm^3\n",
        "\n",
        " Total strain energy=  397.89  kg-cm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14-pg206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the actual deflection of closely coiled comperssion spring\n",
      "D=10. ##cm\n",
      "d= 1. ##cm\n",
      "n=20.\n",
      "P=60. ##kg\n",
      "G=8*10**5 ##kg/cm^2\n",
      "##calculations\n",
      "n=n-0.75*2\n",
      "delta=P*n*math.pi*D**3*32./(4.*math.pi*G)\n",
      "## results\n",
      "print'%s %.2f %s'%('The deflection is ',delta,' cm')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflection is  11.10  cm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex15-pg206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the shear stress in the wire\n",
      "## linked to 6_14\n",
      "D=10. ##cm\n",
      "d= 1. ##cm\n",
      "n=20.\n",
      "P=60. ##kg\n",
      "G=8*10**5 ##kg/cm^2\n",
      "## calculations\n",
      "m=D/d\n",
      "fs=8.*P*D/(d**3*math.pi)\n",
      "fs1=fs*(1+0.615/m+3./(4.*m-4.))\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s '%('The shear stress with and without correction facor are \\n respectively ',fs,''and  '',fs1,'kg/cm^2')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The shear stress with and without correction facor are \n",
        " respectively  1527.89  1749.18 kg/cm^2 \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex16-pg214"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find their angles of twist and maximum stresses\n",
      "\n",
      "## circle\n",
      "D=1. ##unit diameter\n",
      "Ip=D**4/32.\n",
      "Zp=D**3/16.\n",
      "\n",
      "##Square\n",
      "s=math.sqrt(math.pi/4.)*D\n",
      "Is=0.886*D**4/32.\n",
      "Zs=0.7383*D**3/16.\n",
      "\n",
      "##Rectangle\n",
      "a=math.sqrt(math.pi/2.)*D\n",
      "b=math.sqrt(math.pi/8.)*D\n",
      "Ir=0.719*D**4/32.\n",
      "Zr=0.616*D**3/16.\n",
      "\n",
      "## Trianle\n",
      "t=math.sqrt(math.pi/math.sqrt(3))*D\n",
      "It=0.725*D**4/32.\n",
      "Zt=0.622*D**3/16.\n",
      "\n",
      "##Ellipse\n",
      "A=D/math.sqrt(2)\n",
      "B=D/math.sqrt(8)\n",
      "Ie=A**3*B**3/(A**2+B**2)\n",
      "Ze=A*B**2/2.\n",
      "\n",
      "##Normalization\n",
      "Is=Is/Ip\n",
      "Ie=Ie/Ip\n",
      "It=It/Ip\n",
      "Ir=Ir/Ip\n",
      "\n",
      "Zs=Zs/Zp\n",
      "Ze=Ze/Zp\n",
      "Zt=Zt/Zp\n",
      "Zr=Zr/Zp\n",
      "Ip=1.\n",
      "Zp=1.\n",
      "##results\n",
      "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('Z:: Circle:Square:Ellipse:Triangle:Rectangle = ',Zp,'' and '',Zs,'' and '',Ze,'' and '',Zt,' 'and '',Zr,'')\n",
      "\n",
      "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('\\n I:: Circle:Square:Ellipse:Triangle:Rectangle = ',Ip,'' and  '',Is,'' and '',Ie,'' and '',It,'' and '',Ir,'')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Z:: Circle:Square:Ellipse:Triangle:Rectangle =  1.00  0.74  0.71  0.62  0.62  \n",
        "\n",
        " I:: Circle:Square:Ellipse:Triangle:Rectangle =  1.00  0.89  0.80  0.72  0.72  \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex17-pg215"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the maximum torque that can be transmitted without yeilding\n",
      "\n",
      "yp=2450. ##kg/cm^2\n",
      "d=0.4 ##cm\n",
      "ys=4200. ##kg/cm^2\n",
      "sa=1.6 ##mm\n",
      "sb=7. ##mm\n",
      "## calculations\n",
      "sa=sa/10.\n",
      "sb=sb/10.\n",
      "T1=yp*math.pi*d**3/16.\n",
      "T2=ys*0.303*sa**2*sb\n",
      "## results\n",
      "print'%s %.2f %s'%('The maximum torque that can be transitted by the screw-driver is ',T2,' kg-cm')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum torque that can be transitted by the screw-driver is  22.80  kg-cm\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex18-pg216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the maximum stress in the walls \n",
      "b=5. ##cm\n",
      "h=10. ##cm\n",
      "tL=3. ##mm\n",
      "tl=1.5 ##mm\n",
      "T=100. ##kg-cm\n",
      "## calculations\n",
      "tl=tl/10.\n",
      "fs=T*100./(2.*b*h*tl)\n",
      "## results\n",
      "print'%s %.2f %s'%('The maximum stress is ',fs,' kg/cm^2')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum stress is  666.67  kg/cm^2\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex19-pg216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#compare its strength with hollow circular shaft of same thickness\n",
      "b=5. ##cm\n",
      "h=10. ##cm\n",
      "tL=3. ##mm\n",
      "tl=1.5 ##mm\n",
      "T=100. ##kg-cm\n",
      "## calculations\n",
      "D=2.*(b+h)/math.pi\n",
      "AR=b*h\n",
      "AC=math.pi*D**2/4.\n",
      "r=AC/AR\n",
      "## results\n",
      "print'%s %.2f %s'%('The ratio is 1:',r,'')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio is 1: 1.43 \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex20-pg217"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the value of maximum shear stress and angle of twist\n",
      "G=8*10**5 ##kg/cm^2\n",
      "##part (a)\n",
      "T =20. ##kg-m\n",
      "t1=0.9 ##cm\n",
      "t2=0.5 ##cm\n",
      "b1=6.8 ##cm\n",
      "b2=14.2 ##cm\n",
      "I0=1/3.*(2.*b1*t1**3+b2*t2**3)\n",
      "Zt=I0/max(t1,t2)\n",
      "fs=T*100./Zt\n",
      "Phi=T*100./(G*I0)\n",
      "print('part (a)')\n",
      "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and'',Phi, ' radians/cm ')\n",
      "\n",
      "##part (b)\n",
      "t1=1. ##cm\n",
      "t2=1. ##cm\n",
      "b1=10. ##cm\n",
      "b2=9. ##cm\n",
      "I0=1/3.*(b1*t1**3+b2*t2**3)\n",
      "Zt=I0/max(t1,t2)\n",
      "fs=T*100./Zt\n",
      "Phi=T*100/(G*I0)\n",
      "print('\\n part (b)')\n",
      "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,'kg/cm^2'and '',Phi,'radians/cm ')\n",
      "\n",
      "##part (c)\n",
      "t1=0.76 ##cm \n",
      "t2=0.48 ##cm\n",
      "b1=8. ##cm\n",
      "b2=14.04 ##cm\n",
      "I0=(1/3.)*(2*b1*t1**3+b2*t2**3)\n",
      "Zt=I0/max(t1,t2)\n",
      "fs=T*100./Zt\n",
      "Phi=T*100./(G*I0)\n",
      "print('\\n part (c)')\n",
      "print'%s %.2f %s %.5f %s ' %('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
      "\n",
      "##part(d)\n",
      "t=1 ##cm \n",
      "b=19 ##cm\n",
      "I0=1/3.*t**3*b\n",
      "Zt=I0/t\n",
      "fs=T*100./Zt\n",
      "Phi=T*100./(G*I0)\n",
      "print('\\n part (d)')\n",
      "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
      "\n",
      "print('Twist rate: answers differ by a scale of 10. wrong answers in the text')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a)\n",
        "\n",
        " The maximum shear stress and twist rate are respectively \n",
        "  461.96  0.00064  radians/cm  \n",
        "\n",
        " part (b)\n",
        "\n",
        " The maximum shear stress and twist rate are respectively \n",
        "  315.79  0.00039 radians/cm  \n",
        "\n",
        " part (c)\n",
        "\n",
        " The maximum shear stress and twist rate are respectively \n",
        "  531.70  0.00087 radians/cm  \n",
        "\n",
        " part (d)\n",
        "\n",
        " The maximum shear stress and twist rate are respectively \n",
        "  315.79  0.00039 radians/cm  \n",
        "Twist rate: answers differ by a scale of 10. wrong answers in the text\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex21-pg221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#caclualte Maximum +ve residual stress occurs at r and'radius\n",
      "D=5. ##cm\n",
      "d=2. ##cm\n",
      "t_y=3000. ##kg/cm^2\n",
      "## calculations\n",
      "R=D/2. \n",
      "r=d/2. \n",
      "Tep=2.*math.pi*R**3*t_y/3.-math.pi*r**3.*t_y/6.\n",
      "t_er=2*Tep/(math.pi*R**3)\n",
      "t_er1=t_er*r/R\n",
      "prs=t_y-t_er1\n",
      "nrs=t_er-t_y\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s '%('Maximum +ve residual stress occurs at ',r,' cm' and'radius and is equal to \\n ',prs,' kg/cm^2')\n",
      "print'%s %.2f %s %.2f %s '%('\\n Maximum -ve residual stress occurs at ',R,' cm'and' radius and is equal to \\n ',-nrs,' kg/cm^2')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum +ve residual stress occurs at  1.00 radius and is equal to \n",
        "  1425.60  kg/cm^2 \n",
        "\n",
        " Maximum -ve residual stress occurs at  2.50  radius and is equal to \n",
        "  -936.00  kg/cm^2 \n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}