summaryrefslogtreecommitdiff
path: root/Machine_Design-I_by_Dr._Sadhu_Singh/chapter3.ipynb
blob: 3944ce9534c4e56746dd909dcedb01bc65d768e6 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 3 - Design Against Static Load"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.1 Pg 62"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " dimension of cross section of link, t=19 mm. Adopt t=21 mm. \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from sympy import symbols,solve\n",
    "# Given Data\n",
    "P=30## kN\n",
    "Sut=350## MPa\n",
    "n=2.5## factor of safety\n",
    "\n",
    "sigma_w=Sut/n## MPa (Working stress for the link)\n",
    "\n",
    "t=symbols('t')## thickness of link\n",
    "A=2.5*t**2## mm.sq. \n",
    "I=t*(2.5*t)**3/12## mm**4 (Moment of Inertia about N-A)\n",
    "sigma_d=P/A## N/mm.sq.\n",
    "e=10+1.25*t##mm\n",
    "M=P*10**3*e## N.mm\n",
    "sigma_t=M*1.25*t/I## N/mm.sq.\n",
    "#maximum tensile stress at the top fibres = sigma_d+sigma_t=sigma_w  ...eqn(1)\n",
    "expr=sigma_d+sigma_t-sigma_w ## expression of polynomial from above eqn.\n",
    "t=solve(expr)## solving the equation (as denominator will me be multiplied by zero on R.H.S)\n",
    "t=t[0]## mm # discarding -ve roots\n",
    "print ' dimension of cross section of link, t=%.f mm. Adopt t=21 mm. '%(t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.2 Pg 63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " dimension of cross section of link, t=27 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from sympy import symbols,solve\n",
    "from math import sin,cos,pi\n",
    "# Given Data\n",
    "P=6## kN\n",
    "alfa=30## degree\n",
    "Sut=250## MPa\n",
    "n=2.5## factor of safety\n",
    "\n",
    "sigma_w=Sut/n## MPa (Working stress for the link)\n",
    "PH=P*10**3*cos(pi/180*alfa)## kN\n",
    "PV=P*10**3*sin(pi/180*alfa)## kN\n",
    "\n",
    "t=symbols('t')## thickness of link\n",
    "A=2*t*t## mm.sq. \n",
    "sigma_d=PH/A## N/mm.sq.\n",
    "M=PH*100+PV*250## N.mm\n",
    "I=t*(2*t)**3/12## mm**4 (Moment of Inertia)\n",
    "sigma_t=M*t/I## N/mm.sq.\n",
    "#maximum tensile stress at the top fibres = sigma_d+sigma_t=sigma_w  ...eqn(1)\n",
    "expr=sigma_d+sigma_t-sigma_w ## expression of polynomial from above eqn.\n",
    "t=solve(expr,'t')## solving the equation (as denominator will me be multiplied by zero on R.H.S)\n",
    "t=t[0]## mm # discarding -ve roots\n",
    "print ' dimension of cross section of link, t=%.f mm.'%(t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.3 Pg 64"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " dimension of cross section of link, t=22.36 mm. Use 23 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from sympy import symbols,solve\n",
    "# Given Data\n",
    "P=20## kN\n",
    "Sut=300## MPa\n",
    "n=3## factor of safety\n",
    "\n",
    "sigma_w=Sut/n## MPa (Working stress for the link)\n",
    "\n",
    "t=symbols('t')## thickness of link\n",
    "A=4*t*t## mm.sq. \n",
    "sigma_d=P*10**3/A## N/mm.sq.\n",
    "e=6*t##mm\n",
    "M=P*10**3*e## N.mm\n",
    "z=t*(4*t)**2/6## mm**3 (section modulus at x1-x2)\n",
    "sigma_b=M/z## N/mm.sq.\n",
    "#maximum tensile stress at x1 = sigma_d+sigma_b=sigma_w  ...eqn(1)\n",
    "expr=sigma_d+sigma_b-sigma_w ## expression of polynomial from above eqn.\n",
    "t=solve(expr,'t')## solving the equation (as denominator will me be multiplied by zero on R.H.S)\n",
    "t=t[1]## mm # discarding -ve roots\n",
    "print ' dimension of cross section of link, t=%.2f mm. Use 23 mm.'%(t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.4 Pg 65"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Equating resultant tensile stress gives, a = 21.85 mm\n",
      " \n",
      " Equating resultant compressive stress gives, a = 4.77 mm\n",
      " \n",
      " dimension of cross section of link, a=21.85 mm. adopt a=22 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from sympy import symbols,solve\n",
    "from math import ceil\n",
    "# Given Data\n",
    "P=15## kN\n",
    "sigma_t=20## MPa\n",
    "sigma_c=60## MPa\n",
    "n=3## factor of safety\n",
    "\n",
    "a=symbols('a')## from the diagram.\n",
    "# Area of cross section\n",
    "A1=2*a*a## mm.sq.\n",
    "A2=2*a*a/2## mm.sq.\n",
    "A=A1+A2## mm.sq. \n",
    "\n",
    "# Location of neutral axis\n",
    "#3*a**2*y_bar=2*a**2*a/2+a**2*(a+a/2)\n",
    "y_bar=(2*a**2*a/2+a**2*(a+a/2))/(3*a**2)## mm\n",
    "\n",
    "# Moment of Inertia about neutral axis N-A\n",
    "I=2*a*a**3/12+2*a**2*(y_bar-0.5*a)**2+2*((a/2)*(a**3/12)+(a**2/2)*(1.5*a-y_bar)**2)## mm**4\n",
    "yt=y_bar##mm\n",
    "yc=2*a-y_bar## mm\n",
    "e=y_bar-0.5*a##mm\n",
    "M=P*10**3*e## N.mm\n",
    "sigma_d=P*10**3/A## N/mm.sq.\n",
    "sigma_t1=M*yt/I##N/mm.sq.\n",
    "sigma_c1=M*yc/I##N/mm.sq.\n",
    "sigma_r_t=sigma_d+sigma_t1## N/mm.sq. (sigma_r_t=resultant tensile stress at AB=sigma_d+sigma_t)\n",
    "sigma_r_c=sigma_c1-sigma_d## N/mm.sq. (sigma_r_t=resultant tensile stress at AB=sigma_d+sigma_t)\n",
    "\n",
    "#equating resulting tensile stress with given value sigma_t-sigma_r_t=0...eqn(1)\n",
    "expr1=sigma_t-sigma_r_t## expression of polynomial from above eqn.\n",
    "a1=solve(expr1,'a')## solving the equation (as denominator will me be multiplied by zero on R.H.S)\n",
    "a1=a1[1]## mm # discasrding -ve roots\n",
    "print ' Equating resultant tensile stress gives, a = %.2f mm'%(a1)\n",
    "\n",
    "#equating resulting compressive stress with given value sigma_c-sigma_c_t=0...eqn(1)\n",
    "expr2=sigma_c-sigma_r_c## expression of polynomial from above eqn.\n",
    "a2=solve(expr2,'a')## solving the equation (as denominator will me be multiplied by zero on R.H.S)\n",
    "a2=a2[1]## mm # discarding -ve roots\n",
    "print ' \\n Equating resultant compressive stress gives, a = %.2f mm'%(a2)\n",
    "a=ceil(a1)##mm\n",
    "print ' \\n dimension of cross section of link, a=%.2f mm. adopt a=%.f mm.'%(a1,a)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.5 Pg 67"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " (i) Maximum shear stress theory\n",
      " diameter of shaft, d=99.2 mm or 100 mm\n",
      " \n",
      " (ii) Maximum strain energy theory\n",
      " diameter of shaft, d=94.0 mm\n",
      " \n",
      " Adopt d=100mm\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import pi,sqrt,ceil\n",
    "# Given Data\n",
    "Syt=760## MPa\n",
    "M=15## kN.m\n",
    "T=25##kN.m\n",
    "n=2.5## factor of safety\n",
    "E=200## GPa\n",
    "v=0.25## Poisson's ratio\n",
    "\n",
    "sigma_d=Syt/n## MPa\n",
    "# let d is diameter of the shaft\n",
    "sigma_b_into_d_cube=32*M*10**6/pi## N/mm.sq. (where sigma_b_into_d_cube = sigma_d*d**3)\n",
    "tau_into_d_cube=16*T*10**6/pi#d**3## N/mm.sq. (where tau_into_d_cube = tau*d**3)\n",
    "sigma1_into_d_cube=sigma_b_into_d_cube/2+1/2*sqrt(sigma_b_into_d_cube**2+4*tau_into_d_cube**2) # # (where sigma1_into_d_cube=sigma1*d**3)\n",
    "sigma2_into_d_cube=sigma_b_into_d_cube/2-1/2*sqrt(sigma_b_into_d_cube**2+4*tau_into_d_cube**2)# # (where sigma2_into_d_cube=sigma2*d**3)\n",
    "print ' \\n (i) Maximum shear stress theory'\n",
    "tau_max_into_d_cube=(sigma1_into_d_cube-sigma2_into_d_cube)/2# #(where tau_max_into_d_cube = tau_max*d**3)\n",
    "d=(tau_max_into_d_cube/(sigma_d/2))**(1/3)##mm\n",
    "print ' diameter of shaft, d=%.1f mm or %.f mm'%(d,ceil(d))\n",
    "\n",
    "print ' \\n (ii) Maximum strain energy theory'\n",
    "#sigma1**2+sigma2**2-2*v*sigma1*sigma2=sigma_d**2\n",
    "d=((sigma1_into_d_cube**2+sigma2_into_d_cube**2-2*v*sigma1_into_d_cube*sigma2_into_d_cube)/sigma_d**2)**(1/6)\n",
    "print ' diameter of shaft, d=%.1f mm'%(d)\n",
    "print ' \\n Adopt d=100mm'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.6 Pg 69"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " Using equivalent torque equation,\n",
      " shaft diameter d = 105 mm\n",
      " \n",
      " Using equivalent bending moment equation,\n",
      " shaft diameter d = 97.68 mm or 98 mm\n",
      " \n",
      " Adopt d=105 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi\n",
    "# Given Data\n",
    "N=200## rpm\n",
    "P=200## kW\n",
    "tau_d=42## Mpa\n",
    "W=900## N\n",
    "L=3## m\n",
    "sigma_t=56## MPa\n",
    "sigma_c=56## MPa\n",
    "\n",
    "T=P*60*10**3/(2*pi*N)## N.m\n",
    "M=W*L/4## N.m\n",
    "Te=sqrt(M**2+T**2)## N.m\n",
    "#Te=(pi/16)*d**3*tau_d\n",
    "d=(Te/((pi/16)*tau_d)*1000)**(1/3)## mm\n",
    "print ' \\n Using equivalent torque equation,\\n shaft diameter d = %.f mm'%(d)\n",
    "\n",
    "Me=(1/2)*(M+sqrt(M**2+T**2))## N.m\n",
    "#Me=(pi/32)*d**3*sigma_d\n",
    "d=(Me/((pi/32)*sigma_c)*10**3)**(1/3)##mm\n",
    "print ' \\n Using equivalent bending moment equation,\\n shaft diameter d = %.2f mm or %.f mm'%(d, ceil(d))\n",
    "print ' \\n Adopt d=105 mm.'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.8 Pg 70"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " Using equivalent torque equation,\n",
      " shaft diameter d = 23 mm\n",
      " \n",
      " Using equivalent bending moment equation,\n",
      " shaft diameter d = 21.40 mm or 22 mm\n",
      " \n",
      " Adopt d=23 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi\n",
    "# Given Data\n",
    "M=15## N.m\n",
    "P=5## kW\n",
    "N=500## rpm\n",
    "tau_d=40## Mpa\n",
    "sigma_d=58## MPa\n",
    "\n",
    "T=P*60*10**3/(2*pi*N)## N.m\n",
    "Te=sqrt(M**2+T**2)## N.m\n",
    "#Te=(pi/16)*d**3*tau_d\n",
    "d=(Te/((pi/16)*tau_d)*1000)**(1/3)## mm\n",
    "print ' \\n Using equivalent torque equation,\\n shaft diameter d = %.f mm'%(d)\n",
    "\n",
    "Me=(1/2)*(M+sqrt(M**2+T**2))## N.m\n",
    "#Me=(pi/32)*d**3*sigma_d\n",
    "d=(Me/((pi/32)*sigma_d)*10**3)**(1/3)##mm\n",
    "print ' \\n Using equivalent bending moment equation,\\n shaft diameter d = %.2f mm or %.f mm'%(d, ceil(d))\n",
    "print ' \\n Adopt d=23 mm.'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.10 Pg 71"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " (i) Maximum Principal Stress Theory-\n",
      " \n",
      " Maximum value of torque, T = 235851 N.cm.\n",
      " \n",
      " (ii) Maximum Shear Stress Theory\n",
      " \n",
      " Maximum value of torque, T = 124765 N.cm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi\n",
    "from sympy import symbols,solve\n",
    "# Given Data\n",
    "d=4## cm\n",
    "M=15000## N.cm\n",
    "Syt=20000## N/cm.sq.\n",
    "\n",
    "print ' \\n (i) Maximum Principal Stress Theory-'\n",
    "z=pi*d**3/32## cm.cube.\n",
    "sigma_b=M/z## N/cm.sq.\n",
    "T=symbols('T')\n",
    "tau=16*T/(pi*d**3)## N/cm.sq.\n",
    "#sigma1=(1/2)*(sigma_b+sqrt(sigma_b**2+4*tau**2)) # Maximum principal stress\n",
    "#sigma1=(sigma_b/2+sqrt(sigma_b**2/4+tau**2)) # on solving\n",
    "#tau=sqrt((sigma1-sigma_b/2)**2-sigma_b**2/4)\n",
    "sigma1=Syt## N/cm.sq.\n",
    "T=sqrt((sigma1-sigma_b/2)**2-sigma_b**2/4)*(pi*d**3)/16## N.cm.\n",
    "print ' \\n Maximum value of torque, T = %.f N.cm.'%(T)\n",
    "\n",
    "print ' \\n (ii) Maximum Shear Stress Theory'\n",
    "tau_d=0.5*Syt## N.cm.\n",
    "#Te=sqrt(M**2+T**2)=(pi/16)*d**3*tau_d\n",
    "T=sqrt(((pi/16)*d**3*tau_d)**2-M**2)## N.cm.\n",
    "print ' \\n Maximum value of torque, T = %.f N.cm.'%(T)\n",
    "# Answer in the textbook is not accurate."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.11 Pg 72"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " shaft diameter(using equivalent torque)-\n",
      " d=55 mm.\n",
      " \n",
      " shaft diameter(using equivalent bending moment)-\n",
      " d=57 mm.\n",
      " \n",
      " adopt d=57 mm.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi\n",
    "# Given Data\n",
    "N=200## rpm\n",
    "P=25## kW\n",
    "tau_d=42## MPa\n",
    "W=900## N\n",
    "L=3## m\n",
    "Syt=56## MPa\n",
    "Syc=56## MPa\n",
    "sigma_d=56## MPa\n",
    "\n",
    "T=P*60*10**3/(2*pi*N)## N.m\n",
    "M=W*L/4## N.m\n",
    "Te=sqrt(M**2+T**2)## N.m\n",
    "# Te=(pi/16)*d**3*tau_d\n",
    "d=(Te*10**3/((pi/16)*tau_d))**(1/3)## mm\n",
    "print ' \\n shaft diameter(using equivalent torque)-\\n d=%.f mm.'%(d)\n",
    "\n",
    "Me=(1/2)*(M+sqrt(M**2+T**2))##N.m\n",
    "# Me=(pi/32)*d**3*sigma_d\n",
    "d=(Me*10**3/((pi/32)*sigma_d))**(1/3)## mm\n",
    "print ' \\n shaft diameter(using equivalent bending moment)-\\n d=%.f mm.'%(d)\n",
    "print ' \\n adopt d=57 mm.'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.12 Pg 72"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " value of t = 36.9 mm\n",
      " \n",
      " Area of cross-section of Hanger, A = 2716 mm.sq.\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt,pi,cos,sin\n",
    "from sympy import symbols,solve\n",
    "# Given Data\n",
    "sigma_w=60## MPa\n",
    "F=10## kN\n",
    "alfa=30## degree\n",
    "\n",
    "FH=F*sin(pi/180*alfa)## kN\n",
    "FV=F*cos(pi/180*alfa)## kN\n",
    "t=symbols('t')## mm\n",
    "A=t*t## mm.sq.\n",
    "sigma_d=FV*10**3/A\n",
    "M=FV*10**3*120+FH*10**3*150## N.mm\n",
    "I=t*(2*t)**3/12## mm**4\n",
    "sigma_t=M*t/I## N/mm.sq.\n",
    "# Tensile stress at A=sigma_d+sigma_t=sigma_w ...eqn(1)\n",
    "expr = sigma_d+sigma_t-sigma_w## polynomial from above eqn.\n",
    "t=solve(expr,'t')## roots of the polynomial\n",
    "t=t[0]## mm # discarding -ve roots\n",
    "print ' \\n value of t = %.1f mm'%(t)\n",
    "A=2*t**2## mm.sq.\n",
    "print ' \\n Area of cross-section of Hanger, A = %.f mm.sq.'%(A)\n",
    "# Note-Answer in the textbook is slighly wrong and cross section not calculated."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 3.13 Pg 74"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " shaft diameter is : 63 mm\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import tan,pi,sqrt\n",
    "# Given Data\n",
    "P=15## kW\n",
    "n1=200## rpm\n",
    "l=600## mm\n",
    "z2=18## no. of teeth\n",
    "m2=5## mm\n",
    "alfa2=14.5## degree\n",
    "l2=120## mm\n",
    "z1=72## no. of teeth\n",
    "m1=5## mm\n",
    "alfa1=14.5## degree\n",
    "l1=150## mm\n",
    "sigma_d=80## MPa\n",
    "\n",
    "d1=m1*z1## mm\n",
    "v1=pi*d1*n1/(60*10**3)## m/s\n",
    "Ft1=10**3*P/v1## N (outwards)\n",
    "Fr1=Ft1*tan(pi/180*alfa1)## N (Downwards)\n",
    "d2=m2*z2## mm\n",
    "v2=pi*d2*n1/(60*10**3)## m/s\n",
    "Ft2=10**3*P/v2## N (outwards)\n",
    "Fr2=Ft2*tan(pi/180*alfa2)## N (Upwards)\n",
    "\n",
    "# RAV*600=Fr1*450+Fr2*120 (Taking moments about bearing B)\n",
    "RAV=(Fr1*450+Fr2*120)/600## N (Downwards)\n",
    "RBV=(Fr1-Fr2-RAV)## N (upwards)\n",
    "MCV=RAV*l1## N.mm\n",
    "MBV=Fr2*l2## N.mm\n",
    "\n",
    "# RAH*600=-Ft1*450+Ft2*120 (Taking moments about bearing B)\n",
    "RAH=(-Ft1*450+Ft2*120)/600## N (Outwards)\n",
    "RBH=Ft1+Ft2+RAH## N (inwards)\n",
    "MCH=RAH*l1## N.mm\n",
    "MBH=Ft2*l2## N.mm\n",
    "\n",
    "# Resultant Bending Moments\n",
    "MC=sqrt(MCV**2+MCH**2)## N.mm\n",
    "MB=sqrt(MBV**2+MBH**2)## N.mm\n",
    "Mmax=max(MC,MB)## N.mm\n",
    "T=10**3*P/(2*pi*n1)## N.m\n",
    "Me=(1/2)*(Mmax+sqrt(Mmax**2+T**2))## N.mm\n",
    "# Me=(pi/32)*d**3*sigma_d\n",
    "d=(Me/((pi/32)*sigma_d))**(1/3)\n",
    "print ' \\n shaft diameter is : %.f mm'%(d)"
   ]
  }
 ],
 "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
}