{
 "metadata": {
  "name": "",
  "signature": "sha256:768e5620d31d4b5603faf8e19db8db3178570776ab6e28491caaf3d036876dc4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter5-Uniaxial Deformations"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the depth of clay  bed \n",
      "l=20. ##cm\n",
      "dL=1. ##m\n",
      "dl=0.004 ##cm\n",
      "##calculations\n",
      "L=l*dL/dl ##m\n",
      "##results\n",
      "print'%s %.2f %s'%('The depth of the clay bed is ',L,' m')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The depth of the clay bed is  5000.00  m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg140"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the total extension of the rod and draw the force and extension diagrams\n",
      "A=1. ##unit area\n",
      "E=2.*10**6 ##kg/cm^2\n",
      "## calculations\n",
      "db=3000.*90./(A*E)\n",
      "dc=db+5000.*60./(A*E)\n",
      "dd=dc+4000.*30./(A*E)\n",
      "##results\n",
      "print'%s %.2e %s %.2e %s %.2e %s '%('The extension of the rod in part AB is ',db,' cm'and'in part BC is ',dc,' cm'and' \\n and in part CD is ',dd,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The extension of the rod in part AB is  1.35e-01 in part BC is  2.85e-01  \n",
        " and in part CD is  3.45e-01  cm \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg141"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#findthe extension under its own weight\n",
      "A=3. ##cm^2\n",
      "L=18. ##m\n",
      "E= 2*10**6 ##kg/cm^2\n",
      "r=7833. ##kg/m^3\n",
      "##calculations\n",
      "e=r*(L*100)**2./(2*E*10**6)\n",
      "## results\n",
      "print'%s %.4f %s'%('The elongation is ',e,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The elongation is  0.0063  cm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg142"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#find the extension under a concertrated load of 3 tonne at the bottom\n",
      "## linked to 5_3\n",
      "P=3 ##tonne\n",
      "E=2*10**6 ##kg/cm^2\n",
      "d_0= 1. ##cm\n",
      "d_l=2.8 ##cm\n",
      "## calculations\n",
      "e=4*P*1000.*d_l*10**3/(d_l**2*math.pi*E*(1-((d_l-d_0)/d_l)))\n",
      "##results\n",
      "print'%s %.2f %s'%('The total elongation is ',e,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total elongation is  1.91  cm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-145"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "import numpy\n",
      "from numpy import linalg\n",
      "import scipy as Sci\n",
      "from scipy import linalg\n",
      "P=10 ##tonne\n",
      "import numpy as np\n",
      "E=2*10**6 ##kg/cm^2\n",
      "## calculations\n",
      "## We have to solve linear system Ax=B\n",
      "A=numpy.matrix([[1, 1, 1, 0], [3, 1, -3, 0],[-2, 2, 0, -E],[0, -1, 2, -E]])\n",
      "B=numpy.matrix([[P*10**3],[0],[0],[0]])\n",
      "x=numpy.dot(np.linalg.inv(A),B)\n",
      "W1=x[0,0]/1000.\n",
      "W2=x[1,0]/1000.\n",
      "W3=x[2,0]/1000.\n",
      "th=x[3,0]\n",
      "##results\n",
      "print'%s %.2f %s %.2f %s %.2f %s '%('The load taken by each rod is',W1,' tonne'and'',W2,' tonne'and'',W3,'tonne')\n",
      "print'%s %.3e %s'%('\\n and the slope is theta = ',th,' radians')   \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load taken by each rod is 2.33  4.00  3.67 tonne \n",
        "\n",
        " and the slope is theta =  1.667e-03  radians\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg147"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#calculate the safe load taken by the column\n",
      "b=30. ## cm\n",
      "h=30. ##cm\n",
      "n=6.\n",
      "A=36. ##cm^2\n",
      "ss_s=1500. ##kg/cm^2\n",
      "ss_c=60. ##kg/cm^2\n",
      "Er=15. ## Elasticity ratio\n",
      "## calculations\n",
      "L=A*Er*ss_c+(b*h-A)*ss_c\n",
      "## results\n",
      "print'%s %.2f %s'%('The safe load is ',L,'.kg')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The safe load is  84240.00 .kg\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#find the stress in steel and concerete after redisturbution of stress in steel and cncerete\n",
      "## initiaization of variables\n",
      "import math\n",
      "gs_b=10. ##cm\n",
      "gs_h=10. ##cm\n",
      "d_b=2. ##cm\n",
      "d_h=2. ##cm\n",
      "As= 1. ##cm^2\n",
      "s=10000. ##kg/cm^2\n",
      "## part (a)\n",
      "Es=2*10**6 ##kg/cm^2\n",
      "Ec=2*10**5 ##kg/cm^2\n",
      "## calculations\n",
      "e=s/Es\n",
      "Ac=gs_b*gs_h-(d_b*d_h)\n",
      "e_c=e*Es*As/(Ec*Ac+Es*As)\n",
      "s_c=Ec*e_c\n",
      "e_s=e-e_c\n",
      "s_s=Es*e_s\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s '%('part (a) \\n The stress in steel and concrete are respectively ',s_s,''and '',s_c,' kg/cm^2')\n",
      "## part(b)\n",
      "P=8000. ##kg\n",
      "## calculations\n",
      "e_c=(e*Es*As-P)/(Ec*Ac+Es*As)\n",
      "e_s=e-e_c\n",
      "s_c=Ec*e_c\n",
      "s_s=Es*e_s\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s'%('\\n part (b) \\n The stress in steel and concrete are respectively ',s_s,''and  '',s_c,'kg/cm^2')\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a) \n",
        " The stress in steel and concrete are respectively  9056.60  94.34  kg/cm^2 \n",
        "\n",
        " part (b) \n",
        " The stress in steel and concrete are respectively  9811.32  18.87 kg/cm^2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg151"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##calculate temperature which sleeve must be heated if the room temperature is 10c\n",
      "#and pressure and find axial force necessary to separate the two room temperature  and the temperature at which sleeve will easily come off\n",
      "## initialization\n",
      "import math\n",
      "d=10 ##cm\n",
      "D=9.99 ##cm\n",
      "t=3 ##mm\n",
      "E=1.0*10**6 ##kg/cm^2\n",
      "a=2.02*10**-5 ## degree/celcius\n",
      "## part(a)\n",
      "Tr=10. ##degree C\n",
      "T=(d-D)/D*1/a\n",
      "print'%s %.2f %s'%('part(a) \\n The sleeve must be heated to ',T+Tr,' degree C or more for this purpose')\n",
      "\n",
      "##part(b)\n",
      "s_th=a*T*E\n",
      "p=s_th*t*2./(d*10.)\n",
      "print'%s %.2f %s'%('\\n part(b) \\n The pressure developed between the rod and sleeve is',p,' kg/cm^2')\n",
      "\n",
      "## part(c)\n",
      "f=0.2\n",
      "o=10. ## overlap: cm\n",
      "A=math.pi*d*o\n",
      "F=f*p*A\n",
      "print'%s %.2f %s'%('\\n part (c) \\n The axial force required is ',F,' kg')\n",
      "\n",
      "##part (d)\n",
      "## linked to part c\n",
      "T2=20. ##degree C\n",
      "a2=1.17*10**-5 ##  /degree C\n",
      "Ts=(a-a2)*(T2-Tr)*E\n",
      "Ts=s_th-Ts\n",
      "p2=p*Ts/s_th\n",
      "F2=F*Ts/s_th\n",
      "print'%s %.2f %s'%('\\n part(d)\\n The pressure developed between the rod and sleeve is',p2,' kg/cm^2')\n",
      "print'%s %.2f %s'%('\\n The axial force required is ',F2,' kg')\n",
      "##part(e)\n",
      "T3=Tr+(s_th/((a-a2)*10**6))\n",
      "print'%s %.2f %s'%('\\n part(e) \\n The temperature at which the sleeve comes off easily is ',T3,' C')\n",
      "\n",
      "print('calculations in the text: rounding off errors')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part(a) \n",
        " The sleeve must be heated to  59.55  degree C or more for this purpose\n",
        "\n",
        " part(b) \n",
        " The pressure developed between the rod and sleeve is 60.06  kg/cm^2\n",
        "\n",
        " part (c) \n",
        " The axial force required is  3773.68  kg\n",
        "\n",
        " part(d)\n",
        " The pressure developed between the rod and sleeve is 54.96  kg/cm^2\n",
        "\n",
        " The axial force required is  3453.24  kg\n",
        "\n",
        " part(e) \n",
        " The temperature at which the sleeve comes off easily is  127.76  C\n",
        "calculations in the text: rounding off errors\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex11-pg154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##initialization of variables\n",
      "#calculate the radius of curvature of this strip at temperautre of 93.3\n",
      "T1=37.8 ## degre C\n",
      "t=0.355 ##mm\n",
      "T2=93.3 ## degree C\n",
      "L=2 ##cm\n",
      "m=1\n",
      "n=1.53\n",
      "a=1.86*10**-5\n",
      "##calculations\n",
      "R=2*t*(3*(1+m)**2.+(1+m*n)*(m**2+(m*n)**-1))\n",
      "R=R/(6.*a*(T2-T1)*(1+m**2))  ## mm\n",
      "R=R/10.\n",
      "D=L**2./(8.*R)\n",
      "## results\n",
      "print'%s %.2f %s'%('The radius of curvature is ',R,' cm')\n",
      "print'%s %.4f %s'%('\\n The deflection is',D ,' cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The radius of curvature is  92.76  cm\n",
        "\n",
        " The deflection is 0.0054  cm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12-pg155"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#find the energy stored in bolt\n",
      "L=5. ##cm\n",
      "D=1.8 ##cm\n",
      "l=2.5 ##cm\n",
      "d=1.5 ##cm\n",
      "F=1 ##tonne\n",
      "E=2.1*10**6 ##kg/cm^2\n",
      "## calculations\n",
      "s1=F*1000.*4./(D**2*math.pi)\n",
      "s2=F*1000.*4./(d**2*math.pi)\n",
      "U1=1/2.*s1**2./E\n",
      "U1=U1*L*D**2*math.pi/4.\n",
      "U2=1/2.*s2**2./E\n",
      "U2=U2*l*d**2*math.pi/4.\n",
      "U=U1+U2\n",
      "## results\n",
      "print'%s %.1f %s'%('The energy stored in the bolt is ',U,' kg-cm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy stored in the bolt is  0.8  kg-cm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex13-pg159"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "#calculate which of the two ways will give stronger joint\n",
      "t=16. ##mm\n",
      "Pt=1500. ##kg/cm^2\n",
      "Ps=1025. ##kg/cm^2\n",
      "Pb=2360. ##kg/cm^2\n",
      "\n",
      "##part (a)\n",
      "p=6. ##cm\n",
      "r=24. ##mm\n",
      "d=r/10.+0.15\n",
      "Ft=t*(p-d)*Pt/10.\n",
      "Fs=math.pi*d**2*Ps/4.\n",
      "Fb=d*t*Pb\n",
      "x=min(Ft,Fs,Fb)\n",
      "effA=x*100./(p*t/10.*Pt)\n",
      "\n",
      "##part (b)\n",
      "p=9. ##cm\n",
      "r=30. ##mm\n",
      "d=r/10.+0.2\n",
      "Ft=t*(p-d)*Pt/10.\n",
      "Fs=math.pi*d**2*Ps/4.\n",
      "Fb=d*t*Pb\n",
      "x=min(Ft,Fs,Fb)\n",
      "effB=x*100./(p*t/10.*Pt)\n",
      "\n",
      "## results\n",
      "print'%s %.2f %s %.2f %s '%('The efficiencies corresponding to cases a and b are ',effA,'' and '',effB,'')\n",
      "print('\\n Hence part b is better than part a')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiencies corresponding to cases a and b are  36.35  38.16  \n",
        "\n",
        " Hence part b is better than part a\n"
       ]
      }
     ],
     "prompt_number": 13
    }
   ],
   "metadata": {}
  }
 ]
}