summaryrefslogtreecommitdiff
path: root/sample_notebooks/SaleemAhmed/generation.ipynb
blob: 3d7aab3304105238980dce090b58ff8dd5f979bf (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
{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter-2, Economics of generation"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1, Page 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "#To Determine the Demand and Supply Parameters for 15 bulbs\n",
      "\n",
      "W=60  #Wattage of the bulb\n",
      "N=15  #No. of bulbs\n",
      "CL=W*N  #Connected Load \n",
      "Wih=2*(10**3)  #Wattage of immersion heater\n",
      "Wh=2*(10**3)  #Wattage of heater\n",
      "\n",
      "#Usage of Bulbs at different time periods\n",
      "N1=5 \n",
      "N2=10 \n",
      "N3=6\n",
      "\n",
      "#Time periods for bulbs\n",
      "T1=2  #6pm - 8pm\n",
      "T2=2  #8pm - 10pm\n",
      "T3=2  #10pm - 12pm\n",
      "#Time Periods for heaters\n",
      "T4=4  #1pm - 5pm\n",
      "T5=3  #8pm - 11pm\n",
      "\n",
      "#CASE 1\n",
      "MD1=W*N2  #Maximum Demand\n",
      "DF=MD1*100/CL  #Demand Factor\n",
      "EC1=(N1*W*T1)+(N2*W*T2)+(N3*W*T3)  #Energy Consumed\n",
      "DLF1=EC1*100/(24*MD1)  #Daily Load Factor\n",
      "\n",
      "#CASE 2\n",
      "MD2=(W*N2)+Wh  #From 8pm - 10pm\n",
      "EC2=(T4*Wih)+(T5*Wh)+EC1  #Energy Consumed\n",
      "DLF2=EC2*100/(24*MD2)  #Daily Load Factor\n",
      "\n",
      "print '''i)a) Connected Load is %0.2f W\\nb) The Maximum Demand is %0.2f W\n",
      "c) The Demand Factor is %0.2f percent\\nd) The Daily Load Factor is %0.2f percent''' %(CL,MD1,DF,DLF1)\n",
      "print 'ii) The Improved Daily Load Factor is %0.2f percent' %DLF2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)a) Connected Load is 900.00 W\n",
        "b) The Maximum Demand is 600.00 W\n",
        "c) The Demand Factor is 66.67 percent\n",
        "d) The Daily Load Factor is 17.50 percent\n",
        "ii) The Improved Daily Load Factor is 26.47 percent\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2, Page 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#To determine the Demand and supply parameter of four consumers\n",
      "\n",
      "\n",
      "#Maximum Demands of various users\n",
      "MD1=2*(10**3)  #9pm\n",
      "MD2=2*(10**3)  #12 noon\n",
      "MD3=8*(10**3)  #5pm\n",
      "MD4=4*(10**3)  #8pm\n",
      "MDT=MD1+MD2+MD3+MD4  #Sum of all Maximum Demands\n",
      "\n",
      "#Demands of various users\n",
      "D1=1.6*(10**3)  #8pm\n",
      "D2=1*(10**3)  #8pm\n",
      "D3=5*(10**3)  #8pm\n",
      "\n",
      "#The Number after the Alphabets represents the Consumer\n",
      "\n",
      "#Maximum Demand of the System arises at 8.00 PM\n",
      "MDS = D1+D2+D3+MD4 \n",
      "\n",
      "TDF=MDT/MDS  #Diversity Factor\n",
      "#Given Values\n",
      "#Average Loads\n",
      "AL2=500 \n",
      "AL4=1000 \n",
      "#Load Factors\n",
      "LF1=15/100 \n",
      "LF3=25/100 \n",
      "#Calculated Values\n",
      "#Average Loads\n",
      "AL1=LF1*MD1 \n",
      "AL3=LF3*MD3 \n",
      "#Load Factors\n",
      "LF2=AL2*100/MD2 \n",
      "LF4=AL4*100/MD4 \n",
      "\n",
      "ALS=AL1+AL2+AL3+AL4   #Combined Average Loads\n",
      "LFS=ALS*100/MDS  #Combined Load Factor\n",
      "\n",
      "#Load Percent\n",
      "LF1*=100 # %\n",
      "LF3*=100 # %\n",
      "\n",
      "print 'i) The Diversity Factor is %0.2f' %TDF\n",
      "print 'ii) The Average load and Load factor of:'\n",
      "print ' Consumer 1 : %0.2f W and %0.2f percent' %(AL1,LF1)\n",
      "print ' Consumer 2 : %0.2f W and %0.2f percent' %(AL2,LF2)\n",
      "print ' Consumer 3 : %0.2f W and %0.2f percent' %(AL3,LF3)\n",
      "print ' Consumer 4 : %0.2f W and %0.2f percent' %(AL4,LF4)\n",
      "print 'iii) The Combined Load Factor and the Combined Average Load is %0.2f percent and %0.2f W respectively\\n' %(LFS,ALS)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i) The Diversity Factor is 1.38\n",
        "ii) The Average load and Load factor of:\n",
        " Consumer 1 : 300.00 W and 15.00 percent\n",
        " Consumer 2 : 500.00 W and 25.00 percent\n",
        " Consumer 3 : 2000.00 W and 25.00 percent\n",
        " Consumer 4 : 1000.00 W and 25.00 percent\n",
        "iii) The Combined Load Factor and the Combined Average Load is 32.76 percent and 3800.00 W respectively\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3, Page 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#To Determine the Yearly Cost of the substation\n",
      "\n",
      "Teff=95/100  #Transmission Efficiency\n",
      "Deff=85/100  #Distribution Efficiency\n",
      "DFT=1.2  #Diversity Factor For Transmission\n",
      "DFD=1.3  #Diversity Factor For Distribution\n",
      "MDGS=100*(10**6)  #Maximum Demand of Generating Station\n",
      "ALF=40/100  #Annual Load Factor\n",
      "ACCT=2.5*(10**6)  #Annual Capital Charge for Transmission\n",
      "ACCD=2*(10**6)  #Annual Capital Charge for Distribution\n",
      "GCC=100  #Generating Cost per kW demand\n",
      "GCCU=5/100  # Per Unit Cost\n",
      "#Fixed Charges from Supply to Substation Annually\n",
      "GFC=GCC*MDGS/1000  #Generating\n",
      "TFC=ACCT  #Transmission\n",
      "TotFCS=GFC+TFC  #Total\n",
      "#Fixed Charges for supply upto Consumer Annually\n",
      "DFC=ACCD  #Distribution\n",
      "TotFCC=TotFCS+DFC  #Total\n",
      "\n",
      "AMDS= DFT*MDGS/1000  #Aggregate of Maximum Demand at Supply\n",
      "AMDC= DFD*AMDS  #Aggregate of Maximum Demand for Consumers\n",
      "\n",
      "FCS=TotFCS/AMDS  #Fixed Charges Per KW at substation\n",
      "CES=GCCU/Teff  #Cost of energy at the substation\n",
      "\n",
      "FCC=TotFCC/AMDC  #Fixed Charges per KW at the consumer premises\n",
      "CEC=CES/Deff  #Cost of Energy at the consumer premises\n",
      "\n",
      "CEC*=100  # converting from rupee to paise\n",
      "\n",
      "print 'The Yealy Cost per KW demand and the cost per KWhr at:'\n",
      "print 'a) The substation is %0.2f rupees per KW and %0.2f paise per kWhr'%(FCS,CES)\n",
      "print 'b) The consumer premises is %g rupees per KW and %g paise per kWhr' %(FCC,CEC)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Yealy Cost per KW demand and the cost per KWhr at:\n",
        "a) The substation is 104.17 rupees per KW and 0.05 paise per kWhr\n",
        "b) The consumer premises is 92.9487 rupees per KW and 6.19195 paise per kWhr\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4, Page 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#To determine the Load factor and suitable units for 24 hr operation of the plant\n",
      "\n",
      "\n",
      "#Demands at Various Time Periods starting from 12PM to 12PM\n",
      "D1=500*(10**3)  \n",
      "D2=800*(10**3) \n",
      "D3=2000*(10**3) \n",
      "D4=1000*(10**3) \n",
      "D5=2500*(10**3) \n",
      "D6=2000*(10**3) \n",
      "D7=1500*(10**3) \n",
      "D8=1000*(10**3) \n",
      "\n",
      "MD=D5  #Maximum Demand\n",
      "#Time Periods of demands from 12PM\n",
      "T1=5 \n",
      "T2=5 \n",
      "T3=2 \n",
      "T4=2 \n",
      "T5=3 \n",
      "T6=3 \n",
      "T7=2 \n",
      "T8=2 \n",
      "\n",
      "#Total Energy Demand in 24hrs\n",
      "TED=(T1*D1)+(T2*D2)+(T3*D3)+(D4*T4)+(T5*D5)+(D6*T6)+(D7*T7)+(T8*D8) \n",
      "\n",
      "LF=TED*100/(24*MD) \n",
      "\n",
      "C1000=3*1000*(10**3)  #1000 unit \n",
      "C500=1*500*(10**3)  #500 Unit\n",
      "\n",
      "TCP=C1000+C500  #Total capacity of the plant\n",
      "PCF=TED*100/(24*TCP)  #Plant Capacity Factor\n",
      "\n",
      "#Operating Schedule, Units operated can be seen in the textbook\n",
      "G1=500*(10**3)   \n",
      "G2=1000*(10**3) \n",
      "G3=2000*(10**3) \n",
      "G4=1000*(10**3) \n",
      "G5=2500*(10**3) \n",
      "G6=2000*(10**3) \n",
      "G7=1500*(10**3) \n",
      "G8=1000*(10**3) \n",
      "\n",
      "TEG=(T1*G1)+(T2*G2)+(T3*G3)+(G4*T4)+(T5*G5)+(G6*T6)+(G7*T7)+(T8*G8) #Total Energy Generated\n",
      "PUF=TED*100/(TEG)  #Plant Use Factor\n",
      "\n",
      "print 'a) The Reserve Capacity is a 1000kW Unit and Load Factor is %0.2f percent' %LF\n",
      "print 'b) The Plant Capacity Factor is %0.2f percent' %PCF\n",
      "print 'c) The Plant Use Factor is %0.2f percent' %PUF"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Reserve Capacity is a 1000kW Unit and Load Factor is 51.67 percent\n",
        "b) The Plant Capacity Factor is 36.90 percent\n",
        "c) The Plant Use Factor is 96.88 percent\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5, Page 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#To determine the Plant use factore of each unit\n",
      "\n",
      "\n",
      "MDS=25*(10**6)  #Maximum Demand on the System\n",
      "U1=15*(10**6)  #Load Supplied By Unit 1\n",
      "U2=12.5*(10**6)  #Load Supplied By Unit 2\n",
      "#Running Time Factor of the Unit\n",
      "T1=1 \n",
      "T2=40/100 \n",
      "\n",
      "#Energy generated by each unit\n",
      "E1=1*(10**8) \n",
      "E2=1*(10**7) \n",
      "Et=E1+E2  #Total Energy\n",
      "\n",
      "#Maximum Demands on Each Units\n",
      "MD1=U1 \n",
      "MD2=MDS-U1 \n",
      "\n",
      "#Annual Load Factor for the Units\n",
      "ALF1=E1*1000*100/(MD1*8760) \n",
      "ALF2=E2*1000*100/(MD2*8760) \n",
      "\n",
      "LF2=E2*1000*100/(MD2*0.4*8760)  #Load Factor for the it is loaded\n",
      "\n",
      "\n",
      "PUF1=ALF1  #Plant Use Factor\n",
      "PCF1=ALF1  # Plant Capacity Factor\n",
      "\n",
      "PCF2=E2*1000*100/(U2*8760)  #Plant Capacity Factor for Unit 2\n",
      "PUF2=E2*1000*100/(U2*0.4*8760) #Plant Use Factor for Unit 2\n",
      "\n",
      "LFP=Et*100*1000/(MDS*8760)  #Annual Load Factor of the Complete Plant\n",
      "\n",
      "print 'The Load Factor, Plant Capacity Factor, Plant Use Factor of:'\n",
      "print 'Unit 1 : %0.2f percent, %0.2f percent, %0.2f percent' %(ALF1,PCF1,PUF1)\n",
      "print 'Unit 2 : %0.2f percent, %0.2f percent, %0.2f percent' %(ALF2,PCF2,PUF2)\n",
      "print 'The Annual Load Factor of the Entire Plant is %0.2f percent' %LFP"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Load Factor, Plant Capacity Factor, Plant Use Factor of:\n",
        "Unit 1 : 76.10 percent, 76.10 percent, 76.10 percent\n",
        "Unit 2 : 11.42 percent, 9.13 percent, 22.83 percent\n",
        "The Annual Load Factor of the Entire Plant is 50.23 percent\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6, Page 91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#To determine the most economic power factor\n",
      "\n",
      "from numpy import sqrt\n",
      "\n",
      "P=200*(10**3)  #Maximum Demand\n",
      "pf=0.707  #Power Factor Lagging\n",
      "\n",
      "a=100  #Tariff per kVA per year\n",
      "\n",
      "b=200  #Power factor improvement cost Per kVA.\n",
      "r=20  #Interest Depriciation, maintenance and cost of losses amount to  20% of capital cost per year\n",
      "\n",
      "# Economic PF = sqrt(1-((b1/a)**2))\n",
      "\n",
      "b1=r*b/100 # b' term accrding to the equation above\n",
      "\n",
      "pfeco=sqrt(1-((b1/a)**2))  #Economic Power Factor\n",
      "\n",
      "print 'The Economic Power Factor is %0.2f ' %pfeco\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Economic Power Factor is 0.92 \n"
       ]
      }
     ],
     "prompt_number": 22
    }
   ],
   "metadata": {}
  }
 ]
}