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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 6: RESERVIOR PLANNING"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.10: EX6_10.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.10\n",
"//calculate \n",
"//minimum capacity of reservior\n",
"//the initial storage storage required to maintain uniform demand\n",
"clc;funcprot(0);\n",
"//given\n",
"in=[2.83 4.25 5.66 18.4 22.64 22.64 19.81 8.49 7.1 7.1 5.66 5.66]; //inflow(x10^5)\n",
"s=0;\n",
"for i=1:12\n",
" s=s+in(i);\n",
"end\n",
"avd=s/12; //average demand(x10^5)\n",
"s=0;t=0;\n",
"for i=1:12\n",
" e(i)=avd-in(i);\n",
" if e(i)<0 then\n",
" S(i)=-e(i); //surplus(x10^5)\n",
" s=s+S(i);\n",
" else\n",
" D(i)=e(i); //Deficit(x10^5)\n",
" t=t+D(i);\n",
" end\n",
"end\n",
"\n",
"d=(s-(t-D(1)-D(2)-D(3)));\n",
"s=s;\n",
"\n",
"mprintf('minimum capacity of reservior=%fD+5 cumec.',s);\n",
"mprintf('\nstorage required to maintain uniform demand=%fD+5 cumec',d);"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.1: EX6_1.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//exampple 6.1\n",
"//determine maximum reservior level\n",
"//maximum discharge over spillway\n",
"//plot inflow and routed hydrograph and find peak flow and peak lag\n",
"clc;funcprot(0);\n",
"//given\n",
"e=[100 100.3 100.6 100.9 101.2 101.5 101.8 102.1 102.4 102.7]; //elevation(km)\n",
"A=[405 412 420 425 428 436 445 453 460 469]; //area\n",
"o=[0 14.9 42.2 77.3 119 169 217 272 334 405]; //outflow\n",
"c(1)=0;\n",
"for i=2:10\n",
" dh(i)=e(i)-e(i-1);\n",
" s(i)=dh(i)/3*(A(i-1)+A(i)+(A(i-1)*A(i))^0.5); //storage between contours\n",
" c(i)=c(i-1)+s(i); //cumulative storage\n",
" h(i)=c(i)/1.08; //2s/t\n",
" h1(i)=h(i)-o(i); //2s/t-o\n",
" h2(i)=h(i)+o(i); //2s/t+o\n",
"end\n",
"T=[0:6:102];\n",
"I=[42 45 57 88 147 210 272 340 350 338 314 288 263 240 198 170 143 120]; //inflow\n",
"h4=[0 0 60 122 185 266 362 455 545 605 623 620 600 575 550 515 470 430]; //2s/t-0 obtained from curve a\n",
"O=[0 10 24 42 74 130 194 260 316 334 328 312 286 264 236 204 177 150]; //outflow read from curve a\n",
"re=[100.2 100.39 100.58 100.86 101.26 101.65 102.03 102.31 102.4 102.37 102.3 102.18 102.06 101.9 101.72 101.56 102.4]; //reservior elevation read from curve b\n",
"for i=2:17\n",
" t(i)=I(i-1)+I(i); //I1+I2\n",
" h3(i)=t(i)+h4(i); //2s/t+O\n",
"end\n",
"pt=T(10)-T(9);\n",
"d=I(9)-O(10);\n",
"//results\n",
"mprintf(' maximum reservior level=%f m.',re(10));\n",
"mprintf('\nmaximum discharge over spillway=%f cumecs.',O(10));\n",
"mprintf('\nreduction in peak discharge=%f cumecs.',d);\n",
"mprintf('\npeak lag=%f hours.',pt);"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.2: EX6_2.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example6.2\n",
"//calculate required useful storage\n",
"clc;funcprot(0);\n",
"//given\n",
"in=[8.6 2.2 1.8 0 0 13.5 280.6 510.2 136 52.5 20.6 12.3]; //inflow(ha-m)\n",
"pan=[2.2 2.3 3.1 8.6 12.8 15.6 12.3 10.6 10 8.2 5.8 3]; //pan evaporation\n",
"p=[0.8 1.2 0 0 0 4.8 12.2 18.6 8.6 1.5 0 0] //precipitation\n",
"D=[14.5 15.8 16.2 16.8 17.5 18 18 17 16.5 16 15.8 15]; //Demand\n",
"s=0;\n",
"for i=1:12\n",
" if in(i)<10 then\n",
" r(i)=in(i); //D/S requirement\n",
" else\n",
" r(i)=10;\n",
" end\n",
" E(i)=3.6*pan(i); //Evaporation over reservior area\n",
" P(i)=3.5*p(i); //Precipitation\n",
" I(i)=in(i)-r(i)-E(i)+P(i); //Adjusted inflow\n",
" S(i)=D(i)-I(i); //Water required from storage\n",
" if S(i)<0 then\n",
" S(i)=0;\n",
" end\n",
" s=s+S(i);\n",
"end\n",
"mprintf('required useful storage=%f ha-m.',s);"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.3: EX6_3.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.3\n",
"//calculate storage capacity of reservior\n",
"clc;funcprot(0);\n",
"//given\n",
"V=475; //flow required to be maintained throughout the year\n",
"Y=V*365*8.64; //yearly demand\n",
"//yearly demand gives the slope of demand curve\n",
"t=[0:1:36]; //number of season startin from 1960;each year is diveded into 3 seasons.\n",
"q=[0 1050 300 50 3000 250 40 3500 370 90 2000 150 120 1200 350 65 1400 400 100 3600 200 80 3000 200 80 3000 150 120 700 210 50 800 120 80 2400 320 120 3200 280 80]; //average discharge\n",
"v=[0 0.9707 0.4717 0.0328 2.7734 0.3981 0.0263 3.2357 0.5818 0.0591 1.8490 0.2356 0.0788 1.1094 0.5504 0.0427 1.2943 0.6290 0.0657 3.3281 0.3145 0.0525 2.7734 0.2359 0.0788 0.6441 0.3302 0.028 0.7396 0.1887 0.0525 2.2188 0.5032 0.0788 2.9583 0.4403 0.0525]; //voloume\n",
"cv(1)=v(1);\n",
"for i=2:37\n",
" cv(i)=cv(i-1)+v(i);\n",
"end\n",
"//each year is divided into three seasons(monsoon,winter and summer).and readings are taken for 12 years\n",
"//mass inflow curve is plotted and tangent are drawn at the apexes and parellel to demand curve slope;\n",
"//the respectiv ordinates represent the deficiency during dry period\n",
"//maximum of these ordinates gives the desired reservior capacity\n",
"mprintf('storage capacity of reservior=1.6 million ha-m.');\n",
""
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.4: EX6_4.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.4\n",
"//calculate probable life of reservior\n",
"clc;funcprot(0);\n",
"//given\n",
"asi=3.6; //annual sediment inflow(x10^6)\n",
"gamma_s=12; //specific weigth of sediment\n",
"vs=asi/12;\n",
"ir=30; //initial reservior capacity\n",
"fr=60; //final reservior capacity \n",
"r=ir/fr; //initial capacity/inflow ratio\n",
"//r=0.5; hence we start capacity/inflow ratio from 0.5\n",
"c=[0.5:-0.1:0.1]; //capacity inflow ratio\n",
"e=[0.96 0.955 0.95 0.93 0.87]; //trap efficiency\n",
"for i=1:4\n",
" ae(i)=(e(i)+e(i+1))/2; //average efficiency for interval\n",
"end\n",
"as=[0.2872 0.2857 0.2820 0.2700]; //annual sediment trapped\n",
"s=0;\n",
"for i=1:4\n",
" y(i)=6/as(i); //year to fill\n",
" s=s+y(i);\n",
"end\n",
"mprintf(' probable life of reservior=%i years.',s);\n",
""
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.5: EX6_5.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.5\n",
"//calculate maximum outflow discharge over spillway\n",
"//corresponding maximum level of water above spillway crest\n",
"clc;funcprot(0);\n",
"//given\n",
"I=[60 480 900 470 270 160 110 80 60]; //inflow\n",
"//for the first time interval 0 hours to 3 hours\n",
"I1=I(1);\n",
"I2=I(2);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=1.62*h1^1.5;\n",
"//storage change=(30+3h1)h1\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h1^2+0.54h1^1.5+10h1-0.972=0;\n",
"//solving it by trial and error method;we get\n",
"h1=0.0954;\n",
"//for the second time interval 3 hours to 6 hours\n",
"I1=I(2);\n",
"I2=I(3);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=0.0477+1.62*h2^1.5;\n",
"//storage change=(30+3h2)h2\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h2^2+0.54h2^1.5+10h2-3.4312=0;\n",
"//solving it by trial and error method;we get\n",
"h2=0.323;\n",
"//for the third time interval 6 hours to 9 hours\n",
"I1=I(3);\n",
"I2=I(4);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=0.2974+1.62*h3^1.5;\n",
"//storage change=(30+3h3)h3\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h3^2+0.54h3^1.5+10h3-5.7012=0;\n",
"//solving it by trial and error method;we get\n",
"h3=0.522;\n",
"//for the fourth time interval 9 hours to 12 hours\n",
"I1=I(4);\n",
"I2=I(5);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=0.611+1.62*h4^1.5;\n",
"//storage change=(30+3h4)h4\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h4^2+0.54h4^1.5+10h4-6.6208=0;\n",
"//solving it by trial and error method;we get\n",
"h4=0.601;\n",
"//for the fifth time interval 12 hours to 15 hours\n",
"I1=I(5);\n",
"I2=I(6);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=0.7548+1.62*h5^1.5;\n",
"//storage change=(30+3h5)h5\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h5^2+0.54h5^1.5+10h5-6.8936=0;\n",
"//solving it by trial and error method;we get\n",
"h5=0.624;\n",
"//for the sixth time interval 12 hours to 15 hours\n",
"I1=I(6);\n",
"I2=I(7);\n",
"t=3*3600;\n",
"ti=(I1+I2)*t/2; //total inflow\n",
"//outflow=0.7985.62*h6^1.5;\n",
"//storage change=(30+3h6)h6\n",
"//from the basic equation i.e total inflow=total outflow+change in storage\n",
"//on solving we get\n",
"//h6^2+0.54h6^1.5+10h6-6.8492=0;\n",
"//solving it by trial and error method;we get\n",
"h6=0.620;\n",
"hmax=h5;\n",
"q=300*(h5)^1.5; //equation given\n",
"q=round(q*100)/100;\n",
"mprintf('maximum outflow discharge over spillway=%f cumecs.',q);\n",
"mprintf('\nmaximum level of water above spillway crest=%f m.',h5);\n",
"\n",
""
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.6: EX6_6.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.6\n",
"//calculate the allocations to each project purpose\n",
"clc;funcprot(0);\n",
"//given\n",
"t=240; //total cost of project(million rupees)\n",
"s=[32 88 72]; //separable cost\n",
"eb=[40 138 112]; //estimated benifit\n",
"sp=[47 104 101]; //alternate single purpose cost\n",
"//using remaining benifit method\n",
"ts=s(1)+s(2)+s(3); //total separable cost\n",
"tj=t-ts; //total joint cost\n",
"w=0;\n",
"for i=1:3\n",
" if eb(i)<sp(i) then\n",
" b(i)=eb(i); //benifit limited by alternate cost\n",
" else\n",
" b(i)=sp(i);\n",
" end\n",
" rb(i)=b(i)-s(i); //remaining benifit\n",
" w=w+rb(i); \n",
" \n",
"end\n",
"y=0;\n",
"for i=1:3\n",
" aj(i)=tj*rb(i)/w; //allocated joint cost\n",
" ta(i)=s(i)+aj(i); //total allocations\n",
" y=y+ta(i);\n",
"end\n",
"mprintf('Using remaining benifit method.');\n",
"mprintf('\n\nallocations to each project purpose(percent):');\n",
"for i=1:3\n",
" per(i)=ta(i)*100/y; //total allocation percent\n",
" mprintf('\n%f',per(i));\n",
"end\n",
"\n",
"\n",
"//using alternate justifiable method\n",
"w=0;\n",
"for i=1:3\n",
" ac(i)=sp(i)-s(i); //alternate cost less separable cost\n",
" w=w+ac(i); \n",
" \n",
"end\n",
"y=0;\n",
"for i=1:3\n",
" ajc(i)=tj*ac(i)/w; //allocated joint cost\n",
" ta(i)=s(i)+ajc(i); //total allocation\n",
" y=y+ta(i);\n",
"end\n",
"mprintf('\n\nUsing alternate justifiable expenditure method method.');\n",
"mprintf('\n\nallocations to each project purpose(percent):');\n",
"for i=1:3\n",
" pr(i)=ta(i)*100/y; //total allocation percent\n",
"mprintf('\n%f',pr(i));\n",
"end\n",
"\n",
"\n",
""
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.8: EX6_8.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.8\n",
"//calculate outflow hydrograph\n",
"clc;funcprot(0);\n",
"//given\n",
"I=[35 55 92 130 160 140]; //inflow(cumec/sec)\n",
"x=0.28;K=1.6; //studied value\n",
"t=6;\n",
"K=K*24; //in hours\n",
"co=(-K*x+0.5*t)/(K-K*x+0.5*t);\n",
"c1=(K*x+0.5*t)/(K-K*x+0.5*t);\n",
"c2=(K-K*x-0.5*t)/(K-K*x+0.5*t);\n",
"c=co+c1+c2;\n",
"//c=1; which implies (OK)\n",
"//from Muskingum equation\n",
"O(1)=35;\n",
"mprintf('outflow hydrograph:\n%f',O(1));\n",
"for i=2:6\n",
" p1(i)=co*I(i);\n",
" p2(i)=c1*I(i-1);\n",
" p3(i)=c2*O(i-1);\n",
" O(i)=p1(i)+p2(i)+p3(i);\n",
" O(i)=round(O(i)*100)/100;\n",
" mprintf('\n%f',O(i));\n",
"end\n",
""
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6.9: EX6_9.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"\n",
"//example 6.9\n",
"//calculate minimum storage to meet the demand\n",
"clc;funcprot(0);\n",
"//given\n",
"md=[50 75 80 85 130 120 25 25 40 45 50 60]; //monthly demand\n",
"e=[6 8 13 17 22 22 14 11 13 12 7 5]; //evaporation\n",
"r=[1 0 0 0 0 19 43 39 22 6 2 1]; //rainfall\n",
"in=[50 40 30 25 20 30 200 225 150 90 70 60]; //monthly inflow\n",
"A=30; //area of reservior\n",
"Cr=0.4; //run-off coefficient\n",
"for i=1:12\n",
" er(i)=0.4*r(i); //effective rainfall\n",
" ni(i)=er(i)-e(i); //net inflow\n",
" niv(i)=ni(i)*0.01*A; //net inflow volume\n",
" nd(i)=md(i)-niv(i); //net demand\n",
"end\n",
"cnd(1)=nd(1); //cumulative demand\n",
"ci(1)=in(1); //cumulative inflow\n",
"for i=2:12\n",
" cnd(i)=cnd(i-1)+nd(i);\n",
" ci(i)=ci(i-1)+in(i);\n",
"end\n",
"mprintf('Excess demand:');\n",
"for i=1:12\n",
" ed(i)=cnd(i)-ci(i); //excess demand\n",
" if ed(i)<0 then \n",
" es(i)=ed(i); //excess supply\n",
" ed(i)=0;\n",
" end\n",
" mprintf('\n%f',ed(i));\n",
"end\n",
"mprintf('\nminimum storage required=Maximum of excess demand=%f Mm^3.',ed(6));"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|