{
 "metadata": {
  "name": "",
  "signature": "sha256:d5da213085937afdb48d7dfa573f842c4dd8a61f494a1ba421365a0cebd5fe2e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9 : Pressure Measurements"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.1  Page No : 383"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T = 273+20;\n",
      "P = 101.3*10**3;\n",
      "\n",
      "# Calculations and Results\n",
      "mfp = 22.7*10**-6*T/P;\n",
      "print \"length of mean free path when pressure is one atmospheric pressure(m)\", mfp\n",
      "P = 133;\n",
      "mfp = 22.7*10**-6*T/P;\n",
      "print \"length of mean free path when pressure is one torr(m)\", mfp\n",
      "P = 133*10**-3;\n",
      "mfp = 22.7*10**-6*T/P;\n",
      "print \"length of mean free path when pressure is one micrometer of Hg(m)\", mfp\n",
      "P = 249.1;\n",
      "mfp = 22.7*10**-6*T/P;\n",
      "print \"length of mean free path when pressure is one inch of water(m)\", mfp\n",
      "P = 133*10**-6;\n",
      "mfp = 22.7*10**-6*T/P;\n",
      "print \"length of mean free path when pressure is 10**-3 micrometer of Hg(m)\", mfp\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "length of mean free path when pressure is one atmospheric pressure(m) 6.56574531096e-08\n",
        "length of mean free path when pressure is one torr(m) 5.00082706767e-05\n",
        "length of mean free path when pressure is one micrometer of Hg(m) 0.0500082706767\n",
        "length of mean free path when pressure is one inch of water(m) 2.67005218788e-05\n",
        "length of mean free path when pressure is 10**-3 micrometer of Hg(m) 50.0082706767\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.2  Page No : 385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "T = 273.+25;\n",
      "P = 99.22*10**3;\n",
      "R = 288.;\n",
      "df = P/(R*T);\n",
      "dm = 0.82*996;\n",
      "g = 9.81;\n",
      "h = 200*10**-6;\n",
      "\n",
      "# Calculations\n",
      "P1 = g*h*(dm-df)*10**3;\n",
      "Pa = P+P1;\n",
      "\n",
      "# Results\n",
      "print \"Pressure of air source(N/m2)\", Pa\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure of air source(N/m2) 100820.136398\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.3  Page No : 387"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "df = 1.*10**3;\n",
      "dm = 13.56*10**3;\n",
      "g = 9.81;\n",
      "h = 130.*10**-3;\n",
      "\n",
      "# Calculations\n",
      "P = g*h*(dm-df);\n",
      "Ph = P/9.81;\n",
      "\n",
      "# Results\n",
      "print \"Pressure head(mm of water)\", Ph\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure head(mm of water) 1632.8\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.4  Page No : 389"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "hn  = 250.;\n",
      "d = 5.;\n",
      "D = 25.;\n",
      "\n",
      "# Calculations\n",
      "h = hn*(1+(d/D)**2);\n",
      "\n",
      "# Results\n",
      "print \"height\", h\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "height 260.0\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.6  Page No : 391"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "P = 8.*133;\n",
      "h = P/(800*9.81);\n",
      "d = 2.;\n",
      "D = 50.;\n",
      "\n",
      "# Calculations\n",
      "hn = h/(1+(d/D)**2);\n",
      "e = (hn-h)/h*100;\n",
      "eP = 0.8*1000*9.81*(hn-h);\n",
      "\n",
      "# Results\n",
      "print \"error interms of pressure(N/m2)\", eP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "error interms of pressure(N/m2) -1.69968051118\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.7  Page No : 393"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "P = 133.;\n",
      "g = 9.81;\n",
      "dm = 13.56*10**3;\n",
      "R = 10.**-3;\n",
      "d = 4.;\n",
      "D = 20.;\n",
      "\n",
      "# Calculations\n",
      "th = math.asin(P/(g*dm*R*(1+(d/D)**2)));\n",
      "thV = 90-th;\n",
      "\n",
      "# Results\n",
      "print \"angle to which tube is incliend to vertical(degree)\", thV\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle to which tube is incliend to vertical(degree) 88.708070889\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.8  Page No : 395"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "\n",
      "# Variables\n",
      "P = 9.81;\n",
      "g = 9.81;\n",
      "dm = 0.864*10**3;\n",
      "R = 4.*10**-3;\n",
      "d = 2.;\n",
      "D = 20.;\n",
      "\n",
      "# Calculations\n",
      "th = math.asin(P/(g*dm*R*(1+(d/D)**2)));\n",
      "\n",
      "# Results\n",
      "print \"angle to which tube is incliend to horizontal(degree)\", th\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle to which tube is incliend to horizontal(degree) 0.290558105825\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.9  Page No : 397"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P = 500.*9.81;\n",
      "g = 9.81;\n",
      "d = 8.;\n",
      "a =  (math.pi/4)*d**2;\n",
      "A = 1200.;\n",
      "\n",
      "# Calculations and Results\n",
      "dm = 0.8*10**3;\n",
      "hn = P/(g*dm*(1+(a/A)));\n",
      "print \"Length of scale(m)\", hn\n",
      "R = 0.6;\n",
      "P1 = 50*9.81;\n",
      "th = math.asin(P1/(g*dm*R*(1+(a/A))));\n",
      "print \"angle to which tube is incliend to horizontal(degree)\", th\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length of scale(m) 0.599872595479\n",
        "angle to which tube is incliend to horizontal(degree) 0.100146080124\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.10  Page No : 399"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P = 100.*10**3;\n",
      "g = 9.81;\n",
      "di = 10.*10**-3;\n",
      "D = 40.*10**-3;\n",
      "\n",
      "# Calculations\n",
      "A =  (math.pi/4)*D**2;\n",
      "dm = 13.6*10**3;\n",
      "a = A/(P/(dm*g*di)-1);\n",
      "d = (4*a/math.pi)**0.5*10**3;\n",
      "\n",
      "# Results\n",
      "print \"diameter of the tube(mm)\", d\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diameter of the tube(mm) 4.65136628261\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.11  Page No : 401"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Calculations and Results\n",
      "AR = 1./(0.83-0.8);\n",
      "print \"Amplification ratio\", AR\n",
      "D = 50.*10**-3;\n",
      "A =  (math.pi/4)*D**2;\n",
      "d = 6.*10**-3;\n",
      "a =  (math.pi/4)*d**2;\n",
      "PR = (a/A)*100;\n",
      "print \"percentage error\", PR\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Amplification ratio 33.3333333333\n",
        "percentage error 1.44\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.12  Page No : 403"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P = 981;\n",
      "g = 9.81;\n",
      "d = 500.*10**-3;\n",
      "\n",
      "# Calculations\n",
      "A =  (math.pi/4)*(10*10**-3)**2;\n",
      "R = 275*10**-3;\n",
      "th = 30;\n",
      "W = A*d*P/(2*g*R*math.sin(math.radians(th)));\n",
      "\n",
      "# Results\n",
      "print \"value of counter weight required(kg)\", W\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of counter weight required(kg) 0.0142799666072\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.13  Page No : 405"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "Mp1 = 20./40;\n",
      "Mp2 = 10./40;\n",
      "Mp3 = 5./40;\n",
      "\n",
      "# Calculations and Results\n",
      "Eta = 0.225;\n",
      "print \"damping factor\", Eta\n",
      "Td = 1.2;\n",
      "wd = 2*math.pi/Td;\n",
      "wn = wd/((1-Eta**2)**0.5);\n",
      "tc = 1/wn;\n",
      "print \"time constant(s)\", tc\n",
      "ess = 2*Eta/wn;\n",
      "ess5 = 5*ess;\n",
      "print \"error for 5mm/s ramp(mm)\", ess5\n",
      "Tlag = 2*Eta*tc;\n",
      "print \"time lag(s)\", Tlag\n",
      "Eta1 = Eta*(0.5)**0.5;\n",
      "print \"New damping factor\", Eta1\n",
      "Td = 1.2;\n",
      "wn1  =  wn*(0.5)**0.5;\n",
      "print \"New natural frequency(rad/s)\", wn1\n",
      "tc1 = 1/wn;\n",
      "print \"New time constant(s)\", tc1\n",
      "ess51 = ess5;\n",
      "print \"new error for 5mm/s ramp(mm)\", ess51\n",
      "Tlag1 = Tlag;\n",
      "print \"new time lag(s)\", Tlag1\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "damping factor 0.225\n",
        "time constant(s) 0.186088816266\n",
        "error for 5mm/s ramp(mm) 0.418699836599\n",
        "time lag(s) 0.0837399673198\n",
        "New damping factor 0.159099025767\n",
        "New natural frequency(rad/s) 3.79983491418\n",
        "New time constant(s) 0.186088816266\n",
        "new error for 5mm/s ramp(mm) 0.418699836599\n",
        "new time lag(s) 0.0837399673198\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.14  Page No : 407"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P = 7.*10**6;\n",
      "R = 6.25*10**-3;\n",
      "v = 0.28;\n",
      "E = 200.*10**9;\n",
      "\n",
      "# Calculations and Results\n",
      "t = ((9*P*R**4*(1-v**2)/(16*E))**0.25)*10**3;\n",
      "print \"thickness of diaphram(mm)\", t\n",
      "ds = 7800;\n",
      "fn = (2.5*t/(math.pi*R**2))*(E/(3*ds*(1-v**2)))**0.5;\n",
      "print \"natural frequency(Hz)\", fn\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "thickness of diaphram(mm) 0.407908989726\n",
        "natural frequency(Hz) 25306332.7381\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.15  Page No : 409"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P = 100.*10**3;\n",
      "A = 1500.*10**-6;\n",
      "F = P*A;\n",
      "Cs = F/3;\n",
      "\n",
      "# Calculations and Results\n",
      "Ls = Cs+40;\n",
      "print \"natural length of spring(mm)\", Ls\n",
      "P1 = 10*10**3;\n",
      "F1 = P1*A;\n",
      "Ss = 3+2*.5;\n",
      "D = F1/Ss;\n",
      "print \"lacement (mm)\",D\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "natural length of spring(mm) 90.0\n",
        "lacement (mm) 3.75\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.16  Page No : 411"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P = 200*10**3;\n",
      "R = 70*10**-3;\n",
      "v = 0.25;\n",
      "t = 1*10**-3;\n",
      "r = 60*10**-3;\n",
      "E = 200*10**9;\n",
      "\n",
      "# Calculations\n",
      "Sr = (3*P*R**2*v/(8*t**2))*((1/v+1)-(3/v+1)*(r/R)**2);\n",
      "St = (3*P*R**2*v/(8*t**2))*((1/v+1)-(1/v+3)*(r/R)**2);\n",
      "Sta2 = (Sr-v*St)/E;\n",
      "Sta3 = (Sr-v*St)/E;\n",
      "r0 = 10*10**-3;\n",
      "Sr1 = (3*P*R**2*v/(8*t**2))*((1/v+1)-(3/v+1)*(r0/R)**2);\n",
      "St1 = (3*P*R**2*v/(8*t**2))*((1/v+1)-(1/v+3)*(r0/R)**2);\n",
      "Sta1 = (Sr1-v*St1)/E;\n",
      "Sta4 = (Sr1-v*St1)/E;\n",
      "Gf = 1.8;\n",
      "ei = 12;\n",
      "eo = (Sta1+Sta4-Sta2-Sta3)*Gf*ei/4;\n",
      "\n",
      "# Results\n",
      "print \"output voltage (V)\", eo\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output voltage (V) 0.0398671875\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.17  Page No : 413"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Aou = 700.*25*1/100;\n",
      "Aol = 100.*25*1/100;\n",
      "AouPtP =  2*Aou;\n",
      "AolPtP =  2*Aol;\n",
      "Se1 = 1.;\n",
      "\n",
      "# Calculations and Results\n",
      "D1 = AouPtP/Se1;\n",
      "print \"deflection of screen corresponding to maximum pressure for sensitivity of 1mV/mm (mm)\", D1\n",
      "print \"since the length of the screen is 100mm so waveform is out of range and hence sensitivity setting of 1mV/mm should not be used\",\n",
      "Se2 = 5;\n",
      "D2 = AouPtP/Se2;\n",
      "print \"deflection of screen corresponding to maximum pressure for sensitivity of 5mV/mm (mm)\", D2\n",
      "print \"delection is within the range\",\n",
      "Se3 = 20;\n",
      "D3 = AouPtP/Se3;\n",
      "print \"deflection of screen corresponding to maximum pressure for sensitivity of 20mV/mm (mm)\", D3\n",
      "print \"delection is within the range\",\n",
      "Se4 = 100;\n",
      "D4 = AouPtP/Se4;\n",
      "print \"deflection of screen corresponding to maximum pressure for sensitivity of 100mV/mm (mm)\", D4\n",
      "print \"delection is within the range\",\n",
      "Se5 = 500;\n",
      "D5 = AouPtP/Se5;\n",
      "print \"deflection of screen corresponding to maximum pressure for sensitivity of 500mV/mm (mm)\", D5\n",
      "print \"delection is within the range\",\n",
      "print \"since the sensitivity of 5mV/mm gives higher deflection so it is the optimum sensitivity\",\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "deflection of screen corresponding to maximum pressure for sensitivity of 1mV/mm (mm) 350.0\n",
        "since the length of the screen is 100mm so waveform is out of range and hence sensitivity setting of 1mV/mm should not be used deflection of screen corresponding to maximum pressure for sensitivity of 5mV/mm (mm) 70.0\n",
        "delection is within the range deflection of screen corresponding to maximum pressure for sensitivity of 20mV/mm (mm) 17.5\n",
        "delection is within the range deflection of screen corresponding to maximum pressure for sensitivity of 100mV/mm (mm) 3.5\n",
        "delection is within the range deflection of screen corresponding to maximum pressure for sensitivity of 500mV/mm (mm) 0.7\n",
        "delection is within the range since the sensitivity of 5mV/mm gives higher deflection so it is the optimum sensitivity\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.18  Page No : 415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "dP = (7000*10**3)-(100*10**3);\n",
      "b = 25*10**-12;\n",
      "R1 = 100;\n",
      "dR = R1*b*dP;\n",
      "ei = 5.;\n",
      "\n",
      "# Calculations\n",
      "deo = dR*ei/(4*R1)\n",
      "\n",
      "# Results\n",
      "print \"output voltage of bridge(V)\", deo\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output voltage of bridge(V) 0.000215625\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.19  Page No : 417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "T = 273+20;\n",
      "P = 101.3*10**3;\n",
      "R = 287;\n",
      "de = P/(R*T);\n",
      "C = 20.04*T**0.5;\n",
      "r = 6.25*10**-3;\n",
      "L = 0.6;\n",
      "\n",
      "# Calculations\n",
      "V = math.pi*((12.5*10**-3)**2)*(12.5*10**-3);\n",
      "wn = C*r*(math.pi/(V*(L+0.5*math.pi*r)))**0.5;\n",
      "fn = wn/(2*math.pi);\n",
      "f = 1000;\n",
      "u = f/fn;\n",
      "mu = 19.1*10**-6;\n",
      "eta = (2*mu/(de*C*r**3))*(3*L*V/math.pi)**0.5;\n",
      "M = 1/(((1-u**2)**2)+((2*eta*u)**2))**0.5;\n",
      "M = M*100;\n",
      "\n",
      "# Results\n",
      "print \"attenuation = \", M\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "attenuation =  10.834485951\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.20  Page No : 419"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "d = 1;\n",
      "At = (math.pi*d**2)*10**-6/4;\n",
      "V = 100*10**-6;\n",
      "h = 30*10**-3;\n",
      "\n",
      "# Calculations\n",
      "P1 = (At*h**2)/V;\n",
      "P2 = (At*h**2)/(V-At*h);\n",
      "e = P2-P1;\n",
      "\n",
      "# Results\n",
      "print \"error =  \", e\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "error =   1.66588825836e-09\n"
       ]
      }
     ],
     "prompt_number": 20
    }
   ],
   "metadata": {}
  }
 ]
}