{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5: Junction Properties (Continued)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 5.1 Page No 191"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "When no external voltage is applied, Junction width is  3.9e-07 m\n",
      "When external voltage of -10 Volt is applied, Junction width is  1.5e-06 m\n"
     ]
    }
   ],
   "source": [
    "#Exa 5.1\n",
    "#Estimate the junction width in two cases.\n",
    "\n",
    "#given data\n",
    "import math\n",
    "ND=10**17           #in atoms/cm**3\n",
    "NA=0.5*10**16       #in atoms/cm**3\n",
    "Vo=0.7              #in Volts\n",
    "V=-10.0               #in Volts\n",
    "ND=ND*10**6         #in atoms/m**3\n",
    "NA=NA*10**6         #in atoms/m**3\n",
    "epsilon=8.85*10**-11  #in F/m\n",
    "e=1.6*10**-19         #coulamb\n",
    "\n",
    "#Calculation\n",
    "#part (i)\n",
    "#print \"When no external voltage is applied i.e. V=0\"\n",
    "#print\"VB = 0.7 volts\"\n",
    "VB=0.7               #in Volts\n",
    "W1=math.sqrt(2*epsilon*VB*(1/NA+1/ND)/e)         #in m\n",
    "\n",
    "#part (ii)\n",
    "#print\"When external voltage of -10 volt is applied\"\n",
    "#print\"VB = Vo-V volts\"\n",
    "VB=Vo-V              #in Volts\n",
    "W2=math.sqrt(2*epsilon*VB*(1/NA+1/ND)/e)    #in m\n",
    "\n",
    "#result\n",
    "print \"When no external voltage is applied, Junction width is \",round(W1,8),\"m\"\n",
    "print\"When external voltage of -10 Volt is applied, Junction width is \",round(W2,7),\"m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 5.3 Page No 195"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Junction capacitance is 21.59 pF\n"
     ]
    }
   ],
   "source": [
    "#Exa 5.3\n",
    "#Determine the junction capacitance\n",
    "\n",
    "#given data\n",
    "CTzero=50            #in pF\n",
    "VR=8                 #in Volt\n",
    "VK=0.7               #in Volt\n",
    "n=1/3.0                #for Si\n",
    "\n",
    "#calculation\n",
    "CT=CTzero/((1+VR/VK)**n)   #in pF\n",
    "\n",
    "#result\n",
    "print\"Junction capacitance is\",round(CT,2),\"pF\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 5.4 Page No.196"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The tuning range of circuit lies between 318.31 khz and 1007.0 Mhz\n"
     ]
    }
   ],
   "source": [
    "#Example 5.4\n",
    "#Determine the tuning range of the circuit\n",
    "import math\n",
    "#Given\n",
    "L=12.5*10**-3          #mH inductance\n",
    "C1=4.0                 #pF Capacitance\n",
    "C2=40.0                #pF Capacitance\n",
    "\n",
    "#Calculation\n",
    "Ctmin=(C1*C1)/(C1+C1)     #Min value of total Capacitance\n",
    "Ctmax=(C2*C2)/(C2+C2)     #Max value of total Capacitance\n",
    "Fmax=1/(2*math.pi*math.sqrt(L*Ctmin*10**-12))\n",
    "Fmin=1/(2*math.pi*math.sqrt(L*Ctmax*10**-12))\n",
    "\n",
    "#result\n",
    "print\"The tuning range of circuit lies between\",round(Fmin/1000,2),\"khz and\",round(Fmax/1000,0),\"Mhz\"\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}