{
 "metadata": {
  "name": "",
  "signature": "sha256:ca682350308b29c013e46db9f08b9b34713af4db683eab2d3a58c670cd39d090"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4: Nuclear Reactions"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3.1, Page 179"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "t = 10**-5; # Thickness of Li(3,7), m\n",
      "d = 500; # Density, Kg/m^3\n",
      "N = 6.023e+026; # Number of  nuclei in 7-Kg of Li-7\n",
      "M = 7 ; # Molar mass of Li\n",
      "\n",
      "#Calculations\n",
      "n = d*N*t/M; # Number of Li(3,7) nuclei/area\n",
      "N_p = 10**8; # Number of neutron produced/s\n",
      "N_0 = 10**13; # Number of incident particle striking/unit area of target\n",
      "C_s = N_p/(N_0*n*10**(-28)); #  Cross section, b\n",
      "\n",
      "#Result\n",
      "print \"Cross section : %5.3f b\"%C_s\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cross section : 0.232 b\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3.2, Page 180"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "t = 0.2e-03; # Thickness of Cd sheet, m\n",
      "d = 8.64e+03; # Density, Kg/m^3\n",
      "N = 6.023e+026; # Number of  nuclei in 7-Kg of Li-7\n",
      "M = 112 ; # Atomic mass of Cd-113, amu\n",
      "C_s = 20000e-028; #  Cross section of neutron for Cd-113, m^2\n",
      "\n",
      "#Calculations\n",
      "n = 0.12*d*N/M; # Number of Cd atoms/volume, atoms/m^3\n",
      "F_inc_absorb = (1-math.exp(-n*C_s*t))*100; # Fraction of neutron absorbed \n",
      "\n",
      "#Result\n",
      "print \"Fraction of neutron absorbed by Cd sheet : %4.2f percent\"%F_inc_absorb"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fraction of neutron absorbed by Cd sheet : 89.25 percent\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4.1, Page 181"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Declare three cells (for three reactions)\n",
      "R1 = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]\n",
      "R2 = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]\n",
      "R3 = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]\n",
      "# Enter data for first cell (Reaction)\n",
      "R1[0][0] = 'Al'; # Element\n",
      "R1[0][1] = 13;   # Atomic number\n",
      "R1[0][2] = 27;    # Mass number\n",
      "R1[0][3] = 0;    # Lepton number \n",
      "R1[1][0] = 'He';\n",
      "R1[1][1] = 2;\n",
      "R1[1][2] = 4;\n",
      "R1[1][3] = 0;\n",
      "R1[2][0] = 'Si';\n",
      "R1[2][1] = 14;\n",
      "R1[2][2] = 30;\n",
      "R1[1][3] = 0;\n",
      "R1[3][0] = 'n';\n",
      "R1[3][1] = 0;\n",
      "R1[3][2] = 1;\n",
      "R1[1][3] = 0;\n",
      "# Enter data for second cell (Reaction)\n",
      "R2[0][0] = \"U\";\n",
      "R2[0][1] = 92;\n",
      "R2[0][2] = 235;\n",
      "R2[0][3] = 0;\n",
      "R2[1][0] = 'n';\n",
      "R2[1][1] = 0;\n",
      "R2[1][2] = 1;\n",
      "R2[1][3] = 0;\n",
      "R2[2][0] = 'Ba';\n",
      "R2[2][1] = 56;\n",
      "R2[2][2] = 143;\n",
      "R2[2][3] = 0;\n",
      "R2[3][0] = 'Kr';\n",
      "R2[3][1] = 36;\n",
      "R2[3][2] = 90;\n",
      "R2[3][3] = 0;\n",
      "R2[4][0] = '2n';\n",
      "R2[4][1] = 0;\n",
      "R2[4][2] = 1;\n",
      "R1[4][3] = 0;\n",
      "# Enter data for third cell (Reaction)\n",
      "R3[0][0] = 'P';\n",
      "R3[0][1] = 15;\n",
      "R3[0][2] = 32;\n",
      "R3[0][3] = 0;\n",
      "R3[1][0] = 'S';\n",
      "R3[1][1] = 16;\n",
      "R3[1][2] = 32;\n",
      "R3[1][3] = 0;\n",
      "R3[2][0] = 'e';\n",
      "R3[2][1] = -1;\n",
      "R3[2][2] = 0;\n",
      "R3[2][3] = 0;\n",
      "R3[3][0] = 'v_e';\n",
      "R3[3][1] = 0;\n",
      "R3[3][2] = 0;\n",
      "R3[3][3] = 0;\n",
      "\n",
      "#Calculations&Results\n",
      "# Declare a function returning equality status of nucleon number\n",
      "def check_nucleon(nr_sum,np_sum):\n",
      "        if nr_sum == np_sum:\n",
      "            return 1;\n",
      "        else: \n",
      "            return 0;\n",
      "            \n",
      "# Declare a function returning equality status of proton number\n",
      "def check_proton(pr_sum,pp_sum):\n",
      "        if pr_sum == pp_sum:\n",
      "            return 1;\n",
      "        else: \n",
      "            return 0;\n",
      "\n",
      "# Declare a function returning equality status of lepton number\n",
      "def check_lepton(lr_sum,lp_sum):\n",
      "        if lr_sum == lp_sum:\n",
      "            return 1;\n",
      "        else: \n",
      "            return 0;\n",
      "            \n",
      "# Reaction-I\n",
      "print(\"\\n\\n\\nReaction-I:\\n\\n\");\n",
      "pr_sum = R1[0][1]+R1[1][1];\n",
      "pp_sum = R1[2][1]+R1[3][1];\n",
      "nr_sum = R1[0][2]+R1[1][2];\n",
      "np_sum = R1[2][2]+R1[3][2];\n",
      "lr_sum = R1[0][3]+R1[1][3];\n",
      "lp_sum = R1[2][3]+R1[3][3]; \n",
      "if (check_nucleon(nr_sum,np_sum) and check_proton(pr_sum,pp_sum) and check_lepton(lr_sum,lp_sum) == 1):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\nis possible\"%( R1[0][0], R1[0][2], R1[1][0], R1[1][2], R1[2][0], R1[2][2], R1[3][0], R1[3][2]);\n",
      "elif (check_proton(pr_sum,pp_sum) == 0):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\nis impossible\"%(R1[0][0], R1[0][2], R1[1][0], R1[1][2], R1[2][0], R1[2][2], R1[3][0], R1[3][2]);\n",
      "    R1[3][0] = 'H'; R1[3][2] = 1;\n",
      "    print(\"\\nThe correct reaction is:\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\n\"%(R1[0][0], R1[0][2], R1[1][0], R1[1][2], R1[2][0], R1[2][2], R1[3][0], R1[3][2]);    \n",
      "\n",
      "#  Display for reaction-II\n",
      "print(\"\\n\\n\\nReaction-II:\\n\\n\");\n",
      "pr_sum = R2[0][1]+R2[1][1];\n",
      "pp_sum = R2[2][1]+R2[3][1]+R2[4][1];\n",
      "nr_sum = R2[0][2]+R2[1][2];\n",
      "np_sum = R2[2][2]+R2[3][2]+R2[4][2];\n",
      "lr_sum = R2[0][3]+R2[1][3];\n",
      "lp_sum = R2[2][3]+R2[3][3]+R2[4][3]; \n",
      "if (check_nucleon(nr_sum,np_sum) and check_proton(pr_sum,pp_sum) and check_lepton(lr_sum,lp_sum) == 1):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)+%s(%d)\\nis possible\"%(R2[0][0], R2[0][2], R2[1][0], R2[1][2], R2[2][0], R2[2][2], R2[3][0], R2[3][2], R2[4][0], R2[4][2]);\n",
      "elif (check_nucleon(nr_sum,np_sum) == 0):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)+%s(%d)\\nis impossible\"%(R2[0][0], R2[0][2], R2[1][0], R2[1][2], R2[2][0], R2[2][2], R2[3][0], R2[3][2], R2[4][0], R2[4][2]);\n",
      "    R2[4][0] = '3n';\n",
      "    print(\"\\nThe correct reaction is:\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)+%s(%d)\\n\"%(R2[0][0], R2[0][2], R2[1][0], R2[1][2], R2[2][0], R2[2][2], R2[3][0], R2[3][2], R2[4][0], R2[4][2]);    \n",
      "       \n",
      "#     Reaction-III\n",
      "print(\"\\n\\n\\nReaction-III:\\n\\n\");\n",
      "pr_sum = R3[0][1]+R3[1][1];\n",
      "pp_sum = R3[2][1]+R3[3][1];\n",
      "nr_sum = R3[0][2]+R3[1][2];\n",
      "np_sum = R3[2][2]+R3[3][2];\n",
      "lr_sum = R3[0][3]+R3[1][3];\n",
      "lp_sum = R3[2][3]+R3[3][3]; \n",
      "if (check_nucleon(nr_sum,np_sum) and check_proton(pr_sum,pp_sum) and check_lepton(lr_sum,lp_sum) == 1):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\nis possible\"%( R3[0][0], R3[0][2], R3[1][0], R3[1][2], R3[2][0], R3[2][2], R3[3][0], R2[3][2]);\n",
      "elif (check_lepton(nr_sum,np_sum) == 0):\n",
      "    print(\"The Reaction\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\nis impossible\"%(R3[0][0], R3[0][2], R3[1][0], R3[1][2], R3[2][0], R3[2][2], R3[3][0], R3[3][2]);\n",
      "    R3[3][0] = 'v_e_a'\n",
      "    print(\"\\nThe correct reaction is:\\n\")\n",
      "    print \"\\t%s(%d) + %s(%d) --> %s(%d)+%s(%d)\\n\" %( R3[0][0], R3[0][2], R3[1][0], R3[1][2], R3[2][0], R3[2][2], R3[3][0], R3[3][2]);    \n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "\n",
        "Reaction-I:\n",
        "\n",
        "\n",
        "The Reaction\n",
        "\n",
        "\tAl(27) + He(4) --> Si(30)+n(1)\n",
        "is impossible\n",
        "\n",
        "The correct reaction is:\n",
        "\n",
        "\tAl(27) + He(4) --> Si(30)+H(1)\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "Reaction-II:\n",
        "\n",
        "\n",
        "The Reaction\n",
        "\n",
        "\tU(235) + n(1) --> Ba(143)+Kr(90)+2n(1)\n",
        "is impossible\n",
        "\n",
        "The correct reaction is:\n",
        "\n",
        "\tU(235) + n(1) --> Ba(143)+Kr(90)+3n(1)\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "Reaction-III:\n",
        "\n",
        "\n",
        "The Reaction\n",
        "\n",
        "\tP(32) + S(32) --> e(0)+v_e(0)\n",
        "is impossible\n",
        "\n",
        "The correct reaction is:\n",
        "\n",
        "\tP(32) + S(32) --> e(0)+v_e_a(0)\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.1, Page 182"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_n = 1.00866501; # Mass of neutron, amu\n",
      "M_Hp = 2.014102; # Mass of proton, amu\n",
      "M_Hd = 3.016049; # Mass of deutron, amu\n",
      "M_He = 4.002603; # Mass of alpha particle, amu\n",
      "\n",
      "#Calculations\n",
      "Q = (M_Hp+M_Hd-M_He-M_n)*931.49; # Q-value, MeV\n",
      "\n",
      "#Result\n",
      "print \"The Q-value for the reaction : %4.1f MeV\"%Q"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q-value for the reaction : 17.6 MeV\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.2, Page 183"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_Cf = 252.081621; # Mass of califronium, amu\n",
      "M_Cm = 248.072343; # Mass of curium, amu\n",
      "M_He = 4.002603; # Mass of alpha particle, amu\n",
      "\n",
      "#Calculations\n",
      "Q = (M_Cf-M_Cm-M_He)*931.49; # Q-value, MeV\n",
      "\n",
      "#Result\n",
      "print \"The Q-value for the reaction : %4.2f MeV\"%Q"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q-value for the reaction : 6.22 MeV\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.3, Page 183"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Pb_208(Fe_56, Fe_54)Pb_210\n",
      "M_Pb_208 = 207.976641; # Mass of Pb-208, amu\n",
      "M_Fe_56 = 55.934939; # Mass of Fe-56, amu\n",
      "M_Pb_210 = 209.984178; # Mass of Pb-210, amu\n",
      "M_Fe_54 = 53.939612; # Mass of Fe-54, amu\n",
      "\n",
      "#Calculations\n",
      "Q = (M_Pb_208+M_Fe_56-M_Pb_210-M_Fe_54)*931.49; # Q-value, MeV\n",
      "E_th = -Q*(M_Fe_56+M_Pb_208)/M_Pb_208; # Threshold energy, MeV \n",
      "\n",
      "#Results\n",
      "print \"The Q-value for the reaction   =  %5.2f MeV \\n Threshold energy   = %5.2f MeV \"%(Q,E_th)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q-value for the reaction   =  -11.37 MeV \n",
        " Threshold energy   = 14.43 MeV \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.4, Page 184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# H(1,1)+n(0,1) = H(1,2)+G is the reaction\n",
      "M_H_2 = 2.014735; # Mass of H-2, amu\n",
      "M_H_1 = 1.008142 ; # Mass of H-1, amu\n",
      "E_g = 2.230; # Energy of gamma rays, MeV\n",
      "\n",
      "#Calculations\n",
      "M_n_1 = ((M_H_2*931.47+E_g)-(M_H_1*931.47))/931.47; #Mass of neutron, amu\n",
      "\n",
      "#Result\n",
      "print \"The  mass of the neutron  : %8.6f MeV \"%M_n_1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The  mass of the neutron  : 1.008987 MeV \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.5, Page 184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Li-6 + n-1     > He-4 + H-3 is the given reaction \n",
      "M_Li = 6.0151234; # Atomic mass of Li, amu\n",
      "M_n = 1.0086654; #  Atomic mass of neutron, amu\n",
      "M_He = 4.0026034; #  Atomic mass of He, amu\n",
      "M_H = 3.0160294; #  Atomic mass of H, amu\n",
      "\n",
      "#Calculations&Results\n",
      "r_sum = M_Li+M_n; #  Sum of reactant, amu\n",
      "p_sum = M_He+M_H; #  Sum of product, amu\n",
      "# Declare a function returning equality status of nucleon number\n",
      "def check_Qvalue(r_sum,p_sum):\n",
      "    if r_sum >= p_sum:\n",
      "        Q = 1;\n",
      "    else: \n",
      "        Q = 0;\n",
      "    return Q\n",
      "# Reaction\n",
      "if (check_Qvalue(r_sum,p_sum)  == 1):\n",
      "    print \"Reaction : \\n\\n\\t Li(6)+n(1) ----> He(4)+H(3)\"\n",
      "    print \"\\t\\tThis reaction is exoergic\"\n",
      "elif (check_Qvalue(r_sum,p_sum) == 0):\n",
      "    print \"Reaction : \\n\\n\\t Li(6)+n(1) ----> He(4)+H(3)\"\n",
      "    print \"\\t\\tThis reaction is endoergic\"\n",
      "             "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reaction : \n",
        "\n",
        "\t Li(6)+n(1) ----> He(4)+H(3)\n",
        "\t\tThis reaction is exoergic\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.6, Page 185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Cf-252    > Zr-98 +Ce-145 + 9*n-1 is the given reaction\n",
      "M_Cf = 252.081621; # Atomic mass of Cf, amu\n",
      "M_Zr = 97.912735; #  Atomic mass of Zr, amu\n",
      "M_Ce = 144.917230; #  Atomic mass of Ce, amu\n",
      "M_n = 3.0160294; #  Atomic mass of neutron, amu\n",
      "\n",
      "#Calculations&Results\n",
      "r_sum = M_Cf+M_Zr; #  Sum of reactant, amu\n",
      "p_sum = M_Ce+M_n; #  Sum of product, amu\n",
      "\n",
      "\n",
      "# Declare the function which check the Q-value \n",
      "def check_Qvalue(r_sum,p_sum):\n",
      "    if r_sum >= p_sum:\n",
      "        Q = 1;\n",
      "    else: \n",
      "        Q = 0;\n",
      "    return Q   \n",
      "\n",
      "\n",
      "# Reaction\n",
      "if (check_Qvalue(r_sum,p_sum)  == 1):\n",
      "    print \"Reaction : \\n\\n\\t Cf(256) ----> Zr(98)+Ce(145)+9*n(1)\"\n",
      "    print \"\\t\\tThis reaction is spontaneous\"\n",
      "elif (check_Qvalue(r_sum,p_sum) == 0):\n",
      "    print \"Reaction : \\n\\n\\t Cf(256) ----> Zr(98)+Ce(145)+9*n(1)\"\n",
      "    print \"\\t\\tThis reaction is not spontaneous\"\n",
      "                    "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reaction : \n",
        "\n",
        "\t Cf(256) ----> Zr(98)+Ce(145)+9*n(1)\n",
        "\t\tThis reaction is spontaneous\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.7, Page 185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# O(8,16)     > N(7,15)+ H(1,1) is the given reaction\n",
      "M_N_15 = 15.000108; # Mass of N-15, amu\n",
      "M_O_16 = 16; # Mass of O-16, amu\n",
      "M_H_1 = 1.007825; # Mass of H-1, amu\n",
      "\n",
      "#Calculations\n",
      "Q = (M_O_16-M_N_15-M_H_1)*931.49; # Q-value, MeV\n",
      "\n",
      "#Result\n",
      "print \"The Q-value for the reaction  : %3.1f MeV \"%Q"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q-value for the reaction  : -7.4 MeV \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.8, Page 185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Na(11,23)+ n    >   F(9,20)+ He(2,4) is the reaction\n",
      "M_Na_23 = 22.99097; # Mass of Na-23, amu\n",
      "M_n_1 =1.00866 ; # Mass of n-1, amu\n",
      "Q = -5.4; # Q-value, MeV\n",
      "\n",
      "#Calculations\n",
      "E_th = -Q*(M_Na_23+M_n_1)/M_Na_23; # Threshold energy, MeV\n",
      "\n",
      "#Result\n",
      "print \"The threshold energy for the reaction  : %4.2f MeV \"%E_th"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The threshold energy for the reaction  : 5.64 MeV \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.9, Page 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# He(2,4)+ N(7,14) =  O(8,17)+ H(1,1)is the given reaction\n",
      "M_N_14 = 14.00755; # Mass of N-14, amu\n",
      "M_He_4 = 4.00388; # Mass of He-4, amu\n",
      "M_O_17 = 17.00452; # Mass of O-17, amu\n",
      "M_H_1 = 1.00815; # Mass of H-1, amu\n",
      "\n",
      "#Calculations\n",
      "Q = (M_N_14+M_He_4-M_O_17-M_H_1)*931.49; # Q-value, MeV\n",
      "\n",
      "#Result\n",
      "print \"The Q-value for the reaction  : %4.2f MeV \"%Q"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q-value for the reaction  : -1.16 MeV \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5.10, Page 186"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "#    H(1,2)+G  =  H(1,1)+ n(0,1) is the given reaction\n",
      "M_H_2 = 2.014735; # Mass of H-2, amu\n",
      "M_H_1 = 1.008142 ; # Mass of H-1, amu\n",
      "M_n_1 = 1.008987; # Mass of M_n_1, amu\n",
      "Q = -5.4; # Q-value, MeV\n",
      "\n",
      "#Calculations\n",
      "E_g = (M_H_1*931.47+M_n_1*931.47)-(M_H_2*931.47); #Energy of the gama rays, MeV\n",
      "\n",
      "#Result\n",
      "print \"The  energy of the gama rays  : %6.4f MeV \"%E_g"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The  energy of the gama rays  : 2.2299 MeV \n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7.1, Page 189"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "m = 0.001; # Mass of U-235 lost during fission, Kg\n",
      "c = 3e+08; # Velocity of light, m/s\n",
      "\n",
      "#Calculations\n",
      "E = m*c**2; # Energy released during fission, J\n",
      "E_t = E/(4e+09*1000); # Energy requires TNT, Kt \n",
      "\n",
      "#Results\n",
      "print \"Energy released during fission    = %1.0e J  \\n Destructive power of bomb    =  %4.1f Kt of TNT\"%(E, E_t)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy released during fission    = 9e+13 J  \n",
        " Destructive power of bomb    =  22.5 Kt of TNT\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7.2, Page 190"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "t = 0.15; # Thickness of the foil, Kg\n",
      "N = 6.023e+026; # Number of nuclei in 1Kg of U-235, nuclei\n",
      "N_1 = N/235*t; # Number of nuclei in 0.15Kg of U-235, nuclei\n",
      "A = 2e-026; # Area present in each nucleus, m^2\n",
      "I = 10^6; # Intensity ,s^-1 \n",
      "\n",
      "#Calculations\n",
      "F_r = N_1*A; # Rate of fissions induced in the foil by the neutrons, s^-1\n",
      "\n",
      "#Result\n",
      "print \"Rate of fissions induced in the foil by the neutrons: %5.3e per sec\"%F_r\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rate of fissions induced in the foil by the neutrons: 7.689e-03 per sec\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7.3, Page 190"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "N = 6.023e+023/256*10**-6; # Number of nuclei in 1ug of Fm-256\n",
      "t_h = 158*60; # Half life of Fm-256, s\n",
      "\n",
      "#Calculations\n",
      "D_c = math.log(2)/t_h; # Decay constant, s^-1\n",
      "F_r = N*D_c; # Fission rate, fissions/s\n",
      "E = 220*1.6e-013; # Energy released during fission of one nucleus, J\n",
      "P = E*F_r; # Power released in fission of 1 microgram of Fm-256, W\n",
      "\n",
      "#Result\n",
      "print \"Power released in fission of 1 microgram of Fm-256 = %d W\"%P\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power released in fission of 1 microgram of Fm-256 = 6 W\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7.4, Page 191"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "N = 6.023e+023/252*0.1; # Number of nuclei in 100mg of Cf-252\n",
      "t_h = 2.62*365*24*3600; # Half life of Cf-252, s\n",
      "\n",
      "#Calculations\n",
      "D_c = math.log(2)/t_h; # Decay constant, s^-1\n",
      "F_r = N*D_c; # Fission rate, fissions/s\n",
      "E = 210*1.6e-013; # Energy released during fission of one nucleus, J\n",
      "P = E*F_r; # Power released in fission of 100 milligram of Cf-252, W\n",
      "\n",
      "#Result\n",
      "print \"Power released in fission of 100 milligram of Cf-252: %4.1f W\"%P\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power released in fission of 100 milligram of Cf-252: 67.4 W\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7.5, Page 191"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "E = 200*1.6e-013; # Energy released during fission of one nucleus, J\n",
      "E_t = 20000*4.18e+09; # Energy released in detonation of 20000 tons of TNT, J\n",
      "\n",
      "#Calculations\n",
      "N_f = E_t/E; # Number of fission occured during eplosion, fissions\n",
      "c = 3e+08; # Velocity of light, m/s\n",
      "m = E_t/(c)**2*10**6; # Decrease in mass during explosion, mg\n",
      "m_r = round(m)\n",
      "\n",
      "#Results\n",
      "print \"Number of fissions occured during explosion = %4.2e fissions \\n Decrease in mass during explosion  = %d mg \"%(N_f, m_r)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of fissions occured during explosion = 2.61e+24 fissions \n",
        " Decrease in mass during explosion  = 929 mg \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.1, Page 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "#  5*H(1,2)= He(2,3)+He(2,4)+H(1,2)+2*n(0,1)+25MeV is the given reaction\n",
      "N = 6.023e+026/2*10; # Number of atoms in 10Kg of H-2, atoms\n",
      "E = 25/5*1.6e-013; # Energy liberate during fusion of 1 atom of H-2, J\n",
      "\n",
      "#Calculations\n",
      "E_l = E*N; # Energy liberate during fusion of 10 Kg  of H-2, J\n",
      "\n",
      "#Result\n",
      "print \"Energy liberated during fusion of 10 Kg  of H-2 = %4.2e J\"%E_l"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy liberated during fusion of 10 Kg  of H-2 = 2.41e+15 J\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.2, Page 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "M_r = 16.002603; # Mass of the reactant, amu\n",
      "M_p = 15.994915; # Mass of reactant, amu\n",
      "M_d = 7.688e-03; # Difference in masses, amu\n",
      "\n",
      "#Calculations\n",
      "E_p = M_d*931.49; # Energy produced, MeV\n",
      "\n",
      "#Result\n",
      "print \"Energy produced by the fusion reaction :%4.2f MeV\"%E_p"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy produced by the fusion reaction :7.16 MeV\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.3, Page 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration & Calculations\n",
      "# Firstly calculate for B-10\n",
      "Z_B = 5; # Atomic number of B-10\n",
      "r_B = 5.17; #  Seperation of two nuclei, fm\n",
      "K = 1.38e-023; # Boltzmann's constant\n",
      "F = 1./137; # Fine structure constant\n",
      "E = 197.5*1.6e-013; # Energy, J\n",
      "V_c_B = F*Z_B**2*E/r_B; # Coulomb barrier for B-10, J\n",
      "T_B = 2./3*V_c_B/K; # Temperature required to overcome the barrier for B-10, K\n",
      "\n",
      "# Now calculate for Mg-24\n",
      "Z_Mg = 12; # Atomic number of Mg-24\n",
      "r_Mg = 6.92; #  Seperation of two nuclei, fm\n",
      "K = 1.38e-023; # Boltzmann's constant\n",
      "F = 1./137; # Fine structure constant\n",
      "E = 197.5*1.6e-013; # Energy, J\n",
      "V_c_Mg = F*Z_Mg**2*E/r_Mg; # Coulomb barrier for Mg-24, J\n",
      "T_Mg = 2./3*V_c_Mg/K; # Temperature required to overcome the barrier for Mg-24, K\n",
      "\n",
      "#Results\n",
      "print \"For B-10 \\n Energy released   = %4.2e J \\n Temperature required   = %4.1e K   \\nFor Mg-24  \\n Energy released    = %4.2e J \\n Temperature required  =  %4.2e K\"%(V_c_B,T_B,V_c_Mg,T_Mg)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For B-10 \n",
        " Energy released   = 1.12e-12 J \n",
        " Temperature required   = 5.4e+10 K   \n",
        "For Mg-24  \n",
        " Energy released    = 4.80e-12 J \n",
        " Temperature required  =  2.32e+11 K\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.4, Page 196"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# 4*H(1,1)= He(2,4)+2*e(1,0)+2*v+G is the reaction\n",
      "E_r = 3.9e+026; # Energy releasd in 1s, J\n",
      "N = 1.2e+057; # Number of hydrogen atoms in the sun, atoms\n",
      "M_d = 0.027599;# Mass difference, amu\n",
      "\n",
      "#Calculations\n",
      "E = M_d*931.47; # In terms of energy, MeV\n",
      "E_t = N/4*E*1.6e-013; # Total energy available in the sun, J\n",
      "t = E_t/(E_r*365*24*3600*10**9); # Life time of the sun, billion years\n",
      "\n",
      "#Result\n",
      "print \"Life time of the sun : %5.1f billion years\"%t"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Life time of the sun : 100.3 billion years\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.5, Page 197"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "# Declare three cells [for three reactions]\n",
      "R = [[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]\n",
      "# Enter data for first cell [Reaction]\n",
      "R[0][0] = 'H'; # Element\n",
      "R[0][1] = 1;   # Atomic number\n",
      "R[0][2] = 2;    # Mass number\n",
      "R[1][0] = 'H';\n",
      "R[1][1] = 1;\n",
      "R[1][2] = 3;\n",
      "R[2][0] = 'n'\n",
      "R[2][1] = 0;\n",
      "R[2][2] = 1;\n",
      "R[3][0] = 'He'\n",
      "R[3][1] = 2;\n",
      "R[3][2] = 3;\n",
      "\n",
      "\n",
      "#Calculations&Results\n",
      "p_sum = R[1][2]+R[2][2];\n",
      "if p_sum == 2:\n",
      "    print \"The particle is : %s[%d][%d] \"%(R[3][0],R[3][1],R[3][2])\n",
      "             \n",
      "#  Calculate the energy released\n",
      "m_n = 1.008665; # Mass of neutron, amu\n",
      "m_d = 2.014102; # Mass of deutron, amu\n",
      "m_He = 3.0160293; # Mass of He-3, amu\n",
      "E = (2*m_d-(m_n+m_He))*931.47; # Energy released in this reaction, MeV\n",
      "print \"The energy released in this reaction : %4.2f MeV\"%E"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy released in this reaction : 3.27 MeV\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8.6, Page 197"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration & Calculations\n",
      "#  Reaction-1 = H(1,2)+H(1,2)= He(2,3)+n(0,1)\n",
      "m_p = 1.007825; # Mass of proton, amu\n",
      "m_n = 1.008665; # Mass of neutron, amu\n",
      "m_H = 2.014102; # Mass of H(1,2), amu\n",
      "m_He = 3.016029; # Mass of He(2,3), amu\n",
      "m_d_1 = 2*m_H-m_He-m_n; # Mass defect for reaction first, amu\n",
      "Q_1 = m_d_1*931.47; # Q-value for reaction first, MeV\n",
      "\n",
      "# Reaction-2 = H(1,2)+H(1,2)= H(1,3)+p(1,1)\n",
      "m_p = 1.007825; # Mass of proton, amu\n",
      "m_n = 1.008665; # Mass of neutron, amu\n",
      "m_H = 2.014102; # Mass of H(1,2), amu\n",
      "m_H_3 = 3.016049; # Mass of H(1,3), amu\n",
      "m_d_2 = 2*m_H-m_H_3-m_p; # Mass defect for reaction second, amu\n",
      "Q_2 = m_d_2*931.47; # Q-value for reaction second, MeV\n",
      "\n",
      "#Results\n",
      "print \"For first reaction \\n Mass defect    = %7.5f amu \\n Q-value    =   %7.5f amu   \\nFor second reaction \\n Mass defect   =  %7.5f MeV \\n Q-value  = %4.2f MeV \"%(m_d_1,Q_1,m_d_2,Q_2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For first reaction \n",
        " Mass defect    = 0.00351 amu \n",
        " Q-value    =   3.26946 amu   \n",
        "For second reaction \n",
        " Mass defect   =  0.00433 MeV \n",
        " Q-value  = 4.03 MeV \n"
       ]
      }
     ],
     "prompt_number": 24
    }
   ],
   "metadata": {}
  }
 ]
}