summaryrefslogtreecommitdiff
path: root/Machine_Design-I_by_Dr._Sadhu_Singh/chapter5.ipynb
blob: 208c11ea7d6804126055d4180df78d0f443c0118 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5 - Riveted Joints"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.1 Pg 142"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " DESIGNING LONGITUDINAL JOINT - \n",
      "\n",
      " \n",
      " Plate Thickness\n",
      " , t = 30.30 mm\n",
      " \n",
      " use t = 32 mm\n",
      " \n",
      " Diameter of rivet hole, do = \n",
      " 33.94 mm\n",
      " \n",
      " Use do = 34 mm\n",
      " \n",
      " Diameter of rivet, d = \n",
      " 33.00 mm\n",
      " \n",
      " Pitch of rivets, p = \n",
      " 220.7 mm\n",
      " \n",
      " as per IBR-\n",
      " pitch, pmax = 232 mm\n",
      " \n",
      " Use p = 220 mm\n",
      " \n",
      " pitch of rivets in inner row, pi = 110 mm\n",
      " \n",
      " distance between outer and adjacent row = 82.5 mm\n",
      " \n",
      " take & use this distance = 85 mm\n",
      " \n",
      " distance between inner row for zig-zag riveting = 59.4 mm\n",
      " \n",
      " take & use this distance = 60 mm\n",
      " \n",
      " Thickness of wide butt strap, t= \n",
      "  24 mm\n",
      " \n",
      " Thickness of narrow butt strap, t= 20 mm\n",
      " \n",
      " margin, m = 52 mm\n",
      " \n",
      " strength of the joint = 2350472 N\n",
      " \n",
      " strength of solid plate = 563200 N\n",
      " \n",
      " Efficiency of joint, eta_l = 417.3 %\n",
      " \n",
      "\n",
      " DESIGNING CIRCUMFERENTIAL JOINT- \n",
      "\n",
      " \n",
      " Plate Thickness\n",
      " , t = 32.00 mm\n",
      " \n",
      " Diameter of rivet hole, do = \n",
      " 34.50 mm\n",
      " \n",
      " Diameter of rivet, d = \n",
      " 33.00 mm\n",
      " \n",
      " no. of rivets = 78.8\n",
      " \n",
      " take n = 80\n",
      " \n",
      " pitch of rivets, pc = 4213.00 mm\n",
      " use pc = 4213 mm\n",
      " \n",
      " Efficiency of joint, eta_c = 99.18 %\n",
      " \n",
      " for zig-zag riveting, distance between rows of rivets = 1413.4 mm. use 65 mm\n",
      " \n",
      " margin, m = 52 mm\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import pi,sqrt,ceil\n",
    "# Given Data\n",
    "ps=2.5## MPa\n",
    "D=1.5##m\n",
    "sigma_t=80## MPa\n",
    "tau=60## MPa\n",
    "sigma_c=120## MPa\n",
    "n=5## no. of rivets\n",
    "\n",
    "print ' DESIGNING LONGITUDINAL JOINT - \\n'\n",
    "print ' \\n Plate Thickness'\n",
    "eta_l=80## % (efficiency)\n",
    "t = ps*D*1000/2/sigma_t/(eta_l/100)+1## mm\n",
    "print ' , t = %.2f mm'%(t)\n",
    "t=32##mm (adopted for design)\n",
    "print ' \\n use t = %d mm'%(t)\n",
    "print ' \\n Diameter of rivet hole, do = '\n",
    "d0=6*sqrt(t)##mm (for t>8 mm)\n",
    "print ' %.2f mm'%(d0)\n",
    "d0=34.5## suggested for design\n",
    "print ' \\n Use do = %.f mm'%(d0)\n",
    "print ' \\n Diameter of rivet, d = '\n",
    "d=d0-1.5##mm \n",
    "print ' %.2f mm'%(d)\n",
    "print ' \\n Pitch of rivets, p = '\n",
    "Ps=(4*1.875+1)*pi/4*d0**2*tau## N\n",
    "# Putting Pt=Ps where Pt=(p-d0)*t*sigma_t## N\n",
    "Pt=Ps##N\n",
    "p=Pt/(t*sigma_t)+d0## N\n",
    "print ' %.1f mm'%(p)\n",
    "C=6## for 5 no. of rivets\n",
    "pmax=C*t+40## mm (as per IBR)\n",
    "print ' \\n as per IBR-\\n pitch, pmax = %.f mm'%(pmax)\n",
    "p=220## mm (adopted for design)\n",
    "print ' \\n Use p = %.f mm'%(p)\n",
    "pi=p/2## mm \n",
    "print ' \\n pitch of rivets in inner row, pi = %.f mm'%(pi)\n",
    "\n",
    "#Distance between rows of rivets\n",
    "dis1=0.2*p+1.115*d0## mm \n",
    "print ' \\n distance between outer and adjacent row = %.1f mm'%(dis1)\n",
    "dis1=85##mm (adopted for design)\n",
    "print ' \\n take & use this distance = %.f mm'%( dis1)\n",
    "dis2=0.165*p+0.67*d0## mm \n",
    "print ' \\n distance between inner row for zig-zag riveting = %.1f mm'%( dis2)\n",
    "dis2=60##mm (adopted for design)\n",
    "print ' \\n take & use this distance = %.f mm'%( dis2)\n",
    "print ' \\n Thickness of wide butt strap, t= '\n",
    "t1=0.75*t## mm (wide butt strap)\n",
    "print '  %.f mm'%(t1)\n",
    "t2=0.625*t## mm (narrow butt strap)\n",
    "print ' \\n Thickness of narrow butt strap, t= %.f mm'%(t2)\n",
    "#margin\n",
    "m=ceil(1.5*d0)## mm\n",
    "print ' \\n margin, m = %.f mm'%(m)\n",
    "# Efficiency of joint\n",
    "Pt=(p-d0)*t*sigma_t## N\n",
    "Ps=Ps## N (shearing resistance of rivets)\n",
    "Pc=n*d0*t*sigma_c## N (crushing resistance of rivets)\n",
    "sigma_com = (p-2*d0)*t*sigma_t+pi/4*d0**2*tau## N\n",
    "print ' \\n strength of the joint = %d N'%(sigma_com)\n",
    "P=p*t*sigma_t##N (strength of solid plate)\n",
    "print ' \\n strength of solid plate = %d N'%(P)\n",
    "eta_l=sigma_com/P*100## % (efficiency)\n",
    "print ' \\n Efficiency of joint, eta_l = %.1f %%'%(eta_l)\n",
    "\n",
    "print ' \\n\\n DESIGNING CIRCUMFERENTIAL JOINT- \\n'\n",
    "t=32## mm\n",
    "d0=34.5##mm\n",
    "d=33##mm\n",
    "print ' \\n Plate Thickness'\n",
    "print ' , t = %.2f mm'%(t)\n",
    "print ' \\n Diameter of rivet hole, do = '\n",
    "print ' %.2f mm'%(d0)\n",
    "print ' \\n Diameter of rivet, d = '\n",
    "print ' %.2f mm'%(d) \n",
    "n=(D*1000/d0)**2*(ps/tau)## no. of rivets\n",
    "print ' \\n no. of rivets = %.1f'%(n)\n",
    "n=80## adopted for design\n",
    "print ' \\n take n = %d'%(n)\n",
    "# Pitch of rivets\n",
    "n1=n/2## no. of rivets per row\n",
    "pc=pi*(D*1000+t)/n1## mm (pitch of rivets)\n",
    "print ' \\n pitch of rivets, pc = %.2f mm\\n use pc = %.f mm'%(pc,pc)\n",
    "eta_c=(pc-d0)/pc*100## % (efficiency of joint)\n",
    "print ' \\n Efficiency of joint, eta_c = %.2f %%'%(eta_c)\n",
    "dis=0.33*pc+0.67*d0## mm (distance between rows of rivets)\n",
    "print ' \\n for zig-zag riveting, distance between rows of rivets = %.1f mm. use 65 mm'%( dis)\n",
    "m=1.5*d0## mm (Margin)\n",
    "print ' \\n margin, m = %.f mm'%(m)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.2 Pg 147"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " Diameter of rivet, do = \n",
      " 26.83 mm\n",
      " \n",
      " Standard diameter of rivet hole, do = 29 mm & corresponding diameter of rivet = 27 mm\n",
      " \n",
      " no. of rivets, n = 9.629. Use n = 10 \n",
      " \n",
      " thickness of inner butt strap, t1 = 15 mm\n",
      " \n",
      " thickness of outer butt strap, t2 = 15 mm\n",
      " \n",
      " efficiency of joint = 92.75 %\n",
      " \n",
      " pitch of rivets = 92 mm. Use 100 mm\n",
      " \n",
      " margin,\n",
      " m = 43.5 mm. Use 50 mm\n",
      " \n",
      " w = 400 mm\n",
      " \n",
      " distance between rows = 72.5 mm. Use 75 mm\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi,ceil\n",
    "# Given Data\n",
    "w=400##mm\n",
    "t=20##mm\n",
    "sigma_t=90## MPa\n",
    "tau=60## MPa\n",
    "sigma_c=140## MPa\n",
    "\n",
    "print ' \\n Diameter of rivet, do = '\n",
    "d0=6*sqrt(t)##mm (for t>8 mm)\n",
    "print ' %.2f mm'%(d0)\n",
    "d0=29##mm (standard)\n",
    "print ' \\n Standard diameter of rivet hole, do = %.f mm & corresponding diameter of rivet = 27 mm'%(d0)\n",
    "Pt=(w-d0)*t*sigma_t##N max. tearing strength of plate\n",
    "Ps=1.75*pi/4*d0**2*tau## N (shearing strength of one rivet)\n",
    "n1=Pt/Ps## no. of rivets\n",
    "n=ceil(n1)#\n",
    "print ' \\n no. of rivets, n = %.3f. Use n = %.f '%(n1,n)\n",
    "t1=0.75*t## mm\n",
    "t2=t1## mm\n",
    "print ' \\n thickness of inner butt strap, t1 = %.f mm'%( t1)\n",
    "print ' \\n thickness of outer butt strap, t2 = %.f mm'%( t2)\n",
    "# section 1-1 \n",
    "P1=(w-d0)*t*sigma_t##N\n",
    "# section 2-2 \n",
    "P2=(w-2*d0)*t*sigma_t+1.75*pi/4*d0**2*tau##N\n",
    "# section 3-3 \n",
    "P3=(w-3*d0)*t*sigma_t+1.75*3*pi/4*d0**2*tau##N\n",
    "# section 4-4\n",
    "P4=(w-4*d0)*t*sigma_t+1.75*6*pi/4*d0**2*tau##N\n",
    "Ps=10*Ps## N (shearing stress of all rivets)\n",
    "Pc=10*d0*t*sigma_c## N (shearing stress of all rivets)\n",
    "Pj=P1## N (strength f joint)\n",
    "P = w*t*sigma_t## N (strength of solid plate)\n",
    "eta=P1/P*100# # % (efficiency of joint)\n",
    "print ' \\n efficiency of joint = %.2f %%'%( eta)\n",
    "p1=3*d0+5## mm (pitch of rivets)\n",
    "p=100##mm (adopt for design)\n",
    "print ' \\n pitch of rivets = %.f mm. Use %.f mm'%(p1,p)\n",
    "m1=1.5*d0## mm (margin)\n",
    "m=50##mm\n",
    "w=3*p+2*m## mm\n",
    "print ' \\n margin,\\n m = %.1f mm. Use %.f mm'%( m1,m)\n",
    "print ' \\n w = %.f mm'%(w)\n",
    "dis=2.5*d0## mm\n",
    "print ' \\n distance between rows = %.1f mm. Use 75 mm'%(dis)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.3 Pg 150"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " diameter of rivets = 16.99 mm. Use d0 = 17.5 mm & d=16 mm for design.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi,ceil,acos,cos\n",
    "# Given Data\n",
    "n=6## no. of rivets\n",
    "P=54## kN\n",
    "e=200##mm \n",
    "a=50##mm (from fig.5.13(a))\n",
    "b=100##mm (from fig.5.13(a))\n",
    "tau=120## MPa\n",
    "\n",
    "Pd=P/n*1000## N (direct shear load in rivet)\n",
    "C=P*e## kN.mm (Couple)\n",
    "#l1=l3=l4=l6\n",
    "l1=sqrt(a**2+b**2)## mm\n",
    "l3=l1#l4=l1#l6=l1#mm\n",
    "l2=a#l5=a##mm\n",
    "# F1/l1*(4*l1**2+2*l2**2)=C\n",
    "F1=C*1000/(4*l1**2+2*l2**2)*l1## N\n",
    "theta1=acos(a/l1)## radian\n",
    "R1=sqrt(Pd**2+F1**2+2*Pd*F1*cos(theta1))## N (resultant force in rivet 1)\n",
    "#R1=pi/4*d0**2*tau\n",
    "d0=sqrt(R1/(pi/4*tau))## mm\n",
    "print ' \\n diameter of rivets = %.2f mm. Use d0 = 17.5 mm & d=16 mm for design.'%(d0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.4 Pg 151"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " DESIGNING LONGITUDINAL JOINT - \n",
      "\n",
      " \n",
      " Plate Thickness\n",
      " , t = 9.61 mm\n",
      " \n",
      " use t = 10 mm\n",
      " \n",
      " Diameter of rivet hole, do = \n",
      " 18.97 mm\n",
      " \n",
      " Use do = 19.5 mm\n",
      " \n",
      " Diameter of rivet, d = \n",
      " 18.00 mm\n",
      " \n",
      " Pitch of rivets, p = \n",
      " 89.18 mm\n",
      " \n",
      " as per IBR-\n",
      " pitch, pmax = 75 mm\n",
      " \n",
      " Use p = 75 mm\n",
      " \n",
      " distance between rows of rivets = 37.8 mm\n",
      " \n",
      " take & use this distance = 40 mm\n",
      " \n",
      " Thickness of butt strap, t= \n",
      "  6.25 mm\n",
      " \n",
      " Use thickness = 7 mm\n",
      " \n",
      " margin, m = 30 mm\n",
      " \n",
      " strength of the joint = 49950 N\n",
      " \n",
      " strength of solid plate = 67500 N\n",
      " \n",
      " Efficiency of joint, eta_l = 74.00 % = 75 % as given\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import ceil,sqrt,pi\n",
    "# Given Data\n",
    "D=0.75##m\n",
    "ps=1.55## N/mm.sq\n",
    "eta_l=0.75## efficiency\n",
    "sigma_t=90## MPa\n",
    "sigma_c=140## MPa\n",
    "tau=56## MPa\n",
    "n=2## no. of rivets\n",
    "\n",
    "print ' DESIGNING LONGITUDINAL JOINT - \\n'\n",
    "print ' \\n Plate Thickness'\n",
    "t = ps*D*1000/2/sigma_t/eta_l+1## mm\n",
    "print ' , t = %.2f mm'%(t)\n",
    "t=ceil(t)##mm (adopted for design)\n",
    "print ' \\n use t = %d mm'%(t)\n",
    "\n",
    "print ' \\n Diameter of rivet hole, do = '\n",
    "d0=6*sqrt(t)##mm (for t>8 mm)\n",
    "print ' %.2f mm'%(d0)\n",
    "d0=19.5## suggested for design\n",
    "print ' \\n Use do = %.1f mm'%(d0)\n",
    "print ' \\n Diameter of rivet, d = '\n",
    "d=d0-1.5##mm \n",
    "print ' %.2f mm'%(d)\n",
    "\n",
    "print ' \\n Pitch of rivets, p = '\n",
    "Ps=(2*1.875)*pi/4*d0**2*tau## N\n",
    "# Putting Pt=Ps where Pt=(p-d0)*t*sigma_t## N\n",
    "Pt=Ps##N\n",
    "p=Pt/(t*sigma_t)+d0## N\n",
    "print ' %.2f mm'%(p)\n",
    "C=3.5## for 2 no. of rivets\n",
    "pmax=C*t+40## mm (as per IBR)\n",
    "print ' \\n as per IBR-\\n pitch, pmax = %.f mm'%(pmax)\n",
    "p=75## mm (adopted for design)\n",
    "print ' \\n Use p = %.f mm'%(p)\n",
    "\n",
    "#Distance between rows of rivets\n",
    "dis=0.33*p+0.67*d0## mm \n",
    "print ' \\n distance between rows of rivets = %.1f mm'%(dis)\n",
    "dis=40##mm (adopted for design)\n",
    "print ' \\n take & use this distance = %.f mm'%( dis)\n",
    "\n",
    "print ' \\n Thickness of butt strap, t= '\n",
    "t1=0.625*t## mm\n",
    "print '  %.2f mm'%(t1)\n",
    "t1=7## mm (adopted for design)\n",
    "print ' \\n Use thickness = %.f mm'%(t1)\n",
    "\n",
    "#margin\n",
    "m=ceil(1.5*d0)## mm\n",
    "print ' \\n margin, m = %.f mm'%(m)\n",
    "\n",
    "# Efficiency of joint\n",
    "Pt=(p-d0)*t*sigma_t## N\n",
    "Ps=Ps## N (shearing resistance of rivets)\n",
    "Pc=n*d0*t*sigma_c## N (crushing resistance of rivets)\n",
    "sigma_com = (p-2*d0)*t*sigma_t+pi/4*d0**2*tau## N\n",
    "print ' \\n strength of the joint = %d N'%(Pt)\n",
    "P=p*t*sigma_t##N (strength of solid plate)\n",
    "print ' \\n strength of solid plate = %d N'%(P)\n",
    "eta_l=Pt/P*100## % (efficiency)\n",
    "print ' \\n Efficiency of joint, eta_l = %.2f %% = 75 %% as given'%(eta_l)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.6 Pg 153"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " diameter of rivets = 22.81 mm. Use d0 = 21.5 mm & d=20 mm for design.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import cos,pi,sqrt,sin,atan,tan\n",
    "# Given Data\n",
    "n=5## no. of rivets\n",
    "P=45## kN\n",
    "alfa=30## degree\n",
    "tau=120## MPa\n",
    "\n",
    "\n",
    "Pd=P/n*1000## N (direct shear load in rivet)\n",
    "# C.G. of rivet group\n",
    "# values below are collected direct from figure\n",
    "x_bar=(3*200)/5## mm\n",
    "y_bar=(1*50+1*150+1*100+1*200)/5## mm\n",
    "ex=300+x_bar+y_bar##mm\n",
    "ey=100##mm\n",
    "l1=sqrt(x_bar**2+(y_bar/2)**2)## mm\n",
    "l2=l1##mm\n",
    "l3=sqrt(100**2+80**2)## mm\n",
    "l4=80##mm\n",
    "l5=l3##mm\n",
    "\n",
    "#2*F1*l1+2*F3*l3+F4*l4=P*cos(alfa)*ex+P*sin(alfa)*ey\n",
    "F1=(P*1000*cos(pi/180*alfa)*ex+P*1000*sin(pi/180*alfa)*ey)/(2*l1**2+2*l3**2+l4**2)*l1##N\n",
    "# rivet 1 is nearest\n",
    "Beta = atan(x_bar/(y_bar/2))*180/pi## degree\n",
    "theta1=Beta-(90-alfa)## degree\n",
    "R1=sqrt(Pd**2+F1**2+2*Pd*F1*cos(pi/180*theta1))## N (resultant force in rivet 1)\n",
    "#R1=pi/4*d0**2*tau\n",
    "d0=sqrt(R1/(pi/4*tau))## mm\n",
    "print ' \\n diameter of rivets = %.2f mm. Use d0 = 21.5 mm & d=20 mm for design.'%(d0)\n",
    "# Note -  Ans in the textbook is wrong."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.7 Pg 155"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Diameter of rivets, d0 = 11.46 mm. Take d0=13.5 mm & d=12 mm\n",
      " \n",
      " Distance between rows of rivet = 35.2 mm = 35 mm\n",
      " \n",
      " back pitch = 21 mm\n",
      " \n",
      " tearing strength = 28380 N\n",
      " \n",
      " shearing strength = 28628 N\n",
      " \n",
      " crushing strength = 24300 N\n",
      " \n",
      " joint strength = 24300 N\n",
      " \n",
      " strength of solid plate = 46200 N\n",
      " \n",
      " efficiency of joint = 52.6 %\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import pi,sqrt,floor\n",
    "# Given Data\n",
    "t=6##mm\n",
    "sigma_t=220## MPa\n",
    "tau=100## MPa\n",
    "sigma_c=150## MPa\n",
    "n=2## no. of rivets / pitch length\n",
    "#Ps=n*pi/4**d0**2*tau## shearing strength of rivets\n",
    "#Pc=2*d0*t*sigma_c## Crushing strength of rivets\n",
    "d0=2*t*sigma_c/(n*pi/4*tau)## mm (equating Ps=Pc)\n",
    "print ' Diameter of rivets, d0 = %.2f mm. Take d0=13.5 mm & d=12 mm'%(d0)\n",
    "d0=13.5##mm\n",
    "d=12##mm\n",
    "#Pt=(p-d0)*t*sigma_t## tearing strength\n",
    "# equating Pt=Ps\n",
    "#p= n*pi/4**d0**2*tau/(t*sigma_t)+d0##mm\n",
    "p= n*pi/4*d0**2*tau/(t*sigma_t)+d0\n",
    "print ' \\n Distance between rows of rivet = %.1f mm = %.f mm'%(p,p)\n",
    "p=floor(p)##mm\n",
    "pb=0.6*p##mm (back pitch)\n",
    "print ' \\n back pitch = %.f mm'%(pb)\n",
    "Pt=(p-d0)*t*sigma_t##  N (tearing strength)\n",
    "print ' \\n tearing strength = %.f N'%(Pt)\n",
    "Ps=n*pi/4*d0**2*tau## N ( shearing strength)\n",
    "print ' \\n shearing strength = %.f N'%(Ps)\n",
    "Pc=2*d0*t*sigma_c##N (Crushing strength of rivets)\n",
    "print ' \\n crushing strength = %.f N'%(Pc)\n",
    "joint_strength = Pc## N\n",
    "print ' \\n joint strength = %.f N'%(joint_strength)\n",
    "P=p*t*sigma_t##N (strength of solid plate)\n",
    "print ' \\n strength of solid plate = %.f N'%(P)\n",
    "eta = joint_strength/P*100## % (efficiency)\n",
    "print ' \\n efficiency of joint = %.1f %%'%( eta)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 5.8 Pg 156"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Diameter of rivets - \n",
      " d0 = 11.654 mm\n",
      " \n",
      " Use d0 = 13.5 mm & d = 12 mm\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi\n",
    "# Given Data\n",
    "P=20## kN\n",
    "e=80##mm\n",
    "tau=150## MPa\n",
    "\n",
    "\n",
    "Pd=P/4## kN\n",
    "C=P*e## kN.mm (Couple)\n",
    "# As C.G. lies at 45mm from top rivet\n",
    "l1=45;l4=45##mm \n",
    "l2=15;l3=15##mm\n",
    "#(F1/l1)*(2*l1*l4+2*l2*l3) = C\n",
    "F1= C*1000/(2*l1*l4+2*l2*l3)*l1##N\n",
    "R1=sqrt(Pd**2+F1**2)## N\n",
    "#R1=pi/4*d0**2*tau\n",
    "d0=sqrt(R1/(pi/4*tau))##mm\n",
    "print ' Diameter of rivets - \\n d0 = %.3f mm'%(d0)\n",
    "print ' \\n Use d0 = 13.5 mm & d = 12 mm'"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}