{

 "metadata": {

  "name": "",

  "signature": "sha256:fe3dcc940fc59f790e074289cf01cde719f2ffc396107eb8d641ad2e7812dc13"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter5:JUNCTIONS IN SEMICONDUCTORS:P-N DIODES"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "\n",

      "Ex5.1:pg-169"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "Nd = 1.0*10**16 #initialising value of donor atoms in centimeter\n",

      "Na= 1.0*10**18 #initialising value of accepter atoms in centimeter\n",

      "Nc= 2.8*10**19 #initialising value of conduction band effective density\n",

      "Nv= 1.0*10**19 #initialising value of valence band effective density\n",

      "kbT = 0.026 #initializing value of kbT at 300K\n",

      "Eg = 1.1 #initializing value of forbidden energy gap\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "eVbi = Eg+(kbT*log(Na/Nv))+((kbT*log(Nd/Nc)))\n",

      "print\"built in voltage is ,eVbi =  \",\"{:.2e}\".format(eVbi),\" eV\"\n",

      "apsilen = 11.9*8.85*10**-12 #initializing value of relative permitivity\n",

      "e = 1.6*10**-19 #initializing value of charge of electron\n",

      "Vbi=eVbi/e\n",

      "Nd = 1.0*10**22 #initialising value of donor atoms in metrers\n",

      "Na= 1.0*10**24 #initialising value of accepter atomsin meters\n",

      "Wp_Vbi = sqrt(((2*apsilen*eVbi)/(e))*(Nd/(Na*(Na+Nd))))\n",

      "print\"depletion width at p side is ,Wp_Vbi =\",\"{:.2e}\".format(Wp_Vbi),\" m\"\n",

      "Wn_Vo = 100*sqrt(((2*apsilen*eVbi)/(e))*(Nd/(Na*(Na+Nd))))\n",

      "print\"depletion width at n side is ,Wn_Vo = \",\"{:.2e}\".format(Wn_Vo),\" m\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "built in voltage is ,eVbi =   8.34e-01  eV\n",

        "depletion width at p side is ,Wp_Vbi = 3.30e-09  m\n",

        "depletion width at n side is ,Wn_Vo =  3.30e-07  m\n"

       ]

      }

     ],

     "prompt_number": 15

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.2:pg-172"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "Nd = 1.0*10**16 #initialising value of donor atoms in centimeter\n",

      "Na= 1.0*10**18 #initialising value of accepter atoms in centimeter\n",

      "ni = 1.5*10**10 #initializing value of intrinsic carrier concentration\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "R= 10*10**-6 #initializing value of radius of pn diode\n",

      "A = math.pi*(R**2)\n",

      "pn = ni**2/Nd\n",

      "print\"concentration of electron in p type is ,pn = \",\"{:.2e}\".format(pn),\" cm**-3\"\n",

      "kbT = 0.026  #initializing value of kbT at 300K\n",

      "eVbi = (kbT*log(Na/pn))\n",

      "print\"built in voltage is ,eVbi =\",\"{:.2e}\".format(eVbi),\" V\"\n",

      "apsilen = 11.9*8.84*10**-12 #initializing value of relative permitivity\n",

      "e = 1.6*10**-19 #initializing value of charge of electron\n",

      "#NOTE: for reverse bias Vr = 0 V,\n",

      "Wp_4 = sqrt(((2.0*apsilen*eVbi)/(e))*((Nd*1.0*10**6)/((Na*1.0*10**6)*((Nd*1.0*10**6)+(Na*1.0*10**6)))))\n",

      "print\"depletion width at p side is ,Wp_4 =\",\"{:.2e}\".format(Wp_4),\"m\"\n",

      "Wn_4 = Wp_4*100\n",

      "print\"depletion width at n side is ,Wn_4 = \",\"{:.2e}\".format(Wn_4),\"m\"\n",

      "\n",

      "#for calculation purpose and for differentiating part (I), equating\n",

      "Vbi_4 = eVbi\n",

      "Vbi_4=round(Vbi_4,3)\n",

      "print(\"\")# for spacing \n",

      "Vbi_2 = Vbi_4 + 2\n",

      "Vbi_2=round(Vbi_2,3)\n",

      "#NOTE: for reverse bias Vr = 2 V,\n",

      "Wp_2 = Wp_4*sqrt(Vbi_2/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_2 = \",\"{:.2e}\".format(Wp_2),\"m\"\n",

      "Wn_2 = Wp_2*100\n",

      "print\"depletion width at n side is ,Wn_2  = \",\"{:.2e}\".format(Wn_2),\"m\"\n",

      "\n",

      "print(\"\")# for spacing\n",

      "Vbi_3 = Vbi_4 + 5\n",

      "Vbi_3=round(Vbi_3,2)\n",

      "#NOTE: for reverse bias Vr = 5 V,\n",

      "Wp_3 = sqrt(((2.0*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_3/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_3 =  \"\"{:.2e}\".format(Wp_3),\"m\"\n",

      "Wn_3 = Wp_3*100\n",

      "print\"depletion width at n side is ,Wn_3 = \",\"{:.2e}\".format(Wn_3),\"m\"\n",

      "print(\"\")# for spacing\n",

      "Vbi_4 = Vbi_4 + 10\n",

      "Vbi_4=round(Vbi_4,2)\n",

      "#NOTE: for reverse bias Vr = 10 V,\n",

      "\n",

      "Wp_4 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_4/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_4 =  \",\"{:.2e}\".format(Wp_4),\"m\"\n",

      "Wn_4 = Wp_4*100\n",

      "print\"depletion width at n side is ,Wn_4 = \",\"{:.2e}\".format(Wn_4),\"m\"\n",

      "\n",

      "print(\"\")# for spacing\n",

      "Vbi_5 = Vbi_4 - 0.5\n",

      "Vbi_5=round(Vbi_5,2)\n",

      "#NOTE: for forward bias Vf = 0.5 V,\n",

      "\n",

      "Wp_5 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_5/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_5 =\",\"{:.2e}\".format(Wp_5),\"m\"\n",

      "Wn_5 = Wp_5*100\n",

      "print\"depletion width at n side is ,Wn_5 = \",\"{:.2e}\".format(Wn_5),\"m\"\n",

      "\n",

      "#CALCULATION   FOR    PEAK FIELD :\n",

      "F =  - e*Nd*(10**6)*Wn_4/apsilen\n",

      "print\"F=\",\"{:.2e}\".format(F),\"v/m\"\n",

      "F =  - e*Nd*(10**6)*Wn_2/apsilen\n",

      "print\"F=\",\"{:.2e}\".format(F),\"v/m\"\n",

      "F =  - e*Nd*(10**6)*Wn_3/apsilen\n",

      "print\"F=\",\"{:.2e}\".format(F),\"v/m\"\n",

      "F =  - e*Nd*(10**6)*Wn_4/apsilen\n",

      "print\"F=\",\"{:.2e}\".format(F),\"v/m\"\n",

      "F =  - e*Nd*(10**6)*Wn_5/apsilen\n",

      "print\"F=\",\"{:.2e}\".format(F),\"v/m\"\n",

      "#calculation for \n",

      "Q = e*(Nd*10**6)*Wn_4*A#charge in depletion region for Vr = 0V\n",

      "print\"Q = \",\"{:.2e}\".format(Q),\"C\"\n",

      "#due to approximation taken by author in the textbook .... the values of Vbi_2, Vbi_3, Vbi_4 and \n",

      "#the values of depletion width(Wp_4, Wp_2,Wp_3, Wp_4, Wn_4, Wn_2, Wn_3, Wn_4) differ from the above solution\n",

      "# The answer of the textbook can be different due to different precision \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "concentration of electron in p type is ,pn =  2.25e+04  cm**-3\n",

        "built in voltage is ,eVbi = 8.17e-01  V\n",

        "depletion width at p side is ,Wp_4 = 3.26e-09 m\n",

        "depletion width at n side is ,Wn_4 =  3.26e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_2 =  6.06e-09 m\n",

        "depletion width at n side is ,Wn_2  =  6.06e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_3 =  8.71e-09 m\n",

        "depletion width at n side is ,Wn_3 =  8.71e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_4 =   3.26e-09 m\n",

        "depletion width at n side is ,Wn_4 =  3.26e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_5 = 3.19e-09 m\n",

        "depletion width at n side is ,Wn_5 =  3.19e-07 m\n",

        "F= -4.96e+06 v/m\n",

        "F= -9.21e+06 v/m\n",

        "F= -1.32e+07 v/m\n",

        "F= -4.96e+06 v/m\n",

        "F= -4.84e+06 v/m\n",

        "Q =  1.64e-13 C\n"

       ]

      }

     ],

     "prompt_number": 19

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.3:pg-173"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import cmath\n",

      "Nd = 1.0*10**16\n",

      "Na= 1.0*10**18\n",

      "ni = 1.5*10**10\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "R= 10*10**-6\n",

      "A = math.pi*(R**2)\n",

      "pn = ni**2/Nd\n",

      "print\"concentration of electron in p type is ,pn = \",\"{:.2e}\".format(pn),\" cm**-3\"\n",

      "kbT = 0.026\n",

      "eVbi = (kbT*log(Na/pn))\n",

      "print\"built in voltage is ,eVbi= \",\"{:.2e}\".format(eVbi),\" V\"\n",

      "apsilen = 11.9*8.84*10**-12\n",

      "e = 1.6*10**-19\n",

      "#NOTE: for reverse bias Vr = 0 V,\n",

      "Wp_4 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))\n",

      "print\"depletion width at p side is ,Wp_4 =  \",\"{:.2e}\".format(Wp_4),\"m\"\n",

      "Wn_4 = Wp_4*100\n",

      "print\"depletion width at n side is ,Wn_4  = \",\"{:.2e}\".format(Wn_4),\"m\"\n",

      "#for calculation purpose and for differentiating part (I), equating\n",

      "Vbi_4 = eVbi\n",

      "print(\"\")# for spacing \n",

      "Vbi_2 = Vbi_4 + 2\n",

      "#NOTE: for reverse bias Vr = 2 V,\n",

      "Wp_2 = Wp_4*sqrt(Vbi_2/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_2 = \",\"{:.2e}\".format(Wp_2),\"m\"\n",

      "Wn_2 = Wp_2*100\n",

      "print\"depletion width at n side is ,Wn_2 =  \",\"{:.2e}\".format(Wn_2),\"m\"\n",

      "print(\"\")# for spacing\n",

      "Vbi_3 = Vbi_4 + 5\n",

      "#NOTE: for reverse bias Vr = 5 V,\n",

      "Wp_3 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_3/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_3 = \",\"{:.2e}\".format(Wp_3),\"m\"\n",

      "Wn_3 = Wp_3*100\n",

      "print\"depletion width at n side is ,Wn_3 =  \",\"{:.2e}\".format(Wn_3),\"m\"\n",

      "print(\"\")# for spacing\n",

      "Vbi_4 = Vbi_4 + 10\n",

      "#NOTE: for reverse bias Vr = 10 V,\n",

      "Wp_4 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_4/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_4 =  \",\"{:.2e}\".format(Wp_4),\"m\"\n",

      "Wn_4 = Wp_4*100\n",

      "print\"depletion width at n side is ,Wn_4 =\",\"{:.2e}\".format(Wn_4),\"m\"\n",

      "print(\"\")# for spacing\n",

      "Vbi_5 = Vbi_4 - 0.5\n",

      "#NOTE: for forward bias Vf = 0.5 V,\n",

      "Wp_5 = sqrt(((2*apsilen*eVbi)/(e))*((Nd*10**6)/((Na*10**6)*((Nd*10**6)+(Na*10**6)))))*sqrt(Vbi_5/Vbi_4)\n",

      "print\"depletion width at p side is ,Wp_5 =\",\"{:.2e}\".format(Wp_5),\"m\"\n",

      "Wn_5 = Wp_5*100\n",

      "print\"depletion width at n side is ,Wn_5 =\",\"{:.2e}\".format(Wn_5),\"m\"\n",

      "#CALCULATION   FOR    PEAK FIELD :\n",

      "Fm =  - e*Nd*(10**6)*Wn_4/apsilen\n",

      "print\"peak Field For Vr = 0V, Fm =  \",\"{:.2e}\".format(Fm),\"V/m\"\n",

      "Fm =  - e*Nd*(10**6)*Wn_2/apsilen\n",

      "print\"peak Field for Vr = 2V, Fm =\",\"{:.2e}\".format(Fm),\"V/m\"\n",

      "Fm =  - e*Nd*(10**6)*Wn_3/apsilen\n",

      "print\"peak Field For Vr = 5V, Fm =  \",\"{:.2e}\".format(Fm),\"V/m\"\n",

      "Fm =  - e*Nd*(10**6)*Wn_4/apsilen\n",

      "print\"peak Field For Vr = 10V, Fm =   \",\"{:.2e}\".format(Fm),\"V/m\"\n",

      "print\"By the appendix B given in the book, the velocity of electron: v = 1*10**7 cm/s\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "concentration of electron in p type is ,pn =  2.25e+04  cm**-3\n",

        "built in voltage is ,eVbi=  8.17e-01  V\n",

        "depletion width at p side is ,Wp_4 =   3.26e-09 m\n",

        "depletion width at n side is ,Wn_4  =  3.26e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_2 =  6.06e-09 m\n",

        "depletion width at n side is ,Wn_2 =   6.06e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_3 =  8.70e-09 m\n",

        "depletion width at n side is ,Wn_3 =   8.70e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_4 =   3.26e-09 m\n",

        "depletion width at n side is ,Wn_4 = 3.26e-07 m\n",

        "\n",

        "depletion width at p side is ,Wp_5 = 3.19e-09 m\n",

        "depletion width at n side is ,Wn_5 = 3.19e-07 m\n",

        "peak Field For Vr = 0V, Fm =   -4.96e+06 V/m\n",

        "peak Field for Vr = 2V, Fm = -9.21e+06 V/m\n",

        "peak Field For Vr = 5V, Fm =   -1.32e+07 V/m\n",

        "peak Field For Vr = 10V, Fm =    -4.96e+06 V/m\n",

        "By the appendix B given in the book, the velocity of electron: v = 1*10**7 cm/s\n"

       ]

      }

     ],

     "prompt_number": 24

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.4:pg-178"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "A= 10**-7\n",

      "Na=10**18*10**6\n",

      "Nd=10**16*10**6\n",

      "Dp1 = 7.8*10**-4\n",

      "Dn2 = 7.3*10**-4\n",

      "Tn = 10**-6\n",

      "Tp = 10**-6\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "ni = 1.5*10**16\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "Lp = sqrt(Dp1*Tp)\n",

      "print\"The hole diffusion length is ,Lp =\",\"{:.2e}\".format(Lp),\"m\"\n",

      "Ln = sqrt(Dn2*Tn)\n",

      "print\"The electron diffusion length is ,Ln =\",\"{:.2e}\".format(Ln),\"m\"\n",

      "# NOTE: pn= (ni**2/nn) and np=(ni**2/pp)\n",

      "# assume that the doants are fully ionised \n",

      "Io = A*e*((((Dn2)/(Ln))*(ni**2/Na))+(((Dp1)/(Lp))*(ni**2/Nd)))\n",

      "print\"The prefactor current is ,Io =\",\"{:.1e}\".format(Io),\"A\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The hole diffusion length is ,Lp = 2.79e-05 m\n",

        "The electron diffusion length is ,Ln = 2.70e-05 m\n",

        "The prefactor current is ,Io = 1.0e-14 A\n"

       ]

      }

     ],

     "prompt_number": 5

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.5:pg-181"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "Na=10**17\n",

      "Nd=10**17\n",

      "Dp1 = 12.5\n",

      "Dn1 = 35\n",

      "Dp2 = 10\n",

      "Dn2 = 220\n",

      "Tn = 10**-8\n",

      "Tp = 10**-8\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "pn1 = 2.25*10**3\n",

      "np1 = 2.25*10**3\n",

      "pn2 = 3.38*10**-5\n",

      "np2 = 3.38*10**-5\n",

      "#Note : since value of holes and electrons in n- type and p type are not given for silicon and germanium thus we have assume it as above\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "Lp1 = sqrt(Dp1*Tp)\n",

      "Ln1 = sqrt(Dn1*Tn)\n",

      "Lp2 = sqrt(Dp2*Tp)\n",

      "Ln2 = sqrt(Dn2*Tn)\n",

      "# NOTE: pn= (ni**2/nn) and np=(ni**2/pp)\n",

      "# assume that the doants are fully ionised \n",

      "Jo1 = e*((((Dn1)/(Ln1))*np1)+(((Dp1)/(Lp1))*pn1))\n",

      "print\"The prefactor current density for silicon is ,Jo1 =\",\"{:.2e}\".format(Jo1),\"A/cm**2\"\n",

      "Jo2 = e*((((Dn2)/(Ln2))*np2)+(((Dp2)/(Lp2))*pn2))\n",

      "print\"The prefactor current density for GaAs is ,Jo2 =\",\"{:.2e}\".format(Jo2),\"A/cm**2\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The prefactor current density for silicon is ,Jo1 = 3.40e-11 A/cm**2\n",

        "The prefactor current density for GaAs is ,Jo2 = 9.73e-19 A/cm**2\n"

       ]

      }

     ],

     "prompt_number": 4

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "\n",

      "Ex5.6:pg-182"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "Na=5*10**16\n",

      "Nd=5*10**17\n",

      "Dp = 15\n",

      "Dn = 30\n",

      "Tn = 10**-8\n",

      "Tp = 10**-7\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "ni = 1.84*10**6\n",

      "np=ni**2/Na\n",

      "print\"The electron conc in p type is ,np=\",\"{:.2e}\".format(np),\"cm**-3\"\n",

      "pn=ni**2/Nd\n",

      "print\"The holes conc in n type is ,pn=\",\"{:.2e}\".format(pn),\"cm**-3\"\n",

      "Lp = sqrt(Dp*Tp)\n",

      "print\"The hole diffusion length is ,Lp =\",\"{:.2e}\".format(Lp),\"cm\"\n",

      "Ln = sqrt(Dn*Tn)\n",

      "print\"The electron diffusion length is ,Ln =\",\"{:.2e}\".format(Ln),\"cm\"\n",

      "Gamma_inj = ((e*Dn*np)/(Ln))/(((e*Dn*np)/(Ln))+((e*Dp*pn)/(Lp)))\n",

      "print\"The efficiency of diode is ,Gamma_inj =\",round(Gamma_inj,2)"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The electron conc in p type is ,np= 6.77e-05 cm**-3\n",

        "The holes conc in n type is ,pn= 6.77e-06 cm**-3\n",

        "The hole diffusion length is ,Lp = 1.22e-03 cm\n",

        "The electron diffusion length is ,Ln = 5.48e-04 cm\n",

        "The efficiency of diode is ,Gamma_inj = 0.98\n"

       ]

      }

     ],

     "prompt_number": 8

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.7:pg-182"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "A= 0.1*10**-2\n",

      "Vf= 1.0\n",

      "E= 1.43\n",

      "Na=5.0*10**16\n",

      "Nd=5.0*10**17\n",

      "Dp = 15.0\n",

      "Dn = 30.0\n",

      "Tn =1*10**-8\n",

      "Tp = 1.0*10**-7\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "kni = 1.84*10**6\n",

      "np=ni**2/Na\n",

      "pn=ni**2/Nd\n",

      "Ln = sqrt(Dn*Tn)\n",

      "In = ((e*A*Dn*np)/Ln)*(exp(Vf/kbT)-1)\n",

      "print\"The electron current is ,In =\",\"{:.1e}\".format(In),\"A\"\n",

      "In_by_e = In/e\n",

      "print\"The electron generation rate is ,In_by_e = \",\"{:.1e}\".format(In_by_e),\"s**-1\"\n",

      "power = In*E\n",

      "print\"The optical power of photon is ,power =\",\"{:.1e}\".format(power),\"W\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The electron current is ,In = 3.0e-05 A\n",

        "The electron generation rate is ,In_by_e =  1.9e+14 s**-1\n",

        "The optical power of photon is ,power = 4.3e-05 W\n"

       ]

      }

     ],

     "prompt_number": 11

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "\n",

      "Ex5.8:pg-183"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "apsilen = 11.9*8.85*10**-14\n",

      "GL= 1.0*10**22\n",

      "A= 1.0*10**-4\n",

      "Vr= 15.0\n",

      "Na=2.0*10**16\n",

      "Nd=1.0*10**16\n",

      "Dp = 12.0\n",

      "Dn = 20.0\n",

      "Tn = 1.0*10**-8\n",

      "Tp = 1.0*10**-8\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "ni = 1.5*10**10\n",

      "Ln = sqrt(Dn*Tn)\n",

      "print\"The electron diffusion length is ,Ln =\",\"{:.1e}\".format(Ln),\"cm\"\n",

      "Lp = sqrt(Dp*Tp)\n",

      "print\"The hole diffusion length is ,Lp =  \",\"{:.2e}\".format(Lp),\"cm\"\n",

      "Vbi = kbT*log((Na*Nd)/ni**2)\n",

      "print\"The built in voltage is ,Vbi =\",\"{:.2e}\".format(Vbi),\"V\"\n",

      "W = sqrt(((2*apsilen)/e)*((Na+Nd)/(Na*Nd))*(Vbi+Vr))\n",

      "print\"The depletion width is ,W =\",\"{:.2e}\".format(W),\"cm\"\n",

      "IL = e*A*GL*(W+Ln+Lp)\n",

      "print\"The photo current is IL =\",\"{:.2e}\".format(IL),\"A\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The electron diffusion length is ,Ln = 4.5e-04 cm\n",

        "The hole diffusion length is ,Lp =   3.46e-04 cm\n",

        "The built in voltage is ,Vbi = 7.15e-01 V\n",

        "The depletion width is ,W = 1.76e-04 cm\n",

        "The photo current is IL = 1.55e-04 A\n"

       ]

      }

     ],

     "prompt_number": 13

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.9:pg-185"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "e = 1.6*10**-19\n",

      "A=1.0*10**-7\n",

      "Na=10**18*10**6\n",

      "Nd=10**16*10**6\n",

      "Dp = 7.8*10**-4\n",

      "Dn = 7.3*10**-4\n",

      "ni = 1.5*10**16\n",

      "Wln = 5.0*10**-6\n",

      "Wlp = Wln\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "pn = ni**2/Nd\n",

      "np = ni**2/Na\n",

      "# from example 5.4 and 5.2 we get the value of diffusion length and zero bias depletion widths\n",

      "Lp = 27.9*10**-6\n",

      "print\"The electron diffusion length is ,Lp= \",\"{:.2e}\".format(Lp),\"m\"\n",

      "Ln = 27*10**-6\n",

      "print\"The electron diffusion length is ,Ln= \",\"{:.2e}\".format(Ln),\"m\"\n",

      "Wp = 3.2*10**-10\n",

      "print\"The zero bias depletion widths is ,Wp= \",\"{:.2e}\".format(Wp),\"m\"\n",

      "Wn = 0.0000003\n",

      "print\"The zero bias depletion widths is ,Wn \",\"{:.2e}\".format(Wn),\"m\"\n",

      "# for short diode the prefactor current is given as\n",

      "Io = e*A*(((Dp*pn)/(Wln-Wn))+((Dn*np)/abs(Wlp-Wp)))\n",

      "print\"The prefactor current is ,Io = \",\"{:.2e}\".format(Io),\"A\"\n",

      "# The prefactor current of short diode is approximately increase by a factor of 5.6 from that of long diode\n",

      "# Note : due to different precisions taken by me and the author ... my answer differ "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The electron diffusion length is ,Lp=  2.79e-05 m\n",

        "The electron diffusion length is ,Ln=  2.70e-05 m\n",

        "The zero bias depletion widths is ,Wp=  3.20e-10 m\n",

        "The zero bias depletion widths is ,Wn  3.00e-07 m\n",

        "The prefactor current is ,Io =  6.03e-14 A\n"

       ]

      }

     ],

     "prompt_number": 19

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.10:pg-188"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "e = 1.6*10**-19\n",

      "A= 10**-7\n",

      "ni = 1.5*10**16\n",

      "T = 1.0*10**-6\n",

      "# from example 5.2 we get the value of zero bias depletion widths\n",

      "W = 0.32*10**-6\n",

      "Io_GR = (e*A*W*ni)/(2*T)\n",

      "print\"The prefactor of the  is ,generation recombination currentIo_GR = \",\"{:.2e}\".format(Io_GR),\"A\"\n",

      "#let V = .2 V \n",

      "V = 0.2\n",

      "I_GR = Io_GR*(exp(V/(2*kbT))-1)\n",

      "print\"The diode current is ,I_GR =\",\"{:.2e}\".format(I_GR),\"A\"\n",

      "#let V = 0.6 V \n",

      "V = 0.6\n",

      "I_GR = Io_GR*(exp(V/(2*kbT))-1)\n",

      "print\"The diode current is ,I_GR = \",\"{:.2e}\".format(I_GR),\"A\"\n",

      "# The generation-recombination prefactor is much larger than prefactor due to diffusion term\n",

      "#In forward bias the diffusion current is initially much smaller than the generation recombination term but at high forward bias diffusion current will start to dominate\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The prefactor of the  is ,generation recombination currentIo_GR =  3.84e-11 A\n",

        "The diode current is ,I_GR = 1.76e-09 A\n",

        "The diode current is ,I_GR =  3.94e-06 A\n"

       ]

      }

     ],

     "prompt_number": 20

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "\n",

      "Ex5.11:pg-189"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "A= 1.0*10**-8\n",

      "Na=1.0*10**23\n",

      "Nd=1.0*10**23\n",

      "Dp = 10.0*10**-4\n",

      "Dn = 30.0*10**-4\n",

      "Tn = 1.0*10**-7\n",

      "Tp = 1.0*10**-7\n",

      "tau = 1.0*10**-8\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "ni = 1.5*10**16\n",

      "apsilen = 11.9*8.85*10**-12\n",

      "#NOTE: nn=Nd and pp=Na\n",

      "Lp = sqrt(Dp*Tp)\n",

      "print\"The hole diffusion length is ,Lp =  \",\"{:.2e}\".format(Lp),\"m\"\n",

      "Ln = sqrt(Dn*Tn)\n",

      "print\"The electron diffusion length is ,Ln = \",\"{:.2e}\".format(Ln),\"m\"\n",

      "# NOTE: pn= (ni**2/nn) and np=(ni**2/pp)\n",

      "np=ni**2/Na\n",

      "print\"The electron conc in p type is ,np=\",\"{:.2e}\".format(np),\"m**-3\"\n",

      "pn=ni**2/Nd\n",

      "print\"The holes conc in n type is ,pn=\",\"{:.2e}\".format(pn),\"m**-3\"\n",

      "Vbi = kbT*log((Na*Nd)/ni**2)\n",

      "print\"The built in voltage is ,Vbi =\",\"{:.2e}\".format(Vbi),\"V\"\n",

      "Io = e*((((Dn)*np)/(Ln))+((Dp*pn)/(Lp)))\n",

      "print\"The prefactor in the ideal diode  is ,Io =\",\"{:.2e}\".format(Io),\"A\"\n",

      "#let Vf = 0.5 V \n",

      "Vf = 0.5\n",

      "W = sqrt((2*apsilen/e)*((Na+Nd)/Nd/Na)*(Vbi-Vf))\n",

      "print\"The depletion width is ,W =\",\"{:.2e}\".format(W),\"m\"\n",

      "Io_GR  = e*A*W*ni/(2*tau)\n",

      "print\"prefactor for recombination generation current, Io_GR = \",\"{:.2e}\".format(Io_GR),\"A\"\n",

      "I = (Io*exp(Vf/kbT))+(Io_GR*exp(Vf/(2*kbT)))\n",

      "I_V1 = I\n",

      "print\"Current, I =\",\"{:.2e}\".format(I_V1),\"A\"\n",

      "#let V = 0.6 V \n",

      "Vf = 0.6\n",

      "W = sqrt((2*apsilen/e)*((Na+Nd)/Nd/Na)*(Vbi-Vf))\n",

      "print\"The depletion width is ,W =\",\"{:.2e}\".format(W),\"m\"\n",

      "Io_GR  = e*A*W*ni/2/tau\n",

      "print\"prefactor for recombination generation current, Io_GR = \",\"{:.1e}\".format(Io_GR),\"A\"\n",

      "I = (Io*exp(Vf/kbT))+(Io_GR*exp(Vf/(2*kbT)))\n",

      "I_V2 = I\n",

      "print\"Current, I =\",\"{:.2e}\".format(I_V2),\"A\"\n",

      "V1 = 0.5\n",

      "V2 = 0.6\n",

      "n = e*(V2-V1)/kbT/log(I_V2/I_V1)\n",

      "print\"Ideallity factor ,n =\",\"{:.2e}\".format(n)\n",

      "#note: in the text book the value of \n",

      "#-+\"prefactor of ideal diode equation, Io\" \n",

      "#calculated by author is wrong thus it efect the overall calculation of the solution ,so the answer in the are wrong of some of the values\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The hole diffusion length is ,Lp =   1.00e-05 m\n",

        "The electron diffusion length is ,Ln =  1.73e-05 m\n",

        "The electron conc in p type is ,np= 2.25e+09 m**-3\n",

        "The holes conc in n type is ,pn= 2.25e+09 m**-3\n",

        "The built in voltage is ,Vbi = 8.17e-01 V\n",

        "The prefactor in the ideal diode  is ,Io = 9.84e-08 A\n",

        "The depletion width is ,W = 9.14e-08 m\n",

        "prefactor for recombination generation current, Io_GR =  1.10e-10 A\n",

        "Current, I = 2.21e+01 A\n",

        "The depletion width is ,W = 7.56e-08 m\n",

        "prefactor for recombination generation current, Io_GR =  9.1e-11 A\n",

        "Current, I = 1.04e+03 A\n",

        "Ideallity factor ,n = 1.60e-19\n"

       ]

      }

     ],

     "prompt_number": 20

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.12:pg-195"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "apsilen = 11.9*8.85*10**-14\n",

      "Na=1.0*10**19\n",

      "Nd=1.0*10**16\n",

      "e = 1.6*10**-19\n",

      "Fcrit1 = 4.0*10**5\n",

      "Fcrit2 = 1.0*10**7\n",

      "VBD_Si = (apsilen*Fcrit1**2)/(2*e*Nd)\n",

      "print\"The breakdown field for silicon is ,VBD_Si =\",\"{:.2e}\".format(VBD_Si),\" V\"\n",

      "VBD_C = (apsilen*Fcrit2**2)/(2*e*Nd)\n",

      "print\"The breakdown field for diomond is ,VBD_C =\",\"{:.2e}\".format(VBD_C),\" V\"\n",

      "# Note : In the textbook answer of breakdown voltage of silicon is wrong due to which breakdown voltage of diomand also differ\n",

      "\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The breakdown field for silicon is ,VBD_Si = 5.27e+01  V\n",

        "The breakdown field for diomond is ,VBD_C = 3.29e+04  V\n"

       ]

      }

     ],

     "prompt_number": 11

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.13:pg-199"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import numpy as np\n",

      "print\"Let the intercept of the 1/c**2 Vs V plot is represented by Icv, which is the built in voltage\"\n",

      "Icv = 0.68\n",

      "Vbi = Icv\n",

      "print\"Let the slope of the intercept of the 1/c**2 Vs V plot is represented by dIcv\"\n",

      "dIcv=2.1*10**23\n",

      "C = 7.0*10**-13\n",

      "#NOTE: The above mentioned values are taken from the figure given in the question in textbook\n",

      "apsilen = 11.9*8.85*10**-12\n",

      "e = 1.6*10**-19\n",

      "kbT = 0.026\n",

      "A = 10**-7\n",

      "ni = sqrt(2.25*10**20)\n",

      "Neff = 2/(A**2*e*apsilen*dIcv)\n",

      "print\"The thickness of n region is ,Neff =\",\"{:.2e}\".format(Neff),\" m**-3\"\n",

      "Neff = Neff/10**6\n",

      "print\"The thickness of n region is ,Neff =\",\"{:.2e}\".format(Neff),\" cm**-3\"\n",

      "NaNd = exp(Vbi/kbT)*ni**2\n",

      "print\"NaNd =\",\"{:.2e}\".format(NaNd),\" cm**-6\"\n",

      "# solving for Na and Nd by creating a quadratic equation using the equations mentioned in the book\n",

      "p1 = [Neff*NaNd, -NaNd, Neff]\n",

      "#Neff*NaNd - NaNd*X + Neff*X**2 \n",

      "p1=p1[0]\n",

      "#p2=p1[1]\n",

      "print(p1)\n",

      "R= roots(p1)\n",

      "#s=roots(p2)\n",

      "Na= R\n",

      "#Nd= s\n",

      "#format ('e',10)\n",

      "#print\"Na = \"\"{:.2e}\".format(Na),\"cm**-3\"\n",

      "#print\"Nd = \"\"{:.2e}\".format(Nd),\"cm**-3\"\n",

      "W = (apsilen*A)/C\n",

      "print\"The thickness of n region is ,W =\",\"{:.1e}\".format(W),\" m\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "Let the intercept of the 1/c**2 Vs V plot is represented by Icv, which is the built in voltage\n",

        "Let the slope of the intercept of the 1/c**2 Vs V plot is represented by dIcv\n",

        "The thickness of n region is ,Neff = 5.65e+19  m**-3\n",

        "The thickness of n region is ,Neff = 5.65e+25  cm**-3\n",

        "NaNd = 5.14e+31  cm**-6\n",

        "The thickness of n region is ,W = 1.5e-05  m\n"

       ]

      }

     ],

     "prompt_number": 30

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.14:pg-201"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import cmath\n",

      "e = 1.6*10**-19\n",

      "I= 1*10**-3\n",

      "kbT = 0.026\n",

      "Tp = 10**-6\n",

      "Gs = (I)/(kbT)\n",

      "print\"The diode conductance is Gs = \",\"{:.2e}\".format(Gs),\"A/V\"\n",

      "Cdiff = (I*Tp)/(2*kbT)\n",

      "print\"The diffusion capacitance is Cdiff =  \",\"{:.2e}\".format(Cdiff),\"F\"\n",

      "# The diffusion capacitance is much larger than junction capacitance hence neglecting junction capacitance\n",

      "Y = Gs+(1j*2*math.pi*10**6*Cdiff)\n",

      "print\"The admittance of the diode is Y =\",Y,\"A/V\"\n",

      "# Note : due to different precisions taken by me and the author ... my answer differ \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The diode conductance is Gs =  3.85e-02 A/V\n",

        "The diffusion capacitance is Cdiff =   1.92e-08 F\n",

        "The admittance of the diode is Y = (0.0384615384615+0.120830486677j) A/V\n"

       ]

      }

     ],

     "prompt_number": 7

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex5.15:pg-207"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "Vr= 10.0\n",

      "R= 10.0*10**3\n",

      "#The junction capacitance is 20pF at zero bias and 10 pF at full reverse bias so\n",

      "Cavg= ((20+10)/2)\n",

      "Tp = 10**-7\n",

      "Ir = (Vr)/(R)\n",

      "Tsd = Tp*log(2)\n",

      "print\"The storage delay time is Tsd = \",\"{:.2e}\".format(Tsd),\" s\"\n",

      "Tt = 2.3*R*Cavg*10**-12\n",

      "print\"The time Tt =  \",\"{:.2e}\".format(Tt),\" s\"\n",

      "T = Tsd+Tt\n",

      "print\"The total diode recovery time is T =  \",\"{:.2e}\".format(T),\" s\"\n",

      "# Note : due to different precisions taken by me and the author ... my answer differ \n",

      "\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The storage delay time is Tsd =  6.93e-08  s\n",

        "The time Tt =   3.45e-07  s\n",

        "The total diode recovery time is T =   4.14e-07  s\n"

       ]

      }

     ],

     "prompt_number": 1

    }

   ],

   "metadata": {}

  }

 ]

}