{
 "metadata": {
  "name": "",
  "signature": "sha256:1087fb8dbcb5b183b8a1d36b431412b33d35209d5f6a3a237469594e817213fb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4 Gauss theorem"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 Page no 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E=25                           #V/m\n",
      "s=150*10**-4                    #m**2\n",
      "a=60                            #degree\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=E*s*math.cos(a*3.14/180.0)\n",
      "\n",
      "#Result\n",
      "print\"Flux of the electric field is\",round(A,4),\"Nm**2/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flux of the electric field is 0.1877 Nm**2/C\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 Page no 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E=3*10**3               #N/C\n",
      "S=10**-2                    #m**2\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "a=E*S\n",
      "A=E*S*math.cos(60*3.14/180.0)\n",
      "\n",
      "#Result\n",
      "print\"(a) Flux of the field is\",a,\"Nm**2/C\"\n",
      "print\"(b) Flux through the square is\", round(A,0),\"Nm**2/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Flux of the field is 30.0 Nm**2/C\n",
        "(b) Flux through the square is 15.0 Nm**2/C\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3 Page no 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "e=8.854*10**-12                        #C**2/N/m**2\n",
      "q=1                                    #C\n",
      "\n",
      "#Calculation\n",
      "a=q/e\n",
      "\n",
      "#Result\n",
      "print\"Number of electric lines are\",round(a*10**-11,3)*10**11"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of electric lines are 1.129e+11\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 Page no 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=8*10**3                    #Nm**2/C\n",
      "e=8.854*10**-12               #C**2/N/m**2\n",
      "\n",
      "#Calculation\n",
      "q=a*e\n",
      "\n",
      "#Result\n",
      "print\"(a) Net charge inside the box is\",q,\"C\"\n",
      "print\"(b) If the net outward flux is zero,we can't conclude that the charge inside the box is zero.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Net charge inside the box is 7.0832e-08 C\n",
        "(b) If the net outward flux is zero,we can't conclude that the charge inside the box is zero.\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5 Page no 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "q=10**-5\n",
      "e=8.854*10**-12\n",
      "\n",
      "#Calculation\n",
      "a=q/(6.0*e)\n",
      "\n",
      "#Result\n",
      "print\"Magnitude of electric flux is\", round(a*10**-5,2),\"*10**5 Nm**2/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnitude of electric flux is 1.88 *10**5 Nm**2/C\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6 Page no 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E=9*10**4                         #N/C\n",
      "r=0.04                                #m\n",
      "m=9*10**9\n",
      "\n",
      "#Calculation\n",
      "l=E*r/(2.0*m)\n",
      "\n",
      "#Result\n",
      "print\"Linear charge density is\", l,\"C/m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Linear charge density is 2e-07 C/m\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7 Page no 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=5*10**-6                       #C/m**2\n",
      "e=8.854*10**-12                   #C**2/Nm**2\n",
      "r=0.1                             #m\n",
      "a1=60                             #Degree\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "A=(a*math.pi*r**2*math.cos(a1*3.14/180.0))/(2.0*e)\n",
      "\n",
      "#Result\n",
      "print\"Electric flux is\", round(A*10**-3,2),\"*10**3 N m**2/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Electric flux is 4.44 *10**3 N m**2/C\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8 Page no 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "a=17*10**-22                       #C/m**2\n",
      "e=8.854*10**-12\n",
      "\n",
      "#Calculation\n",
      "E=a/e\n",
      "\n",
      "#Result\n",
      "print\"(a) Electric field to the left of the plate is zero\"\n",
      "print\"(b) Electric field to the right of the plate is zero\"\n",
      "print\"(c) Electric field between the plates is\",round(E*10**10,2)*10**-10,\"N/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Electric field to the left of the plate is zero\n",
        "(b) Electric field to the right of the plate is zero\n",
        "(c) Electric field between the plates is 1.92e-10 N/C\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9 Page no 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "q=1.6*10**-7                        #C\n",
      "R=0.12                              #m\n",
      "m=9*10**9\n",
      "r=0.18\n",
      "\n",
      "#Calculation\n",
      "E=(m*q)/R**2\n",
      "E1=(m*q)/r**2\n",
      "\n",
      "#Result\n",
      "print\"(a) ELectric field inside the sphere is zero\"\n",
      "print\"(b) Electric field outside the sphere is\",E,\"N/C\"\n",
      "print\"(c) Electric field at a point 18 cm from the centre is\", round(E1*10**-4,2),\"*10**4 N/C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) ELectric field inside the sphere is zero\n",
        "(b) Electric field outside the sphere is 100000.0 N/C\n",
        "(c) Electric field at a point 18 cm from the centre is 4.44 *10**4 N/C\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.11 Page no 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "e=50\n",
      "V=0.2\n",
      "m=9*10**9\n",
      "\n",
      "#Calculation\n",
      "q=e*V**2/m\n",
      "\n",
      "#Result\n",
      "print\"Charge contained in the sphere is\",round(q*10**10,2)*10**-10,\"C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Charge contained in the sphere is 2.22e-10 C\n"
       ]
      }
     ],
     "prompt_number": 56
    }
   ],
   "metadata": {}
  }
 ]
}