diff options
author | hardythe1 | 2015-05-05 14:21:39 +0530 |
---|---|---|
committer | hardythe1 | 2015-05-05 14:21:39 +0530 |
commit | 435840cef00c596d9e608f9eb2d96f522ea8505a (patch) | |
tree | 4c783890c984c67022977ca98432e5e4bab30678 /Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb | |
parent | aa1863f344766ca7f7c20a395e58d0fb23c52130 (diff) | |
download | Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.tar.gz Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.tar.bz2 Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.zip |
add books
Diffstat (limited to 'Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb')
-rwxr-xr-x | Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb | 309 |
1 files changed, 0 insertions, 309 deletions
diff --git a/Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb b/Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb deleted file mode 100755 index c1d76b67..00000000 --- a/Thermodynamics:_From_concepts_to_applications/Chapter8.ipynb +++ /dev/null @@ -1,309 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:8780f29f2ca7dbbe28306b63f91de121a8fdfb0cc3c24c326256cd5a0309b1ed"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter8-Entropy"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example1 pg- 131"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate and entropy of ice and environment and universe\n",
- "##initialisation of variables\n",
- "m= 2 ##kg\n",
- "dh= 333.39 ##kg/h\n",
- "T= 0 ##C\n",
- "T1= 20 ##C\n",
- "##CALCULATIONS\n",
- "Q12= m*dh\n",
- "dS= Q12/(273.15+T)\n",
- "dSenvir= -Q12/(273.15+T1)\n",
- "dStotal= dS+dSenvir\n",
- "##RESULTS\n",
- "print'%s %.3f %s'%(' entropy of ice =',dS,'kJ/K')\n",
- "print'%s %.3f %s'%('entropy of environment =',dSenvir,'kJ/K')\n",
- "print'%s %.3f %s'%('entropy of universe =',dStotal,'kJ/K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " entropy of ice = 2.441 kJ/K\n",
- "entropy of environment = -2.275 kJ/K\n",
- "entropy of universe = 0.167 kJ/K\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example2-pg132"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#calculate change in entropy in system and environment and entropy\n",
- "##initialisation of variables\n",
- "Q= 666.78 ##kJ\n",
- "T= 0 ##C\n",
- "Th= 20. ##C\n",
- "##CALCULATIONS\n",
- "Ssys= Q/(273.15+T)\n",
- "Qh= Q*((273.15+Th)/(273.15+T))\n",
- "Senvir= -Qh/(273.15+Th)\n",
- "Stotal= Ssys+Senvir\n",
- "##RESULTS\n",
- "print'%s %.4f %s'%('change in entropy in sysytem =',Ssys,' kJ/K')\n",
- "print'%s %.4f %s'%('change in entropy in environment =',Senvir,'kJ/K')\n",
- "print'%s %.f %s'%('total change in entropy =',Stotal,'kJ/K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "change in entropy in sysytem = 2.4411 kJ/K\n",
- "change in entropy in environment = -2.4411 kJ/K\n",
- "total change in entropy = 0 kJ/K\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example3-pg134\n"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate change in entropy\n",
- "##initialisation of variables\n",
- "S1= 6.2872 ##J/kg K\n",
- "S2= 5.8712 ##J/kg K\n",
- "m= 18 ##kg\n",
- "##CALCULATIONS\n",
- "S= m*(S1-S2)\n",
- "##RESULTS\n",
- "print'%s %.3f %s'%(' change in entropy =',S,'kJ/K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " change in entropy = 7.488 kJ/K\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example4-pg 134"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate change in entropy\n",
- "##initialisation of variables\n",
- "S2= 5.8328 ##kJ/kg\n",
- "S1= 5.8712 ##kJ/kg\n",
- "##CALCULATIONS\n",
- "S= S2-S1\n",
- "##RESULTS\n",
- "print'%s %.5f %s'%('change in entropy = ',S,'kJ/K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "change in entropy = -0.03840 kJ/K\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example5-pg135"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#calculate enthalpy and change in entropy\n",
- "##initialisation of variables\n",
- "m= 0.1 ##kg\n",
- "p= 3 ##bar\n",
- "p1= 10 ##bar\n",
- "h1= 2964.3 ##kJ/kg\n",
- "v1=0.2378\n",
- "s2= 7.1619 ##kJ/k\n",
- "s1= 6.9641 ##kJ/k\n",
- "##CALCULATIONS\n",
- "h2= h1+(p-p1)*math.pow(10,5)*v1*math.pow(10,-3)\n",
- "S= m*(s2-s1)\n",
- "##RESULTS\n",
- "print'%s %.1f %s'%(' enthalpy =',h2,'kJ/kg')\n",
- "print'%s %.5f %s'%('change in entropy =',S,'kJ/K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " enthalpy = 2797.8 kJ/kg\n",
- "change in entropy = 0.01978 kJ/K\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example6-pg 137"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate final pressure and change in entropy\n",
- "import math\n",
- "##initialisation of variables\n",
- "p1= 5. ##bar\n",
- "V1= 0.4 ##m^2\n",
- "V2= 1.2 ##m^3\n",
- "R= 8.314 ##J/mol K\n",
- "M= 28.##gms\n",
- "T1= 80.##C\n",
- "##CALCULATIONS\n",
- "p2= p1*(V1/V2)\n",
- "S= R*math.log(V2/V1)/M\n",
- "S1= S*p1*V1*100/((R/M)*(273.15+T1))\n",
- "##RESULTS\n",
- "print'%s %.3f %s'%(' final pressure =',p2,'bar')\n",
- "print'%s %.4f %s'% ('change in entropy =',S1,'kJ/kg K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " final pressure = 1.667 bar\n",
- "change in entropy = 0.6222 kJ/kg K\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example7-pg 137"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#calculate heat and change in entropy of system and change in entropy of enironment\n",
- "##initialisation of variables\n",
- "R= 8.314 ##J/mol K\n",
- "M= 29. ##gms\n",
- "T= 400. ##K\n",
- "p2= 1.6 ##bar\n",
- "p1= 1. ##bar\n",
- "Tenvir= 300. ##K\n",
- "##CALCULATIONS\n",
- "q= R*T*math.log(p2/p1)/M\n",
- "S= -R*math.log(p2/p1)/M\n",
- "Senvir= q/Tenvir\n",
- "##RESULTS\n",
- "print'%s %.1f %s'%('heat =',q,'kJ/kg')\n",
- "print'%s %.4f %s'%('change in entropy of system=',S,'kJ/kg K')\n",
- "print'%s %.4f %s'%('change in entropy of environment=',Senvir,'kJ/kg K')\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "heat = 53.9 kJ/kg\n",
- "change in entropy of system= -0.1347 kJ/kg K\n",
- "change in entropy of environment= 0.1797 kJ/kg K\n"
- ]
- }
- ],
- "prompt_number": 7
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file |