summaryrefslogtreecommitdiff
path: root/Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-03 15:27:17 +0530
committerhardythe12015-06-03 15:27:17 +0530
commit47d7279a724246ef7aa0f5359cf417992ed04449 (patch)
treec613e5e4813d846d24d67f46507a6a69d1a42d87 /Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb
parent435840cef00c596d9e608f9eb2d96f522ea8505a (diff)
downloadPython-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.tar.gz
Python-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.tar.bz2
Python-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.zip
add books
Diffstat (limited to 'Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb')
-rwxr-xr-xElements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb102
1 files changed, 102 insertions, 0 deletions
diff --git a/Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb
new file mode 100755
index 00000000..511042b0
--- /dev/null
+++ b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_2_1.ipynb
@@ -0,0 +1,102 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e3ffdae85ed1c10a54629e535e9e044264a512de563ad3fb48c98b93c4a65432"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Fundamental Concepts"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the potential energy\n",
+ "#Initialization of variables\n",
+ "z=100 #ft\n",
+ "m=32.1739 #lbm\n",
+ "#calculations\n",
+ "PE=m*z\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Potential energy =\",PE,\"ft-lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential energy = 3217.39 ft-lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the absolute energy of this mixture and the change in mass\n",
+ "#Initialization of variables\n",
+ "m0=18.016 #lbm\n",
+ "gc=32.1739 #lbm ft/lbf sec^2\n",
+ "c=186000*5280\n",
+ "dU=94.4*10**6 #ft-lbf\n",
+ "#calculations\n",
+ "U=m0/gc *c**2\n",
+ "dm= -dU*gc/c**2\n",
+ "#results\n",
+ "print '%s %.2e %s' %(\"Absolute energy of this mixture =\",U,\" ft-lbf\")\n",
+ "print '%s' %(\"\\n In case b, there is no change in mass\")\n",
+ "print '%s %.2e %s' %(\"\\n Change in mass =\",dm,\" lbm\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute energy of this mixture = 5.40e+17 ft-lbf\n",
+ "\n",
+ " In case b, there is no change in mass\n",
+ "\n",
+ " Change in mass = -3.15e-09 lbm\n",
+ "The answers are a bit different due to rounding off error in textbook.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file