{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 3 - Properties of pure substances" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.1 Page: 88" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.1 - Page: 88\n", "\n", "\n", "Molar Volume of the gas is 1.29e-02 cubic metres\n" ] } ], "source": [ "print \"Example: 3.1 - Page: 88\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "P = 2*10**5## [Pa]\n", "T = 273 + 37## [K]\n", "R = 8.314## [J/mol K]\n", "#****************\n", "# Since the gas behaves ideally:\n", "V = R*T/P## [cubic metres]\n", "print \"Molar Volume of the gas is %.2e cubic metres\"%(V)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.2 Page: 89" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.2 - Page: 89\n", "\n", "\n", "The pressure of air after compression is 1200 kPa\n", "\n" ] } ], "source": [ "print \"Example: 3.2 - Page: 89\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "V1 = 8## [cubic m]\n", "P1 = 300## [kPa]\n", "V2 = 2## [cubic m]\n", "#**************\n", "# Apptying the ideal gas Eqn. & since the Temperature remains constant:\n", "P2 = P1*V1/V2## [kPa]\n", "print \"The pressure of air after compression is %d kPa\\n\"%(P2)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.3 Page: 89" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.3 - Page: 89\n", "\n", "\n", "The pressure of the remaining air is 0 kPa\n", "\n" ] } ], "source": [ "print \"Example: 3.3 - Page: 89\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "V1 = 6## [cubic m]\n", "P1 = 500## [kPa]\n", "R = 0.287## [kJ/kg K]\n", "#*************\n", "# Applying the charectarstic equation to the gas initially:\n", "# P1*V1 = m1*R*T1.......................................(i)\n", "# Applying the charectarstic equation to the gas which was left in the vessel after one-fifth of the gas has been removed:\n", "# P2*V2 = m2*R*T2.......................................(ii)\n", "# V2 = V1# T2 = T1# m2 = (4/5)*m1# Eqn (ii) becomes:\n", "# P2*V1 = (4/5)*m1*R*T1..................................(iii)\n", "# Dividing eqn (i) by eqn (iii), we get:\n", "P2 = (4/5)*P1## [kPa]\n", "print \"The pressure of the remaining air is %d kPa\\n\"%(P2)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.4 Page: 90" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.4 - Page: 90\n", "\n", "\n", "Final Temperature of the air when the piston reaches stop is 361.5 K\n", "\n", "Pressure of air inside the cylinder is 2.51 bar\n", "\n" ] } ], "source": [ "print \"Example: 3.4 - Page: 90\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "T1 = 450 + 273## [K]\n", "P1 = 3## [bar]\n", "#***************\n", "# Soluton(a)\n", "# From Fig. 3.7, (Page 90)\n", "# Since the weight remains the same, therefore, the final pressure is equal to the initial pressure.\n", "# Therefore it is a constant pressure process.\n", "P2 = P1## [bar]\n", "# Volumetric Ratio:\n", "V2_by_V1 = 2.5/(2.5 + 2.5)# Applying ideal gas law & P1 = P2\n", "T2 = T1*V2_by_V1## [K]\n", "print \"Final Temperature of the air when the piston reaches stop is %.1f K\\n\"%(T2)\n", "# Solution (b)\n", "# When the piston rests ot the stops, the pressure exerted by the weight, air & the atmosphere will be different. But there will beno further decrease in volume.\n", "# This is a constant volume process.\n", "T3 = 273 + 30## [K]\n", "# Applying ideal gas law & V2 = V3\n", "P3 = T3*P2/T2## [bar]\n", "print \"Pressure of air inside the cylinder is %.2f bar\\n\"%(P3)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.5 Page: 95" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.5 - Page: 95\n", "\n", "\n", "The temperature at which ammonia exists in the cylinder is 321.5 K\n", "\n" ] } ], "source": [ "print \"Example: 3.5 - Page: 95\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "m = 1.373## [kg]\n", "P = 1.95*10**(6)## [Pa]\n", "V = 0.1## [cubic m]\n", "a = 422.546*10**(-3)## [cubic m/square mol]\n", "b = 37*10**(-6)## [cubic m/mol]\n", "M = 17*10**(-3)## [kg/mol]\n", "R = 8.314## [J/mol K]\n", "#****************\n", "n = m/M## [moles]\n", "Vm = V/n## [molar volume, cubic m]\n", "# Applying Van der Waals equation of state:\n", "T = (P + (a/Vm**2))*((Vm - b)/R)## [K]\n", "print \"The temperature at which ammonia exists in the cylinder is %.1f K\\n\"%(T)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.10 Page: 103" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.10 - Page: 103\n", "\n", "\n", "Value of derivative is 23.98 bar/OC\n", "\n", "The pressure generated by heating at constant Volume is 240.84 Pa\n", "\n", "The change in Volume is -0.038 cubic cm/g\n", "\n" ] } ], "source": [ "from math import exp\n", "print \"Example: 3.10 - Page: 103\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "beeta = 1.487*10**(-3)## [1/OC]\n", "alpha = 62*10**(-6)## [1/bar]\n", "V1 = 1.287## [cubic cm /g]\n", "#************\n", "# Solution (a)\n", "# The value of derivative (dP/dT) at constant V:\n", "# dV/V = beeta*dT - alpha*dP\n", "# dV = 0\n", "# dP/dT = beeta/alpha\n", "# Value = dP/dT\n", "Value = beeta/alpha## [bar/OC]\n", "print \"Value of derivative is %.2f bar/OC\\n\"%(Value)\n", "# Solution (b)\n", "P1 = 1## [bar]\n", "T1 = 20## [OC]\n", "T2 = 30## [OC]\n", "# Applying the same equation:\n", "P2 = P1 +(beeta/alpha)*(T2 - T1)## [bar]\n", "print \"The pressure generated by heating at constant Volume is %.2f Pa\\n\"%(P2)\n", "# Solution (c)\n", "T2 = 0## [OC]\n", "T1 = 20## [OC]\n", "P2 = 10## [bar]\n", "P1 = 1## [bar]\n", "# The change in Volume can be obtained as:\n", "V2 = V1*exp((beeta*(T2 - T1)) - alpha*(P2 - P1))## [cubic cm/g]\n", "deltaV = V2 - V1## [cubic cm/g]\n", "print \"The change in Volume is %.3f cubic cm/g\\n\"%(deltaV)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 3.11 Page: 107" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 3.11 - Page: 107\n", "\n", "\n", "Acentric factor is 0.6447\n" ] } ], "source": [ "from math import log10\n", "print \"Example: 3.11 - Page: 107\\n\\n\"\n", "\n", "# Solution\n", "\n", "#*****Data*****\n", "Tc = 513.9## [K]\n", "Pc = 61.48*10**5## [Pa]\n", "#************\n", "Tr = 0.7\n", "T = Tr*Tc - 273.15## [OC]\n", "P_sat = 10**(8.112 - (1592.864/(T + 226.184)))## [mm Hg]\n", "P_sat = P_sat*101325/760## [Pa]\n", "Pr_sat = P_sat/Pc## [Pa]\n", "omega = -1 - log10(Pr_sat)## [Acentric factor]\n", "print \"Acentric factor is %.4f\"%(omega)#" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }