{
 "metadata": {
  "name": "",
  "signature": "sha256:f6a72f4cc57a2a0246e1148374d652bdc5837f696dab36422b01926c78183403"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter10-Introduction To Energy Methods"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg400"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate lift using Energy method\n",
      "##initialization of variables\n",
      "import math\n",
      "L=6000. ##cm\n",
      "L1=150. ##cm\n",
      "T=90. ##W\n",
      "Ip=math.pi*10**4./32.\n",
      "E=2*10**6 ##kg/cm^2\n",
      "G=E/2.5\n",
      "A=3. ##cm^2\n",
      "delta=0.5\n",
      "##calculations\n",
      "U=L/(2.*E*A)+(T*T*L1/(2.*G*Ip))\n",
      "## U=0.5*W*delta\n",
      "W=0.25/U\n",
      "##results\n",
      "print'%s %.2f %s'%('W = ',W,' kg')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W =  196.31  kg\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg400"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#find deflection under a load of one tonne at end\n",
      "##initialization of variabes\n",
      "import math\n",
      "cA=10. ##cm^2\n",
      "wA=5. ##cm^2\n",
      "P=1. ##tonne\n",
      "E=2*10**6 ##kg/cm^2\n",
      "P=P*1000. ##kg\n",
      "## calculations\n",
      "U_up=P**2*200./(2.*E*cA)*1./math.sqrt(3)*(2.+4.+6.+8.+10.+12.)\n",
      "U_do=P**2*200./(2.*E*cA)*1./math.sqrt(3)*(1.+3.+5.+7.+9.+11.+13./2.)\n",
      "U_web=P**2*200./(2.*E*wA)*1./math.sqrt(3)*(2.*13.)\n",
      "U=U_up+U_do+U_web\n",
      "delta=U*2./(P)\n",
      "## results\n",
      "print'%s %.2f %s'%('deflection = ',delta,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "deflection =  0.79  cm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg402"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate deflection of loaded end due to same load of one tonne\n",
      "a=2*10**8\n",
      "b=69282032.302\n",
      "c=136.5\n",
      "d=28\n",
      "aa=5\n",
      "bb=15\n",
      "BC=16.77\n",
      "cc=56000\n",
      "dd=1300\n",
      "ee=20*10**6\n",
      "\n",
      "\n",
      "#part(a)\n",
      "AB=a*c/(b)  #\n",
      "print'%s %.2f %s'%('energy stored in Bd due to axial force ',AB,'kg-cm')\n",
      "\n",
      "#Part(b)\n",
      "Ubc=(b*b*aa)/(bb*bb)\n",
      "UB=BC*100./(4.*10.)\n",
      "UBC=Ubc*UB\n",
      "Bc=730 \n",
      "print'%s %.2f %s'%('energy stored in Bd due to axial force ',Bc,'kg-cm')\n",
      "\n",
      "#part(c)\n",
      "AB=394 #\n",
      "print'%s %.2f %s'%('energy stored in Bd due to axial force ',AB,'kg-cm')\n",
      "\n",
      "\n",
      "#part(d)\n",
      "Ebc=d*2/bb\n",
      "\n",
      "\n",
      "#assuming that only chord memeber are taking axial stress then\n",
      "\n",
      "BD=(cc/bb)**2*(dd/4*ee)\n",
      "BD1=227 \n",
      "print'%s %.2f %s'%('energy stored in Bd due to axial force ',BD1,'kg-cm')\n",
      "#total energy\n",
      "TE=BD1+AB+Bc+AB\n",
      "delta=(2*TE)/(1000.)\n",
      "print'%s %.2f %s'%('total energy stored in Bd due to axial force ',delta,'kg-cm')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "energy stored in Bd due to axial force  394.04 kg-cm\n",
        "energy stored in Bd due to axial force  730.00 kg-cm\n",
        "energy stored in Bd due to axial force  394.00 kg-cm\n",
        "energy stored in Bd due to axial force  227.00 kg-cm\n",
        "total energy stored in Bd due to axial force  3.49 kg-cm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg406"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate stresses in steel and stress in cloth laminate\n",
      "##initialization of variables\n",
      "import math\n",
      "L=1. ##m\n",
      "w=10. ##kg\n",
      "h=50. ##cm\n",
      "A=1. ##cm^2\n",
      "E=2*10**6 ##kg/cm^2\n",
      "Ar=1 ##cm^2\n",
      "Ec=3*10**4 ##kg/cm^2\n",
      "## For steel\n",
      "D=w*L*100./(A*E)\n",
      "P=w*(1+math.sqrt(1.+(2.*h/D)))\n",
      "print'%s %.2f %s'%('Stress in steeel = ',P,' kg/cm^2 ')\n",
      "\n",
      "## for cloth laminate\n",
      "D=w*L*100./(A*Ec)\n",
      "P=w*(1+math.sqrt(1.+(2.*h/D)))\n",
      "print'%s %.2f %s'%('\\n Stress in cloth laminate = ',P,' kg/cm^2 ')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stress in steeel =  4482.15  kg/cm^2 \n",
        "\n",
        " Stress in cloth laminate =  557.81  kg/cm^2 \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg407"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate maximum stress in wood and divers feet in all parts\n",
      "##initialization of variables\n",
      "import math\n",
      "w=64. ##kg\n",
      "H=60. ##cm\n",
      "b=40. ##cm\n",
      "h=5. ##cm\n",
      "E=0.12*10**6 ##kg/cm^2\n",
      "Es=2*10**6 ##kg/cm^2\n",
      "## for part (a) and (b)\n",
      "I=b*h**3./12.\n",
      "D=4.*w*120**3/(E*I)\n",
      "P=w*(1+math.sqrt(1.+(2.*H/D)))\n",
      "str=P*240.*6./(b*h**2.)\n",
      "print('part (a) and (b)')\n",
      "print'%s %.2f %s'%('\\n Maximum stress in wood = ',str,' kg/cm^2')\n",
      "print'%s %.2f %s'%('\\n Max. force on divers feet =',P,' kg')\n",
      "\n",
      "##for part (c)\n",
      "Ixx=I*E/Es\n",
      "Zxx=19.4 ##cm^2\n",
      "Ixx=72.7 ##cm^4\n",
      "D=4*w*120**3/(Es*Ixx)\n",
      "P=w*(1+math.sqrt(1.+(2.*H/D)))\n",
      "str=P*240./Zxx\n",
      "## results\n",
      "print('\\n part (c)')\n",
      "print'%s %.2f %s'%('\\n Maximum stress in steel = ',str,' kg/cm^2')\n",
      "print'%s %.2f %s'%('\\n Max. force on divers feet =',P,' kg')\n",
      "print('\\n Hence wood is better than steel')\n",
      "\n",
      "print('wrong calculations in some parts')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a) and (b)\n",
        "\n",
        " Maximum stress in wood =  443.86  kg/cm^2\n",
        "\n",
        " Max. force on divers feet = 308.24  kg\n",
        "\n",
        " part (c)\n",
        "\n",
        " Maximum stress in steel =  5826.84  kg/cm^2\n",
        "\n",
        " Max. force on divers feet = 471.00  kg\n",
        "\n",
        " Hence wood is better than steel\n",
        "wrong calculations in some parts\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg414"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate central  deflection\n",
      "##initialization of variables\n",
      "import math\n",
      "A=100. ##cm^2\n",
      "E=2*10**6 ##kg/cm^2\n",
      "## calculations\n",
      "D=1093.5*10**6/(E*A)\n",
      "## 1093.5  from the table\n",
      "## results\n",
      "print'%s %.2f %s'%('Central deflection = ',D,' mm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Central deflection =  5.47  mm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12-pg415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate deflection\n",
      "##initialization of variables\n",
      "import math\n",
      "T=30. ##degree celcius\n",
      "alpha=0.0000117 ## per degree celcius\n",
      "##AB\n",
      "L=6. ##m\n",
      "dl=T*alpha*L\n",
      "df=0.375 ##kg\n",
      "tot=dl*df\n",
      "##BC\n",
      "dl=T*alpha*L\n",
      "df=0.375 ##kg\n",
      "tot=tot+dl*df\n",
      "##CD\n",
      "dl=T*alpha*L\n",
      "df=0.75 ##kg\n",
      "tot=tot+dl*df\n",
      "tot=tot*100.*2.\n",
      "## results\n",
      "print'%s %.2f %s'%('The deflection is ',tot,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The deflection is  0.63  cm\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}