diff options
Diffstat (limited to 'Physical_Chemsitry/Chapter_4.ipynb')
-rwxr-xr-x | Physical_Chemsitry/Chapter_4.ipynb | 1022 |
1 files changed, 1022 insertions, 0 deletions
diff --git a/Physical_Chemsitry/Chapter_4.ipynb b/Physical_Chemsitry/Chapter_4.ipynb new file mode 100755 index 00000000..619fe75d --- /dev/null +++ b/Physical_Chemsitry/Chapter_4.ipynb @@ -0,0 +1,1022 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a82e4bec145fb0d4efd67c857ae44efe430c89bfa64d07388861ee610e670b10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 - Second and Third laws of thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the maximum efficiency in all cases\n",
+ "#initialisation of variables\n",
+ "T = 100. #C\n",
+ "T1= 25. #C\n",
+ "T2= 150. #C\n",
+ "T3= 357. #C\n",
+ "T4= 500. #C\n",
+ "T5= 2000. #C\n",
+ "T6= 5*10**6\n",
+ "T7= 1000. #C\n",
+ "#CALCULATIONS\n",
+ "e= (T-T1)/(T+273)\n",
+ "e1= (T2-T1)/(273+T2)\n",
+ "e2= (T3-T)/(273+T3)\n",
+ "e3= (T5-T4)/(T5+273)\n",
+ "e4= (T6-T7)/T6\n",
+ "#RESULTS\n",
+ "print '%s %.2f' % (' maximum efficiency in case 1= ',e)\n",
+ "print '%s %.2f' % (' \\n maximum efficiency in case 2 = ',e1)\n",
+ "print '%s %.2f' % (' \\n maximum efficiency in case 3 = ',e2)\n",
+ "print '%s %.2f' % (' \\n maximum efficiency in case 4 = ',e3)\n",
+ "print '%s %.2f' % (' \\n maximum efficiency in case 5 = ',e4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " maximum efficiency in case 1= 0.20\n",
+ " \n",
+ " maximum efficiency in case 2 = 0.30\n",
+ " \n",
+ " maximum efficiency in case 3 = 0.41\n",
+ " \n",
+ " maximum efficiency in case 4 = 0.66\n",
+ " \n",
+ " maximum efficiency in case 5 = 1.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the maximum efficiency and minimum work\n",
+ "#initialisation of variables\n",
+ "T= 20. #C\n",
+ "T1= -10. #C\n",
+ "q= 1000. #cal\n",
+ "#CALCULATIONS\n",
+ "e= (273+T1)/(T-T1)\n",
+ "w= (T-T1)*q/(273+T1)\n",
+ "#RESULTS\n",
+ "print '%s %.1f' % (' maximum efficiency = ',e)\n",
+ "print '%s %d %s' % (' \\n minimum work =',w,'cal')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " maximum efficiency = 8.8\n",
+ " \n",
+ " minimum work = 114 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the net work done on and by the gas\n",
+ "#initialisation of variables\n",
+ "T= 1000 #K\n",
+ "T1= 400 #/K\n",
+ "w= 1000 #cal\n",
+ "E= 0 #cal\n",
+ "gam=7/5.\n",
+ "#CALCULATIONS\n",
+ "q= w-E\n",
+ "W= q*(T-T1)/T\n",
+ "q1= W-q\n",
+ "W1= -q1\n",
+ "dE=5/2.*(T1-T)\n",
+ "dH=7/2. *(T1-T)\n",
+ "w2=dE-E\n",
+ "w3=(T-T1)/(gam-1)\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % ('net work done by gas=',W,' cal')\n",
+ "print '%s %.1f %s' % ('net work done on gas =',W1,'cal')\n",
+ "print '%s %.1f %s' %('Change in Internal energy = ',dE,'R cal')\n",
+ "print '%s %.1f %s' %('Change in Enthalpy = ',dH,'R cal')\n",
+ "print '%s %.1f %s' %('Work for adiabatic compression =',w3,'R cal')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "net work done by gas= 600.0 cal\n",
+ "net work done on gas = 400.0 cal\n",
+ "Change in Internal energy = -1500.0 R cal\n",
+ "Change in Enthalpy = -2100.0 R cal\n",
+ "Work for adiabatic compression = 1500.0 R cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the entropy of substances\n",
+ "#initialisation of variables\n",
+ "import numpy as np\n",
+ "Hv= np.array([1960.,1560.,4880.,37000.,5500.,27400.,60700.,9720.,30900.]) #cal mole^-1\n",
+ "Tb= np.array([112.,87.3,239.,1806.,259.,1180.,2466.,373.,1029.]) #K\n",
+ "#CALCULATIONS\n",
+ "Sv= np.round(Hv/Tb,1)\n",
+ "#RESULTS\n",
+ "print '%s' % (' Entropy (cal mole deg^-1)')\n",
+ "print Sv\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Entropy (cal mole deg^-1)\n",
+ "[ 17.5 17.9 20.4 20.5 21.2 23.2 24.6 26.1 30. ]\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the entropy at constant pressure and volume\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "T= 300. #K\n",
+ "T1= 400. #K\n",
+ "k= 6.0954\n",
+ "k1= 3.2533*10**-3\n",
+ "k2= -1.0171*10**-6\n",
+ "R= 1.98719 #cal/mol K\n",
+ "#CALCULATIONS\n",
+ "S= 2*(k*math.log(T1/T)+k1*(T1-T)+k2*(T1**2-T**2)/2)\n",
+ "S1= S-2*R*math.log(T1/T)\n",
+ "#RESULTS\n",
+ "print '%s %.4f %s' % (' Entropy=',S,' cal deg^-1')\n",
+ "print '%s %.4f %s' % (' \\n Entropy =',S1,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Entropy= 4.0865 cal deg^-1\n",
+ " \n",
+ " Entropy = 2.9432 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8 - pg 216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the final temperature \n",
+ "#initialisation of variables\n",
+ "T1= 273.16 #K\n",
+ "R= 1.987 #cal /mol K\n",
+ "R1= 0.08205 #J /mol K\n",
+ "n= 10 #moles\n",
+ "V1= 22.4 #lit\n",
+ "a= 1.36\n",
+ "Cv= 4.9\n",
+ "#CALCULATIONS\n",
+ "T2= T1-(R*a*(n-1)/(R1*n*Cv*V1))\n",
+ "#RESULTS\n",
+ "print '%s %.2f %s' % (' temperature=',T2,' K')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " temperature= 272.89 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9 - pg 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the inversion Temperature\n",
+ "#initialisation of variables\n",
+ "a= 1.360 #l^2 atm mole^-1\n",
+ "b= 0.0317 #l mole^-1\n",
+ "R= 0.08205 #J/mol K\n",
+ "#CALCULATIONS\n",
+ "T= 2*a/(b*R)\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % ('Inversion Temperature=',T,'K')\n",
+ "print 'The answer is a bit different due to rounding off error in textbook'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inversion Temperature= 1045.8 K\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10 - pg 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the joule thomson coefficient\n",
+ "#initialisation of variables\n",
+ "a= 1.360 #l^2 atm mole^-1\n",
+ "b= 0.0317 #l mole^-1\n",
+ "R= 0.08205 #J/mol K\n",
+ "R1= 1.987 #cal/mole K\n",
+ "Cp= 6.9 #cal mole^-1 deg^-1\n",
+ "T= 273.2 #K\n",
+ "#CALCULATIONS\n",
+ "u= ((2*a/(R*T))-b)/(Cp*(R/R1))\n",
+ "#RESULTS\n",
+ "print '%s %.3f %s' % (' Joule thomson coefficient=',u,' atm^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Joule thomson coefficient= 0.315 atm^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12 - pg 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the increase in entropy\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "p= 4/3. #atm\n",
+ "p1= 1 #atm\n",
+ "R= 1.9872 #cal /mole K\n",
+ "#CALCULATIONS\n",
+ "S= 2*R*math.log(p/p1)\n",
+ "#RESULTS\n",
+ "print '%s %.4f %s' %(' increase in entropy=',S,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " increase in entropy= 1.1434 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 13 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the increase in entropy\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "p1= 1 #atm\n",
+ "R= 1.9872 #cal /mole K\n",
+ "#CALCULATIONS\n",
+ "S= 0 #Initial and final states are alike\n",
+ "#RESULTS\n",
+ "print '%s %.4f %s' %(' increase in entropy=',S,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " increase in entropy= 0.0000 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate rhe increase in entropy in both cases\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "T= 25. #C\n",
+ "T1= 100. #C\n",
+ "R= 1.9872 #cal /mole K\n",
+ "p= 1 #atm\n",
+ "p1= 10. #atm\n",
+ "#CALCULATIONS\n",
+ "S= 3.5*R*math.log((T1+273)/(T+273))\n",
+ "S1= S+R*math.log(p/p1)\n",
+ "#RESULTS\n",
+ "print '%s %.2f %s' % (' increase in entropy in case 1 =',S,'cal deg^-1')\n",
+ "print '%s %.2f %s' % (' \\n increase in entropy in case 2 =',S1,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " increase in entropy in case 1 = 1.56 cal deg^-1\n",
+ " \n",
+ " increase in entropy in case 2 = -3.01 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15 - pg 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the absolute entropy\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "S= 45.77 #cal deg^-1\n",
+ "T= 25. #C\n",
+ "T1= 100. #C\n",
+ "R= 1.9872 #cal /mole K\n",
+ "#CALCULATIONS\n",
+ "S0= S+ 3.5*R*math.log((T1+273)/(T+273))\n",
+ "#RESULTS\n",
+ "print '%s %.2f %s' % (' absolute entropy=',S0,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " absolute entropy= 47.33 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16 - pg 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in entropy\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "Cp= 18. #cal deg^-1\n",
+ "T= 0. #C\n",
+ "T1= -5. #C\n",
+ "H2= -1440. #cal\n",
+ "Cp1= 9. #cal deg^-1\n",
+ "H= 0.\n",
+ "#CALCULATIONS\n",
+ "T2= (-Cp*(T-T1)-H2+Cp1*(273.16+T))/Cp1\n",
+ "S= Cp*math.log((273.16+T)/(273.16+T1))-(Cp*(T-T1)/(T+273.16))\n",
+ "#RESULTS\n",
+ "print '%s %.4f %s' % (' Change in entropy=',S,'cal deg^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Change in entropy= 0.0031 cal deg^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18 - pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Gibbs free energy\n",
+ "#initialisation of variables\n",
+ "H= -57.7979 #cal\n",
+ "H1= -68.3174 #cal\n",
+ "S= 45.106 #cal deg^-1\n",
+ "S1= 16.716 #cal deg^-1\n",
+ "T= 25 #C\n",
+ "#CALCULATIONS\n",
+ "H2= (H-H1)*1000\n",
+ "S2= S-S1\n",
+ "G= H2-(273.16+T)*S2\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % (' Gibbs free energy=',G,'cal')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Gibbs free energy= 2054.7 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19 - pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Gibbs free energy\n",
+ "#initialisation of variables\n",
+ "H= -68317.4 #cal\n",
+ "S= 16.716 #cal\n",
+ "S1= 49.003 #cal\n",
+ "S2= 31.211 #cal\n",
+ "T= 25 #C\n",
+ "#CALCULATIONS\n",
+ "H1= 2*H\n",
+ "S3= 2*S-(S1+2*S2)\n",
+ "G= H1-(T+273.16)*S3\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % (' Gibbs free energy=',G,'cal')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Gibbs free energy= -113380.4 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20 - pg 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the gibbs free energy change\n",
+ "#initialisation of variables\n",
+ "H= -57.7979 #kcal\n",
+ "H1= -196.5 #kcal\n",
+ "S1=45.106\n",
+ "S2=6.49\n",
+ "S3=21.5\n",
+ "S4=31.211\n",
+ "T=298.16\n",
+ "#calculations\n",
+ "dH=3*H-H1\n",
+ "dS=3*S1+2*S2-S3-3*S4\n",
+ "dG=dH*1000-T*dS\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Gibbs free energy change =\",dG,\"cal\")\n",
+ "print 'The answer is a bit different due to rounding off error in textbook'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gibbs free energy change = 13217 cal\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22 - pg 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Gibbs free energy and value of A in both cases\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "p= 1. #atm\n",
+ "p1= 3. #atm\n",
+ "R= 1.987 #cal/mole K\n",
+ "T= 27. #C\n",
+ "b= 0.0428 #l mole^-1\n",
+ "a= 3.61 #l^2 atm mole^-1\n",
+ "#CALCULATIONS\n",
+ "G= R*(273+T)*math.log(p/p1)\n",
+ "A= R*(273+T)*math.log(p/p1)\n",
+ "G1= R*(273+T)*math.log(p/p1)+(b-(a/(0.08205*(T+273))))*(p-p1)*(R/0.08205)\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % (' Gibs free energy=',G,'cal')\n",
+ "print '%s %.1f %s' % (' \\n Value of dA=',A,'cal')\n",
+ "print '%s %.1f %s' % (' \\n Gibs free energy=',G1,'cal')\n",
+ "print '%s %.1f %s' % (' \\n Value of dA=',A,'cal')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Gibs free energy= -654.9 cal\n",
+ " \n",
+ " Value of dA= -654.9 cal\n",
+ " \n",
+ " Gibs free energy= -649.9 cal\n",
+ " \n",
+ " Value of dA= -654.9 cal\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 24 - pg 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the fugacities of both components\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "b= 0.0386 #l**2 atm mole**-1\n",
+ "a= 1.348 #l mole**-1\n",
+ "R= 0.08205 #cal /mole K\n",
+ "T= 25 #C\n",
+ "a1= 3.61 #l**2 atm mole**-1\n",
+ "b1= 0.0428 #l mole**-1\n",
+ "P= 50 #atm\n",
+ "P1= 1 #atm\n",
+ "#CALCULATIONS\n",
+ "Bn= b-(a/(R*(273.2+T)))\n",
+ "Bc= b1-(a1/(R*(273.2+T))) \n",
+ "Fn= P1*math.e**(Bn*P1/(R*(273.2+T)))\n",
+ "Fc= P1*math.e**(Bc*P1/(R*(273.2+T)))\n",
+ "Fn1= P*math.e**(Bn*P/(R*(273.2+T)))\n",
+ "Fc1= P*math.e**(Bc*P/(R*(273.2+T)))\n",
+ "#RESULTS\n",
+ "print '%s %.3f %.2f %s' % (' Fugacity of N2 at 1 and 50 atm are respectively =',Fn,Fn1,'atm')\n",
+ "print '%s %.3f %.2f %s' % (' \\n Fugacity of CO2 at 1 and 50 atm are respectively =',Fc,Fc1,'atm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Fugacity of N2 at 1 and 50 atm are respectively = 0.999 48.34 atm\n",
+ " \n",
+ " Fugacity of CO2 at 1 and 50 atm are respectively = 0.996 40.37 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25 - pg 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Increase in pressure in all cases\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "P1= 23.756 #atm\n",
+ "T= 25. #C\n",
+ "P2= 1. #atm\n",
+ "P3= 10. #atm\n",
+ "P4= 100. #atm\n",
+ "R= 82.02 #J/mole K\n",
+ "v= 18.07 #ml\n",
+ "#CALCULATIONS\n",
+ "p1= P1/760.\n",
+ "p2= 10**(math.log10(P1)+(v*(P2-p1)/(2.303*R*(273.2+T))))\n",
+ "p3= 10**(math.log10(P1)+(v*(P3-p1)/(2.303*R*(273.2+T))))\n",
+ "p4= 10**(math.log10(P1)+(v*(P4-p1)/(2.303*R*(273.2+T))))\n",
+ "x= -(P1-p2)*100/P1\n",
+ "x1= -(P1-p3)*100/P1\n",
+ "x2= -(P1-p4)*100/P1\n",
+ "#RESULTS\n",
+ "print '%s %.2f %s' % ('Increase in pressure=',x,'percent')\n",
+ "print '%s %.2f %s' % ('Increase in pressure=',x1,' percent')\n",
+ "print '%s %.1f %s' % ('Increase in pressure=',x2,' percent')\n",
+ "print '%s %.3f %s' %('Vapor pressure at 1 atm',p2,'mm Hg')\n",
+ "print '%s %.3f %s' %('Vapor pressure at 10 atm',p3,'mm Hg')\n",
+ "print '%s %.3f %s' %('Vapor pressure at 100 atm',p4,'mm Hg')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Increase in pressure= 0.07 percent\n",
+ "Increase in pressure= 0.74 percent\n",
+ "Increase in pressure= 7.7 percent\n",
+ "Vapor pressure at 1 atm 23.773 mm Hg\n",
+ "Vapor pressure at 10 atm 23.932 mm Hg\n",
+ "Vapor pressure at 100 atm 25.577 mm Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26 - pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the pressure required\n",
+ "#initialisation of variables\n",
+ "H= 1436.3 #cal mole^-1\n",
+ "d= 0.9999 #g ml^-1\n",
+ "d1= 0.9168 #g ml^-1\n",
+ "P= 1. #atm\n",
+ "m= 18.02 #gm\n",
+ "R= 1.987 #cal/mole K\n",
+ "T= 2 #C\n",
+ "#CALCULATIONS\n",
+ "V= (P/d)-(P/d1)\n",
+ "H1= H*82.05/(m*R) \n",
+ "P1= H1*(-T)/(273*V)\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % (' pressure required to decrease=',P1,'atm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " pressure required to decrease= 266.0 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 27 - pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat of vapourisation\n",
+ "#initialisation of variables\n",
+ "H= 540. #cal gram ^-1\n",
+ "T= 95. #C\n",
+ "T1= 100. #C\n",
+ "m= 18. #gms\n",
+ "R= 1.987 #cal /mole K\n",
+ "P= 760. #mm of Hg\n",
+ "#CALCULATIONS\n",
+ "H1= m*H\n",
+ "P1= P/(10**(H1*(T1-T)/(2.303*R*(273+T)*(273+T1))))\n",
+ "#RESULTS\n",
+ "print '%s %.1f %s' % (' heat of vapourisation=',P1,'mm of Hg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " heat of vapourisation= 636.0 mm of Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28 - pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the vapor pressure of water\n",
+ "#initialisation of variables\n",
+ "H= 9720 #cal mole^-1\n",
+ "P= 1 #atm\n",
+ "R= 1.987 #cal /mole K\n",
+ "T= 100 #C\n",
+ "T1= 95 #C\n",
+ "#CALCULATIONS\n",
+ "r= P*H/(R*(273+T)**2)\n",
+ "dP= r*(T1-T)\n",
+ "P1= (P+dP)*626/0.824\n",
+ "#RESULTS\n",
+ "print '%s %d %s' % (' vapour pressure=',P1,'mm Hg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " vapour pressure= 626 mm Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29 - pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the vapour pressure\n",
+ "#initialisation of variables\n",
+ "G= 145 #cal\n",
+ "R= 1.987 #cal/mole K\n",
+ "T= 95 #C\n",
+ "#CALCULATIONS\n",
+ "P= 10**(-G/(2.303*R*(273+T)))*(624/0.820)\n",
+ "#RESULTS\n",
+ "print '%s %d %s' % (' vapour pressure=',P,'mm Hg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " vapour pressure= 624 mm Hg\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30 - pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the molar heat of vapourisation\n",
+ "#initialisation of variables\n",
+ "import math\n",
+ "R= 1.987 #cal/mole K\n",
+ "T1= 25 #C\n",
+ "T2= 76.8 #C\n",
+ "P2= 760. #mm\n",
+ "P1= 115. #mm\n",
+ "#CALCULATIONS\n",
+ "H= 2.303*R*(273.2+T1)*(273.2+T2)*math.log10(P2/P1)/(T2-T1)\n",
+ "#RESULTS\n",
+ "print '%s %d %s' % (' molar heat of vapourisation=',H,'cal mole^-1')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " molar heat of vapourisation= 7561 cal mole^-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |