{ "metadata": { "name": "", "signature": "sha256:fae9d4c3d571f5f27d1259174500abbced27ed669ce1d759f1518557eb996672" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 2 : Fluid Statics" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.1 Page No : 32" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "# variables\t\t\n", "T = 68;\t\t#degreeF\n", "p = 10;\t\t# psi\n", "d = 15;\t\t# feet\n", "rho = 1.59;\t\t#specific gravity\n", "\n", "# calculations \n", "gam = rho*62.4;\t\t#lb/cuft\n", "p1 = gam*d + p*144;\t\t#psf\n", "\n", "# results \n", "print 'p1 = %d psf = %.1f psi '%(p1,p1*0.00694);\n", "\n", "#incorrect answer given in the textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p1 = 2928 psf = 20.3 psi \n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.2 Page No : 32" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# variables\t\t\n", "h = 35000;\t\t# feet\n", "p1 = 14.7;\t\t# psia\n", "T1 = 519;\t\t# degreeR\n", "gam1 = 0.0765;\t\t# lb/cuft\n", "p2 = 504;\t\t# psfa\n", "\n", "# calculations \n", "T2 = T1 - h*0.00356;\t\t# degreeR\n", "gam2 = p2/(53.3*T2);\t\t# lb/cuft\n", "\n", "# results \n", "print 'p2 = %d psfa = %.2f psia \\nspecific weight = %.3f lb/cuft'%(p2,p2*0.00695,gam2);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p2 = 504 psfa = 3.50 psia \n", "specific weight = 0.024 lb/cuft\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.3 Page No : 35" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\t\t\n", "# variables\n", "h1 = 12.5;\t\t# inches\n", "p1 = 14.50;\t\t# psia\n", "\n", "# calculations \n", "p = p1 - h1*(14.70/29.92);\t\t#absolute pressure in psia\n", "\n", "# results \n", "print 'Absolute pressure = %.2f psia'%(p);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Absolute pressure = 8.36 psia\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.4 Page No : 37" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# variables\t\t\n", "gam1 = 0.9*62.4;\n", "gam2 = 13.55*62.4;\n", "l1 = 10;\t\t# feet\n", "l2 = 15./12;\t\t# feet\n", "\n", "# calculations \n", "p_x = gam2*l2 - gam1*l1;\t\t# psf\n", "\n", "# results \n", "print 'The gauge reading = %d psf = %.2f psi'%(p_x,0.00694*p_x);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The gauge reading = 495 psf = 3.44 psi\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.5 Page No : 42" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "from scipy.integrate import quad \n", "\t\t\n", "# variables \n", "l1 = 4.;\t\t# feet\n", "b1 = 6.;\t\t# feet\n", "b2 = 6.;\t\t# feet\n", "l2 = 2.55;\t\t# feet\n", "t = 1.; \t\t# feet\n", "\n", "# calculations \n", "F1 = 0.5*l1*b1*62.4*(0.5*l1 + t) ;\t\t# lb\n", "F2 = 0.25*math.pi*b2**2 *62.4*(l2 + t);\t\t# lb\n", "a1 = l1*b2**3 /(36*0.5*b2*0.5*l1*b1);\t\t# feet\n", "a2 = 70/((0.5*l2 + t)*28.3);\t\t# feet\n", "l_p = (F1*(0.5*l1 + a1)+F2*(l2+a2))/(F1+F2) +1;\t\t#feet\n", "x_p1 = (0.5*l1-a1) - a1*2/b2;\t\t# feet\n", "\n", "def f2(y): \n", "\t return (62.4/2)*(36-y**2)*(y+1)\n", "\n", "M = quad(f2,0,6)[0]\n", "\n", "x_p2 = M/F2;\t\t# feet\n", "x_p = (x_p2*F2 - F1*x_p1)/(F1+F2);\t\t# feet\n", "\n", "# results \n", "print 'Total force on composite area is %d lb'%(F1+F2); \n", "print ' Vertical location of resultant force is %.2f ft below the water surface'%(l_p);\n", "print ' Horizontal location of resultant force is %.3f ft right of the water surface'%(x_p);\n", "\n", "#incorrect answer given in textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Total force on composite area is 8509 lb\n", " Vertical location of resultant force is 4.38 ft below the water surface\n", " Horizontal location of resultant force is 1.423 ft right of the water surface\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.6 Page No : 45" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "import numpy\n", "\t\t\n", "# variables\n", "l = 8.; \t\t#feet\n", "b = 10.;\t \t# feet\n", "\n", "# calculations \n", "F_h = 0.5*l*b*62.4*(b+2.5);\t\t# lb\n", "x = 83.2/(40*(b+2.5));\t\t# feet\n", "F_v = (b+5)*62.4*40-(l*62.4*(25 - 0.25*math.pi*25));\t\t# lb\n", "F = math.sqrt(F_h**2 + F_v**2);\t\t# lb\n", "e = (2680*3.91 + 37440*(0.25*b))/F_v ;\t\t# feet\n", "theta = 180*numpy.arctan(F_v/F_h) /math.pi;\t\t# degrees\n", "x_p = 0.25*b-x;\t\t# feet\n", "\n", "# results \n", "print 'Magnitude of resultant force is %d lb'%(F);\n", "print 'Theta = %d degrees'%(theta);\n", "print 'Location is %.3f feet above and %.2f feet to the right of B'%(x_p,e);\n", "\n", "#there are errors in the answer given in textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Magnitude of resultant force is 46709 lb\n", "Theta = 48 degrees\n", "Location is 2.334 feet above and 2.99 feet to the right of B\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.7 Page No : 48" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "# variables\n", "A = 4000.;\t\t# sq.ft\n", "d1 = 10.;\t\t# feet\n", "d2 = 2.;\t\t# inches\n", "rho = 64.;\t\t# lb/cuft\n", "\n", "# calculations \n", "W = A*(d2/12)*rho;\t\t# lb\n", "\n", "# results \n", "print 'Weight of cargo = %d lb'%(round(W,-2));\n", "\n", "\t\t" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Weight of cargo = 42700 lb\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.8 Page No : 49" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "# variables\n", "gam = 53.0;\t\t# lb/cuft\n", "D = 17.;\t\t# inches\n", "d = 12.;\t\t# inches\n", "\n", "# calculations \n", "V = (math.pi/6)*(D/d)**3;\n", "V1 = 0.584;\t\t#cuft\n", "V2 = 0.711;\t\t#cuft\n", "W = V*gam;\n", "F_B = V1*62.4;\n", "F_ACA = (V2)*62.4;\n", "F = W+F_ACA-F_B;\n", "\n", "# results \n", "print 'The force exerted between sphere and orfice plate = %.1f lb'%(F);\n", "\n", "#incorrect answer for W in textbook. Hence the answer differs" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The force exerted between sphere and orfice plate = 86.8 lb\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.9 Page No : 51" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "from scipy.integrate import quad \n", "\n", "# variables\n", "v = 15;\t\t# ft/sec**2\n", "d = 5;\t\t# ft\n", "\n", "# calculations \n", "def f3(z): \n", "\t return -62.4*(v+32.2)/32.2\n", "\n", "p = quad(f3,0,-5)[0]\n", "\n", "# results \n", "print 'p = %d psf'%(p);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p = 457 psf\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.10 Page No : 52" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "from scipy.integrate import quad \n", "\n", "# variables\n", "m = -0.229;\t\t#slope\n", "a_z = 1.96;\t\t# ft/sec**2\n", "a_x = 4*a_z;\t\t# ft/sec**2\n", "a = math.sqrt(a_x**2 + a_z**2);\t\t# ft/sec**2\n", "\n", "def f1(z): \n", "\t return -(32.2 + a_z)*(62.4/32.2)\n", "\n", "p = quad(f1,0,-2.75)[0]\n", "\n", "# results \n", "print 'p = %.1f psf'%(p);\n", "\n", "#there is an error in the answer given in textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p = 182.0 psf\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2.11 Page No : 54" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\t\t\n", "# variables\n", "l1 = 2.;\t\t# feet\n", "l2 = 3.;\t\t# feet\n", "rpm = 100;\n", "\n", "# calculations \n", "p_A = (l1+l2)-(2./3)*(2*math.pi*rpm/60)**2 /(2*32.2);\n", "p_B = (l1+l2)+(1./3)*(2*math.pi*rpm/60)**2 /(2*32.2);\n", "\n", "# results \n", "print 'Pressure heads at point A and point B ae %.2f ft and %.2ft ft respectively'%(p_A,p_B);" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Pressure heads at point A and point B ae 3.86 ft and 5.57t ft respectively\n" ] } ], "prompt_number": 9 } ], "metadata": {} } ] }