{ "metadata": { "name": "", "signature": "sha256:2c9e6fedd22fa6b2ae65a19697803d5aa951ae2982e5a733c3ba66fccdc2f728" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 5: Enthalpy and the Second and Third Laws of Thermodynamics" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.1, Page Number 84" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Variable Declaration\n", "Th, Tc = 500.,200. #Temeperatures IN Which reversible heat engine works, K\n", "q = 1000. #Heat absorbed by heat engine, J\n", "\n", "#Calcualtions\n", "eps = 1.-Tc/Th\n", "w = eps*q\n", "\n", "#Results\n", "print 'Efficiency of heat engine is %4.3f'%eps\n", "print 'Work done by heat engine is %4.1f J'%w" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Efficiency of heat engine is 0.600\n", "Work done by heat engine is 600.0 J\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.4, Page Number 87" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from sympy import integrate, symbols\n", "from math import log\n", "#Variable Declaration\n", "n = 1.0 #Number of moles of CO2\n", "Ti, Tf = 320.,650. #Initial and final state Temeperatures of CO2, K\n", "vi, vf = 80.,120. #Initial and final state volume of CO2, K\n", "A, B, C, D = 31.08,-0.01452,3.1415e-5,-1.4973e-8\n", " #Constants in constant volume Heat capacity equation in J, mol, K units\n", "R = 8.314 #Ideal Gas Constant, J/(mol.K) \n", "#Calcualtions\n", "T = symbols('T')\n", "dS1 = n*integrate( (A + B*T + C*T**2 + D*T**3)/T, (T,Ti,Tf)) \n", "dS2 = n*R*log(vf/vi)\n", "dS = dS1 + dS2\n", "#Results\n", "print 'Entropy change of process is %4.2f J/(mol.K)'%dS" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Entropy change of process is 24.43 J/(mol.K)\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.5, Page Number 88" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from sympy import integrate, symbols\n", "from math import log\n", "\n", "#Variable Declaration\n", "n = 2.5 #Number of moles of CO2\n", "Ti, Tf = 450.,800. #Initial and final state Temeperatures of CO2, K\n", "pi, pf = 1.35,3.45 #Initial and final state pressure of CO2, K\n", "A, B, C, D = 18.86,7.937e-2,-6.7834e-5,2.4426e-8\n", " #Constants in constant pressure Heat capacity equation in J, mol, K units\n", "R = 8.314 #Ideal Gas Constant, J/(mol.K) \n", "#Calcualtions\n", "T = symbols('T')\n", "dS1 = n*integrate( (A + B*T + C*T**2 + D*T**3)/T, (T,Ti,Tf)) \n", "dS2 = n*R*log(pf/pi)\n", "dS = dS1 - dS2\n", "#Results\n", "print 'Entropy change of process is %4.2f J/(mol.K)'%dS" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Entropy change of process is 48.55 J/(mol.K)\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.6, Page Number 89" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import log\n", "\n", "#Variable Declaration\n", "n = 3.0 #Number of moles of CO2\n", "Ti, Tf = 300.,600. #Initial and final state Temeperatures of CO2, K\n", "pi, pf = 1.00,3.00 #Initial and final state pressure of CO2, K\n", "cpm = 27.98 #Specific heat of mercury, J/(mol.K)\n", "M = 200.59 #Molecualr wt of mercury, g/(mol)\n", "beta = 1.81e-4 #per K\n", "rho = 13.54 #Density of mercury, g/cm3\n", "R = 8.314 #Ideal Gas Constant, J/(mol.K) \n", "\n", "#Calcualtions\n", "dS1 = n*cpm*log(Tf/Ti)\n", "dS2 = n*(M/(rho*1e6))*beta*(pf-pi)*1e5\n", "dS = dS1 - dS2\n", "\n", "#Results\n", "print 'Entropy change of process is %4.1f J/(mol.K)'%dS\n", "print 'Ratio of pressure to temperature dependent term %3.1e\\nhence effect of pressure dependent term isvery less'%(dS2/dS1)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Entropy change of process is 58.2 J/(mol.K)\n", "Ratio of pressure to temperature dependent term 2.8e-05\n", "hence effect of pressure dependent term isvery less\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.7, Page Number 93" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import log\n", "\n", "#Variable Declaration\n", "n = 1.0 #Number of moles of CO2\n", "T = 300.0 #Temeperatures of Water bath, K\n", "vi, vf = 25.0,10.0 #Initial and final state Volume of Ideal Gas, L\n", "R = 8.314 #Ideal Gas Constant, J/(mol.K) \n", "\n", "#Calcualtions\n", "qrev = n*R*T*log(vf/vi)\n", "w = -qrev\n", "dSsys = qrev/T\n", "dSsur = -dSsys\n", "dS = dSsys + dSsur\n", "\n", "#Results\n", "print 'Entropy change of surrounding is %4.1f J/(mol.K)'%dSsur\n", "print 'Entropy change of system is %4.1f J/(mol.K)'%dSsys\n", "print 'Total Entropy changeis %4.1f J/(mol.K)'%dS" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Entropy change of surrounding is 7.6 J/(mol.K)\n", "Entropy change of system is -7.6 J/(mol.K)\n", "Total Entropy changeis 0.0 J/(mol.K)\n" ] } ], "prompt_number": 25 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.8, Page Number 93" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import log\n", "\n", "#Variable Declaration\n", "n = 1.0 #Number of moles of CO2\n", "T = 300.0 #Temeperatures of Water bath, K\n", "vi, vf = 25.0,10.0 #Initial and final state Volume of Ideal Gas, L\n", "R = 8.314 #Ideal Gas Constant, J/(mol.K) \n", "\n", "#Calcualtions\n", "pext = n*R*T/(vf/1e3)\n", "pi = n*R*T/(vi/1e3)\n", "q = pext*(vf-vi)/1e3\n", "qrev = n*R*T*log(vf/vi)\n", "w = -q\n", "dSsur = -q/T\n", "dSsys = qrev/T\n", "dS = dSsys + dSsur\n", "\n", "#Results\n", "print 'Constant external pressure and initial pressure are %4.3e J,and %4.3e J respectively'%(pext,pi)\n", "print 'Heat in reverssible and irreversible processes are %4.1f J,and %4.1f J respectively'%(qrev,q)\n", "print 'Entropy change of system is %4.1f J/(mol.K)'%dSsys\n", "print 'Entropy change of surrounding is %4.2f J/(mol.K)'%dSsur\n", "print 'Total Entropy changeis %4.2f J/(mol.K)'%dS" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Constant external pressure and initial pressure are 2.494e+05 J,and 9.977e+04 J respectively\n", "Heat in reverssible and irreversible processes are -2285.4 J,and -3741.3 J respectively\n", "Entropy change of system is -7.6 J/(mol.K)\n", "Entropy change of surrounding is 12.47 J/(mol.K)\n", "Total Entropy changeis 4.85 J/(mol.K)\n" ] } ], "prompt_number": 28 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Problem 5.9, Page Number 96" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from sympy import integrate, symbols\n", "from math import log\n", "\n", "#Variable Declaration\n", "n = 1.0 #Number of moles of CO2\n", "pi, pf = 1.35,3.45 #Initial and final state pressure of CO2, K\n", "D1 = 2.11e-3 #Constants in constant pressure Heat capacity equation for K