{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 08 : The Transistor at Low Frequency"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2, Page No 251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Rl=10.0   #in K\n",
      "Rs=1.0        #in K\n",
      "hie=1.1       #in K\n",
      "hre=2.5*(10**-4) \n",
      "hfe=50.0\n",
      "hoe=25*(10**-3)            #in K^-1\n",
      "\n",
      "#Calculations\n",
      "Ai= -hfe/(1+(hoe*Rl))                     #Current Gain or Current Amplification\n",
      "print(\"Ai= %.2f  \" %Ai)\n",
      "\n",
      "Ri = hie + (hre*Rl*Ai)\n",
      "print(\"Ri= %.2f K\" %Ri)\n",
      "\n",
      "Av=(Ai*Rl)/Ri            #Voltage Gain\n",
      "print(\"Av= %.2f  \" %Av)\n",
      "\n",
      "Avs=(Av*Ri)/(Ri+Rs)            #Overall Voltage Gain taking source resistance into account\n",
      "print(\"Avs= %.2f  \" %Avs)\n",
      "\n",
      "Ais=(Ai*Rs)/(Ri+Rs)           #Overall current gain taking source resistance into account\n",
      "print(\"Ais= %.2f  \" %Ais)\n",
      "\n",
      "#Results\n",
      "Yo=hoe-((hfe*hre)/(hie+Rs))          #Admittance\n",
      "print(\"Yo= %.2f K^-1 \" %Yo)\n",
      "\n",
      "Zo = 1.0/Yo          #Impedence\n",
      "print(\"Zo= %.2f K \" %Zo)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ai= -40.00  \n",
        "Ri= 1.00 K\n",
        "Av= -400.00  \n",
        "Avs= -200.00  \n",
        "Ais= -20.00  \n",
        "Yo= 0.02 K^-1 \n",
        "Zo= 52.50 K \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3, Page No 251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "\n",
      "#Yo = I/Vo\n",
      "#When current in a short circuit placed across the output terminals and V is the open circuit voltage\n",
      "print('When current in a short circuit placed across the output terminals and V is the open circuit voltage')\n",
      "print('I = -hf*I1=-(hf*Vs)/(Rs+hi)')\n",
      "#Applying KVL\n",
      "print('Vs = I1*(Rs+hi)+hr*V = -ho*V*(Rs+hi)/hf+hr*V')\n",
      "print('or')\n",
      "print('V = -(hf*Vs/(Rs+hi))/(ho-hf*hr(Rs+hi))')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "When current in a short circuit placed across the output terminals and V is the open circuit voltage\n",
        "I = -hf*I1=-(hf*Vs)/(Rs+hi)\n",
        "Vs = I1*(Rs+hi)+hr*V = -ho*V*(Rs+hi)/hf+hr*V\n",
        "or\n",
        "V = -(hf*Vs/(Rs+hi))/(ho-hf*hr(Rs+hi))\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4 Page No 252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "\n",
      "hie=1.1#in K\n",
      "hre=2.5*(10^-4)\n",
      "hfe=50\n",
      "hoe=25*(10^-3)#in K^-1\n",
      "r=200#in K\n",
      "Rs=10#in K\n",
      "Ri=1#in K\n",
      "Rl=10#in K\n",
      "\n",
      "#Calculations\n",
      "rl=(r*Rs)/(r+Rs)#in K\n",
      "\n",
      "Ai = -hfe/(1+(hoe*rl))#Current Gain\n",
      "print(\"Ai =  %.2f \" %Ai)\n",
      "\n",
      "Ri = hie + (hre*Ai*rl)\n",
      "print(\"Ri =  %.2f K\" %Ri)\n",
      "\n",
      "Av=(Ai*rl)/Ri#Voltage Gain\n",
      "print(\"Av = %.2f \" %Av)\n",
      "\n",
      "k = r/(1-Av)\n",
      "ri = (Ri*k)/(Ri+k)\n",
      "print(\"ri =  %.2f K\" %ri)\n",
      "\n",
      "\n",
      "#Results\n",
      "Avs = Av*(ri/(ri+Rs))#Overall voltage Gain taking Source resistance into account\n",
      "print(\"Avs = %.2f \" %Avs)\n",
      "\n",
      "ai = Avs*((ri+Rs)/Rl)\n",
      "print(\"ai = -I2/I1 =  %.2f \" %ai)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ai =  0.00 \n",
        "Ri =  1.10 K\n",
        "Av = 0.00 \n",
        "ri =  1.09 K\n",
        "Avs = 0.00 \n",
        "ai = -I2/I1 =  0.00 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5, Page No 254"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "hie = 2#in K\n",
      "hfe = 50\n",
      "hre = 6*(10^-4)\n",
      "hoe = 25*(10^-3)#in K^-1\n",
      "hic=2#in K\n",
      "hfc=-51\n",
      "hrc=1\n",
      "hoc=25*(10^-3)#/in K^-1\n",
      "Re2=5#in K\n",
      "Rs=1#in K\n",
      "Rc1=5#in K\n",
      "\n",
      "#The Second Stage\n",
      "\n",
      "#Calculations\n",
      "Rl = Re2\n",
      "Ai2 = -hfc/(1+(hoc*Re2))#Current Gain in @nd Transistor\n",
      "print(\"Ai2 = %.2f \" %Ai2)\n",
      "\n",
      "Ri2 = hic + (hrc*Ai2*Re2)\n",
      "print(\"Ri2 = %.2f K\" %Ri2)\n",
      "\n",
      "Av2 = (Ai2*Re2)/Ri2#Voltage Gain in 2nd Transistor\n",
      "print(\"Av2 = %.2f \" %Av2)\n",
      "\n",
      "#The First Stage\n",
      "\n",
      "Rl1 = (Rc1*Ri2)/(Rc1+Ri2)\n",
      "print(\"Rl1 = %.2f K\" %Rl1)\n",
      "\n",
      "\n",
      "Ai1 = -hfe/(1+(hoe*Rl1))#Current Gain in 1st Transistor\n",
      "print(\"Ai1 = %.2f \" %Ai1)\n",
      "\n",
      "Ri1 = hie + (hre*Ai1*Rl1)\n",
      "print(\"Ri1 = %.2f K\" %Ri1)\n",
      "\n",
      "Av1 = (Ai1*Rl1)/Ri1#Voltage Gain in 1st Transistor\n",
      "print(\"Av1 = %.2f \" %Av1)\n",
      "\n",
      "print('The output Admittance of Transistor')\n",
      "Yo1 = hoe - ((hfe*hre)/(hie+Rs))\n",
      "print(\"Yo= %.2f K^-1 \" %Yo)\n",
      "\n",
      "Ro1 = 1/Yo1\n",
      "\n",
      "#Output Impedence of First Stage\n",
      "print('Output Impedence of First Stage')\n",
      "ro1 = (Ro1*Rc1)/(Ro1+Rc1)\n",
      "print(\"ro1= %.2f K \" %ro1)\n",
      "rs2 = ro1\n",
      "\n",
      "Yo2 = hoc - ((hfc*hrc)/(hic+rs2))\n",
      "print(\"Yo2= %.2f K^-1 \" %Yo2)\n",
      "\n",
      "A1 = (Ai2*Ai2*Rc1)/(Ri2+Rc1)#Overall Current gain\n",
      "print(\"A1 = %.2f \" %A1)\n",
      "\n",
      "Av = Av2*Av1#Overall Voltage Gain\n",
      "print(\"Voltage Gain Av = %.2f \" %Av)\n",
      "print(Av,' = Av=')\n",
      "\n",
      "\n",
      "#Results\n",
      "Avs = (Av*Ri1)/(Ri1+Rs)#Overall Voltage gain with Source Impedence\n",
      "print(\"Overall Voltage gain taking Source Impedence into account = Avs = %.2f \" %Avs)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ai2 = -1.00 \n",
        "Ri2 = -3.00 K\n",
        "Av2 = 1.00 \n",
        "Rl1 = -8.00 K\n",
        "Ai1 = -1.00 \n",
        "Ri1 = -478.00 K\n",
        "Av1 = -1.00 \n",
        "The output Admittance of Transistor\n",
        "Yo= 0.02 K^-1 \n",
        "Output Impedence of First Stage\n",
        "ro1= 0.00 K \n",
        "Yo2= -199.00 K^-1 \n",
        "A1 = 2.00 \n",
        "Voltage Gain Av = -1.00 \n",
        "(-1, ' = Av=')\n",
        "Overall Voltage gain taking Source Impedence into account = Avs = -2.00 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6 Page No 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "hie = 2#in K\n",
      "hfe = 50\n",
      "hre = 6*(10^-4)\n",
      "hoe = 25*(10^-3)#in K^-1\n",
      "hic=2#in K\n",
      "hfc=-51\n",
      "hrc=1\n",
      "hoc=25*(10^-3)#/in K^-1\n",
      "Re2=5#in K\n",
      "Rs=5#in K\n",
      "Rc1=5#in K\n",
      "\n",
      "#Calculations\n",
      "#For the CC output Stage\n",
      "print('For the CC output Stage')\n",
      "Rl = Re2\n",
      "Ai2 = 1+ hfe#Current gain in 2nd Transistor\n",
      "print(\"Ai2= %.2f \" %Ai2)\n",
      "Ri2 = hie+((1+hfe)*Rl)\n",
      "print(\"Ri2= %.2f K\" %Ri2)\n",
      "Av2=1-(hie/Ri2)#voltage gain in 2nd transistor\n",
      "print(\"Av2= %.2f \" %Av2)\n",
      "\n",
      "#For the CE input Stage\n",
      "print('For the CE input Stage')\n",
      "\n",
      "Ai1=-hfe#Current gain in 1st transistor\n",
      "Ri1 = hie\n",
      "print(\"Ai1= %.2f \" %Ai1)\n",
      "Rl1=(Rc1*Ri2)/(Rc1+Ri2)\n",
      "print(\"Rl1= %.2f K\" %Rl1)\n",
      "Av1=(Ai1*Rl1)/Ri1#Voltage gain in 1st transistor\n",
      "print(\"Av1= %.2f \" %Av1)\n",
      "ro1=Rc1\n",
      "Ro2 = (hie+Rs)/(1+hfe)\n",
      "ro2=(Ro2*Rl)/(Ro2+Rl)\n",
      "print(\"Effective Source Impedence = %.2f k\" %ro2)\n",
      "\n",
      "Av = Av1*Av2#Overall voltage gain\n",
      "\n",
      "#Results\n",
      "print(\"Overall Voltage Gain= %.2f k\" %Av)\n",
      "Ai = Ai1*Ai2*(Rc1/(Rc1+Ri2))#Overall current Gain\n",
      "print(\"Overall Current Gain= %.2f k\" %Ai)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For the CC output Stage\n",
        "Ai2= 51.00 \n",
        "Ri2= 257.00 K\n",
        "Av2= 1.00 \n",
        "For the CE input Stage\n",
        "Ai1= -50.00 \n",
        "Rl1= 4.00 K\n",
        "Av1= -100.00 \n",
        "Effective Source Impedence = 0.00 k\n",
        "Overall Voltage Gain= -100.00 k\n",
        "Overall Current Gain= 0.00 k\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}