{
 "metadata": {
  "name": "",
  "signature": "sha256:c177c52862f24e7aa2f65bd196b1696db90de567ae2d80d6061ed266557f0af1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter6-Beams and bending part 3"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg215"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The deflection at the free\n",
      "l = 5.;## feet\n",
      "W = 150.;## lb\n",
      "w = 120.;## lb. per foot run\n",
      "l1 = 3.;## feet\n",
      "b = 3.;## inches\n",
      "d = 6.;## inches\n",
      "E = 1.5*10**6;## lb/in^2\n",
      "I = (1./12.)*b*d**3;## in^4\n",
      "y_B1 = (W*l**3)/(3.*E*I);## feet\n",
      "y_B2 = (w*l1*l1**3)/(8.*E*I) + (l-l1)*(w*l1*l1**2)/(6.*E*I);## feet\n",
      "y_B = (12**3)*(y_B1+y_B2);## inches\n",
      "print'%s %.4f %s'%('The deflection at the free end =',y_B,'inches')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflection at the free end = 0.1823 inches\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ex2-pg218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate 'Uniform distributed load\n",
      "b = 4.;## inches\n",
      "d = 9.;## inches\n",
      "l = 12.;## feet\n",
      "y_c = 1/4.;## inches\n",
      "E = 1.5*10**6;## lb/in^2\n",
      "I = (1/12.)*b*d**3;## in^4\n",
      "W = y_c*384.*E*I/(5.*12**3.*l**3);## inches\n",
      "print'%s %.d %s'%('Uniform distributed load, the beam should carry is, W =',W,'lb-wt');\n",
      "\n",
      "##there is an error in the answer given in text book\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Uniform distributed load, the beam should carry is, W = 2343 lb-wt\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg224"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate 'Uniform distributed load the beam should carry\n",
      "b = 4.;## inches\n",
      "d = 9.;## inches\n",
      "l = 12.;## feet\n",
      "y_c = 1/4.;## inches\n",
      "E = 1.5*10**6;## lb/in^2\n",
      "I = (1/12.)*b*d**3;## in^4\n",
      "W = y_c*384.*E*I/(5.*12**3.*l**3);## inches\n",
      "print'%s %.d %s'%('Uniform distributed load, the beam should carry is, W =',W,'lb-wt');\n",
      "\n",
      "##there is an error in the answer given in text book\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Uniform distributed load, the beam should carry is, W = 2343 lb-wt\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg225"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculateThe deflection for a uniformly distributed load\n",
      "d = 6.;## feet\n",
      "l = 60.;## feet\n",
      "f = 15./2.;## tons/in^2\n",
      "E = 13000.;## tons/in^2\n",
      "k1 = 2.*f/(12.*d);## k1 = M_r/I \n",
      "k2 = k1/(l*12./8.);##k2 = W/I\n",
      "y_c = (5./384.)*k2*l**3 *12**3 /E;## inches\n",
      "##If the giredr is of constant deapth and uniform strength, it bends to an arc of a circle of radius R \n",
      "R = E*d*12/(2*f);## inches\n",
      "delta = (l*12)**2 /(8*R);## inches\n",
      "print'%s %.2f %s'%('The deflection for a uniformly distributed load on it is,delta =',delta,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflection for a uniformly distributed load on it is,delta = 1.04 inches\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg227"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The ratio of deapth to span\n",
      "f = 8.;##tons/in^2\n",
      "E = 12800.;## tons/in^2\n",
      "k1 = 1./480.;##central deflection = k = delta/l\n",
      "k2 = (5./24.)*(f/E)/k1 ;##k2 = d/l =  deapth to span ratio\n",
      "print'%s %.3f %s'%('The ratio of deapth to span, d/l =',k2,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio of deapth to span, d/l = 0.062 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg228"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate 'A section with d and If the deapth of section is limited\n",
      "w = 550.;## lb. per foot run\n",
      "f = 1000.;## lb/in^2\n",
      "l = 20.;## feet\n",
      "d_limit = 15.;## inches\n",
      "E = 1.5*10**6;## lb/in^2\n",
      "##central ddeflection\n",
      "delta = (1./2.);## inches\n",
      "d = (5./24.)*(f/E)*20.*12./(1./(2.*20.*12.));## inches\n",
      "M = w*l*l*12./8.;## lb-inches\n",
      "b = M/(f*(1./6.)*d**2);## inches\n",
      "print'%s %.d %s'%('A section with d =',round(d),'inches')\n",
      "print'%s %.d %s'%('b =',round(b),'inches will do.')\n",
      "f1 = (1./(2.*20.*12.))*(d_limit/(l*12.))*E/(5./24.);## lb/in^2\n",
      "b = M/(f1*(1./6.)*d_limit**2);## inches\n",
      "print'%s %.d %s'%('If the deapth of section is limited to',d_limit,'inches,then')\n",
      "print'%s %.1f %s'%('f =',f1,'lb/in^2')\n",
      "print'%s %.1f %s'%('b =',b,'inches');\n",
      "\n",
      "##tha answer is correct only, but it is approximated in the text book.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "A section with d = 16 inches\n",
        "b = 8 inches will do.\n",
        "If the deapth of section is limited to 15 inches,then\n",
        "f = 937.5 lb/in^2\n",
        "b = 9.4 inches\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The position of maximum deflection occurs and  The maximum deflection and The deflection at the centre\n",
      "l = 20.;## feet\n",
      "b = 4.;## feet\n",
      "W = 5.;## tons\n",
      "d = 12.;## inches\n",
      "h = 5.;## inches\n",
      "I_xx = 220.;## in^4\n",
      "E = 13000.;## tons/in^2\n",
      "a = l-b;## feet\n",
      "##for maximum deflection\n",
      "x = math.sqrt((a**2 + 2.*a*b)/3.);## feet\n",
      "y_max = x*12**3 *((a**2 + 2.*a*b) - x**2)/(6.*E*I_xx);## inches\n",
      "##for deflection at the centre\n",
      "x1 = 0.5*l;## inches\n",
      "y_x1 = x1*12**3 *((a*82. + 2.*a*b) - x1*82.)/(6.*E*I_xx);## inches\n",
      "print'%s %.2f %s'%('The position of maximum deflection occurs at x =',x,'feet')\n",
      "print'%s %.4f %s'%('The maximum deflection is, y_max =',y_max,'inches');\n",
      "print'%s %.3f %s'%('The deflection at the centre,',y_x1,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The position of maximum deflection occurs at x = 11.31 feet\n",
        "The maximum deflection is, y_max = 0.2917 inches\n",
        "The deflection at the centre, 0.624 inches\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The position of the maximum deflection and the maximum deflection\n",
      "d = 12.;## inches\n",
      "h = 5.;## inches\n",
      "l = 20.;## feet\n",
      "E = 13000.; ##tons/in**2\n",
      "I_xx = 220.;## in**4\n",
      "W = 4.;## tons\n",
      "W1 = 3.;## tons\n",
      "a = 15.;## feet\n",
      "b = l-a;## feet\n",
      "a1 = 16.;## feet \n",
      "b1 = l-a1;## feet\n",
      "K1 = (-2*W1*b1*l)/(W1*b1-W*b);\n",
      "K2 = (W*b*a**2 + 2*a*W*b**2 + 2*W1*b1*l**2 - W1*b1*a1**2 -2*W1*a1*b1**2 +W1*b1*l**2)/(3*(W1*b1 - W*b));\n",
      "x = -0.5*K1 + math.sqrt(-K2 + 0.25*K1**2);## feet\n",
      "x1 = l-x;## feet\n",
      "y_max = W*b*x*1728.*(a**2 +2*a*b -x**2)/(6.*E*I_xx*l) + W1*b1*x1*1728.*(a1**2 +2.*a1*b1 -x1**2)/(6.*E*I_xx*l);## inches\n",
      "print'%s %.2f %s'%('The position of the maximum deflection is, x =',x,'feet.');\n",
      "print'%s %.4f %s'%('And the maximum deflection is, y_max =',y_max,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The position of the maximum deflection is, x = 10.26 feet.\n",
        "And the maximum deflection is, y_max = 0.4488 inches\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The position of the maximum deflection and the maximum deflection\n",
      "b = 18.;## inches\n",
      "d = 7.;## inches\n",
      "w1 = 1.;## ton per foot run\n",
      "w2 = 3.;## ton per foot run\n",
      "I_xx = 1149.;## in**4\n",
      "E = 13000.;## tons/in**2\n",
      "R_A = 0.5*b + (b/3.);## tons\n",
      "R_B = 0.5*b + (2.*b/3.);## tons\n",
      "##integrating M = E*I*y'', to get E*I*y' and making y' = 0;, we get maximu deflection\n",
      "x = 9.18;## by trial and error method\n",
      "y_derivative = -R_A*0.5*x**3 + x**4 /6. +0.5*(2./3.)*(1./b)*(1./4.)*x**5 + 469.8;\n",
      "y = -R_A*0.5*x**3 /3. + x**4 /24. +0.5*(2./3.)*(1./b)*(1./(4.*5.))*x**5 + 469.8*x;\n",
      "y_max = y;## inches\n",
      "print'%s %.2f %s'%('The position of maximum deflection from the end A, x =',x,'inches')\n",
      "print'%s %.4f %s'%('Maximum deflection, y_max =',y_max*12**3 /(E*I_xx),'inches')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The position of maximum deflection from the end A, x = 9.18 inches\n",
        "Maximum deflection, y_max = 0.3164 inches\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg254"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The position of the maximum deflection and the maximum deflection and  stress induced\n",
      "b = 18.;## inches\n",
      "d = 6.;## inches\n",
      "l = 16.;## feet\n",
      "W = 2.;## tons\n",
      "h = 1./2.;## inches\n",
      "I_xx = 841.76;## in**4\n",
      "E = 13000.;## tons/in**2\n",
      "P = W + math.sqrt(2.*W*h*48.*E*I_xx/(l*12.)**3 + 2.*W);## tons\n",
      "M_max = P*l*12./4.;## ton-inches\n",
      "Z = 2.*I_xx/b ;## in**3\n",
      "f = M_max/Z ;## tons/in**2\n",
      "delta = P*(l*12.)**3 /(48.*E*I_xx);## inches\n",
      "print'%s %.3f %s'%('The maximum instantaneous deflection delta =',delta,'inches')  \n",
      "print'%s %.3f %s'%('stress induced, f =',f,'tons/in**2');\n",
      "##there is an error in the answer given in text book\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum instantaneous deflection delta = 0.193 inches\n",
        "stress induced, f = 7.362 tons/in**2\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Number of plates required and Number of plates required and The initial radius to which the plates must be bent\n",
      "l = 3.;## feet\n",
      "b = 3.;## inches\n",
      "t = 3./8.;## inches\n",
      "W = 1500.;## lb.\n",
      "f = 12.;## tons/in**2\n",
      "E = 30.*10**6;## tons/in**2\n",
      "M_max = W*l*12./4. ;## lb-inches\n",
      "M_r = f*(1./6.)*b*t**2 *2240.;## lb-inches\n",
      "n = M_max/M_r ;## no. of plates\n",
      "n = round(n+1);\n",
      "f = M_max/(n*(1./6.)*b*t**2);## lb/in**2\n",
      "R = E/(2.*f/t) ;## inches\n",
      "delta = (l*12.)**2 /(8.*R);## inches\n",
      "print'%s %.d %s'%('Number of plates required, n =',n,'');\n",
      "print'%s %.4f %s'%(' The central deflection, delta =',delta,'inch.');\n",
      "print'%s %.3f %s'%('The initial radius to which the plates must be bent, R =',R,'inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of plates required, n = 8 \n",
        " The central deflection, delta = 0.6912 inch.\n",
        "The initial radius to which the plates must be bent, R = 234.375 inches\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}