diff options
author | Trupti Kini | 2016-08-26 23:30:24 +0600 |
---|---|---|
committer | Trupti Kini | 2016-08-26 23:30:24 +0600 |
commit | e05977ece06f8cd61b53adcff9febb2e443de861 (patch) | |
tree | 032a1bd0616e6338797e6ce9abd2e08f6b51319e /Thermodynamics_by_K._M._Gupta/ch7.ipynb | |
parent | 189c5cc9de1ac8d3e79f23c42ce8fe462e151825 (diff) | |
download | Python-Textbook-Companions-e05977ece06f8cd61b53adcff9febb2e443de861.tar.gz Python-Textbook-Companions-e05977ece06f8cd61b53adcff9febb2e443de861.tar.bz2 Python-Textbook-Companions-e05977ece06f8cd61b53adcff9febb2e443de861.zip |
Added(A)/Deleted(D) following books
A Introduction_to_Thermal_Systems_Engineering:_Thermodynamics,_Fluid_Mechanics,_and_Heat_Transfe_by_Moran,_Shapiro,_Munson,_Dewitt/README.txt
A Material_Science_by_S._L._Kakani_and_A._Kakani/README.txt
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch10.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch11.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch12.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch13.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch14.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch15.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch16.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch18.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch2.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch3.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch4.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch5.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch6.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch7.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch8.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/ch9.ipynb
A Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/10.png
A Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/16.png
A Material_Science_by_S._L._Kakani_and_A._Kakani/screenshots/7.png
A Thermodynamics_by_K._M._Gupta/README.txt
A Thermodynamics_by_K._M._Gupta/ch1.ipynb
A Thermodynamics_by_K._M._Gupta/ch10.ipynb
A Thermodynamics_by_K._M._Gupta/ch11.ipynb
A Thermodynamics_by_K._M._Gupta/ch2.ipynb
A Thermodynamics_by_K._M._Gupta/ch3.ipynb
A Thermodynamics_by_K._M._Gupta/ch4.ipynb
A Thermodynamics_by_K._M._Gupta/ch5.ipynb
A Thermodynamics_by_K._M._Gupta/ch6.ipynb
A Thermodynamics_by_K._M._Gupta/ch7.ipynb
A Thermodynamics_by_K._M._Gupta/ch8.ipynb
A Thermodynamics_by_K._M._Gupta/ch9.ipynb
A Thermodynamics_by_K._M._Gupta/screenshots/1.png
A Thermodynamics_by_K._M._Gupta/screenshots/2.png
A Thermodynamics_by_K._M._Gupta/screenshots/3.png
Diffstat (limited to 'Thermodynamics_by_K._M._Gupta/ch7.ipynb')
-rw-r--r-- | Thermodynamics_by_K._M._Gupta/ch7.ipynb | 298 |
1 files changed, 298 insertions, 0 deletions
diff --git a/Thermodynamics_by_K._M._Gupta/ch7.ipynb b/Thermodynamics_by_K._M._Gupta/ch7.ipynb new file mode 100644 index 00000000..2804115d --- /dev/null +++ b/Thermodynamics_by_K._M._Gupta/ch7.ipynb @@ -0,0 +1,298 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3e3cc60dc2a7aa47248e51781bc474e34ce30f23ed528c32391da2267db7146e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 : Entropy" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 Page No : Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "v1 = 0.05;\t\t \t# in m**3\n", + "v2 = 8. * v1;\t\t\t# in m**3\n", + "T1 = 280.;\t\t \t# in \u00b0C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 25.;\t\t # in \u00b0C\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "p1 = 8.;\t \t\t# in bar\n", + "C_p = 1.005;\t\t\t# in kJ/kgK\n", + "C_v = 0.712;\t\t\t# in kJ/kgK\n", + "\n", + "# Calculations\n", + "R = C_p - C_v;\t\t\t# in kJ/kgK\n", + "del_phi = (R * ( math.log(v2/v1)) ) + (C_v * (math.log(T2/T1)) );\t\t\t# in kJ/kgK\n", + "\n", + "# Results\n", + "print \"The change in entrophy of air during the process in kJ/kgK is : %.3f\"%del_phi\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The change in entrophy of air during the process in kJ/kgK is : 0.169\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 Page No : 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 5.; \t\t\t# in kg\n", + "T1 = 50.;\t \t\t# in \u00b0C\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = 250.;\t\t\t # in \u00b0C\n", + "T2 = T2 + 273;\t \t# in K\n", + "C_p = 1.0;\n", + "C_v = 0.72;\n", + "T3 = 50.; \t\t\t# in \u00b0C\n", + "T3 = T3 + 273;\t\t\t# in K\n", + "\n", + "# Calculations\n", + "del_phi = m * C_p * (math.log(T2/T1));\t\t\t# in kJ/ K (this is increase in entrophy)\n", + "del_phi1 = m * C_v * (math.log(T3/T2));\t\t\t# in kJ/K (this is decrease in entrophy)\n", + "phi_net = del_phi - abs(del_phi1);\t\t\t # in kJ/K\n", + "\n", + "# Results\n", + "print \"net change in entrophy in kJ/K is : %.3f\"%phi_net\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "net change in entrophy in kJ/K is : 0.675\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 Page No : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variables\n", + "Q1 = 1600.;\t\t\t# in kJ\n", + "Q2 = 1600.;\t\t\t# in kJ\n", + "T1 = 800.;\t\t\t# in K\n", + "T2 = 127.;\t\t\t# in \u00b0C\n", + "\n", + "# Calculations\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "d1_phi = Q1/T1;\t\t\t# in kJ per K\n", + "d2_phi = Q2/T2;\t\t\t# in kJ per K\n", + "net_phi = d2_phi - d1_phi;\t\t\t# in kJ per K\n", + "\n", + "# Results\n", + "print \"entrophy generated during the process in kJ/K is : \",net_phi\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "entrophy generated during the process in kJ/K is : 2.0\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 Page No : 175" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "T_A = 50.+273;\t\t\t# in K\n", + "T_B = 13.+273;\t\t\t# in K\n", + "P_A = 130.;\t\t\t# in kPa\n", + "P_B = 100.;\t\t\t# in kPa\n", + "Cp = 1.005;\t\t\t# in kJ/kg-K\n", + "pvByT = 0.287;\t\t\t# p in kPa, v in m**3/kg, T in K\n", + "\n", + "# Calculations\n", + "del_S_system = Cp*math.log(T_B/T_A)-pvByT*math.log(P_B/P_A);\t\t\t# in kJ/kg-K\n", + "del_S_surrounding = 0;\n", + "del_S_universe = del_S_system+del_S_surrounding;\t\t\t# in kJ/kg-K\n", + "\n", + "# Results\n", + "print \"change in entropy in kJ/kg-K is : %.3f\"%del_S_universe\n", + "print (\"But a negative change in entropy is not possible,\");\n", + "print (\"therefore the flow of air must be from B to A\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in entropy in kJ/kg-K is : -0.047\n", + "But a negative change in entropy is not possible,\n", + "therefore the flow of air must be from B to A\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9 Page No : 176" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "m = 5.\t \t\t# in kg\n", + "s= 4.18 \n", + "T1 = 0.\t \t\t# in \u00b0C\n", + "T2 = 20.\t\t\t# in \u00b0C\n", + "dt = T2 - T1;\t\t\t# in \u00b0C\n", + "Q = m * s * dt;\t\t\t# in kJ\n", + "L = 335.;\t\t\t# in kJ/kg\n", + "\n", + "# Calculations\n", + "# Q = m_i * l\n", + "m_i = Q/L;\t\t\t# in kg\n", + "T1 = T1 + 273;\t\t\t# in K\n", + "T2 = T2 + 273;\t\t\t# in K\n", + "del_S = ((m_i * L)/T1) - (m * s * (math.log(T1/T2)));\t\t\t# in kJ per K\n", + "\n", + "# Results\n", + "print \"change in entropy of the adiabatic system in kJ/K is %.3f\"%del_S\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in entropy of the adiabatic system in kJ/K is 3.009\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11 Page No : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\n", + "# Variables\n", + "p1 = 1. * 10**5;\t\t\t# in N/m**2\n", + "C_p = 1.005;\t\t\t# in kJ/kg k\n", + "R = 287.;\t\t\t# in j/kg k\n", + "T1 = 290.;\t\t\t# in K\n", + "T2 = 580.;\t\t\t# in K\n", + "v1 = 1.;\t\t\t# in m**3\n", + "\n", + "# Calculations\n", + "m = (p1 * v1)/(R * T1);\t\t\t# in kg\n", + "Q = m * R * (T2-T1);\t\t\t# in J\n", + "Q = Q * 10**-3;\t\t\t# in kJ\n", + "del_phi = m * C_p * (math.log(T2/T1));\t\t\t# in kJ per K\n", + "R = R * 10**-3;\t\t\t# in kJ/kg K\n", + "C_v = C_p - R;\t\t\t# in kJ/kg k\n", + "del1_phi = m * C_v * (math.log(T1/T2));\t\t\t# in kJ/K\n", + "net_phi = del_phi + del1_phi;\t\t\t# in kJ/K\n", + "\n", + "# Results\n", + "print \"Over all change in entrophy in kJ/K is : %.4f\"%net_phi\n", + "\n", + "# rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Over all change in entrophy in kJ/K is : 0.2390\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |