diff options
author | hardythe1 | 2015-06-17 11:14:34 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-17 11:14:34 +0530 |
commit | afcd9e5397e3e1bde0392811d0482d76aac391dc (patch) | |
tree | 228eab879488f9e1fb3250347e225c2ceee6f6a3 /sample_notebooks/kumargugloth/Chapter1.ipynb | |
parent | 251a07c4cbed1a5a960f5ed416ce6ac13c8152b7 (diff) | |
download | Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.tar.gz Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.tar.bz2 Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.zip |
add books
Diffstat (limited to 'sample_notebooks/kumargugloth/Chapter1.ipynb')
-rwxr-xr-x | sample_notebooks/kumargugloth/Chapter1.ipynb | 348 |
1 files changed, 348 insertions, 0 deletions
diff --git a/sample_notebooks/kumargugloth/Chapter1.ipynb b/sample_notebooks/kumargugloth/Chapter1.ipynb new file mode 100755 index 00000000..df9ba4d0 --- /dev/null +++ b/sample_notebooks/kumargugloth/Chapter1.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:84e452258bd05b64c16351467c4970051f4494cb47d7a832df03bdce07abddb8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ " #determine\n",
+ "##This numerical is Ex 1_1E,page 9.\n",
+ "Pso=20.5\n",
+ "Psc=20.5*550##converting hp to fps system\n",
+ "Qo=385.\n",
+ "Qc=385./449.##converting gpm to ft^3/s\n",
+ "E=0.83\n",
+ "dp=E*Psc/(Qc*144.)\n",
+ "print\"%s %.2f %s \"%('The pressure rise is ',dp,' psi')\n",
+ "print(\"After rounding off,pressure rise is 75.8 psi\")\n",
+ "dpr=75.8\n",
+ "dHw=75.8*144/62.4##62.4 is accelaration due to gravity in fps system\n",
+ "print\"%s %.2f %s \"%(' The head of water is ',dHw,' ft of water')\n",
+ "print(\"After rounding off the value of head of water the answer is 175 ft of water.\")\n",
+ "dhwr=175##rounded off value of head of water\n",
+ "sg=0.72##specific gravity of oil\n",
+ "dHo=dhwr/sg\n",
+ "print\"%s %.2f %s \"%(' The head of oil is ',dHo,' ft of oil')\n",
+ "print(\"After rounding off the value of head of oil the answer is 243 ft of oil.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure rise is 75.79 psi \n",
+ "After rounding off,pressure rise is 75.8 psi\n",
+ " The head of water is 174.92 ft of water \n",
+ "After rounding off the value of head of water the answer is 175 ft of water.\n",
+ " The head of oil is 243.06 ft of oil \n",
+ "After rounding off the value of head of oil the answer is 243 ft of oil.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "#determine\n",
+ "##This numerical is Ex 1_1S,page 10.\n",
+ "E=0.83##efficiency\n",
+ "Ps=15300.\n",
+ "Q=87.4\n",
+ "Qs=87.4/3600.##flow rate in meter cube per sec\n",
+ "rho=998.\n",
+ "g=9.81\n",
+ "sg=0.72\n",
+ "dp=E*Ps/Qs\n",
+ "print\"%s %.2f %s \"%('\\n The change in pressure (dp)is ',dp,'')\n",
+ "dpr=523000##rounded value of dp\n",
+ "print(\"The rounded off value of dp is 523kPa.\")\n",
+ "dHw=dpr/(rho*g)\n",
+ "print\"%s %.2f %s \"%(' dHw is equal to ',dHw,' m of water')\n",
+ "print(\"The rounded off value of dHw is 53.4 m of water.\")\n",
+ "dHwr=53.4##rounded off value of dHw\n",
+ "print(\"Thus we can determine head of oil.\")\n",
+ "dHoil=dHwr/sg\n",
+ "print\"%s %.2f %s \"%(' dHoil is given by ',dHoil,' m of oil')\n",
+ "print(\"The rounded off value of dHoil is 74.2 m of oil.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " The change in pressure (dp)is 523070.94 \n",
+ "The rounded off value of dp is 523kPa.\n",
+ " dHw is equal to 53.42 m of water \n",
+ "The rounded off value of dHw is 53.4 m of water.\n",
+ "Thus we can determine head of oil.\n",
+ " dHoil is given by 74.17 m of oil \n",
+ "The rounded off value of dHoil is 74.2 m of oil.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine\n",
+ "##This numerical is Ex 1_2E,page 10.\n",
+ "Q=12000.\n",
+ "A=3.5\n",
+ "rho_a=0.0762\n",
+ "E=0.85\n",
+ "r=2.5##resistance of duct system\n",
+ "V=Q/(60.*A)\n",
+ "print\"%s %.2f %s \"%('The air flow velocity at discharge is ',V,' ft/s')\n",
+ "KE=(rho_a*(V**2))/(32.2*2)\n",
+ "print\"%s %.2f %s \"%('\\n The product is ',KE,' lb/ft^2')\n",
+ "##PE=KE\n",
+ "Hv=KE/62.4\n",
+ "print\"%s %.2f %s \"%('\\n The dynamic head is ',Hv,' ft')\n",
+ "print(\"The value of dynamic head in inches of water is 0.74.\")\n",
+ "Hvi=0.74##Head in inches\n",
+ "Ht=r+Hvi\n",
+ "print\"%s %.2f %s \"%('\\n The total head is ',Ht,' inches of water')\n",
+ "p_tot=Ht*62.4\n",
+ "Ps=Q*p_tot/(60.*12.*E)\n",
+ "print\"%s %.2f %s \"%('\\n The shaft power is ',Ps,' ft-lb/s')\n",
+ "print(\"The shaft power is 7.2 hp.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The air flow velocity at discharge is 57.14 ft/s \n",
+ "\n",
+ " The product is 3.86 lb/ft^2 \n",
+ "\n",
+ " The dynamic head is 0.06 ft \n",
+ "The value of dynamic head in inches of water is 0.74.\n",
+ "\n",
+ " The total head is 3.24 inches of water \n",
+ "\n",
+ " The shaft power is 3964.24 ft-lb/s \n",
+ "The shaft power is 7.2 hp.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##This numerical is Ex 1_2S,page 11.\n",
+ "Q=340.\n",
+ "A=0.325\n",
+ "V=Q/(60.*A)\n",
+ "print\"%s %.2f %s \"%('The air flow velocity at discharge is ',V,' m/s')\n",
+ "rho_a=1.22\n",
+ "Vr=17.4\n",
+ "Hd=(rho_a*(Vr**2))/2.\n",
+ "print\"%s %.2f %s \"%('\\n The dynamic pressure head is ',Hd,' Pa')\n",
+ "Hdr=184.7##rounded off value of Hd\n",
+ "rho_w=998.##density of water=rhow\n",
+ "g=9.81\n",
+ "H=0.0635\n",
+ "dp=rho_w*g*H##static pressure head\n",
+ "print\"%s %.2f %s \"%('\\n The static pressure head is ',dp,' Pa')\n",
+ "dpr=621.7\n",
+ "p_tot=Hdr+dpr\n",
+ "print\"%s %.2f %s \"%('\\n The total pressure head is ',p_tot,' Pa')\n",
+ "p_tot=806.4\n",
+ "E=0.85##efficiency\n",
+ "Ps=Q*p_tot/(60*E)\n",
+ "print\"%s %.2f %s \"%('\\n The shaft power is',Ps, 'W')\n",
+ "print(\"The shaft power is 5.376 kW.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The air flow velocity at discharge is 17.44 m/s \n",
+ "\n",
+ " The dynamic pressure head is 184.68 Pa \n",
+ "\n",
+ " The static pressure head is 621.69 Pa \n",
+ "\n",
+ " The total pressure head is 806.40 Pa \n",
+ "\n",
+ " The shaft power is 5376.00 W \n",
+ "The shaft power is 5.376 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine \n",
+ "import math\n",
+ "##This numerical is Ex 1_3E,page 11.\n",
+ "H=295.##net head in ft\n",
+ "Q=148.##water flow rate\n",
+ "n=1800.##rpm\n",
+ "E=0.87##efficiency\n",
+ "a=62.4##product of density and accelaration due to gravity\n",
+ "omega=(n*2.*math.pi)/60.\n",
+ "dp=a*H\n",
+ "print\"%s %.2f %s \"%('The pressure is ',dp,' lb/ft^2')\n",
+ "Ps=E*Q*dp\n",
+ "print\"%s %.2f %s \"%('\\n Output power is equal to ',Ps,' lb-ft/s')\n",
+ "print(\"The output output power can also be written as 2.37*10^6 lb-ft/s\")\n",
+ "print(\"Output power in terms of horsepower is given by 4309hp.\")\n",
+ "Psr=2370000##rounded off value of Ps\n",
+ "Torque=Psr/omega\n",
+ "print\"%s %.2f %s \"%(' The output torque is ',Torque,' lb-ft.')\n",
+ "print(\"The output torque can also be written as 12.57*10^3 lb-ft\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure is 18408.00 lb/ft^2 \n",
+ "\n",
+ " Output power is equal to 2370214.08 lb-ft/s \n",
+ "The output output power can also be written as 2.37*10^6 lb-ft/s\n",
+ "Output power in terms of horsepower is given by 4309hp.\n",
+ " The output torque is 12573.24 lb-ft. \n",
+ "The output torque can also be written as 12.57*10^3 lb-ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine c\n",
+ "import math\n",
+ "##This numerical is Ex 1_3S,page 12.\n",
+ "H=90.\n",
+ "Q=4.2##water flow rate(in m^3/s)\n",
+ "n=1800.\n",
+ "E=0.87##efficiency\n",
+ "rho=998.\n",
+ "g=9.81\n",
+ "omega=(n*2.*math.pi)/60.\n",
+ "dp=rho*g*H\n",
+ "print\"%s %.2f %s \"%('The pressure is ',dp,' N/m^2')\n",
+ "Ps=E*Q*dp\n",
+ "print\"%s %.2f %s \"%('\\n Output power is equal to ',Ps,' N-m/s')\n",
+ "print(\"After rounding off the value of output power is 3220 kW.\")\n",
+ "Psr=3220000.##rounded off value of Ps\n",
+ "Torque=Psr/omega\n",
+ "print\"%s %.2f %s \"%(' The output torque is ',Torque,' N-m.')\n",
+ "print(\"After rounding off the output torque comes out to be 17.1*10^3 N-m.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure is 881134.20 N/m^2 \n",
+ "\n",
+ " Output power is equal to 3219664.37 N-m/s \n",
+ "After rounding off the value of output power is 3220 kW.\n",
+ " The output torque is 17082.63 N-m. \n",
+ "After rounding off the output torque comes out to be 17.1*10^3 N-m.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |