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
|
{
"metadata": {
"name": "",
"signature": "sha256:94249011b6fa028e4fb13e0830b4dd171e4b428548b27716d80b6a2e4fc89f65"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 2. Process Economics"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.1, Page Number 22"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"Q = 500.0 #Heat TRansfer Area, m2\n",
"QB = 80.0 #Base Size, m2\n",
"CB = 3.28e4 #Base Cost, $\n",
"CEIc = 441.9 #Current CE Index\n",
"CEIp = 435.8 #Past CE Index\n",
"M = 0.68 #Cost exponent\n",
"fM = 2.9 #Factor for capital cost\n",
"fPIP = 0.7\n",
"fER = 0.4\n",
"fINST = 0.2\n",
"fELE = 0.1\n",
"fUTIL = 0.5\n",
"fOS = 0.2\n",
"fBUILD = 0.2\n",
"fSP = 0.1\n",
"fDEC = 1.0\n",
"fCONT =0.4\n",
"fWS = 0.7\n",
"\n",
"#Calculations\n",
"CE = CB*(Q/QB)**M\n",
"CEc = CE*(CEIc/CEIp)\n",
"CF1 = fM*(1+fPIP)*CEc + (fER + fINST + fELE + fUTIL + fOS + fBUILD + fSP + fDEC + fCONT + fWS)*CEc\n",
"CF2 = fM*(1+fPIP)*CEc + (fER + fINST + fDEC + fCONT)*CEc\n",
"#Results\n",
"print 'Capital Cost of Carbon steel exchanger $%5.3e'%CE\n",
"print CF1, CF2"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.2, Page Number 22"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"Q = 500.0 #Heat TRansfer Area, m2\n",
"QB = 80.0 #Base Size, m2\n",
"CB = 3.28e4 #Base Cost, $\n",
"CEIc = 441.9 #Current CE Index\n",
"CEIp = 435.8 #Past CE Index\n",
"M = 0.68 #Cost exponent\n",
"fM = 2.9 #Factor for capital cost\n",
"fPIP = 0.7\n",
"\n",
"#Calculations\n",
"CE = CB*(Q/QB)**M\n",
"CEc = CE*(CEIc/CEIp)\n",
"Cpip = fM*fPIP*CEc\n",
"#Results\n",
"print 'Piping cost $%5.3e'%Cpip"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.3, Page Number 24"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"Q = 1.5 #Heat TRansfer Area, m2\n",
"QB = 0.5 #Base Size, m2\n",
"H = 30.0 # Height of Packing, m\n",
"CB = 1.8e4 #Base Cost for 5m height of pkg, $\n",
"CEIc = 441.9 #Current CE Index\n",
"CEIp = 435.8 #Past CE Index\n",
"M = 1.7 #Cost exponent\n",
"Cr = 0.1 #Cost of removing old packing\n",
"Ca = 0.7 #Cost of adding new packing\n",
"\n",
"#Calculations\n",
"CE = CB*(H/5.)*(Q/QB)**M\n",
"CEc = CE*(CEIc/CEIp)\n",
"Cp = CEc*(1.0+Cr+Ca)\n",
"#Results\n",
"print 'Cost of packing $%5.2e'%CE\n",
"print 'Cost of packing corrected using cost indexes $%5.2e'%CEc\n",
"print 'total Cost of Project $%5.2e'%Cp"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.4, Page Number 24"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"Ci = 1.0e6 #Cost of Distillation column in Dollor\n",
"n = 5. #Number of years\n",
"i = 0.05 #Interest rate in percent\n",
"fi = 5.8 #Installation factor\n",
"\n",
"#Calculations\n",
"CF = fi*Ci\n",
"fA = i*(1.+i)**n/((1.+i)**n-1.)\n",
"CAnnualized = CF*fA\n",
"#Results\n",
"print 'Cost of installed Equipment $%8.0f'%CF\n",
"print 'Annulization factor $%5.4f'%fA\n",
"print 'Annualized cost $%8.0f per year'%CAnnualized"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.5, Page Number 26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from numpy import array,zeros\n",
"from sympy import symbols, integrate\n",
"from scipy.interpolate import interp1d\n",
"from scipy.optimize import root\n",
"\n",
"#Variable Declaration\n",
"P = array([41.0,10.0,3.0]) #Array of pressure for High medium and low pressures, barg bar gauge\n",
"Ieff = 80.0 #Isentropic efficiency of steam turbine\n",
"Cfuel = 4.0e-9 #Cost of fuel, $ per J\n",
"Cele = 0.07 #Cost of electricity, $ per (kWh)\n",
"Tw = 100.0 #Temperature of boiler feed water, \u00b0C\n",
"Cpw = 4200.0 #Specific heat of water, K/(kg.K)\n",
"effSG = 85.0 #Efficiency of Steam Generation\n",
"Ts = 400.0 #Temperature of superheated steam,\u00b0C \n",
"Hs = 3212e3 #Enthalpy of steam at 400 \u00b0C and 41 barg, J/kg\n",
"Tref = 0.0 #Reference Temperature,\u00b0C\n",
"Qloss = 10.0 #Distribution losses in percent\n",
"\n",
"#Calculations\n",
"hw = Cpw*(Tw-Tref) #Enthalpy of water at 100 \u00b0C, J/kg \n",
"dHs = Hs-hw\n",
"#Cost of steam at 41.0 barg\n",
"Csg41 = dHs*Cfuel*100*(1.0+Qloss/100)/effSG\n",
"\n",
"#Cost of steam at 10.0 barg\n",
"Ss = 6747.0 #Entropy of steam at 400 \u00b0C and 41 barg\n",
"H10 = 2873000.0 #Enthalpy of steam at 10 barg\n",
"S10 = 6747.0 #Entropy of steam at 10 barg\n",
"H10dash = Hs - Ieff*(Hs - H10)/100\n",
"Pgen10 = Hs-H10dash #Power gernerated per kg of steam to convert it to 10 barg from 41 barg steam\n",
"\n",
"#Value of power gerneration due to forrmation of 10 barg steam\n",
"VP41t10 = Pgen10*Cele/(3600*1000)\n",
"Csg10 = Csg41-VP41t10\n",
"\n",
"#Cost of steam at 3.0 barg\n",
"H10 = 2941000.0 #Enthalpy of steam at 3.0 barg\n",
"S10 = 6880.0 #Entropy of steam at 3.0 barg\n",
"H3 = 2732000.0 #Enthalpy of steam at 3.0 barg\n",
"S3 = 6880.0 #Entropy of steam at 3.0 barg\n",
"H3dash = H10 -Ieff*(H10-H3)/100\n",
"#Value of power gerneration due to forrmation of 3 barg steam\n",
"Pgen3 = H10-H3dash #Power gernerated per kg of steam to convert it to 3 barg from 10 barg steam\n",
"VP10t3 = Pgen3*Cele/(3600*1000)\n",
"Csg3 = Csg10-VP10t3\n",
"\n",
"#Results\n",
"print 'Heat required to generate steam at 41 barg and 400\u00b0C from water: %8.1f J/kg'%dHs\n",
"print 'Cost of Steam generation for steam at 41 barg and 400\u00b0C from water: $ %8.6f per kg ' %Csg41\n",
"\n",
"print 'Power geration when 41 barg steam is converted to 10 barg steam : %8.1f J/kg'%Pgen10\n",
"print 'Value of when 41 barg steam is converted to 10 barg steam: $ %8.6f per kg ' %VP41t10\n",
"print 'Cost of Steam generation for steam at 10 barg from 41 barg steam: $ %8.6f per kg ' %Csg10\n",
"\n",
"print 'Power geration when 10 barg steam is converted to 3 barg steam : %8.1f J/kg'%Pgen3\n",
"print 'Value of when 10 barg steam is converted to 3 barg steam: $ %8.6f per kg ' %VP10t3\n",
"print 'Cost of Steam generation for steam at 3 barg from 10 barg steam: $ %8.6f per kg' %Csg3"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.6, Page Number 28"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"Qc = 0.5e6 #Cooling load, W\n",
"Tc = -20.0 #Cold Sink temperature, \u00b0C\n",
"Th = 30.0 #Hot source temperature, \u00b0C\n",
"dTmin = 5.0 #Minimum temperature difference, \u00b0C\n",
"eff = 0.6\n",
"Ce = 0.07 #Cost of electricity, $ per KWh\n",
"Hours = 8000.0 #Hours of working per year\n",
"\n",
"#Calculations\n",
"Th = Th + dTmin + 273.15\n",
"Tc = Tc - dTmin + 273.15\n",
"W = Qc/eff*((Th-Tc)/Tc)\n",
"Cele = W*Ce*Hours\n",
"\n",
"#Results\n",
"print 'Actual power required %6.0f W'%W\n",
"print 'Cost of Electriciity $ %6.0f '%(Cele/1000)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 2.7, Page Number 30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from numpy import array,zeros\n",
"from sympy import symbols, integrate\n",
"from scipy.interpolate import interp1d\n",
"from scipy.optimize import root\n",
"\n",
"#Variable Declaration\n",
"CP = 1.0e6 #Cost of Project, dollor\n",
"ACFA = array([-10.,1.6,2.8,4.0,5.2,6.4]) #Annual Cash Flow for Project A\n",
"ACFB = array([-10.,6.5,5.2,4.0,2.8,1.6]) #Annual Cash Flow for Project B\n",
"ADCFA = zeros(len(ACFA)) #Annual Discounted Cash Flow for Project A\n",
"ADCFB = zeros(len(ACFB)) #Annual Discounted Cash Flow for Project B\n",
"Y = array([0,1,2,3,4,5]) #Array containing disyear \n",
"j = array([20.,25.,30.,35.,40.]) #Array containing Discounted Cash Flow Rate of Return in percent\n",
"SADCFA = zeros(len(j)) #Array containing Sum of Annual Discounted Cash Flow for Project A\n",
"SADCFB = zeros(len(j)) #Array containing Sum of Annual Discounted Cash Flow for Project B\n",
"\n",
"#Calculations\n",
"\n",
"ACFA = ACFA*1e6\n",
"ACFB = ACFB*1e6\n",
"NPVA = ACFA/(1.0 + i)**Y\n",
"NPVB = ACFB/(1.0 + i)**Y\n",
"\n",
"print 'Project A:'\n",
"for n in j:\n",
" k = sorted(j).index(n)\n",
" print 'Discounted Annual Cash Flow for DCFRR %2d'%n\n",
" for m in Y:\n",
" ADCFA[m] = ACFA[m]/(1. + n/100.0)**m\n",
" SADCFA[k] = SADCFA[k] + ADCFA[m]\n",
" print 'For year %2d is %8.0f'%(m,ADCFA[m])\n",
" print 'For DCFRR of %2d%% Net Present Value is %9.0f'%(n,SADCFA[k]) \n",
" print '---------------------------------------------'\n",
"\n",
"fA = interp1d(j, SADCFA)\n",
"f = lambda x:fA(x)\n",
"sol = root(f,21)\n",
"DCFRRA = sol.x[0]\n",
"print \n",
"print 'Project B:'\n",
"for n in j:\n",
" k = sorted(j).index(n) \n",
" print 'Discounted Annual Cash Flow for DCFRR %2d'%n\n",
" for m in Y:\n",
" ADCFB[m] = ACFB[m]/(1. + n/100.0)**m\n",
" SADCFB[k] = SADCFB[k] + ADCFB[m]\n",
" ADCFB[m] = ACFB[m]/(1. + n/100.0)**m\n",
" print 'For year %2d is %8.0f'%(m, ADCFB[m])\n",
" print 'for DCFRR of %2d%% Net Present Value is %9.0f'%(n,SADCFB[k]) \n",
" print '---------------------------------------------'\n",
"\n",
"fB = interp1d(j, SADCFB)\n",
"f = lambda x:fB(x)\n",
"sol = root(f,35)\n",
"DCFRRB = sol.x[0]\n",
"\n",
"#Results\n",
"print 'Discounted Cash flow Rate of Return for Project A is: %4.2f%% and for Project B is %4.2f%%'%(DCFRRA,DCFRRB)\n",
"if DCFRRA > DCFRRB:\n",
" print 'Discounted Cash flow Rate of Return for Project A is %4.2f%% > %4.2f%% for Project B, \\nhence project A should be preffered'%(DCFRRA,DCFRRB)\n",
"else:\n",
" print 'Discounted Cash flow Rate of Return for Project A is %4.2f%% < %4.2f%% for Project B, \\nhence project B should be preffered'%(DCFRRA,DCFRRB)\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|