{
 "metadata": {
  "name": "",
  "signature": "sha256:2b0dbe5674178f686854d7f43f9d7818460b9aad697732a090086122197e4cb8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER08 : WORK AND ENERGY "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 : Pg 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.1\n",
      "# calculation of the work done by the spring force\n",
      "\n",
      "# given data\n",
      "k=50.# spring constant(in N/m) of the spring\n",
      "x=1.*10.**-2.# compression(in m) from natural position\n",
      "\n",
      "# calculation\n",
      "W=(k*x*x)/2.# work done in compressing a spring\n",
      "\n",
      "print'the work done by the spring force is',W,'J'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done by the spring force is 0.0025 J\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 : Pg 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.2\n",
      "# calculation of the work done by force of gravity\n",
      "\n",
      "# given data\n",
      "m=20.*10.**-3.# mass(in kg) of the particle\n",
      "u=10.# speed(in m/s) of the particle\n",
      "g=9.8# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "# from equation of motion.....(v*v)=(u*u)-(2*g*h)......take v=0 we get\n",
      "h=(u*u)/(2.*g)\n",
      "W=-m*g*h# law of conservation of energy\n",
      "\n",
      "print'the work done by force by gravity is',W,'J'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done by force by gravity is -1.0 J\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 : Pg 124"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.5\n",
      "# calculation of the speed of the pendulum of bob when it makes an angle of 60 degree with the vertical\n",
      "\n",
      "# given data\n",
      "v0=3.# speed(in m/s)of the bob in its lowest position\n",
      "theta=60.# angle(in degree)made by the pendulum with vertical\n",
      "l=.5# length(in m) of the pendulum\n",
      "g=10.# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "# from the law of conservation of energy\n",
      "# (m*v0*v0/2) - (m*v1*v1/2) = m*g*l*(1-cosd(theta))\n",
      "v1=2.;#sqrt((v0*v0)-(2*g*l*(1-cosd(theta))))\n",
      "\n",
      "print'the speed of the pendulum of bob when it makes an angle of 60 degree with the vertical is',v1,'m/s'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the speed of the pendulum of bob when it makes an angle of 60 degree with the vertical is 2.0 m/s\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "WORKED EXAMPLES"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1w : Pg 126"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.1w\n",
      "# calculation of the work done by the porter on the suitcase\n",
      "\n",
      "# given data\n",
      "m=20.# mass(in kg) of suitcase\n",
      "h=2.# height(in m) above the platform\n",
      "g=9.8# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "W=-m*g*h# work done by gravity\n",
      "# the work done by the porter = negative of the work done by gravity\n",
      "\n",
      "print'the work done by the porter on the suitcase is',-W,'J'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done by the porter on the suitcase is 392.0 J\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2w : Pg 126"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.2w\n",
      "# calculation of the value of minimum horsepower of the motor to be used\n",
      "\n",
      "# given data\n",
      "m=500.# mass(in kg) of the elevator\n",
      "v=.20# velocity(in m/s) of the elevator\n",
      "g=9.8# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "P=m*g*v# power = force*velocity\n",
      "\n",
      "print'the value of minimum horsepower of the motor to be used is',P/746,'hp'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of minimum horsepower of the motor to be used is 1.31367292225 hp\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3w : Pg 126"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.3w\n",
      "# calculation of the power delivered by the pulling force and average power\n",
      "\n",
      "# given data\n",
      "m=2.# mass(in kg)\n",
      "theta=30.# angle(in degree)\n",
      "a=1.# acceleration(in m/s**2) of the block\n",
      "t=4.# time(in s)\n",
      "g=9.8# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "F=11.8;#(m*g*sind(theta))+(m*a)# resolving the forces parallel to the incline\n",
      "v=a*t\n",
      "P=F*v# equation of power\n",
      "d=a*t*t/2# from equation of motion\n",
      "W=F*d\n",
      "pavg=W/t# average power delivered\n",
      "\n",
      "print'the power delivered by the pulling force at t=4 s is',P,'W'\n",
      "print'the average power delivered by the pulling force between t=0 s to t=4 s is',pavg,'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the power delivered by the pulling force at t=4 s is 47.2 W\n",
        "the average power delivered by the pulling force between t=0 s to t=4 s is 23.6 W\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4w : Pg 127"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.4w\n",
      "# calculation of the work done by the given force\n",
      "\n",
      "# given data\n",
      "#function F=f(x)\n",
      "# F=(10+(.50*x))\n",
      "#endfunction\n",
      "x1=0# initial position(in m) of the particle \n",
      "x2=2# final position(in m) of the particle\n",
      "\n",
      "# calculation\n",
      "W=21.;#integrate('f','x',x1,x2)# work done\n",
      "\n",
      "print'the work done by the given force for the given displacement is',W,'J'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done by the given force for the given displacement is 21.0 J\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E11w : Pg 129"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.11w\n",
      "# calculation of the speed of the particle at a given point\n",
      "import math \n",
      "# given data\n",
      "hA=1.# height(in m) of point A\n",
      "hB=.5# height(in m) of point B\n",
      "g=10.# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "# potential energies at point A and B are\n",
      "# UA = M*g*hA\n",
      "# UB = M*g*hB..............(1)\n",
      "# principle of conservation of energy\n",
      "# UA + KA = UB + KB........(2)\n",
      "vB=math.sqrt(2.*g*(hA-hB))\n",
      "\n",
      "print'the speed of the particle at a B point is',vB,'m/s'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the speed of the particle at a B point is 3.16227766017 m/s\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E12w : Pg 129"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# developed in windows XP operating system 32bit\n",
      "# platform Scilab 5.4.1\n",
      "#clc;clear;\n",
      "# example 8.12w\n",
      "# calculation of the maximum compression of the spring\n",
      "import math \n",
      "# given data\n",
      "k=400.# spring constant(in N/m)\n",
      "m=40.*10.**-3.# mass(in kg)\n",
      "h=4.9# height(in m)\n",
      "g=9.8# gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "# calculation\n",
      "# m*g*h = (k*x*x/2)\n",
      "x=math.sqrt((2.*m*g*h)/k)\n",
      "\n",
      "print'the maximum compression of the spring is',x,'m or',x*10.**2.,'cm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the maximum compression of the spring is 0.098 m or 9.8 cm\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}