{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 1: HydroStatistics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.10: example_10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "clc\n", "//initialisation of variables\n", "clear\n", "P= 180 //ln/in^2\n", "r= 53\n", "T= 60 //F\n", "w= 62.4 //lb/ft^3\n", "h= 12 //in\n", "//CALCULATIONS\n", "R= P*144/(r*(460+T))\n", "dP= 12*(1-(R/w))\n", "Pab= dP/(12*2.309)\n", "//RESULTS\n", "printf ('Difference in water level = %.2f in of water ',dP)\n", "printf('\n Pressure difference = %.3f lb/in^2',Pab)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.2: example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear\n", "clc\n", "//initialisation of variables\n", "w= 62.4 //lb/ft^3\n", "A= 18 //ft^2\n", "x= 6 //ft\n", "kg= 6\n", "y= 2 //ft\n", "y1= 5 //ft\n", "//CALCULATIONS\n", "F= w*A*x\n", "F1= F/2\n", "Ft= (F*y-F1*(y1/2))/y1\n", "Fb= F1-Ft\n", "//RESULTS\n", "printf ('Force exerted on the bolt = %.f lb',F1)\n", "printf ('\n Force exerted on the hinge = %.f lb',Ft)\n", "printf ('\n Force exerted on the bolt = %.f lb',Fb)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3: example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear\n", "clc\n", "//initialisation of variables\n", "h1= 11.54 //ft\n", "h2= 16.33 //ft\n", "w= 62.4 //lb/ft^3\n", "x1= 7.69 //ft\n", "x2= 14.09 //ft\n", "x3= 18.23 //ft\n", "//CALCULATIONS\n", "Ft= w*h1^2/2\n", "//RESULTS\n", "printf ('h1 = %.2f ft',h1)\n", "printf ('\n h2 = %.2f ft',h2)\n", "printf ('\n h1+ = %.2f ft',x1)\n", "printf ('\n h2+ = %.2f ft',x2)\n", "printf ('\n h3+ = %.2f ft',x3)\n", "printf ('\n Thrust force = %.f lb/ft run',Ft)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.4: example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "\n", "clc\n", "//initialisation of variables\n", "clear\n", "spo= 0.9\n", "h= 3 //ft\n", "d= 2 //ft\n", "w= 62.4 //lb/ft^3\n", "H= 0.71 //ft\n", "//CALCULATIONS\n", "do= spo*w\n", "de= w*d\n", "bc= do*h\n", "Pt= (bc*(h/2)+bc*d+de*(d/2))*(h+d)\n", "y= (bc*(h/2)+bc*d+de*(d/2)*(d/3))*(h+d)/Pt+H\n", "//RESULTS\n", "printf('Total pressure = %d lb',Pt)\n", "printf ('\n position of centre of ressure above the base = %.2f ft position of centre of pressure above the axis ',y)\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5: example_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "clc\n", "//initialisation of variables\n", "clear\n", "a= 30 //degrees\n", "b= 30 //degrees\n", "h= 20 //ft\n", "h1= 10 //ft\n", "h2= 15 //ft\n", "h3= 16 //ft\n", "w= 62.4 //lb/ft^3\n", "h4= 10/3 //ft\n", "//CALCULATIONS\n", "Rt= (1/h3)*((w*(h*h2^2*(h2/3)/(2*sqrt(3))))-(w*(h*h1^2*h4/(2*sqrt(3)))))\n", "R= ((w*(h*h2^2/(2*sqrt(3))))-(w*(h*h1^2/(2*sqrt(3)))))\n", "Rb= R-Rt\n", "//RESULTS\n", "printf ('Force at the hinge = %.f lb ',Rt)\n", "printf ('\n Force at the hinge = %.f lb ',Rb)\n", "\n", "//Round off error in textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.6: example_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "\n", "clc\n", "//initialisation of variables\n", "clear\n", "x= 32 //ft\n", "h= 60 //ft\n", "w= 62.4 //lb/ft^3\n", "AE= 20 //ft\n", "//CALCULATIONS\n", "Vabc= 2*x*h/3\n", "vc= Vabc*w\n", "Tab= w*h^2/2\n", "Rt= sqrt(vc^2+Tab^2)/2240\n", "A= atand(vc/Tab)\n", "AD= x-AE+AE*cotd(A)\n", "//RESULTS\n", "printf('resultant thrust = %.1f tons',Rt)\n", "printf('\n Angle = %.2f degrees',A)\n", "printf ('\n AD = %.1f ft ',AD)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.7: example_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "\n", "clc\n", "//initialisation of variables\n", "clear\n", "wdc= 3*sqrt(3) //ft\n", "wdo= sqrt(3)\n", "ac= 30 //degrees\n", "ao= 60 //degrees\n", "hob= 3 //ft\n", "haf= 2.6 //ft\n", "hfc= 3 //ft\n", "w= 62.4 //lb/ft^3\n", "V= 5.63 //ft^3\n", "h= 4.3 //ft\n", "y= 3.6 //ft\n", "//CALCULATIONS\n", "W1= wdc*hfc*w/2\n", "Hbc= w*hob*(hob/2)\n", "W2= V*w\n", "W3= w*haf*h\n", "Vt= W1+W2\n", "Vht= Hbc+W3\n", "Rt= sqrt(Vt^2+Vht^2)\n", "A= atand(Vht/Vt)\n", "x= (W1*(wdo-(hob/2))+Hbc*y)/Rt\n", "OP= x/sind(A)\n", "AP= hob+OP\n", "//RESULTS\n", "printf('Resultant thrust = %d lb',Rt)\n", "printf('\n Angle = %.2f degrees ',A)\n", "printf ('\n Distance from A till horizontal thrust = %.3f ft ',AP)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.8: example_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "clc\n", "//initialisation of variables\n", "clear\n", "r= 96\n", "T= 10.5 //C\n", "K1= 288 //C\n", "K2= 0.0015 //C^-1\n", "h= 3000 //ft\n", "P1= 14.69\n", "//CALCULATIONS\n", "P2= P1*10^(((1/(r*K2))*log10((K1-K2*h)/K1)))\n", "w= P2*144/(r*(273+T))\n", "//RESULTS\n", "printf ('Density = %.4f lb/ft^3 ',w)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.9: example_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\n", "clc\n", "//initialisation of variables\n", "clear\n", "Hb= 20 //in\n", "Ha= 1 //in\n", "a= 20 //degrees\n", "//CALCULATIONS\n", "hb= Hb*sind(a)\n", "dh= hb+Ha\n", "dP= dh/(12*2.309)\n", "//RESULTS\n", "printf ('Pressure difference between tapping points = %.3f lb/in^2 ',dP)" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }