{
 "metadata": {
  "name": "",
  "signature": "sha256:7c85091bd4e24d60bc3e76c728778479287ddcc4fa6749b5ce2d1adbd2e10621"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "8: Maxwell's equations"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.1, Page number 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "K=4.3;     #dielectric constant\n",
      "c=3*10**8;   #velocity of light in vacuum\n",
      "\n",
      "#Calculation\n",
      "n=round(math.sqrt(K),2);    #refractive index of quartz\n",
      "v=c/n;    #velocity of light in quartz(m/s)\n",
      "\n",
      "#Result\n",
      "print \"refractive index of quartz is\",n\n",
      "print \"velocity of light in quartz is\",round(v/10**8,2),\"*10**8 m/s\"\n",
      "print \"answer for velocity given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "refractive index of quartz is 2.07\n",
        "velocity of light in quartz is 1.45 *10**8 m/s\n",
        "answer for velocity given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.2, Page number 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "epsilon0=8.87*10**-12;   #dielectric permittivity of free space\n",
      "E=1.2*10**6;     #electric field intensity(N/C)\n",
      "\n",
      "#Calculation\n",
      "Ed=(1/2)*epsilon0*(E**2);     #energy density(J/m**2)\n",
      "\n",
      "#Result\n",
      "print \"energy density is\",round(Ed,3),\"J/m**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "energy density is 6.386 J/m**2\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.3, Page number 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "E0=3*10**6;    #dielectric voltage(V/m)\n",
      "c=3*10**8;   #velocity of light in vacuum\n",
      "mew0=4*math.pi*10**-7;   \n",
      "\n",
      "#Calculation\n",
      "Av=(E0**2)/(2*c*mew0);    #average value of Poynting vector(W/m**2)\n",
      "\n",
      "#Result\n",
      "print \"average value of Poynting vector is\",round(Av/10**11,2),\"*10**11 W/m**2\"\n",
      "print \"answer given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "average value of Poynting vector is 0.12 *10**11 W/m**2\n",
        "answer given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 13
    }
   ],
   "metadata": {}
  }
 ]
}