{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: Stresses in Beams Basic Topics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, page no. 307"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "calculate radius of curvature, curvature & deflection of beam\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "import numpy\n",
      "\n",
      "#initialisation\n",
      "\n",
      "L = 8.0                       # length of beam in ft\n",
      "h = 6.0                       # Height of beam in inch\n",
      "e = 0.00125                   # elongation on the bottom surface of the beam\n",
      "y = -3.0                      # Dismath.tance of the bottom surface to the neutral surface of the beam in inch\n",
      "\n",
      "#Calculations\n",
      "r = -(y/e)                    # Radius of curvature\n",
      "print \"radius of curvature is\", round(r), \"inch\"\n",
      "k = 1/r                     # curvature in in-1\n",
      "print \"curvature\", round(k,5), \"ft-1\"\n",
      "theta = numpy.degrees(numpy.arcsin(((L*12.0)/(2.0*r))))         # angle in degree\n",
      "print \"Angle of twist\", round(theta,3), \"degree\"\n",
      "my_del = r*(1-math.cos(math.radians(theta)))       #Deflection in inch\n",
      "print \"Deflection in the beam is \", round(my_del,4), \"inch\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "radius of curvature is 2400.0 inch\n",
        "curvature 0.00042 ft-1\n",
        "Angle of twist 1.146 degree\n",
        "Deflection in the beam is  0.48 inch\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, page no. 315"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "Evaluate bending moment & maximum bending stress in the wire\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "d = 0.004                       # thickness of wire in m\n",
      "R0 = 0.5                        # radius of cylinder in m\n",
      "E = 200e09                      # Modulus of elasticity of steel\n",
      "s = 1200e06                     # proportional limit of steel\n",
      "\n",
      "#calculation\n",
      "\n",
      "M = (math.pi*E*d**4)/(32*(2*R0+d))      # Bending moment in wire in N-m\n",
      "print \"Bending moment in the wire is \", round(M,2), \"N-m\"\n",
      "s_max = (E*d)/(2*R0+d)                  # Maximum bending stress in wire in Pa\n",
      "print \"Maximum bending stress in the wire is %e\" %(s_max), \"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Bending moment in the wire is  5.01 N-m\n",
        "Maximum bending stress in the wire is 7.968127e+08 Pa\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, page no. 316"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "find maximum tensile and compressive stress in the beam\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "L = 22                          # Span of beam in ft\n",
      "q = 1.5                         # Uniform load intensity in k/ft\n",
      "P = 12                          # Concentrated in k\n",
      "b = 8.75                        # width of cross section of beam in inch\n",
      "h = 27                          # height of cross section of beam in inch\n",
      "Ra = 23.59                      # Reaction at point A\n",
      "Rb = 21.41                      # Reacyion at point B\n",
      "Mmax = 151.6                    # Maximum bending moment\n",
      "\n",
      "#calculation\n",
      "\n",
      "S = (b*h**2)/6                  # Section modulus\n",
      "s = (Mmax*12)/S                 # stress in k\n",
      "st = s*1000                     # Tensile stress\n",
      "print \"Maximum tensile stress in the beam\", round(st), \"psi\"\n",
      "sc = -s*1000                    # Compressive stress\n",
      "print \"Maximum compressive stress in the beam\", round(sc), \"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum tensile stress in the beam 1711.0 psi\n",
        "Maximum compressive stress in the beam -1711.0 psi\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, page no. 318"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "because of uniform load in the beam, calculate maximum tensile & compressive stress\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "q = 3200.0                        # Uniform load intensity in N/m\n",
      "b = 0.3                           # width of beam in m\n",
      "h = 0.08                          # Height of the beam in m\n",
      "t = 0.012                         # thickness of beam in m\n",
      "Ra = 3600.0                       # Reaction at A in N\n",
      "Rb = 10800.0                      # Reaction at B in N\n",
      "Mpos = 2025.0                     # Moment in Nm\n",
      "Mneg = -3600.0                    # Moment in Nm\n",
      "\n",
      "#calculation\n",
      "y1 = t/2.0\n",
      "A1 = (b-2*t)*t  \n",
      "y2 = h/2\n",
      "A2 = h*t  \n",
      "A3 = A2  \n",
      "c1 = ((y1*A1)+(2*y2*A2))/((A1)+(2*A2))\n",
      "c2 = h - c1 \n",
      "Ic1 = (b-2*t)*(t**3)*(1.0/12.0)\n",
      "d1 = c1-(t/2.0)\n",
      "Iz1 = (Ic1)+(A1*(d1**2))\n",
      "Iz2 = 956600e-12\n",
      "Iz3 = Iz2 \n",
      "Iz = Iz1 + Iz2 + Iz3                # Moment of inertia of the beam cross section\n",
      "\n",
      "# Section Modulli\n",
      "S1 = Iz / c1                        # for the top surface\n",
      "S2 = Iz / c2                        # for the bottom surface\n",
      "\n",
      "# Maximum stresses for the positive section\n",
      "st = Mpos / S2 \n",
      "print \"Maximum tensile stress in the beam in positive section is\", st, \"Pa\"\n",
      "sc = -Mpos / S1 \n",
      "print \"Maximum compressive stress in the beam in positive section is\", sc, \"Pa\"\n",
      "\n",
      "# Maximum stresses for the negative section\n",
      "snt = -Mneg / S1 \n",
      "print \"Maximum tensile stress in the beam in negative section is\", snt, \"Pa\"\n",
      "snc = Mneg / S2 \n",
      "print \"Maximum compressive stress in the beam in negative section is\", snc, \"Pa\"\n",
      "\n",
      "# Conclusion\n",
      "st_max = st\n",
      "sc_max = snc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum tensile stress in the beam in positive section is 50468539.6422 Pa\n",
        "Maximum compressive stress in the beam in positive section is -15157118.8248 Pa\n",
        "Maximum tensile stress in the beam in negative section is 26945989.0219 Pa\n",
        "Maximum compressive stress in the beam in negative section is -89721848.2528 Pa\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exampe 5.5, page no. 325"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "choose a suitable size for the beam\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "L = 12                      # Length of beam in ft\n",
      "q = 420                     # Uniform load intensity in lb/ft\n",
      "s = 1800                    # Allowable bending stress in psi\n",
      "w = 35                      # weight of wood in lb/ft3\n",
      "\n",
      "#calculation\n",
      "M = (q*L**2*12)/8           # Bending moment in lb-in\n",
      "S = M/s                     # Section Modulli in in3\n",
      "\n",
      "# From Appendix F\n",
      "q1 = 426.8                  # New uniform load intensity in lb/ft\n",
      "S1 = S*(q1/q)               # New section modulli in in3\n",
      "\n",
      "# From reference to appendix F, a beam of cross section 3*12 inch is selected\n",
      "print (\"Beam of crosssection 3*12 is sufficient\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Beam of crosssection 3*12 is sufficient\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6, page no. 326"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "find min. req. diameter of the woodpost & req. outer diameter of aluminum tube\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "\n",
      "#initialisation\n",
      "P = 12000                           # Lataeral load at the upper end in N\n",
      "h = 2.5                             # Height of post in m\n",
      "Mmax = P*h                          # Maximum bending moment in Nm\n",
      "\n",
      "#calculation\n",
      "# Part (a) : Wood Post\n",
      "s1 = 15e06                          # Maximum allowable stress in Pa\n",
      "S1 = Mmax/s1                        # Section Modulli in m3\n",
      "d1 = ((32.0*S1)/math.pi)**(1.0/3.0)       # diameter in m\n",
      "print \"the minimum required diameter d1 of the wood post is\", round(d1,3), \"m\"\n",
      "\n",
      "# Part (b) : Alluminium tube\n",
      "s2 = 50e06                          # Maximum allowable stress in Pa\n",
      "S2 = Mmax/s2                        # Section Modulli in m3\n",
      "d2 = (S2/0.06712)**(1.0/3.0)            # diameter in meter.....(1) \n",
      "print \"minimum required outer diameter d2 of the aluminum tube is\", round(d2,3),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the minimum required diameter d1 of the wood post is 0.273 m\n",
        "minimum required outer diameter d2 of the aluminum tube is 0.208 m\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, page no. 326"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "evaluate and select a structural steel beam of wide-flange shape to support the loads\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "q = 2000.0                        # Uniform load intensity in lb/ft\n",
      "s = 18000.0                       # Maximum allowable load in Psi\n",
      "Ra = 18860.0                      # Reaction at point  A\n",
      "Rb = 17140.0                      # Reaction at point  B\n",
      "\n",
      "#calculation\n",
      "x1 = Ra/q                         # Distance in ft from left end to the point of zero shear\n",
      "Mmax = (Ra*x1)-((q*(x1**2))/2.0)  # Maximum bending moment in lb-ft\n",
      "S = (Mmax*12.0)/s                 # Section Modulli in in3\n",
      "\n",
      "# Trial Beam\n",
      "Ra_t = 19380.0                            # Reaction at point  A\n",
      "Rb_t = 17670.0                            # Reaction at point  B\n",
      "\n",
      "#in Python the value for x1 differes by some points and hence the subsequent results differ\n",
      "x1_t = Ra_t/q                             # Distance in ft from left end to the point of zero shear\n",
      "Mmax_t = (Ra_t*x1_t)-((q*(x1_t**2))/2.0)  # Maximum bending moment in lb-ft\n",
      "S_t = (Mmax_t*12.0)/s                     # Section Modulli in in3\n",
      "# From table E beam 12*50 is selected \n",
      "print \"Beam of crosssection 12*50 is selected with section modulli\", round(S_t,1), \"in^3\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Beam of crosssection 12*50 is selected with section modulli 62.6 in^3\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8, page 329"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "find min. req. dimension of the posts\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "\n",
      "#initialisation \n",
      "g = 9810                        # Specific weight of water in N/m3\n",
      "h = 2                           # Height of dam in m\n",
      "s = 0.8                         # Dismath.tance between square cross section in m\n",
      "sa = 8e06                       # Maximum allowable stress in Pa\n",
      "\n",
      "#Calculations\n",
      "b = ((g*(h**3)*s)/sa)**(1.0/3.0)    # Dimension of croossection in m\n",
      "\n",
      "#Result\n",
      "print \"the minimum required dimension b of the posts\", round(b,3), \"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the minimum required dimension b of the posts 0.199 m\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11, page no. 341"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "find normal & shear stress at point C\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "L = 3                       # Span of beam in ft\n",
      "q = 160                     # Uniform load intensity in lb/in\n",
      "b = 1                       # Width of cross section\n",
      "h = 4                       # Height of cross section\n",
      "\n",
      "# Calculations from chapter 4\n",
      "Mc = 17920                  # Bending moment in ld-in\n",
      "Vc = -1600                  # Loading in lb\n",
      "I = (b*(h**3))/12.0           # Moment of inertia in in4\n",
      "sc = -(Mc*1)/I              # Compressive stress at point C in psi\n",
      "Ac = 1*1                    # Area of section C in inch2\n",
      "yc = 1.5                    # dismath.tance between midlayers od section C and cross section of beam\n",
      "Qc = Ac*yc                  # First moment of C cross section in inch3\n",
      "tc = (Vc*Qc)/(I*b)          # Shear stress in Psi\n",
      "print \"Normal stress at C\", sc, \"psi\"\n",
      "print \"Shear stress at C\", tc, \"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Normal stress at C -3360.0 psi\n",
        "Shear stress at C -450.0 psi\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12, page no. 342"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "calculate max. permissible value\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "\n",
      "#initialisation\n",
      "s = 11e06                       # allowable tensile stress in pa\n",
      "t = 1.2e06                      # allowable shear stress in pa\n",
      "b = 0.1                         # Width of cross section in m\n",
      "h = 0.15                        # Height of cross section in m\n",
      "a = 0.5                         # in m\n",
      "\n",
      "#Calculations\n",
      "P_bending = (s*b*h**2)/(6.0*a)    # Bending stress in N\n",
      "P_shear = (2*t*b*h)/3.0           # shear stress in N\n",
      "Pmax = P_bending                # Because bending stress governs the design\n",
      "\n",
      "#Result\n",
      "print \"the maximum permissible value Pmax of the loads\", Pmax, \"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the maximum permissible value Pmax of the loads 8250.0 N\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.13, page no. 345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "evaluate max. shear stress in the pole & diameter of solid pole\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "\n",
      "#initialisation\n",
      "d2 = 4                      # Outer diameter in inch\n",
      "d1 = 3.2                    # Inner diameter in inch\n",
      "r2 = d2/2                   # Outer radius in inch\n",
      "r1 = d1/2                   # inner radius in inch\n",
      "P = 1500                    # Horizontal force in lb\n",
      "\n",
      "#calculation\n",
      "# Part (a)\n",
      "t_max = ((r2**2+(r2*r1)+r1**2)*4*P)/(3*math.pi*((r2**4)-(r1**4)))  # Mximum shear stress in Psi\n",
      "print \"Maximum shear stress in the pole is\", round(t_max), \"psi\"\n",
      "\n",
      "# Part (b)\n",
      "d0 = math.sqrt((16*P)/(3*math.pi*t_max))  # Diameter of solid circular cross section in meter\n",
      "print \"Diameter of solid circular cross section is \", round(d0,2), \"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum shear stress in the pole is 658.0 psi\n",
        "Diameter of solid circular cross section is  1.97 m\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.14, page no. 351"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "maximum shear stress, minimum shear stress, and total shear force in the web.\n",
      "\"\"\"\n",
      "\n",
      "import math\n",
      "\n",
      "#initialisation\n",
      "b = 0.165                   # in m\n",
      "h = 0.320                   # in m\n",
      "h1 = 0.290                  # in m\n",
      "t = 0.0075                  #  in m\n",
      "V = 45000.0                   # Vertical force in N\n",
      "\n",
      "#calculation\n",
      "I = (1.0/12.0)*((b*(h**3))-(b*(h1**3))+(t*(h1**3))) # Moment of inertia of the cros section\n",
      "t_max = (V/(8.0*I*t))*((b*(h**2))-(b*(h1**2))+(t*(h1**2))) # Maximum shear stress in Pa\n",
      "t_min = ((V*b)/(8*I*t))*(h**2-h1**2) # Minimum shear stress in Pa\n",
      "T = ((t*h1)/3.0)*(2*t_max + t_min) # Total shear force in Pa\n",
      "t_avg = V/(t*h1)  # Average shear stress in Pa\n",
      "\n",
      "#Result\n",
      "print \"Maximum shear stress in the web is\", round(t_max,2), \"Pa\"\n",
      "print \"Minimum shear stress in the web is\", round(t_min,2), \"Pa\"\n",
      "print \"Total shear stress in the web is\", round(T,2), \"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum shear stress in the web is 20985785.26 Pa\n",
        "Minimum shear stress in the web is 17359517.46 Pa\n",
        "Total shear stress in the web is 43015.04 N\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.15, page no. 352"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "find shear stress at top of the web\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "V = 10000                   # Vertical shear force in lb\n",
      "b = 4                       # in inch\n",
      "t = 1                       # in inch\n",
      "h = 8                       # in inch\n",
      "h1 = 7                      # in inch\n",
      "\n",
      "#calculation\n",
      "A = b*(h-h1) + t*h1                             # Area of cross section \n",
      "Qaa = ((h+h1)/2.0)*b*(h-h1) + (h1/2.0)*(t*h1)       # First moment of cross section\n",
      "c2 = Qaa/A                                      # Position of neutral axis in inch\n",
      "c1 = h-c2                                       # Position of neutral axis in inch\n",
      "Iaa = (b*h**3)/3.0 - ((b-t)*h1**3)/3.0              # Moment of inertia about the line aa\n",
      "I = Iaa - A*c2**2                               # Moment of inertia of crosssection\n",
      "Q1 = b*(h-h1)*(c1-((h-h1)/2.0))                   # First moment of area above the line nn\n",
      "t1 = (V*Q1)/(I*t)                               # Shear stress at the top of web in Psi\n",
      "Qmax = (t*c2)*(c2/2.0)                            # Maximum first moment of inertia below neutral axis\n",
      "t_max = (V*Qmax)/(I*t)                          # Maximum Shear stress in Psi\n",
      "\n",
      "#Result\n",
      "print \"Shear stress at the top of the web is\", round(t1), \"psi\"\n",
      "print \"Maximum Shear stress in the web is\", round(t_max), \"Psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shear stress at the top of the web is 1462.0 psi\n",
        "Maximum Shear stress in the web is 1762.0 Psi\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.16, page no. 357"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "maximum permissible longitudinal spacing of the screws\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "\n",
      "Af = 40*180                     # Area of flange in mm2\n",
      "V = 10500                       # Shear force acting on cross section\n",
      "F = 800                         # Allowable load in shear\n",
      "df = 120                        # Dismath.tance between centroid of flange and neutral axis in mm\n",
      "\n",
      "#calculation\n",
      "Q = Af*df                       # First moment of cross section of flange\n",
      "I = (1.0/12.0)*(210*280**3) - (1.0/12.0)*(180*200**3)  # Moment of inertia of entire cross section in mm4\n",
      "f = (V*Q)/I                     # Shear flow\n",
      "s = (2*F)/f                     # Spacing between the screw\n",
      "\n",
      "#Result\n",
      "print \"The maximum permissible longitudinal spacing s of the screws is\", round(s,1), \"mm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum permissible longitudinal spacing s of the screws is 46.6 mm\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.17, page no. 362"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"\n",
      "maximum tensile and compressive stress in the beam\n",
      "\"\"\"\n",
      "\n",
      "import math \n",
      "\n",
      "#initialisation\n",
      "L = 60                           # Length of beam in inch\n",
      "d = 5.5                          # dismath.tance from the point of application of the load P to the longitudinal axis of the tube in inch\n",
      "b = 6                            # Outer dimension of tube in inch\n",
      "A = 20                           # Area of cross section of tube in inch\n",
      "I = 86.67                        # Moment of inertia in in4\n",
      "P = 1000                         # in lb\n",
      "theta = 60                       # in degree\n",
      "Ph = P*math.sin(math.radians(60)) # Horizontal component\n",
      "Pv = P*math.cos(math.radians(60)) # Vertical component\n",
      "\n",
      "#Calculations\n",
      "M0 = Ph*d                        # Moment in lb-in\n",
      "y = -3                           # Point at which maximum tensile stress occur in inch\n",
      "N = Ph                           # Axial force\n",
      "M = 9870                         # Moment in lb-in\n",
      "st_max = (N/A)-((M*y)/I)         # Maximum tensile stress in Psi\n",
      "yc = 3                           # in inch\n",
      "M1 = 5110                        # moment in lb-in\n",
      "sc_left = (N/A)-((M*yc)/I)       # Stress at the left of point C in Psi\n",
      "sc_right = -(M1*yc)/I            # Stress at the right of point C in Psi\n",
      "sc_max = min(sc_left,sc_right)   # Because both are negative quantities\n",
      "\n",
      "#Result\n",
      "print \"The maximum compressive stress in the beam is\", round(sc_max), \"psi\"\n",
      "print \"The maximum tensile stress in the beam is\", round(st_max), \"psi\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum compressive stress in the beam is -298.0 psi\n",
        "The maximum tensile stress in the beam is 385.0 psi\n"
       ]
      }
     ],
     "prompt_number": 26
    }
   ],
   "metadata": {}
  }
 ]
}