summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_J._P._Holman/ch1.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-11 17:31:11 +0530
committerhardythe12015-06-11 17:31:11 +0530
commit79c59acc7af08ede23167b8455de4b716f77601f (patch)
tree2d6ff34b6f131d2671e4c6b798f210b3cb1d4ac7 /Thermodynamics_by_J._P._Holman/ch1.ipynb
parentdf60071cf1d1c18822d34f943ab8f412a8946b69 (diff)
downloadPython-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.gz
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.bz2
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.zip
add books
Diffstat (limited to 'Thermodynamics_by_J._P._Holman/ch1.ipynb')
-rwxr-xr-xThermodynamics_by_J._P._Holman/ch1.ipynb157
1 files changed, 157 insertions, 0 deletions
diff --git a/Thermodynamics_by_J._P._Holman/ch1.ipynb b/Thermodynamics_by_J._P._Holman/ch1.ipynb
new file mode 100755
index 00000000..ab6704bd
--- /dev/null
+++ b/Thermodynamics_by_J._P._Holman/ch1.ipynb
@@ -0,0 +1,157 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8c130f65381c568b421044f85ca49022c02733507c1f974f96d3542659c93a58"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 : Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 pg : 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "import math \n",
+ "d = 8. \t\t\t#in\n",
+ "ir = 16. \t\t\t#in\n",
+ "MW = 28.97\n",
+ "T = 70.+460 \t\t\t#R\n",
+ "P = 30+14.7 \t\t\t#psia\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "V = math.pi**2 *d**2 *(d+ir)/4\n",
+ "V = V*10./12**3\n",
+ "Rair = 1545/MW\n",
+ "m = P*144*V/(Rair*T)\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Mass of air = %.2f lbm\"%(m)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of air = 4.99 lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2 pg : 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "V = 4. \t\t\t#in**3\n",
+ "P = 30. \t\t\t#psia\n",
+ "T = 500.\t\t\t#R\n",
+ "MW = 32.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "print (\"Metric unit conversion,\")\n",
+ "V = V*2.54**3 *10**-3\n",
+ "P = 30*4.448/(2.54**2 *10**-4)\n",
+ "T = 5*(T-32)/9 +273\n",
+ "n = P*V/(8314.5*T)\n",
+ "eta = n*1000\n",
+ "N = eta*6.025*10**23\n",
+ "m = eta*MW\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"No. of molecules of oxygen = %.3e molecules\"%(N)\n",
+ "print \" Mass of molecules = %.1f g\"%(m)\n",
+ "\n",
+ "#The answer in the textbook is a bit different due to rounding off error\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Metric unit conversion,\n",
+ "No. of molecules of oxygen = 1.843e+24 molecules\n",
+ " Mass of molecules = 97.9 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3 pg : 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "import math \n",
+ "P = 14.7 \t\t\t#psia\n",
+ "T = 70.+460 \t\t\t#R\n",
+ "M = 32.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "Ro = 1545/M\n",
+ "V2 = 3*Ro*T\n",
+ "V2 = V2*32.174\n",
+ "vrms = math.sqrt(V2)\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"rms velocity = %d ft/sec\"%(vrms)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rms velocity = 1571 ft/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file