{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 18: ELECTRICAL MEASURING INSTRUMENTS\n",
      "\n",
      "\n",
      "\n"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.1,Page number: 598\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the deflecting torque in Newton-metres for a PMMC instrument.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "I=15e-03              #Current flowing through the coil(in Amperes) \n",
      "B=0.2                 #Flux density in the air gap(in Tesla)\n",
      "l=2e-02               #Length of the magnetic field(in m)\n",
      "d=2.5e-02             #Mean width of the coil(in m) \n",
      "r=d/2                 #Radius of the coil(in cm) \n",
      "n1=42                 #Number of turns(lower limit) \n",
      "n2=43                 #Number of turns(upper limit)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "F1=I*B*l*n1\n",
      "F2=I*B*l*n2\n",
      "net_torque=(F1+F2)*r\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The deflecting torque is %e Nm.\" %(net_torque)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflecting torque is 6.375000e-05 Nm.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.2,Page Number: 604\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the shunt resistance for measuring a maximum current of 10 mA.\"\"\"     \n",
      "\n",
      "#Variable Declaration:\n",
      "Ifsd=10e-03           #Maximum current(in Amperes)\n",
      "Im=100e-06            #Full-scale deflection current(in Amperes)  \n",
      "Rm=100                #Meter Resistance(in Ohms)  \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Ish=Ifsd-Im\n",
      "Rsh=(Im*Rm)/Ish\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The shunt resistance needed is %.6f Ohms.\" %(Rsh)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The shunt resistance needed is 1.010101 Ohms.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.3,Page number: 605"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Designing an universal shunt for a multi-range ammeter.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "Im=100e-06            #Full-scale deflection current(in Amperes)\n",
      "Rm=100.0              #Internal resistance(in Ohms)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\"For 1-mA range,the required shunt can be calculated as follows.\"\"\"\n",
      "Ifsd=1e-03\n",
      "Rsh=(Im*Rm)/(Ifsd-Im)\n",
      "\n",
      "Rm=900.0\n",
      "R=100.0\n",
      "\"\"\"(a)Range-switch at 1 mA:\"\"\"\n",
      "Rm1=Rm\n",
      "Ish1=(1e-03)-(0.1e-03)\n",
      "Rsh1=(Rm1*Im)/(Ish1)\n",
      "\n",
      "\"\"\"(b)Range-switch at 10 mA:\"\"\"\n",
      "\"\"\"Rm2=Rm+R1\"\"\"\n",
      "Ish2=(10e-03)-(0.1e-03)\n",
      "\"\"\"Rsh2=R2+R3+R4+R5=R-R1=100-R1;\"\"\"\n",
      "\"\"\"Rsh2=(Rm2*Im)/Ish2;\"\"\"\n",
      "R1=(9900.0-900.0)/100.0\n",
      "\n",
      "\"\"\"(c)Range-switch at 100 mA:\"\"\"\n",
      "\"\"\"Rm3=Rm+R1+R2\"\"\"\n",
      "Ish3=(100e-03)-(0.1e-03)\n",
      "\"\"\"Rsh3=R3+R4+R5=R-R1-R2=100-90-R2=90-R2;\"\"\"\n",
      "\"\"\"Rsh3=(Rm3*Im)/Ish3;\"\"\"\n",
      "R2=(9990.0-990.0)/1000.0\n",
      "\n",
      "\"\"\"(d)Range-switch at 500 mA:\"\"\"\n",
      "\"\"\"Rm4=Rm+R1+R2+R3\"\"\"\n",
      "Ish3=(500e-03)-(0.1e-03)\n",
      "\"\"\"Rsh4=R4+R5=R-R1-R2-R3=100-90-9-R3=1-R3;\"\"\"\n",
      "\"\"\"Rsh4=(Rm4*Im)/Ish4;\"\"\"\n",
      "R3=(4999.0-999.0)/5000.0\n",
      "\n",
      "\n",
      "\"\"\"(e)Range-switch at 1 A:\"\"\"\n",
      "\"\"\"Rm5=Rm+R1+R2+R3+R4\"\"\"\n",
      "Ish3=(1000e-03)-(0.1e-03)\n",
      "\"\"\"Rsh5=R5=R-R1-R2-R3-R4=100-90-9-0.8-R4=0.2-R4;\"\"\"\n",
      "\"\"\"Rsh5=(Rm5*Im)/Ish5;\"\"\"\n",
      "R4=(1999.8-999.8)/10000.0\n",
      "R5=R-R1-R2-R3-R4\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The resistor values are: \"\n",
      "print \"R1=%.2f Ohms.\" %(R1)\n",
      "print \"R2=%.2f Ohms.\" %(R2)\n",
      "print \"R3=%.2f Ohms.\" %(R3)\n",
      "print \"R4=%.2f Ohms.\" %(R4)\n",
      "print \"R5=%.2f Ohms.\" %(R5)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resistor values are: \n",
        "R1=90.00 Ohms.\n",
        "R2=9.00 Ohms.\n",
        "R3=0.80 Ohms.\n",
        "R4=0.10 Ohms.\n",
        "R5=0.10 Ohms.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.4,Page number: 609"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"To convert a d'Arsonval meter movement into a voltmeter.\"\"\" \n",
      "\n",
      "#Variable Declaration:\n",
      "Im=100e-06            #Current sensitivity(in Amperes)\n",
      "Rm=100                #Resistance of the coil(in Ohms)\n",
      "Vfsd=100              #Full-scale deflection of voltmeter(in Volts) \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Rs=(Vfsd/Im)-Rm\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"To convert the d'Arsonval meter movement into a voltmeter of range 100V, we connect a resistor Rs in series.\"\n",
      "print \"Rs = %.3f kilo Ohms. \" %(Rs/1000)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "To convert the d'Arsonval meter movement into a voltmeter of range 100V, we connect a resistor Rs in series.\n",
        "Rs = 999.900 kilo Ohms. \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.5,Page number: 609\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the multipiler resistance and the voltage mutiplyiing factor of a dc voltmeter.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "Im=50e-06             #Full-scale deflection current(in Amperes)  \n",
      "Rm=1e03               #Meter Resistance(in Ohms) \n",
      "Vfsd=50               #Full-scale deflection of voltmeter(in Volts)     \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Rs=(Vfsd/Im)-Rm\n",
      "n=Vfsd/(Im*Rm)\n",
      "\n",
      "#Result:\n",
      "print \"(a)The multiplier resistance needed is %.2f kilo Ohms.\" %(Rs/1000)\n",
      "print \"(b)The voltage multiplying factor is %d.\" %(round(n,0))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The multiplier resistance needed is 999.00 kilo Ohms.\n",
        "(b)The voltage multiplying factor is 1000.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.6,Page number: 612"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the reading and error in measurement of voltmeter.\"\"\"\n",
      "    \n",
      "\"\"\" NOTE: All resistances expressed in kilo Ohms.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "range_A=50            #Range of voltmeter-A(in Volts)\n",
      "range_B=50            #Range of voltmeter-B(in Volts)\n",
      "sens_A=1000           #Sensitivity of voltmeter-A(in Ohm/Volts)  \n",
      "sens_B=20000          #Sensitivity of voltmeter-B(in Ohm/Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Vt=150.0*(50.0/(100.0+50.0))\n",
      "R_i1=(range_A*sens_A)/1000.0\n",
      "Req=1/((1/R_i1)+(1.0/50))\n",
      "V1=(150.0)*(Req/(100+Req))\n",
      "R_i2=(range_B*sens_B)/1000.0\n",
      "Req=1/((1/R_i2)+(1.0/50))\n",
      "V2=(150.0)*(Req/(Req+100))\n",
      "err_A=((Vt-V1)/Vt)*100.0\n",
      "err_B=((Vt-V2)/Vt)*100.0\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The reading of voltmeter-A is %.2f V\\nThe reading of voltmeter-B is %.2f V.\" %(V1,V2)\n",
      "print \"\\nThe error in the reading of voltmeter-A is %.2f percent.\" %(err_A)\n",
      "print \"The error in the reading of voltmeter-B is %.2f percent.\" %(err_B)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reading of voltmeter-A is 30.00 V\n",
        "The reading of voltmeter-B is 48.39 V.\n",
        "\n",
        "The error in the reading of voltmeter-A is 40.00 percent.\n",
        "The error in the reading of voltmeter-B is 3.23 percent.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.7,Page number: 617"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the deflection in an ammeter.\"\"\"\n",
      "\n",
      "from math import sin,asin,degrees,pow\n",
      "\n",
      "#Variable Declaration:\n",
      "I1=20.0               #Initial current(in Amperes) \n",
      "I2=12.0               #Final current(in Amperes)\n",
      "angle1=60             #Initial deflection(in degrees)\n",
      "\"\"\" Given: Deflecting torque is directly proportional to the current.\"\"\"\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\"For spring control:  Controlling torque is directly proportional to deflection.\n",
      "                        For steady state deflection, controlling torque=deflecting torque.\n",
      "                        Therefore,deflection is directly proportional to current. \"\"\"\n",
      "angle2_a=(I2/I1)*angle1\n",
      "\"\"\"For gravity control: Controlling torque is directly proportional to sine of the deflection angle.\n",
      "                        For steady state deflection, controlling torque=deflecting torque.\n",
      "                        Therefore,sine of the angle of deflection is directly proportional to the current. \"\"\"  \n",
      "angle2_b=asin((I2/I1)*sin(radians(angle1)))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The deflection for a current of 12A when the instrument is spring controlled is %.2f degrees.\" %(angle2_a) \n",
      "print \"(b)The deflection for a current of 12A when the instrument is gravity controlled is %.2f degrees.\" %(degrees(angle2_b)) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The deflection for a current of 12A when the instrument is spring controlled is 36.00 degrees.\n",
        "(b)The deflection for a current of 12A when the instrument is gravity controlled is 31.31 degrees.\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.8,Page number: 618"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the deflection in degrees in a gravity-controlled instrument.\"\"\"\n",
      "\n",
      "from math import asin,degrees\n",
      "\n",
      "#Variable Declaration:\n",
      "W=0.005               #Controlling weight(in kilograms)\n",
      "l=2.4e-02             #Distance of controlling weight from the axis(in metres)\n",
      "torque=1.05e-04       #Deflecting torque(in kg-m)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "angle=asin(torque/(W*l))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The deflection corresponding to a deflecting torque of 1.05e-04 kg-m is %.2f degrees.\" %(degrees(angle))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflection corresponding to a deflecting torque of 1.05e-04 kg-m is 61.04 degrees.\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.9,Page number: 618"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the deflection in an ammeter.\"\"\"\n",
      "\n",
      "from math import sin,asin,degrees,pow\n",
      "\n",
      "#Variable Declaration:\n",
      "I1=10.0               #Initial current(in Amperes) \n",
      "I2=5.0                #Final current(in Amperes)\n",
      "angle1=90             #Initial deflection(in degrees)\n",
      "\"\"\" Given: Deflecting torque is directly proportional to square of the current.\"\"\"\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\"For spring control:  Controlling torque is directly proportional to deflection.\n",
      "                        For steady state deflection, controlling torque=deflecting torque.\n",
      "                        Therefore,deflection is directly proportional to square of the current. \"\"\"\n",
      "angle2_a=pow((I2/I1),2)*angle1\n",
      "\"\"\"For gravity control: Controlling torque is directly proportional to sine of the deflection angle.\n",
      "                        For steady state deflection, controlling torque=deflecting torque.\n",
      "                        Therefore,sine of the angle of deflection is directly proportional to square of the current. \"\"\"  \n",
      "angle2_b=asin((pow((I2/I1),2))*sin(radians(angle1)))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The deflection for a current of 5A when the instrument is spring controlled is %.2f degrees.\" %(angle2_a) \n",
      "print \"(b)The deflection for a current of 5A when the instrument is gravity controlled is %.2f degrees.\" %(degrees(angle2_b))   "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The deflection for a current of 5A when the instrument is spring controlled is 22.50 degrees.\n",
        "(b)The deflection for a current of 5A when the instrument is gravity controlled is 14.48 degrees.\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18.10,Page number: 619 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the current required to produce a deflection of 60 degrees in a moving coil instrument.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "w=4e-02                 #Width of the coil(in metres)\n",
      "l=5e-02                 #Length of the coil(in metres)\n",
      "N=80.0                  #Number of turns in the coil\n",
      "torque_control=0.5e-07  #Controlling torque per degree deflection of the coil(in Nm)\n",
      "B=0.1                   #Magnetic flux density in the air gap(in Wb per square-metre)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "A=w*l\n",
      "torque_c=torque_control*60.0\n",
      "I=torque_c/(B*N*A)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The current required to give a deflection of 60 degrees is %e A.\" %(I)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current required to give a deflection of 60 degrees is 1.875000e-04 A.\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}