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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 2: Energy Conversion and General Energy Analysis"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
" Example 2-1 ,Page No.57"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#there is a 0.00490% error as the answer in textbook is expressed in multiple of 10\n",
"#Constants used\n",
"Hu=6.73*10**10;#Energy liberated by 1 kg of uranium\n",
"\n",
"# Given values\n",
"p=0.75;# assuming the avg density of gasoline in kg/L\n",
"V=5;# consumption per day of gasoline in L\n",
"Hv=44000; #heat value in kJ/kg\n",
"mu=0.1;# mass of uranium used\n",
"\n",
"#Calculation\n",
"mgas=p*V;#mass of gasoline required per day\n",
"Egas=mgas*Hv;\n",
"Eu=mu*Hu;\n",
"d=Eu/Egas;\n",
"print'%i number of days the car can run with uranium' %round(d,0)\n",
"print'equivalent to %i years' %round(d/365,0)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"40788 number of days the car can run with uranium\n",
"equivalent to 112 years\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-2 ,Page No.59"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Given values\n",
"v=8.5;# wind speed in m/s\n",
"m=10;# given mass for part - b \n",
"mf=1154;# given flowrate for part - c\n",
"\n",
"#Calculations\n",
"e=(v**2)/2;\n",
"print'wind energy per unit mass %f J/kg' %round(e,1);\n",
"E=m*e;\n",
"print'wind energy for 10 kg mass %i J' %E;\n",
"E=mf*e/1000;\n",
"print'wind energy for mass flow rate of 1154kg/s %f kW'%round(E,1)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"wind energy per unit mass 36.100000 J/kg\n",
"wind energy for 10 kg mass 361 J\n",
"wind energy for mass flow rate of 1154kg/s 41.700000 kW\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-7 ,Page No.67"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"# Given values\n",
"T=200;# applied torque in N\n",
"n=4000;# shaft rotation rate in revolutions per minute\n",
"\n",
"#Calculation\n",
"Wsh=(2*math.pi*n*T)/1000/60;#factor of 1000 to convert to kW and 60 to convert to sec\n",
"print'Power transmitted %f kW'%round(Wsh,1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Power transmitted 83.800000 kW\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-8 ,Page No.69"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Constants used\n",
"g=9.81;#acceleration due to gravity in m/s^2;\n",
"\n",
"#Given values\n",
"m=1200;#mass of car in kg\n",
"V=90/3.6;#velocity ; converting km/h into m/s\n",
"d=30*math.pi/180;#angle of slope ; converting into radians\n",
"\n",
"#Calculation\n",
"Vver=V*math.sin(d);#velocity in vertical direction\n",
"Wg=m*g*Vver/1000;\n",
"print'the addtional power %i kW'%Wg"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the addtional power 147 kW\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-9 ,Page No.69"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"m=900;#mass of car in kg\n",
"v1=0;# intial velocity\n",
"v2=80/3.6;# final velocity; converting km/h into m/s\n",
"t=20;# time taken1\n",
"\n",
"#Calculation\n",
"Wa=m*(v2**2-v1**2)/2/1000;\n",
"Wavg=Wa/t;\n",
"print'the average power %f kW'%round(Wavg,1)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the average power 11.100000 kW\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-10 ,Page No.74"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"Win=100;# work done in the process in kJ\n",
"Qout=500;# heat lost in kJ\n",
"U1=800;# internal energy of the fluid in kJ\n",
"\n",
"#Calculations\n",
"# Win - Qout = U2- U1 i.e change in internal energy \n",
"U2=U1-Qout+Win;\n",
"print'final internal of the system %i kJ'%U2\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"final internal of the system 400 kJ\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-11 ,Page No.75"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given values\n",
"Win=20;# power consumption in W\n",
"mair=0.25;# rate of air discharge in kg/sec\n",
"\n",
"#calculation\n",
"v=math.sqrt(Win/2/mair)#Win = 1/2*m*v^2\n",
"if v >=8:\n",
" print('True');\n",
"else:\n",
" print('False')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"False\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-12 ,Page No.76"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"Win=200.0;#Power of fan in W\n",
"U=6.0;#Overall heat transfer coefficient in W/m^2 C\n",
"A=30;#Surface area in m^2\n",
"To=25;#Outdoor temperature in C\n",
"\n",
"#Calculations\n",
"Ti= (Win/U/A)+To;# Win = Qout = U*A*(Ti - To)\n",
"print'the indoor air temperature %f Celcius'%Ti\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the indoor air temperature 26.111111 Celcius\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-13 ,Page No.76"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"Plamp=80.0;#Power of lamp in W\n",
"N=30;#no of lamps\n",
"t=12;#time period the light is in use in hours/day\n",
"y=250;#days in a year light is in function \n",
"UC=0.07;#unit cost in $\n",
"\n",
"#Calculation\n",
"LP=Plamp*N/1000;#Lighting power in kW\n",
"OpHrs=t*y;#Operating hours\n",
"LE=LP*OpHrs;#Lighting energy in kW\n",
"LC=LE*UC;#Lighting cost\n",
"print'the annual energy cost $%i'%LC\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the annual energy cost $504\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-15 ,Page No.82"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"Ein=2.0;#Power of electric burner in kW\n",
"n1=0.73;#Efficiency of open burners\n",
"n2=0.38;#efficency of gas units\n",
"CinH=0.09;#Unit cost of electricity in $\n",
"CinB=0.55;#Unit cost of natural gas in $\n",
"\n",
"#Calculations\n",
"QutH= Ein * n1;\n",
"print'rate of energy consumption by the heater %f kW'%round(QutH,2);\n",
"CutH= CinH / n1;\n",
"print'the unit cost of utilized energy for heater $%f/kWh'%round(CutH,3);\n",
"QutB= QutH / n2 ;\n",
"print'rate of energy consumption by the burner %f kW'%round(QutB,2);\n",
"CutB= CinB / n2 / 29.3; # 1 therm = 29.3 kWh\n",
"print'the unit cost of utilized energy for burner %f kWh'%round(CutB,3);\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"rate of energy consumption by the heater 1.460000 kW\n",
"the unit cost of utilized energy for heater $0.123000/kWh\n",
"rate of energy consumption by the burner 3.840000 kW\n",
"the unit cost of utilized energy for burner 0.049000 kWh\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-16 ,Page No.84"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#there is a 0.204% error in the last part of the question due to rounding off the intermidiate steps in the solution\n",
"\n",
"#Constants used\n",
"g=9.81;#acceleration due to gravity in m/s^2;\n",
"\n",
"#Given values\n",
"h=50.0;#Depth of water in m\n",
"m=5000.0;#mass flow rate of water in kg/sec\n",
"Wout=1862.0;#generated electric power in kW\n",
"ngen=0.95;#efficiency of turbine\n",
"\n",
"#calculation\n",
"X=g*h/1000.0;# X stands for the differnce b/w change in mechanical energy per unit mass\n",
"R=m*X;#rate at which mech. energy is supplied to turbine in kW\n",
"nov=Wout/R;#overall efficiency i.e turbine and generator\n",
"print'overall efficiency is %f'%round(nov,2);\n",
"ntu=nov/ngen;#efficiency of turbine\n",
"print'efficiency of turbine is %f'%round(ntu,2);\n",
"Wsh=ntu*R;#shaft output work\n",
"print'shaft power output %i kW'%round(Wsh,0)\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"overall efficiency is 0.760000\n",
"efficiency of turbine is 0.800000\n",
"shaft power output 1960 kW\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-17 ,Page No.85"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"Pstd=4520.0;\n",
"Phem=5160.0;#prices of std and high eff motor in USD\n",
"R=60*0.7457;#rated power in kW from hp\n",
"OpHrs=3500.0;#Operating hours\n",
"Lf=1.0;#Load Factor\n",
"nsh=0.89;#efficiency of shaft\n",
"nhem=0.932;#efficiency of high eff. motor\n",
"CU=0.08;#per unit cost in $\n",
"\n",
"#calculation\n",
"PS=R*Lf*(1/nsh-1/nhem);#Power savings = W electric in,standard - W electric in,efficient\n",
"ES=PS*OpHrs;#Energy savings = Power savings * Operating hours\n",
"print'Energy savings %i kWh/year'%ES;\n",
"CS=ES*CU;\n",
"print'Cost savings per year $%i'%CS;\n",
"EIC=Phem-Pstd;#excess intial cost\n",
"Y=EIC/CS;\n",
"print'simple payback period %f years'%round(Y,1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Energy savings 7929 kWh/year\n",
"Cost savings per year $634\n",
"simple payback period 1.000000 years\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-18 ,Page No.91"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Given values\n",
"#NOx details\n",
"m1=0.0047;#emissions of gas furnaces of NOx in kg/therm\n",
"N1=18*10**6;#no. of therms per year \n",
"#CO2 details\n",
"m2=6.4;#emissions of gas furnaces of CO2 in kg/therm\n",
"N2=18*10**6;#no. of therms per year \n",
"\n",
"#Calculation\n",
"NOxSav=m1*N1;\n",
"print'NOx savings %f kg/year'%round(NOxSav,1);\n",
"CO2Sav=m2*N2;\n",
"print'CO2 savings %f kg/year'%round(CO2Sav,1)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"NOx savings 84600.000000 kg/year\n",
"CO2 savings 115200000.000000 kg/year\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2-19 ,Page No.95"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Constants used\n",
"e=0.95;#Emissivity\n",
"tc=5.67*10**-8;#thermal conductivity in W/m^2 K^4\n",
"\n",
"#Given values\n",
"h=6;#convection heat transfer coefficient in W/m^2 C\n",
"A=1.6;#cross-sectional area in m^2\n",
"Ts=29;#average surface temperature in C\n",
"Tf=20;#room temperature in C\n",
"\n",
"#Calculation\n",
"#convection rate\n",
"Q1=h*A*(Ts-Tf);\n",
"#radiation rate\n",
"Q2=e*tc*A*((Ts+273)**4-(Tf+273)**4);\n",
"Qt=Q1+Q2;\n",
"print'the total rate of heat transfer %f W'%round(Qt,1)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the total rate of heat transfer 168.100000 W\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
|