{
 "metadata": {
  "name": "",
  "signature": "sha256:c5834020c85eb4ee9dd0f62630cfe11c8ed3ce693f7ae9cc407ce5e3a8a74085"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : Velocity in Mechanisms (Relative Velocity Method)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page No : 148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NBA = 120. \t\t\t#rpm\n",
      "AB = 40./1000\n",
      "CD = 80./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.7\n",
      "#Calculating the angular velocity of the crank AB\n",
      "omegaBA = 2*math.pi*NBA/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of B with respect to A\n",
      "vBA = omegaBA*AB \t\t\t#m/s\n",
      "vB = vBA\n",
      "#By measurement from the velocity diagram Fig. 7.7(b)\n",
      "vCD = 0.385 \t\t\t#m/s\n",
      "vC = vCD\n",
      "#Calculating the angular velocity of link CD\n",
      "omegaCD = vCD/CD \t\t\t#rad/s\n",
      "\n",
      "#Results:\n",
      "print \" The angular velocity of link CD omegaCD  =  %.1f rad/s clockwise about D.\"%(omegaCD)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The angular velocity of link CD omegaCD  =  4.8 rad/s clockwise about D.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page No : 148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NBO = 180. \t\t\t#rpm\n",
      "OB = 0.5\n",
      "PB = 2.\n",
      "dO = 50./1000\n",
      "dB = 60./1000\n",
      "dC = 30./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.8\n",
      "#Calculating the angular velocity of the crank BO\n",
      "omegaBO = 2*math.pi*NBO/60 \t\t\t#rad/s\n",
      "#Calculating the linear velocity of B with respect to O\n",
      "vBO = omegaBO*OB \t\t\t#m/s\n",
      "vB = vBO\n",
      "#By measurement from the velocity diagram Fig. 7.8(b)\n",
      "vP = 8.15\n",
      "vPB = 6.8\n",
      "vE = 8.5\n",
      "bg = 5.\n",
      "bp = vPB\n",
      "vG = 8. \t\t\t#m/s\n",
      "#Calculating the angular velocity of the connecting rod PB\n",
      "omegaPB = vPB/PB \t\t\t#rad/s\n",
      "#Calculating the velocity of rubbing at the pin of crank-shaft\n",
      "vCS = dO/2*omegaBO \t\t\t#Velocity of rubbing at the pin of crank-shaft m/s\n",
      "#Calculating the velocity of rubbing at the pin of crank\n",
      "vC = dB/2*(omegaBO+omegaPB) \t\t\t#Velocity of rubbing at the pin of crank m/s\n",
      "#Calculating the velocity of rubbing at the pin of cross-head\n",
      "vPCH = dC/2*omegaPB \t\t\t#Velocity of rubbing at the pin of cross-head m/s\n",
      "#Calculating the position of point G on the connecting rod\n",
      "BG = bg/bp*PB \t\t\t#m\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of piston P vP  =  %.2f m/s.\"%(vP)\n",
      "print \" The angular velocity of connecting rod omegaPB  =  %.1f rad/s anticlockwise.\"%(omegaPB)\n",
      "print \" The velocity of point E on the connecting rod vE  =  %.1f m/s.\"%(vE)\n",
      "print \" The velocity of rubbing at the pin of crank-shaft is %.2f m/s.\"%(vCS)\n",
      "print \" The velocity of rubbing at the pin of crank is %.4f m/s.\"%(vC)\n",
      "print \" The velocity of rubbing at the pin of cross-head is %.3f m/s.\"%(vPCH)\n",
      "print \" The position of point G on the connecting rod BG  =  %.2f m.\"%(BG)\n",
      "print \" The linear velocity of point G vG  =  %d m/s.\"%(vG)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of piston P vP  =  8.15 m/s.\n",
        " The angular velocity of connecting rod omegaPB  =  3.4 rad/s anticlockwise.\n",
        " The velocity of point E on the connecting rod vE  =  8.5 m/s.\n",
        " The velocity of rubbing at the pin of crank-shaft is 0.47 m/s.\n",
        " The velocity of rubbing at the pin of crank is 0.6675 m/s.\n",
        " The velocity of rubbing at the pin of cross-head is 0.051 m/s.\n",
        " The position of point G on the connecting rod BG  =  1.47 m.\n",
        " The linear velocity of point G vG  =  8 m/s.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page No : 150"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NAO = 600. \t\t\t#rpm\n",
      "OA = 28./1000       #m\n",
      "BD = 46./1000 \t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.10\n",
      "#Calculating the angular velocity of crank AO\n",
      "omegaAO = 2*math.pi*NAO/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of A with respect to O\n",
      "vAO = omegaAO*OA \t\t\t#m/s\n",
      "vA = vAO\n",
      "#By measurement from the velocity diagram Fig. 7.10(b)\n",
      "vD = 1.6\n",
      "vDB = 1.7 \t\t\t#m/s\n",
      "#Calculating the angular velocity of D with respect to B\n",
      "omegaBD = vDB/BD \t\t\t#rad/s\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of the slider D vD  =  %.1f m/s.\"%(vD)\n",
      "print \" The angular velocity of the link BD omegaBD  =  %.2f rad/s clockwise sbout B.\"%(omegaBD)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of the slider D vD  =  1.6 m/s.\n",
        " The angular velocity of the link BD omegaBD  =  36.96 rad/s clockwise sbout B.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page No : 151"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NBA = 120. \t\t\t#rpm\n",
      "AB = 150./1000      #mm\n",
      "DC = 450./1000      #mm\n",
      "BC = 450./1000      #mm\n",
      "dC = 50./1000\n",
      "rC = dC/2 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.12\n",
      "#Calculating the angular velocity of the crank AB\n",
      "omegaBA = 2*math.pi*NBA/60 \t\t\t#rad/s\n",
      "#Calculating the linear velocity of B with respect to A\n",
      "vBA = omegaBA*AB \t\t\t#m/s\n",
      "vB = vBA\n",
      "#By measurement from the velocity diagram Fig. 7.12(b)\n",
      "vF = 0.7\n",
      "vCD = 2.25\n",
      "vCB = 2.25 \t\t\t#m/s\n",
      "#Calculating the angular velocity of DC\n",
      "omegaDC = vCD/DC \t\t\t#rad/s\n",
      "#Calculating the angular velocity of BC\n",
      "omegaCB = vCB/BC \t\t\t#rad/s\n",
      "#Calculating the rubbing speed at the pin C\n",
      "vr = (omegaCB-omegaDC)*rC \t\t\t#The rubbing speed at the pin C m/s\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of block F vF  =  %.1f m/s.\"%(vF)\n",
      "print \" The angular velocity of DC omegaDC  =  %d rad/s anticlockwise about D.\"%(omegaDC)\n",
      "print \" The rubbing speed at the pin C is %d m/s.\"%(vr)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of block F vF  =  0.7 m/s.\n",
        " The angular velocity of DC omegaDC  =  5 rad/s anticlockwise about D.\n",
        " The rubbing speed at the pin C is 0 m/s.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page No : 153"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NAO = 120. \t\t\t#rpm\n",
      "OA = 100./1000\n",
      "CE = 350./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.13\n",
      "#Calculating the angular speed of the crank OA\n",
      "omegaAO = 2*math.pi*NAO/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of A with respect to O\n",
      "vAO = omegaAO*OA \t\t\t#m/s\n",
      "vA = vAO\n",
      "#By measurement from the velocity diagram Fig. 7.14(b)\n",
      "vF = 0.53\n",
      "od = 1.08\n",
      "vCE = 0.44 \t\t\t#m/s\n",
      "#Calculating the angular velocity of CE\n",
      "omegaCE = vCE/CE \t\t\t#rad/s\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of F  vF  =  %.2f m/s.\"%(vF)\n",
      "print \" The velocity of sliding of CE in the trunnion is %.2f m/s.\"%(od)\n",
      "print \" The angular velocity of CE  omegaCE  =  %.2f rad/s  clockwise about E.\"%(omegaCE)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of F  vF  =  0.53 m/s.\n",
        " The velocity of sliding of CE in the trunnion is 1.08 m/s.\n",
        " The angular velocity of CE  omegaCE  =  1.26 rad/s  clockwise about E.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6 Page No : 155"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NCO = 120. \t\t\t#rpm\n",
      "OC = 125./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.15\n",
      "#Calculating the angular velocity of the crank CO\n",
      "omegaCO = 2*math.pi*NCO/60 \t\t\t#rad/s\n",
      "#Calculating the linear velocity of C with respect to O\n",
      "vCO = omegaCO*OC \t\t\t#m/s\n",
      "vC = vCO\n",
      "#By measurement from the velocity diagram  Fig. 7.16(b)\n",
      "\n",
      "vCO = 1.57\n",
      "vE = 0.7 \t\t\t#m/s\n",
      "\n",
      "#Results:\n",
      "print \" The absolute velocity of point E of the lever  vE  =  %.1f m/s.\"%(vE)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The absolute velocity of point E of the lever  vE  =  0.7 m/s.\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7 Page No : 156"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NBO1 = 40. \t\t\t#rpm\n",
      "O1O2 = 800./1000\n",
      "O1B = 300./1000\n",
      "O2D = 1300./1000\n",
      "DR = 400./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.18\n",
      "#Calculating the angular speed of the crank BO\n",
      "omegaBO1 = 2*math.pi*NBO1/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of B with respect to O1\n",
      "vBO1 = omegaBO1*O1B \t\t\t#m/s\n",
      "vB = vBO1\n",
      "#By measurement from the velocity diagram  Fig. 7.18(b)\n",
      "vR = 1.44\n",
      "vDO2 = 1.32 \t\t\t#m/s\n",
      "vD = vDO2\n",
      "#Calculating the angular velocity of the link O2D\n",
      "omegaDO2 = vDO2/O2D \t\t\t#rad/s\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of the ram R  vR  =  %.2f m/s.\"%(vR)\n",
      "print \" The angular velocity of the link O2D omegaDO2  =  %.3f rad/s anticlockwise about O2.\"%(omegaDO2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of the ram R  vR  =  1.44 m/s.\n",
        " The angular velocity of the link O2D omegaDO2  =  1.015 rad/s anticlockwise about O2.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.8 Page No : 158"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NAO1 = 60.         \t\t\t#rpm\n",
      "O1A = 85.\n",
      "rQ = 50. \t\t\t#mm\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.20 and Fig. 7.21\n",
      "#Calculating the angular velocity of AO1\n",
      "omegaAO1 = 2*math.pi*NAO1/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of A with respect to O1\n",
      "vAO1 = omegaAO1*O1A \t\t\t#mm/s\n",
      "vA = vAO1\n",
      "#By measurement from the velocity diagram Fig. 7.20(b)\n",
      "vDO2 = 410. \t\t\t#mm/s\n",
      "O2D = 264.   \t\t\t#mm\n",
      "angleB1O2B2 = 60*math.pi/180 \t\t\t#rad\n",
      "#To vary the Scilab function 'beta'\n",
      "alpha = 120\n",
      "beta = 240 \t\t\t#degrees\n",
      "#Calculating the angular velocity of the quadant Q\n",
      "omegaQ = vDO2/O2D \t\t\t#rad/s\n",
      "#Calculating the linear speed of the rack\n",
      "vR = omegaQ*rQ \t\t\t#mm/s\n",
      "#Calculating the ratio of times of lowering and raimath.sing the rack\n",
      "r = beta/alpha\n",
      "#Calculating the length of stroke of the rack\n",
      "L = rQ*angleB1O2B2 \t\t\t#mm\n",
      "\n",
      "#Results:\n",
      "print \" The linear speed of the rack vR  =  %.1f mm/s.\"%(vR)\n",
      "print \" The ratio of times of lowering and raising the rack is %d.\"%(r)\n",
      "print \" The length of the stroke of the rack is %.2f mm.\"%(L)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The linear speed of the rack vR  =  77.7 mm/s.\n",
        " The ratio of times of lowering and raising the rack is 2.\n",
        " The length of the stroke of the rack is 52.36 mm.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.9 Page No : 160"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NPO = 120. \t\t\t#rpm\n",
      "OQ = 100./1000      #mm\n",
      "OP = 200./1000      #mm\n",
      "RQ = 150./1000      #mm\n",
      "RS = 500./1000 \t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.22\n",
      "#Calculating the angular speed of the crank PO\n",
      "omegaPO = 2*math.pi*NPO/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of P with respect to O\n",
      "vPO = omegaPO*OP \t\t\t#m/s\n",
      "vP = vPO\n",
      "#By measurement from the velocity diagram Fig. 7.23(b)\n",
      "vS = 0.8\n",
      "vSR = 0.96\n",
      "vTP = 0.85 \t\t\t#m/s\n",
      "#Calculating the angular velocity of link RS\n",
      "omegaRS = vSR/RS \t\t\t#rad/s\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of the slider S cutting tool vS  =  %.1f m/s.\"%(vS)\n",
      "print \" The angular velocity of the link RS omegaRS  =  %.2f rad/s clockwise about R.\"%(omegaRS)\n",
      "print \" The velocity of the sliding block T on the slotted lever QT vTP  =  %.2f m/s.\"%(vTP)\n",
      "\n",
      "# note :  answer in book is wrong\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of the slider S cutting tool vS  =  0.8 m/s.\n",
        " The angular velocity of the link RS omegaRS  =  1.92 rad/s clockwise about R.\n",
        " The velocity of the sliding block T on the slotted lever QT vTP  =  0.85 m/s.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.10 Page No : 162"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NAD = 100. \t\t\t#rpm\n",
      "TA = 50. \t\t\t#N-m\n",
      "DA = 300./1000\n",
      "CB = 360./1000\n",
      "AB = CB\n",
      "DC = 600./1000 \t\t\t#m\n",
      "eta = 70./100 \t\t\t#%\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.25\n",
      "#Calculating the angular velocity of the crank AD\n",
      "omegaAD = 2*math.pi*NAD/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of A with respect to D\n",
      "vAD = omegaAD*DA \t\t\t#m/s\n",
      "vA = vAD\n",
      "#By measurement from the velocity diagram Fig. 7.25(b)\n",
      "vBC = 2.25 \t\t\t#m/s\n",
      "vB = vBC\n",
      "#Calculating the angular velocity of the driven link CB\n",
      "omegaBC = vBC/CB \t\t\t#rad/s\n",
      "#Calculating the actual mechanical advantage\n",
      "omegaA = omegaAD\n",
      "omegaB = omegaBC\n",
      "MAactual = eta*omegaA/omegaB\n",
      "#Calculating the resisting torque\n",
      "TB = eta*TA*omegaA/omegaB \t\t\t#N-m\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of the point B. vB  =  %.2f m/s.\"%(vB)\n",
      "print \" The angular velocity of the driven link CB. omegaBC  =  %.2f rad/s.\"%(omegaBC)\n",
      "print \" The actual mechanical advantage. M.A.actual)  =  %.2f.\"%(MAactual)\n",
      "print \" The resisting torque. TB  =  %.1f N-m.\"%(TB)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of the point B. vB  =  2.25 m/s.\n",
        " The angular velocity of the driven link CB. omegaBC  =  6.25 rad/s.\n",
        " The actual mechanical advantage. M.A.actual)  =  1.17.\n",
        " The resisting torque. TB  =  58.6 N-m.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.11 Page No : 163"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "WC = 2.5*1000\n",
      "WD = 4.*1000 \t\t\t#N\n",
      "OA = 175./1000          #mm\n",
      "AB = 180./1000          #mm\n",
      "AD = 500./1000          #mm\n",
      "BC = 325./1000 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.26\n",
      "#Assuming the speed of crank OA to be 'N'\n",
      "#Calculating the angular velocity of crank OA\n",
      "#Assume the vector oa (i.e. velocity of A) as 20 m/s\n",
      "N = 20/(2*math.pi/60*OA) \t\t\t#mm\n",
      "#By measurement from the velocity diagram Fig. 7.27(b)\n",
      "vC = 35.\n",
      "vD = 21. \t\t\t#mm\n",
      "#Calculating the velocity ratio between C and the ram D\n",
      "r = vC/vD \t\t\t#The velocity ratio between C and the ram D\n",
      "#Calculating the efficiency of the machine\n",
      "eta = (WD*vD)/(WC*vC)*100 \t\t\t#%\n",
      "\n",
      "#Results:\n",
      "print \" The velocity ratio between C and the ram D is %.2f.\"%(r)\n",
      "print \" The efficiency of the machine eta  = n %d %%.\"%(eta)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity ratio between C and the ram D is 1.67.\n",
        " The efficiency of the machine eta  = n 96 %.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.12 Page No : 165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NAO = 180. \t\t\t#rpm\n",
      "OA = 180./1000      #mm\n",
      "CB = 240./1000      #mm\n",
      "AB = 360./1000      #mm\n",
      "BD = 540./1000 \t\t#mm\n",
      "FD = 2.*1000 \t\t\t#N\n",
      "DA = 30./1000\n",
      "DD = DA\n",
      "rA = DA/2\n",
      "rD = DD/2 \t\t\t#m\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.28\n",
      "#Calculating the angular velocity of the crank OA\n",
      "omegaAO = 2*math.pi*NAO/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of A with respect to O\n",
      "vAO = omegaAO*OA\n",
      "vA = vAO\n",
      "#By measurement fro the velocity diagram  Fig. 7.29(b)\n",
      "vD = 2.05\n",
      "vBA = 0.9\n",
      "vBC = 2.8\n",
      "vDB = 2.4 \t\t\t#m/s\n",
      "#Calculating the angular velocity of the link AB\n",
      "omegaAB = vBA/AB \t\t\t#rad/s\n",
      "#Calculating the angular velocity of the link CB\n",
      "omegaCB = vBC/CB \t\t\t#rad/s\n",
      "#Calculating the angular velocity of the link BD\n",
      "omegaBD = vDB/BD \t\t\t#rad/s\n",
      "#Calculating the relative angular velocity at A\n",
      "rvA = omegaCB-omegaAB+omegaBD \t\t\t#The relative angular velocity at A  rad/s\n",
      "#Calculating the relative angular velocity at D\n",
      "rvD = omegaBD \t\t\t#The relative angular velocity at D  rad/s\n",
      "#Calculating the velocity of rubbing on the pin A\n",
      "vrA = rvA*rA*1000 \t\t\t#The velocity of rubbing on the pin A  mm/s\n",
      "#Calculating the velocity of rubbing on the pin D\n",
      "vrD = rvD*rD*1000 \t\t\t#The velocity of rubbing on the pin D mm/s\n",
      "#Calculating the torque applied to crank OA\n",
      "TA = FD*vD/omegaAO \t\t\t#N-m\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of slider D vD  =  %.2f m/s.\"%(vD)\n",
      "print \" The angular velocity of the link AB, omegaAB  =  %.1f rad/s, anticlockwise about A.\"%(omegaAB)\n",
      "print \" The angular velocity of the link CB, omegaCB  =  %.2f rad/s, anticlockwise about C.\"%(omegaCB)\n",
      "print \" The angular velocity of the link BD, omegaBD  =  %.2f rad/s, clockwise about B.\"%(omegaBD)\n",
      "print \" The velocity of rubbing on the pin A is %d mm/s.\"%(vrA)\n",
      "print \" The velocity of rubbing on the pin D is %d mm/s.\"%(vrD)\n",
      "print \" The torque applied to the crank OA, TA  =  %.1f N-m.\"%(TA)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of slider D vD  =  2.05 m/s.\n",
        " The angular velocity of the link AB, omegaAB  =  2.5 rad/s, anticlockwise about A.\n",
        " The angular velocity of the link CB, omegaCB  =  11.67 rad/s, anticlockwise about C.\n",
        " The angular velocity of the link BD, omegaBD  =  4.44 rad/s, clockwise about B.\n",
        " The velocity of rubbing on the pin A is 204 mm/s.\n",
        " The velocity of rubbing on the pin D is 66 mm/s.\n",
        " The torque applied to the crank OA, TA  =  217.5 N-m.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.13 Page No : 167"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables:\n",
      "NBA = 180 \t\t\t#rpm\n",
      "AB = 0.45           #m\n",
      "BD = 1.5            #m\n",
      "BC = 0.9            #m\n",
      "CE = BC \t\t\t#m\n",
      "FD = 500.\n",
      "FE = 750. \t\t\t#N\n",
      "\n",
      "#Solution:\n",
      "#Refer Fig. 7.31\n",
      "#Calculating the angular velocity of the crank AB\n",
      "omegaBA = 2*math.pi*NBA/60 \t\t\t#rad/s\n",
      "#Calculating the velocity of B with respect to A\n",
      "vBA = omegaBA*AB \t\t\t#m/s\n",
      "vB = vBA\n",
      "#By measurement from the velocity diagram Fig. 7.31(b)\n",
      "vD = 9.5\n",
      "vE = 1.7 \t\t\t#m/s\n",
      "#Calculating the power input\n",
      "Pi = FD*vD-FE*vE \t\t\t#N-m/s\n",
      "#Calculating the turning moment at A\n",
      "TA = Pi/omegaBA \t\t\t#N-m\n",
      "\n",
      "#Results:\n",
      "print \" The velocity of slider D, vD  =  %.1f m/s.\"%(vD)\n",
      "print \" The velocity of slider E, vE  =  %.1f m/s.\"%(vE)\n",
      "print \" The turning moment at A, TA  =  %.1f N-m.\"%(TA)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The velocity of slider D, vD  =  9.5 m/s.\n",
        " The velocity of slider E, vE  =  1.7 m/s.\n",
        " The turning moment at A, TA  =  184.4 N-m.\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}