{ "metadata": { "name": "chapter 7.ipynb" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 7:Centre Of Gravity And Moment Of Inertia" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.1,Page No.165" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b1=12 #cm #width of flange\n", "d1=3 #cm #depth\n", "\n", "#web\n", "b2=3 #cm\n", "d2=10 #cm \n", "\n", "#Calculations\n", "\n", "#area of flange\n", "a1=b1*d1 #cm**2\n", "\n", "#area of web\n", "a2=b2*d2 #cm**2\n", "\n", "#C.G of flange\n", "y1=d1*2**-1+d2 #cm\n", "\n", "#C.G of web\n", "y2=d2*2**-1 #cm\n", "\n", "#C.G of section\n", "Y=(a1*y1+a2*y2)*(a1+a2)**-1\n", "\n", "#Result\n", "print\"C.G of section is\",round(Y,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C.G of section is 8.55 cm\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.2,Page No.166" ] }, { "cell_type": "code", "collapsed": false, "input": [ " import math\n", "\n", "#Declaration Of Variables\n", "\n", "b1=10 #cm #width of top flange\n", "d1=2 #cm #depth\n", "\n", "#web\n", "b2=2 #cm\n", "d2=15 #cm \n", "\n", "#bottom flange\n", "b3=20 #cm \n", "d3=2 #cm\n", "\n", "#Calculations\n", "\n", "#area of top flange\n", "a1=b1*d1 #cm**2\n", "\n", "#area of web\n", "a2=b2*d2 #cm**2\n", "\n", "#area of bottom flange\n", "a3=b3*d3 #cm**2\n", "\n", "#C.G of flange\n", "y1=d1*2**-1+d2+d3 #cm\n", "\n", "#C.G of web\n", "y2=d2*2**-1+d3 #cm\n", "\n", "#C.G of bottom flange\n", "y3=d3*2**-1 #cm\n", "\n", "#C.G of section\n", "Y=(a1*y1+a2*y2+a2*y3)*(a1+a2+a3)**-1\n", "\n", "#Result\n", "print\"C.G of section is\",round(Y,3),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C.G of section is 7.5 cm\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.3,Page No.167" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b2=8 #cm #width of flange\n", "d2=2 #cm #depth\n", "\n", "#web\n", "b1=2 #cm\n", "d1=10 #cm \n", "\n", "#Calculations\n", "\n", "#area of flange\n", "a1=b1*d1 #cm**2\n", "\n", "#area of web\n", "a2=b2*d2 #cm**2\n", "\n", "#distance of C.G of flange(y-axis)\n", "y1=d1*2**-1+d2 #cm\n", "\n", "#distance of C.G of web(y-axis)\n", "y2=d2*2**-1 #cm\n", "\n", "#C.G of section(y-axis)\n", "Y=(a1*y1+a2*y2)*(a1+a2)**-1 #cm\n", "\n", "#distance of C.G of flange(y-axis)\n", "x1=b1*2**-1 #cm\n", "\n", "#distance of C.G of web(y-axis)\n", "x2=b2*2**-1 #cm\n", "\n", "#C.G of section(y-axis)\n", "X=(a1*x1+a2*x2)*(a1+a2)**-1 #cm\n", "\n", "\n", "#Result\n", "print\"C.G of section(X-axis) is\",round(X,2),\"cm\"\n", "print\"C.G of section(Y-axis) is\",round(Y,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C.G of section(X-axis) is 2.33 cm\n", "C.G of section(Y-axis) is 4.33 cm\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.4,Page No.168" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b=2.5 #cm #width of triangle\n", "h=5 #cm #height of triangle\n", "b2=10 #cm #width of rectangle\n", "h2=5 #cm #height of rectangle\n", "r=2.5 #cm #radius of semicircle\n", "\n", "#Calculations\n", "\n", "#Area of semicircle\n", "a1=pi*2**-1*r**2 #cm**2\n", "\n", "#C.G of semicircle\n", "y1=h2*2**-1 #cm\n", "x1=r-(4*r*(3*pi)**-1)\n", "\n", "#area of rectangle\n", "a2=b2*h2 #cm**2\n", "\n", "#C.G of rectangle\n", "y2=h*2**-1 #cm\n", "x2=r+b2*2**-1 #cm\n", "\n", "#Area of triangle\n", "a3=2*b*h*2**-1 #cm**2\n", "\n", "#c.G of triangle\n", "y3=h2+h2*3**-1 #cm\n", "x3=r+b2*2**-1+b #cm\n", "\n", "#C.G of section (y-axis)\n", "Y=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm\n", "\n", "#C.G of section (x-axis)\n", "\n", "X=(a1*x1+a2*x2+a3*x3)*(a1+a2+a3)**-1 #cm\n", "\n", "#Result\n", "print\"C.G of uniform lamina is\",round(Y,2),\"cm\"\n", "print\" \",round(X,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C.G of uniform lamina is 3.22 cm\n", " 7.11 cm\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.4(A),Page No.169" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "r=6 #cm #radius\n", "b1=12 #cm #width of rectangle angle and triangle\n", "h=6 #cm #height of triangle and rectangle\n", "\n", "#Calculations\n", "\n", "#Semicircle\n", "\n", "#area\n", "A1=pi*r**2*2**-1 #cm**2 \n", "\n", "#distance of C.G\n", "x1=4*r*(3*pi)**-1 #cm\n", "y1=r*2**-1*2 #cm\n", "\n", "#Triangle\n", "\n", "#Area\n", "A2=h*b1*2**-1 #cm**2 \n", "\n", "#Distance of c.g\n", "x2=-b1*3**-1 #cm\n", "y2=h*3**-1+h #cm\n", "\n", "#rectangle\n", "\n", "#Area\n", "A3=b1*h #cm**2\n", "\n", "#Distance of C.G\n", "x3=-b1*2**-1 #cm\n", "y3=h*2**-1 #cm \n", "\n", "#C.G of section\n", "X=(A1*x1+A2*x2+A3*x3)*(A1+A2+A3)**-1\n", "Y=(A1*y1+A2*y2+A3*y3)*(A1+A2+A3)**-1\n", "\n", "#Answer for Y is incorrect in textbook\n", "\n", "#Result\n", "print\"Centroid of Area is\",round(X,2),\"cm\"\n", "print\" \",round(Y,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Centroid of Area is -2.63 cm\n", " 5.12 cm\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.5,Page No.170" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b=10 #cm #width\n", "h=12 #cm #Height\n", "b1=3 #cm #Width of cut hole\n", "h2=4 #cm #height\n", "\n", "#Calculations\n", "\n", "#Area of rectangle\n", "A=b*h #cm**2 \n", "\n", "#Distance of C.G\n", "y=h*2**-1 #cm\n", "\n", "#Area of hole cut\n", "A2=h2*b1 #cm**2\n", "\n", "#Distance of C.G of cut hole\n", "y2=2+h2*2**-1 #cm\n", "\n", "#Distance between C.G of section with a cut hole\n", "y3=(A*y-A2*y2)*(A-A2)**-1 #cm\n", "\n", "#Distance of C.G with acut hole from left\n", "x1=b*2**-1 #cm\n", "\n", "#Distance of C.G of cut hole from left lineAD\n", "x2=b*2**-1+1+b1*2**-1\n", "\n", "#C.G of section\n", "X=(A*x1-A2*x2)*(A-A2)**-1 #cm\n", "\n", "#Result\n", "print\"C.G of section is\",round(X,2),\"cm\"\n", "print\" \",round(y3,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C.G of section is 4.72 cm\n", " 6.22 cm\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.12(A),Page No.197" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b=100 #mm #Width of triangle\n", "h=90 #mm #height of triangle\n", "\n", "#Calculations\n", "\n", "#M.I about BC\n", "I_BC=b*h**3*12**-1 #cm**4 \n", "\n", "#Result\n", "print\"M.I of section about an axispassing through base BC\",round(I_BC,2),\"cm\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "M.I of section about an axispassing through base BC 6075000.0 cm\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.12(B),Page No.199" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "#Rectangle ABCD\n", "L1=10 #cm #Length of rectangle\n", "D1=2 #cm #Depth\n", "\n", "#Rectangle HGEF\n", "L2=2 #cm\n", "D2=10-2 #cm \n", "\n", "D=10 #cm #Total Depth\n", "L=10 #cm #Total Length\n", "\n", "#Calculations\n", "\n", "#Areas\n", "\n", "a1=L1*D1 #cm**2 #Area of rectangle ABCD\n", "a2=L2*D2 #cm**2 #Area of Rectangle HGEF\n", "\n", "#Centre of gravity of respective bodies From Bottom\n", "\n", "y1=D1*2**-1+D2 #cm #C.G of rectangle ABCD from bottom\n", "y2=D2*2**-1 #cm #C.G of rectangle HGEF from bottom\n", "\n", "#Centre of gravity of whole section From bottom\n", "\n", "y_bar=(a1*y1+a2*y2)*(a1+a2)**-1 #cm\n", "\n", "#Centre of gravity of whole section From top\n", "\n", "y_bar2=D-y_bar #cm\n", "\n", "#M.I of respective bodies\n", "\n", "i1=L1*D1**3*12**-1 #cm**4 #M.I of ABCD about an axis passing through it's C.G\n", "i2=L2*D2**3*12**-1 #cm**4 #M.I of HGEF about an axis passing through it's C.G\n", " \n", "h1=y_bar2-D1*2**-1 #cm #Distance of C.G of ABCD from C.G of whole section\n", "h2=y_bar-D2*2**-1 #cm #Distance of C.G of HGEF from C.G of whole section\n", "\n", "I1=i1+a1*h1**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section\n", "I2=i2+a2*h2**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section\n", "\n", "#Moment of Inertia of section about horizontal axis passing through C.G of given section\n", "I_xx=I1+I2 #cm**4\n", "\n", "#Moment of Inertia of section about vertical axis passing through C.G of given section\n", "I_yy=D1*L1**3*12**-1+D2*L2**3*12**-1 #cm**4\n", "\n", "#Result\n", "print\"Moment of Inertia of section about horizontal axis passing through C.G of given section\",round(I_xx,2),\"cm**4\"\n", "print\"Moment of Inertia of section about vertical axis passing through C.G of given section\",round(I_yy,2),\"cm**4\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Moment of Inertia of section about horizontal axis passing through C.G of given section 314.22 cm**4\n", "Moment of Inertia of section about vertical axis passing through C.G of given section 172.0 cm**4\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.13,Page No.201" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "#Rectangle ABCD\n", "\n", "L1=10 #cm #Length\n", "d1=2 #cm #depth\n", "\n", "#Rectangle EHGF\n", "\n", "L2=2 #cm #Length\n", "d2=10 #cm #depth\n", "\n", "#Rectangle JKLM\n", "\n", "L3=20 #cm #Length\n", "d3=2 #cm #depth\n", "\n", "D=14 #cm #Overall Depth\n", "\n", "#Calculations\n", "\n", "a1=L1*d1 #cm**2 #Area of rectangle 1\n", "a2=L2*d2 #cm**2 #Area of Rectangle 2\n", "a3=L3*d3 #cm**2 #Area of rectangle 3\n", "\n", "#Centre of gravity of respective bodies From Bottom\n", "\n", "y1=D-d1*2**-1 #cm #C.G of rectangle 1 from bottom\n", "y2=d2*2**-1+d3 #cm #C.G of rectangle 2from bottom\n", "y3=d3*2**-1 #cm #C.G of rectangle 3from bottom\n", "\n", "#Centre of gravity of whole section From bottom\n", "\n", "y_bar=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm\n", "\n", "#Centre of gravity of whole section From top\n", "\n", "y_bar2=D-y_bar #cm\n", "\n", "\n", "#M.I of respective bodies\n", "\n", "i1=L1*d1**3*12**-1 #cm**4 #M.I of ABCD about an axis passing through it's C.G\n", "i2=L2*d2**3*12**-1 #cm**4 #M.I of HGEF about an axis passing through it's C.G\n", "i3=L3*d3**3*12**-1 #cm**4 #M.I of JKLM about an axis passing through it's C.G\n", "\n", "h1=y_bar2-d1*2**-1 #cm #Distance of C.G of ABCD from C.G of whole section\n", "h2=y_bar2-(d2*2**-1+d1) #cm #Distance of C.G of HGEF from C.G of whole section\n", "h3=y_bar-d3*2**-1 #cm #Distance of C.G of JKLM from C.G of whole section\n", "\n", "I1=i1+a1*h1**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section\n", "I2=i2+a2*h2**2 #cm**4 #M.I of HGEF about an axis passing through C.G of section\n", "I3=i3+a3*h3**2 #cm**4 #M.I of JKLM about an axis passing through C.G of section\n", "\n", "#Moment of Inertia of section about horizontal axis passing through C.G of given section\n", "I_xx=I1+I2+I3 #cm**4\n", "\n", "\n", "#Result\n", "print\"Moment of Inertia of section about horizontal axis passing through C.G of given section\",round(I_xx,2),\"cm**4\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Moment of Inertia of section about horizontal axis passing through C.G of given section 2166.67 cm**4\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.14,Page No.202" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "#Rectangle 1\n", "\n", "L1=80 #cm #Length\n", "d1=12 #cm #depth\n", "\n", "#Rectangle 2\n", "\n", "L2=12 #cm #Length\n", "d2=128 #cm #depth\n", "\n", "#Rectangle 3\n", "\n", "L3=120 #cm #Length\n", "d3=10 #cm #depth\n", "\n", "D=150 #cm #Overall Depth\n", "\n", "\n", "#Calculations\n", "\n", "a1=L1*d1 #cm**2 #Area of rectangle ABCD\n", "a2=L2*d2 #cm**2 #Area of Rectangle EHGF\n", "a3=L3*d3 #cm**2 #Area of rectangle JKLM\n", "\n", "#Centre of gravity of respective bodies From Bottom\n", "\n", "y1=D-d1*2**-1 #cm #C.G of rectangle ABCD from bottom\n", "y2=d2*2**-1+d3 #cm #C.G of rectangle HGEF from bottom\n", "y3=d3*2**-1 #cm #C.G of rectangle JKLM from bottom\n", "\n", "#Centre of gravity of whole section From bottom\n", "\n", "y_bar=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm\n", "\n", "#Centre of gravity of whole section From top\n", "\n", "y_bar2=D-y_bar #cm\n", "\n", "#M.I of respective bodies\n", "\n", "i1=L1*d1**3*12**-1 #cm**4 #M.I of 1 about an axis passing through it's C.G\n", "i2=L2*d2**3*12**-1 #cm**4 #M.I of 2 about an axis passing through it's C.G\n", "i3=L3*d3**3*12**-1 #cm**4 #M.I of 3 about an axis passing through it's C.G\n", "\n", "h1=y_bar2-d1*2**-1 #cm #Distance of C.G of 1 from C.G of whole section\n", "h2=y_bar2-(d2*2**-1+d1) #cm #Distance of C.G of 2 from C.G of whole section\n", "h3=y_bar-d3*2**-1 #cm #Distance of C.G of 3 from C.G of whole section\n", "\n", "I1=i1+a1*h1**2 #cm**4 #M.I of 1 about an axis passing through C.G of section\n", "I2=i2+a2*h2**2 #cm**4 #M.I of 2 about an axis passing through C.G of section\n", "I3=i3+a3*h3**2 #cm**4 #M.I of 3 about an axis passing through C.G of section\n", "\n", "#Moment of Inertia of section about x-x axis\n", "I_xx=(I1+I2+I3)*10**-6 #cm**4\n", "\n", "#Moment of Inertia of section about y-y axis\n", "I_yy=(d1*L1**3*12**-1+d2*L2**3*12**-1+d3*L3**3*12**-1)*10**-6 #cm**4\n", "\n", "#Polar Moment of Inertia\n", "I_zz=I_xx+I_yy #mm**4\n", "\n", "\n", "#Result\n", "print\"Polar Moment of Inertia is\",round(I_zz,2),\"mm**4\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Polar Moment of Inertia is 14.44 mm**4\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.17,Page No.207" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Declaration Of Variables\n", "\n", "b=12 #cm #width of culvert\n", "d=6 #cm #Depth\n", "x=1 #cm #distance between axis of rectangle and semicircle\n", "\n", "b1=3 #cm #width of triangles\n", "h1=6 #cm #height\n", "x1=0 #cm #distance between axis of rectangle and triangles\n", "r=4 #cm #radius of semicircle\n", "\n", "#Calculations\n", "\n", "#area of rectangle\n", "A=b*d #cm\n", "\n", "#M.I of rectangle about an axis A-A\n", "M1=b*d**3*12**-1+A*x #cm**4 \n", "\n", "#Area of rectangle\n", "A1=b1*h1*2**-1 #cm**4\n", "\n", "#M.I of triangles\n", "M2=2*(b1*h1**3*36**-1+A1*x1) #cm**4\n", "\n", "#M.I of semicircle\n", "M3=0.11*r**4+pi*r**2*2**-1*(r-4*r*(3*pi)**-1)**2 #cm**4\n", "\n", "#M.I of c/s of culvert\n", "M4=M1-M2-M3 #cm**4\n", "\n", "#Result\n", "print\"Cross-section of culvert is\",round(M4,2),\"cm**4\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Cross-section of culvert is 90.62 cm**4\n" ] } ], "prompt_number": 11 } ], "metadata": {} } ] }