{ "metadata": { "name": "", "signature": "sha256:f587ddef55b28db4a216d9527633644d2f15945b69280f84d70b5536f38a83a6" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter2- Fluid Statics\n" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex1-pg48" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "##calculate hieght above sea level to which ballon will rise\n", "d=1.5; ##m\n", "m=1.2; ## kg\n", "rate=0.0065; ## K/m\n", "R=287.; ## J/(kg.K)\n", "T_0=288.15; ## K\n", "p_0=101*10**3; ## Pa\n", "g=9.81; ## m/s^2\n", "\n", "rho=m/(math.pi*d**3/6);\n", "rho_0=p_0/R/T_0;\n", "\n", "## log(rho/rho_0)=(g/R*rate - 1)*log((T_0-rate*z)/T_0)\n", "\n", "z=1/rate*(T_0-T_0*math.exp(math.log(rho/rho_0)/(g/R/rate-1)));\n", "print'%s %.f %s'%(\"The height above sea level to which the ballon will rise =\",z,\"m\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The height above sea level to which the ballon will rise = 5708 m\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex2-pg64" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate total force and Distance of line of action of total force from top of cylinder\n", "d=2.; ## m\n", "a=1.; ## radius in m\n", "rho=880.; ## density of oil in kg/m^3\n", "g=9.81; ## m/s^2\n", "rho_w=1000.; ## density of water in kg/m^3\n", "\n", "C_0=4*a/3/math.pi; ## centroid of the upper semicircle\n", "h1=a-C_0; ## distance of the centroid from the top\n", "\n", "P1=rho*g*h1; ## Pressure of the oil at this point\n", "F1=P1*math.pi*a**2/2; ## Force exerted by the oil on the upper half of the wall\n", "\n", "cp1=a**4*(math.pi/8-8/(9*math.pi)); ## (AK^2)_C\n", "\n", "cp2=cp1/(math.pi*a**2/2*h1); ## Centre of Pressure below the centroid\n", "\n", "cp0=cp2+h1; ## Centre of Pressure below the top\n", "\n", "P_w=(rho*g*a)+(rho_w*g*C_0);\n", "F_w=P_w*math.pi*a**2/2;\n", "\n", "h2=C_0+rho/rho_w;\n", "cp2_w=cp1/(math.pi*a**2/2*h2);\n", "cp0_w=a+C_0+cp2_w; ## below the top of cylinder\n", "\n", "F_total=F1+F_w;\n", "\n", "## F1*cp0 + F_w*cp0_w = F_total*x\n", "\n", "x=(F1*cp0 + F_w*cp0_w)/F_total;\n", "\n", "print'%s %.1f %s'%(\"Total force =\",F_total,\"N\")\n", "print'%s %.3f %s'%(\"Distance of line of action of total force from top of cylinder =\",x,\"m\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Total force = 27905.5 N\n", "Distance of line of action of total force from top of cylinder = 1.260 m\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex3-pg67" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "rho=1000.; ## kg/m**3\n", "g=9.81; ## m/s**2\n", "r=4.; ## m\n", "h=2.; ## m\n", "l=5.; ## m\n", "theta=math.pi/6.;\n", "A=h*l;\n", "\n", "F_h=rho*g*h*A; ## Horizontal force\n", "\n", "C0=(2.**2./(12.*2.))+2.; ## distance of line of action below the free surface\n", "\n", "AB=4.-4.*math.cos(theta);\n", "\n", "F_v=rho*g*l*(AB*1.+math.pi*r**2.*theta/(2.*math.pi)-1./2.*h*r*math.cos(theta));\n", "BC=0.237; ## m\n", "\n", "F_net=math.sqrt(F_h**2.+F_v**2.);\n", "\n", "phi=math.atan(F_v/F_h);\n", "\n", "print'%s %.1f %s'%(\"Net force =\",F_net,\"N\")\n", "print'%s %.3f %s'%(\"Angle between net force and horizontal =\",phi,\"degrees\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Net force = 205712.4 N\n", "Angle between net force and horizontal = 0.305 degrees\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex4-76" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#GM and states that negative or positive give explanation\n", "m=10.; ## kg\n", "M=80.; ## kg\n", "H=1.5; ## m\n", "rho=1026.; ## kg/m**3\n", "g=9.81; ## m/s**2\n", "d=1.; ## m\n", "\n", "## m*H + M*H/2 =(M+m)(OG)\n", "\n", "OG=(m*H + M*H/2)/(M+m);\n", "\n", "## For vertical equilibrium, buoyancy = weight\n", "h=(M+m)/(rho*math.pi/4*d**2);\n", "\n", "BM=(math.pi*d**4./64.)/(math.pi*d**2.*h/4.);\n", "OB=h/2.;\n", "\n", "GM=OB+BM-OG;\n", "\n", "print'%s %.4f %s'%(\"GM =\",GM,\"m\")\n", "\n", "print(\"Since this is negative (i.e. M is below G) buoy is unstable.\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "GM = -0.2179 m\n", "Since this is negative (i.e. M is below G) buoy is unstable.\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex5-pg78" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate Least vertical downward force and Depth of immersion\n", "m=10.; ## kg\n", "M=80.; ## kg\n", "OG=0.8333; ## m\n", "rho=1026.; ## kg/m^3\n", "g=9.81; ## m/s^2\n", "d=1.; ## m\n", "W=(m+M)*g;\n", "\n", "## W(OG) = (W + F)(OB + BM) = rho*g*%pi/4*d^2*h1*(h1/2+d^2/(16*h1))\n", "\n", "h1=math.sqrt(2*(W*OG/(rho*g*math.pi/4.*d**2) - d**2/16.));\n", "\n", "F=rho*g*math.pi/4*d**2*h1 - W;\n", "\n", "print'%s %.f %s'%(\"Least vertical downward force =\",F,\"N\")\n", "print'%s %.3f %s'%(\"Depth of immersion =\",h1,\"m\")\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Least vertical downward force = 1072 N\n", "Depth of immersion = 0.247 m\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6-pg83" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate Volume left in the tank and Pressure at the lowest corners of the tank \n", "a=5.; ## m/s^2\n", "s=0.5; ## m\n", "phi=math.atan(1./4.); ## degrees\n", "g=9.81; ## m/s^2\n", "rho=880.; ## kg/m^3\n", "\n", "a_x=a*math.cos(phi); ## Horizontal component of acceleration\n", "a_z=a*math.sin(phi); ## Vertical component of acceleration\n", "\n", "theta=math.atan(a_x/(a_z+g)); ## b=tan(theta)\n", "\n", "d=(math.tan(phi)+math.tan(theta))/(1-math.tan(phi)*math.tan(theta));\n", "\n", "c=s*d;\n", "\n", "V=s*(s**2-s*c/2.);\n", "Z=V*1000.\n", "print'%s %.1f %s'%(\"Volume left in the tank =\",Z,\"L\")\n", "P=rho*g*s*math.cos(phi);\n", "print'%s %.f %s'%(\"Pressure at the lowest corners of the tank =\",P,\"Pa\")\n", "#apporxmatilty it is correct which is 4190 is given in text book" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Volume left in the tank = 76.5 L\n", "Pressure at the lowest corners of the tank = 4188 Pa\n" ] } ], "prompt_number": 21 } ], "metadata": {} } ] }