{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8:Combined Loadings"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1 Page No 408"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "di=4*12          #inch, diameter\n",
      "ri=di/2.0        #Radius\n",
      "t=0.5           #inch, thickness\n",
      "sigma=20.0     #Ksi,  stress\n",
      "\n",
      "#Calculation\n",
      "#Cylindrical Pressure Vessel\n",
      "p1=(t*sigma)/ri #sigma = pr/t\n",
      "#Spherical Vessel\n",
      "p2=(2*t*sigma)/(ri) #sigma = pr/2t\n",
      "\n",
      "#Display\n",
      "print\"The maximum internal pressure the cylindrical pressure vessel can sustainis\",round(p1*1000,0),\"psi\"\n",
      "print\"The maximum internal pressure a spherical pressure vessel can sustain is\",round(p2*1000,0),\"psi\"\n",
      "\n",
      "   "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum internal pressure the cylindrical pressure vessel can sustainis 417.0 psi\n",
        "The maximum internal pressure a spherical pressure vessel can sustain is 833.0 psi\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2 Page No 414"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine stress at point B and C\n",
      "\n",
      "#Given\n",
      "P = 15000.0     #N, force,\n",
      "a = 40.0        #mm, length\n",
      "b = 100.0       #mm, breadth\n",
      "\n",
      "#CAlculation\n",
      "#Normal Force\n",
      "A = a*b         #Area\n",
      "sigma = P/A\n",
      "#Bending Moment\n",
      "I = (a*b**3)/12.0 #I = (1/12)*bh**3\n",
      "M = P*(b/2.0)  \n",
      "c = b/2.0\n",
      "sigma_max =(M*c)/I\n",
      "\n",
      "#Superposition\n",
      "x = ((sigma_max-sigma)*b)/((sigma_max+sigma)+(sigma_max-sigma))\n",
      "sigma_b = (sigma_max-sigma)\n",
      "sigma_c = (sigma_max + sigma)\n",
      "\n",
      "#Display\n",
      "print\"The state of stress at B  is(tensile)\",sigma_b,\"psi\"\n",
      "print\"The state of stress at C is (compressive)\",sigma_c,\"psi\"\n",
      "\n",
      "\n",
      " \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The state of stress at B  is(tensile) 7.5 psi\n",
        "The state of stress at C is (compressive) 15.0 psi\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3 Page No 415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the stress\n",
      "\n",
      "#Given:\n",
      "ri =24       #inch, radius\n",
      "t = 0.5      #inch\n",
      "ro = ri+t\n",
      "sp_wt_water = 62.4    #lb/ft**3\n",
      "sp_wt_steel = 490     #lb/ft**3\n",
      "l_a = 3               #m depth of point A from the top\n",
      "\n",
      "#Internal Loadings:\n",
      "import math\n",
      "v = (math.pi*l_a)*((ro/12.0)**2 - (ri/12.0)**2)\n",
      "W_st = sp_wt_steel*v\n",
      "p = sp_wt_water*l_a #lb/ft**2,Pascal's Law\n",
      "p_=p*0.0069         #psi\n",
      "#Circumferential Stress:\n",
      "sigma1 = (p_*ri)/t\n",
      "#Longitudinal Stress:\n",
      "A_st = (math.pi)*(ro**2 - ri**2)\n",
      "sigma2 = W_st/A_st\n",
      "\n",
      "#Display:\n",
      "print\"The state of stress at A (Circumferential)\",round(sigma1,0),\"KPa\"\n",
      "print\"The state of stress at A (Longitudinal) \",round(sigma2,1),\"KPa\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The state of stress at A (Circumferential) 62.0 KPa\n",
        "The state of stress at A (Longitudinal)  10.2 KPa\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4 Page No 417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the state of stress\n",
      "\n",
      "#Given\n",
      "y_c = 125/1000.0 #m,  length\n",
      "x_c = 1.5        #m\n",
      "y_b = 1.5         #m\n",
      "x_b = 6.0         #m\n",
      "udl = 50.0       #kN/m, force per unit length\n",
      "l_udl = 2.5      #m\n",
      "l = 250/1000.0   #m\n",
      "width = 50/1000.0 #m \n",
      "\n",
      "\n",
      "#Internal Loadings:\n",
      "N = 16.45 #kN\n",
      "V = 21.93 #kN\n",
      "M = 32.89 #kNm\n",
      "\n",
      "#Stress Components:\n",
      "#Normal Force:\n",
      "A = l*width\n",
      "sigma1 = N/(A*1000)\n",
      "#Shear Force:\n",
      "tou_c = 0\n",
      "#Bending Moment:\n",
      "c = y_c\n",
      "I = (1/12.0)*(width*l**3)\n",
      "sigma2 = (M*c)/(I*1000)\n",
      "#Superposition:\n",
      "sigmaC = sigma1+sigma2\n",
      "\n",
      "#Display:\n",
      "print\"The stress due to normal force at C   \",round(sigma1,2),\"MPa\"\n",
      "print\"The stress due to shear force at C    \",tou_c,\"MPa\"\n",
      "print\"The stress due to bending moment at C \",round(sigma2,1),\"MPa\"\n",
      "print\"The resultant stress at C             \",round(sigmaC,1),\"MPa\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress due to normal force at C    1.32 MPa\n",
        "The stress due to shear force at C     0 MPa\n",
        "The stress due to bending moment at C  63.1 MPa\n",
        "The resultant stress at C              64.5 MPa\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5 Page No 418"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given:\n",
      "r = 0.75*10       #mm, radius\n",
      "f_x =40000        #N, force along x\n",
      "f_y =800          #N force along y\n",
      "l1 = 0.8         #mm\n",
      "l2 = 0.4        #mm\n",
      "\n",
      "#Stress Components:\n",
      "#Normal Force:\n",
      "A1 =l1*l2\n",
      "sigma1 = f_x/A1   #stress = P/A\n",
      "\n",
      "#Bending Moment:\n",
      "M_y1 = 8000        #N\n",
      "c1 = l2/2.0\n",
      "I1 = (1/12.0)*(l1*l2**3)\n",
      "sigma_A1 = (M_y1*c1)/I1 \n",
      "M_y2 = 16000        #N\n",
      "c2 = l2\n",
      "I2 = (1/12.0)*(l2*l1**3)\n",
      "sigma_A2 = (M_y2*c2)/I2 \n",
      "\n",
      "#Resultant:\n",
      "res_normal= -sigma1-sigma_A1-sigma_A2\n",
      "\n",
      "#Display:\n",
      "\n",
      "print\"The stress due to normal force at A   \",sigma1/1000,\"KPa\"\n",
      "print\"The stress due to bending moment 8KN at A  \",sigma_A1/1000,\"KPa\"\n",
      "print\"The stress due to bending moment 16KN at A  \",sigma_A2/1000,\"KPa\"\n",
      "print\"The resultant normal stress component at A \",res_normal/1000,\"KPa\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress due to normal force at A    125.0 KPa\n",
        "The stress due to bending moment 8KN at A   375.0 KPa\n",
        "The stress due to bending moment 16KN at A   375.0 KPa\n",
        "The resultant normal stress component at A  -875.0 KPa\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7 Page No 420"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate Stress at A\n",
      "\n",
      "#Given:\n",
      "P = 500        #lb, load\n",
      "r=0.75         #inch, radius\n",
      "#Stress Components:\n",
      "\n",
      "#Normal Force:\n",
      "import math\n",
      "A = math.pi*r**2\n",
      "sigma = P/A\n",
      "\n",
      "#Bendng Moments:\n",
      "M_x =7000     #lb\n",
      "cy = r\n",
      "Ix = (1/4.0)*math.pi*(r**4) \n",
      "sigma_max_1 = (M_x*cy)/Ix   \n",
      "\n",
      "M_y = P*l_bc/2.0\n",
      "cx = l_bc/2.0\n",
      "Iy = (1/12.0)*(l_ab*l_bc**3) #I = (1/12)*(bh**3)\n",
      "sigma_max_2 = (M_y*cx)/Iy #sigma = My/I\n",
      "#Superposition\n",
      "sigmaf=round(sigma/1000,3)+round(sigma_max_1/1000,1)\n",
      "\n",
      "#Display:\n",
      "print\"The normal stress at corner A \",round(sigma/1000,3),\"ksi\"\n",
      "print\"The normal stress at point A for Bending Moment \",round(sigma_max_1/1000,1),\"ksi\"\n",
      "print\"The normal stress at point A for Superimposition \",round(sigmaf,1),\"ksi\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The normal stress at corner A  0.283 ksi\n",
        "The normal stress at point A for Bending Moment  21.1 ksi\n",
        "The normal stress at point A for Superimposition  21.4 ksi\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8 Page No 421"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the state of stress at point A\n",
      "\n",
      "#Given\n",
      "r=0.75           #radius,inch\n",
      "V=800             #Forca, lb\n",
      "\n",
      "#Calculation\n",
      "#shear force\n",
      "import math\n",
      "Q=(4*r/(3*math.pi))*(0.5*(math.pi*r**2))\n",
      "Ix=(1/4.0)*math.pi*(r**4) \n",
      "tau=V*Q/(Ix*2*r)\n",
      "#Since point A is on neutral axis\n",
      "sigmaA=0\n",
      "T=11200           #lb inch, force \n",
      "Iy=(1/2.0)*math.pi*(r**4) \n",
      "sigma_a=T*r/Iy\n",
      "#Superimposition\n",
      "sigmayzA=tau+sigma_a\n",
      "\n",
      "\n",
      "#Result\n",
      "print\"The stress for shear stress distribution is\",round(tau/1000,3),\"ksi\"\n",
      "print\"The stress for Bending moment is\",sigmaA,\"ksi\"\n",
      "print\"The stress for torque\",round(sigma_a/1000,2),\"ksi\"\n",
      "print\"The stress for Superimposition \",round(sigmayzA/1000,1),\"ksi\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress for shear stress distribution is 0.604 ksi\n",
        "The stress for Bending moment is 0 ksi\n",
        "The stress for torque 16.9 ksi\n",
        "The stress for Superimposition  17.5 ksi\n"
       ]
      }
     ],
     "prompt_number": 67
    }
   ],
   "metadata": {}
  }
 ]
}