diff options
Diffstat (limited to 'Hydraulics_by_J._Lal')
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_1.ipynb | 938 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_2.ipynb | 399 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_3.ipynb | 705 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_4.ipynb | 772 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_5.ipynb | 1200 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_6.ipynb | 926 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/README.txt | 10 | ||||
-rwxr-xr-x | Hydraulics_by_J._Lal/screenshots/pic11.png | bin | 0 -> 112429 bytes | |||
-rwxr-xr-x | Hydraulics_by_J._Lal/screenshots/pic22.png | bin | 0 -> 130446 bytes | |||
-rwxr-xr-x | Hydraulics_by_J._Lal/screenshots/pic33.png | bin | 0 -> 119096 bytes |
10 files changed, 4950 insertions, 0 deletions
diff --git a/Hydraulics_by_J._Lal/Chapter_1.ipynb b/Hydraulics_by_J._Lal/Chapter_1.ipynb new file mode 100755 index 00000000..0bf18fae --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_1.ipynb @@ -0,0 +1,938 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:479142d4049abdadf07bf1d76656a8c86c874f2a835275461f9e38f39f10cbd5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Hydrostatics" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.1 Page no : 9" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "h1 = 2 \t\t\t#in\n", + "h2 = 2 \t\t\t#in\n", + "wn = 13.6 \t\t\t#g/cc\n", + "w = 1 \t\t\t#g/cc\n", + "W = 62.4 \t\t\t#lbs/ft**3\n", + "\n", + "#CALCULATIONS\n", + "ha = ((h2*wn/w)-h1)/12\n", + "pa = ha*W/144\n", + "\n", + "#RESULTS\n", + "print 'Pressure of water = %.2f lb/sq in '%(pa)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure of water = 0.91 lb/sq in \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.2 page no : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "a = 6 \t\t\t#ft\n", + "h = 2 \t\t\t#ft\n", + "sm = 13.6\n", + "sw = 1\n", + "sl =0.8\n", + "\n", + "#CALCULATIONS\n", + "dh = h*(sm-sw)+a\n", + "h1 = (dh-a)/(sl-1)\n", + "\n", + "#RESULTS\n", + "print 'pressure difference in ft of water = %.1f ft of water '%(dh)\n", + "print 'reading of mercury = %.f ft of liquid '%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure difference in ft of water = 31.2 ft of water \n", + "reading of mercury = -126 ft of liquid \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.3 page no : 11" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "sm = 13.6\n", + "so = 0.9\n", + "sw =1\n", + "hb = 8 \t\t\t#ft\n", + "hc = 7.5 \t\t\t#ft\n", + "hd = 1.75 \t\t\t#ft\n", + "\n", + "#CALCULATIONS\n", + "pa = (sm-so)*sw\n", + "pc = pa - hb*so\n", + "pd = pa+so*2-sm*2.5-hc\n", + "pb = hb+hd+pd\n", + "\n", + "#RESULTS\n", + "print 'pressure at A = %.2f ft of water '%(pa)\n", + "print 'pressure at B = %.2f ft of water '%(pb)\n", + "print 'pressure at C = %.2f ft of water '%(pc)\n", + "print 'pressure at D = %.2f ft of water '%(pd)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure at A = 12.70 ft of water \n", + "pressure at B = -17.25 ft of water \n", + "pressure at C = 5.50 ft of water \n", + "pressure at D = -27.00 ft of water \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.4 page no : 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "lm = 2 \t\t\t#ft\n", + "lw = 5 \t\t\t#ft\n", + "lo = 8 \t\t\t#ft\n", + "so = 0.75\n", + "p = 40 \t\t\t#lb/in**2\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "sm = 13.6\n", + "#CALCULATIONS\n", + "h = p*144/w\n", + "Pd = (h-lm*sm)\n", + "Pc = Pd-lw\n", + "Pb = Pc-lo*so\n", + "Pg = Pb*w/144\n", + "#RESULTS\n", + "print 'Reading of the pressure guage at the top of tank = %.1f lb/in**2 '%(Pg)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reading of the pressure guage at the top of tank = 23.4 lb/in**2 \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.5 page no : 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "h = 42 \t\t\t#in\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "#RESULTS\n", + "D = h*w/(144*12)\n", + "#CALCULATIONS\n", + "print 'Depth of point = %.1f lb/in**2 '%(D)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of point = 1.5 lb/in**2 \n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.6 pageno : 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "h = 200 \t\t\t#ft\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "#RESULTS\n", + "D = h*w/(144)\n", + "#CALCULATIONS\n", + "print 'Depth of point = %.1f lb/in**2 '%(D)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of point = 86.7 lb/in**2 \n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.7 pageno :15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "l = 2 \t\t\t#ft\n", + "b = 3 \t\t\t#ft\n", + "h = 10 \t\t\t#ft\n", + "#CALCULATIONS\n", + "P = w*l*b*h\n", + "#RESULTS\n", + "print 'Total pressure = %.f lb '%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total pressure = 3744 lb \n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.8 page no : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "l = 2. \t\t\t#ft\n", + "b = 3. \t\t\t#ft\n", + "a = 60. \t\t\t#degrees\n", + "h = 8. \t\t\t#ft\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "#CALCULATIONS\n", + "x = h+(b/l)*math.cos(math.radians(a))\n", + "P = w*l*b*x\n", + "#RESULTS\n", + "print 'total pressure = %.f lb '%(P)\n", + "\n", + "\n", + "# Note : Answer is different in book please calculate manually using calculator." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total pressure = 3276 lb \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.9 page no : 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "l = 2. \t\t\t#ft\n", + "b = 3. \t\t\t#ft\n", + "h = 8. \t\t\t#ft\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "#CALCULATIONS\n", + "P = w*l*b*(h+(b/2))\n", + "#RESULTS\n", + "print 'total pressure = %.f lb '%(P)\n", + "\n", + "# Note : Answer is different in book please calculate manually using calculator." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total pressure = 3557 lb \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.10 pageno : 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "l = 6. \t\t\t#ft\n", + "b = 4. \t\t\t#ft\n", + "w = 62.4 \t\t\t#lbs/ft**3\n", + "h = 10. \t\t\t#ft\n", + "\n", + "#CALCULATIONS\n", + "P = w*l*b*(b/2)\n", + "hn = (b/2)+(l*b**3/(12*l*b*(b/2)))\n", + "P1 = w*(h+(b/2))*l*b\n", + "h1 = (h+(b/2))+(l*b**3/(12*l*b*(h+(b/2))))\n", + "\n", + "#RESULTS\n", + "print \"Total pressure = %d lb\"%(P1)\n", + "print \"Depth = %.2f ft\"%(hn)\n", + "print 'pressure in ft in case 2 = %.3f ft '%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total pressure = 17971 lb\n", + "Depth = 2.67 ft\n", + "pressure in ft in case 2 = 12.111 ft \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.11 page no : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "sp = 0.87\n", + "d = 12. \t\t\t#ft\n", + "W = 62.4 \t\t\t#lb/ft**3\n", + "Wa = 30. \t\t\t#lb/in**2\n", + "\n", + "#CALCULATIONS\n", + "A = math.pi*d**2/4\n", + "w = W*sp\n", + "x = Wa*144/(w)\n", + "P = round(w*A*x,-3)\n", + "h = x+(A*d**2/16/(A*x))\n", + "\n", + "#RESULTS\n", + "print 'force exerted by the oil upon the gate = %.f lb '%(P)\n", + "print ' position of centre of pressure = %.3f ft '%(h)\n", + "\n", + "# Note : Answer may vary because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "force exerted by the oil upon the gate = 489000 lb \n", + " position of centre of pressure = 79.689 ft \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.12 page no : 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "import math \n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "a = 60. \t\t\t#degrees\n", + "l = 18. \t\t\t#ft\n", + "b = 4. \t\t\t#ft\n", + "W = 8000. \t\t\t#lb\n", + "\n", + "#CALCULATIONS\n", + "P = w*b/(math.sin(math.radians(a))*2)\n", + "h = ((b/(12*(math.sin(math.radians(a)))**3))*(math.sin(math.radians(a)))**2/(b/(math.sin(math.radians(a))*2)))+0.5\n", + "h1 = (1-h)/math.sin(math.radians(a))\n", + "x = ((l*W)/(h1*P))**(1./3)\n", + "\n", + "#RESULTS\n", + "print 'Level of water = %.2f ft '%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Level of water = 13.74 ft \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.13 page no : 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "l = 12 \t\t\t#ft\n", + "b = 6 \t\t\t#ft\n", + "h = 5.196 \t\t\t#ft\n", + "a = 60 \t\t\t#degrees\n", + "a1 = 45 \t\t\t#degrees\n", + "\n", + "#CALCULATIONS\n", + "P = w*l*b*h/2\n", + "h1 = ((l*b**3*(math.sin(math.radians(a)))**2/12)/(l*b*(h/2)))+(h/2)\n", + "R = round(P*(b-(h1/math.cos(math.radians(a/2))))/((b*math.sin(math.radians(a1)))/2),-2)\n", + "\n", + "#RESULTS\n", + "print 'Total comression in the promp CD = %.f lb '%(R)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total comression in the promp CD = 11000 lb \n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.14 page no : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "h = 4. \t\t\t#ft\n", + "b = 6. \t\t\t#ft\n", + "sg = 1.45\n", + "h1 = 5. \t\t\t#ft\n", + "a = 90. \t\t\t#degrees\n", + "\n", + "#CALCULATIONS\n", + "P1 = w*sg*h*b*(h1+(h/2))\n", + "P2 = w*h*b*(h/2)\n", + "Pr = P1-P2\n", + "hup = ((b*h**3/12)*(math.sin(math.radians(a)))**2/(h*b*(h1+(h/2))))+(h1+(h/2))\n", + "x1 = h+h1-hup\n", + "hd = h*2/3\n", + "x2 = h-hd\n", + "x = (P1*x1-P2*x2)/Pr\n", + "d = h1+h-x\n", + "F = Pr*x/4\n", + "\n", + "#RESULTS\n", + "print 'P resultant = %.f lb '%(Pr)\n", + "print 'depth of centre of pressure = %.3f ft '%(d)\n", + "print 'force F required to act horizontally at the top of gate = %.f lb '%(F)\n", + "\n", + "\n", + "# Note : The answer given in texxtbook is wrong. Please check using a calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "P resultant = 12205 lb \n", + "depth of centre of pressure = 7.074 ft \n", + "force F required to act horizontally at the top of gate = 5878 lb \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.15 page no : 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "w = 15. \t\t\t#ft\n", + "D = 15. \t\t\t#ft\n", + "W = 62.4 \t\t\t#lb/ft**3\n", + "a = 120. \t\t\t#degrees\n", + "h1 = 15. \t\t\t#ft\n", + "h2 = 4. \t\t\t#/ft\n", + "h3 = 18. \t\t\t#ft\n", + "\n", + "#CALCULATIONS\n", + "Pu = round(w*D*W*w/2,-3)\n", + "hu = ((w*D**3/12)/(w**2*D/2))+w/2\n", + "Pd = W*h2*w*h2/2-8\n", + "hd = ((w*h2**3/12)/(h2*h1*(h2/2)))+(h2/2)\n", + "P = Pu-Pd\n", + "h = (Pu*(h1-hu)-Pd*(h2-hd))/P\n", + "F = P/(2*math.sin(math.radians(a/4)))\n", + "RT = round(F*(h3-(h1/10)-h)/(h3-(h1/5)),-3)\n", + "RB =F-RT\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Resultant water pressure on each gate : %d lb'%P\n", + "print 'Height of c.p from bottom %.2f ft'%h\n", + "print 'RB = %.f lb '%(RB)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resultant water pressure on each gate : 97520 lb\n", + "Height of c.p from bottom 5.28 ft\n", + "RB = 24520 lb \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.16 page no : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "h = 42. \t\t\t#ft\n", + "w = 25. \t\t\t#ft\n", + "d = 8. \t\t\t#ft\n", + "W = 150. \t\t\t#lb/ft**3\n", + "w1 = 62.4 \t\t\t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "W1 = W*(h*d+(h*(w-d)/2))\n", + "P = round(w1*h*(h/2),-3)\n", + "R = round(math.sqrt(W1**2+P**2)-100,-2)\n", + "o = math.tan(math.radians(P/W1))\n", + "AE = round((d*h*(d/2)+(w-d)*h*(d+(w-d)/3)/2)/(d*h+h*(w-d)/2),2)\n", + "EF = round(14*P/W1,2)\n", + "AF = EF+AE\n", + "AH = w/2\n", + "e = round(AF-AH,1)\n", + "BS = round(W1*e*AH/(w**3/12),-1)\n", + "DS = W1/w-3\n", + "Smax = BS+DS\n", + "Smin = DS-BS\n", + "u = w1 * h\n", + "#RESULTS\n", + "print \"Resultant thrust R = %d lb\"%R\n", + "print 'S max = %.f lb/sq ft '%(Smax)\n", + "print ' S min = %.f lb/sq ft '%(Smin)\n", + "print 'Normal stress on vertical plane at the base due to water pressure and is uniform = %d lb/sq ft'%u" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resultant thrust R = 117500 lb\n", + "S max = 8045 lb/sq ft \n", + " S min = 265 lb/sq ft \n", + "Normal stress on vertical plane at the base due to water pressure and is uniform = 2620 lb/sq ft\n" + ] + } + ], + "prompt_number": 86 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.17 page no : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "W = 145. \t\t\t#lb/cu ft\n", + "M = 500. \t\t\t#lb\n", + "W1 = 64. \t\t\t#lb/cu ft\n", + "\n", + "#CALCULATIONS\n", + "dW = W-W1\n", + "V = M/dW\n", + "\n", + "#RESULTS\n", + "print 'Volume of concrete = %.1f cu ft '%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volume of concrete = 6.2 cu ft \n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.18 page no : 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "W = 10000. \t\t\t#tons\n", + "A = 15000. \t\t\t#ft**2\n", + "d = 15. \t\t\t#ft\n", + "Dsw = 64. \t\t\t#lb/ft**3\n", + "Dw = 62.4 \t\t\t#lb/ft**3\n", + "\n", + "#CALCULATIONS\n", + "Vsw = 2240./Dsw\n", + "Vw = 2240./Dw\n", + "dV = Vw-Vsw\n", + "V1 = W*dV\n", + "h = W/A\n", + "h1 = d+h\n", + "\n", + "#RESULTS\n", + "print 'Depth necessary to just float the ship in river = %.2f ft '%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth necessary to just float the ship in river = 15.67 ft \n" + ] + } + ], + "prompt_number": 87 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.19 page no : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# find Rightening moment\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "W = 5000. \t\t\t#tons\n", + "w = 10. \t\t\t#tons\n", + "d = 30. \t\t\t#ft\n", + "x = 5.5 \t\t\t#in\n", + "l = 10. \t\t\t#ft\n", + "a = 15. \t\t\t#degrees\n", + "\n", + "#CALCULATIONS\n", + "GM = round((w*d)*l/(W*(x/12)),1)\n", + "M = round(GM*math.sin(math.radians(a))*W,-1)\n", + "\n", + "#RESULTS\n", + "print 'Metacentric Height = %.1f ft'%GM\n", + "print 'Rightening moment = %.f lb '%(M)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Metacentric Height = 1.3 ft\n", + "Rightening moment = 1680 lb \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.20 page no : 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "import numpy\n", + "\n", + "#initialisation of variables\n", + "l = 5. \t\t\t#ft\n", + "h = 20. \t\t\t#in\n", + "n = 1./15\n", + "AG = 50. \t\t\t#in\n", + "x = 30. \t\t\t#in\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "AG1 = round(AG/(1+n),1)\n", + "G1G2 = round(n*x/(1+n),2)\n", + "W = l**2*w*(l/2)\n", + "h1 = 32. \t\t\t#in\n", + "BK = h1/2\n", + "GK = 10. \t\t\t#in\n", + "G1K = (AG+GK)-AG1\n", + "BG1 = BK-G1K\n", + "BM = (l**4./12)*2.*12/(l**3*BK*n)\n", + "G1M = BM+BG1\n", + "o = G1G2/G1M\n", + "\n", + "#RESULTS\n", + "print 'AG1 = %.1f in.'%AG1\n", + "print 'G1G2 = %.2f in.'%G1G2\n", + "print 'angle through which the cube will tilt = %.3f in '%(o)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "AG1 = 46.9 in.\n", + "G1G2 = 1.88 in.\n", + "angle through which the cube will tilt = 0.153 in \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/Chapter_2.ipynb b/Hydraulics_by_J._Lal/Chapter_2.ipynb new file mode 100755 index 00000000..8353a544 --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_2.ipynb @@ -0,0 +1,399 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e77c0ecf71b6b19d4b74c1b5653eedac5bf7ec259a0d03cbae3bef3229b3cdac" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Hydrodynamics" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.1 pageno : 41" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "\n", + "Q = 0.8 \t\t\t#ft**3/sec\n", + "w = 62.4 \t\t\t#lb/sec\n", + "d1 = 3. \t\t\t#in\n", + "d2 = 1.5 \t\t\t#in\n", + "#CALCULATIONS\n", + "Q1 = Q*w*60/10.\n", + "a1 = math.pi*(d1/12.)**2/4.\n", + "a2 = math.pi*(d2/12.)**2/4.\n", + "v1 = Q/a1\n", + "v2 = Q/a2\n", + "\n", + "#RESULTS\n", + "print 'Q = %.f gpm'%Q1\n", + "print 'v1 = %.1f ft/sec '%(v1)\n", + "print 'v2 = %.1f ft/sec '%(v2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Q = 300 gpm\n", + "v1 = 16.3 ft/sec \n", + "v2 = 65.2 ft/sec \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.2 page no : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation of variables\n", + "import math \n", + "d1 = 12. \t\t\t#in\n", + "d2 = 9. \t\t\t#in\n", + "z1 = 10. \t\t\t#ft\n", + "z2 = 10. \t\t\t#ft\n", + "p1 = 15. \t\t\t#lb/in**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "Q = 2. \t\t\t#cuses\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "v1 = Q/(math.pi*(d1/12.)**2/4.)\n", + "v2 = Q/(math.pi*(d2/12.)**2/4.)\n", + "p2 = w*(z1-z2+(p1*144/w)+(v1**2/(2*g))-(v2**2/(2*g)))/144\n", + "#RESULTS\n", + "print 'p2 = %.2f lb/in**2 '%(p2)\n", + "\n", + "# note : answer is slightly differet because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "p2 = 14.91 lb/in**2 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.3 page no : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "d0 = 4. \t\t\t#ft\n", + "d2 = 2. \t\t\t#ft\n", + "z0 = 0 \t\t\t#ft\n", + "z1 = 5. \t\t\t#ft\n", + "z2 = 13. \t\t\t#ft\n", + "h = 9.5 \t\t\t#in\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "w1 = 30. \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "r = 0.1\n", + "#CALCULATIONS\n", + "p2 = -h*34/w1\n", + "v2 = math.sqrt(2*g*(z1-p2-z2)/(1+r))\n", + "Q = math.pi*(d2/12)**2*v2*w*60/(10*4)\n", + "#RESULTS\n", + "print 'Discharge = %.f gpm '%(Q)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 104 gpm \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.4 pageno :47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "d1 = 2 \t\t\t#ft\n", + "d2 = 3 \t\t\t#ft\n", + "v1 = 20 \t\t\t#ft/sec\n", + "z1 = 20 \t\t\t#ft\n", + "z2 = 0 \t\t\t#ft\n", + "h = 5 \t\t\t#ft\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "Hl = v1**2*0.15/(2*g)\n", + "a1 = math.pi*d1**2/4\n", + "a2 = math.pi*d2**2/4\n", + "v2 = a1*v1/a2\n", + "p1 = ((h-z1+(v2**2)/(2*g))-(0.85*v1**2/(2*g)))\n", + "#RESULTS\n", + "print 'water pressure at top = %.2f ft of water '%(p1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "water pressure at top = -19.05 ft of water \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.5 page no : 50" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "d1 = 15. \t\t\t#in\n", + "d2 = 6.\t\t\t#in\n", + "h = 10. \t\t\t#in of mercury\n", + "C = 0.98\n", + "sm = 13.6\n", + "w = 12.\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "a1 = math.pi*(d1/12)**2/4\n", + "a2 = math.pi*(d2/12)**2/4\n", + "h1 = h*(sm-1)/w\n", + "Q = round(C*(a1*a2/(math.sqrt(a1**2-a2**2)))*math.sqrt(2*g)*math.sqrt(h1)*6.24*60*60,-2)\n", + "\n", + "#RESULTS\n", + "print 'Discharge = %.f gph '%(Q)\n", + "\n", + "# answer is different because of rounding error. Please calculate manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 113900 gph \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.6 page no : 52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "d1 = 8. \t\t\t#in\n", + "d2 = 4. \t\t\t#in\n", + "h = 10. \t\t\t#in of mercury\n", + "Cd = 0.98\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "sm = 13.56\n", + "#CALCULATIONS\n", + "a1 = math.pi*(d1/12)**2/4\n", + "a2 = math.pi*(d2/12)**2/4\n", + "h1 = h*(sm-1)/12\n", + "Q = a1*a2*math.sqrt(2*g)*math.sqrt(h1)/math.sqrt(a1**2-a2**2)\n", + "Qactual = Cd*Q\n", + "#RESULTS\n", + "print 'Actual discharge = %.2f cusecs '%(Qactual)\n", + "\n", + "# Note : Answer is slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Actual discharge = 2.29 cusecs \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.7 page no : 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "h = 6.8 \t\t\t#in of mercury\n", + "sm = 13.6\n", + "ssw = 1.026\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "V = math.sqrt(2*g*h*(sm-ssw)/12)*3600/5280\n", + "#RESULTS\n", + "print 'speed of submarine = %.1f miles per hour '%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "speed of submarine = 14.6 miles per hour \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.8 page no : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "d1 = 2. \t\t\t#in\n", + "d2 = 12. \t\t\t#in\n", + "r = 1.4\n", + "n = 0.905\n", + "Q = 2995. \t\t\t#lb/ft**2\n", + "w = 0.083 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "V1 = round(1/w,2)\n", + "n1 = round(n**((r-1)/r),2)\n", + "n2 = n**(2/r)\n", + "Q = math.pi*(d1/12)**2*math.sqrt(2*g*Q*(1-n1)*r/((r-1)*n2*(1-(d1/d2)**2)))\n", + "\n", + "#RESULTS\n", + "print 'Volume of air passing through the Venturimeter = %.1f cuses '%(Q)\n", + "\n", + "# note : answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volume of air passing through the Venturimeter = 13.5 cuses \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/Chapter_3.ipynb b/Hydraulics_by_J._Lal/Chapter_3.ipynb new file mode 100755 index 00000000..6b36939a --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_3.ipynb @@ -0,0 +1,705 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:97f449fad397b42ecb1501f787392dc6e0950fafed8997a70fb14e2a9c19a198" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Flow Through Orifices Mouthpieces Nozzles" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.1 page no : 70" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Q = 16. \t\t\t#gpm\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "d = 1. \t\t\t#in\n", + "h = 2+(5./12) \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "x = 11.5 \t\t\t#ft\n", + "h1 = 1.2 \t\t\t#in\n", + "#CALCULATIONS\n", + "Cd = Q*10/(60*w*(math.pi*(d/12)**2/4)*math.sqrt(2*g*h))\n", + "Cv = math.sqrt(x**2/(4*(h1/12)*h*12**2))\n", + "Cc = Cd/Cv\n", + "Cr = (1-Cv**2)/Cv**2\n", + "#RESULTS\n", + "print 'Cc = %.3f '%(Cc)\n", + "print 'Cv = %.3f '%(Cv)\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Cr = %.3f '%(Cr)\n", + "\n", + "# note : answers are slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cc = 0.644 \n", + "Cv = 0.975 \n", + "Cd = 0.628 \n", + "Cr = 0.053 \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.2 page no : 71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Ww = 261. \t\t\t#lb/min\n", + "a = 1. \t\t\t#in**2\n", + "h = 4. \t\t\t#ft\n", + "y = 5. \t\t\t#ft\n", + "W1 = 10.65 \t\t\t#lb\n", + "l = 1. \t\t\t#ft\n", + "Q = 261. \t\t\t#lb/min\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "v = Q*144./(w*60)\n", + "F = W1*l/y\n", + "v = F*g*60./Q\n", + "vth = math.sqrt(2*g*h)\n", + "Cv = v/vth\n", + "Q1 = Ww/w\n", + "Qth = vth*60./144\n", + "Cd = Q1/Qth\n", + "Cc = Cd/Cv\n", + "#RESULTS\n", + "print 'Cv = %.3f '%(Cv)\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Cc = %.3f '%(Cc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv = 0.982 \n", + "Cd = 0.625 \n", + "Cc = 0.637 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.3 page no : 74" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Q = 10. \t\t\t#ft**3/sec\n", + "a1 = 1. \t\t\t#ft**2\n", + "a2 = 4. \t\t\t#ft**2\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "p1 = 12. \t\t\t#lb/in**2\n", + "v1 = 10. \t\t\t#ft/sec\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#RESULTS\n", + "v2 = v1*a1/a2\n", + "Hl = (v1-v2)**2/(2*g)\n", + "p2 = ((p1*144/w)+(v1**2/(2*g))-(v2**2/(2*g))-Hl)*(w/144)\n", + "W = Hl*v1*w/550.\n", + "\n", + "#RESULTS\n", + "print 'Head lost = %.3f ft of water '%(Hl)\n", + "print 'Pressure in larger part of pipe = %.2f lb/in**2 '%(p2)\n", + "print 'Work done = %.3f HP '%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Head lost = 0.873 ft of water \n", + "Pressure in larger part of pipe = 12.25 lb/in**2 \n", + "Work done = 0.991 HP \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.4 page no : 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Cc = 1.\n", + "Cv = 0.833\n", + "d = 2. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "H = 12. \t\t\t#ft\n", + "Pa = 34. \t\t\t#lb/in**2\n", + "#/CALCULATIONS\n", + "Q = Cc*Cv*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n", + "Cd = Cc*Cv\n", + "Pc = Pa-0.92*H\n", + "#RESULTS\n", + "#RESULTS\n", + "print 'Discharge = %.3f cu ft/sec '%(Q)\n", + "print 'Coefficient of discharge = %.3f '%(Cd)\n", + "print 'Pressure at Vent-contraction = %.2f ft of water '%(Pc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 0.505 cu ft/sec \n", + "Coefficient of discharge = 0.833 \n", + "Pressure at Vent-contraction = 22.96 ft of water \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.5 page no : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "H = 4. \t\t\t#ft\n", + "d = 1. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cc = 0.5\n", + "#CALCULATIONS\n", + "Q = Cc*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n", + "#RESULTS\n", + "print 'Actual Discharge = %.4f cu ft/sec '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Actual Discharge = 0.0438 cu ft/sec \n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 page no : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "\n", + "D = 4. \t\t\t#ft\n", + "d = 2. \t\t\t#in\n", + "H1 = 6. \t\t\t#ft\n", + "H2 = 2. \t\t\t#ft\n", + "t = 4. \t\t\t#min\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "H = 5. \t\t\t#ft\n", + "#CALCULATIONS\n", + "Cd = (2.*(math.pi/4.)*D**2*(math.sqrt(H1)-math.sqrt(H2)))/(t*60*(math.pi/4)*(d/12)**2*math.sqrt(2*g))\n", + "Q = Cd*(math.pi/4)*(d/12)**2*math.sqrt(2*g*H)*w*60/10\n", + "#RESULTS\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Discharge = %.1f gpm'%(Q)\n", + "\n", + "# note : answers are slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cd = 0.619 \n", + "Discharge = 90.8 gpm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.7 page no : 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "H1 = 10. \t\t\t#ft\n", + "H2 = 2. \t\t\t#ft\n", + "Cd = 0.61\n", + "d1 = 8. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "d2 = 3. \t\t\t#ft\n", + "#CALCULATIONS\n", + "a = d2**2./144\n", + "H0 = H1*d2/(d1-d2)\n", + "t = math.pi*(d1/2)**2*((2/5.)*(H1**(5./2)-H2**(5./2))+2*H0**2*(math.sqrt(H1)- \\\n", + "math.sqrt(H2))+(4./3)*H0*(H1**(3./2)-H2**(3./2)))/(60*Cd*a*math.sqrt(2*g)*(H1+H0)**2)\n", + "\n", + "#RESULTS\n", + "print 'time required to lower the water level = %.2f min'%(t)\n", + "\n", + "# Note : answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to lower the water level = 5.14 min\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.8 page no : 85" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "D = 10. \t\t\t#ft\n", + "H1 = 17. \t\t\t#ft\n", + "H2 = 5. \t\t\t#ft\n", + "d = 3. \t\t\t#in\n", + "Cd = 0.62\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "t1 = (2*math.pi*D**2/4)*(math.sqrt(H1)-math.sqrt(H2))/(Cd*math.sqrt(2*g)*math.pi*(d/12)**2/4)\n", + "t2 = math.pi*(14./15)*H2**(5./2)*4/(Cd*math.pi*(d/12.)**2*math.sqrt(2*g))\n", + "t = t1+t2\n", + "#RESULTS\n", + "print 'time required to empty the vessel = %.f sec'%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to empty the vessel = 1885 sec\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.9 page no : 86" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Cd = 0.8\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "d = 3. \t\t\t#in\n", + "#CALCULATIONS\n", + "t = (60*2/(math.pi*(d/12)**2*math.sqrt(2*g)/4*Cd))*(6-d)**(3./2)/(3*60./2)\n", + "#RESULTS\n", + "print 'time to emptify biler = %.2f min'%(t)\n", + "\n", + "# note : answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time to emptify biler = 21.98 min\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.10 page no : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "A = 100 * 27 # sq ft\n", + "dif = 8 - 3. # ft\n", + "a = 2. # sq ft\n", + "Cd = 0.8 # Co-efficient\n", + "\n", + "#CALCULATIONS\n", + "t1 = round(A*((a/3 * 22.7) - a/3 * 5.19 - (a/3*11.2))/(Cd*2*8.02*dif))\n", + "t2 = round(A*(2./3)*11.2/(Cd*a*8.02*dif))\n", + "t = t1 + t2\n", + "\n", + "#RESULTS\n", + "print 'Total time to empty the tank = %d sec'%t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total time to empty the tank = 491 sec\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.11 page no : 89" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "H1 = 9. \t\t\t#ft\n", + "H2 = 4. \t\t\t#ft\n", + "Cd = 0.6\n", + "a = 4. \t\t\t#in**2\n", + "A1 = 72. \t\t\t#ft**2\n", + "A2 = 24. \t\t\t#ft**2\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "t = (2*A1*A2/(A1+A2))*(math.sqrt(H1)-math.sqrt(H2))*144/(Cd*60*a*math.sqrt(2*g))\n", + "#RESULTS\n", + "print 'time required to reduce the water level difference = %.1f min'%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to reduce the water level difference = 4.5 min\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.12 pageno : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "l = 80. \t\t\t#ft\n", + "w = 12. \t\t\t#ft\n", + "t = 3. \t\t\t#min\n", + "Hl = 12. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.6\n", + "#CALCULATIONS\n", + "s = math.sqrt(2*l*w*Hl**(1./2)/(Cd*math.sqrt(2*g)*t*60.))\n", + "#RESULTS\n", + "print 'side of the square orifice = %.2f ft'%(s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "side of the square orifice = 2.77 ft\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.13 page no : 92" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.6\n", + "d = 2. \t\t\t#in\n", + "H1 = 5. \t\t\t#ft\n", + "\n", + "#CALCULATIONS\n", + "K = round(Cd * math.pi/4 * (d/12)**2 * math.sqrt(g*2),3)\n", + "t = d*math.pi*(0.5*math.log(1.89) - 0.235)/K**2 \n", + "v = round(math.sqrt(2*g*H1)/2.)\n", + "q = v*Cd*math.pi*(d/12)**2./4\n", + "\n", + "#RESULTS\n", + "print \"Time required to raise the level is : %.2f sec\"%t\n", + "print 'Total discharge = %.3f cfs'%(q)\n", + "\n", + "# Note : answers may vary because of rounding error. Please calculate manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required to raise the level is : 47.47 sec\n", + "Total discharge = 0.118 cfs\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.14 page no : 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "H = 9. \t\t\t#in\n", + "l = 3. \t\t\t#ft\n", + "g = 32.2 \t\t\t#t/sec**2\n", + "#CALCULATIONS\n", + "Q1 = Cd*(H*l/12)*math.sqrt(2*g*3*H/24.)\n", + "Q2 = Cd*2*l*math.sqrt(2*g)*((H/6)**(3./2)-(H/12)**(3./2))/3\n", + "#RESULTS\n", + "print 'Discharge by appropriate formula = %.2f cfs'%(Q1)\n", + "print ' Discharge by exact formula = %.2f cfs'%(Q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge by appropriate formula = 11.87 cfs\n", + " Discharge by exact formula = 11.82 cfs\n" + ] + } + ], + "prompt_number": 54 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.15 pageno : 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "\n", + "Cd = 0.62\n", + "B = 2.5 \t\t\t#ft\n", + "H2 = 8. \t\t\t#ft\n", + "H1 = 7. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h = 4. \t\t\t#ft\n", + "#CALCULATIONS\n", + "Q1 = round(2*Cd*B*math.sqrt(2*g)*(H2**(3./2)-H1**(3./2))/3)\n", + "Q2 = Cd*math.sqrt(2*g)*math.sqrt(H2)*B*(h-1)\n", + "Q = Q1+Q2\n", + "#RESULTS\n", + "print 'Total discharge = %d cfs'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total discharge = 139 cfs\n" + ] + } + ], + "prompt_number": 60 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/Chapter_4.ipynb b/Hydraulics_by_J._Lal/Chapter_4.ipynb new file mode 100755 index 00000000..60ede3c8 --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_4.ipynb @@ -0,0 +1,772 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7c51eb85c2f5974253c21c1966c99eb7233e433431ba178d1ba6aaccb3adc83a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : Flow Over Weirs Notches" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.1 page no : 103" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "#initialisation of variables\n", + "p = 70. \t\t\t#per cent\n", + "Cd = 0.6\n", + "Q = 50. \t\t\t#million gallons\n", + "H = 2. \t\t\t#ft\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "Q1 = p*Q*10**6*10/(100*w*24*3600)\n", + "L = Q1*3/(2*Cd*math.sqrt(2*g)*H**1.5)\n", + "#RESULTS\n", + "print 'length of the weir = %.2f ft '%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "length of the weir = 7.15 ft \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.2 page no : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "L = 15. \t\t\t#ft\n", + "H = 1. \t\t\t#ft\n", + "Cd = 0.6\n", + "v = 80. \t\t\t#ft/min\n", + "g = 32.2 \t\t\t#ft/sec62\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "vo = v/60\n", + "Q = 2*Cd*math.sqrt(2*g)*L*((1+(vo**2/(2*g)))**1.5-(vo**2/(2*g))**1.5)*w*100/(3*550)\n", + "#RESULTS\n", + "print 'HP = %.f HP '%(Q)\n", + "\n", + "# This is accurate answer. Please calcualte manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "HP = 567 HP \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.3 pageno : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 11. \t\t\t#ft\n", + "H = 0.7 \t\t\t#ft\n", + "Cd = 0.6\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h = 1.95 \t\t\t#ft\n", + "Q = 20.65 \t\t\t#cuses\n", + "Q1 = 21.2 \t\t\t#cfs\n", + "\n", + "#CALCULATIONS\n", + "Q = 2*Cd*math.sqrt(2*g)*L*H**1.5/3\n", + "vo = Q/(h*L)\n", + "h1 = vo**2/(2*g)\n", + "Q1 = 2*Cd*math.sqrt(2*g)*L*((H+(vo**2/(2*g)))**1.5-(vo**2/(2*g))**1.5)/3\n", + "v1 = Q1/(L*h)\n", + "Q2 = 2*Cd*math.sqrt(2*g)*L*((H+(v1**2/(2*g)))**1.5-(v1**2/(2*g))**1.5)/3\n", + "p = (Q2-Q1)*100/Q1\n", + "\n", + "#RESULTS\n", + "print \"Head to velocity approach = %.1f cu ft/sec\"%Q1\n", + "print \"Q2 = %.2f cu ft/sec\"%Q2\n", + "print 'discharge percent = %.3f per cent '%(p)\n", + "\n", + "# Note : answers may vary because of rounding error. Please calculate manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Head to velocity approach = 21.3 cu ft/sec\n", + "Q2 = 21.29 cu ft/sec\n", + "discharge percent = 0.148 per cent \n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.4 page no : 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "b = 3. \t\t\t#ft\n", + "H = 1 \t\t\t#ft\n", + "Q = 9 \t\t\t#cfs\n", + "Q1 = 1.105 # log Q from fig.\n", + "h = 0.1 \t\t# log H from fig. ft\n", + "#CALCULATIONS\n", + "K = Q/b\n", + "n = (Q1-math.log10(3*K))/h\n", + "#RESULTS\n", + "print 'K = %.f '%(K)\n", + "print 'n = %.1f '%(n)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "K = 3 \n", + "n = 1.5 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.5 page no : 108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.62\n", + "L = 7.573 \t\t\t#ft\n", + "H = 1.2 \t\t\t#ft\n", + "S = 2.85 \t\t\t#ft\n", + "#CALCULATIONS\n", + "Q1 = 2*Cd*math.sqrt(2*g)*L*H**1.5/3\n", + "Q2 = 3.33*L*H**1.5\n", + "Q3 = math.sqrt(2*g)*L*H**1.5*(0.405+(0.00984/H))\n", + "He = H+0.004\n", + "Q4 = (3.227+0.435*(He/S))*L*He**1.5\n", + "#RESULTS\n", + "print 'Q = %.2f cuses '%(Q1)\n", + "print 'Q = %.2f cuses '%(Q2)\n", + "print 'Q = %.2f cuses '%(Q3)\n", + "print 'Q = %.2f cuses '%(Q4)\n", + "\n", + "# Note : answers may vari because of rounding error. Please check manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Q = 33.02 cuses \n", + "Q = 33.15 cuses \n", + "Q = 33.01 cuses \n", + "Q = 34.12 cuses \n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.6 pageno : 109" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "H = 2.5 \t\t\t#ft\n", + "L = 10 \t\t\t#ft\n", + "A = 10 \t\t\t#miles\n", + "p = 30 \t\t\t#per cent\n", + "a = 2 \t\t\t#in/hr\n", + "w = 2 \t\t\t#ft\n", + "#CALCULATIONS\n", + "Q = L*1760**2*3**2*a*p/(60*60*12*100)\n", + "n = ((Q/(3.33*H**1.5))-(L-0.1*w*H))/(L-0.1*w*H)\n", + "#RESULTS\n", + "print 'n = %.f '%(n)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "n = 30 \n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.7 page no : 109" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 2.5 \t\t\t#ft\n", + "H = 1 \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.61\n", + "L1 = 1.75 \t\t\t#ft\n", + "L2 = 2.25 \t\t\t#ft\n", + "#CALCULATIONS\n", + "Q1 = 2*Cd*math.sqrt(2*g)*L*H/3\n", + "Q2 = 2*Cd*math.sqrt(2*g)*L1*(L1**1.5-1)/3\n", + "Q3 = 2*Cd*math.sqrt(2*g)*H*(L2**1.5-L1**1.5)/3\n", + "Q = Q1+Q2+Q3\n", + "#RESULTS\n", + "print 'Total discharge = %.1f cfs '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total discharge = 19.1 cfs \n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.8 page no : 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h1 = 16.63 \t\t\t#cm\n", + "h2 = 10.18 \t\t\t#cm\n", + "h3 = 16.53 \t\t\t#cm\n", + "#CALCULATIONS\n", + "H1 = h1-h2\n", + "H2 = h3-h2\n", + "p = (H1**1.5-H2**1.5)*100/H1**1.5\n", + "#RESULTS\n", + "print 'Percent decrease in discharge = %.2f %% '%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percent decrease in discharge = 2.32 % \n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.9 pageno : 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "Cd = 0.6\n", + "a = 20000 \t\t\t#yd**2\n", + "H2 = 12 \t\t\t#in\n", + "L = 5 \t\t\t#ft\n", + "H1 = 2 \t\t\t#ft\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "t = 2*a*9*(L-H1)*((1/math.sqrt(H2/12))-(1/math.sqrt(H1)))/(2*60*Cd*math.sqrt(2*g)*L)\n", + "#RESULTS\n", + "print 'time required to lower level of reservoir = %.2f min '%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to lower level of reservoir = 109.49 min \n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.10 pageno : 113" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 3. \t\t\t#ft\n", + "H = 6. \t\t\t#in\n", + "Cd = 0.62\n", + "Cd1 = 0.59\n", + "a = 45. \t\t\t#degrees\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "H = ((2./3)*Cd*math.sqrt(2*g)*L*(H/12)**1.5/((8./15)*Cd1*math.sqrt(2*g)))**0.4\n", + "#RESULTS\n", + "print 'depth of water = %.3f ft '%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of water = 1.142 ft \n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.11 page no : 114" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "V = 20. \t\t\t#litres\n", + "g = 981. \t\t\t#cm/sec**2\n", + "Cd = 0.593\n", + "r = 2.5\n", + "r1 = 1.5\n", + "e = 2. \t\t\t#mm\n", + "Cd1 = 0.623\n", + "L = 30. \t\t\t#cm\n", + "#CALCULATIONS\n", + "H = (V*1000*15/(8*Cd*math.sqrt(2*g)))**0.4\n", + "dH1 = e/10.\n", + "p = r*dH1*100/H\n", + "H1 = (V*3*1000/(2*Cd1*math.sqrt(2*g)*L))**(2./3)\n", + "p1 = r1*dH1*100/H1\n", + "#RESULTS\n", + "print 'percentage error of discharge over the weir = %.2f %% '%(p)\n", + "print 'percentage error of discharge over the weir = %.2f %% '%(p1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "percentage error of discharge over the weir = 2.74 % \n", + "percentage error of discharge over the weir = 2.74 % \n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.12 page no : 116" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 16. \t\t\t#in\n", + "H = 9. \t\t\t#in\n", + "h = 18. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 2. \t\t\t#ft\n", + "Cd = 0.63\n", + "W = 62.4 \t\t\t#lbs/ft**3\n", + "#CALCULATIONS\n", + "Q = 2*Cd*math.sqrt(2*g)*(L/12)*(H/12)**1.5/3\n", + "v = Q/(w*(h/12))\n", + "H1 = v**2/(2*g)\n", + "Q1 = 2*Cd*math.sqrt(2*g)*(L/12)*(((H/12)+H1)**1.5-H1**1.5)*W*6/3.\n", + "#RESULTS\n", + "print 'Discharge = %.f gpm '%(Q1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 1122 gpm \n" + ] + } + ], + "prompt_number": 37 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.13 pageno : 118" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 100 \t\t\t#ft\n", + "H = 2.25 \t\t\t#ft\n", + "Cd = 0.95\n", + "w = 120 \t\t\t#ft\n", + "h = 2 \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "Q = round(3.087*Cd*L*H**1.5)\n", + "v0 = round(Q/(w*(h+H)),2)\n", + "Q1 = 3.087*Cd*L*((H+(v0**2/(2*g)))**1.5-(v0**2/(2*g))**1.5)\n", + "#RESULTS\n", + "print 'Discharge = %.0f cuses '%(Q1)\n", + "\n", + "# Note: answer is slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 1024 cuses \n" + ] + } + ], + "prompt_number": 48 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.14 pageno : 119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "L = 6 \t\t\t#ft\n", + "H1 = 0.5 \t\t\t#ft\n", + "H2 = 0.25 \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd1 = 0.58\n", + "Cd2 = 0.8\n", + "w = 6.24 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "Q1 = 2*Cd1*math.sqrt(2*g)*L*(H1-H2)**1.5/3\n", + "Q2 = Cd2*L*H2*math.sqrt(2*g*(H1-H2))\n", + "Q = round((Q1+Q2)*w*3600,-3)\n", + "#RESULTS\n", + "print 'Discharge = %.f gph '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 160000 gph \n" + ] + } + ], + "prompt_number": 51 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.15 pageno : 120" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "W = 100 \t\t\t#ft\n", + "h = 10 \t\t\t#ft\n", + "v = 4 \t\t\t#ft/sec\n", + "h1 = 3 \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "H = 5.4 \t\t\t#ft\n", + "Cd1 = 0.58\n", + "Cd2 = 0.8\n", + "#CALCULATIONS\n", + "v0 = (W*h*v)/(W*(h+h1))\n", + "h0 =v0**2/(2*g)\n", + "H2 = (W*h*v-(2*Cd1*W*math.sqrt(2*g)*((h1+h0)**1.5-h0**1.5)/3))/(Cd2*W*math.sqrt(2*g*(h1+h0)))\n", + "dh = h-H2\n", + "#RESULTS\n", + "print 'height of anicut which is drowned = %.f ft '%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of anicut which is drowned = 8 ft \n" + ] + } + ], + "prompt_number": 52 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.16 page no : 123" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "x = 6. \t\t\t#in\n", + "l = 200. \t\t\t#ft\n", + "d = 10. \t\t\t#ft\n", + "v = 4. \t\t\t#ft/sec\n", + "Ce = 0.95\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "l1 = math.sqrt(l**2/(Ce**2*(((x/12)*2*g/v**2)+(d**2/(d+(x/12))**2))))\n", + "#RESULTS\n", + "print 'length = %.f ft '%(l1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "length = 123 ft \n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 4.17 page no : 124" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "H = 25. \t\t\t#ft\n", + "l = 2.5 \t\t\t#ft\n", + "b = 5. \t\t\t#ft\n", + "Cd = 0.64\n", + "Q = 3200. \t\t\t#cuses\n", + "L =150. \t\t\t#ft\n", + "C =3.2\n", + "depth =0.5 \t\t\t#ft\n", + "A1 =5000000. \t\t\t#sq yards\n", + "#CALCULATIONS\n", + "Q1 = Cd*l*b*math.sqrt(2*g*H)\n", + "n = Q/Q1\n", + "h = (Q/(3.2*L))**(2./3)\n", + "hr =h-depth\n", + "Area =A1*9\n", + "V = round(Area*hr,-6)\n", + "#RESULTS\n", + "print 'number of spilways = %.f '%(n)\n", + "print \"Volume of extra water stored = %d cu ft\"%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "number of spilways = 10 \n", + "Volume of extra water stored = 137000000 cu ft\n" + ] + } + ], + "prompt_number": 57 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/Chapter_5.ipynb b/Hydraulics_by_J._Lal/Chapter_5.ipynb new file mode 100755 index 00000000..a400585d --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_5.ipynb @@ -0,0 +1,1200 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:fe74dcaff3035e39890b266fafcf015d3afee121cbb7baf09e89820b75888c5a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : Flow Through Pipes" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.1 pageno : 131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "import numpy \n", + "#initialisation of variables\n", + "h = 4. \t\t\t#ft\n", + "h1 = 3. \t\t\t#ft\n", + "r = 3. \t\t\t#ft\n", + "h2 = 1.5 \t\t\t#ft\n", + "#CALCULATIONS\n", + "m = (h*h1+(h1**2/2))/(h+(h/2)*math.sqrt(h1**2+(h1/2)**2))\n", + "a = 2*numpy.degrees(numpy.arccos(h2/r))\n", + "P = 2*math.pi*r*a/360.\n", + "A = r**2*((2*math.pi/3.)-math.sin(math.radians(a)))/2.\n", + "H = A/(2*math.pi)\n", + "#RESULTS\n", + "print 'Hydraulic mean depth m = %.2f ft'%m\n", + "print 'hydraulic mean depth = %.2f ft '%(H)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Hydraulic mean depth m = 1.54 ft\n", + "hydraulic mean depth = 0.88 ft \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.2 pageno : 133" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d = 3. \t\t\t#ft\n", + "l = 5280. \t\t\t#ft\n", + "v = 3. \t\t\t#ft/sec\n", + "f = 0.005\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "C = 115.\n", + "#CALCULATIONS\n", + "hf = 4*f*l*v**2/(2*g*v)\n", + "m = d/4\n", + "hf1 = (v/C)**2*4*l/3\n", + "#RESULTS\n", + "print 'hf = %.2f ft '%(hf)\n", + "print 'hf = %.1f ft '%(hf1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hf = 4.92 ft \n", + "hf = 4.8 ft \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.3 page no : 134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 6. \t\t\t#in\n", + "Q = 2. \t\t\t#cfs\n", + "l = 1000. \t\t\t#ft\n", + "f = 0.0055\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h = 70. \t\t\t#ft\n", + "#CALCULATIONS\n", + "v = Q/(math.pi*(d/12)**2/4)\n", + "hf = 4*f*l*w*(Q/(math.pi*(d/12)**2/4))**2/((d/12)*2*144*g)\n", + "ft_water = round(hf*144/w + 70)\n", + "P = ft_water*w/144\n", + "\n", + "#RESULTS\n", + "print 'pressure = %.1f lb/in**2 '%(hf)\n", + "print 'presure difference = %.0f lb/in**2 '%(P)\n", + "\n", + "# Answers are slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure = 30.7 lb/in**2 \n", + "presure difference = 61 lb/in**2 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.4 pageno : 135" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 6. \t\t\t#in\n", + "hf = 7.7 \t\t\t#ft\n", + "f = 0.005\n", + "l = 1000. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "C = math.sqrt(2*g/f)\n", + "Q = math.pi*C*(d/12)**2.5*(hf/1000)**0.5 /8\n", + "#RESULTS\n", + "print 'Discharge = %.2f cfs '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 0.69 cfs \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.5 page no : 136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "Q = 400000.\n", + "d = 4. \t\t\t#miles\n", + "h = 50. \t\t\t#ft\n", + "q = 40. \t\t\t#gallons of water\n", + "t = 8. \t\t\t#hr\n", + "f = 0.0075\n", + "w = 6.24 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "Q1 = round(Q*q*0.5/(t*60*60*w),1)\n", + "d = (4*f*(d*5280)*Q1**2*16/(math.pi**2*h*2*g))**0.2*12\n", + "\n", + "#RESULTS\n", + "print 'size of the supply = %.3f in '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "size of the supply = 43.579 in \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.6 pageno : 138" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Q = 0.7 \t\t\t#cfs\n", + "d = 6. \t\t\t#in\n", + "v1 = 1.084*10**-5 \t\t\t#ft**2/sec\n", + "v2 = 0.394*10**-5 \t\t\t#ft**2/sec\n", + "R = 2320.\n", + "#CALCULATIONS\n", + "Re = (4*Q)/(math.pi*.5*v2)\n", + "v3 = R*v1/(d/12.)\n", + "v4 =R*v2/(d/12.) \n", + "v = Q*4/(math.pi*(d/12.)**2)\n", + "\n", + "#RESULTS\n", + "print 'Re at 80 C %.0f'%Re\n", + "print 'crititcal velocity = %.4f ft/sec '%(v4)\n", + "print 'actual velocity = %.2f ft/sec '%(v)\n", + "\n", + "# Note : answer is correct. Please calculate it manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Re at 80 C 452420\n", + "crititcal velocity = 0.0183 ft/sec \n", + "actual velocity = 3.57 ft/sec \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.7 pageno : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "p = 0.91 \t\t\t#units\n", + "u = 0.21 \t\t\t#poise\n", + "q = 200. \t\t\t#gallons\n", + "h = 40. \t\t\t#ft\n", + "l = 200. \t\t\t#ft\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "d = 3./4 \t\t\t#in\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "v = u/(p*(30.5)**2)\n", + "Q = q*10/(w*3600*p)\n", + "V = Q/(math.pi*(d/12)**2/4)\n", + "Re = V*(d/12)/v\n", + "F = 64/Re\n", + "Hf = F*l*V**2/(2*g*(d/12))\n", + "Ht = Hf+h\n", + "P = w*p*Ht/144\n", + "#RESULTS\n", + "print 'Pressure head = %.1f lb/sq in '%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure head = 31.6 lb/sq in \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.8 page no : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import log10\n", + "#initialisation of variables\n", + "h = 1.5 # H\n", + "v = 2. # V\n", + "\n", + "#CALCULATIONS\n", + "logh = round(log10(h),4)\n", + "logk = -0.415 # from fig.\n", + "logv = round(log10(v),4)\n", + "n = (logh-logk)/logv\n", + "\n", + "#RESULTS\n", + "print 'n = %.3f '%(n)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "n = 1.964 \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.10 page no : 146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "pb = 20. \t\t\t#lb/in**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "Q = 1.96 \t\t\t#cfs\n", + "d1 = 0.5 \t\t\t#ft\n", + "d2 = 1. \t\t\t#ft\n", + "f = 0.005\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "l1 = 300. \t\t\t#ft\n", + "H = 14.015 \t\t\t#ft of water\n", + "#CALCULATIONS\n", + "v1 = Q/(math.pi*d1**2/4.)\n", + "v2 = Q/(math.pi*d2**2./4.)\n", + "hf1 = 4*f*l1*v1**2./(2.*g*d1)\n", + "hf2 = 4*f*l1*v2**2/(2*g*d2)\n", + "h = (v1-v2)**2/(2*g)\n", + "h1 = v1**2/(2*g)\n", + "h2 = v2**2/(2*g)\n", + "P = H*w/144\n", + "#RESULTS\n", + "print 'Loss of head at C = %.2f ft '%(h1)\n", + "print 'Loss of head at C = %.3f ft '%(h2)\n", + "print 'Pressure differnece at discharge end = %.2f lb/in**2 '%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss of head at C = 1.55 ft \n", + "Loss of head at C = 0.097 ft \n", + "Pressure differnece at discharge end = 6.07 lb/in**2 \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.11 page no : 148" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 8. \t\t\t#in\n", + "l = 6000. \t\t\t#ft\n", + "H = 100. \t\t\t#ft\n", + "H1 = 1000. \t\t\t#ft\n", + "f = 0.008\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h1 = 24. \t\t\t#ft\n", + "h2 = 34. \t\t\t#ft \n", + "h3 = 25. \t\t\t#ft\n", + "w = 6.24 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "v = math.sqrt(H*d*2*g/(4*f*l*12))\n", + "h = -h1+(v**2/(2*g))+h3+(4*f*H1*v**2/(2*g*(d/12)))\n", + "Q = round(math.pi*(d/12)**2*v*3600*w/4,-2)\n", + "#RESULTS\n", + "print 'minimum depth = %.f ft '%(h)\n", + "print 'Discharge = %.f gpm'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "minimum depth = 18 ft \n", + "Discharge = 37100 gpm\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.12 page no : 151" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "h = 25. \t\t\t#ft\n", + "l = 2000. \t\t\t#ft\n", + "d = 12. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "f = 0.005\n", + "dz = 16. \t\t\t#ft\n", + "zb = 25. \t\t\t#ft\n", + "zc = -16. \t\t\t#ft\n", + "#CALCULATIONS\n", + "v = math.sqrt(2*g*h/(1.5+(4*f*l/(d/12))))\n", + "Q = math.pi*(d/12)**2*v/4\n", + "l1 = (34-dz)*l/(zb-zc-dz)\n", + "#RESULTS\n", + "print 'Discharge = %.1f cfs '%(Q)\n", + "print 'length of the inlet = %.f ft of water '%(l1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 4.9 cfs \n", + "length of the inlet = 1440 ft of water \n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.13 page no : 153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "d1 = 2 \t\t\t#in\n", + "l1 = 25 \t\t\t#ft\n", + "d2 = 4 \t\t\t#in\n", + "l2 = 140 \t\t\t#ft\n", + "v = 4 \t\t\t#ft/sec\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "f = 0.0065\n", + "#CALCULATIONS\n", + "v1 = v*(d2/d1)**2\n", + "H = (0.5*v1**2/(2*g))+(4*f*l1*12*v1**2/(d1*2*g))+((v1-v)**2/(2*g))+(4*f*l2*12*v**2/(d2*2*g))+(v**2/(2*g))\n", + "#RESULTS\n", + "print 'necessaey height of water = %.3f ft '%(H)\n", + "\n", + "# Note : answer is slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "necessaey height of water = 22.688 ft \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.14 page no : 155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "l1 = 3000. \t\t\t#ft\n", + "d1 = 18. \t\t\t#in\n", + "l2 = 1500. \t\t\t#ft\n", + "d2 = 15. \t\t\t#ft\n", + "l3 = 1000. \t\t\t#ft\n", + "d3 = 12. \t\t\t#in\n", + "#CALCULATIONS\n", + "d = ((l1+l2+l3)/((l1/d1**5)+(l2/d2**5)+(l3/d3**5)))**(1./5)\n", + "#RESULTS\n", + "print 'Diameter = %.2f in '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 14.86 in \n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.15 page no : 156" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "D = 9. \t\t\t#in\n", + "#CALCULATIONS\n", + "d = D/(2**0.4)\n", + "#RESULTS\n", + "print 'diameter of paralle mains = %.2f in '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter of paralle mains = 6.82 in \n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.16 page no : 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 2. \t\t\t#ft\n", + "l = 5280. \t\t\t#ft\n", + "f = 0.01\n", + "H = 100. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCLATIONS\n", + "v = math.sqrt(H*2*d*g/(4*f*l))\n", + "Q = math.pi*d**2*v/4.\n", + "r = d\n", + "v2 = math.sqrt(H/((r**2+1)*(4*f*l/(2*2*2*g))))\n", + "Q1 = 2*math.pi*d**2*v2/4.\n", + "dQ = Q1-Q\n", + "p = dQ*100./Q\n", + "#RESULTS\n", + "print 'percentage increase in discharge = %.1f %% '%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "percentage increase in discharge = 26.5 % \n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.17 Page no : 160" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " import math\n", + "\n", + "# Variables\n", + "d1 = 2 # ft\n", + "d2 = 1.5 # ft\n", + "d3 = 1 # ft\n", + "l1 = 2000 # ft\n", + "l2 = 3000 # ft\n", + "l3 = 1500 # ft\n", + "za = 100 # ft\n", + "zb = 70 # ft\n", + "zc = 50 # ft\n", + "zd = 80 # ft\n", + "f = 0.007 # ft\n", + "v3 = 7.93\n", + "\n", + "# Calculations\n", + "\n", + "v1 = round(math.sqrt(111-1.412*(v3**2)),1)\n", + "v2 = round(math.sqrt(-23.4+.745*(v3**2)),2)\n", + "pd_w = round((za - zd) - ( 29 * v1**2/64.4),2)\n", + "Q1 = (math.pi/4)*d1**2*v1\n", + "Q2 = (math.pi/4)*d2**2*v2\n", + "Q3 = Q1 - Q2\n", + "\n", + "# Results\n", + "print \"V1 = %.1f ft/sec\"%v1\n", + "print \"V2 = %.2f ft/sec\"%v2\n", + "print \"V3 = %.2f ft/sec\"%v3\n", + "print \"Pressure at the junction point : %.2f ft of water\"%pd_w\n", + "print \"Discharge in section : %.2f cfs\"%Q3\n", + "\n", + "# Note : Answers may vary because of rounding error. Please check it manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "V1 = 4.7 ft/sec\n", + "V2 = 4.84 ft/sec\n", + "V3 = 7.93 ft/sec\n", + "Pressure at the junction point : 10.05 ft of water\n", + "Discharge in section : 6.21 cfs\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.18 page no : 164" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "A = 10000. \t\t\t#ft**2\n", + "H1 = 50. \t\t\t#ft\n", + "H2 = 40. \t\t\t#ft\n", + "l = 1500. \t\t\t#ft\n", + "d = 6. \t\t\t#in\n", + "f = 0.0075\n", + "g = 32.2 \t\t\t#f/sec**2\n", + "#CALCULATIONS\n", + "t = 2.*A*math.sqrt((1.5+(4*f*l/(d/12)))/(2*g))*(math.sqrt(H1)-math.sqrt(H2))/(math.pi*(d/12)**2/4)\n", + "#RESULTS\n", + "print 'Time taken to lower the level of water = %.f hours '%(t/3600)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken to lower the level of water = 25 hours \n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.19 page no : 164" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "l = 24. \t\t\t#ft\n", + "b = 12. \t\t\t#ft\n", + "f = 0.006\n", + "d = 4. \t\t\t#in\n", + "l1 = 25. \t\t\t#ft\n", + "H1 = 6. \t\t\t#ft\n", + "H = 20. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.6\n", + "#CALCULATIONS\n", + "a = math.pi*(d/12)**2/4\n", + "A = l*b\n", + "H2 = H1+H\n", + "t = round(2*A*math.sqrt((1.5+(4*f*l1/(d/12)))/(2*g))*(math.sqrt(H2)-math.sqrt(H))/a,-1)\n", + "t1 = 2*A*math.sqrt((1.5+(4*f*l1/(d/12)))/(2*g))*math.sqrt(H1)/a\n", + "t2 = 2*A*math.sqrt(H1)/(Cd*a*math.sqrt(2*g))\n", + "#RESULTS\n", + "print 'Time taken to lower the pipe = %.f sec '%(t)\n", + "print 'Time taken to lower the pipe = %.f sec '%(t1)\n", + "print 'Time taken to lower the pipe = %.f sec '%(t2)\n", + "\n", + "# note : answers may vary becasue of ronding error. " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken to lower the pipe = 940 sec \n", + "Time taken to lower the pipe = 3660 sec \n", + "Time taken to lower the pipe = 3358 sec \n" + ] + } + ], + "prompt_number": 49 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.20 page no : 165\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 2 \t\t\t#ft\n", + "l = 1000 \t\t\t#ft\n", + "f = 0.0075\n", + "H1 = 20 \t\t\t#ft\n", + "A1 = 100000 \t\t\t#ft**2\n", + "A2 = 50000 \t\t\t#ft**2\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "h = 2*A1/A2\n", + "H2 = H1-h\n", + "t = 2*A1*A2*math.sqrt(1.5+(4*f*l/2))*0.47/((A1+A2)*(math.pi*d**2/4)*math.sqrt(2*g))/60\n", + "#RESULTS\n", + "print 'Time taken to lower the level of water = %.f min '%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time taken to lower the level of water = 84 min \n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.21 page no : 167" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "H = 1000. \t\t\t#lb/in**2\n", + "Hf = 100. \t\t\t#lb/in**2\n", + "l = 10. \t\t\t#miles\n", + "HP = 100.\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 64.4 \t\t\t#lb/ft**3\n", + "f = 0.006\n", + "#CALCULATIONS\n", + "n = (H-Hf)*100/H\n", + "v = Hf*550/((math.pi/4)*n*10*144)\n", + "r = Hf*144*2*g/(w*4*f*l*5280)\n", + "d = (v**2/r)**(1./5)\n", + "#RESULTS\n", + "print 'Diameter = %.4f ft '%(d)\n", + "\n", + "# answer may vary because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 0.4808 ft \n" + ] + } + ], + "prompt_number": 52 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.22 page no : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "h1 = 1640. \t\t\t#ft\n", + "h2 = 40. \t\t\t#ft\n", + "d = 8. \t\t\t#in\n", + "l = 2. \t\t\t#miles\n", + "D = 3. \t\t\t#ft\n", + "f = 0.006\n", + "Cv = 0.98\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "r = (d/12)/D\n", + "vact = Cv*math.sqrt(2*g*(h1-h2)/(1+(4*f*l*5280*r**4/D)))\n", + "HP = round(round(w*vact**3*(math.pi*(d/12)**2/4)/(550*2*g),-2),-3)\n", + "#RESULTS\n", + "print 'Horse Power of Jet = %.f HP '%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horse Power of Jet = 15000 HP \n" + ] + } + ], + "prompt_number": 58 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.23 page no : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "p = 60. \t\t\t#lb/in**2\n", + "l = 300. \t\t\t#ft\n", + "D = 2.5 \t\t\t#in\n", + "d = 7./8 \t\t\t#in\n", + "f = 0.018\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "r = (D/d)**4\n", + "V = math.sqrt(2*g*144*p/(w*(r+0.5+(4*f*l/(D/12)))))\n", + "Q = V*(math.pi*(D/12)**2)/4\n", + "#RESULTS\n", + "print 'Volume of flow = %.3f cu ft/sec '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volume of flow = 0.246 cu ft/sec \n" + ] + } + ], + "prompt_number": 59 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.24 page no : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "D = 3. \t\t\t#in\n", + "l = 800. \t\t\t#ft\n", + "H = 120. \t\t\t#ft\n", + "f = 0.01\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "d = ((D/12)**5/(8*f*l))**0.25\n", + "hf = H/3\n", + "dh = H-hf\n", + "v = math.sqrt(hf*(D/12)*2*g/(4*f*l))\n", + "HPmax = w*math.pi*((D/48)**2/4)*v*dh/550\n", + "#RESULTS\n", + "print 'HPmax = %.3f HP '%(HPmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "HPmax = 0.125 HP \n" + ] + } + ], + "prompt_number": 60 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.25 page no : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "l = 2. \t\t\t#miles\n", + "Q = 2.*10**6 \t\t\t#gal/day\n", + "d = 12. \t\t\t#in\n", + "t = 16. \t\t\t#sec\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIO\n", + "Q1 =Q*10/(w*24*60*60)\n", + "hi = l*5280*Q1/((math.pi*(d/12)**2./4)*(g*t))\n", + "#RESULTS\n", + "print 'height = %.1f ft '%(hi)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height = 96.8 ft \n" + ] + } + ], + "prompt_number": 61 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.26 pageno : 178" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 6. \t\t\t#in\n", + "Q = 0.7854 \t\t\t#cfs\n", + "E = 30*10**6 \t\t\t#lb/in**2\n", + "t = 0.25 \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "K = 300000. \t\t\t#lb/in**2\n", + "#CALCULATIONS\n", + "v = Q/(math.pi*(d/12)**2/4)\n", + "p = v/(math.sqrt(144*(g/w)*((1/K)+(d/(t*E)))))\n", + "#RESULTS\n", + "print 'rise of presure in the pipe = %.f lb/in**2 '%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rise of presure in the pipe = 228 lb/in**2 \n" + ] + } + ], + "prompt_number": 62 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 5.27 page no : 183" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "f = 0.005\n", + "Q = 100. \t\t\t#cuses\n", + "m = 40. \t\t\t#Rs\n", + "n = 0.75\n", + "n1 = 0.065\n", + "K = 15. \t\t\t#Rs\n", + "#CALCULATIONS\n", + "d = ((5*w/(1.5*550*10))*n*f*Q**3*m/(K*n1))**(1/6.5)\n", + "#RESULTS\n", + "print 'economical diameter of pipe line = %.3f ft '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "economical diameter of pipe line = 3.795 ft \n" + ] + } + ], + "prompt_number": 63 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/Chapter_6.ipynb b/Hydraulics_by_J._Lal/Chapter_6.ipynb new file mode 100755 index 00000000..2ab32b0e --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_6.ipynb @@ -0,0 +1,926 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a578101ccbcde1509a97d02129920a3db28366bac3115a1e48214601165df384" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Flow Through Open Channels" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.1 page no : 196" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "i = 0.000146\n", + "v = 2.8 \t\t\t#ft/sec\n", + "m = 7. \t\t\t#ft\n", + "#CALCULAIONS\n", + "C = v/math.sqrt(m*i)\n", + "K = (157.6-C)*math.sqrt(m)/C\n", + "#RESULTS\n", + "print 'C = %.3f '%(C)\n", + "print 'K = %.3f '%(K)\n", + "\n", + "# answers may vary because of rounding error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 87.586 \n", + "K = 2.115 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.2 pageno : 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "b = 10. \t\t\t#ft\n", + "n = 1.\n", + "i = 1./1000\n", + "d = 1.5 \t\t\t#ft\n", + "C = 110.\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "L = math.sqrt(2*d**2)\n", + "P = b+2*L\n", + "A = d*(b+n*d)\n", + "m = A/P\n", + "v = round(C*math.sqrt(m*i),2)\n", + "A_v = round(A*v)\n", + "Q = A_v*w*60*60*24/10\n", + "#RESULTS\n", + "print 'Discharge = %.2e gal/day '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 3.56e+07 gal/day \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.3 page no : 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "b = 10. \t\t\t#ft\n", + "n = 2.\n", + "d = 3.5 \t\t\t#ft\n", + "i = 1./625\n", + "#CALCULATIONS\n", + "A = d*(b+(d/n))\n", + "L = math.sqrt(d**2+(d/2)**2)\n", + "P = b+2*L\n", + "m = A/P\n", + "v = 1.486*m**(2./3)*i**0.5/0.03\n", + "Q = A*v\n", + "#RESULTS\n", + "print 'Discharge = %.1f cuses '%(Q)\n", + "\n", + "# Note : answer may vary because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 142.3 cuses \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.4 pageno : 198" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 3. \t\t\t#ft\n", + "i = 1./4500\n", + "C = 80.\n", + "#CALCULATIONS\n", + "A = 0.5*(math.pi*d**2/4)\n", + "P = math.pi*d/2\n", + "m = A/P\n", + "v = C*math.sqrt(m*i)\n", + "Q = v*A\n", + "#RESULTS\n", + "print 'Discharge = %.2f cuses '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 3.65 cuses \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.5 page no : 198\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "A = 2500. \t\t\t#acres\n", + "n = 20.\n", + "Q = 40. \t\t\t#gal/head\n", + "C = 130.\n", + "i = 1./3000\n", + "p = 7. \t\t\t#per cent\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#CALCULATIONS\n", + "Q1 = Q*50000*p/(60*100*60*w)\n", + "Q2 = Q1+(A*4840*9/(12*24*60*60))\n", + "d = (Q2*8*math.sqrt(4/i)/(math.pi*C))**0.4\n", + "#RESULTS\n", + "print 'Diameter = %.3f ft '%(d)\n", + "\n", + "# answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter = 8.754 ft \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.6 page no : 199" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Qt = 150000. \t\t\t#cuses\n", + "i = 1/10000.\n", + "n1 = 1.\n", + "n2 = 2./3\n", + "d1 = 30. \t\t\t#ft\n", + "C1 = 100.\n", + "C2 = 75.\n", + "b1 = 600. \t\t\t#ft\n", + "b2 = 2000. \t\t\t#ft\n", + "r = 2.\n", + "A1 = (b1+d1)*d1\n", + "P1 = b1+(2*d1*math.sqrt(2))\n", + "m1 = A1/P1\n", + "v1 = C1*math.sqrt(m1*i)\n", + "Q1 = A1*v1\n", + "Q2 = Qt-Q1\n", + "v2 = v1/2\n", + "A2 = Q2/v2\n", + "d2 = (-b2+math.sqrt(b2**2+4*1.5*A2))/(2*1.5)\n", + "#RESULTS\n", + "print 'depth of water = %.f ft '%(d2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "depth of water = 10 ft \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.7 page no : 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 3. \t\t\t#ft\n", + "i = 1./1000\n", + "C = 65.\n", + "Cd = 0.56\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h1 = 7.5 \t\t\t#ft\n", + "h2 = 3. \t\t\t#ft\n", + "#CALCULATIONS\n", + "m = d\n", + "v = C*math.sqrt(m*i)\n", + "Q = v*d\n", + "H = (Q*d/(2*math.sqrt(2*g)*Cd))**(2./3)\n", + "h = h1+h2-H\n", + "#RESULTS\n", + "print 'Height of dam = %.2f ft '%(h)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Height of dam = 8.17 ft \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.8 page no : 207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "Q =100.\t\t\t#cuses\n", + "v = 2. \t\t\t#/ft/sec\n", + "n = 1.5\n", + "A = 50. \t\t\t#ft**2\n", + "C = 120.\n", + "#CALCULATIONS\n", + "d = math.sqrt((Q/v)/(2*math.sqrt(n**2+1)-n))\n", + "m = A/d\n", + "h1 = m-n*d\n", + "h2 = m+n*d\n", + "i = (v/C)**2*(2/d)\n", + "#RSULTS\n", + "print 'Depth = %.2f ft '%(d)\n", + "print ' Bottom width = %.2f ft '%(h1)\n", + "print ' Top width = %.2f ft '%(h2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth = 4.87 ft \n", + " Bottom width = 2.95 ft \n", + " Top width = 17.57 ft \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.9 page no : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "Q = 1100. \t\t\t#cuses\n", + "i = 1/1800.\n", + "C = 95.\n", + "n = 1.5\n", + "#CALCULATIONS\n", + "d = ((Q*math.sqrt(3600)/C)/(n+0.6))**0.4\n", + "b = 0.6*d\n", + "ht = b+2*(n*d)\n", + "#RESULTS\n", + "print 'Depth = %.1f ft '%(d)\n", + "print ' Bottom width = %.2f ft '%(b)\n", + "print ' Top width = %.1f ft '%(ht)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth = 10.2 ft \n", + " Bottom width = 6.11 ft \n", + " Top width = 36.7 ft \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.10 pageno : 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "\n", + "n = 1.5\n", + "Q = 800. \t\t\t#cuses\n", + "i = 2.5/5280\n", + "n1 = 9.24\n", + "r = 0.6\n", + "k = 1.49\n", + "#CALCULATIONS\n", + "d = (k*10**7*4/n1)**(1/8.)\n", + "#RESULTS\n", + "print 'Depth of channel = %.1f ft '%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth of channel = 7.1 ft \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.11 page no : 210" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "d = 8. \t\t\t#ft\n", + "i = 1./1200\n", + "C = 90.\n", + "a = 308. \t\t\t#degrees\n", + "#CALCULATIONS\n", + "h = 0.95*d\n", + "A = (d/2)**2*(a*(math.pi/180)-math.sin(math.radians(a)))/2\n", + "m = 0.29*d\n", + "Q = A*C*math.sqrt(m*i)\n", + "#RESULTS\n", + "print 'Discharge = %.f cuses '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 195 cuses \n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.12 page no : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "v = 5. \t\t\t#ft/sec\n", + "Q = 500. \t\t\t#cuses\n", + "w = 25. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "h = (Q/v)/w\n", + "E = h+(v**2/(2*g))\n", + "he = round((400*2/64.4)**(1./3),2)\n", + "ve = round(20./2.32,2)\n", + "Emin = he + (ve**2 / (g*2))\n", + "\n", + "#RESULTS\n", + "print 'Specific energy = %.2f ft '%(E)\n", + "print \"Critical Velocity of flow = %.2f ft/sec\"%ve\n", + "print 'Minimum energy Emin = %.2f ft'%Emin" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific energy = 4.39 ft \n", + "Critical Velocity of flow = 8.62 ft/sec\n", + "Minimum energy Emin = 3.47 ft\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.13 page no : 216" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "\n", + "i = 1./5000\n", + "C = 100.\n", + "b = 50. \t\t\t#ft\n", + "h = 10. \t\t\t#ft\n", + "Q = 1000. \t\t\t#cuses\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "f = 2.*g/C**2\n", + "m = (b*h)/(b+2*h)\n", + "v = Q/(b*h)\n", + "r = (i-(f*4/(2*g*m)))/(1-(2**2/(g*h)))\n", + "s = i-r\n", + "#RESULTS\n", + "print 'Slope = %.6f '%(s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Slope = 0.000054 \n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.14 page no : 221" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#Initialization of variables\n", + "B =48. \t\t\t#ft\n", + "D =5. \t\t\t#ft\n", + "f =0.005\n", + "i =1./1000\n", + "g =32.2\n", + "#calculations\n", + "C =math.sqrt(2*g/f)\n", + "m =B*D/(B+2*D)\n", + "V =C*math.sqrt(m*i)\n", + "Q =B*D*V\n", + "Dc =(Q**2 /(g*B**2))**(1./3)\n", + "d1 =2.25 \t\t\t#ft\n", + "Q1 =1*D*V\n", + "d2 =-d1/2 + math.sqrt(2*Q1**2 /(g*d1) + d1**2 /4)\n", + "hd =d2-d1\n", + "#results\n", + "print \"height required = %.1f ft\"%(hd)\n", + "#The answer is a bit different due to rounding off error in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height required = 2.8 ft\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.15 page no : 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "Q = 360. \t\t\t#cfs\n", + "d1 = 1. \t\t\t#ft\n", + "B = 18. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w1 = 624. \t\t\t#lb/ft**3\n", + "d2 =4.5 \t\t\t#ft\n", + "#CALCULATIONS\n", + "w = Q/B\n", + "v1 = w/d1\n", + "v2 = v1/d2\n", + "d2 = -0.5+math.sqrt((2*v1**2*d1/(g))+(d1**2./4))\n", + "El = (d1+(w**2/(2*g)))-(d2+(v2**2/(2*g)))\n", + "EL = round(w1*Q*El,-4)\n", + "#RESULTS\n", + "print 'loss in energy = %.f lb '%(EL)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "loss in energy = 540000 lb \n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.16 page no : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "d1 = 4. \t\t\t#ft\n", + "v1 = 60. \t\t\t#ft/sec\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALULATIONS\n", + "d2 = d1*(math.sqrt(1+8*v1**2/(g*d1))-1)/2.\n", + "#RESULTS\n", + "print 'd2 = %.f ft '%(d2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "d2 = 28 ft \n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.17 page no : 224" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "b = 150. \t\t\t#ft\n", + "d = 12. \t\t\t#ft\n", + "N = 0.03\n", + "i = 1./10000\n", + "h = 10. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "A = b*d\n", + "P = b+2*d\n", + "m = A/P\n", + "v = m**(2/3.)*1.49*i**0.5/N\n", + "A1 = b*(h+d)\n", + "P1 = b+2*(h+d)\n", + "m1 = A1/P1\n", + "C1 = 1.49*m1**(1./6)/N\n", + "v1 = A*v/A1\n", + "s = (i-(v1**2/(C1**2*m1)))/(1-(v1**2/(g*(h+d))))\n", + "L = round(2*h/s,-3)\n", + "#RESULTS\n", + "print 'Length of back water = %.f ft '%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Length of back water = 236000 ft \n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.18 page no : 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "b1 = 3.2 \t\t\t#ft\n", + "b2 = 1.3 \t\t\t#ft\n", + "h1 = 1.86 \t\t\t#ft\n", + "h2 = 1.63 \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "a1 = b1*h1\n", + "a2 = b2*h2\n", + "Q = a1*a2*math.sqrt(2*g)*math.sqrt(h1-h2)/(math.sqrt(a1**2-a2**2))\n", + "#RESULTS\n", + "print 'Discharge = %.1f cuses '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 8.7 cuses \n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.19 page no : 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "b1 = 4. \t\t\t#ft\n", + "b2 = 2. \t\t\t#ft\n", + "h1 = 2. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "Qmax = 3.09*b2*h1**1.5\n", + "v1 = Qmax/(b1*h1)\n", + "H = h1+(v1**2/(2*g))\n", + "Qmax2 = 3.09*b2*H**1.5\n", + "h2 = 2*H/3\n", + "#RESULTS\n", + "print 'Qmax = %.2f cfs '%(Qmax2)\n", + "print 'h2 = %.3f ft '%(h2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Qmax = 18.46 cfs \n", + "h2 = 1.383 ft \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 6.20 pageno : 229" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "h1 = 8. \t\t\t#ft\n", + "b1 = 32. \t\t\t#ft\n", + "h = 1. \t\t\t#ft\n", + "b2 = 24. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "\n", + "#CALCULATIONS\n", + "H = h1-h\n", + "h = 9.65\n", + "Q = 3.09*H**1.5*b2\n", + "v1 = Q/(b1*h1)\n", + "Q1 = 3.09*(H+(v1**2/(2*g)))**1.5*b2\n", + "hc = (Q1**2/(g*b2**2))**(1./3)\n", + "d2 = -(hc/2)+math.sqrt(9*hc**2/2)\n", + "\n", + "#RESULTS\n", + "print 'Q = %.f cfs '%(Q1)\n", + "print 'hc = %.2f ft '%(hc)\n", + "print 'max depth = %.2f ft '%(d2)\n", + "print 'Maximum depth of water downstream %.2f ft'%(d2+1)\n", + "print 'h = %.2f ft'%h\n", + "\n", + "# answers may vary because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Q = 1507 cfs \n", + "hc = 4.97 ft \n", + "max depth = 8.05 ft \n", + "Maximum depth of water downstream 9.05 ft\n", + "h = 9.65 ft\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/README.txt b/Hydraulics_by_J._Lal/README.txt new file mode 100755 index 00000000..0c52211b --- /dev/null +++ b/Hydraulics_by_J._Lal/README.txt @@ -0,0 +1,10 @@ +Contributed By: Raviraj Jadeja +Course: mca +College/Institute/Organization: Freelancing work +Department/Designation: Freelancer +Book Title: Hydraulics +Author: J. Lal +Publisher: Metropolitan Book Co. Pvt. Ltd. +Year of publication: 1959 +Isbn: 9788120004221 +Edition: 2
\ No newline at end of file diff --git a/Hydraulics_by_J._Lal/screenshots/pic11.png b/Hydraulics_by_J._Lal/screenshots/pic11.png Binary files differnew file mode 100755 index 00000000..234881bb --- /dev/null +++ b/Hydraulics_by_J._Lal/screenshots/pic11.png diff --git a/Hydraulics_by_J._Lal/screenshots/pic22.png b/Hydraulics_by_J._Lal/screenshots/pic22.png Binary files differnew file mode 100755 index 00000000..0107e587 --- /dev/null +++ b/Hydraulics_by_J._Lal/screenshots/pic22.png diff --git a/Hydraulics_by_J._Lal/screenshots/pic33.png b/Hydraulics_by_J._Lal/screenshots/pic33.png Binary files differnew file mode 100755 index 00000000..fe6ba2b2 --- /dev/null +++ b/Hydraulics_by_J._Lal/screenshots/pic33.png |