{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 1:Semiconductor Marerials and Crystal Properties"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.1 Page No.23"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Miller indices of the given plane are 3.0 2.0 3.0\n"
     ]
    }
   ],
   "source": [
    "#Example 1.1\n",
    "#Find the miller indices for a plane.\n",
    "\n",
    "#Given\n",
    "#Length of intercept\n",
    "l1=2.0\n",
    "l2=3.0\n",
    "l3=2.0\n",
    "\n",
    "#Calcuation\n",
    "#reciprocal of intercept\n",
    "r1=1/l1\n",
    "r2=1/l2\n",
    "r3=1/l3\n",
    "m1=6*r1\n",
    "m2=6*r2\n",
    "m3=6*r3\n",
    "\n",
    "#Result\n",
    "print\"Miller indices of the given plane are\",m1,m2,m3\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.2 Page No.24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Miller indices of the given plane are 2.0 1.0 0\n"
     ]
    }
   ],
   "source": [
    "#Example 1.2\n",
    "#Find the miller indices for a plane.\n",
    "\n",
    "#Given\n",
    "#Length of intercept\n",
    "l1=1.0\n",
    "l2=2.0\n",
    "l3=0\n",
    "\n",
    "#Calcuation\n",
    "#reciprocal of intercept\n",
    "r1=1/l1\n",
    "r2=1/l2\n",
    "r3=0\n",
    "m1=2*r1\n",
    "m2=2*r2\n",
    "m3=2*r3\n",
    "\n",
    "#Result\n",
    "print\"Miller indices of the given plane are\",m1,m2,m3\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.3 Page No.24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lattice constant is 3.22 A\n",
      "radius of simple lattice is 1.61 A\n"
     ]
    }
   ],
   "source": [
    "#Example 1.3\n",
    "#Obtain lattice constant and radius of the atom.\n",
    "\n",
    "#Given\n",
    "V=3*(10**22)                 #kg/m**3, density of SCC lattice\n",
    "p=(1/3.0)*10**-22\n",
    "\n",
    "#Calculation\n",
    "n=1                       #no. of lattice point     \n",
    "a=(n*p)**(1/3.0)                     #lattice constant\n",
    "r=(a*10**8/2)\n",
    "\n",
    "#Result\n",
    "print\"Lattice constant is\",round(a*10**8,2),\"A\"\n",
    "print\"radius of simple lattice is\",round(r,2),\"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.4 Page no.25"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Density of crystal is 8928.8 Kg/m**3\n"
     ]
    }
   ],
   "source": [
    "#Exampe  1.4\n",
    "#Determine the density of crystal\n",
    "\n",
    "#given data\n",
    "import math\n",
    "r=1.278                      #in Angstrum\n",
    "AtomicWeight=63.5            #constant\n",
    "AvogadroNo=6.023*10**23      #constant\n",
    "\n",
    "#Calculation\n",
    "#For FCC structure a=4*r/math.sqrt(2)\n",
    "a=4*r*10**-10/math.sqrt(2)   #in meter\n",
    "V=a**3                       #in meter**3\n",
    "#mass of one atom = m\n",
    "m=AtomicWeight/AvogadroNo    #in gm\n",
    "m=m/1000                     #in Kg\n",
    "n=4          # no. of atoms per unit cell for FCC structure\n",
    "rho=m*n/V                    #in Kg/m**3\n",
    "\n",
    "#Result\n",
    "print \"Density of crystal is\",round(rho,2),\"Kg/m**3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.5 Page no.26"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Density of silicon crystal is 1249.0 Kg/m**3\n"
     ]
    }
   ],
   "source": [
    "#Example 1.5\n",
    "#What is Density of silicon crystal .\n",
    "\n",
    "#given data\n",
    "n=4                     # no. of atoms per unit cell of silicon\n",
    "AtomicWeight=28         #constant\n",
    "AvogadroNo=6.021*10**23 #constant\n",
    "\n",
    "#calculation\n",
    "m=AtomicWeight/AvogadroNo  #in gm\n",
    "m=m/1000                   #in Kg\n",
    "a=5.3                      #lattice constant in Angstrum\n",
    "a=a*10**-10                #in meter\n",
    "V=a**3                     #in meter**3\n",
    "rho=m*n/V                  #in Kg/m**3\n",
    "\n",
    "#result\n",
    "print\"Density of silicon crystal is\",round(rho,0),\"Kg/m**3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.6 Page no.26"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Surface density in FCC on (111)Plane is %.e 1.02382271468e+13 atoms/mm**2\n"
     ]
    }
   ],
   "source": [
    "#Example 1.5\n",
    "#What is Surface density in FCC .\n",
    "\n",
    "#given data\n",
    "a=4.75                     #lattice constant in Angstrum\n",
    "a=a*10**-10                #in meter\n",
    "\n",
    "#Calculation\n",
    "dp=2.31/a**2               #in atom/m**2\n",
    "dp=dp/10**6                #in atom/mm**2\n",
    "\n",
    "#Result\n",
    "print \"Surface density in FCC on (111)Plane is %.e\",dp,\"atoms/mm**2\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.7 Page no. 28"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Interpolar distance in Angstrum  2.01 A\n"
     ]
    }
   ],
   "source": [
    "#Example 1.7\n",
    "#find the Interpolar distance\n",
    "\n",
    "#given data\n",
    "import math\n",
    "l=1.539         #in Angstrum\n",
    "theta=22.5           #in degree\n",
    "n=1                  #order unitless\n",
    "\n",
    "#Calculation\n",
    "d=n*l/(2*math.sin(theta*math.pi/180))    #in Angstrum\n",
    "\n",
    "#result\n",
    "print \"Interpolar distance in Angstrum \",round(d,2),\"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 1.8 Page no. 28"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of X-rays in Angstrum  0.584 A\n"
     ]
    }
   ],
   "source": [
    "#Example 1.8\n",
    "#Find the wavelength of X-rays \n",
    "\n",
    "#given data\n",
    "import math\n",
    "\n",
    "theta=16.8/2.0             #in degree\n",
    "n=2.0                      #order unitless\n",
    "d=0.4                    #in nm\n",
    "\n",
    "#Calculation\n",
    "l=(2*d*10**-9*sin(theta*math.pi/180.0))/n     #in Angstrum\n",
    "\n",
    "#result\n",
    "print \"wavelength of X-rays in Angstrum \",round(l*10**10,3),\"A\"\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
}