summaryrefslogtreecommitdiff
path: root/Thermal_Engineering_by_A._V._Arasu/ch4.ipynb
blob: 09c1bcde83b7d0e4377aa2eef437aae23bc720d9 (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
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4 :  Steam nozzles and Steam turbines"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.1  Page no : 161"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Throat area is 255 mm**2  \n",
      "Exit area is 344 mm**2  \n",
      "Mach number at exit is 1.49\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "P1 = 3.5;\t\t\t#Pressure at entry in MN/(m**2)\n",
    "T1 = 773.;\t\t\t#Temperature at entry in K\n",
    "P2 = 0.7;\t\t\t#Pressure at exit in MN/(m**2)\n",
    "ma = 1.3;\t\t\t#mass flow rate of air in kg/s\n",
    "y = 1.4;\t\t\t#Ratio of specific heats\n",
    "R = 0.287;\t\t\t#Universal gas constant in KJ/Kg-K\n",
    "\n",
    "# Calculations\n",
    "c = y/(y-1);        \t\t\t#Ratio\n",
    "Pt = ((2/(y+1))**c)*P1;\t\t\t#Throat pressure in MN/(m**2)\n",
    "v1 = (R*T1)/(P1*1000);\t\t\t#Specific volume at entry in (m**3)/kg\n",
    "Ct = ((2*c*P1*v1*(1-((Pt/P1)**(1/c))))**0.5)*1000;\t\t\t#Velocity at throat in m/s\n",
    "vt = v1*((P1/Pt)**(1/y));\t\t\t#Specific volume at throat in (m**3)/kg\n",
    "At = ((ma*vt)/Ct)*(10**6);\t\t\t#Area of throat in (mm**2)\n",
    "C2 = ((2*c*P1*v1*(1-((P2/P1)**(1/c))))**0.5)*1000;\t\t\t#Velocity at exit in m/s\n",
    "v2 = v1*((P1/P2)**(1/y));\t\t\t#Specific volume at exit in (m**3)/kg\n",
    "A2 = ((ma*v2)/C2)*(10**6);\t\t\t#Area of exit in (mm**2)\n",
    "M = C2/Ct;\t\t\t            #Mach number at exit\n",
    "\n",
    "# Results\n",
    "print 'Throat area is %3.0f mm**2  \\\n",
    "\\nExit area is %3.0f mm**2  \\\n",
    "\\nMach number at exit is %3.2f'%(At,A2,M)\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.2  Page no : 163"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Increase in temperature is 356 K  \n",
      "Increase in pressure is 2.46 MN/m**2  \n",
      "Increase in internal energy is 255 kJ/kg\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "T1 = 273.;\t\t\t#Temperature at section 1 in K\n",
    "P1 = 140.;\t\t\t#Pressure at section 1 in KN/(m**2)\n",
    "v1 = 900.;\t\t\t#Velocity at section 1 in m/s\n",
    "v2 = 300.;\t\t\t#Velocity at section 2 in m/s\n",
    "Cp = 1.006;\t\t\t#Specific heat at constant pressure in kJ/kg-K\n",
    "Cv = 0.717;\t\t\t#Specific heat at constant volume in kJ/kg-K\n",
    "y = 1.4;\t\t\t#Ratio of specific heats\n",
    "\n",
    "# Calculations\n",
    "c = y/(y-1);\t\t\t#Ratio\n",
    "R = Cp-Cv;\t\t\t#Universal gas constant in KJ/Kg-K\n",
    "T2 = T1-(((v2)**2-(v1)**2)/(2000*c*R));\t\t\t#Temperature at section 2 in K\n",
    "DT = T2-T1;\t\t\t#Increase in temperature in K\n",
    "P2 = P1*((T2/T1)**c);\t\t\t#Pressure at section 2 in KN/(m**2)\n",
    "DP = (P2-P1)/1000;\t\t\t#Increase in pressure in MN/(m**2)\n",
    "IE = Cv*(T2-T1);\t\t\t#Increase in internal energy in kJ/kg\n",
    "\n",
    "# Results\n",
    "print 'Increase in temperature is %3.0f K  \\\n",
    "\\nIncrease in pressure is %3.2f MN/m**2  \\\n",
    "\\nIncrease in internal energy is %3.0f kJ/kg'%(DT,DP,IE)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.3  Page no : 163"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Throat area is 2888 mm**2  \n",
      "Exit area is 4280 mm**2  \n",
      "Degree of undercooling at exit is 10.3 K\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "# Variables\n",
    "P1 = 2;\t\t\t#Pressure at entry in MN/(m**2)\n",
    "T1 = 598;\t\t\t#Temperature at entry in K\n",
    "P2 = 0.36;\t\t\t#Pressure at exit in MN/(m**2)\n",
    "m = 7.5;\t\t\t#mass flow rate of steam in kg/s\n",
    "n = 1.3;\t\t\t#Adiabatic gas constant\n",
    "v1 = 0.132;\t\t\t#Volume at entry in (m**3)/kg from steam table\n",
    "Ts = 412.9;\t\t\t#Saturation temperature in K\n",
    "\n",
    "# Calculations\n",
    "c = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**c)*P1;\t\t\t#Throat pressure in MN/(m**2)\n",
    "Ct = ((2*c*P1*v1*(1-((Pt/P1)**(1/c))))**0.5)*1000;\t\t\t#Velocity at throat in m/s\n",
    "vt = v1*((P1/Pt)**(1/n));\t\t\t#Specific volume at throat in (m**3)/kg\n",
    "At = ((m*vt)/Ct)*(10**6);\t\t\t#Area of throat in (mm**2)\n",
    "C2 = ((2*c*P1*v1*(1-((P2/P1)**(1/c))))**0.5)*1000;\t\t\t#Velocity at exit in m/s\n",
    "v2 = v1*((P1/P2)**(1/n));\t\t\t#Specific volume at exit in (m**3)/kg\n",
    "A2 = ((m*v2)/C2)*(10**6);\t\t\t#Area of exit in (mm**2)\n",
    "T2 = T1*((P2/P1)**(1/c));\t\t\t#Temperature at exit in K\n",
    "D = Ts-T2;\t\t\t#Degree of undercooling at exit in K\n",
    "\n",
    "# Results\n",
    "print 'Throat area is %3.0f mm**2  \\\n",
    "\\nExit area is %3.0f mm**2  \\\n",
    "\\nDegree of undercooling at exit is %3.1f K'%(At,round(A2,-1),D)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.4  Page no : 165"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Throat velocity is 548 m/s  \n",
      "Exit velocity is 800 m/s  \n",
      "Throat area is 3210 mm**2  \n",
      "Exit area is 6050 mm**2 \n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "# Variables\n",
    "P1 = 2.2;\t\t\t#Pressure at entry in MN/(m**2)\n",
    "T1 = 533.;\t\t\t#Temperature at entry in K\n",
    "P2 = 0.4;\t\t\t#Pressure at exit in MN/(m**2)\n",
    "m = 11.;\t\t\t#mass flow rate of steam in kg/s\n",
    "n = 0.85;\t\t\t#Efficiency of expansion\n",
    "h1 = 2940.;\t\t\t#Enthalpy at entrance in kJ/kg from Moiller chart\n",
    "ht = 2790.;\t\t\t#Enthalpy at throat in kJ/kg from Moiller chart\n",
    "h2s = 2590.;\t\t\t#Enthalpy below exit level in kJ/kg from Moiller chart\n",
    "vt = 0.16;\t\t\t#Throat volume in (m**3)/kg\n",
    "v2 = 0.44;\t\t\t#Volume at exit in (m**3)/kg\n",
    "\n",
    "# Calculations\n",
    "Ct = (2000*(h1-ht))**0.5;\t\t\t#Throat velocity in m/s\n",
    "h2 = ht-(0.85*(ht-h2s));\t\t\t#Enthalpy at exit in kJ/kg\n",
    "C2 = (2000*(h1-h2))**0.5;\t\t\t#Exit velocity in m/s\n",
    "At = ((m*vt)/Ct)*(10**6);\t\t\t#Area of throat in (mm**2)\n",
    "A2 = ((m*v2)/C2)*(10**6);\t\t\t#Area of exit in (mm**2)\n",
    "\n",
    "# Results\n",
    "print 'Throat velocity is %3.0f m/s  \\\n",
    "\\nExit velocity is %3.0f m/s  \\\n",
    "\\nThroat area is %3.0f mm**2  \\\n",
    "\\nExit area is %3.0f mm**2 '%(Ct,C2,round(At,-1),A2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.5  Page no : 166"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cross section of nozzle is 26.7 mm * 8.9 mm  \n",
      "Degree of undercooling is 35.8 K and Degree of supersaturation is 2.58  \n",
      "Loss in available heat drop due to irreversibility is 6.16 kJ/kg  \n",
      "Increase in entropy is 0.01390 kJ/kg-K  \n",
      "Ratio of mass flow rate with metastable expansion to the thermal expansion is 1.065\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "# Variables\n",
    "P1 = 35.;\t\t\t#Pressure at entry in bar\n",
    "T1 = 573.;\t\t\t#Temperature at entry in K\n",
    "P2 = 8.;\t\t\t#Pressure at exit in bar\n",
    "Ts = 443.4;\t\t\t#Saturation temperature in K\n",
    "Ps = 3.1;\t\t\t#Saturation pressure in bar\n",
    "m = 5.2;\t\t\t#mass flow rate of steam in kg/s\n",
    "n = 1.3;\t\t\t#Adiabatic gas consmath.tant\n",
    "v1 = 0.06842;\t\t\t#Specific volume at entry in (m**3)/kg from steam table\n",
    "v3 = 0.2292;\t\t\t#Specific volume at exit in (m**3)/kg from steam table\n",
    "h1 = 2979.;\t\t\t#Enthalpy in kJ/kg from Moiller chart\n",
    "h3 = 2673.3;\t\t\t#Enthalpy in kJ/kg from Moiller chart\n",
    "\n",
    "# Calculations\n",
    "c = n/(n-1);\t\t\t#Ratio\n",
    "C2 = ((2*c*P1*(10**5)*v1*(1-((P2/P1)**(1/c))))**0.5);\t\t\t#Velocity at exit in m/s\n",
    "v2 = v1*((P1/P2)**(1/n));\t\t\t#Specific volume at exit in (m**3)/kg\n",
    "A2 = ((m*v2)/C2)*(10**4);\t\t\t#Area of exit in (cm**2)\n",
    "a = ((A2/18)**0.5)*10;\t\t\t#Length in mm\n",
    "b = 3*a;\t\t\t#Breadth in mm\n",
    "T2 = T1*((P2/P1)**(1/c));\t\t\t#Temperature at exit in K\n",
    "D = Ts-T2;\t\t\t#Degree of undercooling in K\n",
    "Ds = P2/Ps;\t\t\t#Degree of supersaturation\n",
    "hI = h1-h3;\t\t\t#Isentropic enthalpy drop in kJ/kg\n",
    "ha = (C2**2)/2000;\t\t\t#Actual enthalpy drop in kJ/kg\n",
    "QL = hI-ha;\t\t\t#Loss in available heat in kJ/kg\n",
    "DS = QL/Ts;\t\t\t#Increase in entropy in kJ/kg-K\n",
    "C3 = (2000*(h1-h3))**0.5;\t\t\t#Exit velocity from nozzle\n",
    "mf = ((A2*C3*(10**-4))/v3);\t\t\t#Mass flow rate in kg/s\n",
    "Rm = m/mf;\t\t\t#Ratio of mass rate\n",
    "\n",
    "# Results\n",
    "print 'Cross section of nozzle is %3.1f mm * %3.1f mm  \\\n",
    "\\nDegree of undercooling is %3.1f K and Degree of supersaturation is %3.2f  \\\n",
    "\\nLoss in available heat drop due to irreversibility is %3.2f kJ/kg  \\\n",
    "\\nIncrease in entropy is %3.5f kJ/kg-K  \\\n",
    "\\nRatio of mass flow rate with metastable expansion to the thermal expansion is %3.3f'%(b,a,D,Ds,QL,DS,Rm)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.6  Page no : 169"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Nozzle efficiency is 88.9 percent  \n",
      "Exit area is 7000 mm**2  \n",
      "Throat velocity is 529 m/s\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math\n",
    "\n",
    "# Variables\n",
    "m = 14.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "P1 = 3.;\t\t\t#Pressure of Steam in MN/(m**2)\n",
    "T1 = 300.;\t\t\t#Steam temperature in oC\n",
    "h1 = 2990.;\t\t\t#Enthalpy at point 1 in kJ/kg\n",
    "h2s = 2630.;\t\t\t#Enthalpy at point 2s in kJ/kg\n",
    "ht = 2850.;\t\t\t#Enthalpy at point t in kJ/kg\n",
    "n = 1.3;\t\t\t#Adiabatic gas consmath.tant\n",
    "C2 = 800.;\t\t\t#Exit velocity in m/s\n",
    "v2 = 0.4;\t\t\t#Specific volume at exit in (m**3)/kg\n",
    "\n",
    "# Calculations\n",
    "x = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**x)*P1;\t\t\t#Temperature at point t in MN/(m**2)\n",
    "h2 = h1-((C2**2)/2000);\t\t\t#Exit enthalpy in kJ/kg\n",
    "nN = ((h1-h2)/(h1-h2s))*100;\t\t\t#Nozzle efficiency\n",
    "A2 = ((m*v2)/C2)*(10**6);\t\t\t#Exit area in (mm**2)\n",
    "Ct = math.sqrt(2*(h1-ht)*10**3);\t\t\t#Throat velocity in m/s\n",
    "\n",
    "# Results\n",
    "print 'Nozzle efficiency is %3.1f percent  \\\n",
    "\\nExit area is %3.0f mm**2  \\\n",
    "\\nThroat velocity is %3.0f m/s'%(nN,A2,Ct)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.7  Page no : 170"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Throat area is 388 mm**2  \n",
      "Exit area is 1275 mm**2  \n",
      "Steam quality at exit is  95 percent\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "P1 = 10.;\t\t\t#Pressure at point 1 in bar\n",
    "P2 = 0.5;\t\t\t#Pressure at point 2 in bar\n",
    "h1 = 3050.;\t\t\t#Enthalpy at point 1 in kJ/kg\n",
    "h2s = 2480.;\t\t\t#Enthalpy at point 2s in kJ/kg\n",
    "ht = 2910.;\t\t\t#Enthalpy at throat in kJ/kg\n",
    "n = 1.3;\t\t\t#Adiabatic gas constant\n",
    "r = 0.1;\t\t\t#Total available heat drop\n",
    "v1 = 0.258;\t\t\t#Specific volume at point 1 in (m**3)/kg\n",
    "h2f = 340.6;\t\t\t#Enthalpy for exit pressure from steam tables in kJ/kg\n",
    "hfg = 2305.4;\t\t\t#Enthalpy for exit pressure from steam tables in kJ/kg\n",
    "m = 0.5;\t\t\t#Mass flow rate in kg/s\n",
    "\n",
    "# Calculations\n",
    "x = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**x)*P1;\t\t\t#Temperature at throat in bar\n",
    "h2 = h2s+(r*(h1-h2s));\t\t\t#Enthalpy at point 2 in kJ/kg\n",
    "vt = ((P1/Pt)**(1/n))*v1;\t\t\t#Specific volume at throat in (m**3)/kg\n",
    "v2 = ((P1/P2)**(1/n))*v1;\t\t\t#Specific volume at point 2 in (m**3)/kg\n",
    "Ct = math.sqrt(2000*(h1-ht));\t\t\t#Throat velocity in m/s\n",
    "At = ((m*vt)/Ct)*(10**6);\t\t\t#Throat area in (mm**2)\n",
    "C2 = math.sqrt(2000*(h1-h2));\t\t\t#Exit velocity in m/s\n",
    "A2 = ((m*v2)/C2)*(10**6);\t\t\t#Exit area in (mm**2)\n",
    "x2 = ((h2-h2f)/hfg)*100;\t\t\t#Steam quality at exit\n",
    "\n",
    "# Results\n",
    "print 'Throat area is %d mm**2  \\\n",
    "\\nExit area is %d mm**2  \\\n",
    "\\nSteam quality at exit is %3.0f percent'%(At,A2,x2)\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.8  Page no : 171"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maximum discharge is 13.294 kg/min  \n",
      "Exit area is 493.8 mm**2\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "P1 = 3.5;\t\t\t#Dry saturated steam in bar\n",
    "P2 = 1.1;\t\t\t#Exit pressure in bar\n",
    "At = 4.4;\t\t\t#Throat area in cm**2\n",
    "h1 = 2731.6;\t\t\t#Enthalpy at P1 in kJ/kg\n",
    "v1 = 0.52397;\t\t\t#Specific volume at P1 in m**3/kg\n",
    "n = 1.135;\t\t\t#Adiabatic gas constant\n",
    "ht = 2640.;\t\t\t#Enthalpy at Pt in kJ/kg\n",
    "vt = 0.85;\t\t\t#Specific volume at throat in m**3/kg\n",
    "h2 = 2520.;\t\t\t#Enthalpy at P2 in kJ/kg\n",
    "v2 = 1.45;\t\t\t#Specific volume at P2 in m**3/kg\n",
    "\n",
    "# Calculations\n",
    "x = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**x)*P1;\t\t\t#Throat pressure in bar\n",
    "Ct = math.sqrt(2000*(h1-ht));\t\t\t#Throat velocity in m/s\n",
    "mmax = ((At*Ct*(10**-4))/vt)*60;\t\t\t#Maximum discharge in kg/min\n",
    "C2 = math.sqrt(2000*(h1-h2));\t\t\t#Exit velocity in m/s\n",
    "A2 = ((mmax*v2)/(C2*60))*(10**6);\t\t\t#Exit area in mm**2\n",
    "\n",
    "# Results\n",
    "print 'Maximum discharge is %3.3f kg/min  \\\n",
    "\\nExit area is %3.1f mm**2'%(mmax,A2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.9  Page no : 172"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Since throat pressure is greater than exit pressure,nozzle used is convergent-divergent nozzle   \n",
      "Minimum area of nozzle required is 2.14e-03 m**2\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "P1 = 10.;\t\t\t#Pressure at point 1 in bar\n",
    "T1 = 200.;\t\t\t#Temperature at point 1 in oC\n",
    "P2 = 5.;\t\t\t#Pressure at point 2 in bar\n",
    "n = 1.3;\t\t\t#Adiabatic gas consmath.tant\n",
    "h1 = 2830.;\t\t\t#Enthalpy at P1 in kJ/kg\n",
    "ht = 2710.;\t\t\t#Enthalpy at point Pt in kJ/kg\n",
    "vt = 0.35;\t\t\t#Specific volume at Pt in m**3/kg\n",
    "m = 3.  \t\t\t#Nozzle flow in kg/s\n",
    "\n",
    "# Calculations\n",
    "x = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**x)*P1;\t\t\t#Throat pressure in bar\n",
    "Ct = math.sqrt(2000*(h1-ht));\t\t\t#Throat velocity in m/s\n",
    "At = (m*vt)/Ct;\t\t\t#Throat area in m**2\n",
    "\n",
    "# Results\n",
    "print 'Since throat pressure is greater than exit pressure,nozzle used is\\\n",
    " convergent-divergent nozzle  \\\n",
    " \\nMinimum area of nozzle required is %.2e m**2'%(At)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.10  Page no : 173"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Throat velocity is 443.27 m/s  \n",
      "Mass flow rate of steam is 1549.90 kg/m**2\n"
     ]
    }
   ],
   "source": [
    "import math \n",
    "\n",
    "# Variables\n",
    "P1 = 10.5;\t\t\t#Pressure at point 1 in bar\n",
    "x1 = 0.95;\t\t\t#Dryness fraction\n",
    "n = 1.135;\t\t\t#Adiabatic gas constant\n",
    "P2 = 0.85;\t\t\t#Pressure at point 2 in bar\n",
    "vg = 0.185;\t\t\t#Specific volume in m**3/kg\n",
    "\n",
    "\n",
    "# Calculations\n",
    "c = n/(n-1);\t\t\t#Ratio\n",
    "Pt = round(((2/(n+1))**c)*P1,2);\t\t\t#Throat pressure in MN/(m**2)\n",
    "v1 = round(x1*vg,3);\t\t\t#Specific volume at point 1 in m**3/kg\n",
    "Ct = round(math.sqrt((2*n*P1*v1*(10**5)/(n+1))),2);\t\t\t#Velocity at throat in m/s\n",
    "vt = round(((P1/Pt)*(v1**n))**(1/1.135),3);\t\t\t#Specific volume at throat in m**3/kg\n",
    "m = Ct/vt;\t\t\t#Mass flow rate per unit throat area in kg/(m**2)\n",
    "\n",
    "# Results\n",
    "print 'Throat velocity is %3.2f m/s  \\\n",
    "\\nMass flow rate of steam is %3.2f kg/m**2'%(Ct,m)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.11  Page no : 174"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Degree of supersaturation is 4.98  \n",
      "Degree of undercooling  50 C\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "P1 = 10.;\t\t\t#Pressure at point 1 in bar\n",
    "T1 = 452.9;\t\t\t#Temperature at point 1 in K\n",
    "P2 = 4.;\t\t\t#Pressure at point 2 in bar\n",
    "n = 1.3;\t\t\t#Adiabatic gas constant\n",
    "Ps = 0.803;\t\t\t#Saturation pressure at T2 in bar\n",
    "Ts = 143.6;\t\t\t#Saturation temperature at P2 in oC\n",
    "# Calculations\n",
    "x = (n-1)/n;\t\t\t#Ratio\n",
    "T2 = ((P2/P1)**x)*T1;\t\t\t#Temperature at point 2 in K\n",
    "Ds = P2/Ps;\t\t\t#Degree of supersaturation\n",
    "Du = Ts-(T2-273);\t\t\t#Degree of undercooling\n",
    "\n",
    "# Results\n",
    "print 'Degree of supersaturation is %3.2f  \\\n",
    "\\nDegree of undercooling %3.0f C'%(Ds,Du)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.12  Page no : 174"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Quantity of steam used per second is 0.012 kg/s  \n",
      "Exit velocity of steam is 816.09 m/s\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "P1 = 9.;\t\t\t#Pressure at point 1 in bar\n",
    "P2 = 1.;\t\t\t#Pressure at point 2 in bar\n",
    "Dt = 0.0025;\t\t\t#Throat diameter in m\n",
    "nN = 0.9;\t\t\t#Nozzle efficiency\n",
    "n = 1.135;\t\t\t#Adiabatic gas constant\n",
    "h1 = 2770.;\t\t\t#Enthalpy at point 1 in kJ/kg\n",
    "ht = 2670.;\t\t\t#Throat enthlapy in kJ/kg\n",
    "h3 = 2400.;\t\t\t#Enthlapy at point 2 in kJ/kg\n",
    "x2 = 0.96;\t\t\t#Dryness fraction 2\n",
    "vg2 = 0.361;\t\t\t#Specific volume in m**3/kg\n",
    "\n",
    "# Calculations\n",
    "x = n/(n-1);\t\t\t#Ratio\n",
    "Pt = ((2/(n+1))**x)*P1;\t\t\t#Throat pressure in bar\n",
    "Ct = math.sqrt(2000*(h1-ht)*nN);\t\t\t#Throat velocity in m/s\n",
    "At = (3.147*2*(Dt**2))/4;\t\t\t#Throat area in m**2\n",
    "vt = x2*vg2;\t\t\t#Specific volume at throat in m**3/kg\n",
    "m = (At*Ct)/vt;\t\t\t#Mass flow rate of steam in kg/s\n",
    "hact = nN*(h1-h3);\t\t\t#Actual enthalpy drop in kJ/kg\n",
    "C2 = math.sqrt(2000*hact);\t\t\t#Exit velocity of steam in m/s\n",
    "\n",
    "# Results\n",
    "print 'Quantity of steam used per second is %3.3f kg/s  \\\n",
    "\\nExit velocity of steam is %3.2f m/s'%(m,C2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.13  Page no : 202"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blade angles are  33 degrees,  33 degrees  \n",
      "Tangential force on blades is 840 N  \n",
      "Axial thrust is   0  \n",
      "Diagram power is 336 kW  \n",
      "Diagram efficiency 89.6 percent\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "C1 = 1000.;\t\t\t#Steam velocity in m/s\n",
    "a1 = 20.;\t\t\t#Nozzle angle in degrees\n",
    "U = 400.;\t\t\t#Mean blade speed in m/s\n",
    "m = 0.75;\t\t\t#Mass flow rate of steam in kg/s\n",
    "b1 = 33.;\t\t\t#Blade angle at inlet from the velocity triangle in degrees\n",
    "b2 = b1;\t\t\t#Blade angle at exit from the velocity triangle in degrees\n",
    "Cx = 1120.;\t\t\t#Change in whirl velocity from the velocity triangle in m/s\n",
    "Ca = 0;\t\t    \t#Change in axial velocity from the velocity triangle in m/s\n",
    "\n",
    "# Calculations\n",
    "Fx = m*Cx;\t\t    \t    #Tangential force on blades in N\n",
    "Fy = m*Ca;\t\t\t        #Axial thrust in N\n",
    "W = (m*Cx*U)/1000;\t\t\t#Diagram power in kW\n",
    "ndia = ((2*U*Cx)/(C1**2))*100;\t\t\t#Diagram efficiency\n",
    "\n",
    "# Results\n",
    "print 'Blade angles are %3.0f degrees, %3.0f degrees  \\\n",
    "\\nTangential force on blades is %3.0f N  \\\n",
    "\\nAxial thrust is %3.0f  \\\n",
    "\\nDiagram power is %3.0f kW  \\\n",
    "\\nDiagram efficiency %3.1f percent'%(b1,b2,Fx,Fy,W,ndia)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.14  Page no : 203"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Power developed is 3800 kW  \n",
      "Blade efficiency is 78.7 percent  \n",
      "Steam consumed is 9.46 kg/kWh\n"
     ]
    }
   ],
   "source": [
    "# Variables\n",
    "D = 2.5;\t\t\t#Mean diameter of blade ring in m\n",
    "N = 3000.;\t\t\t#Speed in rpm\n",
    "a1 = 20.;\t\t\t#Nozzle angle in degrees\n",
    "r = 0.4;\t\t\t#Ratio blade velocity to steam velocity\n",
    "Wr = 0.8;\t\t\t#Blade friction factor\n",
    "m = 10.;\t\t\t#Steam flow in kg/s\n",
    "x = 3.;\t    \t\t#Sum in blade angles in degrees\n",
    "b1 = 32.5;\t\t\t#Blade angle at inlet from the velocity triangle in degrees\n",
    "W1 = 626.7;\t\t\t#Relative velocity at inlet from the velocity triangle in m/s\n",
    "Cx = 967.;\t\t\t#Change in whirl velocity from the velocity triangle in m/s\n",
    "\n",
    "# Calculations\n",
    "U = (3.147*D*N)/60;\t\t\t#Blade velocity in m/s\n",
    "C1 = U/r;\t\t\t#Steam velocity in m/s\n",
    "b2 = b1-x;\t\t\t#Blade angle at exit in degrees\n",
    "W2 = Wr*W1;\t\t\t#Relative velocity at outlet from the velocity triangle in m/s\n",
    "W = (m*Cx*U)/1000;\t\t\t#Power developed in kW\n",
    "ndia = ((2*U*Cx)/(C1**2))*100;\t\t\t#Blade efficiency\n",
    "sc = (m*3600)/W;\t\t\t#Steam consumption in kg/kWh\n",
    "\n",
    "# Results\n",
    "print 'Power developed is %3.0f kW  \\\n",
    "\\nBlade efficiency is %3.1f percent  \\\n",
    "\\nSteam consumed is %3.2f kg/kWh'%(round(W,-1),ndia,sc)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.15  Page no : 204"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blading efficiency is 68.3 percent  \n",
      "Blade velocity co-efficient is 0.49\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "m = 3.;\t    \t\t#Mass flow rate of steam in kg/s\n",
    "C1 = 425.;\t\t\t#Steam velocity in m/s\n",
    "r = 0.4;\t\t\t#Ratio of blade speed to jet speed\n",
    "W = 170.;\t\t\t#Stage output in kW\n",
    "IL = 15.;\t\t\t#Internal losses in kW\n",
    "a1 = 16.;\t\t\t#Nozzle angle in degrees\n",
    "b2 = 17.;\t\t\t#Blade angle at exit in degrees\n",
    "W1 = 265.;\t\t\t#Relative velocity at inlet from the velocity triangle in m/s\n",
    "W2 = 130.;\t\t\t#Relative velocity at outlet from the velocity triangle in m/s\n",
    "\n",
    "# Calculations\n",
    "U = C1*r;\t\t\t#Blade speed in m/s\n",
    "P = (W+IL)*1000;\t\t\t#Total power developed in W\n",
    "Cx = P/(m*W);\t\t\t#Change in whirl velocity in m/s\n",
    "ndia = ((2*U*Cx)/(C1**2))*100;\t\t\t#Blading efficiency\n",
    "Wr = W2/W1;\t\t\t#Blade velocity co-efficient\n",
    "\n",
    "# Results\n",
    "print 'Blading efficiency is %3.1f percent  \\\n",
    "\\nBlade velocity co-efficient is %3.2f'%(ndia,Wr)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.16  Page no : 205"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blade angles assumed are  34 degrees,  41 degrees  \n",
      "Power developed by turbine is 52.8 kW\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "C1 = 375.;\t\t\t#Steam velocity in m/s\n",
    "a1 = 20.;\t\t\t#Nozzle angle\n",
    "U = 165.;\t\t\t#Blade speed in m/s\n",
    "m = 1.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "Wr = 0.85;\t\t\t#Blade friction factor\n",
    "Ca1 = 130.;\t\t\t#Axial velocity at inlet from the velocity triangle in m/s\n",
    "Ca2 = Ca1;\t\t\t#Axial velocity at outlet in m/s\n",
    "W1 = 230.;\t\t\t#Relative velocity at inlet from the velocity triangle in m/s\n",
    "Cx = 320.;\t\t\t#Change in whirl velocity from the velocity triangle in m/s\n",
    "\n",
    "# Calculations\n",
    "b2 = 41;\t\t\t#Blade angle at exit from the velocity triangle in degrees\n",
    "b1 = 34;\t\t\t#Blade angle at exit from the velocity triangle in degrees\n",
    "W = (m*Cx*U)/1000;\t\t\t#Power developed by turbine in kW\n",
    "\n",
    "# Results\n",
    "print 'Blade angles assumed are %3.0f degrees, %3.0f degrees  \\\n",
    "\\nPower developed by turbine is %3.1f kW'%(b1,b2,W)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.17  Page no : 206"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Nozzle angle is  19 degrees  \n",
      "Blade angles are  33 degrees,  36 degrees\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "m = 2.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "W = 130.;\t\t\t#Turbine power in kW\n",
    "U = 175.;\t\t\t#Blade velocity in m/s\n",
    "C1 = 400.;\t\t\t#Steam velocity in m/s\n",
    "Wr = 0.9;\t\t\t#Blade friction factor\n",
    "W1 = 240.;\t\t\t#Realtive velocity at inlet from the velocity triangle in m/s\n",
    "\n",
    "# Calculations\n",
    "Cx1 = (W*1000)/(m*U);\t\t\t#Whirl velocity at inlet in m/s\n",
    "W2 = Wr*W1;\t\t\t#Realtive velocity at outlet from the velocity triangle in m/s\n",
    "a1 = 19;\t\t\t#Nozzle angle from the velocity triangle in degrees\n",
    "b1 = 33;\t\t\t#Blade angle at inlet from the velocity triangle in degrees\n",
    "b2 = 36;\t\t\t#Blade angle at outlet from the velocity triangle in degrees\n",
    "\n",
    "# Results\n",
    "print 'Nozzle angle is %3.0f degrees  \\\n",
    "\\nBlade angles are %3.0f degrees, %3.0f degrees'%(a1,b1,b2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.18  Page no : 207"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diagram efficiency is 76.2 percent\n"
     ]
    }
   ],
   "source": [
    "# find Diagram efficiency\n",
    "\n",
    "# Variables\n",
    "U = 150.;\t\t\t#Blade speed in m/s\n",
    "m = 3.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "P = 10.5;\t\t\t#Pressure in bar\n",
    "r = 0.21;\t\t\t#Ratio blade velocity to steam velocity\n",
    "a1 = 16.;\t\t\t#Nozzle angle in first stage in degrees\n",
    "b2 = 20.;\t\t\t#Blade angle at exit in first stage in degrees\n",
    "a3 = 24.;\t\t\t#Nozzle angle in second stage in degrees\n",
    "b4 = 32.;\t\t\t#Blade angle at exit in second stage in degrees\n",
    "Wr = 0.79;\t\t\t#Blade friction factor for first stage\n",
    "Wr2 = 0.88;\t\t\t#Blade friction factor for second stage\n",
    "Cr = 0.83;\t\t\t#Blade velocity coefficient\n",
    "W1 = 570.;\t\t\t#Relative velocity at inlet from the velocity triangle for first stage in m/s\n",
    "C2 = 375.;\t\t\t#Velocity in m/s\n",
    "W3 = 185.;\t\t\t#Relative velocity at inlet from the velocity triangle for second stage in m/s\n",
    "\n",
    "# Calculations\n",
    "C1 = U/r;\t\t\t#Steam speed at exit in m/s\n",
    "W2 = Wr*W1;\t\t\t#Relative velocity at outlet for first stage in m/s\n",
    "C3 = Cr*C2;\t\t\t#Steam velocity at inlet for second stage in m/s\n",
    "W4 = Wr2*W3;\t\t\t#Relative velocity at exit for second stage in m/s\n",
    "DW1 = W1+W2;\t\t\t#Change in relative velocity for first stage in m/s\n",
    "DW2 = 275;\t\t\t#Change in relative velocity from the velocity triangle for second stage in m/s\n",
    "ndia = ((2*U*(DW1+DW2))/(C1**2))*100;\t\t\t#Diagram efficiency\n",
    "\n",
    "# Results\n",
    "print 'Diagram efficiency is %3.1f percent'%(ndia)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.19  Page no : 208"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blade speed is 124.7 m/s  \n",
      "Blade tip angles of the fixed blade are  17 degrees and  43 degrees  \n",
      "Diagram efficiency is 79.5 percent\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "# Variables\n",
    "b1 = 30.;\t\t\t#Blade angle at inlet in first stage in degrees\n",
    "b2 = 30.;\t\t\t#Blade angle at exit in first stage in degrees\n",
    "b3 = 30.;\t\t\t#Blade angle at inlet in second stage in degrees\n",
    "b4 = 30.;\t\t\t#Blade angle at exit in second stage in degrees\n",
    "t1 = 240.;\t\t\t#Temperature at entry in oC\n",
    "P1 = 11.5;\t\t\t#Pressure at entry in bar\n",
    "P2 = 5.;\t\t\t#Pressure in wheel chamber in bar\n",
    "vl = 10.;\t\t\t#Loss in velocity in percent\n",
    "h = 155.;\t\t\t#Enthalpy at P2 in kJ/kg\n",
    "W4 = 17.3;\t\t\t#Relative velocity at exit from the velocity triangle for second stage in m/s\n",
    "a4 = 90.;\t\t\t#Nozzle angle in second stage in degrees\n",
    "C3 = 33.;\t\t\t#Steam velocity at inlet from the velocity triangle for second stage in m/s\n",
    "W2 = 49.;\t\t\t#Relative velocity at outlet from the velocity triangle for first stage in m/s\n",
    "x = 15.;\t\t\t#Length of AB assumed for drawing velocity triangle in mm\n",
    "y = 67.;\t\t\t#Length of BC from the velocity triangle in mm\n",
    "\n",
    "# Calculations\n",
    "C1 = math.sqrt(2000*h);\t\t\t#Velocity of steam in m/s\n",
    "W3 = W4/0.9;\t\t\t#Relative velocity at inlet for second stage in m/s\n",
    "C2 = C3/0.9;\t\t\t#Velocity in m/s\n",
    "W1 = W2/0.9;\t\t\t#Relative velocity at inlet for first stage in m/s\n",
    "C1n = C1/y;\t\t\t#Velocity of steam in m/s\n",
    "U = x*C1n;\t\t\t#Blade speed in m/s\n",
    "a3 = 17.;\t\t\t#Nozzle angle in second stage from the velocity triangle in degrees\n",
    "a2 = 43.;\t\t\t#Nozzle angle from the velocity triangle in degrees\n",
    "DW1 = 731.5;\t\t\t#Change in relative velocity from the velocity triangle for first stage in m/s\n",
    "DW2 = 257.5;\t\t\t#Change in relative velocity from the velocity triangle for second stage in m/s\n",
    "ndia = ((2*U*(DW1+DW2))/(C1**2))*100;\t\t\t#Diagram efficiency\n",
    "\n",
    "# Results\n",
    "print 'Blade speed is %3.1f m/s  \\\n",
    "\\nBlade tip angles of the fixed blade are %3.0f degrees and %3.0f degrees  \\\n",
    "\\nDiagram efficiency is %3.1f percent'%(U,a3,a2,ndia)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.20  Page no : 210"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blade speed is 160.5 m/s  \n",
      "Power developed by the turbine is 530.66 kW\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Variables\n",
    "C1 = 600.;\t\t\t#Steam velocity in m/s\n",
    "b1 = 30.;\t\t\t#Blade angle at inlet in first stage in degrees\n",
    "b2 = 30.;\t\t\t#Blade angle at exit in first stage in degrees\n",
    "b3 = 30.;\t\t\t#Blade angle at inlet in second stage in degrees\n",
    "b4 = 30.;\t\t\t#Blade angle at exit in second stage in degrees\n",
    "a4 = 90.;\t\t\t#Nozzle angle in second stage in degrees\n",
    "m = 3.;\t\t\t#Mass of steam in kg/s\n",
    "x = 15.;\t\t\t#Length for drawing velocity triangle in mm\n",
    "y = 56.;\t\t\t#Length of BC from the velocity triangle in mm\n",
    "\n",
    "# Calculations\n",
    "C1n = round(C1/y,1);\t\t\t#Velocity of steam in m/s\n",
    "U = round(x*C1n,1);\t\t\t#Blade speed in m/s\n",
    "l = 103.;\t\t\t#Length from velocity triangle in mm\n",
    "P = (m*l*C1n*U)/1000;\t\t\t#Power developed in kW\n",
    "\n",
    "# Results\n",
    "print 'Blade speed is %3.1f m/s  \\\n",
    "\\nPower developed by the turbine is %3.2f kW'%(U,P)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.21  Page no : 211"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mean diameter of drum is 963 mm  \n",
      "Volume of steam flowing per second is 8.18 m**3/s\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "# Variables\n",
    "N = 400.;\t\t\t#Speed in rpm\n",
    "m = 8.33;\t\t\t#Mass of steam in kg/s\n",
    "P = 1.6;\t\t\t#Pressure of steam in bar\n",
    "x = 0.9;\t\t\t#Dryness fraction\n",
    "W = 10.;\t\t\t#Stage power in kW\n",
    "r = 0.75;\t\t\t#Ratio of axial flow velocity to blade velocity\n",
    "a1 = 20.;\t\t\t#Nozzle angle at inlet in degrees\n",
    "a2 = 35.;\t\t\t#Nozzle angle at exit in degrees\n",
    "b1 = a2;\t\t\t#Blade tip angle at exit in degrees\n",
    "b2 = a1;\t\t\t#Blade tip angle at inlet in degrees\n",
    "a = 25.;\t\t\t#Length of AB from velocity triangle in mm\n",
    "vg = 1.091;\t\t\t#Specific volume of steam from steam tables in (m**3)/kg\n",
    "\n",
    "# Calculations\n",
    "Cx = 73.5;\t\t\t#Change in whirl velocity from the velocity triangle by measurement in mm\n",
    "y = Cx/a;\t\t\t#Ratio of change in whirl velocity to blade speed\n",
    "U = math.sqrt((W*1000)/(m*y));\t\t\t#Blade speed in m/s\n",
    "D = ((U*60)/(3.147*N))*1000;\t\t\t#Mean diameter of drum in mm\n",
    "v = m*x*vg;\t\t\t#Volume flow rate of steam in (m**3)/s\n",
    "\n",
    "# Results\n",
    "print 'Mean diameter of drum is %3.0f mm  \\\n",
    "\\nVolume of steam flowing per second is %3.2f m**3/s'%(D,v)\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.22  Page no : 212"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Drum diameter is 1.030 m  \n",
      "Blade height is  78 mm\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math\n",
    "\n",
    "# Variables\n",
    "N = 300.;\t\t\t#Speed in rpm\n",
    "m = 4.28;\t\t\t#Mass of steam in kg/s\n",
    "P = 1.9;\t\t\t#Pressure of steam in bar\n",
    "x = 0.93;\t\t\t#Dryness fraction\n",
    "W = 3.5;\t\t\t#Stage power in kW\n",
    "r = 0.72;\t\t\t#Ratio of axial flow velocity to blade velocity\n",
    "a1 = 20.;\t\t\t#Nozzle angle at inlet in degrees\n",
    "b2 = a1;\t\t\t#Blade tip angle at inlet in degrees\n",
    "l = 0.08;\t\t\t#Tip leakage steam\n",
    "vg = 0.929;\t\t\t#Specific volume of steam from steam tables in (m**3)/kg\n",
    "\n",
    "# Calculations\n",
    "mact = m-(m*l);\t\t\t#Actual mass of steam in kg/s\n",
    "a = (3.147*N)/60;\t\t\t#Ratio of blade velocity to mean dia\n",
    "b = r*a;\t\t\t#Ratio of axial velocity to mean dia\n",
    "c = 46;\t\t\t#Ratio of change in whirl velocity to mean dia\n",
    "D = math.sqrt((W*1000)/(mact*c*a));\t\t\t#Mean dia in m\n",
    "Ca = b*D;\t\t\t#Axial velocity in m/s\n",
    "h = ((mact*x*vg)/(3.147*D*Ca))*1000;\t\t\t#Blade height in mm\n",
    "D1 = D-(h/1000);\t\t\t#Drum dia in m\n",
    "\n",
    "# Results\n",
    "print 'Drum diameter is %3.3f m  \\\n",
    "\\nBlade height is %3.0f mm'%(D1,h)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.23  Page no : 214"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rotor blade angles are 58.56 degrees and 58.56 degrees  \n",
      "Flow coefficient is 0.611  \n",
      "Blade loading coefficient is   2  \n",
      "Power developed is 13.8 MW\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "# Variables\n",
    "P0 = 800.;\t\t\t#Steam pressure in kPa\n",
    "P2 = 100.;\t\t\t#Pressure at point 2 in kPa\n",
    "T0 = 973.;\t\t\t#Steam temperature in K\n",
    "a1 = 73.;\t\t\t#Nozzle angle in degrees\n",
    "ns = 0.9;\t\t\t#Steam efficiency\n",
    "m = 35.;\t\t\t#Mass flow rate in kg/s\n",
    "Cp = 1.005;\t\t\t#Specific heat at constant pressure in kJ/kg-K\n",
    "y = 1.4;\t\t\t#Ratio of specific heats\n",
    "\n",
    "# Calculations\n",
    "tanb1 = math.tan(math.radians(a1))/2;\t\t\t#Blade angle at inlet in degrees\n",
    "b1 = math.degrees(math.atan(tanb1))\n",
    "b2 = b1;\t\t\t#Blade angle at exit in degrees\n",
    "p = 2/math.tan(math.radians(a1));\t\t\t#Flow coefficient\n",
    "s = p*(math.tan(math.radians(b1))+math.tan(math.radians(b2)));\t\t\t#Blade loading coefficient\n",
    "Dh = ns*Cp*T0*(1-((P2/P0)**((y-1)/y)));\t\t\t#Difference in enthalpies in kJ/kg\n",
    "W = (m*Dh)/1000;\t\t\t#Power developed in MW\n",
    "\n",
    "# Results\n",
    "print 'Rotor blade angles are %3.2f degrees and %3.2f degrees  \\\n",
    "\\nFlow coefficient is %3.3f  \\\n",
    "\\nBlade loading coefficient is %3.0f  \\\n",
    "\\nPower developed is %3.1f MW'%(b1,b2,p,s,W)\n",
    "\n",
    "# answer in book is wrong for W. please check."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.24  Page no : 215"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rotor blade angles for first stage are 53.95 degrees and 53.95 degrees  \n",
      "Rotor blade angles for second stage are 53.95 degrees and 53.95 degrees  \n",
      "Power developed is 9.90 MW  \n",
      "Final state of steam at first stage is 3306.52 kJ/kg  \n",
      "Final state of steam at second stage is 3257.00 kJ/kg  \n",
      "Blade height at first stage is 0.0114 m  \n",
      "Blade height at second stage is 0.0139 m\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "P0 = 100.;\t\t\t#Steam pressure in bar\n",
    "T0 = 773.;\t\t\t#Steam temperature in K\n",
    "a1 = 70.;\t\t\t#Nozzle angle in degrees\n",
    "ns = 0.78;\t\t\t#Steam efficiency\n",
    "m = 100.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "D = 1.;\t\t\t#Turbine diameter in m\n",
    "N = 3000.;\t\t\t#Turbine speed in rpm\n",
    "h0 = 3370.;\t\t\t#Steam enthalpy from Moiller chart in kJ/kg\n",
    "v2 = 0.041;\t\t\t#Specific volume at P2 from steam tables in (m**3)/kg\n",
    "v4 = 0.05;\t\t\t#Specific volume at P4 from steam tables in (m**3)/kg\n",
    "\n",
    "# Calculations\n",
    "U = (3.147*D*N)/60;\t\t\t#Blade speed in m/s\n",
    "C1 = (2*U)/math.sin(math.radians(a1));\t\t\t#Steam speed in m/s\n",
    "b1 = math.tan(math.radians(a1))/2;\t\t\t#Blade angle at inlet for first stage in degrees\n",
    "b1 = math.degrees(math.atan(b1))\n",
    "b2 = b1;\t\t\t#Blade angle at exit for first stage in degrees\n",
    "b3 = b1;\t\t\t#Blade angle at inlet for second stage in degrees\n",
    "b4 = b2;\t\t\t#Blade angle at exit for second stage in degrees\n",
    "Wt = (4*m*(U**2))/(10**6);\t\t\t#Total workdone in MW\n",
    "Dh = (2*(U**2))/1000;\t\t\t#Difference in enthalpies in kJ/kg\n",
    "Dhs = Dh/ns;\t\t\t#Difference in enthalpies in kJ/kg\n",
    "h2 = h0-Dh;\t\t\t#Enthalpy at point 2 in kJ/kg\n",
    "h2s = h0-Dhs;\t\t\t#Enthalpy at point 2s in kJ/kg\n",
    "Dh2 = (2*(U**2))/1000;\t\t\t#Difference in enthalpies in kJ/kg\n",
    "Dh2s = Dh2/ns;\t\t\t#Difference in enthalpies in kJ/kg\n",
    "h4 = h2-Dh2;\t\t\t#Enthalpy at point 4 in kJ/kg\n",
    "h4s = h2-Dh2s;\t\t\t#Enthalpy at point 4s in kJ/kg\n",
    "Ca = C1*math.cos(math.radians(a1));\t\t\t#Axial velocity in m/s\n",
    "hI = (m*v2)/(math.pi*D*Ca);\t\t\t#Blade height at first stage in m/s\n",
    "hII = (m*v4)/(math.pi*D*Ca);\t\t\t#Blade height at second stage in m/s\n",
    "\n",
    "# Results\n",
    "print 'Rotor blade angles for first stage are %3.2f degrees and %3.2f degrees  \\\n",
    "\\nRotor blade angles for second stage are %3.2f degrees and %3.2f degrees  \\\n",
    "\\nPower developed is %3.2f MW  \\\n",
    "\\nFinal state of steam at first stage is %3.2f kJ/kg  \\\n",
    "\\nFinal state of steam at second stage is %3.2f kJ/kg  \\\n",
    "\\nBlade height at first stage is %3.4f m  \\\n",
    "\\nBlade height at second stage is %3.4f m'%(b1,b2,b3,b4,Wt,h2s,h4s,hI,hII)\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.25  Page no : 218"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rotor blade angles for first stage are 64.11 degrees and 64.11 degrees  \n",
      "Rotor blade angles for second stage are 34.48 degrees and 34.48 degrees  \n",
      "Power developed is 19.81 MW  \n",
      "Final state of steam at first stage is 3171.9 kJ/kg  \n",
      "Final state of steam at second stage is 3065.27 kJ/kg  \n",
      "Rotor blade height is 0.0146 m\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "P0 = 100.;\t\t\t#Steam pressure in bar\n",
    "T0 = 773.;\t\t\t#Steam temperature in K\n",
    "a1 = 70.;\t\t\t#Nozzle angle in degrees\n",
    "ns = 0.78;\t\t\t#Steam efficiency\n",
    "m = 100.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "D = 1.;\t\t\t#Turbine diameter in m\n",
    "N = 3000.;\t\t\t#Turbine speed in rpm\n",
    "h0 = 3370.;\t\t\t#Steam enthalpy from Moiller chart in kJ/kg\n",
    "P4 = 27.;\t\t\t#Pressure at point 4 in bar\n",
    "T4 = 638.;\t\t\t#Temperature at point 4 in K\n",
    "v4 = 0.105;\t\t\t#Specific volume at P4 from mollier chart in (m**3)/kg\n",
    "ns = 0.65;\t\t\t#Stages efficiency\n",
    "\n",
    "# Calculations\n",
    "U = (3.147*D*N)/60;\t\t\t#Blade speed in m/s\n",
    "C1 = (4*U)/math.sin(math.radians(a1));\t\t\t#Steam speed in m/s\n",
    "Ca = C1*math.cos(math.radians(a1));\t\t\t#Axial velocity in m/s\n",
    "tanb1 = (3*U)/Ca;\t\t\t#Blade angle at inlet for first stage in degrees\n",
    "b1 = math.degrees(math.atan(tanb1))\n",
    "b2 = b1;\t\t\t#Blade angle at exit for first stage in degrees\n",
    "b4 = math.degrees(math.atan(U/Ca));\t\t\t#Blade angle at exit for second stage in degrees\n",
    "b3 = b4;\t\t\t#Blade angle at inlet for second stage in degrees\n",
    "WI = m*6*(U**2);\t\t\t#Power developed in first stage in MW\n",
    "WII = m*2*(U**2);\t\t\t#Power developed in second stage in MW\n",
    "W = (WI+WII)/(10**6);\t\t\t#Total power developed in MW\n",
    "Dh = (W*1000)/100;\t\t\t#Difference in enthalpies in kJ/kg\n",
    "Dhs = (W*1000)/(ns*100);\t\t\t#Difference in enthalpies in kJ/kg\n",
    "h4 = h0-Dh;\t\t\t#Enthalpy at point 4 in kJ/kg\n",
    "h4s = h0-Dhs;\t\t\t#Enthalpy at point 4s in kJ/kg\n",
    "h = (m*v4)/(3.147*D*Ca);\t\t\t#Rotor blade height in m\n",
    "\n",
    "\n",
    "# Results\n",
    "print 'Rotor blade angles for first stage are %3.2f degrees and %3.2f degrees  \\\n",
    "\\nRotor blade angles for second stage are %3.2f degrees and %3.2f degrees  \\\n",
    "\\nPower developed is %3.2f MW  \\\n",
    "\\nFinal state of steam at first stage is %3.1f kJ/kg  \\\n",
    "\\nFinal state of steam at second stage is %3.2f kJ/kg  \\\n",
    "\\nRotor blade height is %3.4f m'%(b1,b2,b3,b4,W,h4,h4s,h)\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.26  Page no : 221"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Blade angle at inlet is  10 degrees  \n",
      "Blade angle at exit is  60 degrees\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "a1 = 30.;\t\t\t#Nozzle angle in degrees\n",
    "Ca = 180.;\t\t\t#Axial velocity in m/s\n",
    "U = 280.;\t\t\t#Rotor blade speed in m/s\n",
    "R = 0.5;\t\t\t#Degree of reaction\n",
    "\n",
    "# Calculations\n",
    "a1n = 90-a1;\t\t\t#Nozzle angle measured from axial direction in degrees\n",
    "Cx1 = Ca*math.tan(math.radians(a1n));\t\t\t#Whirl velocity in m/s\n",
    "b1 = math.degrees(math.atan((Cx1-U)/Ca));\t\t\t#Blade angle at inlet in degrees\n",
    "b2 = a1n;\t\t\t#Blade angle at exit in degrees\n",
    "\n",
    "# Results\n",
    "print 'Blade angle at inlet is %3.0f degrees  \\\n",
    "\\nBlade angle at exit is %3.0f degrees'%(b1,b2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.27  Page no : 222"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rotor blade angles are   0 degrees and  70 degrees  \n",
      "Power developed is 1.92 MW  \n",
      "Isentropic enthalpy drop is 30.12 kJ/kg\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "P0 = 800.;\t\t\t#Steam pressure in kPa\n",
    "T0 = 900.;\t\t\t#Steam temperature in K\n",
    "a1 = 70.;\t\t\t#Nozzle angle in degrees\n",
    "ns = 0.85;\t\t\t#Steam efficiency\n",
    "m = 75.;\t\t\t#Mass flow rate of steam in kg/s\n",
    "R = 0.5;\t\t\t#Degree of reaction\n",
    "U = 160.;\t\t\t#Blade speed in m/s\n",
    "\n",
    "# Calculations\n",
    "C1 = U/math.sin(a1);\t\t\t#Steam speed in m/s\n",
    "Ca = C1*math.cos(a1);\t\t\t#Axial velocity in m/s\n",
    "b1 = 0;\t\t\t                #Blade angle at inlet from velocity triangle in degrees\n",
    "b2 = a1;            \t\t\t#Blade angle at exit in degrees\n",
    "a2 = b1;\t\t\t            #Nozzle angle in degrees\n",
    "W = (m*(U**2))/(10**6);\t\t\t#Power developed in MW\n",
    "Dhs = (W*1000)/(ns*m);\t\t\t#Isentropic enthalpy drop in kJ/kg\n",
    "\n",
    "# Results\n",
    "print 'Rotor blade angles are %3.0f degrees and %3.0f degrees  \\\n",
    "\\nPower developed is %3.2f MW  \\\n",
    "\\nIsentropic enthalpy drop is %3.2f kJ/kg'%(b1,b2,W,Dhs)\n"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}