{
 "metadata": {
  "name": "",
  "signature": "sha256:ba40baa44e757ea3e91ab8f89704f149291740011280e5a0d9caa508edb83db1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter - 4 : Analog Electronic Meters"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 - Page No : 86\n",
      " "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "V_CC= 12 # in volt\n",
      "V_BE=0.7 #in volt\n",
      "Rsm=4.3 #value o Rs+Rm in kohm\n",
      "I=1 #in mA\n",
      "\n",
      "# Part (i)\n",
      "V= 5 #in volt\n",
      "V_E= V-V_BE # in volt\n",
      "Im= V_E/Rsm # in mA\n",
      "I_E=Im # in mA\n",
      "print \"Meter Current = %0.f mA\" %Im\n",
      "\n",
      "# Part(ii)\n",
      "h_FE= 100 \n",
      "Im=Im*10**-3 #in amp\n",
      "I_B= Im/h_FE # in amp\n",
      "Rin= V/I_B # in ohm\n",
      "print \"Input resistance with transistor = %0.f kohm\" %(Rin*10**-3)\n",
      "# without transistor\n",
      "Rin= Rsm \n",
      "print \"Input resistance without transistor = %0.1f kohm\" %Rin\n",
      "\n",
      "# Part(iii)\n",
      "V=2.5 # in volt\n",
      "V_E= V-V_BE # in volt\n",
      "Im= V_E/Rsm # in mA\n",
      "I_E=Im # in mA\n",
      "print \"Meter current when the dc input voltage is 2.5 volt = %0.2f mA\" %Im"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Meter Current = 1 mA\n",
        "Input resistance with transistor = 500 kohm\n",
        "Input resistance without transistor = 4.3 kohm\n",
        "Meter current when the dc input voltage is 2.5 volt = 0.42 mA\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 - Page No : 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " #Given data\n",
      "V_CC= 12 # in volt\n",
      "V_BE=0.7 #in volt\n",
      "R_E1=3.3 # in kohm\n",
      "V_EE= -12 # in volt\n",
      "# Part (a) when V=0\n",
      "V= 0 #in volt\n",
      "V_E1= V-V_BE-V_EE # in volt\n",
      "I_E1= V_E1/R_E1 # in mA\n",
      "print \"Emitter current when input voltage is zero volt = %0.1f mA\" %I_E1\n",
      "\n",
      "# Part(b)\n",
      "# Part (i) when V=2 volt\n",
      "V= 2 #in volt\n",
      "V_P=0 \n",
      "V_E1= V-V_BE # in volt\n",
      "V_E2= V_P-V_BE # in volt\n",
      "Vm= V_E1-V_E2 # in volt\n",
      "print \"Meter circuit voltage when input voltage is 2 volt = %0.f V\" %Vm\n",
      "\n",
      "# Part (ii) when V=1 volt\n",
      "V= 1 #in volt\n",
      "V_P=0 \n",
      "V_E1= V-V_BE # in volt\n",
      "V_E2= V_P-V_BE # in volt\n",
      "Vm= V_E1-V_E2 # in volt\n",
      "print \"Meter circuit voltage when input voltage is 1 volt = %0.f V\" %Vm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Emitter current when input voltage is zero volt = 3.4 mA\n",
        "Meter circuit voltage when input voltage is 2 volt = 2 V\n",
        "Meter circuit voltage when input voltage is 1 volt = 1 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 - Page No : 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " #Given data\n",
      "Im= 200 # in micro A\n",
      "Im=Im*10**-6 # in amp\n",
      "Rm= 5 # in kohm\n",
      "Rm=Rm*10**3 # in ohm\n",
      "I_B= 0.5 # in micro amp\n",
      "I_B=I_B*10**-6 # in amp\n",
      "V=25 # in mV\n",
      "V=V*10**-3 # in volt\n",
      "Vout= Im*Rm # in volt\n",
      "I= 500*I_B # in amp\n",
      "R1= V/I # in ohm\n",
      "print \"The value of resistor = %0.f ohm\" %R1\n",
      "Rf= (Vout-V)/I # in ohm\n",
      "print \"Feedback resistor = %0.1f kohm\" %(Rf*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of resistor = 100 ohm\n",
        "Feedback resistor = 3.9 kohm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5 - Page No : 93"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " #Given data\n",
      "Im= 1 # in mA\n",
      "Im=Im*10**-3 # in amp\n",
      "Rm= 100 # in ohm\n",
      "V=1.2 # in volt\n",
      "R1= V/Im # in ohm\n",
      "print \"The value of resistance = %0.1f kohm\" %(R1*10**-3)\n",
      "Vout= Im*(Rm+R1) # in volt\n",
      "print \"Output voltage = %0.1f V\" %Vout"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of resistance = 1.2 kohm\n",
        "Output voltage = 1.3 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6 - Page No : 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt \n",
      "#Given data\n",
      "Vrms=120 # in mV\n",
      "Iav= 1.25 # in mA\n",
      "I_max= 1/0.318*Iav # in mA\n",
      "Vmax= sqrt(2)*Vrms # in mV\n",
      "R2= Vmax/I_max # in ohm\n",
      "print \"Value of R2 = %0.1f ohm\" %R2\n",
      "# when input voltage is 60 volt\n",
      "Vrms=60 # in mV\n",
      "Vmax= sqrt(2)*Vrms # in mV\n",
      "I_max= Vmax/R2 # in mA\n",
      "Iav= I_max*0.318 # in mA\n",
      "print \"Average value of meter current = %0.3f mA\" %Iav"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of R2 = 43.2 ohm\n",
        "Average value of meter current = 0.625 mA\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}