{
 "metadata": {
  "name": "",
  "signature": "sha256:b60753ad5256b26ed900efc57b1a6de06dc4217fa7384fe1bb9afe99a185fc77"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter13-Elements of reinforced concrete"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-486"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The stress induced in the concrete and steel and \n",
      "b = 10.;##inches\n",
      "d = 1.;##inches\n",
      "h = 20.;##inches\n",
      "r = 2.;##inches\n",
      "M_r = 500000.;##lb-inches\n",
      "m = 15.;\n",
      "A_r = 4.*0.25*math.pi*d**2;##in^2\n",
      "h_eff = h-r;##inches\n",
      "K = m*A_r/(b*h_eff);##inches\n",
      "n1 = math.sqrt((K)**2+(2*K))-K;\n",
      "n = n1*h_eff;##inches\n",
      "a = h_eff-(n/3);##inches\n",
      "c = 2.*M_r/(b*n*a);##lb/in^2\n",
      "t = (h_eff-n)*m*c/n;##lb/in^2\n",
      "print'%s %.d %s'%('The stress induced in the concrete and steel, t =',t,'lb/in^2');\n",
      "\n",
      "##there is a minute error in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The stress induced in the concrete and steel, t = 10643 lb/in^2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg487"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The distance of the N.A from the top edge and The safe moment of inertia and The safe moment of inertia\n",
      "b = 8.;##inches\n",
      "d = 7/8.;##inches\n",
      "h = 18.;##inches\n",
      "r = 2.;##inches\n",
      "c = 750.;##lb/in^2\n",
      "t_limit = 18000.;##lb/in^2\n",
      "m = 8.;\n",
      "h_eff = 16.;##inches\n",
      "m = 18;\n",
      "A_t = 3*0.25*math.pi*d**2;##in^2\n",
      "K = m*A_t/(b*h_eff);##inches\n",
      "n1 = math.sqrt((K)**2.+(2.*K))-K;\n",
      "n = n1*h_eff;##inches\n",
      "a = h_eff - (n/3.);##inches\n",
      "t = m*c*(h_eff-n)/n;##lb/in^2\n",
      "\n",
      "if t<t_limit:\n",
      "    t = t;\n",
      "else:\n",
      "    t = t_limit;\n",
      "\n",
      "M_r = t*A_t*a;## lb/inches\n",
      "W = M_r*8./(12.*h_eff);##lb-wt\n",
      "print'%s %.3f %s'%('The distance of the N.A from the top edge, n =',n,'inches.');\n",
      "print'%s %.d %s'%('The safe moment of inertia is, t =',t,'lb/in^2.');\n",
      "print'%s %.d %s %d %s'% ('Unifromly distributed load over the beam, W =',W,'lb-wt. or',W/16.011,'lb. per foot run');\n",
      "\n",
      "##there are calculation errors given in the answer in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance of the N.A from the top edge, n = 8.039 inches.\n",
        "The safe moment of inertia is, t = 13368 lb/in^2.\n",
        "Unifromly distributed load over the beam, W = 13385 lb-wt. or 836 lb. per foot run\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg488"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Area of steel reinforcement required and Corresponding stress in steel \n",
      "import numpy\n",
      "from numpy import roots\n",
      "def quadratic(d,M_c,c_limit,b):\n",
      "    p = ([1 , -(d*3), + M_c*3/(0.5*c_limit*b)]);\n",
      "    Z = numpy.roots(p);\n",
      "    return Z;\n",
      "\n",
      "b = 12.;##inches\n",
      "h = 22.;##inches\n",
      "r = 2.;##inches\n",
      "W = 1500.;##lb per foot run\n",
      "d = h-r;##feet\n",
      "l = 20.;##inches\n",
      "c_limit = 700.;## lb/in^2\n",
      "m = 15.;\n",
      "M_c = W*20.*l*b/8.;## lb-inches\n",
      "Z = quadratic(d,M_c,c_limit,b);\n",
      "n = round(Z[1]);\n",
      "t = m*c_limit*(d-n)/n;## lb/in62\n",
      "A_t = 0.5*c_limit*b*n/t;## in^2\n",
      "print'%s %.d %s'%('Area of steel reinforcement required is, A_t =',A_t,'in^2');\n",
      "print'%s %.d %s'%(' Corresponding stress in steel is, t =',t,'lb/in^2');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Area of steel reinforcement required is, A_t = 13 in^2\n",
        " Corresponding stress in steel is, t = 4500 lb/in^2\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg492"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Effective deapth\n",
      "m = 15.;\n",
      "t = 18000.;## lb/in^2\n",
      "c = 700.;## lb/in^2\n",
      "b = 12.;## inches\n",
      "M = 900000.;##bending moment lb/inches\n",
      "k1 = 1./((t/(m*c))+1.);##k = n/d\n",
      "k2 = 1.-k1/3.;##k2 = a/d\n",
      "p = 0.5*c*k1/(t);\n",
      "d = math.sqrt(M/(0.5*c*b*k1*k2));##inches\n",
      "A_t = p*b*d;## sq.inches\n",
      "A_t_previous = 0.25*math.pi*(7/8.)**2;##section area with diameter 7/8 inches\n",
      "n = A_t/A_t_previous;\n",
      "print'%s %.2f %s'%('Effective deapth is d =',d,'inches');\n",
      "print'%s %.3f %s'%('A_t =',A_t,'sq.inches');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Effective deapth is d = 25.75 inches\n",
        "A_t = 2.214 sq.inches\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg492"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the effective death\n",
      "l = 20.;##feet\n",
      "W = 500.;## lb per foot run\n",
      "c = 750.;## lb/in^2\n",
      "t = 18000.;## lb/in^2\n",
      "m = 15.;\n",
      "BM_max = W*l*l*12./8. ;## lb-inches\n",
      "##by making the effective deapth d twice the width b\n",
      "d = (BM_max/(126.*0.5))**(1/3.);##inches\n",
      "b = 0.5*d;##inches\n",
      "##necessary reinforcement is 0.8% of concrete section\n",
      "A_t = 0.008*b*d;## in^2\n",
      "print'%s %.2f %s %.2f %s'%('d =',d,'inches ,b =',b,'inches');\n",
      "print'%s %.3f %s'%('A_t =',A_t,'in^2');\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "d = 16.82 inches ,b = 8.41 inches\n",
        "A_t = 1.132 in^2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg494"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate d1 and d2 and r1\n",
      "W = 180.;## lb per sq.foot\n",
      "l = 10.;## feet\n",
      "b = 12.;##inches\n",
      "c = 750.;## lb/in^2\n",
      "m = 15.;\n",
      "M = W*l*l*12./8.;##lb-inches\n",
      "d_new = math.sqrt(M/(126.*b));##inches\n",
      "A_t = 0.8*b*d_new/100.;##in^2\n",
      "##using 3/8 inch rods \n",
      "d1 = 3/8.;##inches\n",
      "A1 = 0.25*math.pi*(d1)**2;##in^2 \n",
      "r1 = A1*b/A_t;##inch\n",
      "##using 1/2 inch rods \n",
      "d2 = 1/2.;##inches\n",
      "A2 = 0.25*math.pi*(d2)**2;##in^2 \n",
      "r2 = A2*b/A_t;##inches\n",
      "print'%s %.3f %s'%('d =',d_new,'inches');\n",
      "print'%s %.3f %s'%('A_t =',A_t,'in^2');\n",
      "print'%s %.3f %s %.2f %s'%('Using',d1,'inch rods, spacing centre to centre will be',r1,'inches');\n",
      "print'%s %.2f %s %.1f %s'%('Using ',d2,' inch rods, spacing centre to centre will be ',r2,' inches');\n",
      "##there are round-off errors in the answer given in textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "d = 4.226 inches\n",
        "A_t = 0.406 in^2\n",
        "Using 0.375 inch rods, spacing centre to centre will be 3.27 inches\n",
        "Using  0.50  inch rods, spacing centre to centre will be  5.8  inches\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg495"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate foot width of slab and spacing centre to centre \n",
      "l = 12.;##feet\n",
      "w = 150.;## lb per sq.foot\n",
      "##Live load\n",
      "LL = w*l;##lb-wt\n",
      "##Dead Load assuming the slab thickness to be 6 inches\n",
      "t = 6.;##inches\n",
      "DL = t*l*12.;##lb-wt\n",
      "##total load\n",
      "W = LL+DL;##lb-wt\n",
      "M = W*l*12./10.;##lb-inches\n",
      "d = math.sqrt(M/(12.*126.));\n",
      "print'%s %.4f %s'%('d =',d,'inches');\n",
      "##With about an  inch to cover the slab will be 6 inch thick\n",
      "A_t = 0.8*l*d/100.;## in^2\n",
      "##using 1/2 inch rods \n",
      "d1 = 1/2.;##inches\n",
      "A1 = 0.25*math.pi*(d1)**2;##in^2 \n",
      "r1 = A1*l/A_t;##inches\n",
      "print'%s %.4f %s'%(' Per foot width of slab, A_t =',A_t,'in^2');\n",
      "print'%s %.2f %s %.3f %s'%('Using',d1,'inch rods, spacing centre to centre will be ',r1,' inches');\n",
      "##there are minute calculation errors in the answer given in textbook.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "d = 5.0370 inches\n",
        " Per foot width of slab, A_t = 0.4836 in^2\n",
        "Using 0.50 inch rods, spacing centre to centre will be  4.873  inches\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}