summaryrefslogtreecommitdiff
path: root/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb
diff options
context:
space:
mode:
authorhardythe12015-04-07 15:58:05 +0530
committerhardythe12015-04-07 15:58:05 +0530
commit92cca121f959c6616e3da431c1e2d23c4fa5e886 (patch)
tree205e68d0ce598ac5caca7de839a2934d746cce86 /Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb
parentb14c13fcc6bb6d01c468805d612acb353ec168ac (diff)
downloadPython-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.gz
Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.bz2
Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.zip
added books
Diffstat (limited to 'Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb')
-rwxr-xr-xThermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb239
1 files changed, 239 insertions, 0 deletions
diff --git a/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb b/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb
new file mode 100755
index 00000000..55805cb9
--- /dev/null
+++ b/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter03.ipynb
@@ -0,0 +1,239 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ff90ca36306843dda7b5d7f4afff0c2bcd17928b8d2090ef8ae2b28da2c7c555"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Importance of State Functions: Internal Energy and Enthalpy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 3.2, Page Number 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log`\n",
+ "#Variable Declaration\n",
+ "betaOH = 11.2e-4 #Thermal exapnasion coefficient of ethanol, \u00b0C\n",
+ "betagl = 2.00e-5 #Thermal exapnasion coefficient of glass, \u00b0C\n",
+ "kOH = 11.0e-5 #Isothermal compressibility of ethanol, /bar\n",
+ "dT = 10.0 #Increase in Temperature, \u00b0C\n",
+ "\n",
+ "#Calcualtions\n",
+ "vfbyvi = (1+ betagl*dT)\n",
+ "dP = betaOH*dT/kOH-(1./kOH)*log(vfbyvi)\n",
+ "\n",
+ "#Results\n",
+ "print 'Pressure increase in capillary %4.1f bar'%dP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure increase in capillary 100.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 3.4, Page Number 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "cpsubysy = 1000 #Specific heat ration of surrounding and system\n",
+ "Tpreci = 0.006 #Precision in Temperature measurement, \u00b0C\n",
+ "\n",
+ "#Calcualtions\n",
+ "dtgas = -cpsubysy*(-Tpreci)\n",
+ "\n",
+ "#Results\n",
+ "print 'Minimum detectable temperature change of gas +-%4.1f \u00b0C'%dtgas"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum detectable temperature change of gas +- 6.0 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 3.6, Page Number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "n = 1.0 #number of mole of N2, mol \n",
+ "Ti = 200.0 #Intial Temperature, K\n",
+ "Pi = 5.00 #Initial pressure, bar\n",
+ "Tf = 400.0 #Intial Temperature, K\n",
+ "Pf = 20.0 #Initial pressure, bar\n",
+ "a = 0.137 #van der Waals constant a, Pa.m3/(mol2)\n",
+ "b = 3.87e-5 #van der Waals constant b, m3/(mol)\n",
+ "A, B, C, D = 22.5, -1.187e-2,2.3968e-5, -1.0176e-8\n",
+ " #Constants in Cvm equation J, K and mol\n",
+ "vi = 3.28e-3 #initial volume, m3/mol\n",
+ "vf = 7.88e-3 #Final volume, m3/mol\n",
+ "\n",
+ "#Calculations\n",
+ "T = symbols('T')\n",
+ "dUT = n**2*a*(1./vi-1./vf)\n",
+ "dUV = integrate( A + B*T + C*T**2 + D*T**3, (T,Ti,Tf))\n",
+ "\n",
+ "#Results\n",
+ "print 'dUT = %4.1f J: This is wrongly reported in book'%dUT\n",
+ "print 'dUV = %4.1f J'%dUV"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dUT = 24.4 J: This is wrongly reported in book\n",
+ "dUV = 4174.1 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 3.7, Page Number 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import *\n",
+ "\n",
+ "#Variable Declaration\n",
+ "m = 143.0 #Mass of graphite, g \n",
+ "Ti = 300.0 #Intial Temperature, K\n",
+ "Tf = 600.0 #Intial Temperature, K\n",
+ "A, B, C, D, E = -12.19,0.1126,-1.947e-4,1.919e-7,-7.8e-11\n",
+ " #Constants in Cvm equation J, K and mol\n",
+ "M = 12.01\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "T = symbols('T')\n",
+ "dH = (m/M)*integrate( A + B*T + C*T**2 + D*T**3 + E*T**4, (T,Ti,Tf))\n",
+ "expr = A + B*T + C*T**2 + D*T**3 + E*T**4\n",
+ "cpm = expr.subs(T,300.)\n",
+ "qp = (m/M)*cpm*(Tf-Ti)\n",
+ "err = abs(dH-qp)/dH\n",
+ "#Results\n",
+ "print 'dH = %6.1f kJ'%(dH/1000)\n",
+ "print 'qp = %6.1f kJ'%(qp/1000)\n",
+ "print 'Error in calculations %4.1f'%(err*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dH = 46.8 kJ\n",
+ "qp = 30.8 kJ\n",
+ "Error in calculations 34.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 3.9, Page Number 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "m = 124.0 #Mass of liquid methanol, g\n",
+ "Pi = 1.0 #Initial Pressure, bar\n",
+ "Ti = 298.0 #Intial Temperature, K\n",
+ "Pf = 2.5 #Final Pressure, bar\n",
+ "Tf = 425.0 #Intial Temperature, K\n",
+ "rho = 0.791 #Density, g/cc\n",
+ "Cpm = 81.1 #Specifi heat, J/(K.mol)\n",
+ "M = 32.04\n",
+ "\n",
+ "#Calculations\n",
+ "n = m/M\n",
+ "DH = n*Cpm*(Tf-Ti)+ m*(Pf-Pi)*1e-6/rho\n",
+ "\n",
+ "#Results\n",
+ "print 'Enthalpy change for change in state of methanol is %4.1f kJ'%(DH/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enthalpy change for change in state of methanol is 39.9 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file