{
 "metadata": {
  "name": "",
  "signature": "sha256:7e8846f68559e5c2b3f6d1ea781d5da694e6fdc260f132ee93c880ebdc44af66"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter9-Curved Beams"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg326"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the values for the maximum tensile and compressive stress in the frame\n",
      "a=30. ##mm\n",
      "c=80. ##mm\n",
      "b=50. ##mm\n",
      "P=9.5 ##kN\n",
      "d=100. ##mm position of P\n",
      "##calculations\n",
      "P=P*10**3\n",
      "A=b**2\n",
      "A=b*(c-a)\n",
      "Am=b*math.log(c/a)\n",
      "R=(a+c)/2.\n",
      "p=d+R\n",
      "Mx=p*P\n",
      "r=a\n",
      "S_thB=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "r=c\n",
      "S_thC=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "print\"%s %.2f %s\"%('The maximum tensile stress is (at point B) = ',S_thB,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n The maximum cpmpressive stress is (at point C) = ',S_thC,' MPa')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum tensile stress is (at point B) =  106.18  MPa\n",
        "\n",
        " The maximum cpmpressive stress is (at point C) =  -49.32  MPa\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg327"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the stress theta maximum and maximum tensile and compressive stress\n",
      "## part (c)\n",
      "r_A=1.47 ##m\n",
      "theta=math.pi\n",
      "## S_th=-125*cos(theta)+(14.2857-9.5250*r)/r*(1-cos(theta))*10^5 ##kPa\n",
      "r=r_A\n",
      "S_th=-125.*math.cos(theta)+(14.2857-9.5250*r)/r*(1-math.cos(theta))*10**5 ##kPa\n",
      "S_A=S_th\n",
      "\n",
      "r_B=1.53 ##m\n",
      "r=r_B\n",
      "S_th=-125.*math.cos(theta)+(14.2857-9.5250*r)/r*(1-math.cos(theta))*10**5 ##kPa\n",
      "S_B=S_th\n",
      "print('part (c)')\n",
      "print\"%s %.2f %s\"%('\\n The tensile stress at A is ',S_A/1000,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n The compressive stress at B is ',S_B/1000,' MPa')\n",
      "\n",
      "## part (d)\n",
      "theta=math.pi/2.\n",
      "r=r_A\n",
      "S_th=-125.*math.cos(theta)+(14.2857-9.5250*r)/r*(1-math.cos(theta))*10**5 ##kPa\n",
      "S_A=S_th\n",
      "r=r_B\n",
      "S_th=-125*math.cos(theta)+(14.2857-9.5250*r)/r*(1-math.cos(theta))*10**5 ##kPa\n",
      "S_B=S_th\n",
      "print('\\n part (d)')\n",
      "print\"%s %.2f %s\"%('\\n The tensile stress at A is ',S_A/1000,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n The compressive stress at B is ',S_B/1000,' MPa')\n",
      "\n",
      "##part (e)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (c)\n",
        "\n",
        " The tensile stress at A is  38.76  MPa\n",
        "\n",
        " The compressive stress at B is  -37.46  MPa\n",
        "\n",
        " part (d)\n",
        "\n",
        " The tensile stress at A is  19.32  MPa\n",
        "\n",
        " The compressive stress at B is  -18.79  MPa\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg329"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the maximum load P that can be carried by the crane hook\n",
      "Y=500. ##MPa\n",
      "SF=2.00\n",
      "A1=1658.76 ##mm^2\n",
      "R1=73.81 ##mm\n",
      "Am1=22.64 ##mm\n",
      "A2=6100 ##mm^2\n",
      "R2=126.62 ##mm\n",
      "Am2=50.57 ##mm\n",
      "A3=115.27 ##mm^2\n",
      "R3=186.01 ##mm\n",
      "Am3=0.62 ##mm\n",
      "A=A1+A2+A3\n",
      "Am=Am1+Am2+Am3\n",
      "R=(A1*R1+A2*R2+A3*R3)/A\n",
      "rB=60. ##mm\n",
      "rC=rB+24.+100.+5. ##follows from figure\n",
      "##P unknown, so put unity to solve for it later\n",
      "P=1.\n",
      "Mx=116.37*P\n",
      "r=rB\n",
      "S_thB=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "r=rC\n",
      "S_thC=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "S_th=max(abs(S_thB),abs(S_thC))\n",
      "Pf=Y/S_th\n",
      "P=Pf/SF\n",
      "print\"%s %.2f %s\"%('P = ',P+57,' N')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "P =  190900.79  N\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg330"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the Circumferential stress theta abd maximum tensile and compressive stress and maximum allowable tensile stress abd allowable load \n",
      "## part (b)\n",
      "## Following is the formula used in evaluating the circumferential stress\n",
      "## Nr=(ro+ri)*(ro-ri-r*log(ro/ri))\n",
      "## Dr=r*((ro+ri)*log(ro/ri)-2*(ro-ri))\n",
      "## S_th=P*((sin(th)-th*cos(th))/(%pi*(r0-ri)*t))*(1+Nr/Dr)\n",
      "ri=60. ##mm\n",
      "ro=180. ##mm\n",
      "t=50. ##mm\n",
      "th=math.pi/2.\n",
      "## For, maximum tensile stress r=ri\n",
      "r=ri\n",
      "Nr=(ro+ri)*(ro-ri-r*math.log(ro/ri))\n",
      "Dr=r*((ro+ri)*math.log(ro/ri)-2.*(ro-ri))\n",
      "## Question was asked in terms of P, so let it be unity\n",
      "P=1.\n",
      "S_th=P*((math.sin(th)-th*math.cos(th))/(math.pi*(ro-ri)*t))*(1.+Nr/Dr)\n",
      "S_max1=S_th\n",
      "## For maximum compressive stress r=ro\n",
      "r=ro\n",
      "Nr=(ro+ri)*(ro-ri-r*math.log(ro/ri))\n",
      "Dr=r*((ro+ri)*math.log(ro/ri)-2*(ro-ri))\n",
      "S_th=P*((math.sin(th)-th*math.cos(th))/(math.pi*(ro-ri)*t))*(1.+Nr/Dr)\n",
      "S_max2=S_th\n",
      "print('part (b)')\n",
      "print('\\n for theta=90 degrees')\n",
      "print\"%s %.4f %s\"%('\\n Maximum tensile stress = ',S_max1,' P')\n",
      "print\"%s %.4f %s\"%('\\n Maximum compressive stress = ',S_max2,' P')\n",
      "\n",
      "\n",
      "th=math.pi\n",
      "## For, maximum tensile stress r=ri\n",
      "r=ri\n",
      "Nr=(ro+ri)*(ro-ri-r*math.log(ro/ri))\n",
      "Dr=r*((ro+ri)*math.log(ro/ri)-2.*(ro-ri))\n",
      "## Question was asked in terms of P, so let it be unity\n",
      "P=1\n",
      "S_th=P*((math.sin(th)-th*math.cos(th))/(math.pi*(ro-ri)*t))*(1.+Nr/Dr)\n",
      "S_max1=S_th\n",
      "## For maximum compressive stress r=ro\n",
      "r=ro\n",
      "Nr=(ro+ri)*(ro-ri-r*math.log(ro/ri))\n",
      "Dr=r*((ro+ri)*math.log(ro/ri)-2*(ro-ri))\n",
      "S_th=P*((math.sin(th)-th*math.cos(th))/(math.pi*(ro-ri)*t))*(1+Nr/Dr)\n",
      "S_max2=S_th\n",
      "print('\\n for theta=180 degrees')\n",
      "print\"%s %.4f %s\"%('\\n Maximum tensile stress = ',S_max1,' P')\n",
      "print\"%s %.4f %s\"%('\\n Maximum compressive stress = ',S_max2,' P')\n",
      "\n",
      "##part(c)\n",
      "S_thMax=340. ##MPa\n",
      "SF=2.2\n",
      "P=S_thMax/(SF*S_max1)\n",
      "print('\\n part(c)')\n",
      "print\"%s %.2f %s\"%('\\n The maximum allowable load is ',P/1000,' kN')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (b)\n",
        "\n",
        " for theta=90 degrees\n",
        "\n",
        " Maximum tensile stress =  0.0005  P\n",
        "\n",
        " Maximum compressive stress =  -0.0002  P\n",
        "\n",
        " for theta=180 degrees\n",
        "\n",
        " Maximum tensile stress =  0.0017  P\n",
        "\n",
        " Maximum compressive stress =  -0.0006  P\n",
        "\n",
        " part(c)\n",
        "\n",
        " The maximum allowable load is  91.44  kN\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg334"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the circumferential stress at B and Radial stress at the Junction\n",
      "P=120. ##kN\n",
      "b1=120. ##mm\n",
      "b2=120. ##mm\n",
      "h1=48. ##mm\n",
      "h2=24. ##mm\n",
      "P=P*10**3\n",
      "A=h1*b1+b2*h2\n",
      "R=(b1*h1*96.+b2*h2*180.)/A\n",
      "Am=b1*math.log(b1/72.)+h2*math.log(240./b2)\n",
      "r=72.\n",
      "Mx=364.*P\n",
      "S_thB=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "\n",
      "r1=120. ##mm\n",
      "t=24. ##mm\n",
      "A1=h1*r1\n",
      "Am1=r1*math.log(r1/r)\n",
      "S_rr=(A*Am1-A1*Am)*Mx/(t*r1*A*(R*Am-A))\n",
      "print\"%s %.2f %s\"%('Circumferential stress is',S_thB,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n Radial stress is ',S_rr,' MPa')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Circumferential stress is 221.59  MPa\n",
        "\n",
        " Radial stress is  138.39  MPa\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg335"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the circumferntial stress abd radial stresss\n",
      "Mo=96. ##kN\n",
      "P=120. ##kN\n",
      "b1=150. ##mm\n",
      "h1=60. ##mm\n",
      "b2=120. ##mm\n",
      "h2=50. ##mm\n",
      "b3=b1\n",
      "h3=40. ##mm\n",
      "ro=80. ##mm\n",
      "r1=140. ##mm\n",
      "r2=260. ##mm\n",
      "r3=300. ##mm\n",
      "## calculations\n",
      "Mo=Mo*10**6 ## N.mm\n",
      "P=P*10**3 ## N\n",
      "A=b1*h1+b2*h2+b3*h3\n",
      "Am=b1*math.log(r1/ro)+h2*math.log(r2/r1)+b3*math.log(r3/r2)\n",
      "R=(b1*h1*110.+b2*h2*200.+b3*h3*280.)/A\n",
      "Mx=Mo+P*R\n",
      "r=80. ##mm\n",
      "S_th=P/A+(Mx*(A-r*Am))/(A*r*(R*Am-A))\n",
      "\n",
      "A1=9000. ##mm^2\n",
      "r1=140. ##mm\n",
      "t=50. ##mm\n",
      "Am1=b1*math.log(r1/ro)\n",
      "N=120000.\n",
      "S_rr=A1*N/(A*t*r1) + (A*Am1-A1*Am)*Mx/(t*r1*A*(R*Am-A))\n",
      "print\"%s %.2f %s\"%('Circumferential stress is ',S_th,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n Radial stress at B1 is ',S_rr,' MPa')\n",
      "## to find radial stress at C; \n",
      "A1=b1*h1+b2*h2\n",
      "Am1=b1*math.log(r1/ro)+h2*math.log(r2/r1)\n",
      "r1=260. ##mm\n",
      "t=50. ##mm\n",
      "S_rr=A1*N/(A*t*r1) + (A*Am1-A1*Am)*Mx/(t*r1*A*(R*Am-A))\n",
      "print\"%s %.2f %s\"%('\\n Radial stress at C1 is ',S_rr,' MPa')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Circumferential stress is  177.54  MPa\n",
        "\n",
        " Radial stress at B1 is  111.56  MPa\n",
        "\n",
        " Radial stress at C1 is  45.09  MPa\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg337"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the maximum confererntial and radial stress in the beam\n",
      "l=15. ##m\n",
      "R=10. ##m\n",
      "d=0.8 ##m\n",
      "b=0.13 ##m\n",
      "Po=2400. ##N/m\n",
      "P=4800. ##N/m\n",
      "##calculations\n",
      "a=R-d/2.\n",
      "c=R+d/2.\n",
      "A=b*d\n",
      "Am=b*math.log(c/a)\n",
      "Mx=(Po+P)*l**2/8.\n",
      "S_thMax=Mx*(A-a*Am)/(A*a*(R*Am-A))\n",
      "## To find out max radial stress\n",
      "## Nr=d*log(r/a)-(r-a)*log(c/a)\n",
      "## Dr=r*d*(R*log(c/a)-d)\n",
      "## S_rr=Mx/b*Nr/Dr\n",
      "r=a*math.exp(1-(a/d*math.log(c/a)))\n",
      "Nr=d*math.log(r/a)-(r-a)*math.log(c/a)\n",
      "Dr=r*d*(R*math.log(c/a)-d)\n",
      "S_rrMax=Mx/b*Nr/Dr\n",
      "print('\\n part (a)')\n",
      "print\"%s %.2f %s\"%('\\n Maximum circumferential stress is ',S_thMax/10**6,' MPa')\n",
      "print\"%s %.2f %s\"%('\\n Maximum radial stress is ',S_rrMax/10**6,' MPa')\n",
      "## part (b)\n",
      "Ix=b*d**3./12.\n",
      "S_th=Mx*d/(2.*Ix)\n",
      "print('\\n part (b)')\n",
      "print\"%s %.2f %s\"%('\\n Maximum circumferential stress using straight beam formula is ',S_th/10**6,' MPa')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " part (a)\n",
        "\n",
        " Maximum circumferential stress is  15.00  MPa\n",
        "\n",
        " Maximum radial stress is  0.29  MPa\n",
        "\n",
        " part (b)\n",
        "\n",
        " Maximum circumferential stress using straight beam formula is  14.60  MPa\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex8-pg342"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the magnitude of the moment \n",
      "## part(a)\n",
      "Y=280. ##MPa\n",
      "A=4000. ##mm^2\n",
      "Am=44.99 ##mm\n",
      "R=100.0 ##mm\n",
      "r=180. ##mm\n",
      "r=60 ##mm\n",
      "## Mx is not yet known take it as unity\n",
      "Mx=1. ##unity\n",
      "r=180.\n",
      "S_thMax=Mx*(A-r*Am)/(A*r*(R*Am-A))\n",
      "Mx=Y/(abs(S_thMax))\n",
      "print('part(a)')\n",
      "print\"%s %.2f %s\"%('\\n Mx = ',Mx/10**6,' kN.m')\n",
      "## part(b)\n",
      "k1=1.143\n",
      "t_w=20.\n",
      "b_p=40.\n",
      "alpha=0.651\n",
      "Beta=1.711\n",
      "r=60 ##mm\n",
      "b1=2.*alpha*b_p+t_w\n",
      "A=b1*t_w+t_w*R\n",
      "R=(b1*t_w*70.+t_w*R*130.)/A\n",
      "Am=b1*math.log(80./r)+t_w*math.log(180./80.)\n",
      "## Mx not yet known teke it as unity\n",
      "Mx=1.\n",
      "S_thMax=Mx*(A-r*Am)/(A*r*(R*Am-A))\n",
      "r=70. ##mm\n",
      "S_thbar=Mx*(A-r*Am)/(A*r*(R*Am-A))\n",
      "S_xx=-Beta*S_thbar\n",
      "##tau_max=Y/2=(S_thMax-S_xx)/2\n",
      "Mx=Y/(S_thMax-S_xx)\n",
      "print('\\n part (b)')\n",
      "print\"%s %.2f %s\"%('\\n Mx = ',Mx/10**6,' kN.m')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part(a)\n",
        "\n",
        " Mx =  24.55  kN.m\n",
        "\n",
        " part (b)\n",
        "\n",
        " Mx =  10.12  kN.m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg346"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "## initialization of variables\n",
      "##calculate the angle change between the two horizontal faces where M is applied\n",
      "E=72. ##GPa\n",
      "t=60. ##mm\n",
      "M=24. ##kN.m\n",
      "##part(a)\n",
      "ro=100. ##mm\n",
      "r1=150. ##mm\n",
      "A=t*r1\n",
      "Am=t*math.log((ro+r1)/ro)\n",
      "R=ro+r1/2.\n",
      "E=E*10**3\n",
      "Mx=M*10**6\n",
      "Phi=Am*Mx*math.pi/(A*(R*Am-A)*E)\n",
      "print('part(a)')\n",
      "print\"%s %.2f %s\"%('\\n Phi = ',Phi,' rad')\n",
      "##part(b)\n",
      "##Mx=Mx+P*R*sin(th)\n",
      "delta_P=Am*Mx*R*2./(A*(R*Am-A)*E)\n",
      "print('\\n part(b)')\n",
      "print\"%s %.2f %s\"%('\\n deflection = ',delta_P,' mm')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part(a)\n",
        "\n",
        " Phi =  0.01  rad\n",
        "\n",
        " part(b)\n",
        "\n",
        " deflection =  1.15  mm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##calculate the relative displacement\n",
      "## initialization of variables\n",
      "import math\n",
      "P=11.2 ##kN\n",
      "E=200. ##GPa\n",
      "v=0.3\n",
      "Ix=181.7e+03 ##mm^4\n",
      "k1=0.643\n",
      "b1=34.7 ##mm\n",
      "h1=10. ##mm\n",
      "b2=40. ##mm\n",
      "h2=10. ##mm\n",
      "t=10. ##mm\n",
      "h=50. ##mm\n",
      "E=E*10**3\n",
      "A=b1*h1+b2*h2\n",
      "R=(b1*h1*35.+b2*h2*60.)/A\n",
      "Am=b1*math.log(40./30.)+h1*math.log(80./40.)\n",
      "G=E/(2.*(1.+v))\n",
      "Aw=t*h\n",
      "P=P*10**3\n",
      "delta_P=2.*P*100./(Aw*G) + 2*P/(E*3.*Ix)*100**3 + P*48.4*math.pi/(2.*Aw*G) + P*48.4*math.pi/(2.*A*E) + P*16.9/(A*(48.4*16.9-A)*E)*(100**2*math.pi+math.pi/2.*(48.4)**2+2*100.*2.*48.4)\n",
      "print\"%s %.2f %s\"%('seperation = ',delta_P,' mm')\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "seperation =  1.26  mm\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}