summaryrefslogtreecommitdiff
path: root/Mechanics_of_Materials_by_R._C._Hibbeler/Chapter1.ipynb
blob: 4446458c1fe1c0705993edcd92bdce8452d77909 (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
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1:Equilibrium of a deformable body"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.1 Page no 11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "w_varying = 270.0     #N/m, torque\n",
      "l_crossection = 9.0   #m , length\n",
      "l_cb = 6.0            #m length\n",
      "l_ac = 2.0             #m length\n",
      "\n",
      "#Calculation\n",
      "w_c = (w_varying/l_crossection) * l_cb #By proportion, load at C is found.\n",
      "f_resultant_c = 0.5* w_c *l_cb \n",
      "#Balancing forces in the x direction:\n",
      "n_c = 0\n",
      "#Balncing forces in the y direction:\n",
      "v_c = f_resultant_c\n",
      "# Balncing the moments about C:\n",
      "m_c = - (f_resultant_c*l_ac)\n",
      "\n",
      "#Results\n",
      "print\"The resultant force at C  is  \",f_resultant_c,\"N\"\n",
      "print\"The horizontal force at C is  \",n_c,\"N\"\n",
      "print\"The vertical force at C   is  \",v_c,\"N\"\n",
      "print\"The moment about C        is  \",m_c,\"Nm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resultant force at C  is   540.0 N\n",
        "The horizontal force at C is   0 N\n",
        "The vertical force at C   is   540.0 N\n",
        "The moment about C        is   -1080.0 Nm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.2 Page no 12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "f_d = 225         #N\n",
      "w_uniform = 800   # N/m\n",
      "l_ac = 0.200      #m\n",
      "l_cb = 0.05+0.1   #m\n",
      "l_bd = 0.100      #m\n",
      "l_bearing = 0.05    #m\n",
      "f_resultant = w_uniform*l_cb #120N\n",
      "l_f_resultant_b = (l_cb/2)+ l_bearing #0.125m\n",
      "l = l_ac + l_cb + l_bearing + l_bd  \n",
      "\n",
      "\n",
      "#Calculation\n",
      "m_b = 0                                                        # Net moment about B is zero for equilibrium \n",
      "a_y = -((f_d*l_bd) - (f_resultant*l_f_resultant_b))/ (l - l_bd) # finding the reaction force at A\n",
      "\n",
      "# Refer to the free body diagram in Fig.1-5c.\n",
      "f_c = 40                        #N\n",
      "#Balancing forces in the x direction\n",
      "n_c = 0\n",
      "#Balncing forces in the y direction\n",
      "v_c = a_y - f_c            #-18.75N - 40N-Vc = 0\n",
      "# Balncing the moments about C\n",
      "m_c =  ((a_y * (l_ac + 0.05)) - f_c*(0.025) ) # Mc+40N(0.025m)+ 18.75N(0.250m) = 0\n",
      "\n",
      "\n",
      "# Result\n",
      "print'The horizontal force at C =',n_c,\"N\"\n",
      "print'The vertical force at C   =',v_c,\"N\"\n",
      "print'The moment about C        =',round(m_c,2),\"NM\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal force at C = 0 N\n",
        "The vertical force at C   = -58.75 N\n",
        "The moment about C        = -5.69 NM\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.3 Page no 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Given\n",
      "l_ac = 2     #m.,length\n",
      "l_cb = 1     #m.\n",
      "l_ad = 1.5   #m.\n",
      "#r_a = 0.125  #m.\n",
      "#r_d = 0.125  #m.\n",
      "W = 500      # N, force\n",
      "g=9.81\n",
      "\n",
      "#Calculation\n",
      "#Balancing forces in the x direction\n",
      "n_c = (W*g*(l_ac+l_cb))/(3*2/5.0) # N\n",
      "#Balncing forces in the y direction\n",
      "v_c = n_c*(4/5.0)                 #N\n",
      "# Balncing the moments about C\n",
      "m_c = n_c*(3/5.0)-(W*g)\n",
      "\n",
      "\n",
      "# Result\n",
      "print'The horizontal force at C   =  ',-v_c/1000,\"KN\"\n",
      "print'The vertical force at C     =  ',-m_c/1000,\"KN\"\n",
      "print'The moment about C          =  ',-m_c/1000,\"KNm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal force at C   =   -9.81 KN\n",
        "The vertical force at C     =   -2.4525 KN\n",
        "The moment about C          =   -2.4525 KNm\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.4 Page no 14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Given\n",
      "l_ag = 2           #Length of AG is 1m.\n",
      "l_gd = 1         #Length of GD is 1m.\n",
      "l_de = 3         #Length of DE is 1m.\n",
      "f_a = 1500       #Force at A is 1500N.\n",
      "l_ec = 1.5       #Length of EC is 1m.\n",
      "l = l_ag +l_gd +l_de\n",
      "w_uniform_varying = 600 #Nm.\n",
      "f_ba = 7750      #N\n",
      "f_bc = 6200      #N\n",
      "f_bd = 4650      #N\n",
      "\n",
      "#Calculation\n",
      "w_resultant = 0.5*l_de*w_uniform_varying\n",
      "# calling point of action of resultant as P\n",
      "l_ep = (2/3.0)*l_de \n",
      "l_ap = l - l_ep        \n",
      "\n",
      "#Free Body Diagram Using the result for Fba, the left section AG of the beam is shown in Fig 1-7d.\n",
      "# Equations of equilibrium\n",
      "#Balancing forces in the x direction\n",
      "n_g = -f_ba * (4/5.0)    # N\n",
      "#Balncing forces in the y direction\n",
      "v_g = -f_a + f_ba*(3/5.0) #N\n",
      "\n",
      "# Balncing the moments about C\n",
      "m_g = (f_ba * (3/5.0)*l_ag) - (f_a * l_ag) #Nm\n",
      "\n",
      "# Result\n",
      "print'The horizontal force at G =  ',n_g,\"lb\"\n",
      "print'The vertical force at G   =  ',v_g,\"lb\"\n",
      "print'The moment about G        =  ',m_g,\"lb-ft\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal force at G =   -6200.0 lb\n",
        "The vertical force at G   =   3150.0 lb\n",
        "The moment about G        =   6300.0 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.5 Page no 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given\n",
      "f_a = 50       #N, force\n",
      "m_a = 70       # Moment at A in Nm\n",
      "l_ad = 1.25    #Length of AD in m.\n",
      "l_bd = 0.5     #Length of BD in m.\n",
      "l_cb = 0.75    #Length of BC in m.\n",
      "w_l  = 2       #Kg/m\n",
      "g = 9.81       #N/kg- acceleration due to gravity\n",
      "\n",
      "#Free Body Diagram \n",
      "import math\n",
      "w_bd = w_l*l_bd*g #in N. \n",
      "w_ad = w_l*l_ad*g\n",
      "# Equations of Equilibrium\n",
      "#Balancing forces in the x, y and z direction\n",
      "f_b_x = 0     #  N\n",
      "f_b_y = 0     #N\n",
      "f_b_z = g + w_ad + f_a      #N\n",
      "# Balancing Moments in the x,y and z direction\n",
      "m_b_x = - m_a + (f_a*l_bd) + (w_ad*l_bd) + (l_bd/2.0)*g #Nm\n",
      "m_b_y = - (w_ad*(l_ad/2.0)) - (f_a*l_ad) #Nm\n",
      "m_b_z = 0                       #Nm\n",
      "v_b_shear = sqrt(f_b_z **2 + 0) #Shear Force in N\n",
      "t_b = - m_b_y                   #Torsional Moment in Nm\n",
      "m_b = math.sqrt(m_b_x **2+ 0)   # Bending moment in Nm\n",
      "\n",
      "# Result\n",
      "print' The weight of segment BD                =',w_bd,\"N\"\n",
      "print' The weight of segment AD                =',w_ad,\"N\"\n",
      "print' The force at B in the Z direction       =',f_b_z,\"N\"\n",
      "print' The moment about B in the X direction   =',m_b_x,\"Nm\"\n",
      "print' The moment about G in the Y direction   =',m_b_y,\"Nm\"\n",
      "print' The Shear Force at B                    =',v_b_shear,\"N\"\n",
      "print' The Torsional Moment at B               =',t_b,\"Nm\"\n",
      "print' The Bending Moment at B                 =',m_b,\"Nm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The weight of segment BD                = 9.81 N\n",
        " The weight of segment AD                = 24.525 N\n",
        " The force at B in the Z direction       = 84.335 N\n",
        " The moment about B in the X direction   = -30.285 Nm\n",
        " The moment about G in the Y direction   = -77.828125 Nm\n",
        " The Shear Force at B                    = 84.335 N\n",
        " The Torsional Moment at B               = 77.828125 Nm\n",
        " The Bending Moment at B                 = 30.285 Nm\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.6 Page no 28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "netf_b = 18*(10 **3)      #N Net force at B.\n",
      "netf_c = 8*(10**3)        #N Net force at C.\n",
      "f_a = 12 *(10**3)         #N Force at A.\n",
      "f_d = 22* (10**3)         #N Force at D.\n",
      "w = 35.0                    #mm Width.\n",
      "t = 10.0                    #mm Thickness.\n",
      "\n",
      "#calculations\n",
      "p_bc = netf_b + f_a          #N Net force in region BC.\n",
      "a = w*t                      #m**2 The area of the cross section.\n",
      "avg_normal_stress = p_bc/a   #Average Normal Stress.\n",
      "\n",
      "# Result\n",
      "print'The Average Normal Stress in the bar when subjected to load = ',round(avg_normal_stress,1),\"MPa\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Average Normal Stress in the bar when subjected to load =  85.7 MPa\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.7 Page no: 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given :\n",
      "m_lamp = 80   #Mass of lamp in Kg.\n",
      "d_ab = 10     # Diameter of AB in mm.\n",
      "d_bc = 8      # Diameter of BC in mm.\n",
      "ab_h = 60 *(math.pi/180.0) # In degrees - Angle made by AB with the horizontal.\n",
      "w = m_lamp*9.81 #N\n",
      "a_bc = (math.pi/4.0)*(d_bc**2) #m**2 Area of cross section of rod BC\n",
      "a_ab = (math.pi/4.0)*(d_ab**2) #m**2 Area of cross section of rod AB\n",
      "\n",
      "\n",
      "#calculation\n",
      "import math   # Equations of equilibrium: Solving equilibrium equations simultaneously ,\n",
      "f_bc=395\n",
      "f_ab=f_bc*(4/5.0)/(math.cos(60*3.14/180.0))\n",
      "avg_normal_stress_a = f_ab / a_ab #Mpa Average Normal Stress in AB\n",
      "avg_normal_stress_c = f_bc/ a_bc# Mpa   Average Normal Stress in BC\n",
      "\n",
      "# Displaying results:\n",
      "print\"The Average Normal Stress in AB when subjected to load = MPa\",round(avg_normal_stress_a,2),\"MPa\"\n",
      "print\"The Average Normal Stress in BC when subjected to load = MPa\",round(avg_normal_stress_c,2),\"MPa\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Average Normal Stress in AB when subjected to load = MPa 8.04 MPa\n",
        "The Average Normal Stress in BC when subjected to load = MPa 7.86 MPa\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.8 Page no 30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given\n",
      "h_above_ab = 2.75        #ft , height\n",
      "h_below_ab = 0.2 \n",
      "d_a = 0.75               #diameter ft \n",
      "d_b = 0.1 \n",
      "sp_w = 490 \n",
      "\n",
      "# Equation of Equilibrium\n",
      "import math\n",
      "a = math.pi* (d_a**2)  # Area of cross section in m**2\n",
      "p = sp_w * h_above_ab * a\n",
      "avg_comp_stress = p/a # The average compressive stress in kN/m**2\n",
      "\n",
      "#Display\n",
      "print'The average compressive stress = ',avg_comp_stress,\"lb/ft**2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The average compressive stress =  1347.5 lb/ft**2\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.9 Page no 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine Distance of force from AB\n",
      "\n",
      "#Given \n",
      "f = 3000 #N Force acting at distance x from AB.\n",
      "l_ac = 200 #Length of AC in mm.\n",
      "a_ab = 400 #Cross sectional area of AB in mm**2.\n",
      "a_c = 650 # area of C in mm**2.\n",
      "\n",
      "#Calculation\n",
      "#Equations are\n",
      "#Fab+Fc=3000\n",
      "#-3000*x+Fc*200=0\n",
      "Fc=1857\n",
      "Fab=3000-Fc\n",
      "x=Fc*200/3000\n",
      "\n",
      "#Display\n",
      "print'Distance of force from AB =  ',x,\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distance of force from AB =   123 mm\n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.10 Page no 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "af =30\t\t #kN Axial force along centroidal axis\n",
      "t1 = 2 \t\t#m thickness of square cross section\n",
      "t2=4\n",
      "#Internal loading\n",
      "import math\n",
      "Fb=af*t1/((t1+t2)*(4/5.0))\n",
      "Ax=Fb*(3/5.0)\n",
      "Ay=af-(Fb*(4/5.0))\n",
      "Fa=math.sqrt(Ax**2+Ay**2)\n",
      "Va=Fa/t1\n",
      "Vb=Fb\n",
      "Aa=(math.pi/4.0)*((t1/100.0)**2)\n",
      "Ab=(math.pi/4.0)*(((t1+t2)/200.0)**2)\n",
      "Ta=Va/Aa\n",
      "Tb=Vb/Ab\n",
      "\n",
      "#Display\n",
      "print'The Average Normal Stress for section b-b   =  ',round(Ta/1000,0),\"Mpa\"\n",
      "print'The Average Shear Stress for section b-b    =  ',round(Tb/1000,1),\"Mpa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Average Normal Stress for section b-b   =   34.0 Mpa\n",
        "The Average Shear Stress for section b-b    =   17.7 Mpa\n"
       ]
      }
     ],
     "prompt_number": 68
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.11 Page no 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given \n",
      "f = 6          #kN\n",
      "d_rod = 0.1        #Diameter of steel rod in mm.\n",
      "l_bc = 0.125        #Length of side bc in mm.\n",
      "l_ac=0.15\n",
      "#Calculation\n",
      "F=f/2.0\n",
      "#Appling Force balance\n",
      "Va=F\n",
      "Vb=F\n",
      "a_rod=d_rod*l_ac\n",
      "a_strut=l_bc*l_ac\n",
      "#Average shear stress\n",
      "avg_shear_rod = F/a_rod #for rod in Mpa\n",
      "avg_shear_strut = (f/2)/a_strut #for strut\n",
      "\n",
      "#Display\n",
      "print'The average shear stress for the rod    =  ',avg_shear_rod,\"Kpa\"\n",
      "print'The average shear stress for the strut  =  ',avg_shear_strut,\"Kpa\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The average shear stress for the rod    =   200.0 Kpa\n",
        "The average shear stress for the strut  =   160.0 Kpa\n"
       ]
      }
     ],
     "prompt_number": 74
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.12 Page no 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given\n",
      "l_bc = 1 \t#Length of BC in inc.\n",
      "l_db = 3 \t# in.\n",
      "l_ed = 2 \t# in.\n",
      "l_ab = 1.5 \t# in.\n",
      "f_diagonal = 600 \t#lb\n",
      "\n",
      "#Calculation\n",
      "a1 = l_bc*l_ab \t\t#Area of face AB in mm**2.\n",
      "a2 = l_ab*l_ed  \t#mm**2.\n",
      "a3 = l_db*l_ab  \t# mm**2.\n",
      "#Balancing forces along the x- direction.\n",
      "f_ab = f_diagonal*(3/5.0) #Force on segment AB in N\n",
      "V = f_ab             \n",
      "\n",
      "#Balancing forces along the Y direction.\n",
      "f_bc = f_diagonal*(4/5.0) #Force on segment BC in N.\n",
      "avg_comp_ab = f_ab/a1 # N/mm**2\n",
      "avg_comp_bc = f_bc/a2 # N/mm**2\n",
      "avg_shear = f_ab/a3 # N/mm**2\n",
      "\n",
      "#Display\n",
      "print a1\n",
      "print'The average compressive stress along AB  =  ',avg_comp_ab,\"psi\"\n",
      "print'The average compressive stress along BC  =  ',avg_comp_bc,\"psi\"\n",
      "print'The average shear stress along EDB       =  ',avg_shear,\"psi\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1.5\n",
        "The average compressive stress along AB  =   240.0 psi\n",
        "The average compressive stress along BC  =   160.0 psi\n",
        "The average shear stress along EDB       =   80.0 psi\n"
       ]
      }
     ],
     "prompt_number": 81
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.13 Page no 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given\n",
      "shear_allow = 3 \t#ksi, stress\n",
      "tensile_allow = 5 \t#ksi, stress\n",
      "l_C1 = 3\t\t #in\n",
      "l_C2 = 2 \t\t #in\n",
      "l_ac=8            #inch\n",
      "Tauallow=8       #ksi\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "Fab=(tensile_allow*(3/5.0)*(l_C1+l_C2)+shear_allow*l_C1)/(l_ac)\n",
      "Cx=-shear_allow+tensile_allow*(4/5.0)\n",
      "Cy=tensile_allow*(3/5.0)+l_C1\n",
      "Fc=math.sqrt(Cx**2+Cy**2)\n",
      "A=(Fc/2.0)/Tauallow\n",
      "d=2*math.sqrt(A/math.pi)\n",
      "\n",
      "#Result\n",
      "print\" The diameter of rod is =  \",round(d,3),\"inch\"\n",
      "print\"Wse a pin of diameter =\",3/4.0,\"inch\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The diameter of rod is =   0.696 inch\n",
        "Wse a pin of diameter = 0.75 inch\n"
       ]
      }
     ],
     "prompt_number": 87
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.14 Page no 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "P= 20.0\t\t      #kN, force\n",
      "d_hole = 40.0 \t  #mm\n",
      "normal_allow = 60.0 #MPa, pressure\n",
      "shear_allow = 35.0  #MPa, pressure\n",
      "\n",
      "\n",
      "#Diameter of Rod\n",
      "import math\n",
      "area1 = (P*10**3)/(normal_allow*10**6) #Area in m**2\n",
      "d = ((math.sqrt((4*area1)/math.pi))*1000) # Area = (math.pi\\4)d**2\n",
      "#Thickness of disc\n",
      "V = P\n",
      "area2 = (V*10**3)/(shear_allow*10**6) #Area in m**2\n",
      "thickness = (area2*10**6)/(d_hole*math.pi)# A = pi*d*t\n",
      " \n",
      "\n",
      "#Result\n",
      "print\"The diameter of rode   = \",round(d,2),\"mm\"\n",
      "print\"The thickness of disc  = \",round(thickness,2),\"mm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diameter of rode   =  20.6 mm\n",
        "The thickness of disc  =  4.55 mm\n"
       ]
      }
     ],
     "prompt_number": 93
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.15 Page no 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "import math\n",
      "bearing_allow = 75.0\t #MPa, pressure\n",
      "tensile_allow = 55.0 \t#MPa, pressure\n",
      "d_shaft = 60.0\t\t #mm\n",
      "r_shaft = d_shaft/2.0 \t#mm\n",
      "area_shaft = math.pi*(r_shaft**2) #Area = pi*r**2\n",
      "d_collar = 80 #mm\n",
      "thick_collar = 20 #mm\n",
      "\n",
      "#Calculation\n",
      "r_collar = d_collar/2.0 #mm\n",
      "area_collar = math.pi*(r_collar**2) #Area = pi*r**2\n",
      "#Normal Stress\n",
      "P1 = (tensile_allow* area_shaft)/3.0 #Tensile stress = 3P/A.\n",
      "P1_kN = P1/1000.0\n",
      "#Bearing Stress\n",
      "bearing_area = area_collar-area_shaft \n",
      "P2 = (bearing_allow*bearing_area)/3 \n",
      "P2_kN= P2/1000.0\n",
      "\n",
      "#Result\n",
      "print\"The load calculated by Normal Stress  \",round(P1_kN,1),\"kN\"\n",
      "print\"The load calculated by Bearing Stress \",round(P2_kN,0),\"kN\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load calculated by Normal Stress   51.8 kN\n",
        "The load calculated by Bearing Stress  55.0 kN\n"
       ]
      }
     ],
     "prompt_number": 96
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 1.16 Page no 52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "d_ac= 20.0            #mm\n",
      "area_al = 1800.0       #mm**2, area\n",
      "d_pins = 18.0          #mm\n",
      "st_fail_stress = 680.0 #MPa, pressure\n",
      "al_fail_stress = 70.0 #MPa, pressure\n",
      "shear_fail_pin = 900.0 #MPa\n",
      "fos = 2.0             #Factor of safety\n",
      "l_ab = 2.0            #m\n",
      "l_ap = 0.75           #m\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "area_pins = math.pi*(d_pins/2.0)**2\n",
      "area_ac = math.pi*(d_ac/2.0)**2 #Area = (math.pi\\4)d**2\n",
      "st_allow= st_fail_stress /fos #MPa\n",
      "al_allow = al_fail_stress/fos #MPa\n",
      "pin_allow_shear = shear_fail_pin/fos #MPa\n",
      "\n",
      "#Rod AC\n",
      "f_ac = (st_allow*area_ac)/1000.0\n",
      "P1 = ((f_ac*l_ab)/(l_ab-l_ap))\n",
      "\n",
      "#Block B\n",
      "f_b =(al_allow*area_al)/1000.0\n",
      "P2 = ((f_b*l_ab)/l_ap)\n",
      "\n",
      "#Pin A or C\n",
      "V = (pin_allow_shear*area_pins)/1000.0\n",
      "P3 = (V*l_ab)/(l_ab-l_ap)\n",
      "\n",
      "#Result\n",
      "print\"The load allowed on rod AC   \",round(P1,0),\"kN\"\n",
      "print\"The load allowed on block B  \",P2,\"kN\"\n",
      "print\"The load allowed on pins A or C \",round(P3,0),\"kN\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load allowed on rod AC    171.0 kN\n",
        "The load allowed on block B   168.0 kN\n",
        "The load allowed on pins A or C  183.0 kN\n"
       ]
      }
     ],
     "prompt_number": 102
    }
   ],
   "metadata": {}
  }
 ]
}