{ "metadata": { "name": "", "signature": "sha256:1e57dcb73985a42b8c9ee1409e50d4315b6a10f8a73cdae8a91714580c2fe346" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 2: Introduction to Engineering Calculations" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.2-1, page no. 10" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "\n", "AcclInitial=1.0 #cm/s^2\n", "\n", "#Calculations and printing :\n", "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n", "AcclFinal=AcclInitial*math.pow(3600*24*365,2)/math.pow(10,5)\n", "#the calculations involved are the conversion factors\n", "print '%s %.3E' %(\" \\n final acceleration (Km/Yr^2) = \",AcclFinal)\n", "raw_input('press enter key to exit')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n", " \n", " final acceleration (Km/Yr^2) = 9.945E+09\n" ] }, { "name": "stdout", "output_type": "stream", "stream": "stdout", "text": [ "press enter key to exit\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "''" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.3-1, page no. 11" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "\n", "Initial=23.0 #lb.ft/min^2\n", "\n", "#Calculations and printing :\n", "\n", "Final=Initial*0.453593*100/(3.281*60*60)\n", "#the calculations involved are conversion factors\n", "print '%s %.4f' %(\"final (kg.cm/s^2) = \",Final)\n", "raw_input('press enter key to exit')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "final (kg.cm/s^2) = 0.0883\n" ] }, { "name": "stdout", "output_type": "stream", "stream": "stdout", "text": [ "press enter key to exit\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 4, "text": [ "''" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.4-1, page no. 13" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "\n", "density=62.4 #lbm/ft^3\n", "volume=2.0 #ft^3\n", "\n", "#Calculations and printing :\n", "mass=volume*density\n", "print '%s %.3f' %(\"mass of the water = volume x density(lbm) = \",mass)\n", "print(\" \\n At sealevel, g=32.174 ft/s^2\")\n", "g=32.174\n", "weight=mass*g/32.174\n", "print '%s %.3f' %(\" \\n weight at sealevel (lbf) = \",weight)\n", "print(\" \\n At denver, g=32.139 ft/s^2\")\n", "g=32.139\n", "weight=mass*g/32.174\n", "print '%s %.3f' %(\"\\n weight at denver (lbf) = \",weight)\n", "#the division with 32.174 is to convert lbm.math.pow(ft/s,2) to lbf\n", "raw_input('press enter key to exit')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "mass of the water = volume x density(lbm) = 124.800\n", " \n", " At sealevel, g=32.174 ft/s^2\n", " \n", " weight at sealevel (lbf) = 124.800\n", " \n", " At denver, g=32.139 ft/s^2\n", "\n", " weight at denver (lbf) = 124.664\n" ] }, { "name": "stdout", "output_type": "stream", "stream": "stdout", "text": [ "press enter key to exit\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "''" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.5-2, page no. 19" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", " \n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "#the badbatches per week are taken as elements of a vector y\n", "\n", "y=[17, 27, 18, 18, 23, 19, 18, 21, 20, 19, 21, 18]\n", "\n", "#Calculations and printing :\n", "#Here We used standard library functions mean and st_deviation\n", "ybar=numpy.mean(y)\n", "sy=numpy.std(y)\n", "defaultvalue=ybar+3*sy+1\n", "print '%s %d' %(\"the maximum allowed value of y i.e. bad batches in a week is \", defaultvalue+1)\n", "print(\" \\n in case of 2 standard deviations\")\n", "defaultvalue=ybar+2*sy+1\n", "print '%s %d' %(\"the limiting value of y i.e. bad batches in a week is \",defaultvalue)\n", "raw_input('press enter key to exit')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the maximum allowed value of y i.e. bad batches in a week is 29\n", " \n", " in case of 2 standard deviations\n", "the limiting value of y i.e. bad batches in a week is 26\n" ] }, { "name": "stdout", "output_type": "stream", "stream": "stdout", "text": [ "press enter key to exit\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 3, "text": [ "''" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.7-1, page no. 24" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "from matplotlib import pyplot\n", "%matplotlib inline\n", "x=numpy.array([10., 30., 50., 70., 90.])\n", "y=numpy.array([20., 52.1, 84.6, 118.3, 151.0])\n", "\n", "#Calculations and printing :\n", "#this program uses least squares fit to solve for slope and intercept.\n", "#hence the value differs from textbook a bit.\n", "sx=sum(x)\n", "sx2=sum(x*x)\n", "sy=sum(y)\n", "D=numpy.transpose(y)\n", "sxy=sum(x*D)\n", "n=len(x)\n", "A=([[sx,n],[sx2,sx]])\n", "B=([[sy],[sxy]])\n", "p=numpy.dot(linalg.inv(A),B)\n", "m=p[0,0]\n", "b=p[1,0]\n", "yf=m*x+b\n", "pyplot.plot(x,yf)\n", "pyplot.xlim(min(x)-1,max(x)+1)\n", "pyplot.ylim(min(yf)-1,max(yf)+1)\n", "pyplot.xlabel('R')\n", "pyplot.ylabel('V')\n", "pyplot.show()\n", "print(\"in case 2, R=36\")\n", "R=36\n", "V=m*R+b\n", "print '%s %.3f' %(\"then V (L/min) =\",V),\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Populating the interactive namespace from numpy and matplotlib\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEKCAYAAADw2zkCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtU1XW+//EnmP1q1pzjDZUUTAdHE9kgmo5W5lYjEnN1\nSgs1HVMzs9EyWzatqVmAjnWWnpbZWC3LMVM8YbOixhHE+yYvoYyiYK6xNJkDlIp4Tbxw+fz++I5M\nTpaIe+/vd7Nfj7VY4Vc3vLrtN6/v5fMJMcYYREQkqIXaHUBEROynYSAiIhoGIiKiYSAiImgYiIgI\nGgYiIgLcZHeA6+F2u8nNzbU7hohIQBkwYAAej+cn/0xANYPc3FyMMVd8pKSk/OCYkz6cnk8ZldFp\nH07P6OR827cbunQx9Ot3Zcb6/BAdUM1ARER+6MIFSEmBZctg4UIoKrr+rxFQzUBERK6Unw89e8Kh\nQ7B3Lwwf3rCvE/DNwO122x3hJzk9Hyijtyijdzg9o1PyXbwIs2fDe+/BggWQnAwhIdbvNSRjiDEm\nYNYmCgkJIYDiioj4REEBjBsHnTrBokUQHv7Tf74+7506TSQiEiCqqiAtDRITYeZM+PTTaw+C+gr4\n00QiIsGgsBCeeAJuu81qBu3be/frqxmIiDhYdTXMmQODB8O0abB6tfcHAagZiIg41v791rWBFi1g\n1y7o0MF330vNQETEYWpqYN48GDAAJk2CtWt9OwhAzUBExFEOHLCuDdx6q/UMQceO/vm+agYiIg5Q\nWwvz58Pdd8Pjj8OGDf4bBKBmICJiu4MHYcIEMAby8qBzZ/9nUDMQEbFJba21llDfvvDII5Cba88g\nAB8OgwkTJtC2bVtcLtcPfu/1118nNDSUEydO1B177bXXiI6Ox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58uWPyAVRWVlJZ\nWQnAuXPnyMnJoXv37o7KGBkZSVhYGF9++SUAGzZsoFu3bgwZMsQxGS/78MMP604RgbP+f+ncuTN5\neXmcP38eYwwbNmwgKirKURkvv+kfOXKElStXkpyc3LB8vrms4X0jR440t912m2natKmJiIgwS5Ys\nqdcSFv50I0tt+EthYaHp0aOHiYuLM127djVpaWnGGOOojJd5PJ66u4mclO/rr782sbGxJi4uzvzy\nl780v//97x2X0Rhj9uzZY+68804THR1thgwZYk6cOOG4jN99951p1aqVOXPmTN0xp2VMSUkxnTt3\nNl26dDHJycnm/Pnzjsp4zz33mNjYWNOrVy+zadMmY0zD/hlqOQoREQns00QiIuIdGgYiIqJhICIi\nGgYiIoKGgYiIoGEgIiJoGIjckCZNmhAfH88dd9zB0KFDOX36tN2RRBpEw0DkBvzsZz+joKCAv//9\n77Ru3Zq3337b7kgiDaJhIOIl/fr14x//+IfdMUQaRMNAxAtqampYt24dsbGxdkcRaRAtRyFyA266\n6SZcLhdlZWV07NiRvLy8K/ZhEAkU+q9W5AbceuutFBQU8I9//IOf/exn/OUvf7E7kkiDqBmI3ID/\n+I//qFsSfM+ePYwePZovvviiwRuMiNhFzUDkBnz/Tb9Hjx507tyZjz76yMZEIg2jZiAiImoGIiKi\nYSAiImgYiIgIGgYiIoKGgYiIoGEgIiJoGIiICBoGIiIC/H8YvhS2TSiF/wAAAABJRU5ErkJggg==\n", "text": [ "" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "in case 2, R=36\n", "then V (L/min) = 62.226\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.7-2, page no. 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initialization of variables\n", "import math\n", "import numpy\n", "from numpy import linalg\n", "from matplotlib import pyplot\n", "%matplotlib inline\n", "\n", "T=[10., 20., 40., 80.]\n", "M=[14.76, 20.14, 27.73, 38.47]\n", "sqrtT=numpy.sqrt(T)\n", "\n", "\n", "#Calculations and printing :\n", "sx=sum(sqrtT)\n", "sx2=sum(T)\n", "sy=sum(M)\n", "D=numpy.transpose(M)\n", "sxy=sum(sqrtT*D)\n", "n=len(T)\n", "A=([[sx,n],[sx2,sx]]) \n", "B=([[sy],[sxy]])\n", "p=numpy.dot(linalg.inv(A),B)\n", "a=p[0,0]\n", "b=p[1,0]\n", "yf=a*sqrtT+b\n", "x=sqrtT\n", "pyplot.plot(x,yf)\n", "pyplot.xlim(min(x)-1,max(x)+1)\n", "pyplot.ylim(min(yf)-1,max(yf)+1)\n", "pyplot.xlabel('sqrtT')\n", "pyplot.ylabel('M')\n", "pyplot.show()\n", "print '%s %.3f' %(\"slope (g/s*K^.5) =\",a)\n", "print '%s %.3f' %(\"\\n intercept (g/s) =\",b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHy9JREFUeJzt3XlY1mW+x/H345aWWyBiqalTYS6Qj5NLrg8dzTljmhbh\nTp2ypr2wvabEsbRjmUvZYtpqapqmuVGaAi6gZpnWTOqYmkshSOYCiMDv/HE3nCxARR7uZ/m8rotr\nFI0+XU6fbr6/+3ffLsdxHEREJKBVsh1ARES8T2UvIhIEVPYiIkFAZS8iEgRU9iIiQUBlLyISBKrY\nDlAcj8dDcnKy7RgiIn6le/fuJCUlFftrPrmyT05OxnEcn/oYOXKk9QzKqqzKqqylfZS2SPbJshcR\nkfKlshcRCQIq+zPk8XhsRzhjyuodyuodyloxXI7j+NzZOC6XCx+MJSLi00rrTq3sRUSCgMpeRKQE\nJ0/Ct9/aTlE+VPYiIsXIyoK//AXGjrWdpHyo7EVEfudf/4L27aFtW3j3XdtpyodPvkErImLLsmVw\n883wwgvm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ieffNJyShFD++xFyqCgoID333+fTZs28fLLL5/ya82aNWPTpk2EhIRYSifyR3qDVoLa\nkSNHGDhwIPv376ewsJC///3vVK9enYcffpiQkBA6dOjArl27WLRoEQkJCezcuZO9e/dy8cUXs3bt\nWnJyclizZg1PPPEEsbGxtv9xREqkspeglpiYSNOmTVm6dCkAR48eJSIigtTUVJo2bcrgwYNPOXri\nu+++IzU1lSpVqvDuu++yadMmn74NSuQ/NLOXoOZ2u/n00095/PHHSUlJ4V//+hcRERE0bdoUgEGD\nBhUdGe1yuejbty9Vqpg1kuM4fnGctAio7CXIXX755WzatInIyEhGjhxJYmLiKb/++zI///zzi37s\ny4fNifyexjgS1H766SdCQkIYMmQIderUYeLEiezYsYM9e/bQpEkTPvzww6JS/33x16hRw6cvyRb5\nLa3sJaht2bKFq666irZt2zJ69GjGjBnD66+/To8ePejQoQNhYWGnjHF+u5qPjo5m06ZNXHnllcyZ\nM6fo81rxiy/S1kuRUiQnJ/Piiy/65QXTIr+llb3IaWilLoFAK3sRkSCglb2ISBBQ2YuIBAGVvYhI\nEFDZi4gEAZW9iEgQUNmLiASB/wN8FSViNpJblAAAAABJRU5ErkJggg==\n", "text": [ "" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "slope (g/s*K^.5) = 4.100\n", "\n", " intercept (g/s) = 1.798\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.7-3, page no. 29" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#Initilization of variables\n", "#Units are not mentioned in this example\n", "import math\n", "t1=15.\n", "t2=30.\n", "F1=0.298\n", "F2=0.0527\n", "#Calculations and printing:\n", "print(\"Semi-log plot\")\n", "b1=(math.log(F2/F1))/(t2-t1)\n", "a1=math.exp(math.log(F1) -b1*t1)\n", "print '%s %.3f %s %.4f %s' %(\" \\n F=\",a1,\"exp(\",b1,\"t)\")\n", "print(\"\\n Log plot\")\n", "b2=(math.log(F2/F1))/(math.log(t2/t1))\n", "a2=math.exp(math.log(F1) -b2*math.log(t1))\n", "print '%s %.1f %s %.1f %s' %(\" \\n F=\",a2,\"exp(\",b2,\"t)\")\n", "raw_input(\"Press the Enter key to quit\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Semi-log plot\n", " \n", " F= 1.685 exp( -0.1155 t)\n", "\n", " Log plot\n", " \n", " F= 259.3 exp( -2.5 t)\n" ] }, { "name": "stdout", "output_type": "stream", "stream": "stdout", "text": [ "Press the Enter key to quit\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 15, "text": [ "''" ] } ], "prompt_number": 15 } ], "metadata": {} } ] }