{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter 01 : Relativity"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.1 : Pg:20 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relative Speed of approach\n",
      "c = 1     # For the sake of simplicity, assume c = 1, m/s\n",
      "u = 0.87*c     # Velocity of approach of spaceship A towards spaceship B, m/s\n",
      "v = -0.63*c     # Velocity of approach of spaceship B towards spaceship A, m/s\n",
      "V = (u - v)/(1 - (u*v)/c**2)     # Velocity Addition Rule giving relative speed of approach of particles, m/s\n",
      "print \"The relative speed of approach of particles = %6.4fc\" %V"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The relative speed of approach of particles = 0.9689c\n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.2 : Pg: 20 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relative Speed of spaceships\n",
      "c = 1     # For the sake of simplicity, assume c = 1, m/s\n",
      "u = 0.9*c     # Velocity of approach of spaceship A towards spaceship B, m/s\n",
      "v = -0.9*c     # Velocity of approach of spaceship B towards spaceship A, m/s\n",
      "V = (u - v)/(1 - (u*v)/c**2)     # Velocity Addition Rule giving relative speed of approach of spaceships, m/s\n",
      "print \"The relative speed of B w.r.t. A = %5.3fc\"% V"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The relative speed of B w.r.t. A = 0.994c\n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.3 : Pg: 20 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relativistic length contraction\n",
      "L0 = 1.0     # Actual length of the metre stick, m\n",
      "rel_mass = 3.0/2     # Relative mass of stick w.r.t. rest its mass\n",
      "# As m = m0/sqrt(1 - (v/c)**2) and L =  L0*sqrt(1 - (v/c)**2)\n",
      "# Thus L/m = (L0/m0)*(1 - (v/c)**2), solving for L\n",
      "# L = (m0/m)*L0 i.e.\n",
      "L = 1/rel_mass*L0     # Apparent length of the metre rod, m\n",
      "print \"The apparent length of the metre rod = %5.3f m\" %L\n",
      "# Result \n",
      "# The apparent length of the metre rod = 0.667 m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The apparent length of the metre rod = 0.667 m\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.5 : Pg: 22 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Mass-Energy Equivalence\n",
      "U = 7.5e+011     # Total electrical energy generated in a country, kWh\n",
      "kWh = 1000*3600     # Conversion factor for kilowatt-hour into joule, J/kWh\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "m = (U*kWh)/c**2     # Mass equivalent of energy, kg\n",
      "print \"The mass converted into energy = %2d kg\" % m\n",
      "# Result \n",
      "# The mass converted into energy = 30 kg "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass converted into energy = 30 kg\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.6 : Pg:22 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Energy equivalent of mass\n",
      "m = 1     # Mass of a substance, kg\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "U = m*c**2     # Energy equivalent of mass, J\n",
      "print \"The energy equivalent of mass = %1.0e J\"% U"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy equivalent of mass = 9e+16 J\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.7 : Pg: 22 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Relativistic variation of mass with speed\n",
      "m0 = 1e-024     # Mass of a particle, kg\n",
      "v = 1.8e+08     # Speed of the particle, m/s\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "m = m0/sqrt(1-(v/c)**2)     # Mass of the moving particle, kg\n",
      "print \"The mass of moving particle = %4.2e kg\"% m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass of moving particle = 1.25e-24 kg\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.8 : Pg: 23 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Increase in mass of water\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "T1 = 273     # Initial temperature of water, K\n",
      "T2 = 373     # Final temperature of water, K\n",
      "M = 1e+06     # Mass of water, kg\n",
      "C = 1e+03     # Specific heat of water, cal/kg-K\n",
      "J = 4.18     # Joule's mechanical equivalent of heat, cal/joule\n",
      "U = M*C*(T2 - T1)*J     # Increase in energy of water, J\n",
      "m = U/c**2     # Increase in mass of water, kg\n",
      "print \"The increase in mass of water = %4.2e kg\"% m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in mass of water = 4.64e-06 kg\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.9 : Pg:23 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Ratio of rest mass and mass in motion\n",
      "c = 1     # For convenience, speed of light is assumed to be unity, m/s\n",
      "v = 0.5*c     # Velocity of moving particle, m/s\n",
      "# As m0 = m*sqrt(1 - (v/c)**2), and m0/m = rel_mass, we have\n",
      "rel_mass = sqrt(1 - (v/c)**2)     # Ratio of rest mass and the moving mass\n",
      "print \"The ratio of rest mass and the mass in motion = %6.4f kg\"% rel_mass\n",
      "# Result \n",
      "# The ratio of rest mass and the mass in motion = 0.8660 kg "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio of rest mass and the mass in motion = 0.8660 kg\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.10 : Pg:23 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Heat equivalent of mass\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "J = 4.18     # Joule's equivalent of heat, joule per calorie\n",
      "m = 4.18e-03     # Mass of the substance, kg\n",
      "U = m*c**2     # Energy equivalent of mass, J\n",
      "Q = U/J     # Heat equivalent of mass, calorie\n",
      "print \"The heat equivalent of mass = %1.0e cal\"% Q\n",
      "# Result \n",
      "# The heat equivalent of mass = 9e+013 cal"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The heat equivalent of mass = 9e+13 cal\n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.11 : Pg: 23 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Variation of space and time\n",
      "L = 0.5     # Shortened length of the rod, m\n",
      "L0 = 1     # Actual length of the rod, m\n",
      "t0 = 1     # Actual time on the spaceship, s\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "v = sqrt(1 - (L/L0)**2)*c     # Speed of the spaceship, m/s\n",
      "t = t0/sqrt(1 - (v/c)**2)        # Dilated time for stationary observer, s\n",
      "print \"The speed of light = %5.3e m/s\"% v\n",
      "print \"The time dilation corresponding to 1 s on the spaceship = %d s\"% round(t)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of light = 2.598e+08 m/s\n",
        "The time dilation corresponding to 1 s on the spaceship = 2 s\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.12 : Pg: 24 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Mean lifetime of a moving meason\n",
      "c = 1     # For convenience, speed of light is assumed to be unity\n",
      "t0 = 2e-08     # Mean life time of pi-meson at rest, s\n",
      "v = 0.8*c     # Velocity of moving pi-meason, m/s\n",
      "t = t0/sqrt(1-(v/c)**2)     # Mean lifetime of moving pi-meason, s\n",
      "print \"The mean lifetime of moving meason = %4.2e s\"% t"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mean lifetime of moving meason = 3.33e-08 s\n"
       ]
      }
     ],
     "prompt_number": 57
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.13 : Pg: 24 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Velocity of one atomic mass unit\n",
      "c = 1.0     # For convenience, speed of light is assumed to be unity, m/s\n",
      "m0 = 1.0     # For convenience, rest mass is assumed to be unity\n",
      "# Here 2*m0*c**2 = m*c**2 - m0*c**2 = KE which gives\n",
      "m = 3*m0     # Atomic mass in motion, kg\n",
      "# As m = m0/sqrt(1 - (v/c)**2), solving for v\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of one atomic mass, m/s \n",
      "print \"The velocity of one atomic mass = %5.3fc\"% v\n",
      "# Result \n",
      "# The velocity of one atomic mass = 0.943c "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of one atomic mass = 0.943c\n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.14 : Pg: 25 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Speed of an electron for an equivalent proton mass\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "m0 = 1     # For convenience, rest mass of an electron is assumed to be unity\n",
      "m = 2000*m0     # Rest mass of a proton, units\n",
      "# As m = m0/sqrt(1 - (v/c)**2), solving for v\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Speed of the moving electron, m/s \n",
      "print \"The speed of the moving electron = %4.2e m/s (approx.)\"% v "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of the moving electron = 3.00e+08 m/s (approx.)\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.15 : Pg: 25 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Speed at total energy twice the rest mass energy\n",
      "c = 1     # Speed of light is assumed to be unity, m/s\n",
      "m0 = 1.0     # For convenience, rest mass of the particle is assumed to be unity, kg\n",
      "m = 2*m0     # Mass of the moving particle when m*c**2 = 2*m0*c**2, kg\n",
      "# As m = m0/sqrt(1 - (v/c)**2), solving for v\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Speed of the moving particle, m/s \n",
      "print \"The speed of the moving  particle = %5.3fc\"% v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of the moving  particle = 0.866c\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.16 : Pg:26 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relative velocity and mass\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "u = 2e+08     # Speed of first particle, m/s\n",
      "v = -2e+08     # Speed of second particle, m/s\n",
      "u_prime = (u - v)/(1 - u*v/c**2)     # Velocity addition rule giving relative velocity, m/s\n",
      "m0 = 3e-025     # Rest mass of each particle, kg\n",
      "m = m0/sqrt(1 - (u_prime/c)**2)     # Mass of one particle relative to the other, kg\n",
      "print \"The relative speed of one particle w.r.t the other = %5.3e m/s\"% u_prime\n",
      "print \"The mass of one particle relative to the other = %3.1e kg\"% m "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The relative speed of one particle w.r.t the other = 2.769e+08 m/s\n",
        "The mass of one particle relative to the other = 7.8e-25 kg\n"
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.17 : Pg: 26 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Relativistic variation of density with velocity\n",
      "c = 1     # Speed of light is assumed to be unity for convenience, m/s\n",
      "v = 0.9*c     # Speed of moving frame, m/s\n",
      "rho_0 = 19.3e+03     # Density of gold in rest frame, kg metre per cube\n",
      "L0 = 1     # Actual length is assumed to be unity, m\n",
      "m0 = 1     # Rest mass of gold is assumed to be unity, kg\n",
      "V0 = m0/rho_0     # Volume of gold in rest frame, metre cube\n",
      "L = L0*sqrt(1 - (v/c)**2)     # Relativistic Length Contraction Formula, m\n",
      "y = 1     # Width of gold block is assumed to be unity, m\n",
      "z = 1     # Height of gold block is assumed to be unity, m\n",
      "V = L*y*z*V0     # Volume of gold as observed from moving frame, metre cube\n",
      "m = m0/sqrt(1 - (v/c)**2)     # Mass of gold as observed from moving frame, kg\n",
      "rho = m/V     # Density of gold as observed from moving frame, kg per metre cube\n",
      "print \"The density of gold as observed from moving frame = %5.1fe+003 kg per metre cube\"% (rho/1e+03)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The density of gold as observed from moving frame = 101.6e+003 kg per metre cube\n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.18 : Pg: 27 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Electrons accelerated to relativistic speeds\n",
      "U = 1.0e+09*1.6e-019     # Kinetic energy of the electrons, J\n",
      "# As U = m*c**2, solving for m\n",
      "m = U/c**2     # Mass of moving electrons, kg\n",
      "m0 = 9.1e-031     # Rest mass of an electron, kg\n",
      "mass_ratio = m/m0     # Ratio of a moving electron mass to its rest mass \n",
      "c = 3e+08     # Speed of light, m/s\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of moving electron, m/s\n",
      "vel_ratio = v/c     # Ratio of electron velocity to the velocity of light\n",
      "U0 = m0*c**2     # Rest mass energy of electron, J\n",
      "ene_ratio = U/U0     # Ratio of electron energy to its rest mass energy\n",
      "print \"The ratio of a moving electron mass to its rest mass %4.2e\" %(mass_ratio) \n",
      "print \"The ratio of electron velocity to the velocity of light = 1 - %5.3e\" %((1-vel_ratio**2)/2) \n",
      "print \"The ratio of electron energy to its rest mass energy = %5.3e\"%(ene_ratio) \n",
      "# Result \n",
      "# The ratio of a moving electron mass to its rest mass 1.95e+003\n",
      "# The ratio of electron velocity to the velocity of light = 1 - 1.310e-007\n",
      "# The ratio of electron energy to its rest mass energy = 1.954e+003 \n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio of a moving electron mass to its rest mass 1.76e+20\n",
        "The ratio of electron velocity to the velocity of light = 1 - 0.000e+00\n",
        "The ratio of electron energy to its rest mass energy = 1.954e+03\n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.19 : Pg: 28 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Electron speed equivalent of twice its rest mass\n",
      "m0 = 9.1e-031     # Rest mass of an electron, kg\n",
      "m = 2*m0     # Mass of moving electron, kg\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of moving electron, m/s\n",
      "print \"The speed of electron so that its mass becomes twice its rest mass = %5.3e m/s\"% v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of electron so that its mass becomes twice its rest mass = 2.598e+08 m/s\n"
       ]
      }
     ],
     "prompt_number": 64
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.20 : Pg: 28 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Electron speed equivalent of twice its rest mass\n",
      "m0 = 9.1e-031     # Rest mass of an electron, kg\n",
      "m = 2*m0     # Mass of moving electron, kg\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of moving electron, m/s\n",
      "print \"The speed of electron so that its mass becomes twice its rest mass = %5.3e m/s\"%v  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of electron so that its mass becomes twice its rest mass = 2.598e+08 m/s\n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.21 : Pg:29 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Fractional speed of electron\n",
      "m0 = 9.1e-031     # Rest mass of an electron, kg\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "E = 0.5*1e+06*1.6e-019     # Kinetic energy of electron, J\n",
      "# As E = (m - m0)*c**2, solving for m\n",
      "m = E/c**2+m0     # Mass of moving electron, kg\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of moving electron, m/s\n",
      "print \"The speed of electron relative to speed of light = %5.3f\"%(v/c) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of electron relative to speed of light = 0.863\n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.22 : Pg: 29 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Effective mass and speed of electron\n",
      "c = 3e+08     # Speed of light, m/s\n",
      "e = 1.6e-019     # Electron-volt equivalent of 1 joule, eV/joule\n",
      "U = 2*1e+06*e     # Total energy of electron, J\n",
      "# As E = (m - m0)*c**2, solving for m\n",
      "m = U/c**2     # Effective mass of electron, kg\n",
      "m0 = 0.511*1e+06*e/c**2     # Rest mass of the electron, kg\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Velocity of moving electron, m/s\n",
      "print \"The effective mass of electron = %4.1e kg\"% m \n",
      "print \"The relativistic speed of electron = %4.2fc m\"% (v/c) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The effective mass of electron = 3.6e-30 kg\n",
        "The relativistic speed of electron = 0.97c m\n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.23 : Pg: 30 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Energy released in fission\n",
      "c = 3.0e+08     # Speed of light, m/s\n",
      "e = 1.6e-019     # Charge on an electron, coulomb\n",
      "r0 = 1.2e-015     # Equilibrium nuclear radius, m\n",
      "A = 238.0     # Twice the mass of each fragment\n",
      "q1 = 46.0*e     # Charge on first fragment, coulomb\n",
      "q2 = 46.0*e     # Charge on second fragment, coulomb\n",
      "R = r0*(A/2)**(1.0/3) \n",
      "d = 2*R     # Distance between two fragments, m\n",
      "U = q1*q2*9e+09/d     # Energy released in fission, J\n",
      "print \"The energy released in fission of U(92,238) = %3d MeV\"%(U/(e*1e+06)) \n",
      "# Result \n",
      "# The energy released in fission of U(92,238) = 258 MeV  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy released in fission of U(92,238) = 258 MeV\n"
       ]
      }
     ],
     "prompt_number": 68
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.24 : Pg: 30 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Relativistic speed form relativistic mass\n",
      "c = 3e+08     # Speed of light, m/s    \n",
      "m0 = 1.0/2     # Rest mass of the particle, MeV/c**2\n",
      "m = 1/sqrt(2)     # Relativistic mass of the particle, MeV/c**2\n",
      "# As m = m0/sqrt(1 - (v/c)**2), Relativistic mass of electron, kg, solving for v, we have\n",
      "v = sqrt(1 - (m0/m)**2)*c     # Relativistic velocity of particle, m/s\n",
      "print \"The relativistic velocity of particle = %4.2e m/s\"%(v) \n",
      "# Result \n",
      "# The relativistic velocity of particle = 2.12e+008 m/s "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The relativistic velocity of particle = 2.12e+08 m/s\n"
       ]
      }
     ],
     "prompt_number": 69
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.25 : Pg: 31 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Decay of muon\n",
      "c = 3e+08     # Speed of light, m/s \n",
      "v = 0.992*c     # Relativistic speed of muon, m/s\n",
      "S = 60*1e+03     # Distance travelled by muon before it decays, m\n",
      "t_prime = S/v     # Time measured by observer on earth (Dilated Time), s\n",
      "t = t_prime*sqrt(1 - (v/c)**2)     # Time measured by muon in its own frame, s  \n",
      "s = v*t     # Distance covered by the muon in its own frame of reference, m   \n",
      "print \"The time measured by observer on earth (Dilated Time) = %5.3e s\"% t_prime\n",
      "print \"The time measured by muon in its own frame = %4.2e s\"% t \n",
      "print \"The distance covered by the muon in its own frame of reference = %4.2f km\"%(s/1e+03) \n",
      "# Result \n",
      "# The time measured by observer on earth (Dilated Time) = 2.016e-004 s\n",
      "# The time measured by muon in its own frame = 2.55e-005 s\n",
      "# The distance covered by the muon in its own frame of reference = 7.57 km "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time measured by observer on earth (Dilated Time) = 2.016e-04 s\n",
        "The time measured by muon in its own frame = 2.55e-05 s\n",
        "The distance covered by the muon in its own frame of reference = 7.57 km\n"
       ]
      }
     ],
     "prompt_number": 70
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1.26 : Pg: 31 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#Decay of unstable particlec = 3e+08     # Speed of light, m/s \n",
      "v = 0.9*c     # Relativistic speed of unstable particle, m/s\n",
      "t0 = 1e-06     # Time of decay of unstable particle in rest frame, s\n",
      "t = t0/sqrt(1 - (v/c)**2)     #Time of decay of unstable particle in moving frame, s \n",
      "s = v*t     # Distance travelled by unstable particle before it decays in moving frame, m   \n",
      "print \"The distance travelled before the unstable particle decays = %4.2e m\"% s\n",
      "# Result \n",
      "# The distance travelled before the unstable particle decays = 6.19e+002 m "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance travelled before the unstable particle decays = 6.19e+02 m\n"
       ]
      }
     ],
     "prompt_number": 71
    }
   ],
   "metadata": {}
  }
 ]
}
