{
 "metadata": {
  "name": "",
  "signature": "sha256:5cdc0313c39e461d83bef4f404708f38e979d4c9312a95284be2bd9b855678fb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter4-Electron Ballistics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "##Example 4.1\n",
      "##Calculation of acceleration,time taken,distance covered and kinetic energy of an accelerating proton\n",
      "\n",
      "##given values\n",
      "m=1.67  *10**-27;##mass of proton in kg\n",
      "q=1.602 *10**-19;##charge of proton in Coulomb\n",
      "v1=0;##initial velocity in m/s\n",
      "v2=2.5*10**6;##final velocity in m/s\n",
      "E=500.;##electric field strength in V/m\n",
      "##calculation\n",
      "a=E*q/m;##acceleration\n",
      "print'%s %.1f %s'%('acceleration of proton in (m/s^2) is:',a,'');\n",
      "t=v2/a;##time\n",
      "print'%s %.5f %s'%('time(in s) taken by proton to reach the final velocity is:',t,'');\n",
      "x=a*t**2./2.;##distance\n",
      "print'%s %.1f %s'%('distance (in m)covered by proton in this time is:',x,'');\n",
      "KE=E*q*x;##kinetic energy\n",
      "print'%s %.3e %s'%('kinetic energy(in J) at the time is:',KE,'');\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "acceleration of proton in (m/s^2) is: 47964071856.3 \n",
        "time(in s) taken by proton to reach the final velocity is: 0.00005 \n",
        "distance (in m)covered by proton in this time is: 65.2 \n",
        "kinetic energy(in J) at the time is: 5.219e-15 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.2\n",
      "##electrostatic deflection\n",
      "##given values\n",
      "pi=3.141\n",
      "V1=2000.;##in volts,potential difference through which electron beam is accelerated\n",
      "l=.04;##length of rectangular plates\n",
      "d=.015;##distance between plates\n",
      "V=50.;##potential difference between plates\n",
      "##calculations\n",
      "alpha=math.atan(l*V/(2.*d*V1))*(180./pi);##in degrees\n",
      "print'%s  %.1f %s'%('angle of deflection of electron beam is:',alpha,'')\n",
      "v=5.93*(10**5)*math.sqrt(V1);##horizontal velocity in m/s\n",
      "t=l/v;##in s\n",
      "print'%s %.3e %s'%('transit time through electric field is:',t,'')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle of deflection of electron beam is:  1.9 \n",
        "transit time through electric field is: 1.508e-09 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.3\n",
      "##electron projected at an angle into a uniform electric field\n",
      "##given values\n",
      "v1=4.5*10**5;##initial speed in m/s\n",
      "alpha=37*math.pi/180.;##angle of projection in degrees\n",
      "E=200.;##electric field intensity in N/C\n",
      "e=1.6*10**-19;##in C\n",
      "m=9.1*10**-31;##in kg\n",
      "a=e*E/m;##acceleration in m/s**2\n",
      "t=2*v1*math.sin(alpha)/a;##time in s\n",
      "print'%s %.2e %s'%('time taken by electron to return to its initial level is:',t,'')\n",
      "H=(v1**2.*math.sin(alpha)*math.sin(alpha))/(2.*a);##height in m\n",
      "print'%s %.4f %s'%('maximum height reached by electron is:',H,'')\n",
      "s=(v1**2.)*(2.*math.sin(alpha)*math.cos(alpha))/(2.*a);##print'%s %.1f %s'%lacement in m\n",
      "print'%s %.4f %s'%('horizontal displacement(in m)when it reaches maximum height is:',s,'')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "time taken by electron to return to its initial level is: 1.54e-08 \n",
        "maximum height reached by electron is: 0.0010 \n",
        "horizontal displacement(in m)when it reaches maximum height is: 0.0028 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.4\n",
      "##motion of an electron in a uniform magnetic field\n",
      "##given values\n",
      "V=200.;##potential difference through which electron is accelerated in volts\n",
      "B=0.01;##magnetic field in wb/m**2\n",
      "e=1.6*10**-19;##in C\n",
      "m=9.1*10**-31;##in kg\n",
      "v=math.sqrt(2.*e*V/m);##electron velocity in m/s\n",
      "print'%s %.1f %s'%('electron velocity is:',v,'')\n",
      "r=m*v/(e*B);##in m\n",
      "print'%s %.4f %s'%('radius of path (in m)is:',r,'')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "electron velocity is: 8386278.7 \n",
        "radius of path (in m)is: 0.0048 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.5\n",
      "##motion of an electron in a uniform magnetic field acting at an angle\n",
      "##given values\n",
      "v=3*10**7;##electron speed\n",
      "B=.23;##magnetic field in wb/m**2\n",
      "q=45*math.pi/180;##in degrees,angle in which electron enter field\n",
      "e=1.6*10**-19;##in C\n",
      "m=9.1*10**-31;##in kg\n",
      "R=m*v*math.sin(q)/(e*B);##in m\n",
      "print'%s %.5f %s'%('radius of helical path is:',R,'')\n",
      "p=2*math.pi*m*v*math.cos(q)/(e*B);##in m\n",
      "print'%s %.4f %s'%('pitch of helical path(in m) is:',p,'')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "radius of helical path is: 0.00052 \n",
        "pitch of helical path(in m) is: 0.0033 \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.6\n",
      "##Magnetostatic deflection\n",
      "##given values\n",
      "D=.03;##deflection in m\n",
      "m=9.1*10**-31;##in kg\n",
      "e=1.6*10**-19;##in C\n",
      "L=.15;##distance between CRT and anode in m\n",
      "l=L/2.;\n",
      "V=2000.;##in voltsin wb/\n",
      "B=D*math.sqrt(2.*m*V)/(L*l*math.sqrt(e));##in wb/m**2\n",
      "print'%s %.4f %s'%('transverse magnetic field acting (in wb/m^2)is:',B,'')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "transverse magnetic field acting (in wb/m^2)is: 0.0004 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg57"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 4.7\n",
      "##electric and magnetic fields in crossed configuration\n",
      "##given values\n",
      "B=2*10**-3;##magnetic field in wb/m**2\n",
      "E=3.4*10**4;##electric field in V/m\n",
      "m=9.1*10**-31;##in kg\n",
      "e=1.6*10**-19;##in C\n",
      "v=E/B;##in m/s\n",
      "print'%s %.1f %s'%('electron speed is:',v,'')\n",
      "R=m*v/(e*B);##in m\n",
      "print'%s %.3f %s'%('radius of circular path (in m) when electric field is switched off',R,'')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "electron speed is: 17000000.0 \n",
        "radius of circular path (in m) when electric field is switched off 0.048 \n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}