summaryrefslogtreecommitdiff
path: root/Theory_Of_Machines/ch16.ipynb
blob: 1bb8912907feaef55ec7825c625df951674b00ca (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
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
{
 "metadata": {
  "name": "",
  "signature": "sha256:18b62f9d05dddb3fa3e34cb2cfa86e210f5eaa5cdedab202d52d0e65a17b4192"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16 : Turning Moment Diagrams and Flywheel"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.1 Page No : 573"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import linalg\n",
      "\n",
      "# Variables:\n",
      "m = 6.5*1000 \t\t#kg\n",
      "k = 1.8 \t\t\t#m\n",
      "deltaE = 56.*1000 \t#N-m\n",
      "N = 120. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Calculating the maximum and minimum speeds\n",
      "#We know that fluctuation of energy deltaE  =  math.pi**2/900*m*k**2*N*(N1-N2) or N1-N2  =  (deltaE/(math.pi**2/900*m*k**2*N))    .....(i)\n",
      "#Also mean speed N  =  (N1+N2)/2 or N1+N2  =  2*N                                                                     .....(ii)\n",
      "A = [[1, -1],[ 1, 1]]\n",
      "B = [deltaE/(math.pi**2/900*m*k**2*N), 2*N]\n",
      "V = linalg.solve(A,B)\n",
      "N1 = round(V[0]) \t\t\t#rpm\n",
      "N2 = round(V[1]) \t\t\t#rpm\n",
      "\n",
      "#Results:\n",
      "print \" Maximum speed N1  =  %d rpm.\"%(N1)\n",
      "print \" Minimum speed N2  =  %d rpm.\"%(N2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Maximum speed N1  =  121 rpm.\n",
        " Minimum speed N2  =  119 rpm.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.2 Page No : 573"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "k = 1.   \t\t\t#m\n",
      "m = 2500. \t\t\t#kg\n",
      "T = 1500. \t\t\t#N-m\n",
      "\n",
      "#Solution:\n",
      "#Angular acceleration of the flywheel:\n",
      "#Calculating the mass moment of inertia of the flywheel\n",
      "I = m*k**2 \t\t\t#kg-m**2\n",
      "#Calculating the angular acceleration of the flywheel\n",
      "alpha = T/I \t\t\t#rad/s**2\n",
      "#Kinetic energy of the flywheel:\n",
      "omega1 = 0 \t\t\t#Angular speed at rest\n",
      "#Calculating the angular speed after 10 seconds\n",
      "omega2 = omega1+alpha*10 \t\t\t#rad/s\n",
      "#Calculating the kinetic energy of the flywheel\n",
      "KE = 1./2*I*(omega2)**2/1000 \t\t\t#Kinetic energy of the flywheel kN-m\n",
      "\n",
      "#Results:\n",
      "print \" Angular acceleration of the flywheel alpha  =  %.1f rad/s**2.\"%(alpha)\n",
      "print \" Kinetic energy of the flywheel  =  %.1f kN-m.\"%(KE)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Angular acceleration of the flywheel alpha  =  0.6 rad/s**2.\n",
        " Kinetic energy of the flywheel  =  45.0 kN-m.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.3 Page No : 574"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "P = 300.*1000 \t#W\n",
      "N = 90. \t\t#rpm\n",
      "CE = 0.1\n",
      "k = 2. \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Calculating the mean angular speed\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 1./100\n",
      "#Calculating the work done per cycle\n",
      "WD = P*60/N \t\t\t#Work done per cycle N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = WD*CE \t\t\t#N-m\n",
      "#Calculating the mass of the flywheel\n",
      "m = deltaE/(k**2*omega**2*CS) \t\t\t#kg\n",
      "#Results:\n",
      "print \" Mass of the flywheel, m  =  %d kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mass of the flywheel, m  =  5628 kg.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.4 Page No : 574"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "m = 36. \t\t\t#kg\n",
      "k = 150./1000 \t\t#m\n",
      "N = 1800. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.6\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the value of 1 mm**2 on the turning moment diagram\n",
      "c = 5*math.pi/180 \t\t\t#Value of 1 mm**2 on turning miment diagram N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "#From the turning moment diagram maximum energy  =  E+295 and minimum energy  =  E-690\n",
      "deltaE = (285-(-690))*c \t\t\t#N-m\n",
      "#Calculating the coefficient of fluctuation of energy\n",
      "CS = deltaE/(m*k**2*omega**2)*100 \t\t\t#%\n",
      "\n",
      "#Results:\n",
      "print \" Coefficient of fluctuation of speed CS  =  %.1f %%.\"%(CS)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Coefficient of fluctuation of speed CS  =  0.3 %.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.5 Page No : 575"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 600. \t\t\t#rpm\n",
      "R = 0.5 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.7\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 3./100\n",
      "#Calculating the value of 1 mm**2 on turning moment diagram\n",
      "c = 600*math.pi/60 \t\t\t#Value of 1 mm**2 on turning moment diagram N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "#From the turning moment diagram maximum fluctuation  =  E+52 and minimum fluctuation  =  E-120\n",
      "deltaE = (52.-(-120))*c \t\t\t#N-m\n",
      "#Calculating the mass of the flywheel\n",
      "m = deltaE/(R**2*omega**2*CS) \t\t\t#kg\n",
      "\n",
      "#Results:\n",
      "print \" Mass of the flywheel m  =  %d kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mass of the flywheel m  =  182 kg.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.6 Page No : 584\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 250. \t\t\t#rpm\n",
      "m = 500. \t\t\t#kg\n",
      "k = 600./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.8\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the torque required for one complete cycle\n",
      "T = (6*math.pi*750)+(1./2*math.pi*(3000-750))+(2*math.pi*(3000-750))+(1./2*math.pi*(3000-750)) \t\t\t#N-m\n",
      "#Calculating the mean torque\n",
      "Tmean = T/(6*math.pi) \t\t\t#N-m\n",
      "#Calculating the power required to drive the machine\n",
      "P = Tmean*omega/1000 \t\t\t#kW\n",
      "#Coefficient of fluctuation of speed:\n",
      "#Calculating the value of LM\n",
      "LM = math.pi*((3000.-1875)/(3000-750.))\n",
      "#Calculating the value of NP\n",
      "NP = math.pi*((3000.-1875)/(3000-750))\n",
      "#Calculating the value of BM\n",
      "BM = 3000-1875. \t\t\t#N-m CN = BM\n",
      "#Calculating the value of MN\n",
      "MN = 2*math.pi\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = (1./2*LM*BM)+(MN*BM)+(1./2*NP*BM) \t\t\t#N-m\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = deltaE/(m*k**2*omega**2)\n",
      "\n",
      "#Results:\n",
      "print \" Power required to drive the machine P  =  %.3f kW.\"%(P)\n",
      "print \" Coefficient of speed CS  =  %.3f.\"%(CS)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power required to drive the machine P  =  49.087 kW.\n",
        " Coefficient of speed CS  =  0.072.\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.7 Page No : 578"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 100. \t\t\t#rpm\n",
      "k = 1.75 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.9\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 1.5/100\n",
      "#Coefficient of fluctuation of energy:\n",
      "AB = 2000.\n",
      "LM = 1500. \t\t\t#N-m\n",
      "#Calculating the work done per cycle\n",
      "WD = (1./2*math.pi*AB)+(1./2*math.pi*LM) \t\t\t#Work done per cycle N-m\n",
      "#Calculating the mean resisting torque\n",
      "Tmean = WD/(2*math.pi) \t\t\t#N-m\n",
      "#Calculating the value of CD\n",
      "CD = math.pi/2000*(2000-875) \t\t\t#rad\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = 1./2*CD*(2000-875) \t\t\t#N-m\n",
      "#Calculating the coefficient of fluctuation of energy\n",
      "Ce = deltaE/WD*100 \t\t\t#%\n",
      "#Calculating the mass of the flywheel\n",
      "m = deltaE/(k**2*omega**2*CS) \t\t\t#kg\n",
      "#Crank angles for minimum and maximum speeds:\n",
      "#Calculating the value of CE\n",
      "CE = (2000.-875)/2000*(4*math.pi/9) \t\t\t#rad\n",
      "#Calculating the crank angle for minimum speed\n",
      "thetaC = ((4.*math.pi/9)-CE)*180/math.pi \t\t\t#degrees\n",
      "#Calculating the value of ED\n",
      "ED = (2000.-875)/2000*(math.pi-(4*math.pi/9)) \t\t\t#rad\n",
      "#Calculating the crank angle for maximum speed\n",
      "thetaD = ((4.*math.pi/9)+ED)*180/math.pi \t\t\t#degrees\n",
      "\n",
      "#Results:\n",
      "print \" Coefficient of fluctuation of energy CE  =  %d %%.\"%(Ce)\n",
      "print \" Mass of the flywheel, m  =  %.1f kg.\"%(m)\n",
      "print \" Crank angle from IDC for the minimum speed, thetaC  =  %d degrees.\"%(thetaC)\n",
      "print \" Crank angle from IDC for the maximum speed, thetaD  =  %d degrees.\"%(thetaD)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Coefficient of fluctuation of energy CE  =  18 %.\n",
        " Mass of the flywheel, m  =  197.3 kg.\n",
        " Crank angle from IDC for the minimum speed, thetaC  =  35 degrees.\n",
        " Crank angle from IDC for the maximum speed, thetaD  =  136 degrees.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.8 Page No : 580"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 600. \t\t\t#rpm\n",
      "Tmax = 90. \t\t\t#N-m\n",
      "m = 12. \t\t\t#kg\n",
      "k = 80./1000 \t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.10\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Power developed:\n",
      "#Calculating the work done per cycle\n",
      "WD = 3*1./2*math.pi*90 \t\t\t#Work done per cycle N-m\n",
      "#Calculating the mean torque\n",
      "Tmean = WD/(2*math.pi) \t\t\t#N-m\\\n",
      "#Calculating the power developed\n",
      "P = Tmean*omega/1000 \t\t\t#Power developed kW\n",
      "#Coefficient of fluctuation of speed:\n",
      "#Calculating the maximum fluctuation of energy\n",
      "#From the torque-crank angle diagram maximum energy = E+5.89 and minimum energy = E-5.89\n",
      "deltaE = 5.89-(-5.89) \t\t\t#N-m\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = round(deltaE/(m*k**2*omega**2)*100) \t\t\t#%\n",
      "#Calculating the coefficient of fluctuation of energy\n",
      "CE = deltaE/WD*100 \t\t\t#%\n",
      "#Calculating the maximum angular acceleration of the flywheel\n",
      "alpha = (Tmax-Tmean)/(m*k**2) \t\t\t#rad/s**2\n",
      "\n",
      "#Results:\n",
      "print \" Power developed  =  %.2f kW.\"%(P)\n",
      "print \" Coefficient of fluctuation of speed CS  =  %d %%.\"%(CS)\n",
      "print \" Coefficient of fluctuation of energy CE  =  %.2f %%.\"%(CE)\n",
      "print \" Maximum angular acceleration of the flywheel alpha  =  %d rad/s**2.\"%(alpha)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power developed  =  4.24 kW.\n",
        " Coefficient of fluctuation of speed CS  =  4 %.\n",
        " Coefficient of fluctuation of energy CE  =  2.78 %.\n",
        " Maximum angular acceleration of the flywheel alpha  =  292 rad/s**2.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.9 Page No : 582"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "P = 20.*1000 \t\t\t#W\n",
      "N = 300. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.11\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#ra/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 4./100\n",
      "#Calculating the number of working strokes per cycle for a four stroke engine\n",
      "n = N/2\n",
      "#Calculating the work done per cycle\n",
      "WD = P*60/n \t\t\t#Work done per cycle N-m\n",
      "#Calculating the work done during expansion cycle\n",
      "WE = WD*3./2 \t\t\t#N-m\n",
      "#Calculating the maximum turning moment\n",
      "Tmax = WE*2/math.pi \t\t\t#N-m\n",
      "#Calculating the mean turning moment\n",
      "Tmean = WD/(4*math.pi) \t\t\t#N-m\n",
      "#Calculating the excess turning moment\n",
      "Texcess = Tmax-Tmean \t\t\t#N-m\n",
      "#Calculating the value of DE\n",
      "DE = Texcess/Tmax*math.pi \t\t\t#rad\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = (1./2*DE*Texcess) \t\t\t#N-m\n",
      "#Calculating the moment of inertia of the flywheel\n",
      "I = deltaE/(omega**2*CS) \t\t\t#kg-m**2\n",
      "\n",
      "#Results:\n",
      "print \" Moment of inertia of the flywheel I  =  %.1f kg-m**2.\"%(I)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Moment of inertia of the flywheel I  =  255.4 kg-m**2.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.10 Page No : 584"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "a1 = 0.45*10**-3\n",
      "a2 = 1.7*10**-3\n",
      "a3 = 6.8*10**-3\n",
      "a4 = 0.65*10**-3 \t\t\t#m**2\n",
      "N1 = 202.\n",
      "N2 = 198. \t\t\t#rpm\n",
      "R = 1.2 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.12\n",
      "#Calculating the net area\n",
      "a = a3-(a1+a2+a4) \t\t\t#Net area m**2\n",
      "#Calculating the energy scale constant\n",
      "c = 3*10**6 \t\t\t#Energy scale constant N-m\n",
      "#Calculating the net work done per cycle\n",
      "WD = a*c \t\t\t#Net work done per cycle N-m\n",
      "#Calculating the mean torque\n",
      "Tmean = round(WD/(4*math.pi)) \t\t\t#N-m\n",
      "#Calculating the value of FG\n",
      "FG = Tmean \t\t\t#N-m\n",
      "#Calculating the work done during expansion stroke\n",
      "WDe = a3*c \t\t\t#Work done during expansion stroke N-m\n",
      "#Calculating the value of AG\n",
      "AG = WDe/(1./2*math.pi) \t\t\t#N-m\n",
      "#Calculating the excess torque\n",
      "Texcess = round(AG-FG,-1) \t\t\t#N-m\n",
      "#Calculating the value of AF\n",
      "AF = Texcess \t\t\t#N-m\n",
      "#Calculating the value of DE\n",
      "DE = round(AF/AG*math.pi,1) \t\t\t#rad\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = 1./2*DE*AF \t\t\t#N-m\n",
      "#Mass of the rim of a flywheel:\n",
      "#Calculating the mean speed of the flywheel\n",
      "N = (N1+N2)/2 \t\t\t#rpm\n",
      "#Calculating the mass of the rim of a flywheel\n",
      "m = deltaE/(math.pi**2/900*R**2*N*(N1-N2)) \t\t\t#kg\n",
      "\n",
      "#Results:\n",
      "print \" Mass of the rim of the flywheel m  =  %.f kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mass of the rim of the flywheel m  =  1381 kg.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.11 page no : 585"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from scipy.integrate import quad\n",
      "\n",
      "# variables\n",
      "w = math.pi*2*180./60     # rad/s\n",
      "T = 180                   # rpm\n",
      "Cs = 0.01                 # speed\n",
      "\n",
      "# Calculations\n",
      "work_done_r = 20000 * 2    # pi N-m\n",
      "Tmean = work_done_r/2      # N-m\n",
      "power = round(Tmean * w,-3)/1000\n",
      "deltaE = 11078 \n",
      "energy = deltaE/round((w**2*Cs),2)\n",
      "excess = 9500*math.sin(math.radians(90)) - 5700*math.cos(math.radians(90))\n",
      "alpha = excess/energy\n",
      "\n",
      "# results\n",
      "print \"power developed by the engine : %.f kW\"%power\n",
      "print \"maximum fluctuation of energy : %.f kg-m**2\"%energy\n",
      "print \"Alpha a = %.3f rad/s**2\"%alpha"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "power developed by the engine : 377 kW\n",
        "maximum fluctuation of energy : 3121 kg-m**2\n",
        "Alpha a = 3.044 rad/s**2\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.12 Page No : 587"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from scipy.integrate import quad \n",
      "\n",
      "# Variables:\n",
      "m = 500. \t\t\t#kg\n",
      "k = 0.4 \t\t\t#m\n",
      "N = 150. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.14\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Fluctuation of energy:\n",
      "#Equating the change in torque to zero and calculating the value of theta\n",
      "thetaA = math.sin(math.radians(0))\n",
      "thetaC = math.sin(math.radians(0))+180\n",
      "thetaE = math.sin(math.radians(0))+360 \t\t\t#degrees\n",
      "thetaB = 65.4\n",
      "thetaD = 294.6\n",
      "\n",
      "#Calculating the maximum fluctuation of energy\n",
      "def f4(theta): \n",
      "    return (5000+600*math.sin(2*theta))-(5000+500*math.sin(theta))\n",
      "\n",
      "deltaE = round( quad(f4 ,thetaC*math.pi/180,thetaD*math.pi/180)[0])\n",
      "\n",
      "#Calculating the total percentage fluctuation of speed\n",
      "CS = deltaE/(m*k**2*omega**2)*100 \t\t\t#%\n",
      "#Maximum and minimum angular acceleration of the flywheel and the corresponding shaft positions:\n",
      "#Calculating the maximum or minimum values of theta\n",
      "#Differentiating (600*math.sin(2*theta))-500*math.sin(theta)  =  0 with respect to theta and equating to zero\n",
      "#we get 12*2*(math.cos(theta))**2-5*math.cos(theta)-12  =  0\n",
      "a = 12.*2\n",
      "b = -5.\n",
      "c = -12.\n",
      "costheta1 = (-b+math.sqrt(b**2-4*a*c))/(2*a)\n",
      "costheta2 = (-b-math.sqrt(b**2-4*a*c))/(2*a)\n",
      "theta1 = math.degrees(math.acos(costheta1))\n",
      "theta2 = math.degrees(math.acos(costheta2)) \t\t\t#degrees\n",
      "#Calculating the maximum torque\n",
      "Tmax = 600*math.sin(math.radians(2*theta1))-500*math.sin(math.radians(theta1)) \t\t\t#N-m\n",
      "#Calculating the minimum torque\n",
      "Tmin = 600*math.sin(math.radians(2*theta2))-500*math.sin(math.radians(theta2)) \t\t\t#N-m\n",
      "#Calculating the maximum acceleration\n",
      "alphamax = Tmax/(m*k**2) \t\t\t#rad/s**2\n",
      "#Calculating the minimum acceleration\n",
      "alphamin = abs(Tmin)/(m*k**2) \t\t\t#rad/s**2\n",
      "\n",
      "\n",
      "#Results:\n",
      "print \" Fluctuation of energy deltaE  =  %d N-m.\"%(deltaE)\n",
      "print \" Total percentage fluctuation of speed CS  =  %.1f %%.\"%(CS)\n",
      "print \" Shaft position corresponding to maximum and minimum accelerations\\\n",
      " theta  =  %d degrees and %.1f degrees.\"%(theta1,theta2)\n",
      "print \" Maximum acceleration, alphamax  =  %.2f rad/s**2.\"%(alphamax)\n",
      "print \" Minimum acceleration alphamin  =  %.1f rad/s**2.\"%(alphamin)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Fluctuation of energy deltaE  =  1204 N-m.\n",
        " Total percentage fluctuation of speed CS  =  6.1 %.\n",
        " Shaft position corresponding to maximum and minimum accelerations theta  =  35 degrees and 127.6 degrees.\n",
        " Maximum acceleration, alphamax  =  3.46 rad/s**2.\n",
        " Minimum acceleration alphamin  =  12.2 rad/s**2.\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.13 Page No : 589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from scipy.integrate import quad \n",
      "\n",
      "# Variables:\n",
      "I = 1000. \t\t\t#kg-m**2\n",
      "N = 300. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.15 and Fig. 16.16\n",
      "#Calculating the angular speed of the crank\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Power of the engine:\n",
      "#Calculating the work done per revolution\n",
      "def f0(theta): \n",
      "    return 5000+1500*math.sin(3*theta)\n",
      "\n",
      "WD =  quad(f0,0,2*math.pi)[0]\n",
      "\n",
      "#Calculating the mean resisting torque\n",
      "Tmean = WD/(2*math.pi) \t\t\t#N-m\n",
      "#Calculating the power of the engine\n",
      "P = Tmean*omega/1000 \t\t\t#kW\n",
      "#Maximum fluctuation of the speed of the flywheel when resisting torque is consmath.tant:\n",
      "#Calculating the value of theta \n",
      "theta = (5000-5000)/1500\n",
      "theta = 1./3*(math.sin(math.radians((theta)))+180) \t\t\t#degrees\n",
      "#Calculating the maximum fluctuation of energy\n",
      "def f1(theta): \n",
      "    return 5000+1500*math.sin(3*theta)-5000\n",
      "\n",
      "deltaE =  quad(f1,0,60*math.pi/180)[0]\n",
      "\n",
      "#Calculating the maximum fluctuation of speed of the flywheel\n",
      "CS1 = deltaE/(I*omega**2)*100 \t\t\t#%\n",
      "#Maximum fluctuation of speed of the flywheel when resisting torque (5000+600*math.sin(theta)) N-m:\n",
      "#Calculating the values of theta thetaB and thetaC\n",
      "thetaB = math.sin(math.radians(math.sqrt((1./4*(3-600./1500))))) \t\t\t#degrees\n",
      "thetaC = 180-thetaB \t\t\t#degrees\n",
      "#Calculating the maximum fluctuation of energy\n",
      "\n",
      "def f2(theta): \n",
      "    return (5000+1500*math.sin(3*theta))-(5000+600*math.sin(theta))\n",
      "\n",
      "deltaE = round( quad(f2,thetaB*math.pi/180,thetaC*math.pi/180)[0])\n",
      "\n",
      "#Calculating the maximum fluctuation of speed of the flywheel\n",
      "CS2 = abs(deltaE)/(I*omega**2)*100 \t\t\t#%\n",
      "\n",
      "#Results:\n",
      "print \" Power of the engine P  =  %.1f kW.\"%(P)\n",
      "print \" Maximum fluctuation of the speed of the flywheel when resisting torque\\\n",
      " is constant, CS  =  %.1f %%.\"%(CS1)\n",
      "print \" Maximum fluctuation of speed of the flywheel when resisting torque \\\n",
      " 5000+600*sintheta N-m CS  =  %.3f %%.\"%(CS2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power of the engine P  =  157.1 kW.\n",
        " Maximum fluctuation of the speed of the flywheel when resisting torque is constant, CS  =  0.1 %.\n",
        " Maximum fluctuation of speed of the flywheel when resisting torque  5000+600*sintheta N-m CS  =  0.020 %.\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.14 Page No : 592"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 800. \t\t\t#rpm\n",
      "stroke = 300. \t\t\t#mm\n",
      "sigma = 7.*10**6 \t\t\t#N/m**2\n",
      "rho = 7200. \t\t\t#kg/m**3\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.18\n",
      "#Calculating the angular speed of the engine\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 4./100\n",
      "#Diameter of the flywheel rim:\n",
      "#Calculating the peripheral velocity of the flywheel rim\n",
      "v = math.sqrt(sigma/rho) \t\t\t#m/s\n",
      "#Calculating the diameter of the flywheel rim\n",
      "D = v*60/(math.pi*N) \t\t\t#m\n",
      "#Cross-section of the flywheel rim:\n",
      "#Calculating the value of 1 mm**2 on the turning moment diagram\n",
      "c = 500.*math.pi/30 \t\t\t#Value of 1 mm**2 on the turning moment diagram N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = round((420.-(-30))*c) \t\t\t#N-m\n",
      "#Calculating the mass of the flywheel rim\n",
      "m = deltaE/(v**2*CS) \t\t\t#kg\n",
      "#Calculating the thickness of the flywheel rim\n",
      "t = math.sqrt(m/(math.pi*D*5*rho))*1000 \t\t\t#mm\n",
      "#Calculating the width of the flywheel rim\n",
      "b = 5*t \t\t\t                #mm\n",
      "\n",
      "#Results:\n",
      "print \" Diameter of the flywheel rim D  =  %.3f m.\"%(D)\n",
      "print \" Thickness of the flywheel rim t  =  %d mm.\"%(t)\n",
      "print \" Width of the flywheel rim b  =  %d mm.\"%(b)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Diameter of the flywheel rim D  =  0.744 m.\n",
        " Thickness of the flywheel rim t  =  84 mm.\n",
        " Width of the flywheel rim b  =  424 mm.\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.15 Page No : 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "P = 150.*1000 \t\t\t#W\n",
      "N = 80. \t\t\t#rpm\n",
      "CE = 0.1\n",
      "D = 2.\n",
      "R = D/2. \t\t\t#m\n",
      "rho = 7200. \t\t\t#kg/m**3\n",
      "\n",
      "#Solution:\n",
      "#Calculating the angular speed of the engine\n",
      "omega = round(2*math.pi*N/60,1) \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 4./100\n",
      "#Mass of the flywheel rim:\n",
      "#Calculating the work done per cycle\n",
      "WD = P*60/N \t\t\t#Work done per cycle N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = WD*CE \t\t\t#N-m\n",
      "#Calculating the mass moment of inertia of the flywheel\n",
      "I = deltaE/(omega**2*CS) \t\t\t#kg-m**2\n",
      "#Calculating the mass moment of inertia of the flywheel rim\n",
      "Irim = 0.95*I \t\t\t#kg-m**2\n",
      "#Calculating the mass of the flywheel rim\n",
      "k = R \t\t\t#Radius of gyration m\n",
      "m = Irim/k**2 \t\t\t#kg\n",
      "#Calculating the cross-sectional area of the flywheel rim\n",
      "A = m/(2*math.pi*R*rho) \t\t\t#m**2\n",
      "\n",
      "#Resilts:\n",
      "print \" Mass of the flywheel rim m  =  %.f kg.\"%(m)\n",
      "print \" Cross-sectional area of the flywheel rim A  =  %.3f m**2.\"%(A)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mass of the flywheel rim m  =  3787 kg.\n",
        " Cross-sectional area of the flywheel rim A  =  0.084 m**2.\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.16 Page No : 595"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N = 600. \t\t\t#rpm\n",
      "rho = 7250. \t\t\t#kg/m**3\n",
      "sigma = 6.*10**6 \t\t\t#N/m**2\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.19\n",
      "#Calculating the angular speed of the engine\n",
      "omega = 2.*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the total fluctuation of speed\n",
      "CS = 2./100\n",
      "#Moment of inertia of the flywheel:\n",
      "#Calculating the value of 1 mm**2 of turning moment diagram\n",
      "c = 250.*math.pi/60 \t\t\t#Value of 1 mm**2 of turning moment diagram N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = round((162.-(-35))*c) \t\t\t#N-m\n",
      "#Calculating the moment of inertia of the flywheel\n",
      "I = deltaE/(omega**2*CS) \t\t\t#kg-m**2\n",
      "#Dimensions of the flywheel rim:\n",
      "#Calculating the peripheral velocity of the flywheel\n",
      "v = math.sqrt(sigma/rho) \t\t\t#m/s\n",
      "#Calculating the mean diameter of the flywheel\n",
      "D = v*60/(math.pi*N) \t\t\t#m\n",
      "#Calculating the maximum fluctuation of energy of the flywheel rim\n",
      "deltaErim = 0.92*deltaE \t\t\t#N-m\n",
      "#Calculating the mass of the flywheel rim\n",
      "m = deltaErim/(v**2*CS) \t\t\t#kg\n",
      "#Calculating the thickness of the flywheel rim\n",
      "t = math.sqrt(m/(math.pi*D*2*rho))*1000 \t\t\t#mm\n",
      "#Calculating the breadth of the flywheel rim\n",
      "b = 2*t \t\t\t#mm\n",
      "\n",
      "#Results:\n",
      "print \" Moment of inertia of the flywheel I  =  %.1f kg-m**2.\"%(I)\n",
      "print \" Thickness of the flywheel rim t  =  %.1f mm.\"%(t)\n",
      "print \" Breadth of the flywheel rim b  =  %.1f mm.\"%(b)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Moment of inertia of the flywheel I  =  32.7 kg-m**2.\n",
        " Thickness of the flywheel rim t  =  58.6 mm.\n",
        " Breadth of the flywheel rim b  =  117.2 mm.\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.17 Page No : 596"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "a1 = 5.*10**-5          #m**2\n",
      "a2 = 21.*10**-5        #m**2\n",
      "a3 = 85.*10**-5        #m**2\n",
      "a4 = 8.*10**-5 \t\t\t#m**2\n",
      "N2 = 98.\n",
      "N1 = 102. \t\t\t#rpm\n",
      "rho = 8150. \t\t\t#kg/m**3\n",
      "sigma = 7.5*10**6 \t\t\t#N/m**2\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.20\n",
      "#Calculating the net area\n",
      "a = a3-(a1+a2+a4) \t\t\t#Net area m**2\n",
      "#Calculating the value of 1 m**2 on the turning moment diagram in terms of work\n",
      "c = 14*10**6 \t\t\t#Value of 1 m**2 on the turning moment diagram N-m\n",
      "#Calculating the net work done per cycle\n",
      "WD = a*c \t\t\t#Net work done per cycle N-m\n",
      "#Calculating the mean torque on the flywheel\n",
      "Tmean = round(WD/(4*math.pi)) \t\t\t#N-m\n",
      "FG = Tmean \t\t\t#N-m\n",
      "#Calculating the work done during expansion stroke\n",
      "WDe = int(a3*c) \t\t\t#Work done during expansion stroke N-m\n",
      "#Calculating the value of AG\n",
      "AG = int(WDe/(1./2*math.pi)) \t\t\t#N-m\n",
      "#Calculating the excess torque\n",
      "Texcess = AG-FG \t\t\t#Excess torque N-m\n",
      "AF = Texcess \t\t\t#N-m\n",
      "#Calculating the value of DE\n",
      "DE = round(AF/AG*math.pi,1) \t\t\t#rad\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = 1./2*DE*AF \t\t\t#N-m\n",
      "#Moment of inertia of the flywheel:\n",
      "#Calculating the mean speed during the cycle\n",
      "N = (N1+N2)/2 \t\t\t#rpm\n",
      "#Calculating the corresponding angular mean speed\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = (N1-N2)/N\n",
      "#Calculating the moment of inertia of the flywheel\n",
      "I = deltaE/(omega**2*CS) \t\t\t#kg-m**2\n",
      "#Size of flywheel:\n",
      "#Calculating the peripheral velocity of the flywheel\n",
      "v = math.sqrt(sigma/rho) \t\t\t#m/s\n",
      "#Calculating the mean diameter of the flywheel\n",
      "D = v*60/(math.pi*N) \t\t\t#m\n",
      "#Calculating the mass of the flywheel rim\n",
      "m = deltaE/(v**2*CS) \t\t\t#kg\n",
      "#Calculating the thickness of the flywheel rim\n",
      "t = math.sqrt(m/(math.pi*D*4*rho))*1000 \t\t\t#mm\n",
      "#Calculating the width of the flywheel rim\n",
      "b = 4*t \t\t\t#mm\n",
      "\n",
      "#Results:\n",
      "print \" Moment of inertia of the flywheel I  =  %.f kg-m**2.\"%(I)\n",
      "print \" Thickness of the flywheel rim t  =  %.1f mm.\"%(t)\n",
      "print \" Width of the flywheel rim b  =  %.1f mm.\"%(b)\n",
      "\n",
      "# rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Moment of inertia of the flywheel I  =  2316 kg-m**2.\n",
        " Thickness of the flywheel rim t  =  21.6 mm.\n",
        " Width of the flywheel rim b  =  86.3 mm.\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.18 Page No : 599"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "P = 50.*1000 \t\t\t#W\n",
      "N = 150. \t\t\t#rpm\n",
      "n = 75.\n",
      "sigma = 4.*10**6 \t\t\t#N/m**2\n",
      "rho = 7200. \t\t\t#kg/m**3\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 16.21\n",
      "#Calculating the angular speed of the engine\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the mean torque transmitted by the flywheel\n",
      "Tmean = P/omega \t\t\t#N-m\n",
      "FG = Tmean \t\t\t#N-m\n",
      "#Calculating the work done per cycle\n",
      "WD = Tmean*4*math.pi \t\t\t#Work done per cycle N-m\n",
      "#Calculating the work done during power stroke\n",
      "WDp = 1.4*WD \t\t\t#Work done during power stroke N-m\n",
      "#Calculating the maximum torque transmitted by the flywheel\n",
      "Tmax = WDp/(1./2*math.pi) \t\t\t#N-m\n",
      "BF = Tmax \t\t\t#N-m\n",
      "#Calculating the excess torque\n",
      "Texcess = Tmax-Tmean \t\t\t#N-m\n",
      "BG = Texcess \t\t\t#N-m\n",
      "#Calculating the value of DE\n",
      "DE = BG/BF*math.pi \t\t\t#N-m\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = 1./2*DE*BG \t\t\t#N-m\n",
      "#Mean diameter of the flywheel:\n",
      "#Calculating the peripheral velocity of the flywheel\n",
      "v = math.sqrt(sigma/rho) \t\t\t#m/s\n",
      "#Calculating the mean diameter of the flywheel\n",
      "D = v*60./(math.pi*N) \t\t\t#m\n",
      "#Cross-sectional dimensions of the rim:\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 1./100\n",
      "#Calculating the total energy of the flywheel\n",
      "E = deltaE/(2*CS) \t\t\t#N-m\n",
      "#Calculating the energy of the rim\n",
      "Erim = 15./16*E \t\t\t#N-m\n",
      "#Calculating the mass of the flywheel rim\n",
      "m = Erim/(1./2*v**2) \t\t\t#kg\n",
      "#Calculating the thickness of the rim\n",
      "t = round(math.sqrt(m/(math.pi*D*4*rho))*1000) \t\t\t#mm\n",
      "#Calculating the width of the rim\n",
      "b = 4*t \t\t\t#mm\n",
      "\n",
      "#Results:\n",
      "print \" Mean diameter of the flywheel D  =  %d m.\"%(D)\n",
      "print \" Thickness of the flywheel rim t  =  %d mm.\"%(t)\n",
      "print \" Width of the flywheel rim b  =  %d mm.\"%(b)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mean diameter of the flywheel D  =  3 m.\n",
        " Thickness of the flywheel rim t  =  170 mm.\n",
        " Width of the flywheel rim b  =  680 mm.\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.19 Page No : 603"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "N1 = 225.\n",
      "N2 = 200. \t\t\t#rpm\n",
      "k = 0.5 \t\t\t#m\n",
      "E1 = 15.*1000 \t\t\t#N-m\n",
      "HolePunched = 720. \t\t\t#per hour\n",
      "\n",
      "#Solution:\n",
      "#Power of the motor:\n",
      "#Calculating the total energy required per second\n",
      "E = E1*HolePunched/3600 \t\t\t#N-m/s\n",
      "#Calculating the power of the motor\n",
      "P = E/1000 \t\t\t#kW\n",
      "#Minimum mass of the flywheel:\n",
      "#Calculating the energy supplied by the motor in 2 seconds\n",
      "E2 = E*2 \t\t\t#N-m\n",
      "#Calculating the energy supplied by the flywheel during punching\n",
      "deltaE = E1-E2 \t\t\t#N-m\n",
      "#Calculating the mean speed of the flywheel\n",
      "N = (N1+N2)/2 \t\t\t#rpm\n",
      "#Calculating the minimum mass of the flywheel\n",
      "m = round(deltaE*900/(math.pi**2*k**2*N*(N1-N2))) \t\t\t#kg\n",
      "\n",
      "#Results:\n",
      "print \" Power of the motor P  =  %d kW.\"%(P)\n",
      "print \" Minimum mass of the flywheel m  =  %d kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power of the motor P  =  3 kW.\n",
        " Minimum mass of the flywheel m  =  618 kg.\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.20 Page No : 603"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "d = 38.             #mm\n",
      "t = 32.             #mm\n",
      "s = 100. \t\t\t#mm\n",
      "E1 = 7. \t\t\t#N-m/mm**2 of sheared area\n",
      "v = 25. \t\t\t#m/s\n",
      "\n",
      "#Solution:\n",
      "#Power of the motor required:\n",
      "#Calculating the sheared area\n",
      "A = round(math.pi*d*t) \t\t\t#mm**2\n",
      "#Calculating the total energy required per hole\n",
      "E1 = E1*A \t\t\t#N-m\n",
      "#Calculating the energy required for punching work per second\n",
      "E = E1/10 \t\t\t#Energy required for punching work per second N-m/s\n",
      "#Calculating the power of the motor required\n",
      "P = E/1000 \t\t\t#Power of the motor required kW\n",
      "#Mass of the flywheel required:\n",
      "#Calculating the time required to punch a hole in a 32 mm thick plate\n",
      "t32 = 10/(2*s)*t \t\t\t#Time required to punch a hole in 32 mm thick plate seconds\n",
      "#Calculating the energy supplied by the motor in t32 seconds\n",
      "E2 = E*t32 \t\t\t#N-m\n",
      "#Calculating the energy to be supplied by the flywheel during punching\n",
      "deltaE = E1-E2 \t\t\t#N-m\n",
      "#Calculating the coefficient of fluctuation of speed\n",
      "CS = 3/100.\n",
      "#Calculating the mass of the flywheel required\n",
      "m = round(deltaE/(v**2*CS)) \t\t\t#kg\n",
      "\n",
      "#Results:\n",
      "print \" Power of the motor required P  =  %.3f kW.\"%(P)\n",
      "print \" Mass of the flywheel required m  =  %d kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power of the motor required P  =  2.674 kW.\n",
        " Mass of the flywheel required m  =  1198 kg.\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.21 Page No : 604"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "P = 3. \t\t\t#kW\n",
      "m = 150. \t\t\t#kg\n",
      "k = 0.6 \t\t\t#m\n",
      "N1 = 300. \t\t\t#rpm\n",
      "\n",
      "#Solution:\n",
      "#Calculating the angular speed of the flywheel before riveting\n",
      "omega1 = 2*math.pi*N1/60 \t\t\t#rad/s\n",
      "#Speed of the flywheel immediately after riveting:\n",
      "#Calculating the energy supplied by the motor\n",
      "E2 = P*1000 \t\t\t#N-m/s\n",
      "#Calculating the energy absorbed during one riveting operation which takes 1 second\n",
      "E1 = 10000 \t\t\t#N-m\n",
      "#Calculating the energy to be supplied by the flywheel for each riveting operation per second\n",
      "deltaE = E1-E2 \t\t\t#N-m\n",
      "#Calculating the angular speed of the flywheel immediately after riveting\n",
      "omega2 = math.sqrt(omega1**2-(2*deltaE/(m*k**2))) \t\t\t#rad/s\n",
      "#Calculating the corresponding speed in rpm\n",
      "N2 = omega2*60/(2*math.pi) \t\t\t#rpm\n",
      "#Calculating the number of rivets that can be closed per minute\n",
      "n = E2/E1*60 \t\t\t#Number of rivets that can be closed per minute\n",
      "\n",
      "#Results:\n",
      "print \" Speed of the flywheel immediately after riveting N2  =  %.1f rpm.\"%(N2)\n",
      "print \" Number of rivets that can be closed per minute  =  %d rivets.\"%(n)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Speed of the flywheel immediately after riveting N2  =  257.6 rpm.\n",
        " Number of rivets that can be closed per minute  =  18 rivets.\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.22 Page No : 605"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "d = 40.             #mm\n",
      "t = 15. \t\t\t#mm\n",
      "NoofHoles = 30. \t\t\t#per minute\n",
      "EnergyRequired = 6. \t\t\t#N-m/mm**2\n",
      "Time = 1./10 \t\t\t#seconds\n",
      "N1 = 160.\n",
      "N2 = 140. \t\t\t#rpm\n",
      "k = 1. \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Calculating the sheared area per hole\n",
      "A = round(math.pi*d*t) \t\t\t#Sheared area per hole mm**2\n",
      "#Calculating the energy required to punch a hole\n",
      "E1 = EnergyRequired*A \t\t\t#N-m\n",
      "#Calculating the energy required for punching work per second\n",
      "E = E1*NoofHoles/60 \t\t\t#Energy required for punching work per second N-m/s\n",
      "#Calculating the energy supplied by the motor during the time of punching\n",
      "E2 = E*Time \t\t\t#N-m\n",
      "#Calculating the energy to be supplied by the flywheel during punching a hole\n",
      "deltaE = E1-E2 \t\t\t#N-m\n",
      "#Calculating the mean speed of the flywheel\n",
      "N = (N1+N2)/2 \t\t\t#rpm\n",
      "#Calculating the mass of the flywheel required\n",
      "m = round(deltaE*900/(math.pi**2*k**2*N*(N1-N2))) \t\t\t#kg\n",
      "\n",
      "#Results:\n",
      "print \" Mass of the flywheel required m  =  %d kg.\"%(m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Mass of the flywheel required m  =  327 kg.\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.23 Page No : 606"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "n = 25.\n",
      "d1 = 25./1000      #m\n",
      "t1 = 18./1000      #m\n",
      "D = 1.4\n",
      "R = D/2 \t\t\t#m\n",
      "touu = 300.*10**6 \t\t\t#N/m**2\n",
      "etam = 95./100\n",
      "CS = 0.1\n",
      "sigma = 6.*10**6 \t\t\t#N/m**2\n",
      "rho = 7250. \t\t\t#kg/m**3\n",
      "\n",
      "#Solution:\n",
      "#Power needed for the driving motor:\n",
      "#Calculating the area of the plate sheared\n",
      "AS = math.pi*d1*t1 \t\t\t#m**2\n",
      "#Calculating the maximum shearing force required for punching\n",
      "FS = AS*touu \t\t\t#N\n",
      "#Calculating the energy required per stroke\n",
      "E = 1./2*FS*t1 \t\t\t#Energy required per stroke N-m\n",
      "#Calculating the energy required per minute\n",
      "E1 = E*n \t\t\t#Energy required per minute N-m\n",
      "#Calculating the power required for the driving motor\n",
      "P = E1/(60*etam)/1000 \t\t\t#Energy required for the driving motor kW\n",
      "#Dimensions for the rim cross-section:\n",
      "#Calculating the maximum fluctuation of energy\n",
      "deltaE = 9./10*E \t\t\t#N-m\n",
      "#Calculating the maximum fluctuation of energy provided by the rim\n",
      "deltaErim = 0.95*deltaE \t\t\t#N-m\n",
      "#Calculating the mean speed of the flywheel\n",
      "N = 9.*25 \t\t\t#rpm\n",
      "#Calculating the mean angular speed\n",
      "omega = 2*math.pi*N/60 \t\t\t#rad/s\n",
      "#Calculating the mass of the flywheel\n",
      "m = round(deltaErim/(R**2*omega**2*CS)) \t\t\t#kg\n",
      "#Calculating the thickness of rim\n",
      "t = math.sqrt(m/(math.pi*D*2*rho))*1000 \t\t\t#mm\n",
      "#Calculating the width of rim\n",
      "b = 2*t \t\t\t#mm\n",
      "\n",
      "#Results:\n",
      "print \" Power needed for the driving motor  =  %.3f kW.\"%(P)\n",
      "print \" Thickness of the flywheel rim t  =  %d mm.\"%(t)\n",
      "print \" Width of the flywheel rim b  =  %d mm.\"%(b)\n",
      "#Answers vary due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Power needed for the driving motor  =  1.674 kW.\n",
        " Thickness of the flywheel rim t  =  43 mm.\n",
        " Width of the flywheel rim b  =  86 mm.\n"
       ]
      }
     ],
     "prompt_number": 32
    }
   ],
   "metadata": {}
  }
 ]
}