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
|
{
"metadata": {
"name": "",
"signature": "sha256:2d67a927dfb7c5a82b8b43df0005a44016d56976a1ce99d5ed2f07fea412a913"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter2-Energy Sources\n"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex1-pg44"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.1\n",
"print('Example 2.1\\n\\n');\n",
"print('Page No. 44\\n\\n');\n",
"\n",
"## given\n",
"C= 35000.;## cost of boiler\n",
"C_grant=.25;## Capital grant available from goverment\n",
"E= -(C-(C_grant*C));## Net expenditure\n",
"Fs= 15250.;## Fuel Saving\n",
"r_i = 0.15;## interest\n",
"r_t = 0.55;## tax\n",
"\n",
"a = ([0, E ,Fs ,0 ,E+Fs, r_i*(E+Fs) ,0 ])\n",
"bal_1 = a[4]+a[5]-a[6]## Total Balance after 1st year\n",
"\n",
"c_all = 0.55;## capital allowance in 2nd year\n",
"C_bal= (bal_1+0+Fs+(-(c_all*E)));## Cash Balance after 2nd year\n",
"b = ([bal_1 ,0 ,Fs ,-(c_all*E) ,C_bal, r_i*C_bal, r_t*(Fs+(r_i*C_bal))]);\n",
"bal_2 = b[4]+b[5]-b[6]##Total Balance after 2nd year\n",
"\n",
"c = ([bal_2, 0 ,Fs ,0 ,bal_2+Fs ,r_i*(bal_2+Fs) ,r_t*(Fs+(r_i*(bal_2+Fs)))])\n",
"bal_3= c[4]+c[5]-c[6]## Total Balance after 3rd year\n",
"\n",
"if(bal_2>0):\n",
"\tprint('Pay back period is of two year')\n",
"else:\n",
" print('Pay back period is of three year')\n",
"\n",
"\n",
"print'%s %.2f %s'%('Total saving at the end of second year is ',bal_2,' Pound\\n');\n",
"print'%s %.2f %s'%('Total saving at the end of third year is ',bal_3,' Pound\\n');\n",
"## Deviation in answer due to direct substitution\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.1\n",
"\n",
"\n",
"Page No. 44\n",
"\n",
"\n",
"Pay back period is of two year\n",
"Total saving at the end of second year is 9800.03 Pound\n",
"\n",
"Total saving at the end of third year is 18353.41 Pound\n",
"\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2-pg45"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.2\n",
"print('Example 2.2');\n",
"print('Page No. 45');\n",
"\n",
"## given\n",
"C= 35000.;## cost of boiler\n",
"C_grant=0.;## Capital grant available from goverment\n",
"E= -(C-(C_grant*C));## Net expenditure\n",
"Fs= 15250.;## Fuel Saving\n",
"r_i = 0.15;## interest\n",
"r_t = 0.55;## tax\n",
"\n",
"a = ([0, E ,Fs ,0, E+Fs, r_i*(E+Fs) ,0 ])\n",
"bal_1 = a[4]+a[5]-a[6]## Total Balance after 1st year\n",
"\n",
"c_all = 0.55;## capital allowance in 2nd year\n",
"C_bal= (bal_1+0+Fs+(-(c_all*E)));## Cash Balance after 2nd year\n",
"b = ([bal_1 ,0 ,Fs ,-(c_all*E), C_bal ,r_i*C_bal, r_t*(Fs+(r_i*C_bal))]);\n",
"bal_2 = b[4]+b[5]-b[6]##Total Balance after 2nd year\n",
"\n",
"c = ([bal_2, 0 ,Fs ,0 ,bal_2+Fs, r_i*(bal_2+Fs) ,r_t*(Fs+(r_i*(bal_2+Fs)))])\n",
"bal_3= c[4]+c[5]-c[6]## Total Balance after 3rd year\n",
"\n",
"if(bal_2>0):\n",
"\tprint('pay back period is of two year')\n",
"else:\n",
"\tprint('pay back period is of three year')\n",
"\n",
"\n",
"print'%s %.2f %s'%('Total saving at the end of second year is ',bal_2,' Pound');\n",
"print'%s %.2f %s'%('Total saving at the end of third year is ',bal_3,' Pound');\n",
"## Deviation in answer due to direct substitution\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.2\n",
"Page No. 45\n",
"pay back period is of two year\n",
"Total saving at the end of second year is 4195.66 Pound\n",
"Total saving at the end of third year is 12370.74 Pound\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex3-pg46"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.3\n",
"print('Example 2.3');\n",
"print('Page No. 46');\n",
"\n",
"## given\n",
"F= 350*10**3.;## fuel oils in gallons\n",
"Ci= 5000.;## cost of insulation of tanks\n",
"\n",
"As= 7500.;##Annual Saving in Pound\n",
"\n",
"if(As> Ci):\n",
"\tprint(\"The investment has a pay-back period of less than 1 year\");\n",
"else:\n",
"\tprint(\"The investment has not a pay-back period of less than 1 year\");\n",
" \n",
"## Note- Since here pack back period is less than 1 year and the company is in profit so they can go with this fuel oil,\n",
"## although it can be noted that there are more problems handling heavy fuels oils \n",
"##and that the pay-back increases considerably the smaller the installation.\n",
"##So the company can changeover from oil to coal as a fuel.\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.3\n",
"Page No. 46\n",
"The investment has a pay-back period of less than 1 year\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex4-pg47"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.4\n",
"print('Example 2.4');\n",
"print('Page No. 47');\n",
"\n",
"## given\n",
"F1= 500.*10**3;## fuel oil in gallons\n",
"F2= 500.*10**3;## coal in gallons in Pound\n",
"C1= 165.*10**3;## cost of oil per year in Pound\n",
"C2= 92.*10**3;## cost of an equivalent of coal in Pound\n",
"Ce= 100.*10**3;## capital cost of extra handling eqiupment\n",
"\n",
"Cm= (Ce*0.2);## Maintenance , interest costs per year\n",
"As= C1-C2;## Annual Saving in Pound\n",
"print'%s %.2f %s'%('Annual Saving is ',As,' Pound')\n",
"\n",
"if((2*As)> Ce):\n",
"\tprint(\"Replacing an obsolete boiler plant is considerable\");\n",
"else:\n",
"\tprint(\"Replacing an obsolete boiler plant is not considerble\");\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.4\n",
"Page No. 47\n",
"Annual Saving is 73000.00 Pound\n",
"Replacing an obsolete boiler plant is considerable\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5-pg49"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.5\n",
"print('Example 2.5\\n\\n');\n",
"print('Page No. 49\\n\\n');\n",
"\n",
"## given\n",
"F= 10.*10**3;## fuel oils in gallons\n",
"Cs= 2200.;## cost of maintaining tanks per year in Pound\n",
"Ci= 1850.;## cost of insulation of pipe in Pound\n",
"\n",
"As= (Cs*.85);##company saving is 85 per cent to the cost\n",
"print'%s %.2f %s'%('Annual Saving on heating is ',As,' Pound\\n')\n",
"\n",
"\n",
"if(As> Ci):\n",
"\tprint(\"The investment has a pay-back period of less than 1 year\");\n",
"else:\n",
"\tprint(\"The investment has not a pay-back period of less than 1 year\");\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.5\n",
"\n",
"\n",
"Page No. 49\n",
"\n",
"\n",
"Annual Saving on heating is 1870.00 Pound\n",
"\n",
"The investment has a pay-back period of less than 1 year\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex6-pg52"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"## Example 2.6\n",
"print('Example 2.6\\n\\n');\n",
"print('Page No. 52\\n\\n');\n",
"\n",
"## given\n",
"P1= 50.;## Dry saturated steam pressure in bar\n",
"P2= 0.5;## condenser pressure in bar\n",
"\n",
"##By using the steam tables saturation temperature is obtained at given pressures\n",
"T1= 537.##The saturation temperatue in K at 50 bar\n",
"T2= 306.##The saturation temperatue in K at 0.5 bar\n",
"\n",
"## For Carnot Cycle\n",
"n=(1.-(T2/T1))*100.;\n",
"print'%s %.2f %s'%('Efficiency percentage of Carnot Cycle is ',n,' \\n')\n",
"\n",
"\n",
"## For Rankine Cycle\n",
"## By usins steam tables, the total heat and the sensibles heat and other remaining parameter has been calculated\n",
"h1= 2794.*10**3;##the total heat in dry steam at 50 bar in J/kg\n",
"d= 0.655;## dryness fraction \n",
"h2= 1725.*10**3;## the entropy at state 2 in J/kg\n",
"h3= 138.*10**3;## the sensible heat at 0.5 bar in J/kg\n",
"Vf= 1.03*10**-3;## volume of fluid im m^3,calculated from steam table\n",
"W= (Vf*(P1-P2))*10**5;## pump work in J/kg\n",
"E=(((h1-h2)-(W))/((h1-h3)-(W)))*100.;\n",
"print'%s %.2f %s'%('Efficiency percentage of Rankine Cycle is ',E,' \\n')\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Example 2.6\n",
"\n",
"\n",
"Page No. 52\n",
"\n",
"\n",
"Efficiency percentage of Carnot Cycle is 43.02 \n",
"\n",
"Efficiency percentage of Rankine Cycle is 40.13 \n",
"\n"
]
}
],
"prompt_number": 6
}
],
"metadata": {}
}
]
}
|