{
 "metadata": {
  "name": "",
  "signature": "sha256:d3eb95f5e18a78e74ef41bfca92729f5344f3fef9eebaa02f35bb683ba9d0489"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 : Hydrostatics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1 Page No : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "Ar = 50 \t\t#area of ram in**2\n",
      "Ap = 1./8 \t\t#area of plunger in**2\n",
      "Wp = 5. \t\t#force lbs\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Pp = Wp/Ap\n",
      "F = Pp*Ar\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'weight supported by ram  = %.f lbs'%(F)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "weight supported by ram  = 2000 lbs\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2 Page No : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "Dp = 1. \t\t#diameter of punger - in\n",
      "Dr = 10. \t\t#diameter of ram - in\n",
      "R = 12.         #leverage of handle\n",
      "W = 15. \t\t#wieght of body - tons\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Ar = math.pi*Dr**2/4\n",
      "Ap = math.pi*Dp**2/4\n",
      "P = W*2240/((Ar/Ap)*R)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'power applied to lever  = %.f lbs'%(P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "power applied to lever  = 28 lbs\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3 Page No : 7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "Dj = 1. \t\t#diameter of plunger - in\n",
      "Dr = 2. \t\t#in\n",
      "W = 40. \t\t#lbs\n",
      "W1 = 1. \t\t#ton\n",
      "rl = 20.\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Ap = math.pi*Dj**2/4\n",
      "Ar = math.pi*Dr**2/4\n",
      "Vrj = rl*Ar/Ap\n",
      "e = W1*2240*100/(W*Vrj)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'efficiency of machine at this load  = %.f percent'%(e)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "efficiency of machine at this load  = 70 percent\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4 Page No : 7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "Dj = 1. \t\t#in\n",
      "Dr = 2. \t\t#in\n",
      "ns = 3. \t\t#strokes\n",
      "h = 2.   \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Ap = math.pi*Dj**2/4\n",
      "Ar = math.pi*Dr**2/4\n",
      "Vrj = Ar/Ap\n",
      "ns1 = h*12*Vrj/ns\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' working strokes  = %.f strokes'%(ns1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " working strokes  = 32 strokes\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5 Page No : 9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "T = 40. \t\t#F\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "h = 50 \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "p = w*h/(12**2)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' pressure at a depth of 50 ft  = %.2f lbs per in'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " pressure at a depth of 50 ft  = 21.67 lbs per in\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.6 Page No : 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "W = 64. \t\t#lbs/ft**3\n",
      "h1 = 27. \t\t#ft\n",
      "h2 = 9. \t\t#ft\n",
      "w = 40. \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Pr = w*W*h1*h1/2\n",
      "Pl = w*W*h2*h2/2\n",
      "y1 = h1/3\n",
      "y2 = h2/3\n",
      "y = (Pr*y1-Pl*y2)/(Pr-Pl)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' point of application  = %.2f ft'%(y)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " point of application  = 9.75 ft\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.7 Page No : 14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 5.  \t\t#ft\n",
      "x = 3. \t    \t#ft\n",
      "w = 62.4 \t\t#lb/ft**3\n",
      "a = 90. \t\t#degrees\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = math.pi/4*d**2\n",
      "b = w*A*x\n",
      "Ig = round(math.pi*d**4/64,2)\n",
      "Io = Ig + A*x**2 * 1\n",
      "h = Io/(A*x)\n",
      "\n",
      "#RESULTS\n",
      "print  'depth of the pressure = %.2f ft'%(h)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth of the pressure = 3.52 ft\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.8 Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 3.   \t\t#ft\n",
      "h = 4. \t    \t#ft\n",
      "ht = 30 \t\t#ft\n",
      "W = 62.4 \t\t#ft**3\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Ap = w*h\n",
      "X = ht+(h/2)\n",
      "P = Ap*X*W\n",
      "I0 = (w*h**3/12)+Ap*X**2\n",
      "H = I0/(Ap*X)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' total pressure on the gate  = %.2f ft'%(H)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " total pressure on the gate  = 32.04 ft\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.9 Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 3. \t\t#ft\n",
      "h = 4. \t\t#ft\n",
      "ht = 30. \t\t#ft\n",
      "W = 62.4 \t\t#ft**3\n",
      "x = 2.22 \t\t#in\n",
      "x1 = 4.5 \t\t#in\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Ap = w*h\n",
      "X = ht+(h/2)\n",
      "P = Ap*X*W\n",
      "T = P*x/x1\n",
      "T1 = P-T\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' tension devoloped in the top bolt  = %.f lbs'%(T)\n",
      "print  '  tension devoloped in the bottom bolt  = %d lbs'%(T1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " tension devoloped in the top bolt  = 11821 lbs\n",
        "  tension devoloped in the bottom bolt  = 12140 lbs\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.10 Page No : 16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 3.   \t\t#ft\n",
      "h = 15. \t\t#ft\n",
      "d = 140. \t\t#lbs/ft**3\n",
      "x = 6. \t    \t#in\n",
      "W = 62.4 \t\t#lbs/ft**3\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "W1 = h*w*d\n",
      "h = (W1*x*6/(W*12))**(1./3)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  ' height of water rise  = %.2f ft'%(h)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " height of water rise  = 6.72 ft\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.11 Page No : 17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "h = 5. \t\t#ft\n",
      "d = 6. \t\t#ft\n",
      "a = 30. \t\t#degrees\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = math.pi*d**2/4\n",
      "X = h+(d/2)*math.sin(math.radians(a))\n",
      "P = w*A*X\n",
      "Ic = math.pi*d**4/64\n",
      "I0 = Ic+A*X**2/(math.sin(math.radians(a)))**2\n",
      "h = I0*(math.sin(math.radians(a)))**2/(A*X)\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "print  'depth of the centre os pressure = %.2f ft '%(h)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth of the centre os pressure = 6.59 ft \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.12 Page No : 18"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 4. \t    \t#ft\n",
      "l = 4. \t\t    #ft\n",
      "X = 10. \t\t#ft\n",
      "a = 45. \t\t#degrees\n",
      "W = 100. \t\t#lbs\n",
      "a1 = 60. \t\t#degrees\n",
      "w1 = 62.4 \t\t#lbs/ft**3\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = w*l\n",
      "X1 = round(X+(w/2)*math.sin(math.radians(a)),2)\n",
      "Ig = round(w*l**3/12,2)\n",
      "I0 = Ig+(A*X1**2/(math.sin(math.radians(a)))**2)\n",
      "h = I0*(math.sin(math.radians(a)))**2/(A*X1)\n",
      "P = round(w1*A*X1,-2)\n",
      "h1 = round(h-X,2)\n",
      "h2 = round(h1/math.sin(math.radians(a)),2)\n",
      "T = (W*(l/2)*math.sin(math.radians(a))+P*h2)/(w*math.sin(math.radians(a1)))\n",
      "\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print  'Pull in the chain = %d lbs '%(T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pull in the chain = 6885 lbs \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.13 Page No : 20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 4. \t\t#ft\n",
      "l = 4. \t\t#ft\n",
      "X = 10. \t\t#ft\n",
      "a  = 45. \t\t#degrees\n",
      "W = 62.4 \t\t#lbs/ft**3\n",
      "u = 0.25\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = w*l\n",
      "X1 = X+(w/2)*math.sin(math.radians(a))\n",
      "P = W*A*X1\n",
      "T = u*P\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'magnitude of the lifting force = %.f lbs '%(round(T,-1)) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "magnitude of the lifting force = 2850 lbs \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.14 Page No : 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "sg = 1.6\n",
      "h = 10. \t\t#ft\n",
      "h1 = 4. \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "D = w*sg\n",
      "W = w*(h+h1)**2/2\n",
      "P = w*h\n",
      "P1 = D*h1\n",
      "P2 = (P*h/2)+P*h1+(h1*P1/2)\n",
      "y = ((P*h*(h1+(h/3))/2)+P*h1*(h1/2)+P1*h1**2/6)/P2\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Position where P acts = %.1f ft above the base'%(y) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Position where P acts = 4.5 ft above the base\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.15 Page No : 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "pa = 10.     \t#lbs/in**2\n",
      "h = 8. \t\t    #ft\n",
      "h1 = 6. \t\t#ft\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "pg = 10. \t\t#lbs/in**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "Pa = pa*144\n",
      "Pa1 = w*h1\n",
      "Pt = (Pa*h+Pa1*(h1/2))\n",
      "y = (Pa*h*(h/2)+(Pa1*h1*(h-h1)/2))/Pt\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Depth of the centre of pressure = %.2f ft from the base'%(y) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Depth of the centre of pressure = 3.82 ft from the base\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.16 Page No : 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 4. \t\t#ft\n",
      "h = 6. \t\t#in\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = math.pi*d**2/4\n",
      "X = (h-d)\n",
      "I0 = (math.pi*d**4/64)+4*math.pi*(X)**2\n",
      "h1 = I0/(A*X)\n",
      "h2 = d-h1\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Depth of the axis be placed in order = %.1f ft '%(h2) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Depth of the axis be placed in order = 1.5 ft \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.17 Page No : 24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "h = 10 \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "x = math.sqrt(h**2/2)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Depth of the axis be placed in order = %.2f ft '%(x) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Depth of the axis be placed in order = 7.07 ft \n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.18 Page No : 26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "h = 8. \t\t#ft\n",
      "h1 = 10. \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A = h\n",
      "X = (h1/2)\n",
      "Ig = h**3/12\n",
      "I0 = Ig+A*X**2\n",
      "h2 = I0/(A*X)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'depth at which the hinge of the shutter = %.2f ft '%(h2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth at which the hinge of the shutter = 6.07 ft \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.19 Page No : 27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import *\n",
      "\t\t\n",
      "#initialisation of variables\n",
      "k1 = 1. \t\t#ft\n",
      "k2 = 35.98 \t\t#ft\n",
      "k3 = 66.83 \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "\n",
      "vec =roots([k1,0,-k2,k3])\n",
      "\n",
      "X = vec[1]\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'depth of the water = %.2f ft'%(X)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth of the water = 4.65 ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.22 Page No : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 8.   \t\t#ft\n",
      "d1 = 2.     \t\t#ft\n",
      "h = 4. \t\t    #ft\n",
      "h1 = 2 \t\t    #ft\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "A1 = math.pi*d**2/4\n",
      "A2 = math.pi*d1**2/4\n",
      "A = A1-A2\n",
      "x = (A1*d-A2*(d+h-h1))/A\n",
      "P = w*A*x\n",
      "Ig = ((math.pi*d**4/64)+(A1*(d-x)**2))-((math.pi*d1**4/64)+(A2*(h1+d-x)**2))\n",
      "h2 = (Ig/(A*x))+x\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'depth of the centre of the pressure = %.1f ft '%(h2)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "depth of the centre of the pressure = 8.4 ft \n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.25 Page No : 34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "W = 62.4 \t\t#lbs/ft**3\n",
      "a = 140. \t\t#degrees\n",
      "h = 20. \t\t#ft\n",
      "w = 6. \t\t    #ft\n",
      "h1 = 17. \t\t#ft\n",
      "h2 = 5. \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "P1 = int(W*h1**2*w/2)\n",
      "P2 = W*h2**2*w/2\n",
      "P = P1-P2\n",
      "y = (P1*(h1/3)-P2*(h2/3))/P\n",
      "R = P/(2*math.sin(math.radians((180-a)/2)))\n",
      "Rt = y*R/h\n",
      "Rb = R-Rt\n",
      "\n",
      "#RESULTS\n",
      "print  'Rt = %.f lbs '%(Rt)\n",
      "print  ' Rb = %.f lbs '%(Rb)\n",
      "\n",
      "# note : incorrect answer for R in the textbook. Hence, the difference in answers"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rt = 21838 lbs \n",
        " Rb = 50409 lbs \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.26 Page No : 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 64. \t\t#lbs/ft**3\n",
      "h = 12. \t\t#ft\n",
      "l = 9. \t\t#ft\n",
      "a = 45. \t\t#degrees\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "P = w*h**2/2\n",
      "h1 = h/3\n",
      "Rb = P*h1/l\n",
      "Ra = P-Rb\n",
      "Wh = Rb*h1\n",
      "T = Wh/math.sin(math.radians(a))\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print  'Load on the strut = %d lbs '%(T)\n",
      "\n",
      "# note : incorrect answer for T in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load on the strut = 11585 lbs \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.27 Page No : 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "h = 9. \t\t#ft\n",
      "l = 10. \t\t#ft\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "P = w*h**2/2\n",
      "h1 = h/3\n",
      "Ra = P/2\n",
      "x = (w*4*h**2/9)/Ra\n",
      "x1 = x+(h/3)\n",
      "hb = h1-x\n",
      "W = Ra*l\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'magnitude od total in each beam = %d lbs '%(W)\n",
      "\n",
      "# note : rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "magnitude od total in each beam = 12636 lbs \n"
       ]
      }
     ],
     "prompt_number": 23
    }
   ],
   "metadata": {}
  }
 ]
}