{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ch-5 : Special Diodes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 132 Exmaple 5.1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The barrier height for N-type material is,\n",
      "    Theta_BN = Theta_M - Chi = 0.25 V\n",
      "The built-in potential is given by,\n",
      "    Theta_IN = Theta_BN - (kT/q)*ln(NC/ND) =-0.22 V\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "thetaM=4.26 #work function\n",
    "chi=4.01 #electron affinity\n",
    "thetaBN=thetaM-chi\n",
    "print \"The barrier height for N-type material is,\"\n",
    "print \"    Theta_BN = Theta_M - Chi = %0.2f V\"%thetaBN\n",
    "thetaIN=thetaBN-((((1.38*10**-23)*300)/(1.6*10**-19)))*log((2.8*10**25)/(4*10**17))\n",
    "print \"The built-in potential is given by,\"\n",
    "print \"    Theta_IN = Theta_BN - (kT/q)*ln(NC/ND) =%0.2f V\"%thetaIN \n",
    "# answer in the textbook is wrong, even if we take log10 we get a answer 0.047."
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
