{
 "metadata": {
  "name": "",
  "signature": "sha256:754c71c2e29646e743d2602122b6349e57c8b539ae4803d803ea41cdce275af3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 Potential energy"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 page no 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "m=0.04                                        #Mass of stone in kg\n",
      "vi=25                                         #Initial velocity in m/s\n",
      "vf=0                                          #Final velocity in m/s\n",
      "yi=0                                          #Initial height in m\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "Ui=(m*9.81*yi)\n",
      "Ki=(1/2.0)*m*vi**2\n",
      "Etotal=(Ui+Ki)\n",
      "h=(Etotal/(m*9.8))\n",
      "#when the stone is at (2/3)h, total energy is again same\n",
      "v=math.sqrt((Etotal-(m*9.8*(2/3.0)*h))/((1/2.0)*m))\n",
      "\n",
      "#Output\n",
      "print\"Maximum height it will reach is \",round(h,1),\"m\" \n",
      "print\"velocity when it is at the two-third of its maximum height is \",round(v,2),\"m/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum height it will reach is  31.9 m\n",
        "velocity when it is at the two-third of its maximum height is  14.43 m/s\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 page no 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "m=0.5                                       #Mass of the sphere in kg\n",
      "vi=100                                      #Initial velocity in m/s\n",
      "vf=20                                       #Final velocity in m/s\n",
      "\n",
      "#Calculations\n",
      "h=(vi**2-vf**2)/(2.0*9.8)\n",
      "PE=(m*9.8*h)\n",
      "\n",
      "#Calculations\n",
      "print\"Potential energy of the sphere is \",PE,\"J\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Potential energy of the sphere is  2400.0 J\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 page no 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "m=0.5                                    #Mass of the block in kg\n",
      "x=0.05                                   #Distance to which block is pulled in m\n",
      "k=300                                    #Force constant of the spring in N/m\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "U=(1/2.0)*k*x**2\n",
      "v=x*math.sqrt(k/m)\n",
      "\n",
      "#Output\n",
      "print\"Potential energy of the block when spring is in stretched position is \",U,\"J\" \n",
      "print\"Velocity of the block when it passes through the equilibrium position is \",round(v,2),\" m/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Potential energy of the block when spring is in stretched position is  0.375 J\n",
        "Velocity of the block when it passes through the equilibrium position is  1.22  m/s\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 page no 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "l=0.8                                            #Length of a simple pendulum in m\n",
      "q=30                                             #Angle with the vertical through which the bob is released in degrees\n",
      "q1=10                                            #Required angle in degrees\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "v=math.sqrt(2*9.8*l*(math.cos(q1*3.14/180.0)-math.cos(q*3.14/180.0)))\n",
      "\n",
      "#Output\n",
      "print\"Speed when the bob is at the angle of \",q1,\"degrees with the vertical is \",round(v,2),\"m/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed when the bob is at the angle of  10 degrees with the vertical is  1.36 m/s\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 page no 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "m=(9.1*10**-31)                                     #Mass of the electron in kg\n",
      "v=(3*10**8)                                         #Velocity of light in m/s\n",
      "c=(1.6*10**-19)                                     #Charge of the electron in coloumbs\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "Re=(m*v**2)/(c*10**6)\n",
      "E=(Re/math.sqrt(1-0.9**2))\n",
      "\n",
      "#Output\n",
      "print\"Rest energy of the electron is \",round(Re,3),\"MeV\" \n",
      "print\"Total energy is \",round(E,2),\"MeV\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rest energy of the electron is  0.512 MeV\n",
        "Total energy is  1.17 MeV\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}