{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 4: HYDROLOGY" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.10: EX4_10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.10\n", "//calculate average depth of precipitation using depth area curve\n", "clc;funcprot(0);\n", "//given\n", "I=[25:-1:16]; //isohytes\n", "a=[407 1008 1522 1909 2216 2460 2651 2782 2910 2936]; //enclosed area\n", "ia(1)=407;\n", "for i=2:10\n", " ia(i)=a(i)-a(i-1);\n", "end\n", "r=[25.5:-1:16.5]\n", "for i=1:10\n", " rv(i)=r(i)*ia(i);\n", "end\n", "cv(1)=10378;\n", "for i=2:10\n", " cv(i)=cv(i-1)+rv(i);\n", "end\n", "for i=1:10\n", " eud(i)=cv(i)/a(i); //mean precipitation\n", "end\n", "\n", "mprintf('From depth area curve we obtain average depth of precipitation=24.1 mm for an \narea of 1800 sq. km.');\n", "//graph is plotted between eud and a." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.11: EX4_11.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 8.11\n", "//calculate\n", "//24h max. rainfall with return period of 8,15 and 25.\n", "//24h max rainfall with 40%,24% and 8% probability.\n", "//probabilty of rainfall of magnitude equal to or exceeding 100 mm.\n", "clc;funcprot(0);\n", "//given\n", "N=20;\n", "r=[142 126 116 108 102 95 92 88 86 82 80 78 76 73 71 69 68 66 65 64]; //rainfall in respective years\n", "m=[1:1:20]; //ranking of storm\n", "for i=1:20\n", " p(i)=m(i)*100/(N+1); //probability(percent)\n", " T(i)=100/p(i); //recurrence interval\n", "end\n", "//from frequency curve obtained we get\n", "//Part (a)\n", "T1=[8 15 25];\n", "r1=[119 134 149];\n", "mprintf('T(years) Rainfall(mm)');\n", "for i=1:3\n", " mprintf('\n%i %i',T1(i),r1(i));\n", "end\n", "\n", "//Part (b)\n", "p1=[40 24 8];\n", "r2=[87 101 130];\n", "mprintf('\n\nprobability(percent) Rainfall(mm)');\n", "for i=1:3\n", " mprintf('\n%i %i',p1(i),r2(i));\n", "end\n", "//graph is plotted on semi-log graph between r and p\n", "\n", "mprintf('\n\nFor rainfall=100 m.\nT=4 years.\nProbability=25 percent.');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.12: EX4_12.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.12\n", "//plot IDF curve for return period of 10,2 and 1 years using california formula\n", "clc;funcprot(0);\n", "//given\n", "t=[5 10 20 30 60 90 120]; //duration\n", "//value of P for respective return period is\n", "p10=[10.6 14.7 19.3 20.8 25.5 29 34.7]; //rainfall for T=10 years\n", "p2=[8.2 10.3 13.2 14.2 16.6 19.4 21.4]; //rainfall for T=2 years\n", "p1=[3.5 6.2 8.9 10 13.2 15 16.5]; //rainfall for T=1 year\n", "for i=1:7\n", " i1(i)=p10(i)*60/t(i); //intensity of rainfall with return period of 10 years\n", " i2(i)=p2(i)*60/t(i); //intensity of rainfall with return period of 2 years\n", " i3(i)=p1(i)*60/t(i); //intensity of rainfall with return period of 1 year\n", "end\n", "//graph is plotted between\n", "//t and i1\n", "//t and i2\n", "//t and i3" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.13: EX4_13.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.13\n", "//calculate maximum and minimum rainfall\n", "clc;funcprot(0);\n", "//given\n", "N=20;\n", "m=[1:1:20]; //rank number\n", "rd=[82 78 75 72 70 68 65 63 61 58 56 54 52 50 46 40 36 34 32 30]; //rainfall in decresing order\n", "for i=1:20\n", " ri(i)=rd(21-i);\n", "end\n", "for i=1:20\n", " T(i)=N/(m(i)-0.5);\n", "end\n", "//from the curves\n", "mprintf('maximum rainfall=79cm for T=15 years.');\n", "mprintf('\nminimum rainfall =31 cm for T=15 years.');\n", "//graph is plotted between rd and T;ri and T\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.14: EX4_14.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.14\n", "//calculate daily lake evaporation\n", "//average evaporation for one week\n", "clc;funcprot(0);\n", "//given\n", "w=[12 5 2 -3 1 6 11]; //water added or taken out\n", "r=[0 6 8 12 9 5 0]; //rainfall\n", "for i=1:7\n", " pan(i)=w(i)+r(i); //Pan evaporation\n", " le(i)=0.8*pan(i); //lake evaporation\n", "end\n", "\n", "s=0;\n", "for i=1:7\n", " s=s+le(i);\n", "end\n", "mprintf('daily lake evaporation(mm):');\n", "for i=1:7\n", " mprintf('\n%f',le(i));\n", "end\n", "av=s/7;\n", "av=round(av*100)/100;\n", "mprintf('\n\naverage evaporation for one week=%f mm.',av);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.15: EX4_15.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.15\n", "//calculate average evaporation loss from reservior\n", "//total depth and volume of evaporation loss\n", "clc;funcprot(0);\n", "//given\n", "Rh=0.4; //relative humidity\n", "A=4.8; //average surface spread of reservior\n", "v3=18; //wind velocity at 3m above ground\n", "es=31.81; //saturated vapour pressure\n", "Km=0.36; //for large deep waters\n", "\n", "//using Meyer's formula\n", "ea=es*Rh;\n", "v9=v3*(9/3)^(1/7);\n", "E=Km*(es-ea)*(1+v9/16);\n", "d=7*E;\n", "v=d*A*100/1000;\n", "E=round(E*10)/10;\n", "d=round(d*10)/10;\n", "v=round(v*100)/100;\n", "mprintf('using Meyers formula:');\n", "mprintf('\naverage evaporation loss from reservior=%f mm/day.',E);\n", "mprintf('\ntotal depth=%f mm',d);\n", "mprintf('\ntotal volume=%f hectare-m.',v);\n", "\n", "//using Rohwer's formula\n", "Pa=760;\n", "vdash=(0.6/2)^(1/7)*18;\n", "E=0.771*(1.465-0.000732*Pa)*(0.44+0.0733*vdash)*(es-ea);\n", "d=7*E;\n", "v=d*A*100/1000;\n", "E=round(E*10)/10;\n", "d=round(d*10)/10;\n", "v=round(v*10)/10;\n", "mprintf('\n\nusing Rohwers formula:');\n", "mprintf('\naverage evaporation loss from reservior=%f mm/day.',E);\n", "mprintf('\ntotal depth=%f mm',d);\n", "mprintf('\ntotal volume=%f hectare-m.',v);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.16: EX4_16.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.16\n", "//plot infiltration capacity curve\n", "//calculate constant rate of infiltration\n", "clc;funcprot(0);\n", "//given\n", "D=30; //diameter of inside ring of infiltrometer\n", "A=%pi*D^2/4;\n", "V=[0 200 470 840 1405 1840 2245 2510 2745 2885 2990 3130 3270]; //cumulative volume;\n", "t=[0 2 5 10 20 30 45 60 80 100 120 150 180]; //Time(minutes)\n", "dt(1)=0;\n", "for i=2:13\n", " dt(i)=(t(i)-t(i-1))/60;\n", "end\n", "for i=1:13\n", " F(i)=V(i)/A;\n", "end\n", "Fd(1)=F(1);\n", "for i=2:13\n", " Fd(i)=F(i)-F(i-1);\n", "end\n", "for i=2:13\n", " ft(i)=Fd(i)/dt(i); //infirltration rate\n", "end\n", "//from the graph\n", "mprintf('constant rate of infiltration=0.40 cm/hr.');\n", "avg10=F(4)*60/10;\n", "avg30=F(6)*60/30;\n", "avg10=round(avg10*100)/100;\n", "avg30=round(avg30*100)/100;\n", "mprintf('\naverage rate of infiltration for first 10 min=%f cm/hr.',avg10);\n", "mprintf('\naverage rate of infiltration for first 30 min=%f cm/hr.',avg30);\n", "//graph is plotted between ft and t" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.17: EX4_17.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.17\n", "//calculate\n", "//drainage desity\n", "//form factor\n", "//channel slope\n", "//average overland flow length\n", "clc;funcprot(0);\n", "//given\n", "A=82; //area of watershed\n", "d=12.6; //distance between outlet and farther most point\n", "l=440; //total length of channel\n", "e=656; //elevation differnce between outlet and further most point\n", "\n", "Dd=l/A;\n", "ff=A/d^2;\n", "cs=e/(d*1000);\n", "lo=1000/(2*Dd);\n", "Dd=round(Dd*100)/100;\n", "ff=round(ff*1000)/1000;\n", "mprintf('drainage desity=%f km/square.km.',Dd);\n", "mprintf('\nform factor=%f.',ff);\n", "mprintf('\nchannel slope=%f.',cs);\n", "mprintf('\naverage overland flow length=%i m.',lo);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.18: EX4_18.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.18\n", "//compute fi and W index\n", "clc;funcprot(0);\n", "//given\n", "R=3.6; //surface runoff\n", "r=[0 1.3 2.8 4.1 3.9 2.8 2.0 1.8 0.9]; //rainfall at respective time\n", "t=4; //total time\n", "s=0;\n", "for i=3:8\n", " s=s+r(i)\n", "end\n", "fi=(s-R*2)/6;\n", "//since fi >1.3 and <1.8\n", "mprintf('fi index=%f cm.',fi);\n", "mprintf('\ncomputations are correct.');\n", "\n", "s=0;\n", "for i=1:9\n", " s=s+r(i);\n", "end\n", "P=s/2;\n", "Sr=0;\n", "W=(P-R-Sr)/t;\n", "mprintf('\nW index=%f cm/hr.',W);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.19: EX4_19.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example4.19\n", "//calculate fi index and time of rainfall excess\n", "clc;funcprot(0);\n", "//given\n", "T=[1:1:9]; //time from start\n", "r=[0.7 1.4 2.4 3.7 2.9 2.6 1.7 0.8 0.5]; //increamental rainfall\n", "R=9.3; //total run-off\n", "s=0;\n", "for i=1:9\n", " s=s+r(i);\n", "end\n", "ti=s-R;\n", "\n", "//first trial\n", "tr=9; //assumed\n", "fi1=ti/tr;\n", "//this makes 1st,8th and 9th hour ineffective\n", "\n", "//second trial\n", "tr=6;\n", "ti=s-R-r(1)-r(8)-r(9);\n", "fi=ti/tr;\n", "for i=1:9\n", " P(i)=r(i)-fi;\n", " if (P(i)<0) then\n", " P(i)=0;\n", " end\n", "end\n", "mprintf('Time(h) rainfall excess.');\n", "for i=1:9\n", " mprintf('\n%f %f',T(i),P(i));\n", "end\n", "mprintf('\n\nfi index=%f cm/hr.',fi);\n", "mprintf('\n\ntime of rainfall excess=%i hours..',tr);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.1: EX4_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.1\n", "//calculate mean rainfall;additional guages needed\n", "clc;funcprot(0);\n", "//given\n", "p=[78.8 90.2 98.6 102.4 70.4]; //rain guage readings at respective stations\n", "s=0;\n", "for i=1:5\n", " s=s+p(i);\n", "end\n", "pavg=s/5;\n", "u=0;\n", "for i=1:5\n", " u=u+(p(i)-pavg)^2;\n", "end\n", "sx=(u/4)^0.5;\n", "Cv=sx*100/pavg;\n", "N=(Cv/6)^2;\n", "N=round(N*100)/100;\n", "mprintf('mean rainfall=%f cm.',pavg);\n", "mprintf('\ntotal stations needed=%f.',N);\n", "//taking N=7\n", "N=7;\n", "n=N-5;\n", "mprintf('\nadditional guages needed=%i.',n);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.20: EX4_20.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.20\n", "//calculate relation between R and P\n", "clc;funcprot(0);\n", "//given\n", "P=[72.2 70.1 73.3 42.5 81.3 50.6 52.9 59.4 60.3 64.3 68.8 56.7 77.2 40.5 44.1 65.5]; //Precipitation\n", "R=[24.1 22.7 25.6 11.3 28.4 12.7 13.4 15.7 16.2 17.7 19.2 14.9 25.4 10.6 11.7 17.9]; //runoff\n", "for i=1:16\n", " Ps(i)=P(i)^2;\n", " Rs(i)=R(i)^2;\n", " PR(i)=P(i)*R(i);\n", "end\n", "\n", "s=0;t=0;u=0;q=0;w=0;\n", "for i=1:16\n", " s=s+Ps(i);\n", " t=t+Rs(i);\n", " u=u+PR(i);\n", " q=q+P(i);\n", " w=w+R(i);\n", "end\n", "N=16;\n", "a=(N*u-q*w)/(N*s-q^2);\n", "b=(w-a*q)/N;\n", "b=round(b*1000)/1000;\n", "a=round(a*10000)/10000;\n", "mprintf('Equation is:\n%fP%f.',a,b);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.21: EX4_21.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example4.21\n", "//calculateeffective rainfall hyetograph and volume of diret run-off\n", "clc;funcprot(0);\n", "//given\n", "A=8.6; //catchment area\n", "T=[0:0.5:4]; //time\n", "r=[0 0.4 1.1 2.3 3.8 4.8 5.6 6.2 6.7]; //accumulated rainfall\n", "fi=0.4; //fi index\n", "dt=0.5; //time interval\n", "d(1)=0;\n", "for i=2:9\n", " d(i)=r(i)-r(i-1); //accumulated rainfall\n", "end\n", "mprintf('Intensity of effective Rainfall:');\n", "I(1)=0;\n", "s=0;\n", "for i=2:9\n", " p(i)=d(i)-fi; //effective rainfall\n", " I(i)=p(i)/dt; //Intensity of effective Rainfall\n", " s=s+I(i);\n", " mprintf('\n%f',I(i));\n", "end\n", "//graph is plotted between I and T\n", "run=s*dt;\n", "V=run*A*10000;\n", "mprintf('\nVolume of direct run-off=%f cubic metre.',V);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.22: EX4_22.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.22\n", "//calculate\n", "//total rainfall\n", "//total rainfall excess\n", "//W index\n", "clc;funcprot(0);\n", "//given\n", "r=[3.5 6.5 8.5 7.8 6.4 4 4 6]; //rainfall intensity\n", "T=[0:30:240]; //time\n", "dt=30; //time interval\n", "//graph is plotted between r and T\n", "s=0;\n", "for i=1:8\n", " s=s+r(i);\n", "end\n", "P=s*dt/60;\n", "Pe=((6.5-4.5)+(8.5-4.5)+(7.8-4.5)+(6.4-4.5)+(6-4.5))*dt/60; //area of graph above r=4.5.\n", "w=(P-Pe)/4;\n", "mprintf('total rainfall=%f cm.',P);\n", "mprintf('\ntotal rainfall excess=%f cm.',Pe);\n", "mprintf('\nW index=%f cm/hr.',w);\n", "\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.23: EX4_23.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.23\n", "//calculate fi index\n", "clc;funcprot(0);\n", "//given\n", "r=[0 8 22 74 92 105 114 120]; //raccumulated rainfall\n", "T=[0 2 4 6 8 10 12 14]; //time for start of rainfall\n", "V=2D6; //volume of run-off\n", "A=40; //catchment area\n", "tr=14; //duration of rainfall\n", "\n", "d=V*1000/(40*1000000);\n", "\n", "l=r(8)-d;\n", "W=l/tr;\n", "for i=2:8\n", " I(i)=r(i)-r(i-1); //incremental rainfall\n", "end\n", "\n", "//rainfall excess is available in 4 time intervals of 2 hrs\n", "tre=8;\n", "fi=(l-I(2)-I(7)-I(8))/tre;\n", "fi=round(fi*100)/100;\n", "mprintf('fi index=%f mm/hr.',fi);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.24: EX4_24.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.24\n", "//calculate average infiltration index\n", "clc;funcprot(0);\n", "//given\n", "r=[2.0 2.5 7.6 3.8 10.6 5.0 7.0 10.0 6.4 3.8 1.4 1.4]; //rainfall depths\n", "R=25.5; //total rum-off\n", "s=0;\n", "for i=1:12\n", " s=s+r(i);\n", "end\n", "tf=s-R;\n", "af=tf/12;\n", "//rainfall is less than average infiltration in1st,2nd,11th and 12th hours\n", "\n", "f=(tf-r(1)-r(2)-r(11)-r(12))/8;\n", "f=round(f*10)/10;\n", "mprintf('average infiltration index=%f cm/hour.',f);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.25: EX4_25.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.25\n", "//calculate average depth of hourly rainfall excess\n", "clc;funcprot(0);\n", "//given\n", "r=[2.0 2.5 7.6 3.8 10.6 5.0 7.0 10.0 6.4 3.8 1.4 1.4]; //rainfall depths\n", "A1=20;\n", "A2=40;\n", "A3=60;\n", "A=A1+A2+A3;\n", "fi1=7.6;\n", "fi2=3.8;\n", "fi3=1.0;\n", "for i=1:12\n", " R1(i)=r(i)-fi1; //rainfall excess\n", " R2(i)=r(i)-fi2;\n", " R3(i)=r(i)-fi3;\n", " if (R1(i)<0) then\n", " R1(i)=0;\n", "end\n", "if (R2(i)<0) then\n", " R2(i)=0;\n", "end\n", "if (R3(i)<0) then\n", " R3(i)=0;\n", "end\n", "end\n", "mprintf('average depth of hourly rainfall excess(cm/hr)');\n", "for i=1:12\n", " a1(i)=R1(i)*A1/A; //average rainfall excess\n", " a2(i)=R2(i)*A2/A;\n", "a3(i)=R3(i)*A3/A;\n", "T(i)=a1(i)+a2(i)+a3(i); //total hourly rainfall excess\n", "T(i)=round(T(i)*100)/100;\n", "mprintf('\n%f',T(i));\n", "end\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.26: EX4_26.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example4.26\n", "//derive the unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "A=92; //area of drainage basin\n", "t=[6 8 10 12 14 16 18 20 22 24 2 4 6 8 10 12 14 16]; //time\n", "r=[10.6 9.7 107.8 175.6 193.9 150.3 126.2 106.9 90 72.8 58.2 48 36.2 28.4 20.2 14 10.2 10.4]; //total run-off\n", "B=[10.6 9.7 9.73 9.77 9.8 9.83 9.87 9.9 9.93 9.97 10 10.03 10.07 10.10 10.13 10.16 10.20 10.40]; //base flow\n", "s=0;\n", "for i=1:18\n", " d(i)=r(i)-B(i); //direct run-off ordinate\n", "s=s+d(i);\n", "end\n", "n=0.36*s*2/A;\n", "mprintf('ordinates of unit hydrograph:');\n", "for i=1:18\n", " u(i)=d(i)/n; //ordinates of unit hydrograph\n", " u(i)=round(u(i)*100)/100;\n", " mprintf('\n%f',u(i));\n", "end\n", "mprintf('\nHydograph is 4-hr unit hydrograph');\n", "//graph is plotted between:\n", "//r and t\n", "//u and t" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.27: EX4_27.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.27\n", "//calculate rainfall excess\n", "clc;funcprot(0);\n", "//given\n", "A=316; //drainage area\n", "B=17; //base flow\n", "t=6;\n", "O=[17.0 113.2 254.5 198.0 150.0 113.2 87.7 67.9 53.8 42.5 31.1 22.6 17.0]; //ordinates of storm hydrograph\n", "for i=1:13\n", " Or(i)=O(i)-B; //ordinates of direct run-off\n", " Oh(i)=Or(i)/6.477; //ordinates of unit hydrograph\n", "end\n", "s=0;\n", "for i=1:13\n", " s=s+Or(i);\n", "end\n", "re=s*60*60*t/(A*10000);\n", "re=round(re*1000)/1000;\n", "mprintf('rainfall excess=%f cm.',re);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.28: EX4_28.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.28\n", "//calculate ordinates of storm hydrograph\n", "clc;funcprot(0);\n", "//given\n", "fi=2.5; //infiltration index\n", "B=10; //Base flow\n", "O=[0 110 365 500 390 310 250 235 175 130 95 65 40 22 10 0 0 0]; //ordinates of unit hydrograph\n", "R1=2;R2=6.75;R3=3.75;\n", "r1=(R1*10-(fi*3)-5)/10; //rainfall excess in first three hour\n", "r2=(R2*10-(fi*3))/10; //rainfall excess in second three hour\n", "r3=(R3*10-(fi*3))/10; //rainfall excess in third three hour\n", "\n", "for i=1:18\n", " s1(i)=r1*O(i); \n", "end\n", "for i=2:18\n", " s2(i)=r2*O(i-1);\n", "end\n", "for i=3:18\n", " s3(i)=r3*O(i-2);\n", "end //surface run-off from rainfall excess during succesive unit periods\n", "mprintf('ordinates of storm hydrograph');\n", "for i=1:18\n", " T(i)=s1(i)+s2(i)+s3(i);\n", " t(i)=T(i)+B;\n", " t(i)=round(t(i)*10)/10;\n", " mprintf('\n%f',t(i));\n", "end\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.29: EX4_29.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example4.29\n", "//derive and plot 6 hr unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "A=103.4; //area of basin\n", "t=[0:3:36]; //time\n", "q=[0 21 80 82 189 123 184 87 55.5 25.25 9 6 0]; //flow\n", "mprintf('ordinates of unit hydrograph are:');\n", "u(1)=0;\n", "u(2)=q(2)/2;\n", "u(3)=(q(3)-4*u(1))/2;\n", "u(4)=(q(4)-4*u(2))/2;\n", "for i=5:9\n", " u(i)=(q(i)-3*u(i-4)-4*u(i-2))/2; //ordinates of unit hydrograph\n", "end\n", "for i=1:9\n", " mprintf('\n%f',u(i));\n", "end\n", "mprintf('\n\nThe succesive unit hydrograph will have same ordinates but will be shifted\nlaterally by 6 hrs.');\n", "//graph is plotted between u and t." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.2: EX4_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.2\n", "//calculate precipitation at A using arithmatic mean method\n", "clc;funcprot(0);\n", "//given\n", "pB=48; //precipitation at B\n", "pC=51; //precpitation at C\n", "pD=45; //precipitation at D\n", "\n", "pA=(pB+pC+pD)/3;\n", "mprintf('precipitation at A=%i mm.',pA);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.30: EX4_30.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.30\n", "//derive ordinates of 6 hrs unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "R=[0 1 2.7 5 8 9.8 9 7.5 6.3 5 4 2.9 2.1 1.3 0.5 0 0 0 0 0]; //2hrs unit hydrograph\n", "mprintf('ordinates of 6 hrs unit hydrograph');\n", "for i=1:18\n", " O1(i+2)=R(i);\n", " \n", " \n", "end\n", "for i=1:16\n", " O2(i+4)=R(i);\n", "end //offset unit hydrograph\n", "for i=1:20\n", " S(i)=O1(i)+O2(i)+R(i); //sum\n", " f(i)=S(i)/3; //ordinates of 6 hrs unit hydrograph\n", " f(i)=round(f(i)*10)/10;\n", " mprintf('\n%f',f(i));\n", "end\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.31: EX4_31.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.31\n", "//calculate ordinate of 9 hr unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "t=[0:3:45]; //time\n", "O=[0 9 20 35 49 43 35 28 22 17 12 9 6 3 0 0]; //ordinate of 2 hr unit hydrograph\n", "of(1)=0;\n", "of(2)=0;\n", "for i=3:16\n", " of(i)=O(i-2)+of(i-2); //offset ordinate\n", "end \n", "for i=1:16\n", " s(i)=O(i)+of(i); //ordinate of s-curve\n", "end \n", "of1(3)=0; \n", "for i=4:16\n", " of1(i)=s(i-3); //offset of s-curve\n", "end\n", "mprintf('ordinates of 9 hrs unit hydrograph:');\n", "for i=1:16\n", " y(i)=s(i)-of1(i);\n", " u(i)=2*y(i)/3; //ordinate of 9 hrs unit hydrograph\n", " u(i)=round(u(i)*10)/10;\n", " mprintf('\n%f',u(i));\n", "end\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.32: EX4_32.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.32\n", "//calculate recurrence interval of flood using\n", "//california method\n", "//Hazens method\n", "//gumbels method\n", "clc;funcprot(0);\n", "//given\n", "q=[9200 7800 6600 5800 5260 4980 4525 3810 3630 3250 3110 3090 2380 2390 1723]; //Discharge arranged in decreasing order\n", "N=15;\n", "C=0.3;\n", "m=[1:1:15];\n", "C=[0.3 0.44 0.52 0.57 0.61 0.66 0.7 0.74 0.78 0.82 0.86 0.88 0.94 0.96 1]; //from table 4.25\n", "mprintf('California Hazen Gumbel');\n", "for i=1:15\n", " Ca(i)=N/m(i);\n", " H(i)=2*N/(2*m(i)-1);\n", " G(i)=N/(m(i)+C(i)-1);\n", " Ca(i)=round(Ca(i)*100)/100;\n", " G(i)=round(G(i)*100)/100;\n", " H(i)=round(H(i)*100)/100;\n", " mprintf('\n%f %f %f',Ca(i),H(i),G(i));\n", "end\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.33: EX4_33.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.33\n", "//calculate flood magnitude with return period of 240 years\n", "clc;funcprot(0);\n", "//given\n", "T1=40;T2=80; //Return period\n", "F1=27000;F2=31000; //Peak flood\n", "y80=-(2.303*log10(2.303*log10(T2/(T2-1))));\n", "y40=-(2.303*log10(2.303*log10(T1/(T1-1))));\n", "y=(F2-F1)/(y80-y40);\n", "T=240;\n", "y240=-(2.303*log10(2.303*log10(T/(T-1))));\n", "x240=F2+(y240-y80)*y;\n", "mprintf('flood magnitude with return period of 240 years=%i cumec.',x240);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.34: EX4_34.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.34\n", "//calculate flood discharge with recurrence period of 100 years and 200 years\n", "clc;funcprot(0);\n", "//given\n", "N=40;\n", "Sn=1.1413;yn=0.5436; //from table 4.21 (a) and(b)\n", "q=[1330 1095 1030 980 975 950 945 940 925 855 853 840 835 825 810 795 756 710 708 705 700 670 625 620 610 605 595 585 570 550 530 505 500 495 485 465 460 420 390 380]; //discharge\n", "s=0;\n", "for i=1:40\n", " s=s+q(i);\n", " end\n", "xavg=s/N;\n", "w=0;\n", "for i=1:40\n", " t(i)=(q(i)-xavg)^2;\n", " w=w+t(i);\n", "end\n", "sigma=(w/(N-1))^0.5;\n", "N=10;\n", "y10=-(2.303*log10(2.303*log10(N/(N-1))));\n", "K10=(y10-yn)/Sn;\n", "x10=xavg+K10*sigma;\n", "N=20;\n", "y20=-(2.303*log10(2.303*log10(N/(N-1))));\n", "K20=(y20-yn)/Sn;\n", "x20=xavg+K20*sigma;\n", "N=5;\n", "y5=-(2.303*log10(2.303*log10(N/(N-1))));\n", "K5=(y5-yn)/Sn;\n", "x5=xavg+K5*sigma;\n", "\n", "T=100;\n", "y100=-(2.303*log10(2.303*log10(T/(T-1))));\n", "K100=(y100-yn)/Sn;\n", "x100=xavg+K100*sigma;\n", "\n", "T=200;\n", "y200=-(2.303*log10(2.303*log10(T/(T-1))));\n", "K200=(y200-yn)/Sn;\n", "x200=xavg+K200*sigma;\n", "x100=round(x100);\n", "mprintf('For T=100 years:\nflood discharge=%f cumecs.\n\nFor T=200 years:\nflood discharge=%i cumecs.',x100,x200);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.35: EX4_35.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.35\n", "//calculate 200 year flood for stream using gumbel's method\n", "clc;funcprot(0);\n", "//given\n", "sigma=1.1413; //standard deviation\n", "yn=0.5436;\n", "T=50;\n", "y50=-2.303*log10(2.303*log10(T/(T-1)));\n", "K50=(y50-yn)/sigma;\n", "T=100;\n", "y100=-2.303*log10(2.303*log10(T/(T-1)));\n", "K100=(y100-yn)/sigma;\n", "x50=878; x100=970; //given peak flood\n", "A=[K50 1;K100 1];\n", "B=[x50;x100];\n", "C=A\B;\n", "xavg=C(2);\n", "sigmad=C(1);\n", "T=200;\n", "y200=-2.303*log10(2.303*log10(T/(T-1)));\n", "K200=(y200-yn)/sigma;\n", "x200=xavg+K200*sigmad;\n", "x200=round(x200);\n", "mprintf('200 year flood for stream=%f cumecs.',x200);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.36: EX4_36.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.36\n", "//calculate\n", "//risk of failure of cofferdam\n", "//return period\n", "clc;funcprot(0);\n", "//given\n", "T=30; //deign for period\n", "n=6; //period of construction\n", "R=(1-(1-(1/T))^n)*100;\n", "R1=0.1; //reduced risk\n", "T1=1/(1-(1-R1)^(1/6));\n", "R=round(R*10)/10;\n", "T1=round(T1*100)/100;\n", "mprintf('risk of failure of cofferdam=%f percent.',R);\n", "mprintf('\nreturn period=%f years.',T1);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.37: EX4_37.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.37\n", "//calculate\n", "//probability of excedence\n", "//probability of flood magnitude occuring at:\n", "//at least once in 10 years\n", "//two times in 10 succesive years\n", "//once in 10 succesive years\n", "clc;funcprot(0);\n", "//given\n", "T=40; //return period\n", "P=1/T;\n", "n=10;\n", "Rsk=1-(1-P)^n;\n", "s=1;t=1;\n", "for i=1:n\n", " s=s*i;\n", "end\n", "for i=1:(n-2)\n", " t=t*i;\n", "end\n", "P2n=s*P^2*(1-P)^8/(t*2);\n", "P1n=n*P*(1-P)^(n-1);\n", "Rsk=round(Rsk*1000)/1000;\n", "P2n=round(P2n*10000)/10000;\n", "P1n=round(P1n*1000)/1000;\n", "mprintf('probability of excedence=%f.',P);\n", "mprintf('\nprobability of flood magnitude occuring at least once in 10 years=%f',Rsk);\n", "mprintf('\nprobability of flood magnitude occuring at two times in 10 succesive years=%f',P2n);\n", "mprintf('\nprobability of flood magnitude occuring at once in 10 succesive years=%f',P1n);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.38: EX4_38.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.38\n", "//calculate peak rate of run off\n", "clc;funcprot(0);\n", "//given\n", "C1=0.22;C2=0.12;C3=0.32; //run-off coefficient\n", "A1=3.2;A2=4.8;A3=1.8; //calculated area\n", "L=2.4; //length of water course\n", "H=30; //fall\n", "T=30; //frequency\n", "t=60*0.000323*(L*1000)^0.77*(H/(L*1000))^(-0.385);\n", "i=78*T^0.22/(t+12)^0.45;\n", "q=2.778*i*(C1*A1+C2*A2+C3*A3);\n", "q=round(q*10)/10;\n", "mprintf('peak rate of run off=%f cumecs.',q);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.39: EX4_39.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.39\n", "//calculate peak flow rate\n", "clc;funcprot(0);\n", "//given\n", "T=30; //return period\n", "A=2.4; //area of watershed\n", "s=1/200; //slope oof catchment\n", "L=1.8; //length of travel of water\n", "C=0.25; //average run-off coefficient\n", "r=[2.5 3.8 4.8 5.9 6.7 7.4 8.4 8.7 9.2]; //rsinfall depth\n", "t=60*0.000323*(L*1000)^0.77*(s)^(-0.385); \n", "rmax=r(7)+(r(8)-r(7))*7.84/10;\n", "i=rmax*60/t;\n", "q=2.778*C*A*i;\n", "q=round(q*100)/100;\n", "mprintf('peak flow rate=%f cumecs.',q);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.3: EX4_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.3\n", "//calculate precipitation at x\n", "clc;funcprot(0);\n", "//given\n", "pA=6.6; //precipitation at A\n", "pB=4.8; //precpitation at B\n", "pC=3.7; //precipitation at C\n", "nA=72.6; //normal precipitation at A\n", "nB=51.8; //normal precipitation at B\n", "nC=38.2; //normal precipitation at C\n", "nX=65.6; //normal precipitation at X\n", "\n", "pX=(nX*pA/nA+nX*pB/nB+nX*pC/nC)/3;\n", "pX=round(pX*100)/100;\n", "mprintf('precipitation at x=%f cm.',pX);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.40: EX4_40.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.40\n", "//calculate precipitation at x\n", "clc;funcprot(0);\n", "//given\n", "pA=75; //precipitation at A\n", "pB=58; //precpitation at B\n", "pC=47; //precipitation at C\n", "nA=826; //normal precipitation at A\n", "nB=618; //normal precipitation at B\n", "nC=482; //normal precipitation at C\n", "nX=757; //normal precipitation at X\n", "\n", "pX=(nX*pA/nA+nX*pB/nB+nX*pC/nC)/3;\n", "pX=round(pX*10)/10;\n", "mprintf('precipitation at x=%f cm.',pX);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.41: EX4_41.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.1\n", "//calculate mean rainfall;additional guages needed\n", "clc;funcprot(0);\n", "//given\n", "p=[41 51 32 55 50 68]; //rain guage readings at respective stations\n", "s=0;\n", "for i=1:6\n", " s=s+p(i);\n", "end\n", "pavg=s/6;\n", "u=0;\n", "for i=1:6\n", " u=u+(p(i)-pavg)^2;\n", "end\n", "sx=(u/5)^0.5;\n", "Cv=sx*100/pavg;\n", "N=(Cv/8)^2;\n", "N=round(N*100)/100;\n", "mprintf('mean rainfall=%f cm.',pavg);\n", "mprintf('\ntotal stations needed=%f.',N);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.42: EX4_42.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.42\n", "//calculate mean precipitaion using thiesson polygon method\n", "clc;funcprot(0);\n", "//given\n", "a=4; //dimension of plot sides\n", "P1=4.8;P2=13;P3=8;P4=5.4;P5=3.2;P6=9.4; //precipitaion at respective stations\n", "A1=a^2/8+a^2/(4*1.73);\n", "A2=a^2/8;\n", "A3=A2;A4=A1;\n", "A5=a^2/(4*1.73);\n", "A6=a^2/2;\n", "A=A1+A2+A3+A4+A5+A6;\n", "Pavg=(P1*A1+P2*A2+P3*A3+P4*A4+P5*A5+P6*A6)/A;\n", "mprintf('Mean precipitaion=%f cm.',Pavg);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.43: EX4_43.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.43\n", "//calculate average depth of precipitation\n", "clc;funcprot(0);\n", "//given\n", "A=[90 140 125 140 85 40 20]; //area of isohytes\n", "I=[13:-2:1]; //average isohytel interval\n", "s=0;t=0;\n", "for i=1:7\n", " s=s+A(i)*I(i);\n", " t=t+A(i);\n", "end\n", "Pavg=s/t;\n", "Pavg=round(Pavg*10)/10;\n", "mprintf(' average depth of precipitation=%f cm.',Pavg);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.44: EX4_44.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.44\n", "//calculate mean rainfall;additional guages needed\n", "clc;funcprot(0);\n", "//given\n", "p=[120 95 96 60 65 70 45 21]; //rain guage readings at respective stations\n", "s=0;\n", "for i=1:8\n", " s=s+p(i);\n", "end\n", "pavg=s/8;\n", "u=0;\n", "for i=1:8\n", " u=u+(p(i)-pavg)^2;\n", "end\n", "sx=(u/7)^0.5;\n", "Cv=sx*100/pavg;\n", "N=(Cv/13.99)^2;\n", "N=round(N*100)/100;\n", "mprintf('mean rainfall=%f cm.',pavg);\n", "mprintf('\ntotal stations needed=%f.',N);\n", "//taking N=10\n", "N=10;\n", "n=N-8;\n", "mprintf('\nadditional guages needed=%i.',n);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.45: EX4_45.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.45\n", "//compute maximum rainfall intensities for 5,10,15,20,25,30,35,40,45,50 minutes\n", "//plot intensity duration graph\n", "clc;funcprot(0);\n", "//given\n", "CR=[0 1.02 2.08 3.30 4.72 5.58 6.40 7.16 7.88 8.54 9.14]; //cumulative rainfall\n", "\n", "c5(2)=CR(2);\n", "c10(3)=CR(3);\n", "c15(4)=CR(4);\n", "c20(5)=CR(5);\n", "c25(6)=CR(6);\n", "c30(7)=CR(7);\n", "c35(8)=CR(8);\n", "c40(9)=CR(9);\n", "c45(10)=CR(10);\n", "c50(11)=CR(11);\n", "for i=3:11\n", " c5(i)=CR(i)-CR(i-1);\n", "end\n", "for i=4:11\n", " c10(i)=CR(i)-CR(i-2);\n", "end\n", "for i=5:11\n", " c15(i)=CR(i)-CR(i-3);\n", "end\n", "for i=6:11\n", " c20(i)=CR(i)-CR(i-4);\n", "end\n", "for i=7:11\n", " c25(i)=CR(i)-CR(i-5);\n", "end\n", "for i=8:11\n", " c30(i)=CR(i)-CR(i-6);\n", "end\n", "for i=9:11\n", " c35(i)=CR(i)-CR(i-7);\n", "end\n", "for i=10:11\n", " c40(i)=CR(i)-CR(i-8);\n", "end\n", "for i=11:11\n", " c45(i)=CR(i)-CR(i-9);\n", "end //rainfall in any possible time interval\n", "\n", "mprintf('5min 10min 15min 20min 25min 30min 35min 40min 45min 50min');\n", "for i=1:11\n", " mprintf('\n%f %f %f %f %f %f %f %f %f %f',c5(i),c10(i),c15(i),c20(i),c25(i),c30(i),c35(i),c40(i),c45(i),c50(i));\n", "end\n", "I=[17.04 15.84 14.80 14.16 13.39 12.80 12.27 11.82 11.39 10.97]; //maximum intensity at respective durations\n", "D=[5:5:50]; //durations\n", "//graph is plotted between I and D" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.46: EX4_46.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.46\n", "//draw storm hyetograph and intensity duration curve\n", "clc;funcprot(0);\n", "//given\n", "p=[0 5 7.5 8.5 9]; //accumulated precipitation\n", "t=[0 30 60 90 120]; //time\n", "r(1)=0;\n", "mprintf('Rainfall intensity:');\n", "for i=2:5\n", " r(i)=p(i)-p(i-1); //rainfall in succesive 30 min interval\n", " I(i)=r(i)*60/30; //rainfall intensity\n", " mprintf('\n%f',I(i));\n", "end\n", "//graph is plotted between I and t.\n", " " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.47: EX4_47.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.47\n", "//calculate average depth of precipitation using depth area curve\n", "clc;funcprot(0);\n", "//given\n", "I=[21:-1:12]; //isohytes\n", "a=[543 1345 2030 2545 2955 3280 3535 3710 3880 3915]; //enclosed area\n", "ia(1)=543;\n", "for i=2:10\n", " ia(i)=a(i)-a(i-1); //net incremental area between isohytes\n", "end\n", "r=[21.5:-1:12.5]\n", "for i=1:10\n", " rv(i)=r(i)*ia(i); //rainfall volume\n", "end\n", "cv(1)=11675;\n", "for i=2:10\n", " cv(i)=cv(i-1)+rv(i); //cumulative volume\n", "end\n", "for i=1:10\n", " eud(i)=cv(i)/a(i); //depth(mm)\n", "end\n", "\n", "mprintf('From depth area curve we obtain average depth of precipitation=20.15 mm for an\narea of 2400 sq. km.');\n", "//graph is plotted between eud and a" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.48: EX4_48.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.48\n", "//calculate evaporation from reservior surface during the week\n", "clc;funcprot(0);\n", "//given\n", "h1=7.75; //initial depth of water\n", "r=3.80; //rainfall during the week\n", "hr=2.50; //depth of water removed\n", "C=0.7; //pan coefficient\n", "ha=r-hr;\n", "hl=ha+h1;\n", "h2=8.32;\n", "ev=hl-h2;\n", "evs=ev*C;\n", "evs=round(evs*100)/100;\n", "mprintf('evaporation from reservior surface during the week=%f cm.',evs);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.49: EX4_49.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example4.49\n", "//calculate fi index and time of rainfall excess\n", "clc;funcprot(0);\n", "//given\n", "T=[1:1:12]; //time from start\n", "r=[1.8 2.6 7.8 3.9 10.6 5.4 7.8 9.2 6.5 4.4 1.8 1.6]; //increamental rainfall\n", "R=24.4; //total run-off\n", "s=0;\n", "for i=1:12\n", " s=s+r(i);\n", "end\n", "ti=s-R;\n", "\n", "//first trial\n", "tr=7; //assumed\n", "ti=s-R-r(1)-r(2)-r(4)-r(11)-r(12);\n", "fi=ti/tr;\n", "for i=1:12\n", " P(i)=r(i)-fi;\n", " if (P(i)<0) then\n", " P(i)=0;\n", " end\n", "end\n", "mprintf('Time(h) rainfall excess.');\n", "for i=1:12\n", " mprintf('\n%f %f',T(i),P(i));\n", "end\n", "mprintf('\n\nfi index=%f cm/hr.',fi);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.4: EX4_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.4\n", "//calculate precipitation at A by inverse distance method\n", "clc;funcprot(0);\n", "//given\n", "pB=74; //precipitation at B\n", "pC=88; //precpitation at C\n", "pD=71; //precipitation at D\n", "pE=80; //precipitation at E\n", "Bx=9;By=6;\n", "Cx=12;Cy=-9;\n", "Dx=-11;Dy=-6;\n", "Ex=-7;Ey=7;\n", "Ax=0;Ay=0;\n", "Db=(Bx^2+By^2);\n", "Dc=(Cx^2+Cy^2);\n", "Dd=(Dx^2+Dy^2);\n", "De=(Ex^2+Ey^2);\n", "Wb=1/Db;\n", "Wc=1/Dc;\n", "Wd=1/Dd;\n", "We=1/De;\n", "s=pB*Wb+pC*Wc+pD*Wd+pE*We;\n", "pA=s/(Wb+Wc+Wd+We);\n", "pA=round(pA*10)/10;\n", "mprintf('precipitation at A=%f mm.',pA);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.50: EX4_50.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.50\n", "//calculate fi index\n", "clc;funcprot(0);\n", "//given\n", "r=[0.6 1.35 2.25 3.45 2.7 2.4 1.5 0.75]; //incremental rainfall\n", "T=[1:1:8]; //time from start of rainfal\n", "t=8;\n", "P=15; //total rainfall\n", "R=8.7; //direct run-off\n", "W=(P-R)/t;\n", "//since fi wil be more than W\n", "tre=6;\n", "fi=((P-R)-r(1)-r(8))/tre;\n", "mprintf('fi index=%f cm/hr.',fi);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.51: EX4_51.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 4.51\n", "//calculate total infiltration depth lasting 6 hrs\n", "clc;funcprot(0);\n", "//given\n", "I=10; //total infiltration rate\n", "fI=5; //final infiltration rate\n", "k=0.95; //rate of decay of difference between final and initial infiltration rate\n", "\n", "q=integrate('fI+(I-fI)*%e^(-k*t)','t',0,6);\n", "q=round(q*100)/100;\n", "mprintf('total infiltration depth=%f mm.',q);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.52: EX4_52.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 4.52\n", "//find the equation of infiltration capacity\n", "clc;funcprot(0);\n", "//given\n", "fc=1; //constant infiltration rate\n", "ft=[10.4 5.6 3.2 2.1 1.5 1.2 1.1 1 1]; //infiltration capacity\n", "f=ft(1)-fc;\n", "t=[0:0.25:2];\n", "\n", "for i=1:9\n", " r(i)=ft(i)-fc;\n", " \n", "end\n", "for i=1:7\n", " h(i)=log10(r(i));\n", "end\n", "s=0.775; //from graph\n", "k=1/(log10(%e)*s);\n", "k=round(k*100)/100;\n", "mprintf('Equation is:\nft=fc+%fe^(-%ft)',f,k);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.53: EX4_53.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.53\n", "//calculate\n", "//total rainfall\n", "//net run-off\n", "//W index\n", "clc;funcprot(0);\n", "//given\n", "r=[2 2 8 7 1.25 1.25 4.5]; //rainfall intensity\n", "T=[15 30 45 60 70 90 105]; //time\n", "dt=15; //time interval\n", "fi=3; //fi index\n", "//graph is plotted between r and T\n", "s=0;\n", "for i=1:7\n", " s=s+r(i);\n", "end\n", "P=s*dt/60;\n", "Pe=((8-3)+(7-3)+(4.5-3))*dt/60; //area of graph above r=3.0.\n", "w=(P-Pe)/(105/60);\n", "w=round(w*1000)/1000;\n", "mprintf('total rainfall=%f cm.',P);\n", "mprintf('\nnet run-off=%f cm.',Pe);\n", "mprintf('\nW index=%f cm/hr.',w);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.54: EX4_54.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.54\n", "//calculate Total rainfall in catchment\n", "//run-off by rainfall of 3.3cm in 3hrs\n", "clc;funcprot(0);\n", "//given\n", "A=[36 18 66]; //area of catchment\n", "fi=[0.9 1.1 0.5]; //fi index\n", "r1=[0.6 0.9 1.0]; //rainfall in first hour\n", "r2=[2.4 2.1 2.0]; //rainfall in second hour\n", "r3=[1.3 1.5 0.9]; //rainfall in third hour\n", "\n", "t36=r1(1)+r2(1)+r3(1);\n", "t18=r1(2)+r2(2)+r3(2);\n", "t66=r1(3)+r2(3)+r3(3);\n", "\n", "p=(t36*A(1)+t18*A(2)+t66*A(3))/(A(1)+A(2)+A(3));\n", "mprintf('Total rainfall in catchment=%f cm.',p);\n", "\n", "ro1=[0 0 0.5];ro2=[1.5 1.0 1.5];ro3=[0.4 0.4 0.4]; //rainfall-fi\n", "t1=ro1(1)+ro2(1)+ro3(1);\n", "t2=ro1(2)+ro2(2)+ro3(2);\n", "t3=ro1(3)+ro2(3)+ro3(3);\n", "run=(A(1)*t1+A(2)*t2+A(3)*t3)/(A(1)+A(2)+A(3)); //run-off from entire catchment\n", "mprintf('\nrun-off by rainfall of 3.3cm in 3hrs=%f cm.',run);\n", "fia=(fi(1)*A(1)+fi(2)*A(2)+fi(3)*A(3))/(A(1)+A(2)+A(3));\n", "tr=(1.1-fia)*3;\n", "mprintf('\nTotal run-off=%f cm.',tr);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.55: EX4_55.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.55\n", "//calculate relation between R and P\n", "clc;funcprot(0);\n", "//given\n", "P=[4 22 28 15 12 8 4 15 10 5]; //Precipitation\n", "R=[0.2 7.1 10.9 4.0 3.0 1.3 0.4 4.1 2.0 0.3]; //runoff\n", "for i=1:10\n", " Ps(i)=P(i)^2;\n", " Rs(i)=R(i)^2;\n", " PR(i)=P(i)*R(i);\n", "end\n", "\n", "s=0;t=0;u=0;q=0;w=0;\n", "for i=1:10\n", " s=s+Ps(i);\n", " t=t+Rs(i);\n", " u=u+PR(i);\n", " q=q+P(i);\n", " w=w+R(i);\n", "end\n", "N=10;\n", "a=(N*u-q*w)/(N*s-q^2);\n", "b=(w-a*q)/N;\n", "a=round(a*10000)/10000;\n", "b=round(b*10000)/10000;\n", "mprintf('Equation is:\n%fP%f.',a,b);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.56: EX4_56.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.56\n", "//calculate peak discharge of 6 hrs unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "Q=470; //peak discharge of flood hydrograph\n", "B=15; //base flow\n", "l=0.25; //infiltration loss\n", "Qr=Q-B;\n", "d=8; //average depth of rainfall\n", "re=d-l*6; //rainfall excess\n", "q=Qr/re;\n", "mprintf('peak discharge of 6 hrs unit hydrograph=%i cumecs.',q);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.57: EX4_57.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.57\n", "//calculate ordinates of storm hydrograph\n", "clc;funcprot(0);\n", "//given\n", "fi=0.25; //infiltration index\n", "B=20; //Base flow\n", "O=[0 20 60 150 120 90 70 50 30 20 10 0 0 0]; //ordinates of unit hydrograph\n", "R1=5;R2=0.8;R3=3;\n", "r1=R1-(fi*4); //rainfall excess in first four hour\n", "r2=R2-(fi*4); //rainfall excess in second four hour\n", "r3=R3-(fi*4); //rainfall excess in third four hour\n", "if r2<0\n", " r2=0;\n", " end \n", "\n", "for i=1:14\n", " s1(i)=r1*O(i);\n", "end\n", "for i=2:14\n", " s2(i)=r2*O(i-1);\n", "end\n", "for i=3:14\n", " s3(i)=r3*O(i-2);\n", "end //surface run-off from rainfall excess during succesive unit periods\n", "mprintf('ordinates of storm hydrograph');\n", "for i=1:14\n", " T(i)=s1(i)+s2(i)+s3(i); //sub-total\n", " t(i)=T(i)+B; //ordinate of flood hydrograph\n", " mprintf('\n%i',t(i));\n", "end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.58: EX4_58.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.58\n", "//calculate ordinates of discharge hydrograph and peak discharge\n", "clc;funcprot(0);\n", "//given\n", "fi=2.5; //fi index\n", "t=24;\n", "A=200; //area of catchment\n", "R1=7.5;R2=2.0;R3=5; //rainfall\n", "r1=R1-fi;r2=R2-fi;r3=R3-fi;\n", "r2=0;\n", "r=[5 0 2.5]; //excess rainfall\n", "D=[5 15 40 25 10 5 0 0 0]; //distribution\n", "for i=1:9\n", " d1(i)=D(i)*r(1)/100;\n", "end\n", "for i=1:8\n", " d2(i+1)=D(i)*r(2)/100;\n", "end\n", "for i=1:7\n", " d3(i+2)=D(i)*r(3)/100;\n", "end //distribution run-off for rainfall excess\n", "\n", "for i=1:9\n", " tr1(i)=d1(i)+d2(i)+d3(i); //total run-off as depth\n", " tr2(i)=23.148*tr1(i); //total run-off as discharge\n", " tr2(i)=round(tr2(i)*1000)/1000;\n", "end\n", "s=0;\n", "for i=1:9\n", " s=s+tr2(i);\n", "end\n", "mprintf('Total run-off:');\n", "mprintf('\nas depth as discharge');\n", "for i=1:9\n", " mprintf('\n%f %f',tr1(i),tr2(i));\n", "end\n", "r=0.36*s*t/A;\n", "r=round(r*10)/10;\n", "mprintf('\ntotal run-off=%f cm.',r);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.59: EX4_59.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.59\n", "//calculate ordinate of 6 hr unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "O=[10 30 90 220 280 220 166 126 92 62 40 20 10]; //ordinates of 6 hr flood hydrograph\n", "B=10; //Base flow\n", "for i=1:13\n", " r(i)=O(i)-B; //ordinates of direct run-off\n", "end\n", "mprintf('Ordinates of 6 hr unit hydrograph');\n", "u(1)=0;\n", "for i=2:13\n", " u(i)=r(i)-u(i-1); //ordinates of 6 hrs unit hydrograph\n", "end\n", "for i=1:13\n", " mprintf('\n%i',u(i));\n", "end\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.5: EX4_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.5\n", "//calculate average rainfall using\n", "//arithmatic average method\n", "//isohytel method\n", "//thiesson polygon method\n", "clc;funcprot(0);\n", "//given\n", "p=[58 61 69 56 84 86 69 79 71]; //values of precipitation\n", "s=0;\n", "for i=1:9\n", " s=s+p(i);\n", "end\n", "ar=s/9;\n", "ar=round(ar*10)/10;\n", "mprintf('using arithmatic average method:')\n", "mprintf('\nAverage rainfall=%f cm.',ar);\n", "\n", "I=[86 85 80 75 70 65 60 55 50]; //isphytes\n", "A=[0.43 5.20 4.0 5.04 5.85 4.53 4.09 1.27]; //area between isohytes\n", "for i=1:8\n", " a(i)=(I(i)+I(i+1))/2;\n", "end\n", "for i=1:8\n", " P(i)=A(i)*a(i);\n", "end\n", "s=0;\n", "for i=1:8\n", " s=s+P(i);\n", "end\n", "t=0;\n", "for i=1:8\n", " t=t+A(i);\n", "end\n", "ar=s/t;\n", "ar=round(ar*10)/10;\n", "mprintf('\n\nisohytel method:')\n", "mprintf('\nAverage rainfall=%f cm.',ar);\n", "\n", "A=[3.26 0.39 1.61 2.04 2.46 0.84 3.91 5.09 0.41 3.94 2.06 4.40]; //thiessen area\n", "p=[58 63 71 69 86 81 84 56 53 69 61 79]; //observed precipitation\n", "for i=1:12\n", " P(i)=A(i)*p(i);\n", "end\n", "s=0;\n", "for i=1:12\n", " s=s+P(i);\n", "end\n", "disp(s);\n", "t=0;\n", "for i=1:12\n", " t=t+A(i);\n", "end\n", "ar=s/t;\n", "ar=round(ar*10)/10;\n", "mprintf('\n\nthiesson polygon method:')\n", "mprintf('\nAverage rainfall=%f cm.',ar);\n", "//mean rainfall obtained by thiesson polygon method is different from book as product(A*P) is round offed in book." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.60: EX4_60.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.60\n", "//determine the ordinates of 1 cm-6 hour hydrograph\n", "clc;funcprot(0);\n", "//given\n", "t=6;\n", "A=450; //catchment area\n", "O=[5 15 40 80 60 50 25 15 5]; //ordinates of flood hydrograph\n", "B=5; //base flow assumed\n", "s=0;\n", "for i=1:9\n", " r(i)=O(i)-B; //ordinates of direct run-off\n", "s=s+r(i);\n", "end\n", "n=s*0.36*12/A;\n", "mprintf('ordinates of unit hydrograph');\n", "for i=1:9\n", " u(i)=r(i)/n;\n", " u(i)=round(u(i)*100)/100;\n", " mprintf('\n%f',u(i));\n", "end\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.61: EX4_61.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.61\n", "//obtain ordinates 24 hr unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "O=[0 5.5 13.5 26.5 45 82 162 240 231 165 112 79 57 42 31 22 14 9.5 6.6 4 2 1 0 0 0 0 0]; //ordinates of 1st 8 hrs unit hydrograph\n", "for i=1:25\n", " o1(i+2)=O(i); //ordinates of 2nd 8 hrs unit hydrograph\n", " o2(i+4)=O(i); //ordinates of 3rd 8 hrs unit hydrograph\n", "end\n", "mprintf('ordinates 24 hr unit hydrograph:');\n", "for i=1:27\n", " o3(i)=o1(i)+o2(i)+O(i); //total 24 hr hydrograph of 3 cm run-off\n", " t(i)=o3(i)/3;\n", " t(i)=round(t(i)*10)/10;\n", " mprintf('\n%f',t(i));\n", "end\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.62: EX4_62.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 4.62\n", "//ordinates of 1 hr unit hydrograph\n", "clc;funcprot(0);\n", "//given\n", "t=[0:1:12]; //time\n", "O=[0 0 54 0 175 0 127 0 58 0 25 0 0 0]; //ordinate of 2 hr unit hydrograph\n", "of(1)=0;\n", "of(2)=0;\n", "for i=3:13\n", " if modulo(i,2)==0;\n", " of(i)=0;\n", " \n", "else \n", " of(i)=O(i-2)+of(i-2);\n", "end\n", "end\n", "s=[0 25 54 120 229 300 356 390 414 430 439 439 439]; //Ordinates of S-curve\n", "for i=2:13\n", " of1(i)=s(i-1);\n", "end\n", "mprintf('ordinates of 1 hr unit hydrograph:');\n", "for i=1:13\n", " y(i)=s(i)-of1(i);\n", "u(i)=y(i)*2;\n", "mprintf('\n%i',u(i));\n", "end\n", "//graph is plotted between u and t\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.63: EX4_63.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.63\n", "//calculate design disharge\n", "clc;funcprot(0);\n", "//given\n", "xavg=1200; //sample mean\n", "n=50; //assurance year\n", "A=0.95; //assurance percent\n", "Rsk=1-A;\n", "sigma=650; //standard deviation\n", "yn=0.53622; //mean of reduced variate\n", "sigma30=1.11238; //standard deviation of reduced variate\n", "\n", "T=1/(1-(1-Rsk)^(1/n));\n", "yt=-2.303*log10(2.303*log10(T/(T-1)));\n", "K=(yt-yn)/sigma30;\n", "xt=xavg+K*sigma;\n", "mprintf(' design disharge=%i cumecs.',xt);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.64: EX4_64.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.64\n", "//calculate flood magnitude with return period of 500 years\n", "clc;funcprot(0);\n", "//given\n", "T1=50;T2=100; //Return period\n", "F1=20600;F2=22150; //Peak flood\n", "y100=-(2.303*log10(2.303*log10(T2/(T2-1))));\n", "y50=-(2.303*log10(2.303*log10(T1/(T1-1))));\n", "y=(F2-F1)/(y100-y50);\n", "T=500;\n", "y500=-(2.303*log10(2.303*log10(T/(T-1))));\n", "x500=F2+(y500-y100)*y;\n", "x500=round(x500);\n", "mprintf('flood magnitude with return period of 240 years=%f cumec.',x500);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.65: EX4_65.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.65\n", "//calculate recurrence interval of 10 minutes storm using Gumbel's method\n", "clc;funcprot(0);\n", "//given\n", "xavg=1.65; //mean of data\n", "sigma=0.45; //standard deviation\n", "x=3;\n", "y=1.2825*(x-xavg)/sigma+0.577;\n", "l=%e^(%e^(-y));\n", "T=l/(l-1);\n", "T=round(T*10)/10;\n", "mprintf('recurrence interval of 10 minutes storm=%f years.',T);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.66: EX4_66.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.66\n", "//calculate flood magnitude with return period of 200 years\n", "clc;funcprot(0);\n", "//given\n", "T1=50;T2=100; //Return period\n", "F1=30800;F2=36300; //Peak flood\n", "y100=-(2.303*log10(2.303*log10(T2/(T2-1))));\n", "y50=-(2.303*log10(2.303*log10(T1/(T1-1))));\n", "y=(F2-F1)/(y100-y50);\n", "T=200;\n", "y200=-(2.303*log10(2.303*log10(T/(T-1))));\n", "x200=F2+(y200-y100)*y;\n", "x200=round(x200);\n", "mprintf('flood magnitude with return period of 240 years=%f cumecs.',x200);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.67: EX4_67.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.67\n", "//calculate return period of flood of 9950 cumec/s\n", "clc;funcprot(0);\n", "//given\n", "xavg=4200; //mean\n", "sigma=1705; //standard deviation\n", "xt=9550; //flood value\n", "K=(xt-xavg)/sigma;\n", "yt=1.2825*K+0.577;\n", "l=%e^(%e^(-yt));\n", "T=l/(l-1);\n", "T=round(T*100)/100;\n", "mprintf('Return period of flood of 9950 cumec/s=%f years.',T);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.68: EX4_68.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.68\n", "//calculate flood magnitude with return period of 1000 years\n", "clc;funcprot(0);\n", "//given\n", "T1=100;T2=50; //Return period\n", "F1=485;F2=445; //Peak flood\n", "y50=-(2.303*log10(2.303*log10(T2/(T2-1))));\n", "y100=-(2.303*log10(2.303*log10(T1/(T1-1))));\n", "y=(F2-F1)/(y50-y100);\n", "T=1000;\n", "y1000=-(2.303*log10(2.303*log10(T/(T-1))));\n", "x1000=F2+(y1000-y50)*y;\n", "x1000=round(x1000*10)/10;\n", "mprintf('flood magnitude with return period of 240 years=%f cumecs.',x1000);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.69: EX4_69.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.69\n", "//calculate\n", "//probability of exceedence\n", "//probability of occurence in next 12 years\n", "clc;funcprot(0);\n", "//given\n", "T=25; //return period\n", "n=12;\n", "P=1/T;\n", "Rsk=1-(1-P)^n;\n", "P=round(P*100)/100;\n", "Rsk=round(Rsk*10000)/10000;\n", "mprintf('probability of exceedence=%f.',P);\n", "mprintf('\nprobability of occurence in next 12 years=%f.',Rsk);\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.6: EX4_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.6\n", "//ceck whether data at station X is consistence\n", "//year in which regime is indicated\n", "//compute the adjusted rainfall atX\n", "clc;funcprot(0);\n", "//given\n", "X=[69 55 62 67 87 70 65 75 90 100 90 95 85 90 75 95]; //annual rainfall at X\n", "Y=[77 62 67 68 86 90 65 75 70 70 70 75 65 70 55 75]; //average rainfall at 10 base stations\n", "cx(1)=69; //accumulated annual values at station X \n", "for i=2:16 \n", " cx(i)=cx(i-1)+X(i);\n", "end\n", "cy(1)=77;\n", "for i=2:16\n", " cy(i)=cy(i-1)+Y(i); //accumulated annual values at ten stations\n", " \n", "end\n", "\n", "//since curve is not having unform slope\n", "mprintf('Record at X is not consistent.');\n", "mprintf('\nFrom the curve regime is observed in the year 1978.')\n", "\n", "Q=[1970 1971 1972 1973 1974 1975 1976 1977];\n", "O=[95 75 90 85 95 90 100 90];\n", "for i=1:8\n", " A(i)=0.7051*O(i);\n", "end\n", "mprintf('\n\nYear Observed rainfall Adjusted rainfall');\n", "for i=1:8\n", " mprintf('\n%i %i %i',Q(i),O(i),A(i));\n", "end\n", "//graph is plotted between cx and cy" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.7: EX4_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.7\n", "//construct hyetograph\n", "clc;funcprot(0);\n", "//given\n", "c=[0 12.4 22.1 35.1 52.7 63.7 81.9 109.2 123.5 132.6 143.3 146 146]; //cumulative rainfall\n", "T=[0:1:13]; //Time\n", "t=15/60; //time interval\n", "r(1)=0;\n", "mprintf('Rainfall intensity:');\n", "I(1)=0;\n", "for i=2:13\n", " r(i)=c(i)-c(i-1); \n", " I(i)=r(i)/t; //Rainfall intensity\n", "mprintf('\n%f',I(i));\n", "end\n", "\n", "//graph is plotted between I and T" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.8: EX4_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.8\n", "//compute maximum rainfall intensities for 15,30,45,60,90,120 minutes\n", "//plot intensity duration graph\n", "clc;funcprot(0);\n", "//given\n", "CR=[0 12.4 22.1 35.1 52.7 63.7 81.9 109.2 123.5 132.6 143.3 146.0 146.0]; //cumulative rainfall\n", "\n", "c15(2)=12.4;\n", "c30(3)=22.1;\n", "c45(4)=35.1;\n", "c60(5)=52.7;\n", "c90(7)=81.9;\n", "c120(9)=123.5;\n", "for i=3:13\n", " c15(i)=CR(i)-CR(i-1);\n", "end\n", "for i=4:13\n", " c30(i)=CR(i)-CR(i-2);\n", "end\n", "for i=5:13\n", " c45(i)=CR(i)-CR(i-3);\n", "end\n", "for i=6:13\n", " c60(i)=CR(i)-CR(i-4);\n", "end\n", "for i=8:13\n", " c90(i)=CR(i)-CR(i-6);\n", "end\n", "for i=10:13\n", " c120(i)=CR(i)-CR(i-8);\n", "end\n", "mprintf('15min 30min 45min 60min 90min 120min');\n", "for i=1:13\n", " mprintf('\n%f %f %f %f %f %f',c15(i),c30(i),c45(i),c60(i),c90(i),c120(i));\n", "end\n", "I=[109.2 91 79.7 74.1 67.6 61.75]; //maximum intensity at respective durations\n", "D=[15 30 45 60 90 120]; //durations\n", "//greph is plotted between I and D" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.9: EX4_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "//example 4.9\n", "//calculate preciptation value which has recurrence period of 6 years\n", "clc;funcprot(0);\n", "//given\n", "p=[475 377 731 1066 361 305 926 628 409 236 337 853]; //precipitation value\n", "N=12; //total number of years\n", "T=6; //recurrence interval\n", "m=N/T;\n", "mprintf('Ranking of storm=%i.',m);\n", "//hence pick 2nd severest storm\n", "mprintf('\npreciptation value which has recurrence period of 6 years=%i mm.',p(7));\n", "" ] } ], "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 }