{
 "metadata": {
  "name": "",
  "signature": "sha256:cfde82eb2eac726301e92e1b27c27d3628db6f9b0e8b5d7b0cd15017ca0006f7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9:Elastic stress analysis and design"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.4 pagenumber 465"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given \n",
      "b = 40.0    #mm - The width of the beam crossection\n",
      "h = 300.0   #mm - The length of the beam crossection \n",
      "V = 40.0    #KN - The shear stress in teh crossection\n",
      "M = 10.0    #KN-m - The bending moment on K----K crossection \n",
      "c = h/2     #mm -The position at which maximum stress occurs on the crossection\n",
      "I = b*(h**3)/12                #mmm4 - the moment of inertia \n",
      "#Caliculations \n",
      "\n",
      "stress_max_1 = M*c*(10**6)/I   #The maximum stress occurs at the end\n",
      "stress_max_2 = -M*c*(10**6)/I  #The maximum stress occurs at the end\n",
      "y = 140                        #mm The point of interest, the distance of element from com\n",
      "n = y/(c)                      # The ratio of the distances from nuetral axis to the elements\n",
      "stress_L_1 = n*stress_max_1    #The normal stress on elements L--L\n",
      "stress_L_2 = -n*stress_max_1   #The normal stress on elements L--L\n",
      "x = 10       #mm The length of the element\n",
      "A = b*x      #mm3 The area of the element \n",
      "y_1 = y+x/2  # the com of element from com of whole system\n",
      "stress_xy = V*A*y_1*(10**3)/(I*b) #Mpa - The shear stress on the element \n",
      "#stresses acting in plane 30 degrees \n",
      "o = 60 #degrees - the plane angle\n",
      "stress_theta = stress_L_1/2 +  stress_L_1*(math.cos(math.radians(o)))/2 - stress_xy*(math.sin(math.radians(o))) #Mpa by direct application of equations\n",
      "stress_shear =  -stress_L_1*(math.sin(math.radians(o)))/2 - stress_xy*(math.cos(math.radians(o)))               #Mpa Shear stress\n",
      "  \n",
      "print \"a)The principle stresses are \",round(stress_max_1,2),\"MPa,\",round(stress_max_2,2),\"Mpa\"\n",
      "print \"b)The stresses on inclines plane \",round(stress_theta,2),\"Mpa noraml, \",round(stress_shear,2),\"Mpa shear \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a)The principle stresses are  16.67 MPa, -16.67 Mpa\n",
        "b)The stresses on inclines plane  11.11 Mpa noraml,  -7.06 Mpa shear \n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.5 page number 476"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "M = 10           #KN-m moment\n",
      "v = 8.0            #KN - shear Stress \n",
      "stress_allow = 8 #MPa - The maximum allowable stress\n",
      "shear_allow_per = 1.4      #Mpa - The allowable stress perpendicular to grain\n",
      "stress_allow_shear = 0.7   #MPa - The maximum allowable shear stress\n",
      "#Caliculations \n",
      "\n",
      "S = M*(10**6)/stress_allow #mm3 \n",
      "#lets arbitarly assume h = 2b\n",
      "#S = b*(h**2)/6\n",
      "h = pow(12*S,0.333)              #The depth of the beam\n",
      "b = h/2                          #mm The width of the beam\n",
      "A = h*b                          #mm2 The area of the crossection , assumption\n",
      "stress_shear = 3*v*(10**3)/(2*A) #Mpa The strear stress \n",
      "if stress_shear<stress_allow_shear:\n",
      "    print \"The stress developed \",round(stress_shear,2),\" is in allowable ranges for \",round(A,2),\"mm2 area\"\n",
      "else:\n",
      "    print \"The stress developed\",stress_shear,\" is in non allowable ranges\",A,\"area\"\n",
      "Area_allow = v*(10**3)/shear_allow_per  #mm - the allowable area\n",
      "print \"The minimum area is \",Area_allow ,\"mm2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress developed  0.4  is in allowable ranges for  30077.85 mm2 area\n",
        "The minimum area is  5714.28571429 mm2\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 36,
       "text": [
        "8.0"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.6 page number 478"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "stress_allow = 24 #ksi - The maximum allowable stress\n",
      "stress_allow_shear = 14.5   #ksi- The maximum allowable shear stress\n",
      "M_max  = 36 #k-ft The maximum moment\n",
      "l = 16 #in-The length of the rod\n",
      "w = 2 #k/ft - The force distribution on the rod\n",
      "R_A = 6.4 #k - The reaction at A\n",
      "R_B = 25.6 #k - the reaction at B\n",
      "v_max = R_B-l*w #kips the maximum stress, from diagram\n",
      "#W8x24 is used from the appendix table 3 and 4 \n",
      "l =0.245 #in - W8x24 crossesction length\n",
      "#Caliculations \n",
      "\n",
      "stress_xy = v_max/A #ksi the approximate shear stress \n",
      "if stress_xy < stress_allow_shear:\n",
      "    print \"W8x24 gives the allowable ranges of shear stress\"\n",
      "else:\n",
      "     print \"W8x24 doesnot gives the allowable ranges of shear stress\"\n",
      "k = 7.0/8 #in the distance from the outer face of the flange to the webfillet\n",
      "#at+kt should not exceed 0.75 of yeild stress\n",
      "#a1t+2kt should not exceed 0.75 of yeild stress\n",
      "Stress_yp = 36 #Ksi - The yeild stress\n",
      "t = 0.245 #in thickness of the web\n",
      "#support a \n",
      "a = R_A/(0.75*Stress_yp*t)-k #in lengths of the bearings\n",
      "#support b\n",
      "a_1 = R_B/(0.75*Stress_yp*t)-2*k #in lengths of the bearings\n",
      "print \"lengths of the bearing at A \",round(a,3),\"in\"\n",
      "print \"lengths of the bearing at B\",round(a_1,3),\"in\"\n",
      "    \n",
      "\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W8x24 gives the allowable ranges of shear stress\n",
        "lengths of the bearing at A  0.092 in\n",
        "lengths of the bearing at B 2.12 in\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 44,
       "text": [
        "0.875"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.8 page number 483"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given \n",
      "hp = 63000              #horse power\n",
      "T = hp*20*(10**-3)/63   #k-in the torsion implies due to horse power\n",
      "stress_allow_shear = 6  #ksi- The maximum allowable shear stress\n",
      "M_ver = 6.72/2          #k-in the vertical component of the moment \n",
      "M_hor = 9.10            #k-in the horizantal component of the moment \n",
      "#Caliculations \n",
      "\n",
      "M = pow(((M_ver**2)+(M_hor**2)),0.5)                                 #K-in The resultant \n",
      "d = pow((16*(((M**2)+(T**2))**0.5)/(stress_allow_shear*3.14)),0.333) #in, The suggested diameter from derivation\n",
      "print \"The suggested diameter is\",round(d,2),\"in\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The suggested diameter is 2.66 in\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}