{
 "metadata": {
  "name": "",
  "signature": "sha256:3ec304c8c9eb23fdd2ae23967a8effd62df3acdefa633ca8bf2a83485250a21b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 Electrical Measurements"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page no 229"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R1=2\n",
      "R2=3\n",
      "R3=5\n",
      "E1=6\n",
      "E2=4\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[7,5],[5,8]])\n",
      "b=np.array([6,4])\n",
      "z=np.linalg.solve(A,b)\n",
      "Z=z[0]\n",
      "Z1=z[1]\n",
      "A1=Z+Z1\n",
      "\n",
      "#Result\n",
      "print\"Current through R1 is\", round(Z,3),\"A\"\n",
      "print\"Current through R2 is\", round(Z1,3),\"A\"\n",
      "print\"Current through R3 is\",round(A1,2),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current through R1 is 0.903 A\n",
        "Current through R2 is -0.065 A\n",
        "Current through R3 is 0.84 A\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page no 229"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E1=1.5                    #V\n",
      "E2=2.0                    #V\n",
      "r1=1                      #ohm\n",
      "r2=2                      #ohm\n",
      "R=5                       #ohm\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[6,5],[5,7]])\n",
      "B=np.array([1.5,2])\n",
      "Z=np.linalg.solve(A,B)\n",
      "Z1=Z[0]\n",
      "Z2=Z[1]\n",
      "A1=(Z1+Z2)*R\n",
      "\n",
      "#Result\n",
      "print\"Current through R1 is\", round(Z1,4),\"A\"\n",
      "print\"Current through R2 is\",round(Z2,4),\"A\"\n",
      "print\"Current through R3 is\",round(A1,4),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current through R1 is 0.0294 A\n",
        "Current through R2 is 0.2647 A\n",
        "Current through R3 is 1.4706 A\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page no 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E1=2                        #V\n",
      "E2=1                        #V\n",
      "E3=4                        #V\n",
      "r1=4                        #ohm\n",
      "r2=3                        #ohm\n",
      "r3=2                        #ohm\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[1,1,1],[4,-3,0],[0,3,-2]])\n",
      "A1=np.array([0,1,-3])\n",
      "Z=np.linalg.solve(A,A1)\n",
      "Z1=Z[0]\n",
      "Z2=Z[1]\n",
      "Z3=Z[2]\n",
      "\n",
      "#Result\n",
      "print\"Current through R1 is\", round(Z1,2),\"A\"\n",
      "print\"Current through R2 is\",round(Z2,2),\"A\"\n",
      "print\"Current through R3 is\",round(Z3,2),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current through R1 is -0.15 A\n",
        "Current through R2 is -0.54 A\n",
        "Current through R3 is 0.69 A\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page no 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R1=5                   #ohm\n",
      "R3=2 \n",
      "R=10\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[9,5],[10,19]])\n",
      "A1=np.array([1,1])\n",
      "Z=np.linalg.solve(A,A1)\n",
      "Z1=Z[0]\n",
      "Z2=Z[1]\n",
      "I=(Z1+Z2)*R\n",
      "\n",
      "#Result\n",
      "print\"Potential difference across the resistor is\", round(I,4),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Potential difference across the resistor is 1.0744 V\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page no 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "A=10                              #ohm\n",
      "B=5                               #ohm\n",
      "S=2\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[25,-10],[5,5]])\n",
      "B=np.array([9,7])    \n",
      "Z=np.linalg.solve(A,B)\n",
      "Z1=Z[1]*10\n",
      "\n",
      "#Result\n",
      "print\"Equivalent resistance is\", round(Z1,0),\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equivalent resistance is 7.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6 Page no 231 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "P=15                              #ohm\n",
      "Q=12.0\n",
      "R=10.0\n",
      "S=4\n",
      "\n",
      "#Calculation\n",
      "R1=S*(P/Q)\n",
      "X=1/(1/R1-1/R)\n",
      "\n",
      "#Result\n",
      "print\"The resistance to be connectedin parallel is\",X,\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resistance to be connectedin parallel is 10.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7 Page no 231"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "P=4.0\n",
      "Q=4.0\n",
      "R=4.0\n",
      "X=4.0\n",
      "\n",
      "#Calculation\n",
      "R1=P+Q\n",
      "R2=R+X\n",
      "R3=1/(1/R1+1/R2)\n",
      "I=P/R3\n",
      "I1=I/2\n",
      "\n",
      "#Result\n",
      "print\"(i) Equivalent resistance is\",R3,\"ohm\"\n",
      "print\"(ii) The magnitudes of current is\",I1,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Equivalent resistance is 4.0 ohm\n",
        "(ii) The magnitudes of current is 0.5 A\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.8 Page no 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=4\n",
      "b=3\n",
      "c=2.0\n",
      "E=6                   #v\n",
      "\n",
      "#Calculation\n",
      "X=(a*b)/c\n",
      "R1=a+c\n",
      "R2=b+R1\n",
      "R=((R1*R2)/(R1+R2))+2.4\n",
      "I=E/R\n",
      "\n",
      "#Result\n",
      "print\"Current drawn by the circuit is\", I,\"A\"\n",
      "print\"Unknown resistance is\",R,\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current drawn by the circuit is 1.0 A\n",
        "Unknown resistance is 6.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.9 Page no 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=1.5\n",
      "b=5\n",
      "c=6\n",
      "\n",
      "#Calculation\n",
      "I1=a/(b+c)\n",
      "I2=I1/10.0\n",
      "I=I1+I2\n",
      "\n",
      "#Result\n",
      "print\"Current in the arms is\", round(I1,4),\"A and\",round(I2,4),\"A\"\n",
      "print\"Current in the cell is\",I,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current in the arms is 0.1364 A and 0.0136 A\n",
        "Current in the cell is 0.15 A\n"
       ]
      }
     ],
     "prompt_number": 68
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.10 Page no 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "X=10\n",
      "P=3\n",
      "Q=2.0\n",
      "\n",
      "#Calculation\n",
      "R=X*P/Q\n",
      "L=1/R\n",
      "\n",
      "#Result\n",
      "print\"Length is\",round(L,3),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length is 0.067 m\n"
       ]
      }
     ],
     "prompt_number": 71
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.11 Page no 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "r=6                        #ohm\n",
      "l=1/3.0\n",
      "r1=2/3.0\n",
      "\n",
      "#Calculation\n",
      "R1=r/((2.0*(r1/l))-1)\n",
      "R2=2*R1\n",
      "\n",
      "#Result\n",
      "print\"Resistance of two wires is\", R1,\"ohm and\",R2,\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance of two wires is 2.0 ohm and 4.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 76
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.12 Page no 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "P=1.2                        #ohm\n",
      "Q=0.8\n",
      "R=2\n",
      "E=4                              #V\n",
      "\n",
      "#Calculation\n",
      "X=(R*P)/Q\n",
      "R1=X+R\n",
      "R2=P+Q\n",
      "R11=R1*R2/(R1+R2)\n",
      "I=E/R11\n",
      "\n",
      "#Result\n",
      "print\"Unknown resistance is\", X,\"ohm\"\n",
      "print\"Current drawn is\",I,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Unknown resistance is 3.0 ohm\n",
        "Current drawn is 2.8 A\n"
       ]
      }
     ],
     "prompt_number": 83
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.13 Page no 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R=20.0                     #ohm\n",
      "V=10**-3                  #V/m\n",
      "l=10**4                   #mm\n",
      "V1=10**-2                     #V\n",
      "\n",
      "#Calculation\n",
      "I=V1/R\n",
      "R1=(2/I)-R\n",
      "\n",
      "#Result\n",
      "print\"Value of resistance is\", R1,\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of resistance is 3980.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 87
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.14 Page no 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "l1=65                    #cm\n",
      "l2=60.0\n",
      "a=0.1\n",
      "\n",
      "#Calculation\n",
      "E1=((a*l1)/l2)/((l1/l2)-1)\n",
      "E2=E1-a\n",
      "\n",
      "#Result\n",
      "print\"E.m.f of cell is\", E1,\"V and\",E2,\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E.m.f of cell is 1.3 V and 1.2 V\n"
       ]
      }
     ],
     "prompt_number": 93
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.15 Page no 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "S=9.5                 #ohm\n",
      "I1=76.3               #cm\n",
      "l2=64.8\n",
      "\n",
      "#Calculation\n",
      "r=((I1/I2)-1)*S\n",
      "\n",
      "#Result\n",
      "print\"Internal resistance is\",round(r*10**-3,1),\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Internal resistance is 53.1 ohm\n"
       ]
      }
     ],
     "prompt_number": 138
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.16 Page no 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E=10*10**-3  \n",
      "r=10\n",
      "l=40                  #cm\n",
      "\n",
      "#Calculation\n",
      "R=10*l/100.0\n",
      "R1=(R*2/E)-10\n",
      "\n",
      "#Result\n",
      "print\"External resistance is\", R1,\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "External resistance is 790.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 111
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.17 Page no 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R1=10*10**3\n",
      "E=12\n",
      "\n",
      "#Calculation\n",
      "R=R1/((E/2.0)-1)\n",
      "\n",
      "#Result\n",
      "print\"(a) Resistance is\",R*10**-3,\"K ohm\"\n",
      "print\"(b) When current flows through a resistor,its temperature increases due toheat produced across it.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Resistance is 2.0 K ohm\n",
        "(b) When current flows through a resistor,its temperature increases due toheat produced across it.\n"
       ]
      }
     ],
     "prompt_number": 116
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.18 Page no 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=3.0\n",
      "b=6.0\n",
      "\n",
      "#Caculation\n",
      "E=(1/a)+(1/b)+1+(1/a)\n",
      "\n",
      "#Result\n",
      "print\"Equivalent resistance is\",round(E,2),\"r\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equivalent resistance is 1.83 r\n"
       ]
      }
     ],
     "prompt_number": 120
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.22 Page no 237"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=5\n",
      "b=10\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=np.array([[7,1],[1,5]])\n",
      "A1=np.array([2,2])\n",
      "B=np.linalg.solve(A,A1)\n",
      "B1=B[0]\n",
      "B2=B[1]\n",
      "E=(a*B2)+(B1*b)\n",
      "\n",
      "#Result\n",
      "print\"Equivalent resistance is\", round(E,2),\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equivalent resistance is 4.12 ohm\n"
       ]
      }
     ],
     "prompt_number": 125
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.23 Page no 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R=12.5\n",
      "l=39.5\n",
      "\n",
      "#Calculation\n",
      "X=(R*(100-l))/l\n",
      "L=X/(X+R)\n",
      "\n",
      "#Result\n",
      "print\"(a) Resistance is\",round(X,2),\"W\"\n",
      "print\"(b) Balance point of bridge is\", L*10**2,\"cm\"\n",
      "print\"(c) The galvanometer will not show any current.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Resistance is 19.15 W\n",
        "(b) Balance point of bridge is 60.5 cm\n",
        "(c) The galvanometer will not show any current.\n"
       ]
      }
     ],
     "prompt_number": 135
    }
   ],
   "metadata": {}
  }
 ]
}