{
 "metadata": {
  "name": "",
  "signature": "sha256:98cea729f1af3b9239b34331490c505c13d69177c4b00cc183482c502c22d490"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 Semiconductor Diodes"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1 , Page no:48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "n=1\n",
      "k=1.38 #x 10^-23\n",
      "\n",
      "#CALCULATIONS\n",
      "T=25+273\n",
      "q=1.6 #x 10^-19\n",
      "vd=((k*T)/(1.6*(10**4))*4.6151)\n",
      "\n",
      "#RESULTS\n",
      "print\"what range of forward voltage drop vD can (2.1) be approximated\";\n",
      "print\"vd =\",round(vd,3),\"V\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "what range of forward voltage drop vD can (2.1) be approximated\n",
        "vd = 0.119 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2 , Page no:48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "iD2=(47.73*10) #mA\n",
      "\n",
      "#RESULTS\n",
      "print\"find the forward and reverse saturation current\";\n",
      "print\"iD2=\",iD2;\n",
      "print\"iD1/(e^(0.3/0.02587)-1)=91nA\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "find the forward and reverse saturation current\n",
        "iD2= 477.3\n",
        "iD1/(e^(0.3/0.02587)-1)=91nA\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 , Page no:48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Rl=100 #k\u2126\n",
      "Rs=10 #k\u2126\n",
      "\n",
      "#CALCULATIONS\n",
      "Vl=(Rl/(Rl+Rs))\n",
      "\n",
      "#RESULTS\n",
      "print\"find the value of Vl\";\n",
      "print\"The value of Vl =\",round(Vl,3),\"vs\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "find the value of Vl\n",
        "The value of Vl = 0.909 vs\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5 , Page no:50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Vs=5 #V\n",
      "V2=3 #V\n",
      "\n",
      "#CALCULATIONS\n",
      "iD2=((Vs-V2)/500)*1000 #mA\n",
      "\n",
      "#RESULTS\n",
      "print\"In the circuit D1 and D2 are ideal diodes. Find iD1 and iD2.\";\n",
      "print\"iD2=\",round(iD2),\"mA\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In the circuit D1 and D2 are ideal diodes. Find iD1 and iD2.\n",
        "iD2= 4.0 mA\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7 , Page no:51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "vs=0.1 #cos wtV\n",
      "Vb=2 #V\n",
      "\n",
      "#CALCULATIONS\n",
      "Rth=(100**2)/200 #k\u2126\n",
      "Rf=(0.7-0.5)/0.004\n",
      "\n",
      "#RESULTS\n",
      "print\"Find iD and vD analytically\";\n",
      "print\"(100/200)*(2+0.1cos wt) V\";\n",
      "print\"Rth=\",round(Rth,3),\"ohm\";\n",
      "print\"Rf=\",round(Rf,3),\"ohm\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Find iD and vD analytically\n",
        "(100/200)*(2+0.1cos wt) V\n",
        "Rth= 50.0 ohm\n",
        "Rf= 50.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9 , Page no:52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Idq=5 #mA\n",
      "Vdq=0.75 #V\n",
      "vh=0.05 #cos wt\n",
      "Rth=50 #k\u2126\n",
      "rd=50\n",
      "\n",
      "#CALCULATIONS\n",
      "rd=(0.7-0.5)/0.004\n",
      "id=(vh/(Rth+rd))*1000\n",
      "vd=(rd*id)/1000 #cos wt V\n",
      "\n",
      "#RESULTS\n",
      "print\"Use the small-signal technique to find iD and vD\";\n",
      "print\"rd=\",rd,\"ohm\";\n",
      "print\"id=\",round(id,3),\"cos wt mA\";\n",
      "print\"vd=\",round(vd,3),\"cos wt V\";\n",
      "print\"iD = Idq + id = 5+0.5 cos wt mA\";\n",
      "print\"vD = Vdq + vd = 0.75+0.025 cos wt V \";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Use the small-signal technique to find iD and vD\n",
        "rd= 50.0 ohm\n",
        "id= 0.5 cos wt mA\n",
        "vd= 0.025 cos wt V\n",
        "iD = Idq + id = 5+0.5 cos wt mA\n",
        "vD = Vdq + vd = 0.75+0.025 cos wt V \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.11 , Page no:54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Rs=200 #\u2126\n",
      "R1=200 #\u2126\n",
      "Rl=50 #k\u2126\n",
      "vs=400 #sin wt V\n",
      "\n",
      "#CALCULATIONS\n",
      "vth=(R1/(R1+Rs))*vs\n",
      "Rth=((R1*Rs)/(R1+Rs))\n",
      "id=-2*10**(-6)\n",
      "Rl=Rl*(10**3)\n",
      "vD=vth-(id)*(Rth+Rl)\n",
      "\n",
      "#RESULTS\n",
      "print\"vth =\",round(vth,3),\"sin wt V\";\n",
      "print\"Rth =\",round(Rth,3),\"ohm\";\n",
      "print\"vD =\",round(vD,3),\"V\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "vth = 200.0 sin wt V\n",
        "Rth = 100.0 ohm\n",
        "vD = 200.1 V\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.13 , Page no:55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Vf1=1 #v\n",
      "Vf2=2 #v\n",
      "Rf1=100 #\u2126\n",
      "Rf2=200 #\u2126\n",
      "Vb1=4 #v\n",
      "Vb2=6 #v\n",
      "R=2000\n",
      "\n",
      "#CALCULATIONS\n",
      "V01=Vf2+((Vb1-Vf1-Vf2)*Rf2)/(R+Rf1+Rf2)\n",
      "V02=Vf2+((Vb2-Vf1-Vf2)*Rf2)/(R+Rf1+Rf2)\n",
      "Reg=((V02-V01)/V01)*100\n",
      "\n",
      "#RESULTS\n",
      "print\"V01 is=\",round(V01,3),\"and\",round(V02,3);\n",
      "print\"Reg =\",round(Reg,3);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "V01 is= 2.087 and 2.261\n",
        "Reg = 8.333\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.14 , Page no:56"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Rl=10 #\u2126\n",
      "Rs=10 #\u2126\n",
      "Vs=10 #v\n",
      "Vl01=2.5 #V\n",
      "Rl1=1000\n",
      "Vs1=10\n",
      "Rs1=10\n",
      "Vl02=4.9 #V\n",
      "\n",
      "#CALCULATIONS\n",
      "Vl=(Rl/(Rl+Rs))*Vs #V\n",
      "Vl1=(Rl1/(Rl1+Rs1))*Vs1\n",
      "Reg=((Vl02-Vl01)/Vl01)*100\n",
      "\n",
      "#RESULTS\n",
      "print\"Vl =\",round(Vl,3);\n",
      "print\"For Rl=1000\";\n",
      "print\"Vl1 =\",round(Vl1,3);\n",
      "print\"Reg =\",round(Reg);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Vl = 5.0\n",
        "For Rl=1000\n",
        "Vl1 = 9.901\n",
        "Reg = 96.0\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.15 , Page no:56"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Rl=10 #\u2126\n",
      "Rs=10 #\u2126\n",
      "Vs=-10 #v\n",
      "Vl0=2.5 #V\n",
      "\n",
      "#CALCULATIONS\n",
      "Vl=(Rl/(Rl+Rs))*Vs\n",
      "\n",
      "#RESULTS\n",
      "print\"Vl =\",round(Vl,3);\n",
      "print\"Vl0 =\",round(Vl0,3);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Vl = -5.0\n",
        "Vl0 = 2.5\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.26 , Page no:61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "R1=6 #k\u2126\n",
      "R2=3 #k\u2126\n",
      "V1=5 #v\n",
      "V2=10 #v\n",
      "\n",
      "#CALCULATIONS\n",
      "Rth=(R1*R2/(R1+R2))\n",
      "R2=(R1*Rth/(R1-Rth))\n",
      "\n",
      "#RESULTS\n",
      "print\"Rth =\",round(Rth,3);\n",
      "print\"R2 =\",round(R2,3);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rth = 2.0\n",
        "R2 = 3.0\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.30 , Page no:65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Vz=8.2 #V\n",
      "Rl=9 #k\u2126\n",
      "iZ=1\n",
      "Vb=13.2\n",
      "Vb1=11.7\n",
      "\n",
      "#CALCULATIONS\n",
      "iL=Vz/Rl #mA\n",
      "Rs=((Vb-Vz)/(iZ+iL))\n",
      "iZ1=((Vb1-Vz)/Rs)-iL\n",
      "\n",
      "#RESULTS\n",
      "print\"iL =\",round(iL,3),\"A\";\n",
      "print\"Rs =\",round(Rs,3),\"ohm\";\n",
      "print\"iZ =\",round(iZ1,3);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "iL = 0.911 A\n",
        "Rs = 2.616 ohm\n",
        "iZ = 0.427\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.31 , Page no:65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Vz=5.2 #V\n",
      "Pdmax=260 #mW\n",
      "Vs=15\n",
      "\n",
      "#CALCULATIONS\n",
      "iZmax=Pdmax/Vz #mA\n",
      "R=(Vs-Vz)*1000/iZmax\n",
      "\n",
      "#RESULTS\n",
      "print\"iZmax =\",round(iZmax,3),\"mA\";\n",
      "print\"R =\",round(R,3),\"ohm\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "iZmax = 50.0 mA\n",
        "R = 196.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 13
    }
   ],
   "metadata": {}
  }
 ]
}