{
 "metadata": {
  "name": "",
  "signature": "sha256:aed91241b0d77299ff8c2e50640bc19852836cb984949d1c94dda4447fc8f7e4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11 - Power Amplifier"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 536"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Ex11_1 Pg-536\n",
      "#calculate Idc_sat,DC load,AC load,Icq,Vceq ,Efiiciency\n",
      "Vcc=15. #supply voltage in V\n",
      "R1=2.*10.**(3.) #resistor R1 in ohm\n",
      "R2=470. #resistor R2 in ohm\n",
      "Rc=680. #collector resistor in ohm\n",
      "Rl=2.7*10.**(3.) #load resistor in ohm\n",
      "Re=220. #emitter resistor\n",
      "Idc=Vcc/(Rc+Re) #saturation current\n",
      "print '%s %.1f' %(\"(1) Idc_sat = mA\",Idc*1e3) \n",
      "DCload=Rc #Dc load resistance\n",
      "print '%s %.0f' %(\"(2) DC load = ohm\",DCload)\n",
      "ACload=Rc*Rl/(Rc+Rl) #Ac load resistance \n",
      "print '%s %.0f' %(\"(3) AC load = ohm\",ACload)\n",
      "Vb=R2/(R1+R2)*Vcc #base voltage\n",
      "Icq=(Vb-0.7)/Re #collector current\n",
      "print '%s %.1f' %(\"(4) Icq = mA\",Icq*1e3)\n",
      "#answer in the book is wrong\n",
      "Vc=Vcc-Icq*Rc #collector emitter voltage\n",
      "Vceq=Vc-Icq*Re\n",
      "print '%s %.1f' %(\"(5) Vceq = V\",Vceq)\n",
      "#answer in the book is wrong\n",
      "Pac=Vcc**2./(8.*Rl) #ac power\n",
      "Pdc=Vcc*Idc #dc power\n",
      "n=Pac/Pdc*100. #efficiency\n",
      "print '%s %.0f' %(\"Efiiciency =\",n)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) Idc_sat = mA 16.7\n",
        "(2) DC load = ohm 680\n",
        "(3) AC load = ohm 543\n",
        "(4) Icq = mA 9.8\n",
        "(5) Vceq = V 6.2\n",
        "Efiiciency = 4\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 551"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Ex11_2 Pg-551\n",
      "#calculate Effective power to be transfered,Effective load,Maximum transistor voltage,Maximum transistor curren,Transformer specification\n",
      "Po=4. #power in watts\n",
      "n=80./100. #transformer efficiency in percentage\n",
      "Vcc=30. #supply voltage\n",
      "Pout=Po/n #effective power \n",
      "print '%s %.0f' %(\"Effective power to be transfered = W\",Pout)\n",
      "print '%s' %(\"\\nImpedance seen when \"\"looking into\"\" the whole winding of centertapped transformer \")\n",
      "Vp=Vcc #peak voltage\n",
      "Rload=Vp**2./(2.*Pout) \n",
      "Rload_4=4*Rload #effective load\n",
      "print '%s %.0f' %(\"\\nEffective load = ohm\",Rload_4)\n",
      "print '%s' %(\"\\nTransformer specification Po=4W,RL=16ohm,RL\"\"=360ohm\")\n",
      "Vce=2*Vcc #Maximum transistor voltage\n",
      "print '%s %.0f' %(\"\\nMaximum transistor voltage = V\",Vce)\n",
      "Ip=2*Pout/Vp #Maximum transistor current\n",
      "Ic=Ip\n",
      "print '%s %.0f' %(\"\\nMaximum transistor current = mA\",Ip*1e3)\n",
      "# answer in the book is different due to approximate value\n",
      "print '%s %.0f' %(\"\\nTransformer specification Vce=60V,Ic = mA\",Ic*1e3)\n",
      "# answer in the book is different  due to approximate value \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Effective power to be transfered = W 5\n",
        "\n",
        "Impedance seen when looking into the whole winding of centertapped transformer \n",
        "\n",
        "Effective load = ohm 360\n",
        "\n",
        "Transformer specification Po=4W,RL=16ohm,RL=360ohm\n",
        "\n",
        "Maximum transistor voltage = V 60\n",
        "\n",
        "Maximum transistor current = mA 333\n",
        "\n",
        "Transformer specification Vce=60V,Ic = mA 333\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 564"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Ex11_3 Pg-564\n",
      "#calculate Resonant frequency,Bandwidth\n",
      "import math\n",
      "L=2.*10.**(-6.) #inductance in H\n",
      "C=220.*10.**(-12.) #capacitance in F\n",
      "f0=1./(2.*math.pi*math.sqrt(L*C)) #resonant frequency (textbook answer is wrong)\n",
      "print '%s %.1f' %(\"Resonant frequency = MHz\",f0*1e-6)\n",
      "Q=125. #quality factor\n",
      "BW=f0/Q #Bandwidth (textbook answer is wrong)\n",
      "print '%s %.0f' %(\"Bandwidth = kHz\",BW*1e-3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resonant frequency = MHz 7.6\n",
        "Bandwidth = kHz 61\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 564"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Ex11_4 Pg-564\n",
      "#calculate Bias voltag,Emitter current,DC collector voltage,DC collector to emitter voltage,Power dissipation\n",
      "Vcc=10. #supply volage in V\n",
      "Rc=3600. #collector resistor in ohm\n",
      "Re=680. #emitter resistor in ohm\n",
      "Ri=10000. #input resistor in ohm\n",
      "R2=2.2 #resistor R2 in ohm\n",
      "R1=10. #resistor R1 in ohm\n",
      "Vb=R2/(R1+R2)*Vcc #bias voltage \n",
      "print '%s %.1f' %(\"(1) Bias voltage = V\",Vb)\n",
      "Ie=(Vb-0.7)/Re #emitter current\n",
      "print '%s %.2f' %(\" Emitter current = mA\",Ie*1e3)\n",
      "Vc=Vcc-Rc*Ie #Dc collector voltage\n",
      "print '%s %.2f' %(\" DC collector voltage = V\",Vc)\n",
      "Vceq=Vc-Ie*Re #DC collector to emitter voltage\n",
      "print '%s %.2f' %(\" DC collector to emitter voltage = V\",Vceq)\n",
      "Pd=Vceq*Ie #power dissipation\n",
      "print '%s %.2f' %(\" Power dissipation = mW\",Pd*1e3)\n",
      "print '%s' %(\"\\n(2)If collector resistance Rc is replaced by tank circuit there is no voltage drop across it\")\n",
      "Vc=Vcc\n",
      "print '%s %.0f' %(\" DC collector voltage = V\",Vc)\n",
      "Vceq=Vc-Ie*Re #DC collector to emitter voltage\n",
      "print '%s %.2f' %(\" DC collector to emitter voltage = V\",Vceq)\n",
      "Pd=Vceq*Ie #power dissipation\n",
      "print '%s %.2f' %(\" Power dissipation = mW\",Pd*1e3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) Bias voltage = V 1.8\n",
        " Emitter current = mA 1.62\n",
        " DC collector voltage = V 4.16\n",
        " DC collector to emitter voltage = V 3.06\n",
        " Power dissipation = mW 4.96\n",
        "\n",
        "(2)If collector resistance Rc is replaced by tank circuit there is no voltage drop across it\n",
        " DC collector voltage = V 10\n",
        " DC collector to emitter voltage = V 8.90\n",
        " Power dissipation = mW 14.43\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 565"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Ex11_5 Pg-565\n",
      "#calculate The peak value,peak-to-peak value of input voltage,Base to ground voltage\n",
      "import math\n",
      "Vin=5. #input voltage\n",
      "Vp=Vin*math.sqrt(2.) #peak voltage\n",
      "print '%s' %(\"The peak value(maximum amplication) of input signal\")\n",
      "print '%s %.2f' %(\"= V\",Vp)\n",
      "Vin_pp=2*Vp #peak-to-peak value of input voltage\n",
      "print '%s' %(\"\\nPeak-to-peak value of input voltage\")\n",
      "print '%s %.2f' %(\"= V\",Vin_pp)\n",
      "Vbg=-1*(Vp-0.7) #base to ground voltage 0.7 is the voltage drop\n",
      "print '%s %.2f' %(\"\\nBase to ground voltage = V\",Vbg)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The peak value(maximum amplication) of input signal\n",
        "= V 7.07\n",
        "\n",
        "Peak-to-peak value of input voltage\n",
        "= V 14.14\n",
        "\n",
        "Base to ground voltage = V -6.37\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}