{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : Hydrostatic Forces and Centre of Pressure"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3.1 page no : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "sw= 62.3 \t\t\t#lbf/ft**3\n",
      "d= 288. \t\t\t#ft\n",
      "p= 1. \t\t\t#lbf/in**2\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "P= sw*d/144.\n",
      "D= p*144./sw\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  'pressure at a depth of 288 ft= %.1f lbf/in**2'%(P)\n",
      "print  'depth= %.2f ft'%(D)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure at a depth of 288 ft= 124.6 lbf/in**2\n",
        "depth= 2.31 ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3.2 page no : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "\n",
      "w= 62.3 \t\t\t#lbf/ft**3\n",
      "d= 11.5 \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "p= w*d/144.\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  'pressure required to bubble air slowly through the tank= %.f lbf/in**2 guage'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure required to bubble air slowly through the tank= 5 lbf/in**2 guage\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3.3 page no : 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "    \n",
      "#initialisation of variables\n",
      "w= 62.3 \t\t\t#lbf/ft**3\n",
      "d= 23.1 \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "dp=  w*d/144.\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  ' pressure guage= %.f lbf/in**2'%(dp)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " pressure guage= 10 lbf/in**2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3.4 page no : 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "d= 1. \t\t\t#ft\n",
      "s= 0.8\n",
      "h= 2. \t\t\t#ft\n",
      "w= 62.3 \t\t\t#lbf/ft**3\n",
      "d1= 5. \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "F= (math.pi/4)*d**2*s*w*(d/2)\n",
      "F1= (math.pi/4)*d**2*s*w*(d1/2)\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  'Force= %.2f lbf'%(F)\n",
      "print  'Force= %.f lbf'%(F1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force= 19.57 lbf\n",
        "Force= 98 lbf\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3.5 page no : 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#initialisation of variables\n",
      "F= 100. \t\t\t#tonf\n",
      "p= 2000. \t\t\t#lbf/in**2\n",
      "x= 12. \t\t\t#in\n",
      "x1= 48. \t\t\t#in\n",
      "p1= 40. \t\t\t#lbf/in**2\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "A3= (F/p)*2240.\n",
      "A2= A3*x/x1\n",
      "A1= A2*p/p1\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  'Piston area= %.f in**2'%(A2)\n",
      "print  'Ram area= %.f in**2'%(A1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Piston area= 28 in**2\n",
        "Ram area= 1400 in**2\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.4.1 page no : 34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "\n",
      "Va= 100. \t\t\t#ft**3\n",
      "h= 10. \t\t\t#ft\n",
      "V1= 60. \t\t\t#ft**3\n",
      "Pabyw= 34. \t\t\t#ft\n",
      "h1= 4. \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "H= Pabyw*((Va/V1)-1)-(h-h1)\n",
      "h2= H+h\n",
      "Va1= (1+(h2/Pabyw))*Va\n",
      "V= Va1-Va\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  'depth of the river= %.1f ft'%(h2)\n",
      "print  'volume to be pumped= %.f ft**3'%(V)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth of the river= 26.7 ft\n",
        "volume to be pumped= 78 ft**3\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.6.2 page no : 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "w= 62.3 \t\t\t#lbf/ft**3\n",
      "dg= 4. \t\t\t#ft\n",
      "d= 1. \t\t\t#ft\n",
      "h= 2. \t\t\t#ft\n",
      "HP= 1.0156 \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "F= w*dg*d**2*(math.pi/4.)\n",
      "F1= F*HP/h\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  ' Minimum force= %.1f lbf'%(F1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Minimum force= 99.4 lbf\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.6.3 page no : 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "s= 1.03\n",
      "w= 64.3 \t\t#lbf/ft**3\n",
      "dg= 14. \t\t#ft\n",
      "A= 40. \t\t\t#ft**2\n",
      "b= 5. \t\t\t#ft\n",
      "d= 8. \t\t\t#ft\n",
      "b1= 2.5 \t\t#ft\n",
      "y= 10. \t\t\t#ft\n",
      "x= 3. \t\t\t#ft\n",
      "z= 4. \t\t\t#ft\n",
      "\t\t\t \n",
      "#CALCULATIONS\n",
      "F= w*dg*A*16.05/36000\n",
      "r= ((b*d**3./12)/(A*dg))\n",
      "F3= F*b1/b\n",
      "F1= (F*(x-r)-(F/2)*x)/(y-z)\n",
      "F2= F-(F1+F3)\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  ' force F3 = %.3f tonf'%(F3)\n",
      "print  ' force F2 = %.2f tonf'%(F2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " force F3 = 8.027 tonf\n",
        " force F2 = 5.03 tonf\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.6.5 page no : 42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "w= 62.4 \t\t\t#lb/ft**3\n",
      "H1= 15. \t\t\t#ft\n",
      "B= 10. \t\t\t#ft\n",
      "H2= 5. \t\t\t#ft\n",
      "r= math.sqrt(19.)/10.\n",
      "l= 16. \t\t\t#ft\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "F= 0.5*w*(H1**2-H2**2)*B/2240\n",
      "N= F*0.5/r\n",
      "h= H2*(1-(H2/H1)**3)/(1-(H2/H1)**2)\n",
      "R1= N*h/l\n",
      "R2= N-R1\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print 'Resultant water force on one gate : %.1f tonf'%F\n",
      "print  ' Normal reaction = %.2f tonf'%(N)\n",
      "print  '  reaction forces on the finges= %.1f tonf'%(R2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resultant water force on one gate : 27.9 tonf\n",
        " Normal reaction = 31.95 tonf\n",
        "  reaction forces on the finges= 21.1 tonf\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.7.1 page no : 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "w= 62.3 \t\t\t#lb/ft**3\n",
      "b= 1. \t\t\t#ft\n",
      "s= 42. \t\t\t#ft\n",
      "d= 170. \t\t\t#ft\n",
      "l= 15.75\n",
      "a= 170/3.\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "W= 2*w*b*s*d/3.\n",
      "F= w*b*d**2/2.\n",
      "L= l+a*(F/W)\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  ' distance= %.f ft from O'%(L)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " distance= 188 ft from O\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.7.2 page no : 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "import math \n",
      "d= 2. \t\t\t#ft\n",
      "a= 30. \t\t\t#degrees\n",
      "p= 200. \t\t\t#ft\n",
      "w= 62.3 \t\t\t#lbf/ft**3\n",
      "\t\t\t\n",
      "#CALCULATIONS\n",
      "T= (math.pi/4)*(d**2/2240)*w*p*math.sqrt(2*(1-math.cos(math.radians(a))))\n",
      "\t\t\t\n",
      "#RESULTS\n",
      "print  ' Resultant static thrust= %.2f tonf'%(T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Resultant static thrust= 9.05 tonf\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}