{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 13: Bonding In Crystals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 1, Page number 398"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "potential energy is -5.76 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "x=9*10**9;              #assume x=1/(4*pi*epsilon0)\n",
    "e=1.6*10**-19;          #charge(coulomb)\n",
    "r0=2.5*10**-10;         #radius(m)\n",
    "\n",
    "#Calculation\n",
    "U=-e*x/r0;              #potential energy(eV)\n",
    "\n",
    "#Result\n",
    "print \"potential energy is\",U,\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 2, Page number 398"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "equilibrium distance is -2.25 angstrom\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "x=9*10**9;              #assume x=1/(4*pi*epsilon0)\n",
    "e=1.6*10**-19;          #charge(coulomb)\n",
    "U=6.4;                  #potential energy(eV)\n",
    "\n",
    "#Calculation\n",
    "r0=-e*x/U;              #equilibrium distance(m)\n",
    "\n",
    "\n",
    "#Result\n",
    "print \"equilibrium distance is\",r0*10**10,\"angstrom\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 3, Page number 399"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "compressibility of the solid is -25.087 *10**14\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "x=9*10**9;              #assume x=1/(4*pi*epsilon0)\n",
    "e=1.6*10**-19;          #charge(coulomb)\n",
    "alpha=1.76;             #madelung constant\n",
    "n=0.5;                  #repulsive exponent\n",
    "r0=4.1*10**-4;          #equilibrium distance(m)\n",
    "\n",
    "#Calculation\n",
    "C=18*r0**4/(x*alpha*e**2*(n-1));     #compressibility of the solid\n",
    "\n",
    "#Result\n",
    "print \"compressibility of the solid is\",round(C*10**-14,3),\"*10**14\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 4, Page number 399"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lattice energy is -6.45 eV\n",
      "energy needed to form neutral atoms is -6.17 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "x=9*10**9;              #assume x=1/(4*pi*epsilon0)\n",
    "e=1.6*10**-19;          #charge(coulomb)\n",
    "alpha=1.763;            #madelung constant\n",
    "n=10.5;                 #repulsive exponent\n",
    "r0=3.56*10**-10;        #equilibrium distance(m)\n",
    "IE=3.89;                #ionisation energy(eV)\n",
    "EA=-3.61;               #electron affinity(eV)\n",
    "\n",
    "#Calculation\n",
    "U=-x*alpha*e**2*(1-(1/n))/(e*r0);     #lattice energy(eV)  \n",
    "E=U+EA+IE;                            #energy needed to form neutral atoms\n",
    "\n",
    "#Result\n",
    "print \"lattice energy is\",round(U,2),\"eV\"\n",
    "print \"energy needed to form neutral atoms is\",round(E,2),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 5, Page number 400"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lattice energy is -3.98 eV\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "x=9*10**9;              #assume x=1/(4*pi*epsilon0)\n",
    "e=1.6*10**-19;          #charge(coulomb)\n",
    "alpha=1.748;            #madelung constant\n",
    "n=9;                 #repulsive exponent\n",
    "r0=2.81*10**-10;        #equilibrium distance(m)\n",
    "\n",
    "#Calculation\n",
    "U=-x*alpha*e**2*(1-(1/n))/(e*r0);     #lattice energy(eV)  \n",
    "\n",
    "#Result\n",
    "print \"lattice energy is\",round(U/2,2),\"eV\"\n",
    "print \"answer given in the book is wrong\""
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
