{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# chapter7 :Maxwell's Equations and Electromagnetic Waves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.1;page no:304"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.1,page no:304\n",
      "Average value of electric field at distance m in Volt/m: 86.57\n"
     ]
    }
   ],
   "source": [
    "#cal of Average value of electric field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "p = 1000 # power in watt\n",
    "d = 2 # Distance from lamp in m\n",
    "epsilon_0 = 8.854e-12 # Permittivity of free space\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "print(\"Example 7.1,page no:304\")\n",
    "s = p/(4*math.pi*d**2)# Calculation of pointing vector\n",
    "E_H_ratio = math.sqrt(mu_0/epsilon_0) # Calculation of ratio of Electric field and magnetic field\n",
    "E= math.sqrt(E_H_ratio*s) # Calculation of  Electric field \n",
    "print(\"Average value of electric field at distance m in Volt/m:\"),round(E,2)\n",
    "# Answer in book is 48.87 volt/m which is due to wrong calculation at intermediate steps"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.2;page no:304"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.2,page no:304\n",
      "Average value of electric field  in Volt/m: 1027.1\n",
      "Average value of magnetic field in Amp turn/m: 2.726\n"
     ]
    }
   ],
   "source": [
    "#cal of Average value of electric field and magnetic field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "p = 2 # power in cal/min/cm^2\n",
    "epsilon_0 = 8.854e-12 # Permittivity of free space\n",
    "mu_0 = 4*math.pi*1e-7 # permeability of free space\n",
    "print(\"Example 7.2,page no:304\")\n",
    "s = p*4.2e4/60 # Calculation of pointing vector\n",
    "E_H_ratio = math.sqrt(mu_0/epsilon_0) # Calculation of ratio of Electric field and magnetic field\n",
    "E= math.sqrt(E_H_ratio*s) # Calculation of Electric field \n",
    "H = s/E # Calculation of Electric field \n",
    "print(\"Average value of electric field  in Volt/m:\"),round(E*math.sqrt(2),1)\n",
    "print(\"Average value of magnetic field in Amp turn/m:\"),round(H*math.sqrt(2),3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.3;page no:305"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.3,page no:305\n",
      "Skin depth penetration in cm: 0.0009\n"
     ]
    }
   ],
   "source": [
    "#cal of Skin depth penetration\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "mu_0 = 4*math.pi*1e-7 # permeability of free space\n",
    "mu = mu_0 #permeability of silver\n",
    "sigma = 3e7 # conductivity in mhos/m\n",
    "f = 1e8 # frequency in Hz\n",
    "print(\"Example 7.3,page no:305\")\n",
    "omega = 2*math.pi/f # Calculation of time period\n",
    "delta = math.sqrt(2/(omega*sigma*mu)) # Calculation of skin depth penetration\n",
    "Delta = (delta/100)*100 # Rounding off\n",
    "print(\"Skin depth penetration in cm:\"),round(Delta*1e-6,4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.5;page no:307"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.5,page no:307\n",
      "Frequency required for penetration of depth in MHz= 6.0\n",
      "Sea water is good conductor at frequency lesser than 1e8 Hz\n"
     ]
    }
   ],
   "source": [
    "#cal of Frequency required for penetration of depth and sea water can be considered as good conductor\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "k = 80 # relative Dielectric constant of sea water\n",
    "epsilon_0 = 1/9e9 # Permittivity of free space\n",
    "epsilon = 80*epsilon_0 # Permittivity of free space\n",
    "sigma = 4.3 # conductivity in mho/m\n",
    "delta = 10 # penetration depth in cm\n",
    "mu_0 = 4*math.pi*1e-7 # permeability f free space\n",
    "F = 1e8 # Given frequency in Hz\n",
    "print(\"Example 7.5,page no:307\")\n",
    "f = (1/(math.pi*mu_0*sigma))/(delta*1e-2)**2 # Calculation of frequency\n",
    "print(\"Frequency required for penetration of depth in MHz=\"),round(f/10**6)\n",
    "omega = 2*math.pi*F\n",
    "x = 2*sigma/(epsilon*omega)\n",
    "if x>1:\n",
    "\tprint(\"Sea water is good conductor at frequency lesser than 1e8 Hz\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.7;page no:308"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.7,page no:308\n",
      "For MHz frequency, Penetration depth in cm: 1.0 3.6\n",
      "Silicon is good conductor at frequency lesser than 1e9 Hz:\n"
     ]
    }
   ],
   "source": [
    "#cal of Penetration depth and frequency\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "k = 12 # relative Dielectric constant of sea water\n",
    "epsilon_0 = 1/9e9 # Permittivity of free space\n",
    "sigma = 2 # conductivity in mho/cm\n",
    "mu_0 = 4*math.pi*1e-7 # permeability f free space\n",
    "f= 1e9 # Given frequency in Hz\n",
    "F = 1e6 # Given frequency in Hz\n",
    "print(\"Example 7.7,page no:308\")\n",
    "delta = math.sqrt(2/(2*math.pi*F*mu_0*sigma*100)) # Calculation of frequency\n",
    "print(\"For MHz frequency, Penetration depth in cm:\"),round(F/10**6,1),round(delta*100,1)\n",
    "omega = 2*math.pi*f\n",
    "x = 2*sigma*100/(k*epsilon_0*omega)\n",
    "if x>1:\n",
    "    print(\"Silicon is good conductor at frequency lesser than 1e9 Hz:\")\n",
    "# Answer in book is 3.6 cm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.8;page no:309"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.8,page no:309\n",
      "Required frequency in Hz: 436729.2\n",
      "The incident electromagnetic wave is the radio part of spectrum.\n"
     ]
    }
   ],
   "source": [
    "#cal of frequency of incident electromagnetic wave\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "mu_0 = 4*math.pi*1e-7 # permeability of free space\n",
    "mu = mu_0 #permeability of silver\n",
    "sigma = 5.8e7 # conductivity in simens /m\n",
    "delta = 0.1 # Skin depth penetration in mm\n",
    "print(\"Example 7.8,page no:309\")\n",
    "f = 2/((delta*1e-3)**2*sigma*mu*2*math.pi) # Calculation of skin depth penetration\n",
    "print(\"Required frequency in Hz:\"),round(f,1)\n",
    "print(\"The incident electromagnetic wave is the radio part of spectrum.\")\n",
    "# Answer in book is 3.36e5 Hz. Difference is due to approximation at intermediate stages"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.9;page no:310"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.9,page no:310\n",
      "Skin depth penetration in micrometre: 0.92\n"
     ]
    }
   ],
   "source": [
    " #cal of Skin depth penetration\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "mu = mu_0 #Permeability of silver\n",
    "sigma = 3e7 # conductivity in mhos/m\n",
    "f = 1e10 # frequency in Hz\n",
    "print(\"Example 7.9,page no:310\")\n",
    "delta = math.sqrt(1/(math.pi*sigma*f*mu)) # Calculation of skin depth penetration\n",
    "print(\"Skin depth penetration in micrometre:\"),round(delta*1e6,2)\n",
    "# Answer in book is 0.93 micrometer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 7.10;page no:310"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.10,page no:310\n",
      "Average value of electric field at distance  m in Volt/m: 376.7\n",
      "Average value of magnetic field at distance  m in Amp-turn/m: 0.106\n"
     ]
    }
   ],
   "source": [
    "#cal of Average value of electric field and magnetic field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "p = 500. # power in watt\n",
    "d = 1. # Distance from lamp in m\n",
    "epsilon_0 = 8.854e-12 # Permittivity of free space\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "print(\"Example 7.10,page no:310\")\n",
    "s = p/(4.*math.pi*d**2)# Calculation of pointing vector\n",
    "E_H_ratio = math.sqrt(mu_0/epsilon_0) # Calculation of ratio of Electric field and magnetic field\n",
    "H = s/E_H_ratio # Calculation of Electric field \n",
    "h = (H*100.)/100. # rounding off for 2 decimal places\n",
    "E= p/(4.*math.pi*h) # Calculation of Electric field \n",
    "print(\"Average value of electric field at distance  m in Volt/m:\"),round(E,1)\n",
    "print(\"Average value of magnetic field at distance  m in Amp-turn/m:\"),round(h,3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.11;page no:312"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.11,page no:312\n",
      "Required frequency in MHz: 8.0\n",
      "The incident electromagnetic wave is the radio part of spectrum\n"
     ]
    }
   ],
   "source": [
    "#cal of frequency of incident radiation and location in electromagnetic\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "mu = mu_0 #Permeability of silver\n",
    "sigma = 3.5e7 # conductivity in simens /m\n",
    "delta = 0.03 # Skin depth penetration in mm\n",
    "print(\"Example 7.11,page no:312\")\n",
    "f = 2/((delta*1e-3)**2*sigma*mu*2*math.pi) # Calculation of skin depth penetration\n",
    "print(\"Required frequency in MHz:\"),round(f/1e6,0)\n",
    "print(\"The incident electromagnetic wave is the radio part of spectrum\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.12;page no:312"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.12,page no:312\n",
      "Solar energy received during solar eclipse in Cal per min per m^2: 2.1\n"
     ]
    }
   ],
   "source": [
    "#cal of Solar energy received during solar eclipse\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "p = 3.8e26 # power radiated by moon in watt\n",
    "d_sun = 1.44e11 # Distance between sun and earth in meter\n",
    "d_moon = 3e8 #Distance between moon and earth in meter\n",
    "epsilon_0 = 8.854e-12 # Permittivity of free space\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "print(\"Example 7.12,page no:312\")\n",
    "s = p/(4*math.pi*d_sun**2)# Calculation of solar energy received during solar eclipse in watt /m^2\n",
    "S = s*60/(4.2*1e4) # Unit conversion\n",
    "print(\"Solar energy received during solar eclipse in Cal per min per m^2:\"),round(S,1)\n",
    "# Ansewr in book is 2.1 cal per min per m^2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 7.13;page no:313"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 7.13,page no:313\n",
      "Skin depth penetration in nm: 3.9\n"
     ]
    }
   ],
   "source": [
    "#cal of Skin depth penetration\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "mu_0 = 4*math.pi*1e-7 # Permeability of free space\n",
    "mu = mu_0 #Permeability of silver\n",
    "sigma = 3.5e7 # conductivity in simens /m\n",
    "lamda = 6328 # Wavelength in angstrom\n",
    "c = 3e8# Speed of light in m/sec\n",
    "print(\"Example 7.13,page no:313\")\n",
    "f = c/(lamda*1e-10)\n",
    "omega = 2*math.pi/f # Calculation of time period\n",
    "f = c/(lamda*1e-10) # Calculation of frequency in Hz\n",
    "delta = math.sqrt(1/(math.pi*f*sigma*mu)) # Calculation of skin depth penetration\n",
    "print(\"Skin depth penetration in nm:\"),round(delta*1e9,1)\n",
    "# Answer in book is 3.9 mm, unit used in 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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
