{
 "metadata": {
  "name": "",
  "signature": "sha256:43e40533bff9f31c3775eeac8a38c708406dc4765f3bc2853584ba2600307abe"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1: The Nucleus"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.1, Page 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "h = 6.626e-034;    # Planck's constant, Js\n",
      "e = 1.602e-019;    # Charge on an electron, C\n",
      "red_h = h/(2*math.pi*e*1e+06);    # Reduced Planck's constant, MeV\n",
      "lamda = 5.0e-015;    # de_Broglie wavelength of neutron, m\n",
      "\n",
      "#Calculations\n",
      "p = red_h/lamda;    # Momentum of the neutron, MeV-s/m\n",
      "\n",
      "#Result\n",
      "print \"The momentum of the neutron from de-Broglie relation : %5.3e MeV-s/m\"%p"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The momentum of the neutron from de-Broglie relation : 1.317e-07 MeV-s/m\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.2, Page 32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "E = [[0,0,0],[0,0,0],[0,0,0]];    # Declare a cell array of empty matrices for nuclides information\n",
      "E[0][0] = 'C';    # Assign element 'C' to (1,1) cell\n",
      "E[1][0] = 'N';    # Assign element 'N' to (2,1) cell\n",
      "E[2][0] = 'O';    # Assign element 'o' to (3,1) cell\n",
      "E[0][1] = 6;    # Assign atomic No. 6 to (1,2) cell\n",
      "E[1][1] = 7;    # Assign atomic No. 7 to (2,2) cell\n",
      "E[2][1] = 8;    # Assign atomic No. 8 to (3,2) cell\n",
      "E[0][2] = [12,13,14,16];    # Assign mass numbers for 'C' to (1,3) cell\n",
      "E[1][2] = [14,15,16,17];    # Assign mass numbers for 'N' to (2,3) cell\n",
      "E[2][2] = [14,15,16,17];    # Assign mass numbers for 'O' to (3,3) cell\n",
      "\n",
      "#Calculations&Results\n",
      "# Isotopes\n",
      "print \"\\nIsotopes:\"\n",
      "print \"\\n=========\"\n",
      "for i in range(0,3):    # Search for the three elements one-by-one\n",
      "    print \"\\n(Z = %d)\"%(E[i][1])\n",
      "    for j in range(0,4):\n",
      "       print \"\\t%s(%d)\"%(E[i][0],E[i][2][j]),\n",
      "    \n",
      "# Isotones\n",
      "print \"\\n\\nIsotones:\";\n",
      "print \"\\n========\"\n",
      "for N in range(6,10):    # Search for the neutron numbers from 6 to 9\n",
      "    print \"\\n(N = %d)\\n\"%N;\n",
      "    for i in range(0,3):\n",
      "         for j in range(0,4):\n",
      "             if  E[i][2][j]- E[i][1] == N:           # N = A-Z\n",
      "                  print \"\\t%s(%d)\"%(E[i][0],E[i][2][j]),\n",
      "              \n",
      "# Isobars\n",
      "print \"\\n\\nIsobars:\"\n",
      "print \"\\n=======\"\n",
      "for A in range(14,18):  # Search for the mass numbers from 14 to 17\n",
      "    print \"\\n(A = %d)\\n\"%A    \n",
      "    for i in range(1,3):\n",
      "         for j in range(0,3):\n",
      "             if  E[i][2][j] == A:\n",
      "                 print \"\\t%s(%d)\"%(E[i-1][0],E[i][2][j]),\n",
      "             \n",
      "             "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Isotopes:\n",
        "\n",
        "=========\n",
        "\n",
        "(Z = 6)\n",
        "\tC(12) \tC(13) \tC(14) \tC(16) \n",
        "(Z = 7)\n",
        "\tN(14) \tN(15) \tN(16) \tN(17) \n",
        "(Z = 8)\n",
        "\tO(14) \tO(15) \tO(16) \tO(17) \n",
        "\n",
        "Isotones:\n",
        "\n",
        "========\n",
        "\n",
        "(N = 6)\n",
        "\n",
        "\tC(12) \tO(14) \n",
        "(N = 7)\n",
        "\n",
        "\tC(13) \tN(14) \tO(15) \n",
        "(N = 8)\n",
        "\n",
        "\tC(14) \tN(15) \tO(16) \n",
        "(N = 9)\n",
        "\n",
        "\tN(16) \tO(17) \n",
        "\n",
        "Isobars:\n",
        "\n",
        "=======\n",
        "\n",
        "(A = 14)\n",
        "\n",
        "\tC(14) \tN(14) \n",
        "(A = 15)\n",
        "\n",
        "\tC(15) \tN(15) \n",
        "(A = 16)\n",
        "\n",
        "\tC(16) \tN(16) \n",
        "(A = 17)\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.1, Page 33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "m = 9.1e-031; # Mass of the electron, Kg\n",
      "C = 3e+08; # Velocity of the light,m/s\n",
      "\n",
      "#Calculations\n",
      "E = m*C**2/1.6e-013; # Energy of the electron at rest, MeV\n",
      "\n",
      "#Result\n",
      "print \"Energy of the electron at rest : %5.3f MeV\"%E"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy of the electron at rest : 0.512 MeV\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.2, Page 33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "r = 3.46e-015; # Radius of the nucleus, m\n",
      "r0 = 1.2e-015; # Distance of closest approach of the nucleus, m\n",
      "\n",
      "#Calculations\n",
      "A = round((r/r0)**3); # Mass number of the nucleus\n",
      "if A == 23:\n",
      "   element = \"Na\";\n",
      "elif A == 24:\n",
      "   element = \"Mg\";\n",
      "elif  A == 27:\n",
      "   element = \"Al\";\n",
      "elif  A == 28:\n",
      "   element = \"Si\";\n",
      "\n",
      "#Result\n",
      "print \"The mass number of the nucleus is %d and the nucleus is of %s\"%(A, element)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass number of the nucleus is 24 and the nucleus is of Mg\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.3, Page 34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "m = 40*(1.66e-027); # Mass of the nucleus, kg \n",
      "r0 = 1.2e-015; # Distance of the closest approach, m\n",
      "A = 40; # Atomic mass of the nucleus\n",
      "\n",
      "#Calculations\n",
      "r = r0*A**(1./3); #Radius of the nucleus, m\n",
      "V = 4./3*(math.pi*r**3); # Volume of the nucleus, m^3\n",
      "density = m/V; # Density of the nucleus, kg/m^3\n",
      "\n",
      "#Result\n",
      "print \"Radius of the nucleus: %3.1e m\\nVolume of the nucleus: %5.3e m^3\\nDensity of the nucleus: %3.1e kg/m^3\"%(r,V,density)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radius of the nucleus: 4.1e-15 m\n",
        "Volume of the nucleus: 2.895e-43 m^3\n",
        "Density of the nucleus: 2.3e+17 kg/m^3\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.4, Page 34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "m = 1.66e-027;    # Mass of a nucleon, kg\n",
      "A = 235; # Atomic mass of U-235 nucleus\n",
      "M = A*m;    #Mass of the U-235 nucleus, kg\n",
      "r0 = 1.2e-015; # Distance of closest approach, m\n",
      "\n",
      "#Calculations\n",
      "r = r0*(A)**(1./3); # Radius of the U-235 nucleus\n",
      "V = 4./3*(math.pi*r**3); # Volume of the U-235 nucleus,m^3\n",
      "d = M/V; # Density of the U-235 nucleus,kg/m^3\n",
      "\n",
      "#Result\n",
      "print \"The density of U-235 nucleus : %4.2e kg per metre cube\"%d\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The density of U-235 nucleus : 2.29e+17 kg per metre cube\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.5, Page 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "m_O = 2.7e-026; # Mass of O nucleus, kg\n",
      "r_O = 3e-015; # Radius of O nucleus, m\n",
      "V_O = 4/3*(math.pi*(r_O)**3); # Volume of O nucleus, metre cube\n",
      "d_O = m_O/V_O; # Density of O nucleus, kg/metre cube\n",
      "m_Pb = 3.4e-025; # Mass of Pb nucleus, kg\n",
      "r_Pb = 7.0e-015; # Radius of Pb nucleus, m\n",
      "\n",
      "#Calculations\n",
      "V_Pb = 4./3*(math.pi*(r_Pb)**3); # Volume of Pb nucleus, metre cube\n",
      "d_Pb = m_Pb/V_Pb; #Density of Pb nucleus,kg/metre cube\n",
      "\n",
      "#Results\n",
      "print \"The density of oxygen nucleus : %4.2e in kg/metre cube\"%d_O\n",
      "print \"The density of Pb nucleus : %4.2e in kg/metre cube\"%d_Pb\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The density of oxygen nucleus : 3.18e+17 in kg/metre cube\n",
        "The density of Pb nucleus : 2.37e+17 in kg/metre cube\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.6, Page 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "E = 5.48*1.6e-013; # Energy of alpha particle, J\n",
      "e = 1.6e-019; # Charge of an electron, C\n",
      "Z = 79; # Mas number of Au nucleus, \n",
      "epsilon_0 = 8.85e-012; # Permittivity of free space, \n",
      "\n",
      "#Calculations\n",
      "D = (2*Z*e**2)/(4*math.pi*epsilon_0*E); # Distance of closest approach, m\n",
      "\n",
      "#Result\n",
      "print \"The distance of closest appproach of alpha particle : %4.2e m\"%D\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance of closest appproach of alpha particle : 4.15e-14 m\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.7, Page 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "A = 208; # Mass number of Pb-208\n",
      "r0 = 1.2e-015; # Distance of closest approach, m\n",
      "\n",
      "#Calculations\n",
      "r = r0*((A)**(1./3)); # Radius of Pb-208, m\n",
      "\n",
      "#Result\n",
      "print \"The radius of Pb-208 : %4.2e m\"%r\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The radius of Pb-208 : 7.11e-15 m\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.1, Page 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "amu = 931.49; # Atomic mass unit, MeV\n",
      "M_p = 1.00758; # Mass of proton, amu\n",
      "M_n = 1.00897;  # Mass of neutron, amu\n",
      "M_He = 4.0028; # Mass of He nucleus, amu\n",
      "Z = 2; # Atomic number\n",
      "N = 2; # Number of neutron\n",
      "\n",
      "#Calculations\n",
      "M_defect = Z*M_p+N*M_n-M_He;    # Mass defect, amu\n",
      "BE_MeV = M_defect*amu; # Binding energy, MeV\n",
      "BE_J = M_defect*1.49239e-010;    # Binding energy, J\n",
      "\n",
      "#Results\n",
      "print \"The binding energy (in MeV): %5.2f\"%BE_MeV\n",
      "print \"The binding energy (in J): %4.2e\"%BE_J\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The binding energy (in MeV): 28.22\n",
        "The binding energy (in J): 4.52e-12\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.2, Page 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "amu = 1.49239e-010; # Atomic mass unit, J\n",
      "M_C = 12; # Mass of C-12, amu\n",
      "M_a = 4.0026;    # Mass of alpha particle, amu\n",
      "\n",
      "#Calculations\n",
      "M_3a = 3*M_a; # Mass of 3 alpha particle, amu\n",
      "D = M_C-M_3a; # Difference in two masses, amu\n",
      "E = D*amu; # Required energy,J\n",
      "\n",
      "#Result\n",
      "print \"The energy required to break 3 alpha particles : %4.2e J\"%E\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy required to break 3 alpha particles : -1.16e-12 J\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.3, Page 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_p = 1.007895; # Mass of proton, amu\n",
      "M_n = 1.008665; # Mass of neutron, amu\n",
      "M_He = 4.0026; # Mass of He-nucleus, amu\n",
      "Z = 2; # Number of proton\n",
      "N = 2; # Number of neutron\n",
      "\n",
      "#Calculations\n",
      "D_m = ((Z*M_p)+(N*M_n)-M_He); # Mass defect, amu\n",
      "amu = 931.49; # Atomic mass unit, MeV\n",
      "E = D_m*amu; # Required energy, MeV\n",
      "\n",
      "#Result\n",
      "print \"The energy required to knock out nucleons from the He nucleus = %5.2f MeV\"%E\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy required to knock out nucleons from the He nucleus = 28.43 MeV\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.4, Page 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_Fe = 55.934939; # Mass of Fe-56, amu\n",
      "M_p = 1.007825; # Mass of proton, amu\n",
      "M_n = 1.008665; # Mass of neutron, amu\n",
      "Z = 26; # Atomic number of Fe-56\n",
      "N = 30; # Number of neutron in Fe-56\n",
      "amu = 931.49; # Atomic mass unit, MeV\n",
      "\n",
      "#Calculations\n",
      "BE = ((Z*M_p)+(N*M_n)-M_Fe)*amu; # Binding energy of Fe-56, MeV\n",
      "\n",
      "#Result\n",
      "print \"The binding energy of Fe-56 : %6.4f MeV\"%BE\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The binding energy of Fe-56 : 492.2561 MeV\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.5, Page 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "amu = 931.49; # Atomic mass unit, MeV\n",
      "M_p = 1.007825; # Mass of proton, amu\n",
      "M_n = 1.008663;  # Mass of neutron, amu\n",
      "A = 2;       # Mass number of deutron, amu\n",
      "M_D = 2.014103;    # Mass of deuteron nucleus, amu\n",
      "\n",
      "#Calculations\n",
      "M_Defect = (M_p+M_n-M_D)*amu;     # Mass defect of the nucleus, MeV\n",
      "P_fraction = (M_D - A)/A;     # Packing fraction of nucleus\n",
      "\n",
      "#Results\n",
      "print \"Mass defect      %4.2f MeV\\n Packing fraction    %7.5f\"%(M_Defect,P_fraction);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass defect      2.22 MeV\n",
        " Packing fraction    0.00705\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5.6, Page 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "m_p = 1.007825; # Mass of proton, amu\n",
      "m_n = 1.008665; # Mass of neutron, amu\n",
      "m_He = 4.002634; # Mass of He-4 nucleus, amu\n",
      "amu = 931.47; # Atomic mass unit, MeV\n",
      "A = 4 # Mass number of He-4 nucleus\n",
      "\n",
      "#Calculations\n",
      "BE = (2*m_p+2*m_n-m_He)*amu; # Binding energy of He-4 nucleus, MeV\n",
      "Av_BE = BE/A; # Average binding energy or binding energy per nucleon, MeV\n",
      "\n",
      "#Result\n",
      "print \"The binding energy per nucleon : %4.2f MeV\"%Av_BE\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The binding energy per nucleon : 7.07 MeV\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.6.1, Page 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "l1 = 1;    # Orbital qunatum number for p-state nucleon\n",
      "l2 = 2;    # Orbital qunatum number for d-state nucleon\n",
      "\n",
      "#Calculations&Result\n",
      "# Display the value of L within the for loop\n",
      "print \"The possible L values will be\"\n",
      "for i in range(abs(l1-l2),abs(l1+l2+1)):        # Coupling of l-orbitals \n",
      "    print \"\\t %1d\"%i,\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The possible L values will be\n",
        "\t 1 \t 2 \t 3\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.6.2, Page 40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy\n",
      "#Variable declaration\n",
      "# Get the l value from the user\n",
      "l = 3;    # Orbital qunatum number for f-state proton\n",
      "s = 0.5;    # Magnitude of spin quantum number\n",
      "\n",
      "#Calculations&Result\n",
      "# Display the value of j within the for loop\n",
      "\n",
      "print \"The j values will be between\"\n",
      "for i in numpy.arange((l-s),(l+s+1)):        # l-s Coupling \n",
      "    print \"\\t %3.1f\"%i,\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The j values will be between\n",
        "\t 2.5 \t 3.5\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.11.1, Page 40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 1000; # Potential difference, volts\n",
      "R = 0.122; # Radius of the circular path, m\n",
      "B = 1500e-04; # Magnetic field, tesla\n",
      "e = 1.602e-019; # Charge of the electron, C\n",
      "amu = 1.673e-027; # Atomic mass unit, kg\n",
      "\n",
      "#Calculations\n",
      "v = (2*V)/(R*B); # Speed of the ion, m/s\n",
      "M = 2*e*V/v**2; # Mass of the ion, kg\n",
      "A = M/amu; # Mass number\n",
      "\n",
      "#Result\n",
      "print \"    Speed   >  %5.3e m/s  \\n    Mass    >  %5.3e kg  \\n    Mass number   >  %5.2f \"%(v, M, A)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "    Speed   >  1.093e+05 m/s  \n",
        "    Mass    >  2.682e-26 kg  \n",
        "    Mass number   >  16.03 \n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.11.2, Page 41"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import numpy\n",
      "\n",
      "#Variable declaration\n",
      "amu = 1.673e-027; # Atomic mass unit, kg\n",
      "E = 5e+04; # Electric field, V/m\n",
      "B1 = 0.4; # Magnetic field, tesla\n",
      "v = E/B1; # Velocity of ions, m/s\n",
      "B = 0.8; # Magnetic field, tesla\n",
      "e = 1.602e-019; #charge of electron,C\n",
      "\n",
      "#Calculations\n",
      "m_Ar = [36,38,40]    # Masses of three isoptopes of Ar, amu\n",
      "\n",
      "r_Ar = [0,0,0];    # Array of radii of three Ar ions, mm\n",
      "for i in range(len(r_Ar)):\n",
      "    r_Ar[i] = (m_Ar[i]*amu*v)/(B*e)*1e+03; # Radius of Ar ion orbit, mm\n",
      "\n",
      "d1 = 2*(r_Ar[1]-r_Ar[0]);    # Distance b/w first and second line, mm\n",
      "d2 = 2*(r_Ar[2]-r_Ar[1]);    # Distance b/w second and third line, mm\n",
      "\n",
      "#Results\n",
      "print \"The distance between successive lines due to three different isotopes : %3.1f mm and %3.1f mm\"%(d1,d2)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance between successive lines due to three different isotopes : 6.5 mm and 6.5 mm\n"
       ]
      }
     ],
     "prompt_number": 36
    }
   ],
   "metadata": {}
  }
 ]
}