{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 3 DIODE THEORY"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-2, Page 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Pr=5     #Power rating(W)\n",
      "Vd=1.2   #diode voltage(V)\n",
      "Id=1.75  #diode current(A)\n",
      "\n",
      "PD=Vd*Id #Power dissipaion(W)\n",
      "\n",
      "print 'Power Dissipation =',PD,'W'\n",
      "print 'PD(',PD,'W) < ''Pr(',Pr,'W), So diode will not be destroyed.'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power Dissipation = 2.1 W\n",
        "PD( 2.1 W) < Pr( 5 W), So diode will not be destroyed.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-3, Page 65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "Vs=10     #Source voltage(V)\n",
      "RL=1      #Load resistance(KOhm)\n",
      "VL=Vs     #LOad voltage(V)\n",
      "\n",
      "IL=VL/RL  #Load current(mA)\n",
      "\n",
      "print 'Vs will be appearing across RL'\n",
      "print 'Load voltage VL =',Vs,'V'\n",
      "print 'Load current IL =',IL,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Vs will be appearing across RL\n",
        "Load voltage VL = 10 V\n",
        "Load current IL = 10 mA\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-4, Page 65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print 'As per figure 3-6b, Thevenize the circuit to the left of the diode'\n",
      "R1=6   #Resistance(KOhm)\n",
      "R2=3   #Resistance(KOhm)\n",
      "RL=1   #Load Resistance(KOhm)\n",
      "Vs=36  #Supply voltage(V)\n",
      "\n",
      "Vth=R2*Vs/(R1+R2)   #ThCevenin voltage(V)\n",
      "Rth=(R1*R2)/(R1+R2) #Thevenin resistance(KOhm)\n",
      "Rt=Rth+RL           #total resistance(KOhm)\n",
      "IL=Vth/Rt           #Load current(mA)\n",
      "VL=IL*RL            #Load voltage(V)\n",
      "\n",
      "print 'Vth =',Vth,'V & Rth =',Rth,'KOhm'\n",
      "print 'Visualize diode as closed switch,'\n",
      "print 'IL =',IL,'mA'\n",
      "print 'VL =',VL,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "As per figure 3-6b, Thevenize the circuit to the left of the diode\n",
        "Vth = 12 V & Rth = 2 KOhm\n",
        "Visualize diode as closed switch,\n",
        "IL = 4 mA\n",
        "VL = 4 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-5, Page 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print 'As per Second approximation in Fig.3-8,'\n",
      "Vd=0.7    #diode voltgage(V)\n",
      "Vs=10     #supply voltage(V)\n",
      "RL=1      #Load resistance(KOhm)\n",
      "\n",
      "VL=Vs-Vd  #Load voltage(v)\n",
      "IL=VL/RL  #Load current(mA)\n",
      "PD=Vd*IL  #diode power(mW)\n",
      "\n",
      "print 'IL =',IL,'mA & VL =',VL,'V'\n",
      "print 'Diode power PD =',PD,'mW'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "As per Second approximation in Fig.3-8,\n",
        "IL = 9.3 mA & VL = 9.3 V\n",
        "Diode power PD = 6.51 mW\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-6, Page 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print 'As per Second approximation in Fig.3-9a,'\n",
      "Vd=0.7  #diode voltgage(V)\n",
      "Vs=36   #supply voltage(V)\n",
      "R1=6    #Resistance(KOhm)\n",
      "R2=3    #Resistance(KOhm)\n",
      "RL=1    #Load resistance(KOhm)\n",
      "\n",
      "Vth=R2*Vs/(R1+R2)#Thevenin Voltage(V)\n",
      "Rth=(R1*R2)/(R1+R2)#Thevenin resistance(KOhm)\n",
      "IL=(Vth-Vd)/R2#Load current(mA)\n",
      "VL=IL*RL#Load voltage(V)\n",
      "PD=Vd*IL#diode power(mW)\n",
      "\n",
      "print 'Thevenize the circuit to the left of the diode'\n",
      "print 'Vth =',Vth,'V & Rth =',Rth,'KOhm'\n",
      "print 'VL =',round(VL,2),'V & IL =',round(IL,2),'mA'\n",
      "print 'Diode power PD =',round(PD,2),'mW'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "As per Second approximation in Fig.3-9a,\n",
        "Thevenize the circuit to the left of the diode\n",
        "Vth = 12 V & Rth = 2 KOhm\n",
        "VL = 3.77 V & IL = 3.77 mA\n",
        "Diode power PD = 2.64 mW\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-7, Page 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print 'In Fig.3-11a,'\n",
      "Vd=0.7    #diode voltgage(V)\n",
      "Vs=10     #supply voltage(V)\n",
      "RL=1000L  #Load resistance(Ohm)\n",
      "Rb=0.23   #bulk resistance\n",
      "\n",
      "print 'As per third approximation, we get fig.3-11b'\n",
      "if Rb<(RL/100):\n",
      "    print'If Rb < 0.01RL than ignore Rb & use second approximation.'\n",
      "    VL=Vs-Vd          #Load voltage(V)\n",
      "    IL=(VL/RL)*1000   #Load current(mA)\n",
      "    PD=Vd*IL          #diode power(mW)\n",
      "\n",
      "    print 'IL =',IL,'mA & VL =',VL,'V'\n",
      "    print 'Diode power PD =',PD,'mW'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In Fig.3-11a,\n",
        "As per third approximation, we get fig.3-11b\n",
        "If Rb < 0.01RL than ignore Rb & use second approximation.\n",
        "IL = 9.3 mA & VL = 9.3 V\n",
        "Diode power PD = 6.51 mW\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-8, Page 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print 'In Fig.3-11a, take RL = 10 Ohm'\n",
      "Vd=0.7    #diode voltgage(V)\n",
      "Vs=10     #supply voltage(V)\n",
      "RL=10     #Load resistance(Ohm)\n",
      "Rb=0.23   #bulk resistance\n",
      "RT=Rb+RL  #Total reistance(Ohm)\n",
      "VT=Vs-Vd  #total voltage(V)\n",
      "\n",
      "print 'RT =',RT,'Ohm & VT =',VT,'V'\n",
      "IL=VT/RT      #Load current(mA)\n",
      "VL=IL*RL      #Load voltage(V)\n",
      "VD=Vd+(IL*Rb) \n",
      "PD=VD*IL      #diode power(W)\n",
      "\n",
      "print 'IL =',round(IL,2),'mA & VL =',round(VL,2),'V'\n",
      "print 'VD =',round(VD,2),'V'\n",
      "print 'Diode power PD =',round(PD,2),'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In Fig.3-11a, take RL = 10 Ohm\n",
        "RT = 10.23 Ohm & VT = 9.3 V\n",
        "IL = 0.91 mA & VL = 9.09 V\n",
        "VD = 0.91 V\n",
        "Diode power PD = 0.83 W\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}