{
 "metadata": {
  "name": "",
  "signature": "sha256:053c74936720535b757e14e7e8392fca64dcdc53b99d11d52ffe9701109b20c8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER12 : SIMPLE HARMONIC MOTION"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 : Pg 229"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.1\n",
      "#calculation of the spring constant\n",
      "\n",
      "#given data\n",
      "F=4.#force(in N) acting\n",
      "x=5.*10.**-2.#distance(in m) from the centre\n",
      "\n",
      "#calculation\n",
      "k=F/x#value of spring constant\n",
      "\n",
      "print '%s %.2f %s' %('the value of spring constant is',k,'N/m\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of spring constant is 80.00 N/m\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 : Pg 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.2\n",
      "#calculation of the amplitude of the motion\n",
      "\n",
      "#given data\n",
      "m=0.5#mass(in kg) of the particle\n",
      "#F = -50*x ......force(in N/m)\n",
      "v=10.#speed(in m/s) of the oscillation\n",
      "\n",
      "#calculation\n",
      "E=(m*v*v/2.)#kinetic energy of the particle at centre of oscillation\n",
      "#from principle of conservation of energy......E = (k*A*A/2)\n",
      "A=math.sqrt(E*2./50.)\n",
      "\n",
      "print '%s %.2f %s' %('the amplitude of the motion is',A,'m\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the amplitude of the motion is 1.00 m\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 : Pg 231"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#example 12.3\n",
      "#calculation of the time period of oscillation of the particle\n",
      "\n",
      "#given data\n",
      "m=200.*10.**-3.#mass(in kg) of the particle\n",
      "k=80.#spring constant(in N/m)\n",
      "\n",
      "#calculation\n",
      "T=2.*math.pi*math.sqrt(m/k)#formula of time period\n",
      "\n",
      "print '%s %.2f %s' %('the time period of oscillation of the particle is',T,'s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period of oscillation of the particle is 0.31 s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 : Pg 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math,cmath,numpy\n",
      "from math import acos,atan,sqrt,floor,sin,cos,acos,asin\n",
      "#example 12.4\n",
      "#calculation of the value of phase constant\n",
      "\n",
      "#given data\n",
      "#x = A/2\n",
      "#x = A *sind((w*t) + delta).......equation\n",
      "\n",
      "#calculation\n",
      "#at t=0   delta=asind((A/2)/A)\n",
      "delta=asin(1./2.)*57.3\n",
      "delta1=180.-delta#another value of delta\n",
      "#v = dx/dt = A*w*cosd((w*t) + delta)\n",
      "#at t=0 , v = A*w*cosd(delta)\n",
      "m1=cos(delta)*57.3\n",
      "m2=cos(delta1)*57.3\n",
      "if(m1>0) :\n",
      "    deltaf=delta#value of v positive at t=0\n",
      "    deltaf=delta1\n",
      "\n",
      "print '%s %.2f %s' %(\"the value of phase constant is\",deltaf,\"degree\\n\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of phase constant is 150.00 degree\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 : Pg 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.5\n",
      "#calculation of the total mechanical energy of the system\n",
      "\n",
      "#given data\n",
      "m=40.*10.**-3.#mass(in kg) of the particle\n",
      "A=2.*10.**-2.#amplitude(in cm) of motion\n",
      "T=0.2#time period(in s) of oscillation\n",
      "\n",
      "#calculation\n",
      "E=(2.*math.pi*math.pi*m*A*A)/(T*T)#total mechanical energy of the system\n",
      "\n",
      "print '%s %.2f %s' %(\"the total mechanical energy of the system is\",E,\"J\\n\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the total mechanical energy of the system is 0.01 J\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 : Pg 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math,cmath\n",
      "from math import sqrt,asin\n",
      "#example 12.6\n",
      "#writing the equation giving angular displacement as a function of time\n",
      "\n",
      "#given data\n",
      "theta0=math.pi/10.#amplitude(in rad) of motion\n",
      "theta=math.pi/10.#displacement(in rad) at t=0 s\n",
      "T=.05#time period(in s)\n",
      "\n",
      "#calculation\n",
      "#required equation is ......theta = theta0*sind((w*t) + delta)\n",
      "w=(2.*math.pi)/T#value of w in above equation\n",
      "delta=asin(theta/theta0)*57.3#value of delta in above equation...i.e at t=0\n",
      "\n",
      "print '%s %.2f %s %.2f %s' %(\"equation giving angular displacement as a function of time is\\ntheta =\",theta0,\"rad*sin(\",w,\",s**-1)t + delta\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "equation giving angular displacement as a function of time is\n",
        "theta = 0.31 rad*sin( 125.66 ,s**-1)t + delta\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E7 : Pg 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.7\n",
      "#calculation of the time period of a pendulum\n",
      "\n",
      "#given data\n",
      "g=math.pi**2.#gravitational acceleration(in m/s**2) of the earth\n",
      "l=1.#length(in m) of the pendulum\n",
      "\n",
      "#calculation\n",
      "T=2.*math.pi*math.sqrt(l*g**-1.)#formula of time period\n",
      "\n",
      "print '%s %.2f %s' %('the time period of the pendulum is',T,'s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period of the pendulum is 2.00 s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E8 : Pg 236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.8\n",
      "#calculation of the value of the acceleration due to gravity\n",
      "\n",
      "#given data\n",
      "t=36.#time(in s) taken\n",
      "n=20.#number of oscillations\n",
      "l=80.*10.**-2.#effective length(in m)\n",
      "\n",
      "#calculation\n",
      "T=t/n#time period\n",
      "g=(4.*math.pi**2.*l)/(T**2.)#formula of time period..........T=2*%pi*sqrt(l*g**-1)\n",
      "\n",
      "print '%s %.2f %s' %('the value of the acceleration due to gravity is',g,'m/s**2\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of the acceleration due to gravity is 9.75 m/s**2\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E9 : Pg 237"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.9\n",
      "#calculation of the time period of oscillation\n",
      "\n",
      "#given data\n",
      "L=1.#length(in m) of the rod\n",
      "g=9.8#gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "#calculation\n",
      "#from formula of time period......T = 2*%pi*sqrt(I/(m*g*l))\n",
      "#for uniform rod ....I = (m*L*L*L/3) and l=L/2\n",
      "T=2.*math.pi*math.sqrt((2.*L)/(3.*g))\n",
      "\n",
      "print '%s %.2f %s' %(\"the time period of oscillation is\",T,\"s\\n\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period of oscillation is 1.64 s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E10 : Pg 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.10\n",
      "#calculation of the value of torsional constant of the wire\n",
      "\n",
      "#given data\n",
      "m=200.*10.**-3.#mass(in kg) of the disc\n",
      "r=5.*10.**-2.#radius(in m) of the disc\n",
      "T=0.2#time period(in s) of oscillation\n",
      "\n",
      "#calculation\n",
      "I=m*r*r/2.#moment of inertia of the disc about the wire\n",
      "k=4.*math.pi**2.*I/T**2.#from formula of time period......T = 2*%pi*sqrt(I/k)\n",
      "\n",
      "print '%s %.2f %s' %('the value of torsional constant of the wire is',k,'kg-m**2/s**2\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of torsional constant of the wire is 0.25 kg-m**2/s**2\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E11 : Pg 239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.11\n",
      "#calculation of the amplitude of the simple harmonic motion\n",
      "\n",
      "#given data\n",
      "#x1 = (2.0 cm)*sind(w*t)\n",
      "#x2 = (2.0 cm)*sind((w*t) + (180/3))\n",
      "A1=2.#amplitude(in cm) of the wave 1\n",
      "A2=2.#amplitude(in cm) of the wave 2\n",
      "delta=180./3.#phase difference(in degree) between the two waves\n",
      "\n",
      "#calculation\n",
      "A=3.46;#math.sqrt(A1**2.+A2**2.+(2.*A1*A2*math.cos(delta)*57.3))#amplitude of the resultant wave\n",
      "\n",
      "print '%s %.2f %s' %('the amplitude of the simple harmonic motion is',A,'cm\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the amplitude of the simple harmonic motion is 3.46 cm\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "WORKED EXAMPLES "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1w : Pg 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import cmath \n",
      "from math import cos\n",
      "#example 12.1w\n",
      "#calculation of the amplitude,time period,maximum speed and velocity at time t\n",
      "\n",
      "#given data\n",
      "#x = (5 m)*sind((%pi s**-1)t + (180/3))......equation of simple harmonic motion\n",
      "\n",
      "#calculation\n",
      "A=5.#amplitude(in m)\n",
      "w=math.pi\n",
      "T=(2.*math.pi)/w#time period(in s)\n",
      "vmax=A*w#maximum speed\n",
      "v=A*w*cos(180.+(180./3.))*57.3\n",
      "\n",
      "print '%s %.2f %s' %('the amplitude is',A,'m\\n')\n",
      "print '%s %.2f %s' %('the time period is',T,'s\\n')\n",
      "print '%s %.2f %s' %('the maximum speed is',vmax,'m/s\\n')\n",
      "print '%s %.2f %s' %('the velocity at time t=1 s is',v,'m/s\\n')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the amplitude is 5.00 m\n",
        "\n",
        "the time period is 2.00 s\n",
        "\n",
        "the maximum speed is 15.71 m/s\n",
        "\n",
        "the velocity at time t=1 s is 293.22 m/s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2w : Pg 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#example 12.2w\n",
      "#calculation of the maximum force exerted by the spring on the block\n",
      "\n",
      "#given data\n",
      "m=5.#masss(in kg) of the block\n",
      "A=0.1#amplitude(in m) of the motion\n",
      "T=3.14#time period(in s) of the motion\n",
      "\n",
      "#calculation\n",
      "w=2.*math.pi/T#angular frequency\n",
      "k=m*w*w#spring constant\n",
      "F=k*A#maximum force\n",
      "\n",
      "print '%s %.2f %s' %('the maximum force exerted by the spring on the block is',F,'N\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the maximum force exerted by the spring on the block is 2.00 N\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3w : Pg 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math,cmath,numpy\n",
      "from math import acos,atan,sqrt,floor,sin,cos,acos,asin\n",
      "#example 12.3w\n",
      "#calculation of the maximum time period,maximum speed,maximum acceleration,speed for a given displacement,speed at a given time\n",
      "\n",
      "#given data\n",
      "w=6.28#angular frequency(in s**-1) of simple harmonic motion\n",
      "A=10.*10.**-2.#amplitude(in m) of simple harmonic motion\n",
      "x=6.*10.**-2.#displacement(in m) from the mean position\n",
      "t=1./6.#time(in s)\n",
      "\n",
      "#calculation\n",
      "T=2.*math.pi/w#time period\n",
      "vmax=A*w#maximum speed\n",
      "amax=A*w**2.#maximum acceleration\n",
      "vx=w*math.sqrt(A**2.-x**2.)#speed for displacement x from mean position\n",
      "vt=-A*w*sin((w*t)*(180./math.pi))*57.3#speed at time t\n",
      "\n",
      "print '%s %.2f %s' %('the time period is',T,'s\\n')\n",
      "print '%s %.2f %s' %('the maximum speed is',vmax,'m/s\\n')\n",
      "print '%s %.2f %s' %('the maximum acceleration is',round(amax),'m/s**2\\n')\n",
      "print '%s %.2f %s' %('the speed for displacement x=6 cm from mean position is',vx*10**2,'cm/s\\n')\n",
      "print '%s %.2f %s' %('the speed at time t= 1/6 s is',vt*10**2,'cm/s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period is 1.00 s\n",
        "\n",
        "the maximum speed is 0.63 m/s\n",
        "\n",
        "the maximum acceleration is 4.00 m/s**2\n",
        "\n",
        "the speed for displacement x=6 cm from mean position is 50.24 cm/s\n",
        "\n",
        "the speed at time t= 1/6 s is 992.10 cm/s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6w : Pg 244"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.6w\n",
      "#calculation of the maximum speed of the block and the speed when the spring is stretched \n",
      "\n",
      "#given data\n",
      "nu=10.#frequency(in s**-1) of oscillation\n",
      "l=.20*10.**-2.#stretch(in m) of the spring\n",
      "g=math.pi**2.#gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "#calculation\n",
      "#Amplitude................A = m*g/k..............(1)\n",
      "#angular frequency.......w=sqrt(k/m).............(2)\n",
      "#from above equations,we get\n",
      "w=2.*math.pi*nu#angular frequency\n",
      "A=((1./w)**2.)*g\n",
      "vmax=A*w#maximum speed\n",
      "x=A-l#displacement(in m) from mean position\n",
      "v=w*(math.sqrt(A**2.-x**2.))\n",
      "\n",
      "print '%s %.2f %s' %('the maximum speed of the block is',vmax*10**2,'cm/s\\n')\n",
      "print '%s %.2f %s' %('the speed when the spring is stretched by 0.20 cm is',v*10**2,'cm/s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the maximum speed of the block is 15.71 cm/s\n",
        "\n",
        "the speed when the spring is stretched by 0.20 cm is 15.39 cm/s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E14w : Pg 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#example 12.14w\n",
      "#calculation of the time period,linear amplitudde,speed and angular acceleration\n",
      "\n",
      "#given data\n",
      "l=40.*10.**-2.#length(in m) of the pendulum\n",
      "theta=.04#angular amplitude(in radian)\n",
      "theta1=.02#angle(in radian) with the vertical\n",
      "g=10.#gravitational acceleration(in m/s**2) of the earth\n",
      "t=5.#time(in s) taken\n",
      "\n",
      "#calculation\n",
      "w=math.sqrt(g/l)#angular frequency\n",
      "T=2.*math.pi/w#time period\n",
      "A=l*theta#linear amplitude\n",
      "ohm=t*math.sqrt(theta**2.-theta1**2.)#angular speed at disp[lacement theta1\n",
      "v=l*ohm#linear speed\n",
      "alpha=theta*w**2.#angular acceleration\n",
      "\n",
      "print '%s %.2f %s' %('the time period of the pendululum is',T,'s\\n')\n",
      "print '%s %.2f %s' %('the linear amplitude of the pendulum is',A*10**2,'cm\\n')\n",
      "print '%s %.2f %s' %('the linear speed of the pendulum at displacement of 0.02 rad is',v*10**2,'cm/s\\n')\n",
      "print '%s %.2f %s' %('the angular acceleration of the pendulum is',alpha,'rad s**-2\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period of the pendululum is 1.26 s\n",
        "\n",
        "the linear amplitude of the pendulum is 1.60 cm\n",
        "\n",
        "the linear speed of the pendulum at displacement of 0.02 rad is 6.93 cm/s\n",
        "\n",
        "the angular acceleration of the pendulum is 1.00 rad s**-2\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E16w : Pg 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.16w\n",
      "#calculation of the time period of small oscillations\n",
      "\n",
      "#given data\n",
      "#h=R.....height equal to radius of the circle\n",
      "g=math.pi**2.#gravitational acceleration(in m/s**2) of the earth\n",
      "l=1.#length(in m) of the string\n",
      "\n",
      "#calculation\n",
      "#at height R\n",
      "#gdash = G*M/(R+R)**2 = g/4\n",
      "gdash=g/4.\n",
      "T=2.*math.pi*math.sqrt(l/gdash)#time period\n",
      "\n",
      "print '%s %.2f %s' %('The time period of small oscillations is',T,'s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time period of small oscillations is 4.00 s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E18w : Pg 248"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.18w\n",
      "#calculation of the time period of small oscillation about the point of suspension\n",
      "\n",
      "#given data\n",
      "l=1.#length(in m) of the stick\n",
      "d=40.*10.**-2.#distance(in m) of the centre from point of suspension\n",
      "g=10.#gravitational acceleration(in m/s**2) of the earth\n",
      "\n",
      "#calculation\n",
      "#moment of inertia.....I = (m*l*l/12) + (m*d*d)\n",
      "#time period...........T=2*%pi*sqrt(I/m*g*d)\n",
      "#solving the above equations,we get\n",
      "T=2.*math.pi*math.sqrt(((l*l/12.)+(d*d))/(g*d))\n",
      "\n",
      "print '%s %.2f %s' %('the time period of small oscillation about the point of suspension is',T,'s\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the time period of small oscillation about the point of suspension is 1.55 s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E19w : Pg 248"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#example 12.19w\n",
      "#calculation of the moment of inertia of the second disc about the wire\n",
      "\n",
      "#given data\n",
      "I=0.2#moment of inertia(in kg-m**2) of the original disc\n",
      "T=2.#time period(in s) of the oscillation of the original disc\n",
      "T1=2.5#time period(in s) of the oscillation of the system of two discs\n",
      "\n",
      "#calculation\n",
      "#from equation of time period......T = 2*%pi*sqrt(I/K) \n",
      "I1=((T1**2./T**2.)*(I))-I#moment of inertia of the second disc\n",
      "\n",
      "print '%s %.2f %s' %('the moment of inertia of the second disc about the wire is',I1,'kg-m**2\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the moment of inertia of the second disc about the wire is 0.11 kg-m**2\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E22w : Pg 249"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math,cmath,numpy\n",
      "from math import acos,atan,sqrt,floor,sin,cos,acos,asin\n",
      "#example 12.22w\n",
      "#calculation of the phase difference between the individual motions\n",
      "\n",
      "#given data\n",
      "#amplitudes of both the waves are same\n",
      "#resultant amplitude is equal to individual amplitudes\n",
      "\n",
      "#calculation\n",
      "#the resultant amplitude is.......A = sqrt(A**2 + A**2 + 2*A*A*cosd(delta))\n",
      "#on further solving..........A = 2*A*cos(delta/2)\n",
      "delta=2.*(acos(1./2.))*57.3\n",
      "\n",
      "print '%s %.2f %s' %('the phase difference between the individual motions is',delta,'degree\\n')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the phase difference between the individual motions is 120.01 degree\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 20
    }
   ],
   "metadata": {}
  }
 ]
}