{
 "metadata": {
  "name": "",
  "signature": "sha256:3c32f4c771b7aa90d25f7c7a71e72b94eccb8c650a9b70156e8a9a1623dc111e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : Static Characteristics of Instruments and Measurement systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1  Page No : 5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating static error and static correction\n",
      "# Variables\n",
      "Am  =  127.50;\n",
      "At  =  127.43;\n",
      "\n",
      "# Calculations and Results\n",
      "e = Am-At;\n",
      "print \"Static error(V) = \", e\n",
      "\n",
      "Sc = -e;\n",
      "print \"Static Correction(V) = \", Sc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Static error(V) =  0.07\n",
        "Static Correction(V) =  -0.07\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2  Page No : 7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating true value of the temperature\n",
      "\n",
      "# Variables\n",
      "Am  =  95.45;\n",
      "Sc = -0.08;\n",
      "\n",
      "# Calculations\n",
      "At = Am+Sc;\n",
      "\n",
      "# Results\n",
      "print \"True Temperature(Degree C) = \", At\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "True Temperature(Degree C) =  95.37\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3  Page No : 9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating Relative error (expressed as a percentage of f.s.d)\n",
      "\n",
      "# Variables\n",
      "Am  =  1.46;\n",
      "At = 1.50;\n",
      "\n",
      "# Calculations and Results\n",
      "e = Am-At;\n",
      "print \"Absolute error(V) = \", e\n",
      "Sc = -e;\n",
      "print \"Absolute Correction(V) = \", Sc\n",
      "RE = (e/At)*100;\n",
      "print \"Relative Error in terms of true value(in percentage) = \", RE\n",
      "REF = (e/2.5)*100;\n",
      "print \"Relative Error in terms of true value(in percentage) = \", REF"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Absolute error(V) =  -0.04\n",
        "Absolute Correction(V) =  0.04\n",
        "Relative Error in terms of true value(in percentage) =  -2.66666666667\n",
        "Relative Error in terms of true value(in percentage) =  -1.6\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4  Page No : 11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating static error and static correction\n",
      "\n",
      "# Variables\n",
      "Am  =  0.000161;\n",
      "At  =  0.159*10**-3;\n",
      "\n",
      "# Calculations and Results\n",
      "e = Am-At;\n",
      "print \"Static error(m3/s) = \", e\n",
      "\n",
      "Sc = -e;\n",
      "print \"Static Correction(m3/s) = \", Sc\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Static error(m3/s) =  2e-06\n",
        "Static Correction(m3/s) =  -2e-06\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5  Page No : 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating maximum static error \n",
      "\n",
      "# Variables\n",
      "#Span of the thermometer(degree C)\n",
      "S = 200.-150;\n",
      "#Accuracy of the thermometer(in terms of percentage of span)\n",
      "A = 0.0025;\n",
      "\n",
      "# Calculations\n",
      "e =  A*S;\n",
      "\n",
      "# Results\n",
      "print \"Maximum Static error(degree C) = \", e"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum Static error(degree C) =  0.125\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6  Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating the pressure for a dial reading of 100\n",
      "\n",
      "# Calculations\n",
      "P = ((27.58-6.895)/150)*100+6.895;\n",
      "\n",
      "# Results\n",
      "print \"pressure for a dial reading of 100(kN/m2) = \", P\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure for a dial reading of 100(kN/m2) =  20.685\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7  Page No : 17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating the noise output voltage of the amplifier\n",
      "\n",
      "# Variables\n",
      "Bw = 100.*10**3;\n",
      "Sn = 7.*10**-21;\n",
      "R = 50.*10**3;\n",
      "\n",
      "# Calculations and Results\n",
      "A = (Sn*R*Bw)**0.5;\n",
      "En = 2*A;\n",
      "print \"Noise voltage at input(V) = \", En\n",
      "\n",
      "Ga = 100;\n",
      "Eno = En*Ga;\n",
      "print \"Noise voltage at output(V) = \", Eno\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Noise voltage at input(V) =  1.18321595662e-05\n",
        "Noise voltage at output(V) =  0.00118321595662\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8  Page No : 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating the noise voltage\n",
      "\n",
      "# Variables\n",
      "Sn = 20.;\n",
      "Vs = 3;\n",
      "\n",
      "# Calculations\n",
      "Vn = Vs/(Sn)**0.5;\n",
      "\n",
      "# Results\n",
      "print \"noise Voltage(mV) = \", Vn"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "noise Voltage(mV) =  0.67082039325\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9  Page No : 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# calculating the signal to noise ratio at input\n",
      "# calculating the signal to noise ratio at output\n",
      "#calculating the noise factor and noise figure\n",
      "\n",
      "# Calculations and Results\n",
      "print \"signal to noise ratio at input\"\n",
      "Sni = (3.*10**-6/(1*10**-6))**2;\n",
      "print \"signal to noise ratio at input = \", Sni\n",
      "print \"signal to noise ratio at output\"\n",
      "Sno = (60.*10**-6/(20*10**-6))**2;\n",
      "print \"signal to noise ratio at output = \", Sno\n",
      "print \"New signal to noise ratio at output\"\n",
      "Snno = (60.*10**-6/(25*10**-6))**2;\n",
      "print \"signal to noise ratio at output = \", Snno\n",
      "\n",
      "F = Sni/Snno;\n",
      "print \"noise Factor = \", F\n",
      "\n",
      "nf = 10*math.log10(F);\n",
      "print \"noise Figure(dB) = \", nf\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "signal to noise ratio at input\n",
        "signal to noise ratio at input =  9.0\n",
        "signal to noise ratio at output\n",
        "signal to noise ratio at output =  9.0\n",
        "New signal to noise ratio at output\n",
        "signal to noise ratio at output =  5.76\n",
        "noise Factor =  1.5625\n",
        "noise Figure(dB) =  1.93820026016\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.10  Page No : 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# calculating the ratio of output signal to noise signal \n",
      "\n",
      "# Variables\n",
      "Bw = 100.*10**3;\n",
      "K = 1.38*10**-23;\n",
      "T = 300.;\n",
      "R = 120.;\n",
      "\n",
      "# Calculations and Results\n",
      "A = (K*T*R*Bw)**0.5;\n",
      "En = 2*A;\n",
      "print \"Noise voltage (V) = \", En\n",
      "Eno = 0.12*10**-3;\n",
      "print \"Noise voltage at output(V) = \", Eno\n",
      "Ra = Eno/En;\n",
      "print \"Ratio of signal votage to Noise voltage  = \", Ra\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Noise voltage (V) =  4.45780214904e-07\n",
        "Noise voltage at output(V) =  0.00012\n",
        "Ratio of signal votage to Noise voltage  =  269.190951029\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.12  Page No : 25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "#calculating the average force and range of error\n",
      "F1 = 10.03;\n",
      "F2 = 10.10;\n",
      "F3 = 10.11;\n",
      "F4 = 10.08;\n",
      "\n",
      "# Calculations and Results\n",
      "Fav = (F1+F2+F3+F4)/4;\n",
      "print \"Average Force(N)  = \", Fav\n",
      "Fmax = F3;\n",
      "MaxR = Fmax-Fav;\n",
      "Fmin = F1;\n",
      "MinR = Fav-Fmin;\n",
      "AvgR = (MaxR+MinR)/2;\n",
      "print \"Average range of error (N) = \", AvgR"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Average Force(N)  =  10.08\n",
        "Average range of error (N) =  0.04\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.13  Page No : 27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "#calculating the sum of resistances connected in series with uncertainity of one unit\n",
      "R1 = 72.3;\n",
      "R2 = 2.73;\n",
      "R3 = 0.612;\n",
      "\n",
      "# Calculations\n",
      "R = (R1+R2+R3);\n",
      "\n",
      "# Results\n",
      "print \"sum of resistances(ohm)  = \", R\n",
      "\n",
      "print \"the resultant resistance is 75.6 ohm with 6 as first doutful figure\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "sum of resistances(ohm)  =  75.642\n",
        "the resultant resistance is 75.6 ohm with 6 as first doutful figure\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.14  Page No : 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#calculating the power with uncertainity of one unit in voltage and current\n",
      "\n",
      "# Variables\n",
      "V = 12.16;\n",
      "I = 1.34;\n",
      "\n",
      "# Calculations\n",
      "P = V*I;\n",
      "\n",
      "# Results\n",
      "print \"Power(W)  = \", P\n",
      "\n",
      "print \"the resultant  is 16.2 W with 2 as first doutful figure\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power(W)  =  16.2944\n",
        "the resultant  is 16.2 W with 2 as first doutful figure\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.15  Page No : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the sum of resistances connected in series with appropriate number of significant figure\n",
      "\n",
      "# Variables\n",
      "R1 = 28.7;\n",
      "R2 = 3.624;\n",
      "\n",
      "# Calculations\n",
      "R = (R1+R2);\n",
      "\n",
      "# Results\n",
      "print \"sum of resistances(ohm)  = \", R\n",
      "\n",
      "print \"the resultant resistance is 32.3 ohm as one of the resistance is accurate to three significant figure\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "sum of resistances(ohm)  =  32.324\n",
        "the resultant resistance is 32.3 ohm as one of the resistance is accurate to three significant figure\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.16  Page No : 33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the voltage drop with appropriate number of significant figure\n",
      "\n",
      "# Variables\n",
      "R = 31.27;\n",
      "I = 4.37;\n",
      "\n",
      "# Calculations\n",
      "E = I*R;\n",
      "\n",
      "# Results\n",
      "print \"voltage drop(V)  = \", E\n",
      "\n",
      "print \"the voltage drop is 137 V as one of the resistance is accurate to three significant figure\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "voltage drop(V)  =  136.6499\n",
        "the voltage drop is 137 V as one of the resistance is accurate to three significant figure\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.17  Page No : 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the sensitivity and deflection factor of wheatstone bridge\n",
      "\n",
      "# Variables\n",
      "Mo = 3.;\n",
      "Mi = 7;\n",
      "\n",
      "# Calculations and Results\n",
      "Sen = Mo/Mi;\n",
      "print \"sensitivity(mm per ohm)  = \", Sen\n",
      "Df = Mi/Mo;\n",
      "print \"deflection factor( ohm per mm)  = \", Df\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "sensitivity(mm per ohm)  =  0.428571428571\n",
        "deflection factor( ohm per mm)  =  2.33333333333\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.18  Page No : 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the volume of the mercury thermometer\n",
      "\n",
      "# Calculations and Results\n",
      "Ac = (math.pi/4)*0.25**2;\n",
      "print \"Area of mercury thermometer\", Ac\n",
      "Lc = 13.8*10**3;\n",
      "Vc = Ac*Lc;\n",
      "print \"Volume of mercury thermometer(mm3)\", Vc\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Area of mercury thermometer 0.0490873852123\n",
        "Volume of mercury thermometer(mm3) 677.40591593\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.19  Page No : 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the maximum position deviation, resistance deviation \n",
      "\n",
      "# Variables\n",
      "Pl = 0.001;\n",
      "FSD = 320;\n",
      "R = 10000;\n",
      "\n",
      "# Calculations and Results\n",
      "MDD = (Pl*FSD);\n",
      "print \"Maximum lacement deviation(degree) =\",MDD\n",
      "MRD = Pl*R;\n",
      "print \"Maximum lacement deviation(ohm) = \",MRD\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum lacement deviation(degree) = 0.32\n",
        "Maximum lacement deviation(ohm) =  10.0\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.20  Page No : 41"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the dead zone\n",
      "\n",
      "# Variables\n",
      "s = 600;\n",
      "\n",
      "# Calculations\n",
      "Dz = 0.00125*s;\n",
      "\n",
      "# Results\n",
      "print \"Dead zone(degree C) = \", Dz\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dead zone(degree C) =  0.75\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.22  Page No : 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the Resolution\n",
      "\n",
      "# Variables\n",
      "Fs = 200.;\n",
      "D = 100.;\n",
      "\n",
      "# Calculations\n",
      "SD = Fs/D;\n",
      "R = SD/10;\n",
      "\n",
      "# Results\n",
      "print \"resolution (V) = \", R\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resolution (V) =  0.2\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.23  Page No : 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the Resolution\n",
      "\n",
      "# Variables\n",
      "Fs = 9.999;\n",
      "D = 9999;\n",
      "\n",
      "# Calculations\n",
      "SD = Fs/D;\n",
      "R = SD;\n",
      "\n",
      "# Results\n",
      "print \"resolution (V) = \", R\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resolution (V) =  0.001\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.24  Page No : 47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the reading of the multimeter and percentage error\n",
      "\n",
      "# Variables\n",
      "Zl = 20000.;\n",
      "Zo = 10000.;\n",
      "Eo = 6.;\n",
      "\n",
      "# Calculations and Results\n",
      "El = Eo/(1+Zo/Zl);\n",
      "print \"Reading of the multimeter (V) = \", El\n",
      "PE = ((El-Eo)/Eo)*100;\n",
      "print \"Percentage error = \", PE\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reading of the multimeter (V) =  4.0\n",
        "Percentage error =  -33.3333333333\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.25  Page No : 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the reading of the multimeter and percentage error\n",
      "\n",
      "# Variables\n",
      "Zl = 20000.;\n",
      "Zo = 1000.;\n",
      "Eo = 6;\n",
      "\n",
      "# Calculations and Results\n",
      "El = Eo/(1+Zo/Zl);\n",
      "print \"Reading of the multimeter (V) = \", El\n",
      "PE = ((El-Eo)/Eo)*100;\n",
      "print \"Percentage error = \", PE\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reading of the multimeter (V) =  5.71428571429\n",
        "Percentage error =  -4.7619047619\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.26  Page No : 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the loading error\n",
      "\n",
      "# Variables\n",
      "Zl = 1000.;\n",
      "Zo = 200*200./400;\n",
      "Eo = 100*200./400;\n",
      "\n",
      "# Calculations and Results\n",
      "El = Eo/(1+Zo/Zl);\n",
      "print \"Reading of the multimeter (V) = \", El\n",
      "PE = ((El-Eo)/Eo)*100;\n",
      "print \"Percentage loading error = \", PE\n",
      "Ac = 100+PE;\n",
      "print \"Accuracy = \", Ac\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reading of the multimeter (V) =  45.4545454545\n",
        "Percentage loading error =  -9.09090909091\n",
        "Accuracy =  90.9090909091\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.27  Page No : 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#calculating the voltage across the oscilloscope\n",
      "\n",
      "# Variables\n",
      "C = 50*10.**-6;\n",
      "\n",
      "# Calculations and Results\n",
      "f = 100000.;\n",
      "print \"frequency = \", f\n",
      "Xc = 1./(2*math.pi*f*C);\n",
      "R = 10.**6;\n",
      "Zl = (R*-1j*Xc)/(R-1j*Xc);\n",
      "Eo = 1.;\n",
      "Zo = 10.*10**3;\n",
      "\n",
      "El = Eo/(1+Zo/Zl);\n",
      "print \"Reading of the multimeter (V) = \", El\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "frequency =  100000.0\n",
        "Reading of the multimeter (V) =  (1.02334395478e-11-3.18309886181e-06j)\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.28  Page No : 55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the actual value of current, measured value of current and percentage error\n",
      "\n",
      "# Variables\n",
      "Eo = 10.-((10.*1000)/(1000+1000));\n",
      "Zo = ((1000.*1000)/(1000+1000))+500;\n",
      "\n",
      "# Calculations and Results\n",
      "Io = Eo/Zo;\n",
      "print \"Actual value of current (A) = \", Io\n",
      "Zl = 100.;\n",
      "Il = Eo/(Zo+Zl);\n",
      "print \"Measured value of current (A) = \", Il\n",
      "PE = ((Il-Io)/Io)*100;\n",
      "print \"Percentage loading error = \", PE\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Actual value of current (A) =  0.005\n",
        "Measured value of current (A) =  0.00454545454545\n",
        "Percentage loading error =  -9.09090909091\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.29  Page No : 57"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculating the maximum available power\n",
      "\n",
      "# Variables\n",
      "Eo = 80.*10**-3;\n",
      "Il = 5.*10**-9;\n",
      "Rl = 6.*10**6;\n",
      "\n",
      "# Calculations\n",
      "Ro = (Eo/Il)-Rl;\n",
      "Pmax = (Eo**2)/(4*Ro);\n",
      "\n",
      "# Results\n",
      "print \"Maximum available Power(W) = \", Pmax\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum available Power(W) =  1.6e-10\n"
       ]
      }
     ],
     "prompt_number": 32
    }
   ],
   "metadata": {}
  }
 ]
}