{
 "metadata": {
  "name": "",
  "signature": "sha256:2585c64821e409bb345db95acb15436fd73be8f9564cebfa80630f17af21de1a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter - 1 : Semiconductor and Magnetic Materials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.2 : Page No - 14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "from __future__ import division\n",
      "#Given data\n",
      "I=0.5 # in A\n",
      "rho= 7.4 # in \u03a9/1000 ft\n",
      "rho= rho/(3.05*10**4) # in \u03a9/cm\n",
      "sigma= 1/rho #in cm/\u03a9\n",
      "print \"(a) : Conductivity   = %0.2e \u03a9/cm\" %sigma\n",
      "\n",
      "# Part (ii)\n",
      "n= 6.5*10**28 # in per meter cube\n",
      "q= 1.6*10**-19 # in C\n",
      "# Formula sigma= n*q*miu_n\n",
      "miu_n= sigma/(n*q) # in cm**2/Vs\n",
      "print \"(b) : Mobility       = %0.2e cm**2/Vs\" %miu_n\n",
      "\n",
      "# Part (iii)\n",
      "D= 2.5*10**-3 # in m\n",
      "A= pi*D**2/4 # in m**2\n",
      "v_d= I/(n*q*A) # in m/s\n",
      "print \"(c) : Drift velocity = %0.2e m/s\" %v_d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) : Conductivity   = 4.12e+03 \u03a9/cm\n",
        "(b) : Mobility       = 3.96e-07 cm**2/Vs\n",
        "(c) : Drift velocity = 9.79e-06 m/s\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.3 : Page No - 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "N_D= 6*10**18 # in per cube cm\n",
      "N_A= 3*10**15 # in per cube cm\n",
      "ni= 2.5*10**12 \n",
      "Nn= N_D-N_A # in per cube cm\n",
      "rho_n= ni**2/Nn # in per cube cm\n",
      "# Part (i)\n",
      "print \"(a) : The concentration of holes in n-type  = %0.2e per cm**3\" %rho_n\n",
      "print \"      Concentration  of electrons in n-type = %0.3e per cm**3\" %Nn\n",
      "# Part (ii)\n",
      "print \"(b) : The material is of n-type\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) : The concentration of holes in n-type  = 1.04e+06 per cm**3\n",
        "      Concentration  of electrons in n-type = 5.997e+18 per cm**3\n",
        "(b) : The material is of n-type\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.4 : Page No - 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "ni= 2.5*10**19 \n",
      "q= 1.6*10**-19 # in C\n",
      "miu_n= 0.36 \n",
      "miu_p= 0.17 \n",
      "sigma= q*ni*(miu_n+miu_p) # in s/m\n",
      "rho= 1/sigma # in \u03a9m\n",
      "print \"The conductivity of Ge = %0.2f s/m\" %sigma\n",
      "print \"The resistivity of Ge  = %0.2f \u03a9m\" %rho"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of Ge = 2.12 s/m\n",
        "The resistivity of Ge  = 0.47 \u03a9m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.5 : Page No - 16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "e= 1.6*10**-19 # in C\n",
      "ni= 1.5*10**16 \n",
      "miu_n= 0.13 \n",
      "miu_p= 0.05 \n",
      "atomicDensity= 5*10**28 #atomic density of Si in /m**3\n",
      "C= 1/(2*10**8) # concentration  \n",
      "N_D= atomicDensity*C # in /m**3\n",
      "n=N_D \n",
      "p= ni**2/N_D # in /m**3\n",
      "sigma= e*(n*miu_n+p*miu_p) # in s/m\n",
      "print \"Conductivity of the extrinsic semiconductor = %0.1f s/m\" %sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Conductivity of the extrinsic semiconductor = 5.2 s/m\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.6 : Page No - 16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import exp\n",
      "#Given data\n",
      "Eg= 0.72 # in eV\n",
      "Ef= Eg/2 #in eV\n",
      "K= 8.61*10**-5 # in eV/K\n",
      "T=300 #in K\n",
      "nc= 1 \n",
      "n= 1+exp(((Eg-Ef)/(K*T))) \n",
      "ncBYn= nc/n \n",
      "print \"The fraction of the total number or electrons = %0.2e\" %ncBYn"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fraction of the total number or electrons = 8.85e-07\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.7 : Page No - 17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "ni= 1.4*10**18 #in /m**3\n",
      "N_D= 1.4*10**24 #in /m**3 \n",
      "n=N_D \n",
      "p= ni**2/n # in /m**3\n",
      "nbyp= n/p \n",
      "print \"The ratio of electron to holes concentration = %0.1e\" %nbyp"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio of electron to holes concentration = 1.0e+12\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.8 : Page No - 17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "d= 2 # in mm\n",
      "d=d*10**-3 #in m\n",
      "sigma= 5.8*10**7 # in s/m\n",
      "miu_c= 0.0032 # in m**2/v-sec\n",
      "E= 20 #in mV/m\n",
      "E=E*10**-3 #in V/m\n",
      "e= 1.6*10**-19 # in C\n",
      "# Part (a)\n",
      "n= sigma/(e*miu_c) #in /m**3\n",
      "print \"(a) : Charge density = %0.3e per meter cube\" %n\n",
      "\n",
      "# Part (b)\n",
      "J= sigma*E #in A/m**2\n",
      "print \"(b) : Current density = %0.2e A/m**2\" %J\n",
      "\n",
      "# Part (c)\n",
      "Area= pi*d**2/4 # in area of cross-section of wire in m**2\n",
      "I= J*Area # in A\n",
      "print \"(c) : Current flowing in the wire = %0.3f amp\" %I\n",
      "\n",
      "# Part (d)\n",
      "v= miu_c*E # in m/sec\n",
      "print \"(d) : Electron drift velocity = %0.1e m/sec\" %v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) : Charge density = 1.133e+29 per meter cube\n",
        "(b) : Current density = 1.16e+06 A/m**2\n",
        "(c) : Current flowing in the wire = 3.644 amp\n",
        "(d) : Electron drift velocity = 6.4e-05 m/sec\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.9 : Page No - 18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "rho= 0.5 # in \u03a9-m\n",
      "miu_c= 0.4 # in m**2/v-sec\n",
      "J=100 #in A/m**2\n",
      "distance=10 # \u00b5m\n",
      "distance=distance*10**-6 #in sec\n",
      "# V= miu_c*E = miu_c*J/sigma = miu_c*J*rho \n",
      "V=  miu_c*J*rho  # in m/sec\n",
      "print \"Drift velocity = %0.f m/sec\" %V\n",
      "T= distance/V # in second\n",
      "print \"The time taken by the electron to travel 10 micro meter in the crystal = %0.1e second\" %T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Drift velocity = 20 m/sec\n",
        "The time taken by the electron to travel 10 micro meter in the crystal = 5.0e-07 second\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.10 : Page No - 18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "Bo= 1.7*10**-5 # in weber/meter**2\n",
      "miu_o= 4*pi*10**-7  # in weber/amp-meter\n",
      "H= Bo/miu_o #in A/m\n",
      "print \"The horizontal component of the magnetic intensity = %0.1f A/m\" %H"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal component of the magnetic intensity = 13.5 A/m\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.11 : Page No - 18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "H= 5*10**3 # in amp/meter\n",
      "N= 50 \n",
      "l= 10 #in cm\n",
      "l=l*10**-2 # in m\n",
      "n=N/l # in turns/meter\n",
      "i= H/n # in amp\n",
      "print \"Current should be sent through the solenoid = %0.f ampere\" %i"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current should be sent through the solenoid = 10 ampere\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.12 : Page No - 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "vol= 10**-4 # volume of the rod in m**3\n",
      "i=0.5 # in amp\n",
      "n= 5 # turns/cm\n",
      "n= n*10**2 # turns/meter\n",
      "miu_r= 1000 \n",
      "#B= miu_o*(H+I)\n",
      "# Where I= Bo/miu_o-H and B= miu*H = miu_r*miu_o*H\n",
      "# Then I= miu_r*miu_o*H/miu_o - H = (miu_r-1)*H\n",
      "# H= n*i\n",
      "I= (miu_r-1)*n*i # in amp/meter\n",
      "MagMoment= I*vol # in Am**2\n",
      "print \"Magnetic moment = %0.f Am**2\" %MagMoment"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnetic moment = 25 Am**2\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.13 : Page No - 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "Xm= 9.48*10**-9 \n",
      "miu_r= 1+Xm #\n",
      "print \"Relative permeability = 1 + %0.2e\" %Xm\n",
      "print \"That is \u00b5r is slightly greater than 1\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relative permeability = 1 + 9.48e-09\n",
        "That is \u00b5r is slightly greater than 1\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.14 : Page No - 20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "fie_B= 2*10**-6 # in weber\n",
      "A= 10**-4 # in m**2\n",
      "N= 300 # number of turns\n",
      "l=30 #in cm\n",
      "l=l*10**-2 #in meter\n",
      "i=0.032 # in amp\n",
      "miu_o= 4*pi*10**-7 \n",
      "B=fie_B/A # in weber/meter**2\n",
      "print \"Flux density          = %0.1e weber/meter**2\" %B\n",
      "H= N*i/l # in amp-turn/meter\n",
      "print \"Magnetic intensity    = %0.f amp-turn/meter\"%H\n",
      "miu= B/H # in weber/amp-meter\n",
      "print \"Pemeability           = %0.2e weber/amp-meter\" %miu\n",
      "miu_r= miu/miu_o \n",
      "print \"Relative permeability = %0.f\" %miu_r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux density          = 2.0e-02 weber/meter**2\n",
        "Magnetic intensity    = 32 amp-turn/meter\n",
        "Pemeability           = 6.25e-04 weber/amp-meter\n",
        "Relative permeability = 497\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.15 : Page No - 20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "q=1.6*10**-19 # in C\n",
      "ni= 1.5*10**16 # in /m**3\n",
      "miu_n= 0.13 # in m**3/vs\n",
      "miu_p= 0.05 # in m**3/vs\n",
      "sigma= q*ni*(miu_n+miu_p) # in \u03a9/m\n",
      "print \"The conductivity = %0.3e \u03a9/m\" %sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity = 4.320e-04 \u03a9/m\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.16 : Page No - 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "q=1.6*10**-19 # in C\n",
      "n=4*10**22 # in /m**3\n",
      "ni= 2.4*10**19 # in /m**3\n",
      "miu_n= 3500 # in cm**2/vs\n",
      "miu_n= miu_n*10**-4 # in m**2/vs\n",
      "# Formula n*p= ni**2\n",
      "p= ni**2/n # in m**-3\n",
      "print \"Hole concentration = %0.2e m**-3\" %p\n",
      "sigma=q*n*miu_n # in (\u03a9-m)**-1\n",
      "print \"The conductivity of the extrinsic semiconductor = %0.f (\u03a9m)**-1\" %sigma\n",
      "\n",
      "# Note : There is miss print in the printed value of p and also calculation error in evaluating the value of p . \n",
      "#        So the answer in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Hole concentration = 1.44e+16 m**-3\n",
        "The conductivity of the extrinsic semiconductor = 2240 (\u03a9m)**-1\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.17 : Page No - 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "ni= 1.8*10**16 # in /m**3\n",
      "q= 1.6*10**-19 # in C\n",
      "em=0.14 # electron mobility in m**2/v-sec\n",
      "hm=0.05 # hole mobility in m**2/v-sec\n",
      "resistivity= 1.2 # in \u03a9m\n",
      "n= 1/(q*em*resistivity) # in /m**3\n",
      "print \"The electron concenration = %0.2e /m**3\" %n\n",
      "p= ni**2/n # in /m**3\n",
      "print \"The hole concentration = %0.1e /m**3\" %p"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The electron concenration = 3.72e+19 /m**3\n",
        "The hole concentration = 8.7e+12 /m**3\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.18 : Page No - 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "miu= 35.2*10**-4 # in m**2/vs\n",
      "n=7.87*10**28 \n",
      "e= 1.6*10**-19 # in C\n",
      "sigma= n*e*miu # in s/m\n",
      "print \"Conductivity = %0.3e s/m\" %sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Conductivity = 4.432e+07 s/m\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.19 : Page No - 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "ni= 2.25*10**13 # in /cm**3\n",
      "e= 1.6*10**-19 # in C\n",
      "miu_n= 3800 # in cm**2/vs\n",
      "miu_p= 1800 # in cm**2/vs\n",
      "no=ni \n",
      "sigma= no*e*(miu_n+miu_p) # in s/cm\n",
      "print \"The intrinsic conductivity = %0.4f s/cm\" %sigma\n",
      "\n",
      "# Note: Answer in the book is wrong due to calculation error to evaluating the value of sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The intrinsic conductivity = 0.0202 s/cm\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.20 : Page No - 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "e= 1.6*10**-19 # in C\n",
      "I=100 # in A\n",
      "n_o= 8.5*10**28 # in m**-3\n",
      "A=10**-5 # in m**2\n",
      "# Formula I= n_o*A*e*Vd\n",
      "Vd= I/(n_o*e*A) # in ms**-1\n",
      "print \"The drift velocity of free electron = %0.3e ms**-1\" %Vd"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drift velocity of free electron = 7.353e-04 ms**-1\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.21 : Page No - 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "miu_n= 0.13 # in m**2/v-sec\n",
      "lip= 0.05 # in m**2/v-sec\n",
      "n=5*10**28/10**9 # in /m**3\n",
      "q= 1.6*10**-19 # in C\n",
      "sigma= q*n*miu_n # in (\u03a9m)**-1\n",
      "print \"The conductivity of silicon material = %0.2f (\u03a9m)**-1\" %sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of silicon material = 1.04 (\u03a9m)**-1\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example -  1.22 : Page No - 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "miu_p= 0.05 # in m**2/v-sec\n",
      "rho=5*10**28/10**8 # in /m**3\n",
      "q= 1.6*10**-19 # in C\n",
      "sigma= q*rho*miu_p # in (\u03a9m)**-1\n",
      "print \"The conductivity of silicon material = %0.f (\u03a9m)**-1\" %sigma"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of silicon material = 4 (\u03a9m)**-1\n"
       ]
      }
     ],
     "prompt_number": 32
    }
   ],
   "metadata": {}
  }
 ]
}