diff options
Diffstat (limited to 'Hydraulics_Made_Easy_by_R._S._Dighe/ch6.ipynb')
-rwxr-xr-x | Hydraulics_Made_Easy_by_R._S._Dighe/ch6.ipynb | 1557 |
1 files changed, 1557 insertions, 0 deletions
diff --git a/Hydraulics_Made_Easy_by_R._S._Dighe/ch6.ipynb b/Hydraulics_Made_Easy_by_R._S._Dighe/ch6.ipynb new file mode 100755 index 00000000..8e440d36 --- /dev/null +++ b/Hydraulics_Made_Easy_by_R._S._Dighe/ch6.ipynb @@ -0,0 +1,1557 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ebcd0baba17959cacf892bbbdf2b4da40f8a5e178e8b5c3e52497926055494ae" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 : Flow of Water Through Pipes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 Page No : 168" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "R = 0.5 \t\t#lbs sq ft\n", + "v = 10. \t\t#ft/sec\n", + "A = 1. \t\t# sq ft\n", + "A1 = 15000. \t\t#sq ft\n", + "V = 20. \t\t#m.p.h\n", + "\t\t\n", + "#CALCULATIONS\n", + "k = R/v**2\n", + "R = k*A1*(V*44./30)**2\n", + "HP = R*88/(550*3)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Horse power = %.f HP'%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horse power = 3442 HP\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 Page No : 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "k = 0.01\n", + "d = 6. \t\t#in\n", + "l = 1000. \t\t#ft\n", + "v = 8. \t \t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "f = k*(1+(1/d))\n", + "hf = 4*f*l*v**2*12/(2*g*d)\n", + "C = math.sqrt(2*g/f)\n", + "hf1 = v**2*4*(12/d)*l/C**2\n", + "\n", + "#RESULTS\n", + "print 'head lost in friction = %.2f ft of water'%(hf)\n", + "print ' head lost in friction = %.2f ft of water'%(hf1)\n", + "\n", + "# rounding off error. value of f taken as 0.116 and here answer goes to 0.117 ." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "head lost in friction = 92.75 ft of water\n", + " head lost in friction = 92.75 ft of water\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "d1 = 3. \t\t#in\n", + "d2 = 6. \t\t#in\n", + "v = 6. \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v1 = v*(d1/d2)**2\n", + "L = (v-v1)**2/(2*g)\n", + "\t\t\n", + "#RESULTSa\n", + "print 'Loss due to sudden enlargment = %.4f '%(L)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss due to sudden enlargment = 0.3144 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 4. \t\t#in\n", + "d2 = 3. \t\t#in\n", + "Q = 90. \t\t#gallons\n", + "k = 0.7\n", + "v = 6.24 \t\t#ft/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "V = round(Q/(60*6.24),3)\n", + "v1 = V*4*d2**2/math.pi\n", + "v2 = round(V*4*d1**2/math.pi,1)\n", + "L = ((1/k)-1)**2*v2**2*900/(2*g)\n", + "\n", + "\n", + "#RESULTS\n", + "print 'Loss hc = %.f ft lbs per minute'%(L)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss hc = 62 ft lbs per minute\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 Page No : 178" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d1 = 3. \t\t#in\n", + "d2 = 6. \t\t#in\n", + "sm = 13.6\n", + "Q = 0.5 \t\t#ft**3/sec\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "v1 = Q*(12/d1)**2*4/math.pi\n", + "v2 = Q*(12/d2)**2*4/math.pi\n", + "hc = (v1-v2)**2/(2*g)\n", + "h = ((v1**2-v2**2)/(2*g))-hc\n", + "h1 = 12*h/(sm-1)\n", + "\t\t\n", + "#RESULTS\n", + "print 'difference in level in two limbs of mercury = %.3f in'%(h1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "difference in level in two limbs of mercury = 0.575 in\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 Page No : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 60. \t\t#ft\n", + "d = 6. \t\t#in\n", + "g = 32.2 \t\t#ft/sec\n", + "v = 10. \t\t#ft/sec\n", + "d1 = 3. \t\t#in\n", + "l1 = 20. \t\t#ft\n", + "k = 0.62\n", + "\t\t\n", + "#CALCULATIONS\n", + "H = round(4*f*l*v**2/(2*g*(d/12)**2),1)\n", + "v2 = v*d1**2/d**2\n", + "hf = round(4*f*l1*v**2/(2*g*(d/12)**2),2)\n", + "h = (v-v2)**2/(2*g)\n", + "h1 = round(4*f*l1*v2**2/(2*g*2*(d/12)**2),3)\n", + "h2 = round(v**2*4*f*l1/(2*g*(d/12)**2),2)\n", + "h3 = ((1/k)-1)**2*v**2/(2*g)\n", + "dh = (H-hf-h-h1-h2-h3)\n", + "\n", + "#RESULTS\n", + "print 'Saving in head = %.2f ft'%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Saving in head = 3.35 ft\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7 Page No : 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "d = 3. \t\t#in\n", + "h = 50. \t\t#ft\n", + "w = 6.24 \t\t#lb/ft**3\n", + "r = 0.5\n", + "r1 = 16.\n", + "r2 = 9./16\n", + "r3 = 0.25\n", + "r4 = 40.5/256\n", + "r5 = 972./256\n", + "r6 = 81./256\n", + "\t\t\n", + "#CALCULATIONS\n", + "v =math.sqrt(h*2*g/(r+r1+r2+r3+r4+r5+r6))\n", + "Q = math.pi*(d/12)**2*v*60*w/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'discharge in the pipeline = %.1f gal.min'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "discharge in the pipeline = 224.5 gal.min\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8 Page No : 186" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "l = 6000. \t\t#ft\n", + "d = 9. \t\t#in\n", + "s = 1./100\n", + "h = 20. \t\t#ft\n", + "h1 = 5. \t\t#ft\n", + "f = 0.006\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "L = l*s\n", + "v = math.sqrt((h+L-h1)*(d/12)*2*g/(4*f*l))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "s1 = (L+h-h1)/l\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.2f cusecs'%(Q/10)\n", + "print ' slope of hydraulic gradient = %.4f '%(s1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.22 cusecs\n", + " slope of hydraulic gradient = 0.0125 \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9 Page No : 187" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + " \n", + "#initialisation of variables\n", + "d1 = 24. \t\t#in\n", + "Q = 10. \t\t#cuses\n", + "d2 = 18. \t\t#in\n", + "d3 = 12. \t\t#in\n", + "f = 0.01\n", + "l = 1000. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l1 = 100. \t\t#ft\n", + "l2 = 600. \t\t#ft\n", + " \n", + "#CALCULATIONS\n", + "v1 = math.sqrt(4*Q/(math.pi*(d1/12)**2))\n", + "v2 = math.sqrt(4*Q/(math.pi*(d2/12)**2))\n", + "v3 = math.sqrt(4*Q/(math.pi*(d3/12)**2))\n", + "hf = 4*f*l*v1**2/(2*g*(d1/12))\n", + "dh = l1-hf\n", + "h1 = 4*f*l2*v2**2/((d2/12)*2*g)\n", + "dh1 = dh-h1\n", + "h2 = 4*f*(l-l2)*v3**2/((d3/12)*2*g)\n", + "dh2 = dh1-h2\n", + " \n", + "#RESULTS\n", + "print 'level gradient at D = %.2f ft'%(dh2)\n", + "\n", + " #ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "level gradient at D = 94.44 ft\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10 Page No : 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "k = 0.01\n", + "l = 24. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 15.6 \t\t#lbs/in**2\n", + "W = 62.4 \t\t#lbs/ft**3\n", + "h = 12. \t\t#ft\n", + "l1 = 100. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "f = k*(1+(1/(h/l)))\n", + "C = math.sqrt(2*g/f)\n", + "L = w*144/(W)\n", + "i = h/l1\n", + "v = C*math.sqrt(k*h/(4*l))\n", + "Q = v*60*math.pi*(1/l)**2/4\n", + "v1 = math.sqrt(h*2*g*(1/l)/(4*f*3*l1))\n", + "Q1 = v1*60*math.pi*(1/l)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge quantity of water = %.3f cubic ft/mt'%(Q1)\n", + "\n", + "\n", + "\t\t#ANSWER GIVEN IN THE TETBOOK IS WRONG\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge quantity of water = 0.077 cubic ft/mt\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.11 Page No : 189" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "p = 15.6 \t\t#lbs/in**2\n", + "la = 250. \t\t#ft\n", + "lb = 200. \t\t#ft\n", + "lc = 120. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "p1 = 93.6 \t\t#lbs/in**2\n", + "l2 = 600. \t\t#ft\n", + "l3 = 100. \t\t#ft\n", + "l4 = 300. \t\t#ft\n", + "ph = 95. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "H1 = ((p*144)/w)+la\n", + "H2 = ((p1*144)/w)+(la/2)\n", + "s = (H2-H1)/(l4+l2+l3)\n", + "h1 = l3*s\n", + "h2 = l2*s\n", + "h3 = l4*s\n", + "H = h1+h2+h3\n", + "P = ph*w/144\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure head for 95ft = %.2f lbs/in**2'%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure head for 95ft = 41.17 lbs/in**2\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.12 Page No : 191" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "Q = 30. \t\t#gallons/head\n", + "C = 78.\n", + "n = 100000.\n", + "d = 3. \t\t#miles\n", + "l = 40. \t\t#ft\n", + "\n", + "#CALCULAIONS\n", + "st = Q*n\n", + "Q1 = st/(6.24*2*8*60**2)\n", + "i = l/(d*5280)\n", + "d = (4*Q1*math.sqrt(4/i)/(math.pi*C))**(2./5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'size of pipe = %.2f ft'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "size of pipe = 1.97 ft\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.13 Page No : 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 2000. \t\t#ft\n", + "d = 6. \t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "Q = 10. \t\t#cuses\n", + "\n", + "#CALUCLATIONS\n", + "v = math.sqrt(2*g*(d/12)*Q/(4*f*l))\n", + "Q1 = v*math.pi*(d/12)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.3f cuses'%(Q1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.394 cuses\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.14 Page No : 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "h = 10. \t\t#ft\n", + "l = 50. \t\t#ft\n", + "d = 1. \t\t#in\n", + "lm = 5. \t\t#in\n", + "f = 0.01\n", + "sm = 13.6\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "ps = sm*lm/12\n", + "v = math.sqrt((ps+h)*2*g*(d/12)/(4*f*l))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Discharge through the pipe = %.3f cuses'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge through the pipe = 0.035 cuses\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.15 Page No : 195" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import solve, Symbol\n", + "\n", + "#initialisation of variables\n", + "r = 34.\n", + "r1 = 4.\n", + "H = 25. \t\t#ft\n", + "x = 18.\n", + "l = 2000. \t\t#ft\n", + "g = 32.2\n", + "v = Symbol(\"v\")\n", + "\t\t\n", + "#CALCULATIONS\n", + "l1 = (r-r1-x)*l/H\n", + "print 'l1 = %.f ft'%(l1)\n", + "\n", + "ans = solve(v**2/(2*g) * ( 1.5 + r1*0.0075*l/1) - H)\n", + "v = round(ans[1],2)\n", + "l1 = Symbol(\"l1\")\n", + "ans = solve(r1 + v**2/(2*g) + x + 0.5*v**2/(2*g) + r1*0.0075*l1/1 * v**2/(2*g) - r)\n", + "l1 = ans[0]\n", + "\n", + "#RESULTS\n", + "print \"v = %.2f ft/sec\"%v\n", + "print \"l1 = %.f ft\"%l1\n", + "\n", + "# note : rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "l1 = 960 ft\n", + "v = 5.12 ft/sec" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "l1 = 933 ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.16 Page No : 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "l = 1000. \t\t#ft\n", + "dh = 40. \t\t#ft\n", + "d = 6. \t\t#in\n", + "h = 15. \t\t#ft\n", + "h1 = 300. \t\t#ft\n", + "f = 0.002\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = math.sqrt(dh*2*g/(1.5+(4*f*l/(d/12))))\n", + "Q = v*math.pi*(d/12)**2/4\n", + "r = -(h+(v**2/(2*g))*(1.5+(4*f*h1/(d/12))))\n", + "Pre = 34 + r\t\t\n", + "#RESULTS\n", + "print 'Pressure at vertex = %.1f ft'%(r) \n", + "print \"The pressure head at C will be = %.1f ft. of water absolute.\"%Pre" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure at vertex = -29.4 ft\n", + "The pressure head at C will be = 4.6 ft. of water absolute.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.17 Page No : 198" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.008\n", + "l = 2000. \t\t#ft\n", + "p1 = 34. \t\t#ft\n", + "p2 = 8. \t\t#ft\n", + "p3 = 4. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "d = 18. \t\t#in\n", + "P = 140. \t\t#ft\n", + "l1 = 9500. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "v = math.sqrt((p1-p2-p3)*2*g/((d/12)+(4*f*l/(d/12))))\n", + "Q = math.pi*(d/12)**2*v/4\n", + "v1 = math.sqrt(P*2*g/((d/12)+(4*f*l1/(d/12))))\n", + "Q1 = math.pi*(d/12)**2*v1/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharge = %.f cuses'%(Q) \n", + "print ' Quantity discharge = %.2f cuses'%(Q1) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharge = 10 cuses\n", + " Quantity discharge = 11.74 cuses\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.18 page no : 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import Symbol,solve\n", + "\n", + "# variables\n", + "v = Symbol('v') # ft/sec\n", + "p = Symbol('p') # lbs/in**2\n", + "g = 32.2\n", + "f = 0.0075 # friction\n", + "l = 30. # lenght pipe\n", + "\n", + "# calculations\n", + "ans = solve( v**2/(2*g) *( 0.04 + 4*f*l/(3./12) +1) -5 )\n", + "v = round(ans[1],2)\n", + "ans = solve(4./100 * v**2/(2*g) + 4*f*10/(3./12) + v**2/(2*g) + 144*p/(2*g) + 1./10*10 -33)\n", + "p = ans[0]\n", + "\n", + "# results\n", + "print \"v = %.2f ft./sec\"%v\n", + "print \"p = %.2f lbs./in**2\"%p\n", + "\n", + "# rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "v = 8.33 ft./sec\n", + "p = 13.27 lbs./in**2\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.19 Page No : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "L = 20000. \t\t#ft\n", + "l1 = 6000. \t\t#ft\n", + "d1 = 12. \t\t#in\n", + "l2 = 10000. \t\t#ft\n", + "d2 = 9. \t\t#in\n", + "d3 = 6. \t\t#in\n", + "l3 = 4000. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "D = (L/((l1/(d1/12)**5)+(l2/(d2/12)**5)+(l3/(d3/12)**5)))**(1./5)\n", + "\t\t\n", + "#RESULTS\n", + "print 'Diameter of uniform pipe = %.2f ft'%(D) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diameter of uniform pipe = 0.65 ft\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.20 Page No : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "L = 4700. \t\t#ft\n", + "l1 = 2500. \t\t#ft\n", + "d1 = 15. \t\t#in\n", + "l2 = 1200. \t\t#ft\n", + "d2 = 12. \t\t#in\n", + "d3 = 9. \t\t#in\n", + "l3 = 1000. \t\t#ft\n", + "H = 100. \t\t#ft\n", + "f = 0.01\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "D = (L/((l1/(d1/12)**5)+(l2/(d2/12)**5)+(l3/(d3/12)**5)))**(1./5)\n", + "v = math.sqrt(2*g*D*H/(4*f*L))\n", + "Q = v*math.pi*D**2/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharged = %.2f cusecs'%(Q) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharged = 3.99 cusecs\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.21 Page No : 204" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "v1 = 6.2 \t\t#ft/sec\n", + "a = 43.52 \t\t#ft**2/sec**2\n", + "a1 = 105.6 \t\t#ft**2/sec**2\n", + "r = 0.468\n", + "r1 = 0.87\n", + "d = 5. \t\t#in\n", + "d1 = 6. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "v2 = math.sqrt(a-r*v1**2)\n", + "v3 = math.sqrt(a1-r1*v1**2)\n", + "Q1 = math.pi*(d1/12)**2*60*v2/4\n", + "Q2 = math.pi*(d/12)**2*60*v3/4\n", + "\t\t\n", + "#RESULTS\n", + "print 'Quantity discharged = %.2f cuses'%(Q1) \n", + "print ' Quantity discharged = %.2f cuses'%(Q2) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quantity discharged = 59.53 cuses\n", + " Quantity discharged = 69.50 cuses\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.22 Page No : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\n", + "#initialisation of variables\n", + "w = 62.4 \t\t#lb/ft**3\n", + "za = 150. \t\t#ft\n", + "zd = 80. \t\t#ft\n", + "g = 32.2 \t\t#ft/sec**2\n", + "w = 62.4 \t\t#lb/ft**3\n", + "v1 = 5.25 \t\t#ft/sec\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = (w/144)*(za-zd-145*v1**2/(2*g))\n", + "\t\t\n", + "#RESULTS\n", + "print 'pressure = %.3f lbs/in**2'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "pressure = 3.441 lbs/in**2\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.23 Page No : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 200. \t\t#ft\n", + "f = 0.01\n", + "L = 8100. \t\t#ft\n", + "d = 3. \t\t#in\n", + "d1 = 1. \t\t#in\n", + "\t\t\n", + "#CALCULATIONS\n", + "vn = math.sqrt(2*g*H/(1+(4*f*L*(1/d)**4/(d/12))))\n", + "h = vn**2/(2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.2f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 11.76 ft\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.24 Page No : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 1./4 \t\t#in\n", + "d1 = 1.\t\t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 50. \t\t#ft\n", + "f = 0.1\n", + "L = 100. \t\t#ft\n", + "l = 775. \t\t#ft\n", + "\n", + "#CALCULLATIONS\n", + "vn = math.sqrt(2*g*l*H*0.01/(1+(4*f*L*(d/d1)**2/(d1/12))))\n", + "h = vn**2/(2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.2f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 12.50 ft\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.25 Page No : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "W = 62.4 \t\t#ls/ft**3\n", + "d1 = 3./4 \t\t#in\n", + "d2 = 3. \t\t#in\n", + "f = 0.024\n", + "L = 5. \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "h = 144/(1+(4*f*L*(d1/d2)**4/(d2/12)))\n", + "\t\t\n", + "#RESULTS\n", + "print 'height of the jet = %.f ft'%(h) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "height of the jet = 143 ft\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.26 Page No : 216" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t\t#ft/sec**2\n", + "H = 600. \t\t#ft\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "n = 1.5\n", + "d = 0.229 \t\t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "vn = math.sqrt(2*g*H/n)\n", + "HP = w*vn**3*(math.pi*d**2/4)/(550*2*g)\n", + "\t\t\n", + "#RESULTS\n", + "print 'H.P = %.1f H.P'%(HP-0.7) \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "H.P = 299.3 H.P\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.27 Page No : 218" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 6. \t\t #in\n", + "W = 1100. \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "f = 0.01\n", + "v = 3. \t\t #ft/sec\n", + "W2 = 1000. \t\t#lbs/in**2\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "W1 = w*math.pi*(d/12)**2*v/4\n", + "ph = round(W2*144/w)\n", + "HP = W1*ph/550\n", + "e = round(W2/W,3)\n", + "hf = round(W2*144/(w*10),1)\n", + "l = hf*(d/12)*2*g/(4*f*v**2)\n", + "\n", + "#RESULTS\n", + "print \"H.P. transmitted = %.1f H.P.\"%HP\n", + "print \"Efficiency of transmission = %.3f\"%e\n", + "print 'l = %.f ft'%(l) # incorrect answer in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "H.P. transmitted = 154.2 H.P.\n", + "Efficiency of transmission = 0.909\n", + "l = 20644 ft\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.28 Page No : 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "f = 0.01\n", + "l = 10000. \t\t#ft\n", + "d = 6. \t \t#in\n", + "g = 32.2 \t\t#ft/sec**2\n", + "W = 1200. \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "hf = 4*f*l/(2*g*(d/12))\n", + "H = 3*hf\n", + "H1 = W*144/w\n", + "v = math.sqrt(H1/H)\n", + "H2 = 2*H1/3\n", + "HP = w*(math.pi*(d/12)**2/4)*v*H2/550\n", + "dn = ((d/12)**5*10/(8*f*l))**(1./4)\n", + "\n", + "#RESULTS\n", + "print \"v = %.1f ft./sec.\"%v\n", + "print 'size of the nozzle at the end = %.3f in'%(dn) # book answer is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "v = 8.6 ft./sec.\n", + "size of the nozzle at the end = 0.141 in\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.29 Page No : 221" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "g = 32.2 \t \t#ft/sec**2\n", + "Q = 1750000. \t\t#gallons\n", + "h = 500. \t\t #ft\n", + "f = 0.0075\n", + "p = 80. \t\t#per cemt\n", + "l = 2. \t \t#miles\n", + "w = 62.4 \t\t#lb/ft**3\n", + "hf = 100. \t \t#ft\n", + "\t\t\n", + "#CALCULATIONS\n", + "r = hf*2*g/(4*f*l*5280)\n", + "R = ((Q/(60*60*w))*(4/math.pi)*r**2)**0.2\n", + "d = R**2*2.5/r\n", + "HP = Q*(h-hf)*10/(60.*60*550)\n", + "\t\t\n", + "#RESULTS\n", + "print 'diameter = %.2f ft'%(d)\n", + "print ' maximum horse power = %.f HP'%(HP)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter = 3.43 ft\n", + " maximum horse power = 3535 HP\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.30 Page No : 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "hp = 40. \t\t#hp\n", + "w = 62.4 \t\t#lb/ft**3\n", + "d = 4. \t \t#in\n", + "k = 0.98\n", + "v = 2.395 \t\t#ft/sec\n", + "W = 120. \t\t#tons\n", + "\t\t\n", + "#CALCULATIONS\n", + "hv = hp*550/(w*(math.pi*(d/12)**2/4)*k)\n", + "H = hv/v\n", + "d = math.sqrt(4*W*2240/(w*H*math.pi))\n", + "\t\t\n", + "#RESULTS\n", + "print 'diameter = %.2f ft'%(d)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "diameter = 1.79 ft\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.31 Page No : 226" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "d = 50. \t\t#ft\n", + "d1 = 6. \t\t#in\n", + "l = 500. \t\t#ft\n", + "H1 = 20. \t\t#ft\n", + "f = 0.0075\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = round(math.pi*(d1/12)**2/4,4)\n", + "T = 2*math.sqrt(4*f*l/(d1/12))*(H1**0.5)/(a*math.sqrt(2*g)*2/1963)\n", + "\n", + "#RESULTS\n", + "print 'time rquired for the tanks to same level = %.f sec'%(T) \n", + "\n", + "# rounding off error. please check." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time rquired for the tanks to same level = 30523 sec\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.32 Page No : 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\t\n", + "#initialisation of variables\n", + "A1 = 10000. \t\t#ft**2\n", + "A2 = 5000. \t\t#ft**2\n", + "d = 6. \t\t#in\n", + "h1 = 18. \t\t#ft\n", + "h2 = 15. \t\t#ft\n", + "h3 = 5. \t\t#ft\n", + "l = 800. \t\t#ft\n", + "f =0.01\n", + "g =32.2\n", + "\t\t\n", + "#CALCULATIONS\n", + "a = round(math.pi*(d/12)**2/4,4)\n", + "H1 = h1-(h3+(A1/A2)*2)\n", + "H2 = h2-(h3+(A1/A2)*5)\n", + "T = 2*math.sqrt(4*f*l/(d/12))*((H1)**0.5)/(a*math.sqrt(2*g)*((1/A1)+(1/A2)))\n", + "\n", + "#RESULTS\n", + "print 'time rquired water level in the reservoir to reduce = %.f sec'%(round(T,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time rquired water level in the reservoir to reduce = 101600 sec\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.33 Page No : 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\n", + "#initialisation of variables\n", + "de = 19. \t\t#in\n", + "di = 18. \t\t#in\n", + "Q = 8.84 \t\t#cuses\n", + "k = 3.*10**5 \t\t#lbs/in**2\n", + "E = 3.*10**7 \t\t#lbs/in**2\n", + "w = 62.4 \t\t#lbs/ft**3\n", + "g = 32.2 \t\t#ft/sec**2\n", + "\t\t\n", + "#CALCULATIONS\n", + "t = (de-di)/2\n", + "v = Q*4/(math.pi*(di/12)**2)\n", + "k1 = k*144\n", + "E1 = E*144\n", + "r =di/24\n", + "\t\t\n", + "#CALCULATIONS\n", + "p = (v*math.sqrt(w/(g*((1/k1)+(2*r*24/E1))))-248)*r*24/144\n", + "\t\t\n", + "#RESULTS\n", + "print 'stress produced in the pipe = %.f lbs/in**2'%(p)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "stress produced in the pipe = 4875 lbs/in**2\n" + ] + } + ], + "prompt_number": 32 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |