{
 "metadata": {
  "name": "",
  "signature": "sha256:be9a83eac81003b59bb1ec7327404f7c36e99fe14c8c14251b46829335a79c67"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16 : WATERLOGGING AND CANAL LINING"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.1 pg : 764"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import roots\n",
      "from sympy import acot\n",
      "\n",
      "#design a trapezoidal concrete lined channel\n",
      "\n",
      "#Given\n",
      "Q = 100.;               \t\t\t\t#discharge\n",
      "S = 25./100000;           \t\t\t\t#bed slope\n",
      "N = 0.016;             \t\t\t\t#rogsity coefficient\n",
      "s = 1.5;               \t\t\t\t#side slope\n",
      "V = 1.5;               \t\t\t\t#limiting velocity\n",
      "\n",
      "\n",
      "# Calculations\n",
      "#umath.sing manning's equation  V = (R**2/3*S**1/2)/N;\n",
      "R = (V*N/(S**0.5))**(1.5);      \t\t\t\t#hydraulic mean depth\n",
      "\n",
      "#for s = 1.5;\n",
      "theta = acot(1.5);\n",
      "A = Q/V;\n",
      "P = A/R;\n",
      "#umath.sing equation of area and perimeter of trapezium\n",
      "#perimeter of trapezium = b+2d(theta+cot(theta));\n",
      "#area of trapezium = bd+d**2(theta+cot(theta));\n",
      "#we get\n",
      "y = [1,-17.1,31.9]\n",
      "d = roots(y)[1];\n",
      "#we get D = 14.968917 and 2.1310826.\n",
      "#taking d = 2.1310826;\n",
      "b = P-4.18*d;\n",
      "b = round(b*100)/100;\n",
      "d = round(d*100)/100;\n",
      "print \"required bed width = %.2f m.\"%(b);\n",
      "print \"required bed depth = %.2f m\"%(d);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required bed width = 26.74 m.\n",
        "required bed depth = 2.13 m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.2 pg : 765"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#design a trapezoidal concrete lined channel\n",
      "\t\t\t\t\n",
      "#Given\n",
      "Q = 100.;               \t\t\t\t#discharge\n",
      "S = 25./100000;           \t\t\t\t#bed slope\n",
      "N = 0.016;             \t\t\t\t#rogsity coefficient\n",
      "s = 1.5;               \t\t\t\t#side slope\n",
      "r = 8.;                 \t\t\t\t#b/d ratio\n",
      "\n",
      "\n",
      "# Calculations\n",
      "#umath.sing manning equation V = (R**2/3*S**1/2)/N;\n",
      "#Perimeter = A/R \n",
      "#V = Q/A and on simplification we get\n",
      "d = ((101/10.09)*(12.18/10.09)**(2./3))**(3./8);\n",
      "b = r*d;\n",
      "b = round(b);\n",
      "d = round(d*100)/100;\n",
      "\n",
      "# Results\n",
      "print \"required bed width = %.2f m.\"%(b);\n",
      "print \"required bed depth = %.2f m\"%(d);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required bed width = 20.00 m.\n",
        "required bed depth = 2.49 m\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.3 pg : 766"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from sympy import acot\n",
      "\n",
      "#design a concrete lined channel\n",
      "\n",
      "#Given\n",
      "Q = 45.;              \t\t\t\t#discharge\n",
      "S = 1./10000;         \t\t\t\t#bed slope\n",
      "s = 5./4;             \t\t\t\t#side slope\n",
      "N = 0.018;           \t\t\t\t#rogosity coefficient(manning N)\n",
      "\n",
      "#channel is assumed to be of triangular section\n",
      "theta = acot(s);\n",
      "#umath.sing manning equation V = (R**2/3*S**1/2)/N;\n",
      "#V = Q/A; \n",
      "#perimeter of trapezium = b+2d(theta+cot(theta));\n",
      "#area of trapezium = bd+d**2(theta+cot(theta));\n",
      "#we get\n",
      "d = (Q*2.86/1.925)**(3./8);\n",
      "d = round(d*100)/100;\n",
      "\n",
      "# Results\n",
      "print \"required depth of triangular channel = %.2f m\"%(d);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required depth of triangular channel = 4.84 m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.4 pg : 767"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#design a concrete lined channel of trapezoidal section\n",
      "\t\t\t\t\n",
      "#Given\n",
      "Q = 250.;             \t\t\t\t#discharge\n",
      "S = 1./6000;          \t\t\t\t#bed slope\n",
      "s = 1.5;             \t\t\t\t#side slope\n",
      "d = 3.;               \t\t\t\t#limiting depth\n",
      "N = 0.015;           \t\t\t\t#rogosity coefficient\n",
      "\n",
      "#umath.sing Perimeter = A/R;\n",
      "#perimeter of trapezium = b+2d(theta+cot(theta));\n",
      "#area of trapezium = bd+d**2(theta+cot(theta));\n",
      "#Q = A*V; and on simplification\n",
      "#we get\n",
      "#(3b+18.81)**5/3/(b+12.54)**2/3 = 290.47;\n",
      "#solving it by trial and error method we get\n",
      "b = 44.6;\n",
      "\n",
      "# Results\n",
      "print \"required bed width = %.2f m.\"%(b);\n",
      "print \"required bed depth = %i m\"%(d);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required bed width = 44.60 m.\n",
        "required bed depth = 3 m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.5 pg : 767"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "H = 10.;             \t\t\t\t#depth of impervious stratum from top soil\n",
      "D = 1.8;           \t\t\t\t#position of drain below top soil surface\n",
      "Hw = 1.5;          \t\t\t\t#depth of highest point of water\n",
      "k = 1.e-4;         \t\t\t\t#permeability consmath.tant\n",
      "\n",
      "\n",
      "# Calculations\n",
      "#math.since water has to be removed in 24 hours\n",
      "b = H-Hw;\n",
      "a = H-D;\n",
      "L = (4*k*(b**2-a**2)*100*24*3600/0.8)**0.5;\n",
      "\n",
      "# Results\n",
      "print \"drains should be spaced at %i m c/c.\"%(L);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "drains should be spaced at 147 m c/c.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.6 pg : 768"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "L = 30.;         \t\t\t\t#spacing between drans\n",
      "Q = 4.e-6;       \t\t\t\t#discharge\n",
      "a = 8.;\n",
      "b = 8.3;\n",
      "\n",
      "\n",
      "# Calculations\n",
      "k = 1000000*Q*L/(4*(b**2-a**2));\n",
      "k = round(k*100)/100;\n",
      "\n",
      "# Results\n",
      "print \"permeability coefficient = %.2fD-6 m/sec.\"%(k);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "permeability coefficient = 6.13D-6 m/sec.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.7 pg : 768"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "L = 50.;         \t\t\t\t#spacing between drains\n",
      "k = 1.e-5;       \t\t\t\t#permeability coefficient\n",
      "a = 10.;\n",
      "b = 10.3;\n",
      "\n",
      "\n",
      "# Calculations\n",
      "Q = 4*k*(b**2-a**2)/L;\n",
      "Pav = Q*24*3600*100*100/L;\n",
      "\n",
      "# Results\n",
      "print \"annual average rainfall = %i cm\"%(Pav);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "annual average rainfall = 84 cm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.8 pg : 768"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "r1 = 2;        \t\t\t\t#ka/kb\n",
      "r2 = 1./1.5;    \t\t\t\t#La/Lb\n",
      "r3 = 5./6;      \t\t\t\t#(b**2-a**2)a/((b**2-a**2)b)\n",
      "\n",
      "\n",
      "# Calculations\n",
      "Rq = r1*r3/r2;\n",
      "Rp = Rq/r2;\n",
      "\n",
      "# Results\n",
      "print \"ratio of discharge at A and B = %.2f.\"%(Rq);\n",
      "print \"ratio of average rainfall at A and B = %.2f.\"%(Rp);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "ratio of discharge at A and B = 2.50.\n",
        "ratio of average rainfall at A and B = 3.75.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.9 pg : 775"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "#decide whether it is economically feasible to provide canal lining\n",
      "\t\t\t\t\n",
      "#Given\n",
      "li = 2.5;               \t\t\t\t#seepage loss for lined channel\n",
      "p1 = 25.;                \t\t\t\t#wetted perimeter for lined channel\n",
      "t = 12.;                 \t\t\t\t#thickness of concrete lining\n",
      "lf = 0.02;              \t\t\t\t#seepage loss for unlined channel\n",
      "p2 = 20.;                \t\t\t\t#wetted perimeter for unlined channel\n",
      "\n",
      "#assume 1 km length of canal\n",
      "#annual benifit\n",
      "\n",
      "\t\t\t\t#(1).seepage\n",
      "A1 = p1*1000;             \t\t\t\t#area of wetted perimeter\n",
      "li = li*p1/1000;          \t\t\t\t#seepage loss\n",
      "A2 = p2*1000;            \t\t\t\t#area of wetted perimmeter for unlined channel\n",
      "lf = p2*lf/1000;        \t\t\t\t#seepage loss for unlined channel\n",
      "s = li-lf;               \t\t\t\t#saving in water loss\n",
      "a1 = s*p1*100000;        \t\t\t\t#annual revenue saved\n",
      "\n",
      "\t\t\t\t#(2)maintainence\n",
      "a2 = 0.4*25000;         \t\t\t\t#saving in maintainance math.cost\n",
      "ts = a1+a2;             \t\t\t\t#total annual benifit\n",
      "\n",
      "\t\t\t\t#annual math.cost\n",
      "A1 = p2*1000;           \t\t\t\t#area of lining for unlinrd canal\n",
      "C = 100*A1;             \t\t\t\t#math.cost of lining\n",
      "\t\t\t\t#interest rate is 6%\n",
      "i = 0.06;\n",
      "N = 50;\n",
      "a = (C*i*(i+1)**N)/((1+i)**N-1);  \t\t\t\t#annual math.cost of lining or capital recovery factor\n",
      "bcr = ts/a;                 \t\t\t\t#benifit math.cost ratio\n",
      "bcr = round(bcr*1000)/1000;\n",
      "print \"Benifit math.cost ratio = %.2f.\"%(bcr);\n",
      "\t\t\t\t#as bcr>1\n",
      "print \" ;Since it is more than 1.Hence, it is economically justifiable. \";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Benifit math.cost ratio = 1.30.\n",
        " ;Since it is more than 1.Hence, it is economically justifiable. \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.10 pg : 776"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "Ecd = 20;           \t\t\t\t#electrical conductivity of drainage water\n",
      "Eci = 1.5;        \t\t\t\t#m mho/cm\n",
      "Dc = 55.5;        \t\t\t\t#consumptive use\n",
      "\n",
      "\n",
      "# Calculations\n",
      "Lr = Eci/Ecd;\n",
      "D = Dc/(1-Lr);\n",
      "\n",
      "# Results\n",
      "print \"required depth of water to be applied = %i mm.\"%(D);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required depth of water to be applied = 60 mm.\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.11 pg : 776"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "Eci = 1.4;        \t\t\t\t# m mho/cm\n",
      "Ece = 11.;         \t\t\t\t#saturated extract of soil\n",
      "Dc = 85.;          \t\t\t\t#consumptive use requirement of crop\n",
      "\n",
      "\n",
      "# Calculations\n",
      "#let us assume Ecd = 2Ece\n",
      "Lr = Eci/(2*Ece);\n",
      "Di = Dc/(1-Lr);\n",
      "Di = round(Di*10)/10;\n",
      "\n",
      "\n",
      "# Results\n",
      "print \"required depth of water to be applied = %.2f mm.\"%(Di);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required depth of water to be applied = 90.80 mm.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.12 pg : 776"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#percentage of earth work is saved in lined section\n",
      "\n",
      "#Given\n",
      "s = 1.5;        \t\t\t\t#side slope\n",
      "Q = 15.;         \t\t\t\t#discharge\n",
      "S = 1./4000;     \t\t\t\t#bed slope\n",
      "Nl = 0.014;      \t\t\t\t#manning n for lined channel\n",
      "Nu = 0.028;      \t\t\t\t#manning n for ulined channel \n",
      "fb = 0.75;         \t\t\t\t#free board\n",
      "\n",
      "#considering the perimeter of trapezoidal section\n",
      "#taking minimum perimeter for given area\n",
      "#i.e dP/dD = 0\n",
      "#we get\n",
      "#A = 2.1D**2; R = D/2; and P = 4.2D\n",
      "\n",
      "#for linrd channel\n",
      "#Q = AR**(2/3)*S**0.5\n",
      "#substituting above values we get\n",
      "D = (10.0396)**(3./8);\n",
      "B = 0.6*D;\n",
      "R = D/2;\n",
      "tau = 9.81*R*S*1000;\n",
      "tau = round(tau*1000)/1000;\n",
      "print \"for lined canal:\";\n",
      "print \"average boundary shear stress = %.2f N/square m.\"%(tau);\n",
      "Dc = D+fb;            \t\t\t\t#total depth of cutting\n",
      "A1 = (B+1.5*Dc)*Dc;\n",
      "\n",
      "#for unlined channel\n",
      "#Q = AR**(2/3)*S**0.5\n",
      "#substituting above values we get\n",
      "D = 3.08;\n",
      "B = 0.6*D;\n",
      "R = D/2;\n",
      "tau = 9.81*R*S*1000;\n",
      "tau = round(tau*100)/100;\n",
      "print \"for unlined canal:\";\n",
      "print \"average boundary shear stress = %.2f N/square m.\"%(tau);\n",
      "Dc = D+fb;            \t\t\t\t#total depth of cutting\n",
      "A2 = (B+1.5*Dc)*Dc;\n",
      "per = (A2-A1)*100/A2;   \n",
      "per = round(per*100)/100;\n",
      "print \"percent saving of earth = %.2f percent.\"%(per);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "for lined canal:\n",
        "average boundary shear stress = 2.91 N/square m.\n",
        "for unlined canal:\n",
        "average boundary shear stress = 3.78 N/square m.\n",
        "percent saving of earth = 34.32 percent.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.13 pg : 778"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import roots\n",
      "\n",
      "#design a lined canal\n",
      "\t\t\t\t\n",
      "#Given\n",
      "Q = 100.;              \t\t\t\t#discharge\n",
      "S = 1./2500;           \t\t\t\t#bed slope\n",
      "V = 2.;                \t\t\t\t#maximum permissible velocity\n",
      "n = 0.013;            \t\t\t\t#manning n\n",
      "s = 1.25;             \t\t\t\t#side slope\n",
      "\n",
      "\n",
      "# Calculations\n",
      "A = Q/V;\n",
      "#from manning formula  V = (R**2/3*S**1/2)/N;\n",
      "R = (V*n/S**0.5)**1.5;\n",
      "P = A/R;\n",
      "\n",
      "#now umath.sing the equation of area and perimeter of trapezoid\n",
      "#area = D(B+2.5D)\n",
      "#perimeter = B+3.2D;\n",
      "#we get\n",
      "y = [1.95,-33.73,50]\n",
      "D = roots(y)[1];\n",
      "#we get D = 15.660087 and 1.6373489\n",
      "#taking D = 1.6373489;\n",
      "B = P-3.2*D;\n",
      "B = round(B*10)/10;\n",
      "D = round(D*100)/100;\n",
      "\n",
      "# Results\n",
      "print \"required bed width = %.2f m.\"%(B);\n",
      "print \"required bed depth = %.2f m\"%(D);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "required bed width = 28.50 m.\n",
        "required bed depth = 1.64 m\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.14 pg : 778"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\t\n",
      "#Given\n",
      "B = 5.;         \t\t\t\t#bed width\n",
      "D = 2.;         \t\t\t\t#bed depth\n",
      "S = 1./1600;    \t\t\t\t#bed slope\n",
      "n = 0.015;     \t\t\t\t#manning n\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "A = B+2*D;     \t\t\t\t#area of lining\n",
      "#let B1 and D1 be new  width and depth of bed\n",
      "#for getting maximum discharge we diffrentiate Q and equating it to zero\n",
      "#Q = S**0.5*B1D1**5/3/n\n",
      "#we get\n",
      "D1 = 45./16;\n",
      "B1 = 9-2*D1;\n",
      "Q1 = S**0.5*B1*D1**5/3/n;\n",
      "D1 = round(D1*10000)/10000;\n",
      "print \"new width of bed = %.2f m.\"%(B1);\n",
      "print \"new depth of bed = %.2f m.\"%(D1);\n",
      "print \" maximum discharge = %.2f cumec.\"%(Q1);\n",
      "R = D;\n",
      "V = R**(2./3)*S**0.5/n;\n",
      "F = V/(9.81*D)**0.5;       \t\t\t\t#froud number\n",
      "R = D1;\n",
      "V = R**(2./3)*S**0.5/n;\n",
      "F = V/(9.81*D1)**0.5;       \t\t\t\t#froud number\n",
      "print \"Froud number is less than 1 in both case.Hence flow doesnot change from sub-critical to super critical.\";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "new width of bed = 3.38 m.\n",
        "new depth of bed = 2.81 m.\n",
        " maximum discharge = 329.96 cumec.\n",
        "Froud number is less than 1 in both case.Hence flow doesnot change from sub-critical to super critical.\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.15 pg : 779"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from sympy import acot\n",
      "\n",
      "#area to be irrigated\n",
      "\t\t\t\t\n",
      "#Given\n",
      "B = 5.;          \t\t\t\t#bed width\n",
      "D = 2.5;        \t\t\t\t#bed depth\n",
      "s = 1.5;        \t\t\t\t#side slope\n",
      "S = 1./1000;     \t\t\t\t#bed slope\n",
      "n = 0.016;       \t\t\t\t#manning n\n",
      "k = 10.;         \t\t\t\t#kor period\n",
      "d = 150.;        \t\t\t\t#field irrigation requirement   \n",
      "\n",
      "\n",
      "# Calculations\n",
      "theta = acot(s);\n",
      "A = B*D+D**2*(theta+1/math.tan(theta));\n",
      "P = B+2*D*(theta+1/math.tan(theta));\n",
      "R = A/P;\n",
      "Q = A*R**(2./3)*S**0.5/n;\n",
      "V = Q*k*24*3600;   \t\t\t\t#volum of water supply by channel\n",
      "A = V*10/(d*10000);\n",
      "Q = round(Q*100)/100;\n",
      "A = round(A)*100;\n",
      "\n",
      "# Results\n",
      "print \"maximum carrying capacity of canal = %.2f cumec.\"%(Q);\n",
      "print \"Area to be irrigated = %.2f hectares.\"%(A);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "maximum carrying capacity of canal = 70.65 cumec.\n",
        "Area to be irrigated = 40700.00 hectares.\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}