{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 14:Energy Methods"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.1 Page No 721"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "sigma_y = 44        #stress ,ksi\n",
      "db =0.731           #inch, diameter\n",
      "rb = db/2.0         #radius\n",
      "import math\n",
      "Ab = math.pi*(rb**2)\n",
      "E = 29*10**3    #N/mm**2, stress\n",
      "da1 = 0.875     #inch, diameter\n",
      "ra1 = da1/2.0\n",
      "La1 = 2           #inch\n",
      "La2= 0.25            #inch\n",
      "da2 =0.731          #inch\n",
      "ra2 = da2/2.0\n",
      "Lb = 2.25         #inch\n",
      "\n",
      "#Calculation\n",
      "#Bolt A\n",
      "Aa2 = math.pi*(ra2**2)\n",
      "Aa1 = math.pi*(ra1**2)\n",
      "P_max = sigma_y*Ab\n",
      "Uia = (P_max**2/(2*E))*(La1/Aa1 + La2/Aa2) #Ui = (N**2L)/(2AE)\n",
      "#Bolt B\n",
      "Uib = (P_max**2/(2*E))*(Lb/Ab)\n",
      "\n",
      "#Display\n",
      "print'The greatest amount of strain energy absorbed by bolt A    = ',round(Uia,4),\"J\"\n",
      "print'The greatest amount of strain energy absorbed by bolt B    = ',round(Uib,4),\"J\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.0230568851609\n",
        "The greatest amount of strain energy absorbed by bolt A    =  0.0231 J\n",
        "The greatest amount of strain energy absorbed by bolt B    =  0.0315 J\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.5 Page No 728"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "G = 75*10**9    #N/m**2, stress\n",
      "ro = 80/1000.0  #m, outside radius\n",
      "t = 15/1000.0   #m, thickness\n",
      "ri = ro - t     #inside radius\n",
      "l1 = 750/1000.0   #m, length\n",
      "l2 = 300/1000.0   #m\n",
      "T1 = 40         #Nm. torque\n",
      "T2 =15          #Nm\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "J = (math.pi/2.0)*(ro**4 - ri**4)\n",
      "#Eqn 14-22\n",
      "U1 = (T1**2*l1)/(2*G*J) \n",
      "U2 = (T2**2*l2)/(2*G*J)\n",
      "Ui = U1 + U2\n",
      "Ui = Ui*10**6    #in micro Joule\n",
      "\n",
      "#Display\n",
      "print'The strain energy stored in the shaft    = ',round(Ui,0),\"micro J\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The strain energy stored in the shaft    =  233.0 micro J\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.6 Page No 735"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given:\n",
      "F=5.0       #kip, horizontal distance\n",
      "A=0.20    #inch**2, area\n",
      "E=29*10**3   #ksi, stress\n",
      "Nab=2.89   #kip, normal stress\n",
      "Nac=5.77   #kip\n",
      "L1=2         #ft, length\n",
      "L2=4       #ft\n",
      "L3=3.46     #ft\n",
      "\n",
      "#calculation\n",
      "#Appling equation 14-24\n",
      "dBh=(Nab**2*L1/(2*A*E)+(-Nac)**2*L2/(2*A*E)+F**2*L3/(2*A*E))*(2/F)\n",
      "\n",
      "#result\n",
      "print\"The horizontal displacement is\",round(dBh*12,4),\"inch\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal displacement is 0.0978 inch\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.8 Page No 743"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "ro = 3         #inch, outside radius\n",
      "ri = 2.5       #inch, inside radius\n",
      "E = 10*10**3   #ksi, stress\n",
      "W = 150        #kip, force\n",
      "L = 12         #inch, length\n",
      "h = 0\n",
      "\n",
      "#Part a\n",
      "import math\n",
      "A = (math.pi)*(ro**2 - ri**2)\n",
      "del_st= (W*L)/(A*E)\n",
      "#Part b\n",
      "del_max = del_st*(1 + math.sqrt(1 + 2*(h/del_st)))\n",
      "\n",
      "#Display\n",
      "print'The maximum displacement at the top of the pipe for gradually applied load   = ',round(del_st,4),\"inch\"\n",
      "print'The maximum displacement at the top of the pipe for suddenly applied load    = ',round(del_max,4),\"inch\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum displacement at the top of the pipe for gradually applied load   =  0.0208 inch\n",
        "The maximum displacement at the top of the pipe for suddenly applied load    =  0.0417 inch\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.9 Page No 744"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "W = 1.5           #kip, force\n",
      "h = 2             #inch, height\n",
      "E = 29*1000       #N/mm**2, stress\n",
      "L = 16           #ft, length\n",
      "I = 209          #inch**2, area\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "del_st = (W*L**3*12**3)/(48*E*I)\n",
      "del_max = del_st*(1 + math.sqrt(1 + 2*(h/del_st)))\n",
      "c = 9.92/2.0\n",
      "Pmax=48*E*I/(L**3*12**3)\n",
      "Mmax=Pmax*L/4.0\n",
      "sigma_max = (12*E*del_max*c)/(L**2*12**2)\n",
      "\n",
      "#Display\n",
      "print'The maximum bending stress in the steel beam   = ',round(sigma_max,1),\"ksi\"\n",
      "print'The maximum deflection in the beam             = ',round(del_max,2),\"inch\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum bending stress in the steel beam   =  19.7 ksi\n",
        "The maximum deflection in the beam             =  0.42 inch\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.10 Page No 745"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "m = 80*1000 #kg\n",
      "v = 0.2           #m/s\n",
      "l_ac = 1.5        #m\n",
      "E = 200*10**9     #N/m**2\n",
      "w = 0.2           #m\n",
      "I = (1/12.0)*(w**4)\n",
      "l_ab = 1000      #mm\n",
      "\n",
      "#Calculations\n",
      "import math\n",
      "del_Amax = math.sqrt((m*v**2*l_ac**3)/(3*E*I))\n",
      "\n",
      "P_max = (3*E*I*del_Amax)/(l_ac**3)\n",
      "theta_A = (P_max*l_ac**2)/(2*E*I)\n",
      "del_Amax = del_Amax*1000\n",
      "del_Bmax = del_Amax + (theta_A*l_ab)\n",
      "\n",
      "#Display\n",
      "print'The maximum horizontal displacement of the post at B due to impact   =',round(del_Bmax,2),\"mm\"\n",
      "    \n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum horizontal displacement of the post at B due to impact   = 23.24 mm\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.11 Page No 758"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "A = 400*10**-6 #m**2\n",
      "E = 200*10**6 #kN/m**2\n",
      "P = 100 #kN\n",
      "\n",
      "#Virtual Work Equation\n",
      "n1 = 0\n",
      "n2=0\n",
      "n3=-1.414\n",
      "n4=1\n",
      "N1=-100\n",
      "N2=-141.4\n",
      "N3=-141.4\n",
      "N4=200\n",
      "L1=4\n",
      "L2=2.828\n",
      "L3=2.828\n",
      "L4=2\n",
      "Sum=n1*N1*L1+n2*N2*L2+n3*N3*L3+n4*N4*L4\n",
      "del_cv = Sum/(A*E)\n",
      "\n",
      "#Display\n",
      "print'The vertical displacement of joint C of the steel truss  ',round(del_cv*1000,1),\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The vertical displacement of joint C of the steel truss   12.1 mm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.12 Page no 759"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "A=250*10**(-6)    #m**2\n",
      "E=200*10**6            #pa\n",
      "alpha=12*10**(-6)\n",
      "l=4               #m\n",
      "l1=-1.155         #KN\n",
      "l2=-12            #KN\n",
      "\n",
      "#calculation\n",
      "x=0              #x=n*N*L/A*E\n",
      "y=0              #y=n*alpha*delta*T*L\n",
      "z=(l1*l2*l)/(A*E)\n",
      "deltabh=(x+y+z)\n",
      "\n",
      "#result\n",
      "print \"The horizontal displacement is \",round(deltabh*1000,2),\"m\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal displacement is  1.11 m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.15 Page No 774"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "E = 200*10**6 #kN/m**2\n",
      "P = 0         #N\n",
      "A = 400*10**-6 #m**2\n",
      "\n",
      "#Calculation\n",
      "N_by_P1 = 0\n",
      "N_by_P2=0\n",
      "N_by_P3=-1.414\n",
      "N_by_P4=1\n",
      "L1=4\n",
      "L2=2.828\n",
      "L3=2.828\n",
      "L4=2\n",
      "N1=-100\n",
      "N2=141.4\n",
      "N3=-141.4\n",
      "N4=200\n",
      "\n",
      "Sum = N_by_P1*L1*N1+N_by_P2*L2*N2+N_by_P3*L3*N3+N_by_P4*L4*N4\n",
      "del_ch = Sum/(E*A)\n",
      "\n",
      "#Display\n",
      "print'The vertical displacement of joint C of the steel truss   =',round(del_ch*1000,1),\"mm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The vertical displacement of joint C of the steel truss   = 12.1 mm\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}