{
 "metadata": {
  "name": "",
  "signature": "sha256:0ee07fecb31546aa6587a717abc79d232e40e12aaac4b7ede8f4783b141af15e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4 : Measures Of Pressure"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 Page No :  85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\t\t\t\n",
      "# Variables :\n",
      "p = 5.;\t\t\t#kg/cm**2\n",
      "print (\"Gauge units : \");\n",
      "\n",
      "# Calculations and Results\n",
      "print \"Pressure Intensity in kg/m**2 : \",(p/10**-4)\n",
      "g = 9.81;\t\t\t#gravity consmath.tant\n",
      "print \"Pressure Intensity in N/m**2 : \",(p*g/10**-4)\n",
      "print \"Pressure Intensity in Pa : \",(p*g/10**-4)\n",
      "print \"Pressure Intensity in kPa : \",p*g/10**3/10**-4\n",
      "print \"Pressure Intensity in MPa : \",p*g/10**6/10**-4\n",
      "print (\"In terms of head : \");\n",
      "w = 1000.;\t\t\t#kg/m**3 for water\n",
      "h = p*10**4/w;\t\t\t#meter of water\n",
      "print \"Pressure is  : \",(h),\" meter of water.\"\n",
      "w = 13.6*1000;\t\t\t#kg/m**3 for mercury\n",
      "h = p*10**4/w;\t\t\t#meter of mercury\n",
      "print \"Pressure is  : \",(h),\" meter of mercury.\"\n",
      "print (\"Absolute units : \");\n",
      "Patm = 760.;\t\t\t#mm of mercury\n",
      "Patm = 760*13.6/1000;\t\t\t#m of water\n",
      "Patm = Patm*1000.;\t\t\t#kg/m**2\n",
      "Pabs = p+Patm;\t\t\t#kg/m**2\n",
      "print \"Absolute pressure in kg/m**2 : \",Pabs\n",
      "print \"Absolute pressure in kg/cm**2 : \",Pabs*10**4\n",
      "print \"Absolute pressure in N/m**2 : \",Pabs*10**4*g\n",
      "print \"Absolute pressure in Pa : \",Pabs*10**4*g\n",
      "print \"Absolute pressure in kPa : \",Pabs*10**5/10**3\n",
      "print \"Absolute pressure in MPa : \",Pabs*10**5/10**6\n",
      "h1 = p*10.**4/w;\t\t\t#meter of water\n",
      "h2 = p*10.**4/1000;\t\t\t#meter of water\n",
      "h = h1+h2;\t\t\t#\t\t\t#meter of water\n",
      "print \"Absolute pressure head in terms of water in meter : \",h\n",
      "w = 13.6*1000;\t\t\t#kg/m**3 for mercury\n",
      "h = p*10**4/w+760./1000;\t\t\t#meter of mercury\n",
      "print \"Absolute pressure head in terms of mercury in meter : %.3f\"%h\n",
      "\n",
      "# note : rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Gauge units : \n",
        "Pressure Intensity in kg/m**2 :  50000.0\n",
        "Pressure Intensity in N/m**2 :  490500.0\n",
        "Pressure Intensity in Pa :  490500.0\n",
        "Pressure Intensity in kPa :  490.5\n",
        "Pressure Intensity in MPa :  0.4905\n",
        "In terms of head : \n",
        "Pressure is  :  50.0  meter of water.\n",
        "Pressure is  :  3.67647058824  meter of mercury.\n",
        "Absolute units : \n",
        "Absolute pressure in kg/m**2 :  10341.0\n",
        "Absolute pressure in kg/cm**2 :  103410000.0\n",
        "Absolute pressure in N/m**2 :  1014452100.0\n",
        "Absolute pressure in Pa :  1014452100.0\n",
        "Absolute pressure in kPa :  1034100.0\n",
        "Absolute pressure in MPa :  1034.1\n",
        "Absolute pressure head in terms of water in meter :  53.6764705882\n",
        "Absolute pressure head in terms of mercury in meter : 4.436\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 Page No :  88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "# Variables :\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "h = 50./1000;\t\t\t#m\n",
      "\n",
      "# Calculations and Results\n",
      "p = w*h;\t\t\t#kg/m**2\n",
      "p = p*9.81;\t\t\t#N/m**2 or Pa\n",
      "print \"Pressure Intensity in Pa : \",p\n",
      "alfa = 30.;\t\t\t#degree\n",
      "h = 50;\t\t\t#mm\n",
      "l = h/math.sin(math.radians(alfa));\t\t\t#mm\n",
      "print \"Reading in tube in mm : \",l\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure Intensity in Pa :  490.5\n",
        "Reading in tube in mm :  100.0\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3 Page No : 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 13.6;\t\t\t#sp. gravity of mercury\n",
      "S2 = 1.;\t\t\t#sp. gravity of water\n",
      "H1 = 5.;\t\t\t#m\n",
      "\n",
      "# Calculations and Results\n",
      "H2 = S1*H1/S2;\t\t\t#m\n",
      "print \"(i) Pressure is \",(H2),\" meter of water.\"\n",
      "\n",
      "S2 = 0.79;\t\t\t#sp. gravity of kerpsene\n",
      "H1 = 5;\t\t\t#m\n",
      "H2 = S1*H1/S2;\t\t\t#m\n",
      "print \"(ii) Pressure is \",round(H2,3),\" meter of kerosene.\"\n",
      "\n",
      "S2 = 1.7;\t\t\t#sp. gravity of fluid\n",
      "H1 = 5;\t\t\t#m\n",
      "H2 = S1*H1/S2;\t\t\t#m\n",
      "print \"(iii) Pressure is \",(H2),\" meter of fluid.\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Pressure is  68.0  meter of water.\n",
        "(ii) Pressure is  86.076  meter of kerosene.\n",
        "(iii) Pressure is  40.0  meter of fluid.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 Page No : 95"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "S = 0.9;\t\t\t#sp. gravity of liquid\n",
      "Sm = 13.6;\t\t\t#sp. gravity of mercury\n",
      "S1 = Sm/S;\t\t\t#sp. gravity\n",
      "\n",
      "# Calculations\n",
      "w = S*9.81;\t\t\t#kN/m**3\n",
      "h2 = 500./1000;\t\t\t#m\n",
      "h1 = 300./1000;\t\t\t#m\n",
      "a_BY_A = 1./80;\t\t\t#ratio of area\n",
      "pa = w*(h2*((S1-1)*a_BY_A+S1)-h1);\t\t\t#kPa\n",
      "\n",
      "# Results\n",
      "print \"Pressure in the pipe in kPa: %.3f\"%pa\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure in the pipe in kPa: 64.838\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5 Page No : 96"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 1.2;\t\t\t#sp. gravity\n",
      "S2 = 13.6;\t\t\t#sp. gravity\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "\n",
      "# Calculations\n",
      "h2 = 50./1000;\t\t\t#m\n",
      "h1 = 200./1000;\t\t\t#m\n",
      "pa = w*(S2*h1-S1*h2);\t\t\t#kg/m**2\n",
      "\n",
      "# Results\n",
      "print \"Pressure in the pipe in kg/m**2: \",pa\n",
      "print \"Pressure in the pipe in Pa: \",pa*9.81\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure in the pipe in kg/m**2:  2660.0\n",
        "Pressure in the pipe in Pa:  26094.6\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6 Page No :  97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "S = 1.;\t\t\t#sp. gravity\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "h2 = 50./1000;\t\t\t#m\n",
      "h1 = 200./1000;\t\t\t#m\n",
      "\n",
      "# Calculations\n",
      "pa = w*S*(h1-h2);\t\t\t#kg/m**2\n",
      "\n",
      "# Results\n",
      "print \"Pressure in the pipe in kg/m**2: \",pa\n",
      "print \"Pressure in the pipe in Pa: \",pa*9.81\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure in the pipe in kg/m**2:  150.0\n",
        "Pressure in the pipe in Pa:  1471.5\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7 Page No :  97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 0.005;\t\t\t#sp. gravity\n",
      "S2 = 1.;\t\t\t#sp. gravity\n",
      "Patm = 1.014*10**5;\t\t\t#Pa\n",
      "h = 50./1000;\t\t\t#m\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "\n",
      "# Calculations\n",
      "pa = -w*S2*h;\t\t\t#kg/m**2\n",
      "Pabs = pa*9.81+Patm;\t\t\t#\n",
      "\n",
      "# Results\n",
      "print \"Pressure intensity of gas in Pa(Vaccum): \",abs(pa*9.81)\n",
      "print \"Absolute pressure in the pipe in Pa: \",Pabs\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure intensity of gas in Pa(Vaccum):  490.5\n",
        "Absolute pressure in the pipe in Pa:  100909.5\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8 Page No : 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 0.9;\t\t\t#sp. gravity\n",
      "S2 = 13.6;\t\t\t#sp. gravity\n",
      "h1 = 12.5/100;\t\t\t#m\n",
      "\n",
      "# Calculations and Results\n",
      "P_AB = h1*(S2-S1);\t\t\t#meter of water\n",
      "print \"Difference in pressure head at the points A & B is \",(P_AB),\" meter of water\"\n",
      "\n",
      "w = 1000;\t\t\t#kg/m**3\n",
      "P_diff = P_AB*w*9.81;\t\t\t#Pa or Nm**2\n",
      "print \"In terms A pressure entirely, the difference of pressure in N/m**2 : \",P_diff\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Difference in pressure head at the points A & B is  1.5875  meter of water\n",
        "In terms A pressure entirely, the difference of pressure in N/m**2 :  15573.375\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9 Page No :  100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 1.;\t\t\t#sp. gravity\n",
      "S2 = 13.6;\t\t\t#sp. gravity\n",
      "h1 = 120./1000;\t\t\t#m\n",
      "\n",
      "# Calculations and Results\n",
      "P_diff = h1*(S2-S1);\t\t\t#meter of water\n",
      "print \"Difference in pressure head is \",(P_diff),\" meter of water\"\n",
      "w = 1000;\t\t\t#kg/m**3\n",
      "P_diff = P_diff*w*9.81;\t\t\t#Pa or Nm**2\n",
      "print \"In terms of pressure intensity, the difference of pressure in N/m**2 : \",P_diff\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Difference in pressure head is  1.512  meter of water\n",
        "In terms of pressure intensity, the difference of pressure in N/m**2 :  14832.72\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.10 Page No : 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 0.81;\t\t\t#sp. gravity\n",
      "S2 = 1.2;\t\t\t#sp. gravity\n",
      "S3 = 13.6;\t\t\t#sp. gravity\n",
      "h3 = 200./1000;\t\t\t#m\n",
      "h2 = 50./1000;\t\t\t#m\n",
      "h1 = 100./1000;\t\t\t#m\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "\n",
      "# Calculations\n",
      "pAB = ((h1*(S2-S1)+h2*(S3-S1)-h3*S1))*w;\t\t\t#Kg/m**2\n",
      "\n",
      "# Results\n",
      "print \"Pressure difference between the two vessel in kg/m**2: \",pAB\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure difference between the two vessel in kg/m**2:  516.5\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.11 Page No : 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "# Variables :\n",
      "S1 = 1.9;\t\t\t#sp. gravity\n",
      "S2 = 1.2;\t\t\t#sp. gravity\n",
      "S3 = 0.79;\t\t\t#sp. gravity\n",
      "h2 = 545./1000;\t\t\t#m\n",
      "h1 = 750./1000;\t\t\t#m\n",
      "h3 = h1-h2;\t\t\t#m\n",
      "w = 1000*9.81;\t\t\t#N/m**3\n",
      "\n",
      "# Calculations\n",
      "pAB = (h1*S1-h2*S2-h3*S3)*w;\t\t\t#N/m**2\n",
      "\n",
      "# Results\n",
      "print \"Pressure difference between the two vessel in N/m**2: \",pAB\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure difference between the two vessel in N/m**2:  5974.7805\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.12 Page No :  105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 0.005;\t\t\t#sp. gravity\n",
      "S2 = 0.79;\t\t\t#sp. gravity\n",
      "S3 = 13.6;\t\t\t#sp. gravity\n",
      "h = 30./1000;\t\t\t#m\n",
      "w = 1000*9.81;\t\t\t#N/m**3\n",
      "\n",
      "# Calculations\n",
      "pAB = h*(S3-S2)*w;\t\t\t#N/m**2\n",
      "\n",
      "# Results\n",
      "print \"Pressure difference between the two vessel in N/m**2: \",pAB\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure difference between the two vessel in N/m**2:  3769.983\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.13 Page No :  105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 1.25;\t\t\t#sp. gravity\n",
      "S2 = 1.05;\t\t\t#sp. gravity\n",
      "S3 = 0.79;\t\t\t#sp. gravity\n",
      "h = 30./1000;\t\t\t#m\n",
      "w = 1000.;\t\t\t#kg/m**3\n",
      "\n",
      "# Calculations\n",
      "#pA = pB\n",
      "h = (0.15*w*S2-S1*w*0.15)/(S3*w-w*S2);\t\t\t#m\n",
      "h = h*1000;\t\t\t#mm\n",
      "\n",
      "# Results\n",
      "print \"Reading of manometer in mm : %.f\"%h\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reading of manometer in mm : 115\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.14 Page No : 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "S1 = 1.;\t\t\t#sp. gravity of water\n",
      "S2 = 1.;\t\t\t#sp. gravity of water\n",
      "S3 = 0.9;\t\t\t#sp. gravity of oil\n",
      "h3 = 100./1000;\t\t\t#meter\n",
      "w = 9.81*1000;\t\t\t#N/m**3\n",
      "\n",
      "# Calculations\n",
      "pAB = w*(h3-h3*S3);\t\t\t#N/m**2\n",
      "\n",
      "# Results\n",
      "print \"Difference of pressure in N/m**2 or Pa : \",pAB\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Difference of pressure in N/m**2 or Pa :  98.1\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}