From 64419e47f762802600b3a2b6d8c433a16ccd3d55 Mon Sep 17 00:00:00 2001 From: Thomas Stephen Lee Date: Fri, 4 Sep 2015 22:04:10 +0530 Subject: add/remove/update books --- Chemical_Engineering_Thermodynamics/README.txt | 10 - Chemical_Engineering_Thermodynamics/ch1.ipynb | 145 --- Chemical_Engineering_Thermodynamics/ch10.ipynb | 202 --- Chemical_Engineering_Thermodynamics/ch11.ipynb | 585 --------- Chemical_Engineering_Thermodynamics/ch12.ipynb | 716 ----------- Chemical_Engineering_Thermodynamics/ch13.ipynb | 235 ---- Chemical_Engineering_Thermodynamics/ch14.ipynb | 846 ------------- Chemical_Engineering_Thermodynamics/ch2.ipynb | 117 -- Chemical_Engineering_Thermodynamics/ch3.ipynb | 897 -------------- Chemical_Engineering_Thermodynamics/ch4.ipynb | 1291 -------------------- Chemical_Engineering_Thermodynamics/ch5.ipynb | 974 --------------- Chemical_Engineering_Thermodynamics/ch6.ipynb | 214 ---- Chemical_Engineering_Thermodynamics/ch7.ipynb | 255 ---- Chemical_Engineering_Thermodynamics/ch8.ipynb | 600 --------- Chemical_Engineering_Thermodynamics/ch9.ipynb | 1125 ----------------- .../hardythe1/attachment/20150521.pdf | Bin 230939 -> 0 bytes .../screenshots/1.png | Bin 144195 -> 0 bytes .../screenshots/2.png | Bin 144507 -> 0 bytes .../screenshots/3.png | Bin 167523 -> 0 bytes .../screenshots/Plot_of_gE-RTx1x2_vs_x1.png | Bin 8932 -> 0 bytes .../Plot_of_ln(gamma1-gamma2)_vs_x1.png | Bin 13438 -> 0 bytes .../screenshots/T-x-y_diagram.png | Bin 23932 -> 0 bytes .../screenshots/ch1.png | Bin 80229 -> 0 bytes .../screenshots/ch8.png | Bin 79322 -> 0 bytes .../screenshots/pic111.png | Bin 134032 -> 0 bytes .../screenshots/pic222.png | Bin 140462 -> 0 bytes .../screenshots/pic333.png | Bin 149247 -> 0 bytes .../screenshots/pressureVSvol3.png | Bin 11626 -> 0 bytes 28 files changed, 8212 deletions(-) delete mode 100755 Chemical_Engineering_Thermodynamics/README.txt delete mode 100755 Chemical_Engineering_Thermodynamics/ch1.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch10.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch11.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch12.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch13.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch14.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch2.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch3.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch4.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch5.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch6.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch7.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch8.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/ch9.ipynb delete mode 100755 Chemical_Engineering_Thermodynamics/hardythe1/attachment/20150521.pdf delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/1.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/2.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/3.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/Plot_of_gE-RTx1x2_vs_x1.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/Plot_of_ln(gamma1-gamma2)_vs_x1.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/T-x-y_diagram.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/ch1.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/ch8.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/pic111.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/pic222.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/pic333.png delete mode 100755 Chemical_Engineering_Thermodynamics/screenshots/pressureVSvol3.png (limited to 'Chemical_Engineering_Thermodynamics') diff --git a/Chemical_Engineering_Thermodynamics/README.txt b/Chemical_Engineering_Thermodynamics/README.txt deleted file mode 100755 index 98c63c7c..00000000 --- a/Chemical_Engineering_Thermodynamics/README.txt +++ /dev/null @@ -1,10 +0,0 @@ -Contributed By: Jai Mathur -Course: mca -College/Institute/Organization: IIT -Department/Designation: System Admin -Book Title: Chemical Engineering Thermodynamics -Author: Y. V. C. Rao -Publisher: Universities Press -Year of publication: 1997 -Isbn: 81-7371-048-1 -Edition: 1 \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch1.ipynb b/Chemical_Engineering_Thermodynamics/ch1.ipynb deleted file mode 100755 index c7a29075..00000000 --- a/Chemical_Engineering_Thermodynamics/ch1.ipynb +++ /dev/null @@ -1,145 +0,0 @@ -{ - "metadata": { - "name": "", - "signature": "sha256:4f7d90cd7b10a2be32d6f9985c84b88b7895b54f53fda509a7ab6972ab90144a" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 1 : Introduction" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 1.1 Page No : 6" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "\n", - "# Variables\n", - "weight = 981. \t\t\t #weight of payload in N\n", - "gmoon = 1.62;\t\t\t #acceleration due to gravity on the moon in m/s**2\n", - "g = 9.81;\t\t\t #acceleration due to gravity on earth\n", - "\n", - "# Calculations\n", - "mass = weight/g; \t\t\t # Calculations of mass of the payload in kg (calculated as F = m*g)\n", - "weightmoon = mass*gmoon;\t\t\t # Calculations of weight of payload on the moon in N\n", - "\n", - "# Results\n", - "print ' The weight of payload on the moon = %d N'%(weightmoon);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The weight of payload on the moon = 162 N\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 1.2 Page No : 7" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "\n", - "# Variables\n", - "l = 15.;\t\t\t #length of the child's head in cm\n", - "b = 12.;\t\t\t #breadth of the child's head in cm\n", - "p = 101325.;\t\t\t #atmospheric pressure in Pa\n", - "\n", - "# Calculations\n", - "area = (l*b)/(10**4);\t\t\t # Calculations of area of the child's head in m**2\n", - "force = p*area;\t\t\t # Calculations of force exerted on the child's head due to atmospheric air in N\n", - "\n", - "# Results\n", - "print ' The force exerted on the childs head due to atmospheric air = %.2f N'%(force);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The force exerted on the childs head due to atmospheric air = 1823.85 N\n" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 1.3 Page No : 7" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "\n", - "\n", - "# Variables\n", - "rho_water = 1000.;\t\t\t #density of water flowing through the pipeline in kg/m**3\n", - "rho_manomtr = 1595.;\t\t #density of manometric fluid (carbon tetrachloride) in kg/m**3\n", - "l = 40.;\t \t\t #length between the selected sections in cm\n", - "theta = 45.\t\t\t #inclination of the manometer in degrees\n", - "g = 9.81;\t \t\t #acceleration due to gravity in m/s**2\n", - "\n", - "# Calculations\n", - "delp = (l/100.)*math.sin((theta*math.pi)/180.)*g*(rho_manomtr-rho_water); # Calculations of pressure drop between the required sections in Pa\n", - "\n", - "# Results\n", - "print ' The pressure drop between the required sections = %.2f Pa'%delp\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The pressure drop between the required sections = 1650.94 Pa\n" - ] - } - ], - "prompt_number": 13 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch10.ipynb b/Chemical_Engineering_Thermodynamics/ch10.ipynb deleted file mode 100755 index 5d1a66e8..00000000 --- a/Chemical_Engineering_Thermodynamics/ch10.ipynb +++ /dev/null @@ -1,202 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 10 : Stability and phase transition in thermodynamic systems" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 10.2 Page No : 369" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "P = 2;\t\t\t #number of phases (no unit)\n", - "C = 2;\t\t\t #number of components (no unit)\n", - "\n", - "# Calculations\n", - "F = C+2-P\n", - "\n", - "# Results\n", - "print \" The number of degrees of freedom = %d \"%(F);\n", - "print \"Two intensive properties are required to be specified to\\\n", - " describe the thermodynamic state of the system,and the fundamental relation in\\\n", - " the Gibbs free energy representation for this system is of the type, G = GT,P,N1,N2\"\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The number of degrees of freedom = 2 \n", - "Two intensive properties are required to be specified to describe the thermodynamic state of the system,and the fundamental relation in the Gibbs free energy representation for this system is of the type, G = GT,P,N1,N2\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 10.3 Page No : 370" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import cmath\n", - "import math\n", - "\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature of n-octane vapour in K\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "w = 0.398;\t\t\t #acentric factor (no unit) \n", - "\n", - "# Calculations\n", - "Pguess = 0.215\n", - "\n", - "\n", - "Tr = T/Tc\n", - "Pr = (Pguess*10**6)/(Pc*10**5)\n", - "S = 0.37464+(1.54226*w)-(0.26992*w**2)\n", - "alpha1 = (1+(S*(1-math.sqrt(Tr))))**2;\n", - "a = (0.45724*R**2*Tc**2*alpha1)/(Pc*10**5)\n", - "b = (0.07780*R*Tc)/(Pc*10**5);\t\t\t \n", - "A = (a*Pguess*10**6)/(R*T)**2;\t\t\t \n", - "B = (b*Pguess*10**6)/(R*T);\t\t\t \n", - "alpha = -1+B\n", - "beeta = A-(2*B)-(3*B**2)\n", - "gaamma = -(A*B)+(B**2)+(B**3)\n", - "p = beeta-(alpha**2)/3;\t\t\n", - "q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4)+(((p)**3)/27);\t\t\t \n", - "\n", - "\n", - "if D>0:\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3);\n", - " Z_l = Z;\n", - " Z_v = Z;\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3);\t\t\t \n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Z = [Z1 ,Z2, Z3];\n", - " Z_l = min(Z);\n", - " Z_v = max(Z);\n", - "else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\t \n", - " theta = math.acos((-(q)/2)*(1./r));\t\t\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3)\n", - " Z = [Z1, Z2, Z3];\n", - " Z_l = min(Z)\n", - " Z_v = max(Z)\n", - "\n", - "\n", - "phi_l = math.exp(Z_l-1-math.log(Z_l-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_l+(B*(1+math.sqrt(2))))/(Z_l+(B*(1-math.sqrt(2)))))));\n", - "phi_v = math.exp(Z_v-1-math.log(Z_v-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_v+(B*(1+math.sqrt(2))))/(Z_v+(B*(1-math.sqrt(2)))))));\n", - "fl = Pguess*phi_l;\t\t\t # Calculations of the fugacity of the liquid in MPa\n", - "fv = Pguess*phi_v;\t\t\t # Calculations of the fugacity of the vapour in MPa\n", - "tolerance = 1e-3;\t\t\t #defining the tolerance to compare fl and fv\n", - "\n", - "if abs(fl-fv)tolerance:\n", - " Tr = T/Tc\n", - " Pr = (Prevised*10**6)/(Pc*10**5);\n", - " S = 0.37464+(1.54226*w)-(0.26992*w**2)\n", - " alpha1 = (1+(S*(1-math.sqrt(Tr))))**2;\n", - " a = (0.45724*R**2*Tc**2*alpha1)/(Pc*10**5)\n", - " b = (0.07780*R*Tc)/(Pc*10**5);\t\t\t \n", - " A = (a*Prevised*10**6)/(R*T)**2;\t\t\n", - " B = (b*Prevised*10**6)/(R*T);\t\t\t\n", - " alpha = -1+B;\t\t\t \n", - " beeta = A-(2*B)-(3*B**2);\n", - " gaamma = -(A*B)+(B**2)+(B**3)\n", - " p = beeta-(alpha**2)/3;\t\t\n", - " q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - " D = (((q)**2)/4)+(((p)**3)/27);\t\n", - " \n", - " if D > 0:\n", - " Z=((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3); #One real root given by Eq.(3.32)\n", - " Z_l=Z;\n", - " Z_v=Z;\n", - " elif D==0:\n", - " Z1=((-2*(q/2))**(1./3))-(alpha/3); #Three real roots and two equal given by Eq.(3.33)\n", - " Z2=((q/2)**(1./3))-(alpha/3);\n", - " Z3=((q/2)**(1./3))-(alpha/3);\n", - " Z=[Z1, Z2, Z3];\n", - " Z_l=min(Z);\n", - " Z_v=max(Z);\n", - " else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\t \n", - " theta = math.acos((-(q)/2)*(1./r));\t\t\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - " Z = [Z1, Z2, Z3];\n", - " Z_l = Z[0];\n", - " Z_v = Z[1];\n", - "\n", - " phi_l = math.exp(Z_l-1-math.log(Z_l-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_l+(B*(1+math.sqrt(2))))/(Z_l+(B*(1-math.sqrt(2)))))));\n", - " phi_v = math.exp(Z_v-1-math.log(Z_v-B)-((a/(2*math.sqrt(2)*b*R*T))*math.log((Z_v+(B*(1+math.sqrt(2))))/(Z_v+(B*(1-math.sqrt(2)))))));\n", - " fl = Prevised*phi_l;\t\n", - " fv = Prevised*phi_v;\t\n", - " Prevised = Prevised*fl/fv\n", - "\n", - "P = Prevised;\t\t\t\n", - "\n", - "# Results\n", - "print \" The vapour pressure of n-octane at 427.85K = %.5f\"%P,\" MPa\"\n", - "\n", - "# Note: answer is slightly differnt because of rounding off error." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The vapour pressure of n-octane at 427.85K = 0.21196 MPa\n" - ] - } - ], - "prompt_number": 34 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch11.ipynb b/Chemical_Engineering_Thermodynamics/ch11.ipynb deleted file mode 100755 index 9c8a35bf..00000000 --- a/Chemical_Engineering_Thermodynamics/ch11.ipynb +++ /dev/null @@ -1,585 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 11 : Properties of solutions" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.1 Page No : 378" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "%matplotlib inline\n", - "import math \n", - "from numpy import *\n", - "from matplotlib.pyplot import *\n", - "\n", - "\n", - "# Variables\n", - "antoine_const_benzene = [6.87987,1196.760,219.161]\n", - "antoine_const_toluene = [6.95087,1342.310,219.187]\n", - "t = 95.\n", - "P = 101.325\n", - "\n", - "# Calculations\n", - "P1_s = 10**(antoine_const_benzene[0]-(antoine_const_benzene[1]/(t+antoine_const_benzene[2])))\t\t\t \n", - "P2_s = 10**(antoine_const_toluene[0]-(antoine_const_toluene[1]/(t+antoine_const_toluene[2])))\t\t\t\n", - "x1 = linspace(0,1,10)\n", - "i = 0;\t\t\t #iteration parameter\n", - "n = len(x1);\t\t\t #iteration parameter\n", - "P_tot = zeros(10)\n", - "y1 = zeros(10)\n", - "\n", - "while i" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.2 Page No : 384" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 95. \t\t \t #temperature of the equimolar vapour mixture of benzene and toluene in degree celsius\n", - "y1 = 0.5\t \t\t #mole fraction of benzene in vapour phase (no unit)\n", - "y2 = 0.5 \t\t\t #mole fraction of toluene in vapour phase (no unit)\n", - "P1_s = 1176.21\t\t\t #saturation pressure of benzene at T, taken from Example 11.1 in Torr\n", - "P2_s = 477.03\t\t\t #saturation pressure of toluene at T, taken from Example 11.1 in Torr\n", - "\n", - "# Calculations\n", - "P = 1./((y1/P1_s)+(y2/P2_s))\n", - "x1 = (y1*P)/P1_s;\t\t\t \n", - "x2 = 1-x1\n", - "\n", - "# Results\n", - "print 'The composition of the liquid which is in equilibrium with the equimolar vapour mixture of\\\n", - " benzene and toluene at 95 degree celsius is mole fraction of benzene\\\n", - " in liquid phase x1 = %f mole fraction of toluene in liquid phase x2 = %f '%(x1,x2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The composition of the liquid which is in equilibrium with the equimolar vapour mixture of benzene and toluene at 95 degree celsius is mole fraction of benzene in liquid phase x1 = 0.288542 mole fraction of toluene in liquid phase x2 = 0.711458 \n" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.5 page no : 386" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# Variables\n", - "n_pentaneA = 6.87632 # Antoine constants\n", - "n_hexaneA = 6.91058\n", - "n_heptanA = 6.89386\n", - "n_pentaneB = 1075.780 \n", - "n_hexaneB = 1189.640\n", - "n_heptanB = 1264.370\n", - "n_pentaneC = 233.205\n", - "n_hexaneC = 226.205\n", - "n_heptanC = 216.640\n", - "pressure = 90 # pressure\n", - "\n", - "# Calculations\n", - "logP1 = n_pentaneA - (n_pentaneB/(90 + n_pentaneC))\n", - "P1 = round(10**logP1 *133.322 /1000,1)\n", - "logP2 = n_hexaneA - (n_hexaneB/(90 + n_hexaneC))\n", - "P2 = round(10**logP2 *133.322 /1000,2)\n", - "logP3 = n_heptanA - (n_heptanB/(90 + n_heptanC))\n", - "P3 = round(10**logP3 *133.322 /1000,2)\n", - "P = 200\n", - "K1 = round(P1/P,3)\n", - "K2 = round(P2/P,2)\n", - "K3 = P3/P\n", - "\n", - "# assume L/F = 0.4\n", - "L_F = 0.4\n", - "x1 = 0.3/(L_F + (1-L_F) * K1)\n", - "x2 = 0.3/(L_F + (1-L_F) * K2)\n", - "x3 = 0.4/(L_F + (1-L_F) * K3)\n", - "sum_x = x1+x2+x3\n", - "\n", - "# assume L/F = 0.752\n", - "L_F = 0.752\n", - "x1 = 0.3/(L_F + (1-L_F) * K1)\n", - "x2 = 0.3/(L_F + (1-L_F) * K2)\n", - "x3 = 0.4/(L_F + (1-L_F) * K3)\n", - "sum_x = round(x1+x2+x3,1) # which is equal to 1 \n", - "\n", - "# Hence, L/F = 0.752 is correct\n", - "y1 = K1*x1\n", - "y2 = K2*x2\n", - "y3 = K3*x3\n", - "\n", - "# Results\n", - "print \"Hence, fraction vaporized, V/F = 1-(L-F) = %.3f\"%(1-L_F)\n", - "print \"Compositions of liquid and vapor leaving the flash unit are :\"\n", - "print \"x1 = %.4f y1 = %.4f\"%(x1,y1)\n", - "print \"x2 = %.4f y2 = %.4f\"%(x2,y2)\n", - "print \"x3 = %.4f y3 = %.4f\"%(x3,y3)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Hence, fraction vaporized, V/F = 1-(L-F) = 0.248\n", - "Compositions of liquid and vapor leaving the flash unit are :\n", - "x1 = 0.2246 y1 = 0.5285\n", - "x2 = 0.3045 y2 = 0.2863\n", - "x3 = 0.4709 y3 = 0.1851\n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.7 Page No : 397" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 45.\t \t\t #temperature of the mixture in degree celsius\n", - "A = 2.230\t\t\t #van laar constant for the system at T (no unit)\n", - "B = 1.959\t\t\t #van laar constant for the system at T (no unit)\n", - "n1 = 30. \t\t #mole percentage of nitromethane in the mixture ( in percentage)\n", - "\n", - "# Calculations\n", - "n2 = 100-n1\n", - "x1 = n1/100\n", - "x2 = 1-x1\n", - "gaamma1 = math.exp(A/(1+((A/B)*(x1/x2)))**2)\n", - "gaamma2 = math.exp(B/(1+((B/A)*(x2/x1)))**2)\n", - "\n", - "# Results\n", - "print 'The activity coefficients for the system using van laar equation is : gamma1 \\\n", - " = %f, gamma2 = %f \\t '%( gaamma1,gaamma2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The activity coefficients for the system using van laar equation is : gamma1 = 2.738343, gamma2 = 1.234443 \t \n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.8 Page No : 397" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "n_azeo = 44.8;\t\t\t #azeotropic composition given as mole percentage\n", - "Tb = 68.24;\t\t\t #boiling point of mixture in degree celsius\n", - "P = 760.;\t\t\t #pressure in Torr\n", - "P1_s = 506.;\t\t\t #saturation pressure of ethanol at Tb in Torr\n", - "P2_s = 517.;\t\t\t #saturation pressure of benzene at Tb in Torr\n", - "n1 = 10.;\t\t\t #mole percentage of ethanol in the mixture (in percentage)\n", - "\n", - "# Calculations\n", - "x1 = n_azeo/100\n", - "x2 = 1-x1;\t\t\n", - "gaamma1 = P/P1_s\n", - "gaamma2 = P/P2_s\n", - "A = math.log(gaamma1)*(1+((x2*math.log(gaamma2))/(x1*math.log(gaamma1))))**2\n", - "B = math.log(gaamma2)*(1+((x1*math.log(gaamma1))/(x2*math.log(gaamma2))))**2\n", - "x1 = n1/100\n", - "x2 = 1-x1;\t\n", - "gaamma1 = math.exp(A/(1+((A/B)*(x1/x2)))**2)\n", - "gaamma2 = math.exp(B/(1+((B/A)*(x2/x1)))**2)\n", - "\n", - "# Results\n", - "print 'The van Laar constants for the system are : A = %f \\t B = %f '%(A,B)\n", - "print 'The activity coefficients for the system using van laar equation are\\\n", - " : gamma1 = %f \\t gamma2 = %f \\t '%( gaamma1,gaamma2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The van Laar constants for the system are : A = 1.910203 \t B = 1.328457 \n", - "The activity coefficients for the system using van laar equation are : gamma1 = 4.137783 \t gamma2 = 1.025531 \t \n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.9 Page No : 399" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "\n", - "T = 45. \t\t\t #temperature of the system in degree celsius\n", - "A_12 = 0.1156;\t\t\t #Wilson's parameter for the system at T (no unit)\n", - "A_21 = 0.2879;\t\t\t #Wilson's parameter for the system at T (no unit)\n", - "x1 = 0.3;\t \t\t #mole fraction of nitromethane in the liquid mixture (no unit)\n", - "\n", - "# Calculations\n", - "x2 = 1-x1\n", - "ln_gaamma1 = -math.log(x1+(A_12*x2))+(x2*((A_12/(x1+(A_12*x2)))-(A_21/((A_21*x1)+x2))));\t\t\t\n", - "gaamma1 = math.exp(ln_gaamma1)\n", - "ln_gaamma2 = -math.log(x2+(A_21*x1))-(x1*((A_12/(x1+(A_12*x2)))-(A_21/((A_21*x1)+x2))));\t\t\t # Calculations of ln(activity coefficient) using Eq.(11.90) (no unit)\n", - "gaamma2 = math.exp(ln_gaamma2)\n", - "\n", - "# Results\n", - "print 'The activity coefficients for the system using Wilsons parameters are : gamma1 = %f \\\n", - " \\t gamma2 = %f \\t '%( gaamma1,gaamma2);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The activity coefficients for the system using Wilsons parameters are : gamma1 = 2.512605 \t gamma2 = 1.295788 \t \n" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.10 Page No : 401" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 345.\t\t\t #temperature of the mixture in K\n", - "x1 = 0.8\t\t\t #mole fraction of ethanol in the liquid phase (no unit)\n", - "\n", - "nu_ki = [1,1,1,6]\t\t\t #number of groups of type: CH3, CH2, OH and ACH respectively (no unit)\n", - "R_k = [0.9011,0.6744,1.0000,0.5313];\t\t\t #Group volume parameter for CH3, CH2, OH and ACH respectively (no unit)\n", - "Q_k = [0.848,0.540,1.200,0.400];\t\t\t #Area parameter for CH3, CH2, OH and ACH respectively (no unit)\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "u12_u22 = -241.2287;\t\t#UNIQUAC parameter for the system in J/molK\n", - "u21_u11 = 2799.5827;\t\t#UNIQUAC parameter for the system in J/molK\n", - "z = 10. \t\t\t #co-ordination number usually taken as 10 (no unit)\n", - "\n", - "# Calculations\n", - "x2 = 1-x1\n", - "r1 = (nu_ki[0]*R_k[0])+(nu_ki[1]*R_k[1])+(nu_ki[2]*R_k[2]);\t\t\t \n", - "r2 = (nu_ki[3]*R_k[3])\n", - "phi1 = (x1*r1)/((x1*r1)+(x2*r2));\t\t\t \n", - "phi2 = (x2*r2)/((x2*r2)+(x1*r1));\t\t\t \n", - "q1 = (nu_ki[0]*Q_k[0])+(nu_ki[1]*Q_k[1])+(nu_ki[2]*Q_k[2])\t\t\t \n", - "q2 = (nu_ki[3]*Q_k[3])\t\t\t\n", - "theta1 = (x1*q1)/((x1*q1)+(x2*q2))\n", - "theta2 = (x2*q2)/((x1*q1)+(x2*q2))\n", - "l1 = ((z/2)*(r1-q1))-(r1-1);\t\t\n", - "l2 = ((z/2)*(r2-q2))-(r2-1);\t\t\n", - "tau_12 = math.exp(-(u12_u22)/(R*T));\t\t\n", - "tau_21 = math.exp(-(u21_u11)/(R*T));\t\t\n", - "tau_11 = 1.0;\t\t\t \n", - "tau_22 = 1.0;\t\t\t \n", - "\n", - "ln_gaamma1_c = math.log(phi1/x1)+((z/2)*q1*math.log(theta1/phi1))+l1-((phi1/x1)*((x1*l1)+(x2*l2)));\n", - "ln_gaamma2_c = math.log(phi2/x2)+((z/2)*q2*math.log(theta2/phi2))+l2-((phi2/x2)*((x1*l1)+(x2*l2)));\n", - "ln_gaamma1_r = q1*(1-math.log((theta1*tau_11)+(theta2*tau_21))-(((theta1*tau_11)/((theta1*tau_11)+(theta2*tau_21)))+((theta2*tau_12)/((theta1*tau_12)+(theta2*tau_22)))));\n", - "ln_gaamma2_r = q2*(1-math.log((theta1*tau_12)+(theta2*tau_22))-(((theta1*tau_21)/((theta1*tau_11)+(theta2*tau_21)))+((theta2*tau_22)/((theta1*tau_12)+(theta2*tau_22)))));\n", - "ln_gaamma1 = ln_gaamma1_c+ln_gaamma1_r\n", - "ln_gaamma2 = ln_gaamma2_c+ln_gaamma2_r\n", - "gaamma1 = math.exp(ln_gaamma1);\t\t\t \n", - "gaamma2 = math.exp(ln_gaamma2);\t\t\t \n", - "\n", - "# Results\n", - "print 'The activity coefficients for the system using the UNIQUAC equation are : gamma1 \\\n", - " = %f \\t gamma2 = %f \\t '%( gaamma1,gaamma2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The activity coefficients for the system using the UNIQUAC equation are : gamma1 = 1.060567 \t gamma2 = 3.679066 \t \n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 11.11 Page No : 405" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 307.\t\t\t #temperature of the mixture in K\n", - "x1 = 0.3\t\t\t #mole fraction of acetone in the liquid phase (no unit)\n", - "\n", - "nu_ki = [1.,1.,2.,3.]\n", - "R_k = [0.9011,1.6724,0.6744]\n", - "Q_k = [0.848,1.488,0.540];\t\t\t \n", - "a_19 = 476.40;\t\t\t #group interaction parameter for the system in K\n", - "a_91 = 26.760;\t\t\t #group interaction parameter for the system in K\n", - "z = 10. \t\t\t #co-ordination number usually taken as 10 (no unit)\n", - "\n", - "# Calculations\n", - "x2 = 1-x1;\t\t\t # Calculations of mole fraction of benzene in liquid phase (no unit)\n", - "r1 = (nu_ki[0]*R_k[0])+(nu_ki[1]*R_k[1])\n", - "r2 = (nu_ki[2]*R_k[0])+(nu_ki[3]*R_k[2])\n", - "phi1 = (x1*r1)/((x1*r1)+(x2*r2))\n", - "phi2 = (x2*r2)/((x2*r2)+(x1*r1))\n", - "q1 = (nu_ki[0]*Q_k[0])+(nu_ki[1]*Q_k[1])\t\t\t\n", - "q2 = (nu_ki[2]*Q_k[0])+(nu_ki[3]*Q_k[2])\n", - "theta1 = (x1*q1)/((x1*q1)+(x2*q2));\n", - "theta2 = (x2*q2)/((x1*q1)+(x2*q2));\n", - "l1 = ((z/2)*(r1-q1))-(r1-1);\t\t\n", - "l2 = ((z/2)*(r2-q2))-(r2-1);\t\t\n", - "ln_gaamma1_c = math.log(phi1/x1)+((z/2)*q1*math.log(theta1/phi1))+l1-((phi1/x1)*((x1*l1)+(x2*l2)));\n", - "ln_gaamma2_c = math.log(phi2/x2)+((z/2)*q2*math.log(theta2/phi2))+l2-((phi2/x2)*((x1*l1)+(x2*l2)));\n", - "a_11 = 0.\n", - "a_99 = 0.\n", - "psi_19 = math.exp(-(a_19)/(T));\t\t\t\n", - "psi_91 = math.exp(-(a_91)/(T));\t\t\t\n", - "psi_11 = 1.;\t\t\t \n", - "psi_99 = 1.;\t\t\t \n", - "x1_1 = nu_ki[0]/(nu_ki[0]+nu_ki[1]);\t\t\t\n", - "x1_18 = nu_ki[1]/(nu_ki[0]+nu_ki[1]);\t\t\n", - "theta1_1 = (Q_k[0]*x1_1)/((Q_k[0]*x1_1)+(Q_k[1]*x1_18))\n", - "theta1_18 = (Q_k[1]*x1_18)/((Q_k[1]*x1_18)+(Q_k[0]*x1_1))\n", - "ln_tau1_1 = Q_k[0]*(1-math.log((theta1_1*psi_11)+(theta1_18*psi_91))-(((theta1_1*psi_11)/((theta1_1*psi_11)+(theta1_18*psi_91)))+((theta1_18*psi_19)/((theta1_1*psi_19)+(theta1_18*psi_11)))));\n", - "ln_tau1_18 = Q_k[1]*(1-math.log((theta1_1*psi_19)+(theta1_18*psi_99))-(((theta1_1*psi_91)/((theta1_1*psi_99)+(theta1_18*psi_91)))+((theta1_18*psi_99)/((theta1_1*psi_19)+(theta1_18*psi_99)))));\n", - "x2_1 = nu_ki[2]/(nu_ki[2]+nu_ki[3]);\t\t\t \n", - "x2_2 = nu_ki[3]/(nu_ki[2]+nu_ki[3]);\t\t\t \n", - "ln_tau2_1 = 0;\n", - "ln_tau2_2 = 0;\n", - "x_1 = ((x1*nu_ki[0])+(x2*nu_ki[2]))/((((x1*nu_ki[0])+(x1*nu_ki[1])))+((x2*nu_ki[2])+(x2*nu_ki[3])));\n", - "x_2 = ((x2*nu_ki[3]))/((((x1*nu_ki[0])+(x1*nu_ki[1])))+((x2*nu_ki[2])+(x2*nu_ki[3])));\n", - "x_18 = ((x1*nu_ki[1]))/((((x1*nu_ki[0])+(x1*nu_ki[1])))+((x2*nu_ki[2])+(x2*nu_ki[3])));\n", - "theta_1 = (Q_k[0]*x_1)/((Q_k[0]*x_1)+(Q_k[1]*x_18)+(Q_k[2]*x_2));\t\t\t\n", - "theta_2 = (Q_k[2]*x_2)/((Q_k[0]*x_1)+(Q_k[1]*x_18)+(Q_k[2]*x_2));\t\t\t\n", - "theta_18 = (Q_k[1]*x_18)/((Q_k[0]*x_1)+(Q_k[1]*x_18)+(Q_k[2]*x_2));\t\t\t\n", - "ln_tau_1 = Q_k[0]*(1-math.log((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91))-((((theta_1*psi_11)+(theta_2*psi_11))/((((theta_1*psi_11)+(theta_2*psi_11))+(theta_18*psi_91)))+((theta_18*psi_19)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));\n", - "ln_tau_2 = Q_k[2]*(1-math.log((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91))-((((theta_1*psi_11)+(theta_2*psi_11))/((((theta_1*psi_11)+(theta_2*psi_11))+(theta_18*psi_91)))+((theta_18*psi_19)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));\n", - "ln_tau_18 = Q_k[1]*(1-math.log((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_99))-(((((theta_1+theta_2)*psi_91)/((theta_1*psi_11)+(theta_2*psi_11)+(theta_18*psi_91)))+((theta_18*psi_99)/((theta_1*psi_19)+(theta_2*psi_19)+(theta_18*psi_11))))));\n", - "ln_gaamma1_r = (nu_ki[0]*(ln_tau_1-ln_tau1_1))+(nu_ki[1]*(ln_tau_18-ln_tau1_18));\n", - "ln_gaamma2_r = (nu_ki[2]*(ln_tau_1-ln_tau2_1))+(nu_ki[3]*(ln_tau_2-ln_tau2_2));\n", - "ln_gaamma1 = ln_gaamma1_c+ln_gaamma1_r\n", - "ln_gaamma2 = ln_gaamma2_c+ln_gaamma2_r\n", - "gaamma1 = math.exp(ln_gaamma1);\t\t\t\n", - "gaamma2 = math.exp(ln_gaamma2);\t\t\t\n", - "\n", - "# Results\n", - "print 'The activity coefficients for the system using the UNIFAC method are\\\n", - " : gamma1 = %f \\t gamma2 = %f \\t '%( gaamma1,gaamma2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The activity coefficients for the system using the UNIFAC method are : gamma1 = 2.149891 \t gamma2 = 1.191192 \t \n" - ] - } - ], - "prompt_number": 4 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch12.ipynb b/Chemical_Engineering_Thermodynamics/ch12.ipynb deleted file mode 100755 index fe626468..00000000 --- a/Chemical_Engineering_Thermodynamics/ch12.ipynb +++ /dev/null @@ -1,716 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 12 : Vapor liquid Equilibrium" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 12.1 Page No : 423" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "%matplotlib inline\n", - "import math \n", - "from numpy import *\n", - "from matplotlib.pyplot import *\n", - "\n", - "# Variables\n", - "T = 60.\t\t\t #temperature of the system in degree celsius\n", - "P = [237.60,265.20,317.50,333.00,368.70,387.20];\t\t\t #Pressure data in Torr (from Danneil et al.)\n", - "x1 = [0.0870,0.1800,0.4040,0.4790,0.7130,0.9070];\t\t\t #mole fraction of benzene in the liquid phase corresponding to the given pressure (no unit) (from Danneil et al.)\n", - "y1 = [0.1870,0.3400,0.5780,0.6420,0.7960,0.9220];\t\t\t #mole fraction of benzene in the vapour phase corresponding to the given pressure (no unit) (from Danneil et al.)\n", - "antoine_const_benzene = [6.87987,1196.760,219.161];\t\t\t #Antoine's constants for Benzene from Table A.7\n", - "antoine_const_heptane = [6.89386,1264.370,216.640];\t\t\t #Antoine's constants for heptane from Table A.7\n", - "\n", - "# Calculations\n", - "P1_s = 10**(antoine_const_benzene[0]-(antoine_const_benzene[1]/(T+antoine_const_benzene[2])));\n", - "P2_s = 10**(antoine_const_heptane[0]-(antoine_const_heptane[1]/(T+antoine_const_heptane[2])));\n", - "l = len(P);\t\t\t #iteration parameter\n", - "i = 0;\t\t\t #iteration parameter\n", - "gaamma1 = zeros(l)\n", - "gaamma2 = zeros(l)\n", - "ln_gaamma1_expt = zeros(l)\n", - "ln_gaamma2_expt = zeros(l)\n", - "gE_RTx1x2 = zeros(l)\n", - "while i" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 12.3 Page No : 430" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from numpy import *\n", - "# Variables\n", - "T = 25. \t\t\t #temperature of the system in degree celsius\n", - "A12 = 2.0522;\t\t\t #three suffix Margules parameters for the system (no unit)\n", - "A21 = 1.7201;\t\t\t #three suffix Margules parameters for the system (no unit)\n", - "P = [118.05,207.70,246.35,259.40,261.50,262.00,261.90,258.70,252.00];\t\t\t #Pressure data in Torr (from Tasic et al.)\n", - "x1 = [0.0115,0.1125,0.3090,0.5760,0.6920,0.7390,0.7575,0.8605,0.9250];\n", - "y1 = [0.1810,0.5670,0.6550,0.7050,0.7250,0.7390,0.7460,0.8030,0.8580];\n", - "antoine_const_acetone = [7.11714,1210.595,229.664];\t\t\t #Antoine's constants for acetone from Table A.7\n", - "antoine_const_chexane = [6.85146,1206.470,223.136];\t\t\t #Antoine's constants for cyclohexane from Table A.7\n", - "\n", - "# Calculations\n", - "P1_s = 10**(antoine_const_acetone[0]-(antoine_const_acetone[1]/(T+antoine_const_acetone[2])));\n", - "P2_s = 10**(antoine_const_chexane[0]-(antoine_const_chexane[1]/(T+antoine_const_chexane[2])));\n", - "\n", - "l = len(P)\n", - "ln_gaamma1 = zeros(l)\n", - "ln_gaamma2 = zeros(l)\n", - "gaamma1 = zeros(l)\n", - "gaamma2 = zeros(l)\n", - "P = zeros(l)\n", - "y1_calc = zeros(l)\n", - "j = 0;\t\n", - "\n", - "while j" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 12.9 Page No : 464" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from numpy import *\n", - "from matplotlib.pyplot import *\n", - "%matplotlib inline\n", - "# Variables\n", - "\n", - "P = 760.\t\t\t #pressure of the system in Torr\n", - "antoine_const_benzene = [6.87987,1196.760,219.161];\t\t\t #Antoine's constants for Benzene from Table A.7\n", - "t = linspace(60,100,9);\t\t\t #temperature range in degree celsius\n", - "\n", - "P2_s = [149.40,187.58,233.71,289.13,355.21,433.51,525.84,634.00,760.00];\n", - "x1 = linspace(0,1,6)\n", - "\n", - "# Calculations\n", - "l = len(t)\n", - "i = 0\n", - "P1_s = zeros(l)\n", - "P_tot = zeros(l)\n", - "\n", - "while i" - ] - } - ], - "prompt_number": 8 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch13.ipynb b/Chemical_Engineering_Thermodynamics/ch13.ipynb deleted file mode 100755 index 8dc5f0be..00000000 --- a/Chemical_Engineering_Thermodynamics/ch13.ipynb +++ /dev/null @@ -1,235 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 13 : Dilute solution laws" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 13.1 Page No : 478" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "weight = 10. \t\t\t #weight of NaCl in grams\n", - "volume = 1. \t \t\t #volume of water in litres\n", - "weight_water = 1000. \t\t\t # weight of water in grams (Weight = Volume*Density, density of water = 1g/cc = 1g/ml = 1000g/l)\n", - "molwt_NaCl = 58.5 \t\t\t #molecular weight of NaCl in grams\n", - "molwt_water = 18. \t\t\t #molecular weight of water in grams\n", - "hf = 6.002; \t\t\t #enthalpy change of fusion in kJ/mol at 0 degree celsius\n", - "P = 101.325; \t\t\t #pressure in kPa\n", - "T = 273.15; \t\t\t # freezing point temperature of water at the given pressure in K\n", - "R = 8.314; \t\t\t #universal gas constant in J/molK;\n", - "\n", - "# Calculations\n", - "x2 = (weight/molwt_NaCl)/((weight/molwt_NaCl)+(weight_water/molwt_water))\n", - "delt = (R*T**2*x2)/(hf*10**3)\n", - "\n", - "# Results\n", - "print ' The depression in freezing point of water when 10g of NaCl solute is added = %0.2f K'%(delt);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The depression in freezing point of water when 10g of NaCl solute is added = 0.32 K\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 13.2 Page No : 480" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "weight = 10.; \t\t \t #weight of NaCl in grams\n", - "volume = 1.; \t\t\t #volume of water in litres\n", - "weight_water = 1000.; \t\t\t # weight of water in grams (Weight = Volume*Density, density of water = 1g/cc = 1g/ml = 1000g/l)\n", - "molwt_NaCl = 58.5; \t\t\t #molecular weight of NaCl in grams\n", - "molwt_water = 18; \t\t\t #molecular weight of water in grams\n", - "lat_ht = 2256.94; \t\t\t #latent heat of vaporization in kJ/kg at 100 degree celsius (obtained from steam tables)\n", - "P = 101.325; \t\t\t #pressure in kPa\n", - "T = 373.15; \t\t\t #boiling point temperature of water at the given pressure in K\n", - "R = 8.314; \t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "x2 = 0.0031\n", - "hv = (lat_ht*molwt_water)/1000\n", - "delt = (R*T**2*x2)/(hv*10**3)\n", - "\n", - "# Results\n", - "print ' The elevation in boiling point of water when 10g of NaCl solute is added = %0.2f K'%(delt);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The elevation in boiling point of water when 10g of NaCl solute is added = 0.09 K\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 13.3 Page No : 481" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "weight = 10.; \t\t\t #weight of NaCl in grams\n", - "weight_water = 1000.; \t\t\t # weight of water in grams\n", - "molwt_NaCl = 58.5; \t\t\t #molecular weight of NaCl in grams\n", - "molwt_water = 18.; \t\t\t #molecular weight of water in grams\n", - "T = 300.; \t\t\t #prevailing temperature of water in K\n", - "R = 8.314; \t\t\t #universal gas constant in (Pa m**3)/(mol K);\n", - "v = 18*10**-6;\t\t\t #molar volume in m**3/mol\n", - "\n", - "# Calculations\n", - "x2 = 0.0031\n", - "pi = ((R*T*x2)/v)*10**-3\n", - "\n", - "# Results\n", - "print ' The osmotic pressure of a solution conatining 10g of NaCl in 1000g of water at 300K = %0.2f kPa'%(pi);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The osmotic pressure of a solution conatining 10g of NaCl in 1000g of water at 300K = 429.56 kPa\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 13.4 Page No : 483" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "\n", - "\n", - "# Variables\n", - "temp = 20. \t\t\t # prevailing tempearture in degree celsius\n", - "melt_temp = 80.05; \t\t\t # melting point of naphthalene in degree celsius\n", - "hf = 18.574 \t\t\t # enthalpy of fusion in kJ/mol\n", - "R = 8.314 \t\t\t # universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "t = temp+273.15\n", - "melt_t = melt_temp+273.15\n", - "x2 = math.exp(((hf*10**3)/R)*((1./melt_t)-(1./t)))\n", - "\n", - "# Results\n", - "print ' The ideal solubility of naphthalene at 20 degree celsius = %0.4f'%(x2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The ideal solubility of naphthalene at 20 degree celsius = 0.2737\n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 13.5 Page No : 483" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "t = 295.43; \t\t\t #prevailing temperature in K\n", - "sat_p = 6.05; \t\t\t #Sasturation pressure of carbon dioxide at the prevailing temperature in MPa\n", - "p = 0.1; \t\t\t #pressure at which solubility has to be determined in MPa\n", - "\n", - "# Calculations\n", - "x2 = p/sat_p\n", - "\n", - "# Results\n", - "print ' The solubility of carbon dioxide expressed in mole fraction of carbon dioxide in solution\\\n", - " at 0.1MPa = %0.4f'%(x2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The solubility of carbon dioxide expressed in mole fraction of carbon dioxide in solution at 0.1MPa = 0.0165\n" - ] - } - ], - "prompt_number": 6 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch14.ipynb b/Chemical_Engineering_Thermodynamics/ch14.ipynb deleted file mode 100755 index e54d6be2..00000000 --- a/Chemical_Engineering_Thermodynamics/ch14.ipynb +++ /dev/null @@ -1,846 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 14 : Chemical reaction equilibrium" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.1 Page No : 489" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math\n", - "\n", - "# Variables\n", - "T = 298.15;\t\t\t #temperature in K\n", - "del_Gf = [-137.327,-228.600,-394.815,0]; #the standard Gibbs free energy of formation of CO(g),H2O(g),CO2(g) and H2(g) in kJ\n", - "n = [1,1,-1,-1] \t\t\t #stoichiometric coefficients of CO(g),H2O(g),CO2(g) and H2(g) respectively (no unit)\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "del_G = (n[0]*del_Gf[0])+(n[1]*del_Gf[1])+(n[2]*del_Gf[2])+(n[3]*del_Gf[3]);\n", - "Ka = math.exp((-(del_G*10**3))/(R*T))\n", - "\n", - "# Results\n", - "print 'The standard Gibbs free energy of the water gas shift reaction at 298.15K = %0.3f kJ '%(del_G);\n", - "print 'The equilibrium constant of the water gas shift reaction at 298.15K = %0.3e '%(Ka);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The standard Gibbs free energy of the water gas shift reaction at 298.15K = 28.888 kJ \n", - "The equilibrium constant of the water gas shift reaction at 298.15K = 8.685e-06 \n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.2 Page No : 490" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 298.15;\t\t\t #temperature in K\n", - "P_s = 0.16716;\t\t\t #saturation pressure of CH3OH in bar at T\n", - "del_G1 = -166.215\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "f_v = 1\n", - "f_l = P_s\n", - "del_G2 = R*T*math.log(f_v/f_l)*10**-3;\t\t\t # Calculations of the value of del_G2 in kJ\n", - "del_G = del_G2+del_G1;\t\t\n", - "\n", - "# Results\n", - "print 'The standard Gibbs free energy of formation of CH3OHg = %0.3f kJ '%(del_G);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The standard Gibbs free energy of formation of CH3OHg = -161.781 kJ \n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.3 Page No : 491" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "#The water gas shift reaction is given by: CO2(g)+H2(g)--->CO(g)+H2O(g)\n", - "T1 = 298.15 \t\t\t #initial temperature in K\n", - "Ka1 = 8.685*10**-6;\t\t\t #equilibrium constant for the water-gas shift reaction at T1 (no unit)\n", - "T2 = 1000.\t\t \t #temperature at which the equilibrium constant has to be determined in K\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "del_Hf = [-110.532,-241.997,-393.978,0];\t\t\t #the standard enthalpy of formation of CO(g),H2O(g),CO2(g) and H2(g) in kJ\n", - "n = [1,1,-1,-1];\t\t\t #stoichiometric coefficients of CO(g),H2O(g),CO2(g) and H2(g) respectively (no unit)\n", - "\n", - "# Calculations\n", - "#It is assumed that del_H is constant in the temperature range T1 and T2\n", - "del_H = (n[0]*del_Hf[0])+(n[1]*del_Hf[1])+(n[2]*del_Hf[2])+(n[3]*del_Hf[3])\n", - "Ka2 = Ka1*math.exp(((del_H*10**3)/R)*((1./T1)-(1./T2)));\t\t\t \n", - "\n", - "# Results\n", - "print 'The equilibrium constant for the water gas shift reaction at 1000K = %f '%(Ka2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The equilibrium constant for the water gas shift reaction at 1000K = 1.085357 \n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.4 Page No : 492" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "P = 0.1 \t\t\t #pressure in MPa\n", - "T1 = 298.15;\t\t\t #initial temperature in K\n", - "Ka1 = 8.685*10**-6;\t\t\t #equilibrium constant for the water-gas shift reaction at T1 (no unit) (from Example 14.1)\n", - "T2 = 1000. \t\t\t #temperature at which the equilibrium constant is to be found, in K\n", - "del_H = 41.449;\t\t\t #smath.tan(math.radiansard enthalpy of the reaction at T1 in kJ (from Example 14.3)\n", - "a = [28.068,28.850,45.369,27.012];\n", - "b = [4.631*10**-3,12.055*10**-3,8.688*10**-3,3.509*10**-3]\n", - "c = [0,0,0,0];\n", - "d = [0,0,0,0];\n", - "e = [-0.258*10**5,1.006*10**5,-9.619*10**5,0.690*10**5]\n", - "n = [1,1,-1,-1]\n", - "R = 8.314;\t\t\n", - "Ka2_prev = 1.0855\n", - "\n", - "\n", - "# Calculations\n", - "del_a = (n[0]*a[0])+(n[1]*a[1])+(n[2]*a[2])+(n[3]*a[3]);\n", - "del_b = (n[0]*b[0])+(n[1]*b[1])+(n[2]*b[2])+(n[3]*b[3]);\n", - "del_c = (n[0]*c[0])+(n[1]*c[1])+(n[2]*c[2])+(n[3]*c[3]);\n", - "del_d = (n[0]*d[0])+(n[1]*d[1])+(n[2]*d[2])+(n[3]*d[3]);\n", - "del_e = (n[0]*e[0])+(n[1]*e[1])+(n[2]*e[2])+(n[3]*e[3]);\n", - "del_H0 = (del_H*10**3)-((del_a*T1)+((del_b/2)*T1**2)+((del_c/3)*T1**3)+((del_d/4)*T1**4)-(del_e/T1));\n", - "I = (math.log(Ka1))-((1./R)*((-del_H0/T1)+(del_a*math.log(T1))+((del_b/2)*T1)+((del_c/6)*T1**2)+((del_d/12)*T1**3)+((del_e/(2*T1**2)))));\n", - "Ka2 = math.exp(((1./R)*((-del_H0/T2)+(del_a*math.log(T2))+((del_b/2)*T2)+((del_c/6)*T2**2)+((del_d/12)*T2**3)+((del_e/(2*T2**2)))))+I);\n", - "\n", - "\t\t\t # Results\n", - "print 'The equilibrium constant for the water gas shift reaction at 1000K\\\n", - " by taking into account the variation of del_H with temperature = %f '%(Ka2);\n", - "print 'The equilibrium constant for the water gas shift reaction at 1000K without\\\n", - " considering the variation of del_H with temperature as given by Example14.3 = %0.4f '%(Ka2_prev);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The equilibrium constant for the water gas shift reaction at 1000K by taking into account the variation of del_H with temperature = 0.664976 \n", - "The equilibrium constant for the water gas shift reaction at 1000K without considering the variation of del_H with temperature as given by Example14.3 = 1.0855 \n" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.5 page no : 494" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "import math\n", - "\n", - "# variables\n", - "deltaGf = -161.781 # kJ from exa. 14.2\n", - "deltaG298 = deltaGf - (-137.327)\n", - "deltaH298 = -200.660 - (-110.532)\n", - "deltaA = 18.382 - 28.068 - 2 * 27.012\n", - "deltaB = (101.564 - 4.631 - 2 * 3.509) * 10**-3\n", - "deltaC = -28.683 * 10**-6\n", - "deltaD = 0\n", - "deltaE = (0.258 - 2 * 0.690) * 10**5\n", - "T = 298.15\n", - "\n", - "# calculations\n", - "deltaHf298 = -238.648 + 37.988\n", - "deltaH0 = Symbol('deltaH0')\n", - "Eq = deltaH0 + deltaA*T + deltaB*T**2/2 + deltaC*T**3/3 - deltaE/T - deltaH298*1000\n", - "deltaH0 = solve(Eq,deltaH0)[0]/1000\n", - "I = Symbol('I')\n", - "\n", - "Eq1 = deltaH0*1000 - deltaA*T*math.log(T) - deltaB*T**2/2 - deltaC*T**3/6 - deltaD*T**4/12 - deltaE/(2*T) - 8.314 * T * I + 24454\n", - "I = round(solve(Eq1,I)[0],3)\n", - "\n", - "T = 500\n", - "deltaG500 = (deltaH0*1000 - deltaA*T*math.log(T) - deltaB*T**2/2 - deltaC*T**3/6 - deltaD*T**4/12 - deltaE/(2*T) - 8.314 * T * I)/1000\n", - "\n", - "Ka = math.exp(-22048/(8.314*T))\n", - "e = Symbol('e')\n", - "Eq3 = ( (e*(3-2*e)**2) / (1 - e)**3) / 0.4973 -1\n", - "e = round(solve(Eq3,e)[0],4)\n", - "yCH3OH = e/(3-2*e)\n", - "yco = (1-e)/(3-2*e)\n", - "yh2 = (2*(1-e) / (3-2*e))\n", - "\n", - "# Results\n", - "print \"E = %.4f\"%e\n", - "print \"YCH30H = %.4f\"%yCH3OH\n", - "print \"YCO = %.4f\"%yco\n", - "print \"YH2 = %.4f\"%yh2\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "E = 0.0506\n", - "YCH30H = 0.0175\n", - "YCO = 0.3275\n", - "YH2 = 0.6550\n" - ] - } - ], - "prompt_number": 103 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.6, Page 496" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy.solvers import solve \n", - "from sympy import Symbol \n", - "\n", - "#Variables\n", - "e = Symbol('e')\n", - "\n", - "#Calculations\n", - "x = solve((((e/(3-2*e))/(((1-e)/(3-2*e))*(((2*(1-e))/(3-2*e))**2)))-49.73),e)\n", - "print \"e =\",round(x[0],3)\n", - "ych3oh = x[0]/(3-2*x[0])\n", - "yco = (1-x[0])/(3-2*x[0])\n", - "yh2 = ((2*(1-x[0]))/(3-2*x[0]))\n", - "print \"yCH3OH =\",round(ych3oh,4)\n", - "print \"yCO =\",round(yco,4)\n", - "print \"yH2 =\",round(yh2,4)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "e = 0.801\n", - "yCH3OH = 0.5731\n", - "yCO = 0.1423\n", - "yH2 = 0.2846\n" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.7 pageno : 497" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "\n", - "# variables\n", - "Ka = 4.973*10**-3 # from example 14.5\n", - "Ky = 25 * Ka # from example 14.5\n", - "\n", - "# calculations\n", - "e = Symbol('e')\n", - "Eq1 = ( (e*(4-e)**2)/(1-e)**3 ) / .1243 - 1\n", - "e = round(solve(Eq1,e)[0],5)\n", - "yCH3OH = e/(8-2*e)\n", - "yco = (1-e)/(8-2*e)\n", - "yh2 = (2*(1-e) / (8-2*e))\n", - "yA = 5/(8-2*e)\n", - "\n", - "# Results\n", - "print \"E = %.5f\"%e\n", - "print \"YCH30H = %.5f\"%yCH3OH\n", - "print \"YCO = %.5f\"%yco\n", - "print \"YH2 = %.5f\"%yh2\n", - "print \"YA = %.5f\"%yA" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "E = 0.00762\n", - "YCH30H = 0.00095\n", - "YCO = 0.12428\n", - "YH2 = 0.24857\n", - "YA = 0.62619\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.8 pageno : 198" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "\n", - "# variables\n", - "Ka = 4.973*10**-3 # example 14.5\n", - "Ky = 25 * Ka # example 14.5\n", - "\n", - "# calculations and results\n", - "e = Symbol('e')\n", - "Eq1= ((e*(1-e))/(1-2*e)**2)/.03108 - 1\n", - "e = solve(Eq1,e)\n", - "print \"part a\"\n", - "print \"e = %.5f and e = %.5f\"%(e[0],e[1])\n", - "print \"The admissible value is e = %.5f\"%e[0]\n", - "\n", - "print \"part b\"\n", - "print \"e = 0.0506 ( from example 14.5 )\"\n", - "\n", - "x = 4\n", - "e = Symbol('e')\n", - "Eq1= ((e/(1-e) ) * ( (5 - 2*e)/ (2-e) )**2)/ 0.4973 - 1\n", - "e = solve(Eq1,e)\n", - "print \"part c\"\n", - "print \"e = %.4f\" %(e[0])" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "part a\n", - "e = 0.02845 and e = 0.97155\n", - "The admissible value is e = 0.02845\n", - "part b\n", - "e = 0.0506 ( from example 14.5 )\n", - "part c" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "e = 0.0727\n" - ] - } - ], - "prompt_number": 134 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.9 pageno : 499" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "\n", - "# variables\n", - "Ka = 4.973*10**-3 # example 14.5\n", - "Ky = 25 * Ka # example 14.5\n", - "\n", - "# calculations\n", - "e = Symbol('e')\n", - "Eq1 = (0.02 + e)*(1.51-e)**2 / (1-e)**3 / Ky - 1\n", - "e = solve(Eq1,e)[0]\n", - "\n", - "# Results\n", - "print \"E = %.5f\"%e" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "E = 0.03165\n" - ] - } - ], - "prompt_number": 138 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.10 pageno : 500" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%matplotlib inline\n", - "\n", - "from matplotlib.pyplot import *\n", - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "from scipy.integrate import quad\n", - "import math\n", - "\n", - "# variables\n", - "deltaA = round(28.850 - 27.012 - 0.5 * 30.255,2)\n", - "deltaB = (12.055 - 3.509 - 0.5 * 4.207) * 10**-3\n", - "deltaC = 0\n", - "deltaD = 0\n", - "deltaE = round((1.006 - 0.690 + 0.5 * 1.887),3) * 10**5\n", - "deltaH298 = -241.997\n", - "Ts = [2000,2500,3000,3500,3800]\n", - "deltaHt = []\n", - "deltaGt = []\n", - "Ka = []\n", - "Ea = []\n", - "Eb = []\n", - "\n", - "# Calculations\n", - "T = 298.15\n", - "deltaH0 = Symbol('deltaH0')\n", - "Eq = deltaH0 + deltaA*T + deltaB*T**2/2 + deltaC*T**3/3 + deltaD*T**4/4 - deltaE/T - deltaH298*1000\n", - "deltaH0 = round(solve(Eq,deltaH0)[0]/1000,3)\n", - "I = Symbol('I')\n", - "Eq1 = deltaH0*1000 - deltaA*T*math.log(T) - deltaB*T**2/2 - deltaC*T**3/6 - deltaD*T**4/12 - deltaE/(2*T) - 8.314 * T * I + 228600\n", - "I = round(solve(Eq1,I)[0],3)\n", - "\n", - "def fun1(T1):\n", - " #return 42.1395*(T1 - 298.15) + 5.613*10**-3/2*(T1**2 - 298.15**2) + .2535 * 10**5 * (1./T1 - 1/298.15)\n", - " return 42.1395*T1 + 5.613*10**-3/2 * T1**2 + 0.2535*10**5/T1 - 12898.37\n", - "\n", - "for T in Ts:\n", - " Ht = deltaH0*1000 + deltaA*T + deltaB*T**2/2 + deltaC*T**3/3 + deltaD*T**4/4 - deltaE/T \n", - " Gt = deltaH0*1000 - deltaA*T*math.log(T) - deltaB*T**2/2 - deltaC*T**3/6 - deltaD*T**4/12 - deltaE/(2*T) - 8.314 * T * I \n", - " ka = math.exp(-Gt/(8.314*T))\n", - " e = Symbol('e')\n", - " Eq2 = ( e * (3-e)**(1./2) ) / ( 1-e)**(3./2) / ka - 1\n", - " b = round(solve(Eq2)[0],4)\n", - " a = (quad(fun1,298.15,T)[0]/1000) / -Ht\n", - " deltaHt.append(Ht)\n", - " deltaGt.append(Gt)\n", - " Ka.append(ka)\n", - " Ea.append(a)\n", - " Eb.append(b)\n", - "\n", - "\n", - "# Results \n", - "plot(Ts,Ea,\"g\")\n", - "plot(Ts,Eb,\"b\")\n", - "xlabel(\"T(k)\")\n", - "ylabel(\"E\")\n", - "suptitle(\"Plot of e versus adiabatic reaction temperature\")\n", - "show()\n", - "print \"from plot, it can be seen that both lines are simultaneously satisfied at the point \\\n", - "\\nintersection where e = 0.68 and T = 3440 K\"\n", - "e = 0.68\n", - "T = 3440\n", - "yh2 = (1- e)/(1.5 - 0.5*e)\n", - "yo2 = 0.5*(1-e) / (1.5-0.5*e)\n", - "yh2o = e/(1.5- 0.5*e)\n", - "\n", - "print \"yH2 = %.4f\"%yh2\n", - "print \"yO2 = %.4f\"%yo2\n", - "print \"yH2O = %.4f\"%yh2o" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Populating the interactive namespace from numpy and matplotlib\n" - ] - }, - { - "output_type": "stream", - "stream": "stderr", - "text": [ - "WARNING: pylab import has clobbered these variables: ['solve', 'draw_if_interactive', 'e']\n", - "`%pylab --no-import-all` prevents importing * from pylab and numpy\n" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEhCAYAAABhpec9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVGX/BvB7QBFMU3MhFRRDk8VhExEUFEvUXNMwNSUV\nLcLUfDNfWyzEyqXSst5SNHDLzD1NBfdRcUFAFLfMUGNRSRAVYp95fn+cHxMIM6HNcFjuz3VxOcuZ\nMzdnjvPleZ5znqMQQggQERHpYCJ3ACIiqt5YKIiISC8WCiIi0ouFgoiI9GKhICIivVgoiIhILxYK\nIzE1NYWrqyvs7OwwbNgwZGdnAwAaNWqk93V//P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nd6q52KIgegyvvPIKdu/erfc6zrt27YK/vz+LBNV4bFEQ\nEZFebFEQEZFeLBRERKQXCwUREenFQkFERHqxUBARkV4sFEREpNf/ARiuLhNA/r0uAAAAAElFTkSu\nQmCC\n", - "text": [ - "" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "from plot, it can be seen that both lines are simultaneously satisfied at the point \n", - "intersection where e = 0.68 and T = 3440 K\n", - "yH2 = 0.2759\n", - "yO2 = 0.1379\n", - "yH2O = 0.5862\n" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.11 Page No : 506" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "from numpy import *\n", - "\n", - "# Variables\n", - "stoichio_matrix = matrix([[-1,-1, 1, 3, 0, 0],[0, -1, -1, 1, 1 ,0],[-1, -2, 0 ,4, 1, 0], \\\n", - " [0,0, 1, 0, -1, 0.5],[-1, 2 ,0, 0, 1, -2],[-1, 1, 1, 1, 0, -1]])\t\t\t #Framing the stoichiometric coefficient matrix\n", - "\n", - "\n", - "# Calculations\n", - "\n", - "r = linalg.matrix_rank(stoichio_matrix)\n", - "\n", - "stoichio_matrix[0] = -stoichio_matrix[0];\n", - "stoichio_matrix[2] = stoichio_matrix[2]+stoichio_matrix[0];\n", - "stoichio_matrix[5:] = stoichio_matrix[5:]+stoichio_matrix[0];\n", - "stoichio_matrix[6:] = stoichio_matrix[6:]+stoichio_matrix[0];\n", - "stoichio_matrix[1] = -stoichio_matrix[1];\n", - "stoichio_matrix[2] = stoichio_matrix[2]+stoichio_matrix[1];\n", - "stoichio_matrix[5:] = stoichio_matrix[5:]-(3*stoichio_matrix[1]);\n", - "stoichio_matrix[6:] = stoichio_matrix[6:]-(2*stoichio_matrix[1]);\n", - "x = stoichio_matrix[:3]\n", - "y = stoichio_matrix[:4];\n", - "stoichio_matrix[:4] = y;\n", - "stoichio_matrix[:3] = x;\n", - "stoichio_matrix[5:] = stoichio_matrix[5:]+(4*stoichio_matrix[3]);\n", - "stoichio_matrix[6:] = stoichio_matrix[6:]+(2*stoichio_matrix[3]);\n", - "\n", - "\n", - "\n", - "# Results\n", - "print ' The stoichiometric coefficient matrix after performing the elementary row operations = ';\n", - "print (stoichio_matrix);\n", - "print ' The number of primary reactions = %d'%(r);\n", - "print ' The non zero rows are 1,2,4'\n", - "print ' The primary reactions are: CH4g)+H2Og)--->COg)+3H2g)%( COg)+H2Og)--->CO2g)+H2g),( CO2g)--->COg)+1./2)O2g)'\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The stoichiometric coefficient matrix after performing the elementary row operations = \n", - "[[ 1. 1. -1. -3. -0. -0. ]\n", - " [-0. 1. 1. -1. -1. -0. ]\n", - " [ 0. 0. 0. 0. 0. 0. ]\n", - " [ 0. 0. 1. 0. -1. 0.5]\n", - " [-1. 2. 0. 0. 1. -2. ]\n", - " [ 0. -1. 1. 1. -1. 1. ]]\n", - " The number of primary reactions = 3\n", - " The non zero rows are 1,2,4\n", - " The primary reactions are: CH4g)+H2Og)--->COg)+3H2g)%( COg)+H2Og)--->CO2g)+H2g),( CO2g)--->COg)+1./2)O2g)\n" - ] - } - ], - "prompt_number": 169 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.13 pageno : 510" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "\n", - "# variables\n", - "Ka1 = 0.1429\n", - "Ka2 = 2\n", - "\n", - "# calculations and Results\n", - "\n", - "# assume e1 = .3\n", - "e2 = Symbol('e2')\n", - "Eq1 = ((0.3 - e2)*(0.3+e2) /((0.7 - e2) * 0.7)) / 0.1429 -1\n", - "e2 = solve(Eq1)\n", - "print \"E2 = %.1f and %.1f \"%(e2[0],e2[1])\n", - "\n", - "# since negative value is inadmissible. e2 = 0.2\n", - "e2 = round(e2[1],1)\n", - "e1 = Symbol('e1')\n", - "Eq2 = ((e1 + 0.2)*(0.2) /((0.8 - e1) *(e1 - 0.2) ) ) / 2 -1\n", - "e1 = solve(Eq2)\n", - "print \"E1 = %.1f and %.1f \"%(e1[0],e1[1])\n", - "e1 = round(e1[0],1)\n", - "print \"Satisfied results when e1 = %.1f and e2 = %.1f\"%(e1,e2)\n", - "\n", - "yA = (1-e1-e2)/2\n", - "yB = (1-e1)/2\n", - "yC = (e1-e2)/2\n", - "yD = (e1+e2)/2\n", - "yE = e2/2\n", - "\n", - "print \"yA = %.2f\"%yA\n", - "print \"yB = %.2f\"%yB\n", - "print \"yC = %.2f\"%yC\n", - "print \"yD = %.2f\"%yD\n", - "print \"yE = %.2f\"%yE\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "E2 = -0.1 and 0.2 \n", - "E1 = 0.3 and 0.6 \n", - "Satisfied results when e1 = 0.3 and e2 = 0.2\n", - "yA = 0.25\n", - "yB = 0.35\n", - "yC = 0.05\n", - "yD = 0.25\n", - "yE = 0.10\n" - ] - } - ], - "prompt_number": 214 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 14.14 page no : 515" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from sympy import Symbol\n", - "from sympy.solvers import solve\n", - "\n", - "# variables\n", - "Kc = 2.92\n", - "\n", - "# Calculations and results\n", - "e = Symbol('e')\n", - "Eq1 = (e*(10+e)/((5-e)*(10-e)))/Kc - 1\n", - "e = round(solve(Eq1)[0],4)\n", - "print \"E = %.4f\"%e\n", - "\n", - "cA = 5-e\n", - "cB = 10-e\n", - "cC = e\n", - "cD = 10+e\n", - "\n", - "print \"CA = %.4f kmol/m*3\"%cA\n", - "print \"CB = %.4f kmol/m*3\"%cB\n", - "print \"CC = %.4f kmol/m*3\"%cC\n", - "print \"CD = %.4f kmol/m*3\"%cD" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "E = 3.0446\n", - "CA = 1.9554 kmol/m*3\n", - "CB = 6.9554 kmol/m*3\n", - "CC = 3.0446 kmol/m*3\n", - "CD = 13.0446 kmol/m*3\n" - ] - } - ], - "prompt_number": 220 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example 14.15, Page 517" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 1200. \t\t\t #temperature in K\n", - "T0 = 298.15 \t\t\t #reference temperature in K\n", - "a = [41.84,45.369,82.34];\n", - "b = [20.25*10**-3,8.688*10**-3,49.75*10**-3];\n", - "c = [0,0,0];\n", - "d = [0,0,0];\n", - "e = [-4.51*10**5,-9.619*10**5,-12.87*10**5];\n", - "del_Gf = [-604.574,-394.815,-1129.515]\n", - "del_Hf = [-635.975,-393.978,-1207.683]\n", - "n = [1,1,-1]\n", - "R = 8.314\n", - "\n", - "# Calculations\n", - "del_G = (n[0]*del_Gf[0])+(n[1]*del_Gf[1])+(n[2]*del_Gf[2]);\n", - "del_H = (n[0]*del_Hf[0])+(n[1]*del_Hf[1])+(n[2]*del_Hf[2]);\n", - "del_a = (n[0]*a[0])+(n[1]*a[1])+(n[2]*a[2]);\n", - "del_b = (n[0]*b[0])+(n[1]*b[1])+(n[2]*b[2]);\n", - "del_c = (n[0]*c[0])+(n[1]*c[1])+(n[2]*c[2]);\n", - "del_d = (n[0]*d[0])+(n[1]*d[1])+(n[2]*d[2]);\n", - "del_e = (n[0]*e[0])+(n[1]*e[1])+(n[2]*e[2]);\n", - "del_H0 = ((del_H*10**3)-((del_a*T0)+((del_b/2)*T0**2)+((del_c/3)*T0**3)+((del_d/4)*T0**4)-(del_e/T0)))*10**-3;\n", - "IR = (1./(T0))*((del_H0*10**3)-(del_a*T0*math.log(T0))-((del_b/2)*T0**2)-((del_c/6)*T0**3)-((del_d/12)*T0**4)-((del_e/2)*(1./T0))-(del_G*10**3));\n", - "del_G_T = ((del_H0*10**3)-(del_a*T*math.log(T))-((del_b/2)*T**2)-((del_c/6)*T**3)-((del_d/12)*T**4)-((del_e/2)*(1./T))-(IR*T))*10**-3;\n", - "Ka = math.exp((-del_G_T*10**3)/(R*T))\n", - "y = 1;\n", - "phi = 1;\n", - "f0 = 1;\n", - "P = (Ka*f0)/(phi*y)\n", - "\n", - "# Results\n", - "print ' The decomposition pressure,P = %f bar '%(P);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The decomposition pressure,P = 2.384295 bar \n" - ] - } - ], - "prompt_number": 6 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch2.ipynb b/Chemical_Engineering_Thermodynamics/ch2.ipynb deleted file mode 100755 index b7849ef3..00000000 --- a/Chemical_Engineering_Thermodynamics/ch2.ipynb +++ /dev/null @@ -1,117 +0,0 @@ -{ - "metadata": { - "name": "", - "signature": "sha256:76568d79b614fc85568c92855047632dbe19f5ec7540dbd287268967c3318f2b" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 2 : Review of basic concepts" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 2.1 Page No : 29" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math\n", - "\n", - "# Variables\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "t1 = 300.;\t\t\t #initial temperature of gas in K\n", - "p1 = 0.1;\t\t\t #initial pressure of the gas in MPa\n", - "p2 = 0.5;\t\t\t #pressure of gas after heating in MPa\n", - "p3 = 0.1;\t\t\t #pressure of gas after expansion in MPa\n", - "n = 1.; \t\t\t #number of moles of gas in mole\n", - "\n", - "# Calculations\n", - "w1 = 0*n; \t\t\t # Calculations of work done by the gas during heating in kJ (since dv = 0)\n", - "t2 = t1*(p2/p1);\t\t\t # Calculations of temperature of gas after heating in K\n", - "t3 = t2;\t\t \t # Calculations of temperature of gas after expansion in K (constant temperature expansion)\n", - "volume2 = p2/p3;\t\t\t # Calculations of ratio of volume of gas after expansion to the volume of gas after heating (no unit)\n", - "w2 = (R*t2*math.log(volume2)*n)/1000\n", - "volume3 = t3/t1;\t\t\n", - "w3 = (R*t1*(1-volume3)*n)/1000\n", - "work_net = w1+w2+w3;\t\t\t # Calculations of net work done by the gas for the process in kJ\n", - "\n", - "# Results\n", - "print ' Work done during heating process:Work from 1-2 = %d kJ '%(w1);\n", - "print ' Work done during constant temperature expansion: Work from 2-3 = %.3f kJ '%(w2);\n", - "print ' Work done during constant pressure compression: Work from 3-1 = %.3f kJ '%(w3);\n", - "print ' Net work done by the gas during the process = %.3f kJ '%(work_net);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " Work done during heating process:Work from 1-2 = 0 kJ \n", - " Work done during constant temperature expansion: Work from 2-3 = 20.071 kJ \n", - " Work done during constant pressure compression: Work from 3-1 = -9.977 kJ \n", - " Net work done by the gas during the process = 10.095 kJ \n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 2.2 Page No : 30" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "v1 = 0.1;\t\t\t #volume of gas initially present in the cylinder in m**3\n", - "p1 = 0.1;\t\t\t #initial pressure of gas in MPa\n", - "p_atm = 0.1;\t\t #atmospheric pressure acting on the piston in MPa\n", - "v2 = 0.3;\t\t\t #volume of gas after heating in m**3\n", - "p2 = 0.6;\t\t\t #pressure of gas after heating in MPa\n", - "\n", - "# Calculations\n", - "work = ((p1+p2)*(v2-v1)*10**6)/(2*1000);\t\t\t # Calculations of work done by the gas in kJ \n", - "\n", - "# Results\n", - "print ' The work done by the gas = %d kJ'%(work);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The work done by the gas = 70 kJ\n" - ] - } - ], - "prompt_number": 4 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch3.ipynb b/Chemical_Engineering_Thermodynamics/ch3.ipynb deleted file mode 100755 index 2b39d6e0..00000000 --- a/Chemical_Engineering_Thermodynamics/ch3.ipynb +++ /dev/null @@ -1,897 +0,0 @@ -{ - "metadata": { - "name": "", - "signature": "sha256:8d10c3a8d696216084bffc2404a32e0b3c15831ac555c05fcb7016ab7d75d0e7" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 3 : PvT relations of fluids" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.1 Page No : 48" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "X = 0.8; \t\t\t #Quality of wet steam (no unit)\n", - "T = 150.;\t \t\t #Temperature of the wet steam in degree celsius\n", - "vf = 0.0010908;\t\t\t #molar volume of saturated liquid in m**3/kg\n", - "vg = 0.3924;\t\t\t #molar volume of saturated vapour in m**3/kg\n", - "uf = 631.63;\t\t\t #molar internal energy of the saturated liquid in kJ/kg\n", - "ug = 2558.6;\t\t\t #molar internal energy of the saturated vapour in kJ/kg\n", - "\n", - "# Calculations\n", - "V = (X*vg)+((1-X)*vf);\t\t\t # Calculations of specific volume in m**3/kg using Eq.(3.3)\n", - "U = (X*ug)+((1-X)*uf);\t\t\t # Calculations of specific internal energy in kJ/kg using Eq.(3.6)\n", - "\n", - "# Results\n", - "print 'The specific volume of wet steam = %0.4f m**3/kg '%(V);\n", - "print 'The specific internal energy of wet steam = %0.1f kJ/kg '%(U);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The specific volume of wet steam = 0.3141 m**3/kg \n", - "The specific internal energy of wet steam = 2173.2 kJ/kg \n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.2 Page No : 49" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 1.42;\t\t\t #specific volume of wet steam in m**3/kg\n", - "T = 100.;\t\t\t #temperature of wet steam in degree celsius\n", - "vf = 0.0010437;\t\t #molar volume of saturated liquid in m**3/kg\n", - "vg = 1.673;\t\t\t #molar volume of saturated vapour in m**3/kg\n", - "\n", - "# Calculations\n", - "X = (V-vf)/(vg-vf);\t\t\t # Calculations of the quality of wet steam using Eq.(3.3) (no unit)\n", - "\n", - "# Results\n", - "print ' The quality of wet steam = %0.4f '%(X);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The quality of wet steam = 0.8487 \n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.3 Page No : 49" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 100.;\t\t\t #temperature inside the vessel in degree celsius\n", - "V = 0.00317;\t\t\t #specific volume of water at the critical point in m**3/kg\n", - "vf = 0.0010437;\t\t\t #molar volume of saturated liquid in m**3/kg\n", - "vg = 1.673;\t\t\t #molar volume of saturated vapour in m**3/kg\n", - "\n", - "# Calculations\n", - "X = (V-vf)/(vg-vf);\t\t\t # Calculations of the quality of wet steam using Eq.(3.3) (no unit)\n", - "ratio = (X*vg)/((1-X)*vf);\t\t\t # Calculations of volume ratio of saturated vapour to the saturated liquid (no unit)\n", - "\n", - "# Results\n", - "print ' The volume ratio of saturated vapour to the saturated liquid = %0.2f '%(ratio);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume ratio of saturated vapour to the saturated liquid = 2.04 \n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.4 Page No : 49" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "U = 2000.\t\t\t #specific internal energy of liquid-vapour mixture in kJ/kg\n", - "uf = 850.6\t\t\t #specific internal energy of saturated liquid in kJ/kg\n", - "ug = 2593.2\t\t\t #specific internal energy of saturated vapour in kJ/kg\n", - "\n", - "# Calculations\n", - "mass_ratio = (U-uf)/(ug-U);\t\t\t # Calculations of the mass ratio of vapour to liquid using the lever rule (no unit)\n", - "\n", - "# Results\n", - "print ' The mass ratio of vapour to liquid = %0.4f '%(mass_ratio);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The mass ratio of vapour to liquid = 1.9376 \n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.5 Page No : 52" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "n = 1.\t\t\t #number of moles of n-octane vapour in mol\n", - "T = 427.85;\t\t\t #tempearture of n-octane vapour in K\n", - "P = 0.215;\t\t\t #pressure n-octane vapour in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in (kPa m**3)/(kmol K)\n", - "\n", - "# Calculations\n", - "V = ((n*10**-3)*R*T)/(P*10**3);\t\t\t # Calculations of volume using ideal gas law-Eq.(3.9) in m**3\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane vapour = %f m**3 '%(V);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane vapour = 0.016545 m**3 \n" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.6 Page No : 54" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "n = 1.; \t\t\t #number of moles occupied by n-octane vapour in mol\n", - "T = 427.85;\t\t\t #temperature in K\n", - "P = 0.215;\t\t\t #saturation pressure in MPa\n", - "a = 3.789;\t\t\t #van der Waals constant in Pa(m**3/mol)**2\n", - "b = 2.37*10**-4;\t #van der Waals constant in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "Vguess = (n*R*T)/(P*10**6);\t\t\t \n", - "Vnew = (R*T)/((P*10**6)+(a/Vguess**2))+b\n", - "tolerance = 1e-6\n", - "\n", - "while abs(Vguess-Vnew)>tolerance:\n", - " Vguess = Vnew;\n", - " Vnew = (R*T)/((P*10**6)+(a/Vguess**2))+b;\t\t\t #the iteration process to solve the system of equation\n", - "\n", - "V = Vnew;\t\t\t #The volume calculated using the van der Waals equation in m**3/mol\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane vapour obtained by van der Waals equation = %f m**3/mol'%(V);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane vapour obtained by van der Waals equation = 0.015675 m**3/mol\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.7 Page No : 55" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "n = 1.; \t\t\t #number of moles occupied by n-octane liquid in mol\n", - "T = 427.85;\t\t\t #temperature in K\n", - "P = 0.215;\t\t\t #saturation pressure in MPa\n", - "a = 3.789;\t\t\t #van der Waals constant in Pa(m**3/mol)**2\n", - "b = 2.37*10**-4;\t\t\t #van der Waals constant in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "Vguess = b\n", - "Vnew = (R*T)/((P*10**6)+(a/Vguess**2))+b\n", - "tolerance = 1e-6\n", - "while abs(Vguess-Vnew)>tolerance:\n", - " Vguess = Vnew;\n", - " Vnew = (R*T)/((P*10**6)+(a/Vguess**2))+b;\t\t\t #the iteration process to solve the system of equation\n", - "\n", - "V = Vnew;\t\t\t #The volume calculated using the van der Waals equation in m**3/mol\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane liquid obtained by van der Waals equation = %e m**3/mol'%(V);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane liquid obtained by van der Waals equation = 3.517652e-04 m**3/mol\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.8 Page No : 57" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math\n", - "\n", - "# Variables\n", - "T = 427.85; \t\t \t #temperature in K\n", - "P = 0.215;\t \t\t #saturation pressure in MPa\n", - "a = 3.789;\t\t \t #van der Waals constant in Pa(m**3/mol)**2\n", - "b = 2.37*10**-4;\t\t\t #van der Waals constant in m**3/mol\n", - "R = 8.314;\t\t \t #universal gas constant in (Pa m**3)/(mol K)\n", - "Pcvc = 3\n", - "RTc = 8.\n", - "# Calculations\n", - "#The Cardan's method simplifies the equation of state into a cubic equation which can be solved easily\n", - "#The general form of the cubic equation is (Z**3)+(alpha*Z**2)+(beeta*Z)+gaamma = 0, where alpha,beeta and gaamma are determined using established relations\n", - "\n", - "A = (a*P*10**6)/(R*T)**2;\t\t\t\n", - "B = (b*P*10**6)/(R*T);\t\t\t \n", - "alpha = -1-B;\t\t\t \n", - "beeta = A;\t\t\t \n", - "gaamma = -(A*B);\t\n", - "p = round(beeta-(alpha**2)/3,4)\n", - "q = round(((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma,4)\n", - "D = (q**2/4)+(p**3/27);\t\n", - "\n", - "\n", - "if D>0 :\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3);\n", - " vf = ((Z)*R*T)/(P*10**6);\t\t\n", - " vg = ((Z)*R*T)/(P*10**6);\t\t\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3);\t\n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Z = [Z1 ,Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6)\n", - " vg = (max(Z)*R*T)/(P*10**6)\n", - "else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\t # Calculations of r using Eq.(3.38)\n", - " theta = math.cos((-(q)/2)*(1./r));\t\t\t # Calculations of theta in radians using Eq.(3.37)\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3);\t\t\t #Three unequal real roots given by Eqs.(3.34,3.35 and 3.36)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - " Z = [Z1, Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6)\n", - " vg = (max(Z)*R*T)/(P*10**6)\n", - "\n", - "crit = Pcvc/RTc \n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane saturated liquid obtained by Cardans method = %.3e m**3/mol'%(vf);\n", - "print ' The volume occupied by n-octane saturated vapour obtained by Cardans method = %.2e m**3/mol'%(vg);\n", - "print \" At the critical point, PcVc/RTc = %.3f\"%crit\n", - "\n", - "# Note: value of D is calculated wrongly in book. Please calculate manually." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane saturated liquid obtained by Cardans method = -9.345e-04 m**3/mol\n", - " The volume occupied by n-octane saturated vapour obtained by Cardans method = 1.55e-02 m**3/mol\n", - " At the critical point, PcVc/RTc = 0.375\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.9 Page No : 60" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "from numpy import *\n", - "import math\n", - "\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature in K\n", - "P = 0.215;\t\t\t #saturation pressure in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "\n", - "# Calculations\n", - "a = (0.42748*R**2*Tc**2.5)/(Pc*100*10**3*math.sqrt(T));\t\t\t \n", - "b = (0.08664*R*Tc)/(Pc*100*10**3);\t\t\t\n", - "\n", - "\n", - "A = (a*P*10**6)/(R*T)**2;\t\t\t \n", - "B = (b*P*10**6)/(R*T);\n", - "alpha = -1.;\t\t\t\n", - "beeta = A-B-B**2.;\t\n", - "gaamma = -(A*B);\t\n", - "p = beeta-(alpha**2)/3.\n", - "q = ((2*alpha**3.)/27.)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4.)+(((p)**3)/27.);\t\t\t \n", - "#if D>0 then:\n", - " # Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3)\n", - " # vf = ((Z)*R*T)/(P*10**6)\n", - " # vg = ((Z)*R*T)/(P*10**6)\n", - "#elif D == 0:\n", - " # Z1 = ((-2*(q/2))**(1./3))-(alpha/3);\n", - " # Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " # Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " # Z = [Z1 ,Z2, Z3];\n", - " # vf = (min(Z)*R*T)/(P*10**6);\t\t\n", - " # vg = (max(Z)*R*T)/(P*10**6);\t\t\n", - "#else:\n", - "\n", - "r = math.sqrt((-(p**3)/27));\t\t\t\n", - "theta = (math.acos((-(q)/2)*(1./r)));\n", - "Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - "Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3);\t\n", - "Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - "Z = [Z1, Z2, Z3];\n", - "vf = (min(Z)*R*T)/(P*10**6);\t\t\n", - "vg = (max(Z)*R*T)/(P*10**6);\t\t\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane saturated vapour) using Redlich-Kwong equation of state = %f m**3/mol'%(vg);\n", - "print ' The volume occupied by n-octane saturated liquid) using Redlich-Kwong equation of state = %f m**3/mol'%(vf);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane saturated vapour) using Redlich-Kwong equation of state = 0.015401 m**3/mol\n", - " The volume occupied by n-octane saturated liquid) using Redlich-Kwong equation of state = 0.000244 m**3/mol\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.10 Page No : 67" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "\n", - "# Variables\n", - "T = 180.;\t\t\t #temperature of water in degree celsius\n", - "P = 1.0027;\t\t\t #saturation pressure of water in MPa\n", - "Tc = 647.3;\t\t\t #critical temperature of water in K\n", - "Pc = 221.2;\t\t\t #critical pressure of water in bar\n", - "Tr = 0.7;\t\t\t #reduced temperature at which acentric factor was defined by Pitzer \n", - "\n", - "# Calculations\n", - "T1 = Tr*Tc; \t\t\t #calculating temperature in K using reduced temperature value\n", - "T1 = T1-273.15;\t\t\t #conversion to degree celsius\n", - "Pr = (P*10)/Pc;\t\t\t # Calculations of reduced pressure (no unit) using saturation pressure at t1. In this case t1 equals t, therefore the given saturation pressure is taken\n", - "w = -math.log10(Pr)-1.0;\t\t\t # Calculations of acentric factor using Eq.(3.62)\n", - "\n", - "# Results\n", - "print ' The acentric factor of water = %f '%(w);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The acentric factor of water = 0.343614 \n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.11 Page No : 72" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 409.41;\t\t\t #temperature of n-octane in degree celsius\n", - "P = 4.98;\t\t\t #pressure in bar\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "w = 0.398;\t\t\t #acentric factor (no unit)\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "Tr = (T+273.15)/Tc;\t\n", - "Pr = P/Pc;\t\t\t\n", - "z0 = 0.96;\t\t\t\n", - "V1 = (z0*R*(T+273.15))/(P*10**5);\t\t\t \n", - "z1 = 0.01;\t\t\t \n", - "z = z0+(w*z1);\t\t\n", - "V2 = (z*R*(T+273.15))/(P*10**5)\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane obtained by the two parameter compressibilty \\\n", - " factor correlation = %f m**3/mol'%(V1);\n", - "print ' The volume occupied by n-octane obtained by the three parameter compressibility \\\n", - "factor correlation = %f m**3/mol'%(V2);\n", - "\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane obtained by the two parameter compressibilty factor correlation = 0.010939 m**3/mol\n", - " The volume occupied by n-octane obtained by the three parameter compressibility factor correlation = 0.010985 m**3/mol\n" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.12 Page No : 72" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 1.;\t \t\t #volume of the tank in m**3\n", - "m = 180.;\t\t\t #mass of carbon dioxide in kg\n", - "T = 91.8;\t\t\t #temperature of the tank in degree celsius after it is placed in the vicinity of a furnace\n", - "Tc = 304.2;\t\t\t #critical temperature of carbon dioxide in K\n", - "Pc = 73.87;\t\t\t #critical pressure of carbon dioxide in bar\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "mwt = 44.*10**-3\t #molecular weight of carbon dioxide in kg/mol\n", - "n = m/mwt;\t\t\t # Calculations of number of moles of carbon dioxide in the tank in moles\n", - "MV = V/n;\t\t\t # Calculations of molar volume in m**3/mol\n", - "slope = (MV*Pc*10**5)/(R*(T+273.15));\t\t\t #slope of the straight line formed when z0 is plotted against Pr formed by using the relation z0 = (V*Pc*Pr)/(R*T)\n", - "Tr = (T+273.15)/Tc;\t\t\t # Calculations of reduced temperature (no unit)\n", - "\n", - "#At the given conditions, the state of CO2 must lie on the curve corresponding to the obtained value of Tr. To determine the state of CO2, a straight line passing through the origin, with the obtained value of slope is drawn on the z0 vs Pr plot of Fig.3.12 and the point of intersection of this straight line with the Tr curve is obtained to get the value of z0\n", - "z0 = 0.725;\t\t\t #value of compressibilty factor obtained by doing the above mentioned procedure\n", - "P = (z0*R*10**-6*(T+273.15))/(MV)\t\t\t # Calculations of pressure in MPa using Eq.(3.59)\n", - "\n", - "# Results\n", - "print ' The pressure developed by carbon dioxide = %.0f MPa'%(P);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The pressure developed by carbon dioxide = 9 MPa\n" - ] - } - ], - "prompt_number": 69 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.13 Page No : 73" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "\n", - "\n", - "# Variables\n", - "V = 1.;\t\t\t #volume of the tank in m**3\n", - "m = 180.;\t\t\t #mass of carbon dioxide in kg\n", - "T = 91.8;\t\t\t #temperature of the tank in degree celsius after it is placed in the vicinity of a furnace\n", - "Tc = 304.2;\t\t\t #critical temperature of carbon dioxide in K\n", - "Pc = 73.87;\t\t\t #critical pressure of carbon dioxide in bar\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "w = 0.239;\t\t\t #acentric factor (no unit)\n", - "\n", - "# Calculations\n", - "mwt = 44.*10**-3\n", - "n = m/mwt\n", - "MV = V/n;\t\t\t\n", - "Tr = (T+273.15)/Tc\n", - "z0 = 0.725\n", - "z_init = z0;\t\t\t \n", - "slope = (MV*Pc*10**5)/(R*(T+273.15));\t\t\t \n", - "Prguess = z_init/slope;\t\n", - "z1guess = 0.1;\t\t\t \n", - "tolerance = 1e-6;\t\t\t \n", - "\n", - "def solver_function(zi):\n", - " return zi-(z0+(w*z1guess))\n", - "\n", - "z = fsolve(solver_function,z1guess)\n", - "Pr = z/slope;\t\t\t \n", - "P = ((Pc*10**5)*Pr)*10**-6\n", - "\n", - "# Results\n", - "print ' The pressure developed by carbon dioxide = %f MPa'%(P);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The pressure developed by carbon dioxide = 9.295806 MPa\n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.14 Page No : 75" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from scipy.optimize import fsolve\n", - "\n", - "\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature of n-octane vapour in K\n", - "P = 0.215;\t\t\t #pressure of n-ocatne vapour in MPa\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 2.497;\t\t\t #critical pressure of n-octane in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "Tr = T/Tc\n", - "Pr = P/Pc\n", - "z_init = 1\n", - "h = (0.08664*Pr)/(z_init*Tr)\n", - "tolerance = 1e-6;\t\t\t\n", - "\n", - "def solver_func(zi):\n", - " return zi-((1./(1-h))-((h/(1+h))*(4.93398/(Tr**(3./2)))))\n", - "\n", - "z = fsolve(solver_func,h)\n", - "V = (z*R*T)/(P*10**6);\t\t\t\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane vapour obtained by the generalized form of \\\n", - " \\n Redlich-Kwong equation of state = %.2e m**3/mol'%(V);\n", - "\n", - "\n", - "# Note : Answer may vary because of rouding off error." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane vapour obtained by the generalized form of \n", - " Redlich-Kwong equation of state = 1.55e-02 m**3/mol\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.15 Page No : 77" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature in K\n", - "P = 0.215;\t\t\t #saturation pressure in MPa\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "w = 0.398;\t\t\t #acentric factor (no unit) \n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "#The Cardan's method simplifies the equation of state into a cubic equation which can be solved easily\n", - "#The general form of the cubic equation is (Z**3)+(alpha*Z**2)+(beeta*Z)+gaamma = 0, where alpha,beeta and gaamma are determined using established relations\n", - "\n", - "Tr = T/Tc\n", - "Pr = (P*10**6)/(Pc*10**5)\n", - "S = 0.48+(1.574*w)-(0.176*w**2)\n", - "alpha1 = (1+(S*(1-math.sqrt(Tr))))**2\n", - "a = (0.42748*R**2*Tc**2*alpha1)/(Pc*10**5)\n", - "b = (0.08664*R*Tc)/(Pc*10**5)\n", - "A = (a*P*10**6)/(R*T)**2\n", - "B = (b*P*10**6)/(R*T)\n", - "alpha = -1.\n", - "beeta = A-B-B**2\n", - "gaamma = -(A*B)\n", - "p = beeta-(alpha**2)/3\n", - "q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4.)+(((p)**3)/27.)\n", - "\n", - "if D>0:\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3)\n", - " vf = ((Z)*R*T)/(P*10**6)\n", - " vg = ((Z)*R*T)/(P*10**6)\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3)\n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Z = [Z1, Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6);\t\t\n", - " vg = (max(Z)*R*T)/(P*10**6);\t\t\n", - "else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\n", - " theta = acos((-(q)/2)*(1./r));\t\t\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - " Z = [Z1, Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6)\n", - " vg = (max(Z)*R*T)/(P*10**6)\n", - "\n", - "# Results\n", - "print ' The volume occupied by n-octane saturated vapour obtained by Soave-Redlich-Kwong \\\n", - " equation of state = %f m**3/mol'%(vg);\n", - "print ' The volume occupied by n-octane saturated liquid obtained by Soave-Redlich-Kwong \\\n", - " equation of state = %f m**3/mol'%(vf);\n", - "\n", - "\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane saturated vapour obtained by Soave-Redlich-Kwong equation of state = 0.015207 m**3/mol\n", - " The volume occupied by n-octane saturated liquid obtained by Soave-Redlich-Kwong equation of state = 0.000227 m**3/mol\n" - ] - } - ], - "prompt_number": 74 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 3.16 Page No : 78" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature in K\n", - "P = 0.215;\t\t\t #saturation pressure in MPa\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "w = 0.398;\t\t\t #acentric factor (no unit) \n", - "R = 8.314;\t\t\t #universal gas constant in (Pa m**3)/(mol K)\n", - "\n", - "# Calculations\n", - "Tr = T/Tc;\t\t\t\n", - "Pr = (P*10**6)/(Pc*10**5)\n", - "S = 0.37464+(1.54226*w)-(0.26992*w**2)\n", - "alpha1 = (1+(S*(1-math.sqrt(Tr))))**2\n", - "a = (0.45724*R**2*Tc**2*alpha1)/(Pc*10**5)\n", - "b = (0.07780*R*Tc)/(Pc*10**5)\n", - "A = (a*P*10**6)/(R*T)**2\n", - "B = (b*P*10**6)/(R*T)\n", - "alpha = -1+B;\t\n", - "beeta = A-(2*B)-(3*B**2)\n", - "gaamma = -(A*B)+(B**2)+(B**3)\n", - "p = beeta-(alpha**2)/3;\t\t\n", - "q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4)+(((p)**3)/27)\n", - "\n", - "if D>0:\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3)\n", - " vf = ((Z)*R*t)/(P*10**6)\n", - " vg = ((Z)*R*t)/(P*10**6)\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3)\n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Z = [Z1 ,Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6)\n", - " vg = (max(Z)*R*T)/(P*10**6)\n", - "else:\n", - " r = math.sqrt((-(p**3)/27))\n", - " theta = .1533\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3);\t\t\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - " Z = [Z1, Z2, Z3];\n", - " vf = (min(Z)*R*T)/(P*10**6)\n", - " vg = (max(Z)*R*T)/(P*10**6)\n", - " \n", - "# Results\n", - "print ' The volume occupied by n-octane saturated vapour, obtained by Peng\\\n", - "-Robinson equation of state = %.3e m**3/mol'%(vg);\n", - "print ' The volume occupied by n-octane saturated liquid, obtained by Peng-Robinson\\\n", - " equation of state = %.3e m**3/mol'%(vf);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume occupied by n-octane saturated vapour, obtained by Peng-Robinson equation of state = 1.514e-02 m**3/mol\n", - " The volume occupied by n-octane saturated liquid, obtained by Peng-Robinson equation of state = 2.003e-04 m**3/mol\n" - ] - } - ], - "prompt_number": 33 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch4.ipynb b/Chemical_Engineering_Thermodynamics/ch4.ipynb deleted file mode 100755 index 5433cf7c..00000000 --- a/Chemical_Engineering_Thermodynamics/ch4.ipynb +++ /dev/null @@ -1,1291 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 4 : First law of thermodynamics and its applications" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.1 Page No : 94" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "Q1 = 50.;\t\t\t #Energy added as heat in kJ when the system undergoes a process 1-2\n", - "W1 = 30.;\t\t\t #Work done by the system in kJ during the process 1-2\n", - "Q2 = -40.;\t\t\t #Energy rejected as heat in kJ during the process 2-3\n", - "W2 = -50.;\t\t\t #Work done on the system in kJ during the process 2-3\n", - "Q3 = 0.\t \t\t #System undergoes an adiabatic process to return to initial state\n", - "\n", - "# Calculations\n", - "U2_1 = Q1-W1\n", - "U3_2 = Q2-W2\n", - "U1_3 = (-U2_1)-(U3_2)\n", - "W3 = Q3-U1_3\n", - "net_work = W1+W2+W3\n", - "\n", - "# Results\n", - "print ' The net work done by the system = %d kJ'%(net_work);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The net work done by the system = 10 kJ\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.3 Page No : 96" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 1. \t\t\t #volume of tank in m**3;\n", - "N = 200.;\t\t\t #number of moles of carbon dioxide in tank in mol\n", - "T1 = 25.;\t\t\t #ambient temperature in degree celsius\n", - "I = 5.; \t\t\t #current in amperes passed through the resistor place in the tank\n", - "Voltage = 440.\t\t #voltage in volts existing across the resistor\n", - "t = 10.;\t\t\t #time in minutes for which the current is passed\n", - "a = 363.077*10**-3\t\t\t #van der waals constant in Pa (m**3/mol)**2\n", - "b = 0.043*10**-3\t\t\t #van der waals constant in m**3/mol\n", - "Cv = 32.34\t\t\t #molar heat capacity at constant volume in J/molK\n", - "R = 8.314\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "MV = V/N;\t\t\t # Calculations of molar volume in m**3/mol\n", - "Q = 0. \t\t\t #energy transfer as heat during the process\n", - "W_Pdv = 0.;\t\t\t #mechanical work done by the system\n", - "W_elec = -(Voltage*I*t*60)*(10**-6)\n", - "U2_1 = Q-(W_Pdv+W_elec);\t\t\t\n", - "T2 = ((U2_1*10**6)/(N*Cv))+(T1+273.15)\n", - "P = (((R*T2)/(MV-b))-(a/(MV**2)))*10**-3\n", - "\n", - "# Results\n", - "print ' The final pressure = %0.3f kPa '%(P);\n", - "print ' The final temperature = %0.2f K'%(T2);\n", - "\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final pressure = 827.832 kPa \n", - " The final temperature = 502.23 K\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.4 Page No : 97" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 0.1;\t\t\t #volume of tank in m**3\n", - "T1 = 200.;\t\t\t #initial temperature of saturated steam inside the tank in degree celsius\n", - "T2 = 150.;\t\t\t #temperature in degree celsius that the tank attains after some time due to poor insulation\n", - "P1 = 15.549;\t\t\t #pressure in bar obtained from steam tables corresponding to T1\n", - "vg1 = 0.1272;\t\t\t #specific volume of saturated vapour in m**3/kg obtained from steam tables corresponding to T1\n", - "hg1 = 2790.9;\t\t\t #specific enthalpy of saturated vapour in kJ/kg obtained from steam tables corresponding to T1\n", - "P2 = 4.76;\t\t\t #pressure in bar obtained from steam tables corresponding to T2\n", - "vf = 0.0010908;\t\t\t #specific volume of saturated liquid in m**3/kg obtained from steam tables corresponding to T2\n", - "vg2 = 0.3924;\t\t\t #specific volume of saturated vapour in m**3/kg obtained from steam tables corresponding to T2\n", - "hf = 632.15;\t\t\t #specific enthalpy of saturated liquid in kJ/kg obtained from steam tables corresponding to T1\n", - "hg2 = 2745.4;\t\t\t #specific enthalpy of saturated vapour in kJ/kg obtained from steam tables corresponding to T1\n", - "\n", - "# Calculations\n", - "ug1 = ((hg1*10**3)-(P1*10**5*vg1))*10**-3\n", - "uf = ((hf*10**3)-(P2*10**5*vf))*10**-3\n", - "ug2 = ((hg2*10**3)-(P2*10**5*vg2))*10**-3\n", - "v2 = vg1\n", - "X2 = (v2-vf)/(vg2-vf)\n", - "u2 = (X2*ug2)+((1-X2)*uf)\n", - "m = V/vg1\n", - "Q = m*(u2-ug1)\n", - "mf = m*(1-X2)\n", - "mg = m*X2\n", - "\n", - "# Results\n", - "print ' The energy transferred as heat = %f kJ'%(Q);\n", - "print ' The mass of liquid in the tank in the final state = %0.3f kg'%(mf)\n", - "print ' The mass of vapour in the tank in the final state = %0.3f kg'%(mg)\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The energy transferred as heat = -1053.825572 kJ\n", - " The mass of liquid in the tank in the final state = 0.533 kg\n", - " The mass of vapour in the tank in the final state = 0.253 kg\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.5 Page No : 102" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "W = 1.;\t \t\t #weight of steam in kg in the piston cylinder assembly\n", - "X = 0.8;\t\t\t #quality of steam (no unit)\n", - "T1 = 150.;\t\t\t #initial temperature of steam in degree celsius\n", - "T2 = 200.;\t\t\t #final temperature of steam in degree celsius\n", - "P1 = 476.;\t\t\t #pressure in kPa obatined from steam tables (corresponding to T1)\n", - "vf = 0.0010908;\t\t\t #specific volume of saturated liquid in m**3/kg obatined from steam tables (corresponding to T1)\n", - "vg = 0.3924;\t\t\t #specific volume of satuarted vapour in m**3/kg obatined from steam tables (corresponding to T1)\n", - "hf = 632.15;\t\t\t #specific enthalpy of saturated liquid in kJ/kg obtained from steam tables (corresponding to T1)\n", - "hg = 2745.4;\t\t\t #specific enthalpy of saturated vapour in kJ/kg obtained from steam tables (corresponding to T1)\n", - "\n", - "# Calculations\n", - "V1 = (X*vg)+((1-X)*vf)\n", - "h1 = (X*hg)+((1-X)*hf)\n", - "P2 = 0.476;\t\t\t \n", - "P_int1 = 0.4;\t\t\n", - "P_int2 = 0.5;\t\t\n", - "V_int1 = 0.5343;\t\n", - "V_int2 = 0.4250;\t\n", - "h_int1 = 2860.4;\t\n", - "h_int2 = 2855.1;\t\n", - "V2 = (((P2-P_int1)/(P_int2-P_int1))*(V_int2-V_int1))+V_int1\n", - "h2 = (((P2-P_int1)/(P_int2-P_int1))*(h_int2-h_int1))+h_int1\n", - "Q = (h2-h1)*W\n", - "W = P1*(V2-V1)*W\n", - "\n", - "# Results\n", - "print ' The work done by steam = %0.2f kJ '%(W);\n", - "print ' The net energy transferred as heat = %0.2f kJ'%(Q);\n", - "print ' The final state of superheated steam,Pressure = %0.3f MPa '%(P2);\n", - "print ' The final state of superheated steam,Temperature = %d degree celsius '%(T2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The work done by steam = 65.26 kJ \n", - " The net energy transferred as heat = 533.62 kJ\n", - " The final state of superheated steam,Pressure = 0.476 MPa \n", - " The final state of superheated steam,Temperature = 200 degree celsius \n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.6 Page No : 103" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "W = 1. \t\t\t #weight of steam in kg in the piston cylinder assembly\n", - "X = 0.8;\t\t\t #quality of steam (no unit)\n", - "T1 = 150.\t\t\t #initial temperature of steam in degree celsius\n", - "I = 5. \t\t\t #current passed in Amperes\n", - "V = 220.\t\t\t #voltage in volts across the resistor\n", - "t = 10. \t\t\t #time for which the current is passed in minutes\n", - "P1 = 476.\t\t\t #pressure in kPa obatined from steam tables (corresponding to T1)\n", - "vf = 0.0010908;\t\t\t #specific volume of saturated liquid in m**3/kg obatined from steam tables (corresponding to T1)\n", - "vg = 0.3924;\t\t\t #specific volume of satuarted vapour in m**3/kg obatined from steam tables (corresponding to T1)\n", - "hf = 632.15;\t\t\t #specific enthalpy of saturated liquid in kJ/kg obtained from steam tables (corresponding to T1)\n", - "hg = 2745.4;\t\t\t #specific enthalpy of saturated vapour in kJ/kg obtained from steam tables (corresponding to T1)\n", - "\n", - "# Calculations\n", - "V1 = (X*vg)+((1-X)*vf);\t\n", - "h1 = (X*hg)+((1-X)*hf);\t\n", - "Ws = -V*I*t*60*10**-3;\t\n", - "h2 = h1-Ws;\t\t\t \n", - "P2 = 0.476;\t\t\t \n", - "T_int1 = 200;\t\t\n", - "T_int2 = 300;\t\t\n", - "V_int1 = 0.4512;\t\n", - "V_int2 = 0.5544;\t\n", - "h_int1 = 2856.37;\t\n", - "h_int2 = 3065.38;\t\n", - "V2 = (((h2-h_int1)/(h_int2-h_int1))*(V_int2-V_int1))+V_int1;\n", - "T2 = (((h2-h_int1)/(h_int2-h_int1))*(T_int2-T_int1))+T_int1;\n", - "W = (P1*10**3*(V2-V1)*W)*10**-3\n", - "\n", - "# Results\n", - "print ' The work done by steam = %0.2f kJ '%(W);\n", - "print ' The final temperature = %0.2f degree celsius'%(T2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The work done by steam = 94.94 kJ \n", - " The final temperature = 260.47 degree celsius\n" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.7 Page No : 104" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "N = 1.\t\t\t #number of moles of carbon dioxide in kmol\n", - "T1 = 298.\t\t\t #initial temperature in K\n", - "T2 = 600.\t\t\t #final raised temperature in K\n", - "a = 45.369\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "b = 8.688*10**-3\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "e = -9.619*10**5\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "\n", - "# Calculations\n", - "Q = N*10**3*((a*(T2-T1)+((b/2)*(T2**2-T1**2))-(e*((1./T2)-(1./T1)))))*10**-6\n", - "\n", - "# Results\n", - "print ' The amount of energy to be transferred as heat = %0.3f MJ'%(Q);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The amount of energy to be transferred as heat = 13.255 MJ\n" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.8 Page No : 104" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T1 = 298. \t\t\t #initial temperature in K\n", - "T2 = 600.\t \t\t #final raised temperature in K\n", - "a = 45.369;\t\t \t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "b = 8.688*10**-3;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "e = -9.619*10**5;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "\n", - "# Calculations\n", - "Cpm = ((a*(T2-T1))+((b/2)*(T2**2-T1**2))-(e*((1./T2)-(1./T1))))/(T2-T1)\n", - "\n", - "# Results\n", - "print ' The isobaric molar heat capacity = %0.2f J/molK'%(Cpm);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The isobaric molar heat capacity = 43.89 J/molK\n" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.9 Page No : 105" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "N = 1.\t \t\t #number of moles of carbon dioxide in kmol\n", - "T1 = 298.\t\t\t #initial temperature in K\n", - "T2 = 600.\t\t\t #final raised temperature in K\n", - "a = 45.369;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "b = 8.688*10**-3;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "e = -9.619*10**5;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "\n", - "# Calculations\n", - "Cpm = ((a*(T2-T1))+((b/2)*(T2**2-T1**2))-(e*((1./T2)-(1./T1))))/(T2-T1)\n", - "Q = N*10**3*Cpm*(T2-T1)*10**-6\n", - "\n", - "# Results\n", - "print ' The amount of energy to be transferred as heat = %0.3f MJ '%(Q);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The amount of energy to be transferred as heat = 13.255 MJ \n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.10 Page No : 105" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "N = 100.\t\t\t #number of moles of carbon dioxide in mol\n", - "T1 = 298.\t\t\t #initial temperature in K\n", - "Q = 1. \t\t\t #energy added as heat in MJ\n", - "a = 45.369;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "b = 8.688*10**-3;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "e = -9.619*10**5;\t\t\t #coefficient in the specific heat capacity expression where Cp = a+bT+eT**-2\n", - "\n", - "# Calculations\n", - "delh = Q*10**6/N\n", - "Tguess = 520.\t\n", - "Cpm_guess = a+(b*((T1+Tguess)/2))+(e/(T1*Tguess))\n", - "T2_guess = T1+(delh/Cpm_guess)\n", - "tolerance = 1e-6;\t\t\t\n", - "while abs(T2_guess-Tguess)>tolerance:\n", - " Tguess = T2_guess;\n", - " Cpm_guess = a+(b*((T1+Tguess)/2))+(e/(T1*Tguess));\n", - " T2_guess = T1+(delh/Cpm_guess)\n", - "\n", - "T2 = T2_guess\n", - "\n", - "# Results\n", - "print ' The final temperature = %0.1f K'%(T2)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final temperature = 531.1 K\n" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.11 Page No : 107" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "volume_ratio = 1./15\t #final volume to the initial volume of air at the end of compression stroke (no unit)\n", - "gaamma = 1.4\t\t\t #ratio of the molar heat capacities at constant pressure and constant volume for air (no unit)\n", - "T1 = 300.\t\t\t #initial temperature of air in K\n", - "P1 = 0.1;\t\t\t #initial pressure of air in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "T2 = T1*((1./volume_ratio)**(gaamma-1))\n", - "P2 = P1*((1./volume_ratio)**(gaamma))\n", - "W = (R*(T1-T2)*10**-3)/(gaamma-1)\n", - "\n", - "# Results\n", - "print ' The final temperature = %0.2f K'%(T2);\n", - "print ' The final pressure = %0.4f MPa'%(P2);\n", - "print ' Work done per mole of air = %0.3f kJ/mol'%(W);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final temperature = 886.25 K\n", - " The final pressure = 4.4313 MPa\n", - " Work done per mole of air = -12.185 kJ/mol\n" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.12 Page No : 110" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "volume_ratio = 1./15;\t\t\t #final volume to the initial volume of ideal gas at the end of compression (no unit)\n", - "T1 = 300. \t\t\t #initial temperature of ideal gas in K\n", - "P1 = 0.1;\t \t\t #initial pressure of ideal gas in MPa\n", - "R = 8.314;\t\t \t #universal gas constant in J/molK\n", - "n = 1.2;\t\t\t #index of expansion (no unit)\n", - "gaamma = 1.4;\t\t\t #ratio of the molar heat capacities at constant pressure and constant volume for ideal gas (no unit)\n", - "\n", - "# Calculations\n", - "P2 = P1*((1./volume_ratio)**n)\n", - "T2 = T1*(P2/P1)*(volume_ratio)\n", - "W = (R*(T1-T2)*10**-3)/(n-1)\n", - "del_u = (R*(T2-T1)*10**-3)/(gaamma-1)\n", - "q = del_u+W\n", - "\n", - "# Results\n", - "print ' The final pressure = %0.3f MPa'%(P2);\n", - "print ' The final temperature = %0.1f K'%(T2);\n", - "print ' Work done on the gas = %f kJ/mol'%(W);\n", - "print ' Heat interaction during the process = %f kJ/mol'%(q)\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final pressure = 2.578 MPa\n", - " The final temperature = 515.6 K\n", - " Work done on the gas = -8.963805 kJ/mol\n", - " Heat interaction during the process = -4.481902 kJ/mol\n" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.13 Page No : 112" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 1.;\t \t\t #volume of tank in m**3\n", - "T0 = 300.\t\t\t #initial temperature of ideal gas in K\n", - "P0 = 0.1\t\t\t #initial pressure of ideal gas in MPa\n", - "T = 500.\t\t\t #temperature of ideal gas in the pipeline in K\n", - "P = 3.\t\t \t #pressure of ideal gas in the pipeline in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "gaamma = 1.4;\t\t\t #ratio of the molar heat capacities at constant pressure and constant volume for ideal gas (no unit)\n", - "\n", - "# Calculations\n", - "Pf = 3.\n", - "Tf = (Pf*10**6)/((((Pf*10**6)-(P0*10**6))/(gaamma*T))+((P0*10**6)/T0));\n", - "N = (V/R)*(((Pf*10**6)/Tf)-((P0*10**6)/T0));\n", - "\n", - "# Results\n", - "print ' The final temperature = %0.1f K'%(Tf);\n", - "print ' The amount of gas that has entered the tank = %0.2f mol'%(N);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final temperature = 670.2 K\n", - " The amount of gas that has entered the tank = 498.30 mol\n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.14 Page No : 113" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "from scipy.optimize import fsolve\n", - "\n", - "# Variables\n", - "V = 3. \t\t\t #volume of tank in m**3\n", - "T0 = 100.;\t\t\t #initial temperature of steam in degree celsius\n", - "T = 300.;\t\t\t #temperature of superheated steam in the pipeline in degree celsius\n", - "P = 3.;\t\t\t #pressure of superheated steam in the pipeline in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "Ps = 101.33\n", - "vg = 1.673\n", - "hg = 2676.0\n", - "h = 2995.1\n", - "u0 = ((hg*10**3)-(Ps*10**3*vg))*10**-3\n", - "m0 = V/vg;\t\t\t\n", - "\n", - "Tf = 418.\n", - "vf = 0.102329\n", - "uf = 2965.78\n", - "\n", - "mf_guess = V/vf\n", - "\n", - "def solver_func(ui):\n", - " return (mf_guess*ui)-(m0*u0)-((mf_guess-m0)*h);\n", - "\n", - "uf_solved = fsolve(solver_func,mf_guess)\n", - "mf = mf_guess\n", - "mass = mf-m0\n", - "\n", - "# Results\n", - "print \" The final state of steamsuperheated, Pressure = %d MPa\"%(P);\n", - "print \" The final state of steamsuperheated, Temperature = %d degree celsius\"%(Tf);\n", - "print \" The mass of steam that entered the tank = %0.3f kg\"%(mass);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final state of steamsuperheated, Pressure = 3 MPa\n", - " The final state of steamsuperheated, Temperature = 418 degree celsius\n", - " The mass of steam that entered the tank = 27.524 kg\n" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.15 Page No : 115" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 0.1;\t\t\t #volume of cylinder in m**3\n", - "T0 = 300.\t\t\t #initial temperature of nitrogen in K\n", - "P0 = 14.\t\t\t #initial pressure of nitrogen in MPa\n", - "P = 0.1;\t\t\t #ambient pressure in MPa\n", - "Pf = 2. \t\t\t #final pressure of nitrogen in MPa\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "gaamma = 1.4;\t\t #ratio of the molar heat capacities at constant pressure and constant volume for nitrogen (no unit)\n", - "\n", - "# Calculations\n", - "def solver_func(Ti):\n", - " return ((P0*10**6)-(Pf*10**6))-((gaamma/2)*(T0+Ti)*(((P0*10**6)/T0)-((Pf*10**6)/Ti)));\n", - "\n", - "Tguess = 300.\n", - "Tf = fsolve(solver_func,Tguess)\n", - "\n", - "N = (V/R)*(((P0*10**6)/T0)-((Pf*10**6)/Tf));\n", - "\n", - "# Results\n", - "print ' The final temperature = %0.1f K'%(Tf);\n", - "print ' The amount of gas that has escaped from the cylinder = %0.2f mol'%(N);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The final temperature = 181.2 K\n", - " The amount of gas that has escaped from the cylinder = 428.52 mol\n" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.16 Page No : 118" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T0 = 300.;\t\t\t #initial temperature of superheated steam in degree celsius\n", - "P0 = 3.;\t\t\t #initial pressure of superheated steam in MPa\n", - "Xe = 0.85;\t\t\t #quality of steam leaving the turbine (no unit)\n", - "Tf = 45.;\t\t\t #final temperature of steam leaving the turbine in degree celsius\n", - "Vi = 10.;\t\t\t #velocity of steam at the entrance in m/s\n", - "Ve = 40.;\t\t\t #exit velocity of steam in m/s\n", - "Zi = 10.;\t\t\t #elevation at the entrance in m\n", - "Ze = 4.;\t\t\t #elevation at the exit in m\n", - "m = 1.;\t\t\t #mass flow rate of steam through turbine in kg/s\n", - "g = 9.81;\t\t\t #accleration due to gravity in m/s**2\n", - "\n", - "# Calculations\n", - "hi = 2995.1\n", - "hf = 188.35\n", - "hg = 2583.3\n", - "he = ((1-Xe)*hf)+(Xe*hg)\n", - "Q = 0.\t\t\t \n", - "enthalpy_change = (he*10**3)-(hi*10**3)\n", - "KE_change = ((Ve**2)-(Vi**2))/2\n", - "PE_change = g*(Ze-Zi);\t\t\t\n", - "Ws = Q-(m*(enthalpy_change+KE_change+PE_change)*10**-3)\n", - "err_KE = ((KE_change)/(Ws*10**3))*100;\t\n", - "err_PE = ((abs (PE_change)/(Ws*10**3)))*100\n", - "err = err_KE+err_PE\n", - "\n", - "# Results\n", - "print ' The percentage error when Kinetic energy change is ignored = %0.3f '%(err_KE);\n", - "print ' The percentage error when Potential energy change is ignored = %0.4f '%(err_PE);\n", - "print ' The percentage error when both Kinetic and Potential energy changes are ignored = %f '%(err);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The percentage error when Kinetic energy change is ignored = 0.097 \n", - " The percentage error when Potential energy change is ignored = 0.0076 \n", - " The percentage error when both Kinetic and Potential energy changes are ignored = 0.104999 \n" - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.17 Page No : 119" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "\n", - "# Variables\n", - "Pi = 5.;\t\t\t #pressure of dry saturated steam at the entrance in bar\n", - "Pe = 2.;\t\t\t #pressure of dry saturated steam at the exit in bar\n", - "Vi = 3.;\t\t\t #velocity of dry saturated steam at the entrance in m/s\n", - "m = 1.; \t\t\t #flow rate of steam through the nozzle in kg/s\n", - "g = 9.81;\t\t\t #acceleration due to gravity in m/s**2\n", - "\n", - "# Calculations\n", - "hi = 2747.5\n", - "he = 2706.3\n", - "ve = 0.8854\n", - "Zi = 0;\t\t\n", - "Ze = 0;\t\t\n", - "Q = 0;\t\t\n", - "Ws = 0;\t\t\n", - "Ve = math.sqrt (2*(((Q-Ws)/m)-(g*(Zi-Ze))-((he*10**3)-(hi*10**3)))+(Vi**2))\n", - "A = (m*ve)/Ve\n", - "\n", - "# Results\n", - "print ' The velocity of dry saturated steam at the exit = %0.2f m/s'%(Ve);\n", - "print ' The cross sectional area of the nozzle at the exit = %0.3e m**2'%(A);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The velocity of dry saturated steam at the exit = 287.07 m/s\n", - " The cross sectional area of the nozzle at the exit = 3.084e-03 m**2\n" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.18 Page No : 123" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T1 = 270.\t\t\t #temperature of wet steam in degree celsius\n", - "T2 = 120.\t\t\t #final temperature of superheated steam in degree celsius\n", - "P = 0.1;\t\t\t #pressure of superheated steam in MPa\n", - "\n", - "# Calculations\n", - "hf = 1185.2 \t\t\t\n", - "hg = 2789.9\t \t\t\n", - "he = 2716.04\t\t\t\n", - "Xi = (he-hf)/(hg-hf);\t\n", - "\n", - "# Results\n", - "print ' The quality of wet steam = %0.3f '%(Xi);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The quality of wet steam = 0.954 \n" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.20 Page No : 128" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "del_H = -90.135;\t\t\t #standard enthalpy change for the reaction CO(g)+2H2(g)--->CH3OH(g) at 298.15K in kJ\n", - "\n", - "# Calculations\n", - "del_H1 = 2*del_H\n", - "del_H2 = (1./2)*del_H\n", - "\n", - "# Results\n", - "print ' The standard enthalpy change for the reaction 2COg)+4H2g)---->2CH3OHg \\\n", - ") at 298.15K = %0.2f kJ'%(del_H1);\n", - "print ' The standard enthalpy change for the reaction 1./2)COg)+H2g)---->1./2\\\n", - ")CH3OHg) at 298.15K = %0.4f kJ'%(del_H2 );\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy change for the reaction 2COg)+4H2g)---->2CH3OHg ) at 298.15K = -180.27 kJ\n", - " The standard enthalpy change for the reaction 1./2)COg)+H2g)---->1./2)CH3OHg) at 298.15K = -45.0675 kJ\n" - ] - } - ], - "prompt_number": 21 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.22 Page No : 130" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "del_Hf_C4H10 = -74.943;\t\t\t #smath.tan(math.radiansard enthalpy of formation of C4H10(g) at 298.15K in kJ\n", - "del_Hf_CO2 = -393.978;\t\t\t #smath.tan(math.radiansard enthalpy of formation of CO2(g) at 298.15K in kJ\n", - "del_Hf_H2O = -241.997;\t\t\t #smath.tan(math.radiansard enthalpy of formation of H2O(g) at 298.15K in kJ\n", - "\n", - "# Calculations\n", - "\n", - "del_Hr = (5*del_Hf_H2O)+(4*del_Hf_CO2)-(del_Hf_C4H10);\n", - "\n", - "# Results\n", - "print ' The standard enthalpy change for the reaction C4H10g)+13\\\n", - "/2)O2g)---->4CO2g)+5H2Og) at 298.15K = %0.3f kJ'%(del_Hr);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy change for the reaction C4H10g)+13/2)O2g)---->4CO2g)+5H2Og) at 298.15K = -2710.954 kJ\n" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.23 Page No : 131" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "del_Hf_C4H10 = -74.943;\t\t\t #smath.tan(math.radiansard enthalpy of formation of C4H10(g) at 298.15K in kJ\n", - "del_Hf_CO2 = -393.978;\t\t\t #smath.tan(math.radiansard enthalpy of formation of CO2(g) at 298.15K in kJ\n", - "del_Hf_H2O = -241.997;\t\t\t #smath.tan(math.radiansard enthalpy of formation of H2O(g) at 298.15K in kJ\n", - "del_H_vap = 43.966;\t\t\t #enthalpy of vaporization of H2O at 298.15K in kJ/mol\n", - "\n", - "# Calculations\n", - "\n", - "del_H1 = 0.\n", - "del_H2 = 5*(-del_H_vap)\n", - "del_H3 = 0.\n", - "\n", - "del_H = (5*del_Hf_H2O)+(4*del_Hf_CO2)-(del_Hf_C4H10);\n", - "del_net_H = (del_H)+(del_H1)+(del_H2)+(del_H3)\n", - "\n", - "# Results\n", - "print ' The standard enthalpy change for the reaction C4H10g)+13/2)O2g)---->4CO2g\\\n", - ")+5H2Ol) at 298.15K = %0.3f kJ'%(del_net_H);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy change for the reaction C4H10g)+13/2)O2g)---->4CO2g)+5H2Ol) at 298.15K = -2930.784 kJ\n" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.24 Page No : 132" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "del_H_comb = 2880.44;\t\t\t #gross heating value of n-buatne gas at 298.15K in kJ/mol\n", - "del_Hf_CO2 = -393.978;\t\t\t #standard enthalpy of formation of CO2(g) at 298.15K in kJ\n", - "del_Hf_H2O = -285.958;\t\t\t #standard enthalpy of formation of H2O(l) at 298.15K in kJ\n", - "del_Hf_O2 = 0.;\t\t \t #standard enthalpy of formation of O2(g) at 298.15K in kJ\n", - "\t\t\t \n", - "# Calculations\n", - "n_CO2 = 4.\n", - "n_H2O = 5.\n", - "n_O2 = -13./2\n", - "n_C4H10 = -1.\n", - "\t\t\t \n", - "del_Hf_C4H10 = (n_CO2*del_Hf_CO2)+(n_H2O*del_Hf_H2O)+(n_O2*del_Hf_O2)-(-del_H_comb);\n", - "\n", - "\n", - "# Results\n", - "print ' The standard enthalpy of formation of n-butane gas at 298.15K = %0.3f kJ'%(del_Hf_C4H10);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy of formation of n-butane gas at 298.15K = -125.262 kJ\n" - ] - } - ], - "prompt_number": 24 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.25 Page No : 133" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "del_Hc_A = -890.94;\t\t\t #enthalpy change accompanying reaction A in kJ\n", - "del_Hc_B = -283.18;\t\t\t #enthalpy change accompanying reaction B in kJ\n", - "del_Hc_C = -286.03;\t\t\t #enthalpy change accompanying reaction C in kJ\n", - "del_H_vap = -43.966;\t\t\t #enthalpy change of vaporization of H2O at 298.15K in kJ/mol\n", - "\n", - "# Calculations\n", - "del_H0 = (del_Hc_A)-(del_Hc_B)-(3*del_Hc_C)+(del_H_vap)\n", - "\n", - "# Results\n", - "print ' The standard enthalpy change at 298.15K for the reaction \\\n", - "CH4g)+H2Og)--->COg)+3H2g) = %0.3f kJ'%(del_H0);\n", - "\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy change at 298.15K for the reaction CH4g)+H2Og)--->COg)+3H2g) = 206.364 kJ\n" - ] - } - ], - "prompt_number": 25 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.26 Page No : 135" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "#The reaction is : C2H4(g)+H2O(g)--->C2H5OH(g)\n", - "del_H_vap = 43.82\n", - "\n", - "del_Hf = [52.335,-241.997,0,-277.819]\n", - "a = [4.196,28.850,20.691,0]\t\n", - "b = [154.565*10**-3,12.055*10**-3,205.346*10**-3,0]\n", - "c = [-81.076*10**-6,0,-99.793*10**-6,0]\n", - "d = [16.813*10**-9,0,18.825*10**-9,0]\t\n", - "e = [0,1.006*10**5,0,0];\t\t\n", - "\n", - "T1 = 298.15\t\t\n", - "T2 = 400.\t\t\t\n", - "n_C2H4 = -1.\n", - "n_H2O = -1.\n", - "n_C2H5OH = 1.\n", - "\n", - "# Calculations\n", - "\n", - "del_Hf_C2H5OH_g = del_Hf[3]+del_H_vap;\n", - "del_Hr = (n_C2H5OH*del_Hf_C2H5OH_g)+(n_C2H4*del_Hf[0])+(n_H2O*del_Hf[1])\n", - "del_a = (n_C2H4*a[0])+(n_H2O*a[1])+(n_C2H5OH*a[2])\t\t\t \n", - "del_b = (n_C2H4*b[0])+(n_H2O*b[1])+(n_C2H5OH*b[2])\t\t\t \n", - "del_c = (n_C2H4*c[0])+(n_H2O*c[1])+(n_C2H5OH*c[2])\t\t\t \n", - "del_d = (n_C2H4*d[0])+(n_H2O*d[1])+(n_C2H5OH*d[2])\t\t\t \n", - "del_e = (n_C2H4*e[0])+(n_H2O*e[1])+(n_C2H5OH*e[2])\t\t\t \n", - "del_H0 = (del_Hr*10**3)-((del_a*T1)+((del_b/2)*T1**2)+((del_c/3)*T1**3)+((del_d/4)*T1**4)-(del_e/T1))\n", - "del_Hr_T2 = (del_H0+((del_a*T2)+((del_b/2)*T2**2)+((del_c/3)*T2**3)+((del_d/4)*T2**4)-(del_e/T2)))*10**-3;\n", - "\n", - "# Results\n", - "print ' The standard enthalpy change at 400K for the reaction\\\n", - " C2H4g)+H2Og)--->C2H5OHg) = %f kJ'%(del_Hr_T2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The standard enthalpy change at 400K for the reaction C2H4g)+H2Og)--->C2H5OHg) = -44.529472 kJ\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.28 Page No : 137" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "from scipy.optimize import fsolve \n", - "import math \n", - "\n", - "# Variables\n", - " \n", - "#The combustion reaction of methane is given by:\n", - "# CH4(g)+2O2(g)--->CO2(g)+2H2O(g)\n", - "\n", - "n_O2 = 2.\t\t\t # stoichiometric amount of oxygen required for combustion\n", - "n_CH4 = 1.\t\t\t #number of moles of CH4(g) in moles\n", - "n_CO2 = 1.\t\t\t #number of moles of CO2(g) formed in the combustion reaction in moles\n", - "n_H2O = 2.\t\t\t #number of moles of H2O(g) formed in the combustion reaction in moles\n", - "del_Hf = [-74.943,0,-393.978,-241.997];\t\t\t # standard enthalpies of formation of CH4(g),O2(g),CO2(g),H2O(g) at 298.15K in kJ\n", - "a = [45.369,28.850,30.255,27.270];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),H2O(g),O2(g),N2(g) in J/molK\n", - "b = [8.688*10**-3,12.055*10**-3,4.207*10**-3,4.930*10**-3];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),H2O(g),O2(g),N2(g) in J/molK\n", - "c = [0,0,0,0]; \t \t\t #coefficients to compute isobaric molar heat capacity of CO2(g),H2O(g),O2(g),N2(g) in J/molK\n", - "d = [0,0,0,0];\t \t \t #coefficients to compute isobaric molar heat capacity of CO2(g),H2O(g),O2(g),N2(g) in J/molK\n", - "e = [-9.619*10**5,1.006*10**5,-1.887*10**5,0.333*10**5];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),H2O(g),O2(g),N2(g) in J/molK\n", - "per_excess_air = 50. \t\t\t #percentage excess of air supplied to the adiabatic burner\n", - "T_amb = 298.15\t\t\t # temperature at which air and methane enter the burner in K\n", - "per_N2 = 79.\t\t\t #percentage of N2 in the air supplied\n", - "per_O2 = 21.\t\t\t #percentage of O2 in the air supplied\n", - "\n", - "# Calculations\n", - "n_O2_actual = (1+(per_excess_air/100))*n_O2\n", - "n_N2 = n_O2_actual*(per_N2/per_O2);\t\t\t\n", - "n_O2_residual = n_O2_actual-n_O2;\t\t\t\n", - "\n", - "del_Hr = (n_CO2*del_Hf[2])+(n_H2O*del_Hf[3])-(n_O2*del_Hf[1])-(n_CH4*del_Hf[0])\n", - "\n", - "del_a = (n_CO2*a[0])+(n_H2O*a[1])+(n_O2_residual*a[2])+(n_N2*a[3])\n", - "del_b = (n_CO2*b[0])+(n_H2O*b[1])+(n_O2_residual*b[2])+(n_N2*b[3])\n", - "del_c = (n_CO2*c[0])+(n_H2O*c[1])+(n_O2_residual*c[2])+(n_N2*c[3])\n", - "del_d = (n_CO2*d[0])+(n_H2O*d[1])+(n_O2_residual*d[2])+(n_N2*d[3])\n", - "del_e = (n_CO2*e[0])+(n_H2O*e[1])+(n_O2_residual*e[2])+(n_N2*e[3]);\t\n", - "tguess = 500.\n", - "\n", - "def solver_func(ti):\n", - " return (-(del_Hr*10**3))-((del_a*(ti-T_amb))+((del_b/2)*((ti**2)-(T_amb**2)))+((del_c/3)*((ti**3)-(T_amb**3)))+((del_d/4)*((ti**4)-(T_amb**4)))+(del_e*((1./T_amb)-(1./ti))));\n", - "\n", - "T = fsolve(solver_func,tguess)\n", - "\n", - "# Results\n", - "print ' The flame temperature when methane is burned with 50 percent excess air \\\n", - "in an adiabatic burner = %f K'%(T);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The flame temperature when methane is burned with 50 percent excess air in an adiabatic burner = 1793.784965 K\n" - ] - } - ], - "prompt_number": 29 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 4.29 Page No : 139" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T_exit = 550.\t\t\t #temperature in K at which the combustion products leave the boiler\n", - "percent_molar_comp_prdct = [6.28,3.14,7.85,82.73];\t\t\t # percentage molar composition of the combustion products CO2(g),CO(g),O2(g),N2(g) on dry basis\n", - "T_ent = 298.15;\t\t\t #temperature in K at which Propane and air enter the combustion chamber\n", - "del_Hf = [-393.978,-110.532,-241.997,0,0,-103.833];\t\t\t #smath.tan(math.radiansard enthalpies of formation of CO2(g),CO(g),H2O(g),O2(g),N2(g),C3H8(g) at 298.15K in kJ\n", - "a = [45.369,28.068,30.255,27.270,28.850];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),CO(g),O2(g),N2(g),H2O(g) in J/molK\n", - "\n", - "#coefficients to compute isobaric molar heat capacity of CO2(g),CO(g),O2(g),N2(g),H2O(g) in J/molK\n", - "b = [8.688*10**-3,4.631*10**-3,4.207*10**-3,4.930*10**-3,12.055*10**-3];\n", - "c = [0,0,0,0,0];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),CO(g),O2(g),N2(g),H2O(g) in J/molK\n", - "d = [0,0,0,0,0];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),CO(g),O2(g),N2(g),H2O(g) in J/molK\n", - "e = [-9.619*10**5,-0.258*10**5,-1.887*10**5,0.333*10**5,1.006*10**5];\t\t\t #coefficients to compute isobaric molar heat capacity of CO2(g),CO(g),O2(g),N2(g),H2O(g) in J/molK\n", - "per_N2 = 79.\t\t\t #percentage of nitrogen in air\n", - "per_O2 = 21.\t\t\t #percentage of oxygen in air\n", - "molar_mass_propane = 44.*10**-3;\t\t\t #molar mass of propane in kg/mole\n", - "\n", - "# Calculations\n", - "# TAKE BASIS AS 100 mol OF DRY COMBUSTION PRODUCTS\n", - "n_CO2 = percent_molar_comp_prdct[0]\t\t\t #number of moles of CO2(g) in the product stream\n", - "n_CO = percent_molar_comp_prdct[1]\t\t\t #number of moles of CO(g) in the product stream\n", - "n_O2 = percent_molar_comp_prdct[2]\t\t\t #number of moles of O2(g) in the product stream\n", - "n_N2 = percent_molar_comp_prdct[3]\t\t\t #number of moles of N2(g) in the product stream\n", - "\n", - "x = (n_CO2+n_CO)/3;\n", - "\n", - "y = (2*n_N2)/(2*(per_N2/per_O2));\n", - "\n", - "z = (2*y)-(2*n_CO2)-(n_CO)-(2*n_O2);\n", - "\n", - "n_H2O = z\n", - "n_C3H8 = x\n", - "\n", - "del_Hr = (n_CO2*del_Hf[0])+(n_CO*del_Hf[1])+(n_H2O*del_Hf[2])-(n_C3H8*del_Hf[5]);\n", - "\n", - "del_a = (n_CO2*a[0])+(n_CO*a[1])+(n_O2*a[2])+(n_N2*a[3])+(n_H2O*a[4])\t\n", - "del_b = (n_CO2*b[0])+(n_CO*b[1])+(n_O2*b[2])+(n_N2*b[3])+(n_H2O*b[4])\t\n", - "del_c = (n_CO2*c[0])+(n_CO*c[1])+(n_O2*c[2])+(n_N2*c[3])+(n_H2O*c[4])\t\n", - "del_d = (n_CO2*d[0])+(n_CO*d[1])+(n_O2*d[2])+(n_N2*d[3])+(n_H2O*d[4])\t\n", - "del_e = (n_CO2*e[0])+(n_CO*e[1])+(n_O2*e[2])+(n_N2*e[3])+(n_H2O*e[4])\t\n", - "\n", - "#calulation of del_Hp J\n", - "del_Hp = (del_a*(T_exit-T_ent))+((del_b/2)*((T_exit**2)-(T_ent**2)))+((del_c/3)*((T_exit**3)-(T_ent**3)))+((del_d/4)*((T_exit**4)-(T_ent**4)))-(del_e*((1./T_exit)-(1./T_ent)));\n", - "del_H = ((del_Hr*10**3)+(del_Hp))*10**-3;\t\t\t \n", - "mass_propane = n_C3H8*molar_mass_propane;\t\t\t \n", - "energy = (-(del_H*10**3)/mass_propane)*10**-6;\t\t\n", - " \n", - "# Results\n", - "print ' The energy transferred as heat per kg propane = %f MJ'%(energy); \n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The energy transferred as heat per kg propane = 33.741510 MJ\n" - ] - } - ], - "prompt_number": 31 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch5.ipynb b/Chemical_Engineering_Thermodynamics/ch5.ipynb deleted file mode 100755 index 9cf5b1c8..00000000 --- a/Chemical_Engineering_Thermodynamics/ch5.ipynb +++ /dev/null @@ -1,974 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 5 : Second law of thermodynamics and its applications" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 5.2 Page No : 161" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math \n", - "\n", - "# Variables\n", - "Q = 1000.;\t\t \t #amount of energy absorbed by the heat engine in kJ/s\n", - "W = 650.;\t\t\t #work delivered by the heat engine in kW\n", - "T_source = 500. \t\t #temperature of the source in degree celsius\n", - "T_sink = 25.\t\t\t #temperature of the sink in degree celsius\n", - "\n", - "# Calculations\n", - "n_claimed = W/Q\n", - "T1 = T_source+273.15\n", - "T2 = T_sink+273.15\n", - "n_carnot = 1-(T2/T1)\n", - "\n", - "# Results\n", - "print \" The efficiency of the Carnot engine = %0.3f \"%(n_carnot);\n", - "print \" The efficiency of the engine claimed by the inventor = %0.2f \"%(n_claimed);\n", - "if n_claimed0 or S_G == 0 :\n", - " print \" As the first and second law of thermodynamics are satisfied, the device is theoretically feasible \"\n", - "else:\n", - " print \" As both the first and second law or either the first or second law of thermodynamics \\\n", - " are not satisfied, the device is not feasible \"\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The LHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = 2745.4 kJ\n", - " The RHS of the equation applied to the flow device to check if the first law of thermodynamics is satisfied = 2745.5 kJ\n", - " The entropy generated by applying the second law of thermodynamics to the flow device = 0.3552 kJ/kgK\n", - " As the first and second law of thermodynamics are satisfied, the device is theoretically feasible \n" - ] - } - ], - "prompt_number": 21 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 5.18 Page No : 185" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "Pi = 30.\t\t\t #pressure of superheated steam entering the turbine in bar\n", - "Ti = 300.\t\t\t #temperature of superheated steam entering the turbine in degree celsius\n", - "Pe = 0.1\t\t\t #pressure at which steam exits the turbine in bar\n", - "Xe = 0.9\t\t\t #quality of steam at the exit (no unit)(for the actual turbine)\n", - "\n", - "# Calculations\n", - "#For superheated steam at Pi and Ti\n", - "hi = 2995.1;\t\t\t #enthalpy of superheated steam at the entrance in kJ/kg\n", - "si = 6.5422;\t\t\t #entropy of superheated steam at the entrance in kJ/kgK\n", - "\n", - "#For steam at Pe\n", - "hf = 191.83;\t\t\t #enthalpy of saturated liquid in kJ/kg\n", - "hg = 2584.8;\t\t\t #enthalpy of saturated vapour in kJ/kg\n", - "sf = 0.6493;\t\t\t #entropy of saturated liquid in kJ/kgK\n", - "sg = 8.1511;\t\t\t #entropy of saturated vapour in kJ/kgK\n", - "\n", - "X2 = (si-sf)/(sg-sf)\n", - "h2 = (hf*(1-X2))+(X2*hg)\n", - "he = (hf*(1-Xe))+(Xe*hg)\n", - "n_T = (hi-he)/(hi-h2)\n", - "\n", - "# Results\n", - "print \" The isentropic efficiency of the turbine = %f \"%(n_T);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The isentropic efficiency of the turbine = 0.703395 \n" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 5.19 Page No : 186" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "Ti = 25.\t\t\t #temperature of air taken in by the adiabatic air compressor in degree celsius\n", - "Pi = 0.1\t\t\t #pressure of air taken in by the adiabatic air compressor in MPa\n", - "Pe = 1.\t \t\t #discharge pressure of air in MPa\n", - "n_c = 0.8\t\t\t #isentropic efficiency of the compressor (no unit)\n", - "gaamma = 1.4\t\t #ratio of molar specific heat capacities (no unit)\n", - "R = 8.314\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "Ti = Ti+273.15\n", - "Te = Ti*(((Pe*10**6)/(Pi*10**6))**((gaamma-1)/gaamma))\n", - "W_s = (((R*gaamma)/(gaamma-1))*(Te-Ti))*10**-3;\t\t\t\n", - "Ws = W_s/n_c\n", - "Te_actual = ((Ws*10**3*(gaamma-1))/(R*gaamma))+Ti\n", - "\n", - "# Results\n", - "print \" The exit temperature of air = %0.2f K\"%(Te_actual);\n", - "print \" The power consumed by the compressor = %f kW/mol\"%(Ws);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The exit temperature of air = 645.01 K\n", - " The power consumed by the compressor = 10.093262 kW/mol\n" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 5.20 Page No : 187" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "Ti = 30.\t\t\t #temperature of saturated liquid water in degree celsius\n", - "m = 500.\t\t\t #mass flow rate of water being pumped in kg/s\n", - "P2 = 3. \t\t\t #preesure maintained in the boiler in MPa\n", - "n_p = 0.75;\t\t\t #isentropic efficiency of the pump (no unit)\n", - "\n", - "# Calculations\n", - "#For saturated liquid water at Ti\n", - "vf = 0.0010043\n", - "P1 = 4.241;\t\t\n", - "\n", - "Ws_m = (vf*((P2*10**6)-(P1*10**3)))*10**-3\n", - "Ws_act_m = Ws_m/n_p;\t\t\t \n", - "P = ((Ws_act_m*10**3)*m)*10**-6;\n", - "\n", - "# Results\n", - "print \" The power consumed by the pump = %d MW\"%(P);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The power consumed by the pump = 2 MW\n" - ] - } - ], - "prompt_number": 24 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 5.21 Page No : 188" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "Pi = 3.\t\t\t #pressure of dry saturated steam entering the nozzle in bar\n", - "Xe = 0.98\t\t #quality of steam exiting the nozzle (no unit)\n", - "Pe = 2.\t\t\t #pressure of steam exiting the nozzle in bar\n", - "\n", - "# Calculations\n", - "#For steam at Pi\n", - "hi = 2724.7\n", - "he = 2652.8\n", - "V2_2_s = hi-he\n", - "\n", - "#For steam at Pe\n", - "hf = 504.70\n", - "hg = 2706.3\n", - "he_act = ((1-Xe)*hf)+(Xe*hg)\n", - "V2_2 = hi-he_act;\t\t\t\n", - "n_N = (V2_2)/(V2_2_s)\t\t\n", - "\n", - "# Results\n", - "print \" The isentropic efficiency of the nozzle = %0.3f \"%(n_N);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The isentropic efficiency of the nozzle = 0.868 \n" - ] - } - ], - "prompt_number": 25 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch6.ipynb b/Chemical_Engineering_Thermodynamics/ch6.ipynb deleted file mode 100755 index cf3f1f12..00000000 --- a/Chemical_Engineering_Thermodynamics/ch6.ipynb +++ /dev/null @@ -1,214 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 6 : Thermodynamic potentials" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 6.6 Page No : 218" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "m = 0.1;\t\t\t #mass of superheated steam in the piston cylinder assembly in kg\n", - "P1 = 1.\t \t\t #initial pressure of superheated steam in MPa\n", - "T1 = 300.\t\t\t #initial temperature of superheated steam in degree celsius\n", - "P2 = 0.1\t\t\t #pressure of steam after expansion in MPa\n", - "T2 = 200.\t\t\t #temperature of steam after expansion in degree celsius\n", - "\n", - "# Calculations\n", - "#For steam at P1 and T1:\n", - "h1 = 3052.1\n", - "v1 = 0.2580\n", - "\n", - "#For steam at P2 and T2:\n", - "h2 = 2875.4\n", - "v2 = 2.1720\n", - "\n", - "del_u = (((h1*10**3)-(P1*10**6*v1))-((h2*10**3)-(P2*10**6*v2)))*10**-3\n", - "W = m*(del_u)\n", - "\n", - "# Results\n", - "print \" The work done by steam = %0.2f kJ\"%(W);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The work done by steam = 13.59 kJ\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 6.8 Page No : 220" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "P = 3.\t \t\t #pressure of superheated steam in MPa\n", - "Ti = 300.\t\t\t #temperature at which the steam enters the turbine in degree celsius\n", - "m = 1.\t\t \t #mass flow rate of steam in kg/s\n", - "Te = 60.\t\t\t #temperature of dry saturated steam when it leaves the turbine in degree celsius\n", - "\n", - "# Calculations\n", - "#For steam at P and Ti:\n", - "h1 = 2995.1\t\t\t #specific entahlpy of steam in kJ/kg\n", - "\n", - "#For saturated steam at Te:\n", - "h2 = 2609.7\t\t\t #specific enthalpy of saturated vapour in kJ/kg\n", - "\n", - "Ws = m*(h1-h2)\t\t # Calculations of the power Results of the turbine using Eq.(6.83) in kW\n", - "\n", - "# Results\n", - "print \" The power Results of the turbine = %0.1f kW\"%(Ws);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The power Results of the turbine = 385.4 kW\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 6.10 Page No : 223" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "m = 0.1 \t\t\t #mass of superheated steam in the piston cylinder assembly in kg\n", - "P1 = 3.\t \t\t #initial pressure of superheated steam in MPa\n", - "T1 = 300.\t\t\t #initial temperature of superheated steam in degree celsius\n", - "T0 = 300.\t\t\t #temperature of the reservoir which is placed in thermal contact with the piston-cylinder assembly in degree celsius\n", - "P2 = 0.1\t\t\t #pressure of steam after expansion in MPa\n", - "\n", - "#For steam at P1 and T1:\n", - "h1 = 2995.1\n", - "v1 = 0.08116\n", - "s1 = 6.5422\n", - "\n", - "#For steam at P2 and T2:\n", - "h2 = 3074.5\n", - "v2 = 2.6390\n", - "s2 = 8.2166\n", - "\n", - "# Calculations\n", - "T0 = T0+273.15\n", - "\n", - "W = m*(h1-h2-(((P1*v1)-(P2*v2))*10**3)-(T0*(s1-s2)))\n", - "\n", - "# Results\n", - "print \" The maximum work obtained from steam = %0.2f kJ\"%(W);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The maximum work obtained from steam = 90.07 kJ\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 6.12 Page No : 226" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math\n", - "\n", - "# Variables\n", - "P1 = 0.1\t\t\t #pressure at which air enters the compressor in MPa\n", - "T1 = 300.\t\t\t #temperature at which air enters the compressor in K\n", - "P2 = 1. \t\t\t #pressure at which air leaves the compressor in MPa\n", - "T2 = 300.\t\t\t #temperature at which air leaves the compressor in K\n", - "T0 = 300.\t\t\t #ambient temperature in K\n", - "N = 1. \t\t\t #molar flow rate of air in mol/s\n", - "gaamma = 1.4\t\t #ratio of specific heat capacities (no unit)\n", - "R = 8.314\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "\n", - "Ws = (-N*T0*(-R*math.log (P2/P1)))*10**-3\n", - "\n", - "# Results\n", - "print \" The minimum power required to compress one mole per second of air = %0.3f kW\"%(Ws);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The minimum power required to compress one mole per second of air = 5.743 kW\n" - ] - } - ], - "prompt_number": 4 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch7.ipynb b/Chemical_Engineering_Thermodynamics/ch7.ipynb deleted file mode 100755 index 879f7b43..00000000 --- a/Chemical_Engineering_Thermodynamics/ch7.ipynb +++ /dev/null @@ -1,255 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 7 : Thermodynamic property relations" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 7.10 Page No : 259" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math \n", - "\n", - "# Variables\n", - "T2 = 150. \t\t\t #temperature at which water it is desired to boil water in degree celsius\n", - "P1 = 0.10133\t\t\t #ambient pressure in MPa\n", - "T1 = 100.\t \t\t #temperature at which water boils corresponding at pressure P1 in degree celsius\n", - "del_hv = 2256.94\t\t #enthalpy of vaporization in kJ/kg\n", - "R = 8.314;\t\t \t #universal gas constant in J/molK\n", - "M = 18*10**-3;\t\t\t #molar mass of water in kg/mol\n", - "\n", - "# Calculations\n", - "T1 = T1+273.15\n", - "T2 = T2+273.15\n", - "P2 = P1*(math.exp(((del_hv*10**3*M)*((1./T1)-(1./T2)))/(R)))\n", - "\n", - "# Results\n", - "print \" The approximate pressure at which the boiler is to be operated = %0.3f MPa\"%(P2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The approximate pressure at which the boiler is to be operated = 0.476 MPa\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 7.11 Page No : 259" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "m = 60. \t\t\t #mass of the person who wants to skate in kg\n", - "T = -2.\t\t\t #temperature of the ice in degree celsius\n", - "A = 15.\t\t\t #area of contact between the skate edges and ice in mm**2\n", - "vs = 1.091*10**-3;\t\t\t #specific volume of ice in m**3/kg (at Tref)\n", - "vf = 1.0*10**-3;\t\t\t #specific volume of water in m**3/kg (at Tref)\n", - "del_hf = 6.002;\t\t \t #enthalpy of melting of ice in kJ/mol\n", - "g = 9.81;\t\t\t #accleration due to gravity in m/s**2\n", - "Tref = 0. \t\t\t #reference temperature at which the specific enthalpy of ice and water are taken in degree celsius\n", - "\n", - "# Calculations\n", - "Tref = Tref+273.15\n", - "del_P = ((m*g)/(A*10**-6))*10**-6\n", - "del_v = (vf-vs)*(18*10**-3);\t\n", - "del_T = (del_P*10**6)/((del_hf*10**3)/(Tref*del_v));\t\t\t \n", - "\n", - "# Results\n", - "print \" The temperature of ice originally = %d degree celsius \"%(T);\n", - "print \" The reduction in melting point of ice due to the additional pressure,computed using the Clayperon equation = %0.2f degree celsius \"%(del_T);\n", - "if del_T0:\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3)\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3)\n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Za = [Z1 ,Z2, Z3];\n", - " Z = max(Za);\n", - "else:\n", - " theta = math.cos((-(q)/2)*(math.sqrt((-27)/(((p)**3)))))\n", - " r = math.sqrt((-(p**3)/27));\t\t\t \n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3)\n", - " Za = [Z1, Z2, Z3];\n", - " Z = max(Za);\n", - "da_dT = (-a*S)/(cmath.sqrt(alpha*T_ref*Tc));\t\t\t \n", - "\n", - "dep_h = (R*T_ref*(Z-1))+(((((T_ref*da_dT)-a)/(2*math.sqrt(2)*b)))*(math.log ((Z+(B*(1+math.sqrt (2))))/(Z+(B*(1-math.sqrt (2)))))));\n", - "dep_s = (R*math.log (Z-B))+((1./(2*math.sqrt (2)*b))*(da_dT)*(math.log ((Z+(B*(1+math.sqrt (2))))/(Z+(B*(1-math.sqrt (2)))))));\n", - "del_hb = -dep_h\n", - "del_sb = -dep_s\n", - "\n", - "del_hc = ((Cp[0]*(T-T_ref))+(((Cp[1])/2)*((T**2)-(T_ref**2)))+(((Cp[2])/3)*((T**3)-(T_ref**3)))+(((Cp[3])/4)*((T**4)-(T_ref**4)))-((Cp[4])*((1./T)-(1./T_ref))))*10**-3;\n", - "del_sc = ((Cp[0])*math.log (T/T_ref))+((Cp[1])*(T-T_ref))+(((Cp[2])/2)*((T**2)-(T_ref**2)))+(((Cp[3])/3)*((T**3)-(T_ref**3)))-(((Cp[4])/2)*((1./(T**2))-(1./(T_ref**2))))-(R*math.log((P*10**6)/(P2*10**3)))\t\t\t \n", - "\n", - "Z = 0.9151\n", - "da_dT = (-a*S)/(cmath.sqrt (alpha*T*Tc));\t\t\t \n", - "\n", - "del_hd = (R*T*(Z-1))+((((T*da_dT)-a)/(2*math.sqrt(2)*b))*math.log ((Z+(B*(1+math.sqrt (2))))/(Z+(B*(1-math.sqrt (2))))));\n", - "\n", - "del_sd = (R*math.log (Z-B))+((1./(2*math.sqrt(2)*b))*(da_dT)*(math.log ((Z+(B*(1+math.sqrt (2))))/(Z+(B*(1-math.sqrt (2)))))));\n", - "\n", - "h = h0+del_ha+(del_hb*10**-3)+del_hc+(del_hd*10**-3)\n", - "s = s0+del_sa+del_sb+del_sc+del_sd;\t\t\t \n", - "\n", - "# Results\n", - "print \" The enthalpy of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson equation\\\n", - " of state =\",h, \"kJ/mol\"\n", - "print \" The entropy of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson\\\n", - " equation of state = \",s,\" J/mol K\"\n", - "print \" The volume of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson\\\n", - " equation of state =\",v,\" m**3/mol\"\n", - "\n", - "\n", - "#THE VOLUME OF n-OCTANE VAPOUR AS COMPUTED IN EXAMPLE 3.16 IS 15.14*10**-3 m**3/mol AND NOT \n", - "#15.41*10**-3 m**3/mol AS PRINTED IN THIS EXAMPLE IN THE TEXTBOOK.\n", - "# So ANSWER WOULD BE DIFFERENT\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The enthalpy of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson equation of state = (76.8343786515+0.000518888144511j) kJ/mol\n", - " The entropy of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson equation of state = (207.222784016-0.000740500199878j) J/mol K\n", - " The volume of n-octane vapour at 427.85K and 0.215MPa using the Peng-Robinson equation of state = 0.01514 m**3/mol\n" - ] - } - ], - "prompt_number": 20 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/ch9.ipynb b/Chemical_Engineering_Thermodynamics/ch9.ipynb deleted file mode 100755 index 9efdc810..00000000 --- a/Chemical_Engineering_Thermodynamics/ch9.ipynb +++ /dev/null @@ -1,1125 +0,0 @@ -{ - "metadata": { - "name": "" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "heading", - "level": 1, - "metadata": {}, - "source": [ - "Chapter 9 : Multicomponent mixtures" - ] - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.1 Page No : 313" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "per_ethanol = 60.\t\t\t #mole percent of ethanol in a ethanol-water system\n", - "per_water = 40. \t\t\t #mole percent of water in a ethanol-water system\n", - "v1 = 57.5*10**-6\t\t\t #partial molar volume of ethanol in the ethanol-water system in m**3\n", - "rho = 849.4;\t \t\t #density of the mixture in kg/m**3\n", - "M_ethanol = 46*10**-3\t\t\t #molar mass of ethanol in kg/mol\n", - "M_water = 18*10**-3 \t\t\t #molar mass of ethanol in kg/mol\n", - "\n", - "# Calculations\n", - "X1 = per_ethanol/100\n", - "X2 = per_water/100\n", - "M = (X1*M_ethanol)+(X2*M_water)\n", - "v = M/rho\n", - "v2 = (v-(X1*v1))/(X2);\t\t\t \n", - "\n", - "# Results\n", - "print \" The partial molar volume of water = %f m**3/mol\"%(v2);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The partial molar volume of water = 0.000016 m**3/mol\n" - ] - } - ], - "prompt_number": 1 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.2 Page No : 313" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "V = 3.\t\t\t #volume of mixture to be prepared in m**3\n", - "per_ethanol = 60.\t\t\t #mole percent of ethanol in a ethanol-water system\n", - "per_water = 40.\t\t\t #mole percent of water in a ethanol-water system\n", - "v1 = 57.5*10**-6;\t\t\t #partial molar volume of ethanol in the ethanol-water system in m**3/mol\n", - "v2 = 16*10**-6\t\t\t #partial molar volume of water in the ethanol-water system in m**3/mol\n", - "v1_pure = 57.9*10**-6\t\t\t #molar volume of pure ethanol in m**3/mol\n", - "v2_pure = 18*10**-6\t\t\t #molar volume of pure water in m**3/mol\n", - "\n", - "# Calculations\n", - "X1 = per_ethanol/100;\t\t\t # Calculations of the mole fraction of ethanol (no unit)\n", - "X2 = per_water/100;\t\t\t # Calculations of the mole fraction of water (no unit)\n", - "v = (X1*v1)+(X2*v2);\t\t\t # Calculations of the molar volume of the solution using Eq.(9.10) in m**3/mol\n", - "N = V/v\t \t\t # Calculations of the mole number of solution required in mol\n", - "N1 = N*X1\t\t\t # Calculations of the mole number of ethanol in solution in mol\n", - "N2 = N*X2;\t\t\t # Calculations of the mole number of water in solution in mol\n", - "V1 = N1*v1_pure;\t\t\t # Calculations of the volume of pure ethanol required in m**3\n", - "V2 = N2*v2_pure;\t\t\t # Calculations of the volume of pure water required in m**3\n", - "\n", - "# Results\n", - "print \" The volume of pure ethanol required = %0.3f m**3\"%(V1);\n", - "print \" The volume of pure water required = %0.3f m**3\"%(V2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The volume of pure ethanol required = 2.548 m**3\n", - " The volume of pure water required = 0.528 m**3\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.3 Page No : 318" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "import math\n", - "\n", - "\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature of n-octane vapour in K\n", - "P = 0.215;\t\t\t #pressure of n-octane vapour in MPa\n", - "a = 3.789;\t\t\t #van der Waals constant in Pa(m**3/mol)**2\n", - "b = 2.37*10**-4;\t\t\t #van der Waals constant in m**3/mol\n", - "v = 15.675*10**-3;\t\t\t #molar volume of n-octane saturated vapour taken from Example 3.8 in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "Z = (P*10**6*v)/(R*T)\t\t\t # Calculations of the compressibility factor (no unit)\n", - "# Calculations of the fugacity coefficient (f/P) using the expression derived in Example 9.3 (no unit)\n", - "phi = math.exp(Z-1-math.log (((P*10**6)*(v-b))/(R*T))-a/(R*T*v));\n", - "f = (P*10**6*phi)*10**-6\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of n-octane vapour = %0.2f \"%(phi);\n", - "print \" The fugacity of n-octane vapour = %0.4f MPa\"%(f);\n", - "\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of n-octane vapour = 0.95 \n", - " The fugacity of n-octane vapour = 0.2043 MPa\n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.5 Page No : 322" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 427.85;\t\t\t #temperature of n-octane vapour in K\n", - "P = 0.215;\t\t\t #pressure of n-octane vapour in MPa\n", - "Tc = 569.4;\t\t\t #critical temperature of n-octane in K\n", - "Pc = 24.97;\t\t\t #critical pressure of n-octane in bar\n", - "w = 0.398;\t\t\t #acentric factor (no unit)\n", - "\n", - "# Calculations\n", - "Tr = T/Tc\n", - "Pr = (P*10**6)/(Pc*10**5)\n", - "log_phi0 = -0.032;\t\n", - "log_phi1 = -0.025;\n", - "phi = round(log_phi0 + 0.398*log_phi1,3)\n", - "phie = 1.1014\n", - "f = P*phie\n", - "\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of n-octane vapour = %.3f \"%(phi);\n", - "print \" The fugacity of n-octane vapour = %.4f MPa\"%(f);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of n-octane vapour = -0.042 \n", - " The fugacity of n-octane vapour = 0.2368 MPa\n" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.6 Page No : 327" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 339.7\t\t\t #temperature of ethylene in K\n", - "P = 1.\t \t\t #pressure of ethylene in bar\n", - "Tc = 283.1\t\t\t #critical temperature of ethylene in K\n", - "Pc = 51.17\t\t\t #critical pressure of ethylene in bar\n", - "w = 0.089\t\t\t #acentric factor (no unit)\n", - "\n", - "# Calculations\n", - "Tr = T/Tc\n", - "Pr = P/Pc\n", - "B0 = 0.083-(0.422/(Tr**1.6))\n", - "B1 = 0.139-(0.172/(Tr**4.2))\n", - "phi = math.exp((B0+(w*B1))*(Pr/Tr))\n", - "f = P*phi\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of ethylene = %0.4f \"%(phi);\n", - "print \" The fugacity of ethylene = %0.4f bar\"%(f);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of ethylene = 0.9963 \n", - " The fugacity of ethylene = 0.9963 bar\n" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.7 Page No : 330" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t \t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "vc = [255.0*10**-6,486.0*10**-6];\t\t\t #critical molar volume of n-butane and n-octane in m**3/mol\n", - "Zc = [0.274,0.256];\t \t\t #compressibility factor of n-butane and n-octane corresponding to Tc,Pc (no unit)\n", - "w = [0.199,0.398];\t\t\t #acentric factor of n-butane and n-octane (no unit)\n", - "R = 8.314 \t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "K_12 = 1-((8*((vc[0]*vc[1])**(1./2)))/((((vc[0])**(1./3))+((vc[1])**(1./3)))**3))\n", - "Tc_12 = (((Tc[0])*(Tc[1]))**(1./2))*(1-K_12);\t\t\t \n", - "w_12 = (w[0]+w[1])/2\n", - "Zc_12 = (Zc[0]+Zc[1])/2\n", - "vc_12 = ((((vc[0])**(1./3))+((vc[1])**(1./3)))/2)**3\n", - "Pc_12 = ((Zc_12*R*Tc_12)/vc_12)*10**-6;\t\t\t \n", - "Tr_12 = T/Tc_12\n", - "B_12_0 = 0.083-(0.422/(Tr_12**(1.6)));\t\t\t \n", - "B_12_1 = 0.139-(0.172/(Tr_12**(4.2)));\t\t\t \n", - "B_12 = ((R*Tc_12)/(Pc_12*10**6))*(B_12_0+(w_12*B_12_1))\n", - "Tr1 = T/Tc[0]\n", - "B_11_0 = 0.083-(0.422/(Tr1**(1.6)));\t\t\t \n", - "B_11_1 = 0.139-(0.172/(Tr1**(4.2)));\t\t\t \n", - "B_11 = ((R*Tc[0])/(Pc[0]*10**5))*(B_11_0+(w[0]*B_11_1))\n", - "Tr2 = T/Tc[1]\n", - "B_22_0 = 0.083-(0.422/(Tr2**(1.6)))\n", - "B_22_1 = 0.139-(0.172/(Tr2**(4.2)))\n", - "B_22 = ((R*Tc[1])/(Pc[1]*10**5))*(B_22_0+(w[1]*B_22_1))\n", - "Bm = ((y1**2)*B_11)+((2*y1*y2)*B_12)+((y2**2)*B_22);\t\t\n", - "\n", - "# Results\n", - "print \" The second virial coefficient for an equimolar mixture of n-butane and n-octane at\\\n", - " 600K = %.2e m**3/mol\"%(Bm);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The second virial coefficient for an equimolar mixture of n-butane and n-octane at 600K = -3.09e-04 m**3/mol\n" - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.8 Page No : 331" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "a = [1.3874,3.7890];\t\t\t #van der Waals constant of n-butane and n-octane in Pa(m**3/mol)**2\n", - "b = [0.1163*10**-3,0.237*10**-3];\t\t\t #van der Waals constant of n-butane and n-octane in m**3/mol\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "a_m = ((y1**2)*a[0])+((2*y1*y2)*math.sqrt(a[0]*a[1]))+((y2**2)*a[1])\n", - "b_m = (y1*b[0])+(y2*b[1])\t\t\t\n", - "\n", - "# Results\n", - "print \" The van der Waals constant for an equimolar mixture of n-butane and n-octane,\\\n", - " a_m = %0.4f Pam**3/mol)**2\"%(a_m);\n", - "print \" The van der Waals constant for an equimolar mixture of n-butane and n-octane,\\\n", - " b_m = %f m**3/mol\"%(b_m);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The van der Waals constant for an equimolar mixture of n-butane and n-octane, a_m = 2.4405 Pam**3/mol)**2\n", - " The van der Waals constant for an equimolar mixture of n-butane and n-octane, b_m = 0.000177 m**3/mol\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.9 Page No : 333" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t \t \t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16.\t \t \t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "Tr1 = T/Tc[0]\n", - "Pr1 = P/Pc[0]\n", - "Z1_0 = 0.95\n", - "Tr2 = T/Tc[1]\n", - "Pr2 = P/Pc[1]\n", - "Z2_0 = 0.785\n", - "\n", - "Zm = (y1*Z1_0)+(y2*Z2_0)\n", - "vm = (Zm*R*T)/(P*10**5)\n", - "\n", - "P1 = y1*P\n", - "P2 = y2*P\n", - "Pr1 = P1/Pc[0]\n", - "Pr2 = P2/Pc[1]\n", - "Z1_0 = 0.97\n", - "Z2_0 = 0.91\n", - "Zm = (y1*Z1_0)+(y2*Z2_0)\n", - "vm_dalton = (Zm*R*T)/(P*10**5)\n", - "\n", - "P1 = ((Z1_0*y1*R*T)/(vm_dalton))*10**-2\n", - "P2 = ((Z2_0*y2*R*T)/(vm_dalton))*10**-2\n", - "Pr1 = P1/Pc[0]\n", - "Pr2 = P2/Pc[1]\n", - "Z1_0_new = 0.97\n", - "Z2_0_new = 0.91\n", - "if Z1_0_new == Z1_0 and Z2_0_new == Z2_0:\n", - " vm_new = vm_dalton;\t\t\t \n", - "else:\n", - " Zm = (y1*Z1_0_new)+(y2*Z2_0_new)\n", - " vm_new = (Zm*R*T)/(P*10**5);\t\n", - "\n", - "# Results\n", - "print \" The molar volume of an equimolar mixture of n-butane and n-octane found using the\\\n", - " Amagats law of additive volumes = %0.4e m**3/mol\"%(vm);\n", - "print \" The molar volume of an equimolar mixture of n-butane and\\\n", - " n-octane found using the Daltons law of additive pressures = %0.2e m**3/mol\"%(vm_new);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The molar volume of an equimolar mixture of n-butane and n-octane found using the Amagats law of additive volumes = 2.7046e-03 m**3/mol\n", - " The molar volume of an equimolar mixture of n-butane and n-octane found using the Daltons law of additive pressures = 2.93e-03 m**3/mol\n" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.10 Page No : 334" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16.\t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "R = 8.314;\t \t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "Tcm = (y1*Tc[0])+(y2*Tc[1]);\t\t\t \n", - "Pcm = (y1*Pc[0])+(y2*Pc[1])\n", - "Trm = T/Tcm;\t\t\t \n", - "Prm = P/Pcm;\t\t\t \n", - "Zm0 = 0.9;\t\t\t \n", - "vm = (Zm0*R*T)/(P*10.**5)\n", - "\n", - "# Results\n", - "print \" The molar volume of an equimolar mixture of n-butane and n-octane using the\\\n", - " pseudocritical properties estimated through Kays rule = %0.2e m**3/mol\"%(vm);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The molar volume of an equimolar mixture of n-butane and n-octane using the pseudocritical properties estimated through Kays rule = 2.81e-03 m**3/mol\n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.11 Page No : 335" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "vc = [255.0*10**-6,486.0*10**-6];\t\t\t #critical molar volume of n-butane and n-octane in m**3/mol\n", - "Zc = [0.274,0.256];\t\t\t #compressibility factor of n-butane and n-octane corresponding to Tc,Pc (no unit)\n", - "R = 8.314;\t \t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "Tcm = (y1*Tc[0])+(y2*Tc[1]);\t\t\t \n", - "Pcm = ((R*((y1*Zc[0])+(y2*Zc[1]))*Tcm)/((y1*vc[0])+(y2*vc[1])))*10**-5\n", - "Trm = T/Tcm\n", - "Prm = P/Pcm\n", - "Zm0 = 0.89\n", - "vm = (Zm0*R*T)/(P*10**5)\n", - "\n", - "# Results\n", - "print \" The molar volume of an equimolar mixture of n-butane and n-octane at 600K\\\n", - " and 16bar estimated using the Prausnitz-Gunn rule = %0.2e m**3/mol\"%(vm);" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The molar volume of an equimolar mixture of n-butane and n-octane at 600K and 16bar estimated using the Prausnitz-Gunn rule = 2.77e-03 m**3/mol\n" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.12 Page No : 335" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "a_m = 2.4405\t\t\t #van der Waals constant for the mixture as determined in Example 9.8 in Pa(m**3/mol)**2\n", - "b_m = 0.1767*10**-3\t\t #van der Waals constant for the mixture as determined in Example 9.8 in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "A = (a_m*P*10**5)/(R*T)**2\n", - "B = (b_m*P*10**5)/(R*T)\n", - "alpha = -1-B\n", - "beeta = A\n", - "gaamma = -(A*B)\n", - "p = beeta-((alpha**2)/3)\n", - "q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4)+(((p)**3)/27)\n", - "\n", - "if D>0 :\n", - " Z = (((-(q)/2)+(math.sqrt(D)))**(1./3))+(((-(q)/2)-(math.sqrt(D)))**(1./3))-(alpha/3);\t\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3)\n", - " Z2 = ((q/2)**(1./3))-(alpha/3)\n", - " Z3 = ((q/2)**(1./3))-(alpha/3)\n", - " Za = [Z1 ,Z2, Z3];\n", - " Z = max(Za);\n", - "else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\t \n", - " theta = amath.cos((-(q)/2)*(1./r));\t\t\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3)\n", - " Za = [Z1, Z2, Z3];\n", - " Z = max(Za);\n", - "\n", - "vm = (Z*R*T)/(P*10**5)\n", - "\n", - "# Results\n", - "print \" The molar volume of an equimolar mixture of n-butane and n-octane at 600K and 16bar found \\\n", - " using the van der Waals equation of state = %e m**3/mol\"%(vm);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The molar volume of an equimolar mixture of n-butane and n-octane at 600K and 16bar found using the van der Waals equation of state = 2.780786e-03 m**3/mol\n" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.13 Page No : 336" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t\t \t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16.\t\t \t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Bm = -309.*10**-6;\t\t\t #second virial coefficient for the mixture taken from Example(9.7) in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "Zm = 1+((Bm*P*10**5)/(R*T))\n", - "vm = (Zm*R*T)/(P*10**5)\t\n", - "\n", - "# Results\n", - "print \" The molar volume of an equimolar mixture of n-butane and n-octane\\\n", - " found using the generalized virial coefficient correlation = %0.4e m**3/mol\"%(vm);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The molar volume of an equimolar mixture of n-butane and n-octane found using the generalized virial coefficient correlation = 2.8088e-03 m**3/mol\n" - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.14 Page No : 337" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "am = 2.4405\t\t\t #van der Waals constant for the mixture taken from Example 9.8 in Pa(m**3/mol)**2\n", - "bm = 0.1767*10**-3;\t\t\t #van der Waals constant for the mixture taken from Example 9.8 in m**3/mol\n", - "vm = 2.8933*10**-3;\t\t\t #molar volume of the mixture taken from Example 9.12 in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "dep_h = ((P*10**5*vm)-(R*T)-(am/vm))*10**-3\n", - "dep_s = R*(math.log ((P*10**5*(vm-bm))/(R*T)))\n", - "\n", - "# Results\n", - "print \" The enthalpy departure of an equimolar mixture of n-butane and n-octane = %0.3f kJ/mol\"%(dep_h);\n", - "print \" The entropy departure of an equimolar mixture of n-butane and n-octane = %0.3f J/mol K\"%(dep_s);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The enthalpy departure of an equimolar mixture of n-butane and n-octane = -1.203 kJ/mol\n", - " The entropy departure of an equimolar mixture of n-butane and n-octane = -1.145 J/mol K\n" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.15 Page No : 338" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600. \t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t \t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tcm = 497.3;\t\t\t #pseudocritical temperature of mixture taken from Example(9.10) in K\n", - "Pcm = 31.47;\t\t\t #pseudocritical pressure of mixture taken from Example(9.10) in bar\n", - "Trm = 1.21;\t\t \t #pseudoreduced temperature of the mixture taken from Example(9.10) (no unit)\n", - "Prm = 0.51;\t\t\t #pseudoreduced pressure of the mixture taken from Example(9.10) (no unit)\n", - "w_butane = 0.199;\t\t #acentric factor for n-butane (no unit)\n", - "w_octane = 0.398;\t\t #acentric factor for n-octane (no unit)\n", - "R = 8.314;\t\t \t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "wm = (y1*w_butane)+(y2*w_octane)\n", - "del_h0 = 0.380;\t\t\t \n", - "del_h1 = 0.188;\t\t\t \n", - "del_s0 = 0.22;\t\t\t \n", - "del_s1 = 0.18;\t\t\t \n", - "dep_h = ((R*Tcm)*(del_h0+(wm*del_h1)))*10**-3;\t\t\t \n", - "dep_s = (R)*(del_s0+(wm*del_s1));\t\t\t \n", - "\n", - "# Results\n", - "print \" The enthalpy departure of an equimolar mixture of n-butane and n-octane using\\\n", - " the generalized compressibility factor correlation = %0.3f kJ/mol\"%(dep_h);\n", - "print \" The entropy departure of an equimolar mixture of n-butane and n-octane using \\\n", - "the generalized compressibility factor correlation = %f J/mol K\"%(dep_s);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The enthalpy departure of an equimolar mixture of n-butane and n-octane using the generalized compressibility factor correlation = 1.803 kJ/mol\n", - " The entropy departure of an equimolar mixture of n-butane and n-octane using the generalized compressibility factor correlation = 2.275791 J/mol K\n" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.16 Page No : 339" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "w = [0.199,0.398];\t\t\t #acentric factor of n-butane and n-octane (no unit)\n", - "Tr1 = 1.411;\t\t\t #reduced temperature of n-butane (no unit) taken from Example (9.7)\n", - "Tr2 = 1.054;\t\t\t #reduced temperature of n-octane (no unit) taken from Example (9.7)\n", - "Tr_12 = 1.24;\t\t\t #reduced temperature for computing the mixture interaction virial coefficient (no unit) taken from Example(9.7)\n", - "Pc_12 = 2.978;\t\t\t #Pc_ij in MPa taken from Example(9.7)\n", - "Tc_12 = 483.9;\t\t\t #Tc_ij in K taken from Example(9.7)\n", - "w_12 = 0.2985;\t\t\t # w_ij (no unit) taken from Example(9.7)\n", - "Bm = -309*10**-6;\t\t\t #second virial coefficient in m**3/mol taken from Example (9.7)\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "dB0_dTr1 = 0.675/(Tr1**2.6);\t\t\t \n", - "dB0_dTr2 = 0.675/(Tr2**2.6);\t\t\t \n", - "dB1_dTr1 = 0.722/(Tr1**5.2);\t\t\t \n", - "dB1_dTr2 = 0.722/(Tr2**5.2);\t\t\t \n", - "dB0_dTr12 = 0.675/(Tr_12**2.6);\t\t\t \n", - "dB1_dTr12 = 0.722/(Tr_12**5.2);\t\t\t \n", - "dB1_dT = (R/(Pc[0]*10**5))*((dB0_dTr1)+(w[0]*(dB1_dTr1)));\t\t\t\n", - "dB2_dT = (R/(Pc[1]*10**5))*((dB0_dTr2)+(w[1]*(dB1_dTr2)));\t\t\t\n", - "dB12_dT = (R/(Pc_12*10**6))*((dB0_dTr12)+(w_12*(dB1_dTr12)));\t\t\t\n", - "dBm_dT = ((y1**2)*(dB1_dT))+((2*y1*y2)*(dB12_dT))+((y2**2)*(dB2_dT));\t\n", - "dep_h = ((Bm-(T*dBm_dT))*P*10**5)*10**-3\n", - "dep_s = -P*10**5*(dBm_dT);\t\t\t \n", - "\n", - "# Results\n", - "print \" The enthalpy departure of an equimolar mixture of n-butane and n-octane\\\n", - " using the virial coefficient correlation = %f kJ/mol\"%(dep_h);\n", - "print \" The entropy departure of an equimolar mixture of n-butane and n-octane\\\n", - " using the virial coefficient correlation = %0.3f J/mol K\"%(dep_s);\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The enthalpy departure of an equimolar mixture of n-butane and n-octane using the virial coefficient correlation = -1.908476 kJ/mol\n", - " The entropy departure of an equimolar mixture of n-butane and n-octane using the virial coefficient correlation = -2.357 J/mol K\n" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.17 Page No : 340" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "a_m = 2.4405\t\t\t #van der Waals constant (a_m) in Pa(m**3/mol)**2 taken from Example(9.8)\n", - "b_m = 0.1767*10**-3\t\t #van der Waals constant (b_m) in m**3/mol taken from Example(9.8)\n", - "Z = 0.928;\t\t\t #compressibility factor taken from Example(9.12)\n", - "vm = 2.8933*10**-3;\t\t #molar volume of the equimolar mixture in m**3/mol taken from Example(9.12)\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "phi = math.exp(Z-1-math.log ((P*10**5*(vm-b_m))/(R*T))-(a_m/(R*T*vm)));\t\t\t\n", - "f = phi*P;\t\t\n", - "\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of an equimolar mixture of n-butane and n-octane\\\n", - " using the van der Waals equation of state = %0.4f \"%(phi);\n", - "print \" The fugacity of an equimolar mixture of n-butane and n-octane using the van der Waals \\\n", - "equation of state = %0.2f bar\"%(f);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of an equimolar mixture of n-butane and n-octane using the van der Waals equation of state = 0.9018 \n", - " The fugacity of an equimolar mixture of n-butane and n-octane using the van der Waals equation of state = 14.43 bar\n" - ] - } - ], - "prompt_number": 21 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.18 Page No : 341" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16.\t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tcm = 497.3;\t\t\t #pseudocritical temperature of mixture in K taken from Example(9.10)\n", - "Pcm = 31.47;\t\t\t #pseudocritical pressure of mixture in bar taken from Example(9.10)\n", - "Trm = 1.21;\t\t\t #pseudoreduced temperature of the mixture (no unit) taken from Example(9.10)\n", - "Prm = 0.51;\t\t\t #pseudoreduced pressure of the mixture (no unit) taken from Example(9.10)\n", - "w = [0.199,0.398];\t\t\t #acentric factor of n-butane and n-octane (no unit)\n", - "\n", - "# Calculations\n", - "wm = (w[0]+w[1])/2\n", - "log_phi0 = -0.042\n", - "log_phi1 = 0.01\n", - "phi = 10**(log_phi0+(wm*log_phi1));\t\t\n", - "f = P*phi;\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of an equimolar mixture of n-butane and n-octane \\\n", - "using the pseudocritical constants method = %0.3f \"%(phi);\n", - "print \" The fugacity of an equimolar mixture of n-butane and n-octane using\\\n", - " the pseudocritical constants method = %f bar\"%(f);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of an equimolar mixture of n-butane and n-octane using the pseudocritical constants method = 0.914 \n", - " The fugacity of an equimolar mixture of n-butane and n-octane using the pseudocritical constants method = 14.625307 bar\n" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.19 Page No : 341" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Bm = -309.*10**-6;\t\t\t #second virial coefficient in m**3/mol taken from Example (9.7)\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "phi = math.exp((Bm*P*10**5)/(R*T))\n", - "f = phi*P;\t\t\t \n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of an equimolar mixture of n-butane and n-octane using\\\n", - " the virial coefficient correlation = %.3f \"%(phi);\n", - "print \" The fugacity of an equimolar mixture of n-butane and n-octane using\\\n", - " the virial coefficient correlation = %f bar\"%(f);\n", - "\n", - "# Note : answers in book is wrong please check manually." - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of an equimolar mixture of n-butane and n-octane using the virial coefficient correlation = 0.906 \n", - " The fugacity of an equimolar mixture of n-butane and n-octane using the virial coefficient correlation = 14.490290 bar\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.20 Page No : 344" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "Tc = [425.2,569.4];\t\t\t #critical temperature of n-butane and n-octane in K\n", - "Pc = [37.97,24.97];\t\t\t #critical pressure of n-butane and n-octane in bar\n", - "R = 8.314;\t \t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "a1 = (0.42748*R**2*Tc[0]**2.5)/(Pc[0]*10**5*math.sqrt(T))\n", - "a2 = (0.42748*R**2*Tc[1]**2.5)/(Pc[1]*10**5*math.sqrt(T))\n", - "b1 = (0.08664*R*Tc[0])/(Pc[0]*10**5);\t\t\t \n", - "b2 = (0.08664*R*Tc[1])/(Pc[1]*10**5);\t\t\t \n", - "\n", - "a = ((y1**2)*a1)+(2*y1*y2*math.sqrt(a1*a2))+((y2**2)*a2)\n", - "b = (y1*b1)+(y2*b2)\n", - "\n", - "A = (a*P*10**5)/(R*T)**2\n", - "B = (b*P*10**5)/(R*T);\t\n", - "alpha = -1.\t\t\t \n", - "beeta = A-B-B**2\n", - "gaamma = -(A*B)\n", - "p = beeta-(alpha**2)/3\n", - "q = ((2*alpha**3)/27)-((alpha*beeta)/3)+gaamma\n", - "D = (((q)**2)/4)+(((p)**3)/27)\n", - "\n", - "if D>0:\n", - " Z = ((-q/2)+(math.sqrt(D)))**(1./3)+((-q/2)-(math.sqrt(D)))**(1./3)-(alpha/3);\t\t\t #One real root given by Eq.(3.32)\n", - "elif D == 0:\n", - " Z1 = ((-2*(q/2))**(1./3))-(alpha/3)\n", - " Z2 = ((q/2)**(1./3))-(alpha/3);\n", - " Z3 = ((q/2)**(1./3))-(alpha/3);\n", - " Za = [Z1, Z2, Z3];\n", - " Z = max(Za);\n", - "else:\n", - " r = math.sqrt((-(p**3)/27));\t\t\n", - " theta = amath.cos((-(q)/2)*(1./r));\t\n", - " Z1 = (2*(r**(1./3))*math.cos(theta/3))-(alpha/3);\n", - " Z2 = (2*(r**(1./3))*math.cos(((2*math.pi)+theta)/3))-(alpha/3)\n", - " Z3 = (2*(r**(1./3))*math.cos(((4*math.pi)+theta)/3))-(alpha/3);\n", - " Za = [Z1, Z2, Z3];\n", - " Z = max(Za);\n", - "\n", - "phi1 = math.exp(((b1/b)*(Z-1))-math.log(Z-B)+((a/(b*R*T))*((b1/b)-(2*math.sqrt(a1/a)))*math.log((Z+B)/Z)));\n", - "\n", - "phi2 = math.exp(((b2/b)*(Z-1))-math.log(Z-B)+((a/(b*R*T))*((b2/b)-(2*math.sqrt(a2/a)))*math.log((Z+B)/Z)));\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of n-butane in the equimolar mixture using the\\\n", - " Redlich-Kwong Equation of state = %0.4f \"%(phi1);\n", - "print \" The fugacity coefficient of n-octane in the equimolar mixture using the\\\n", - " Redlich-Kwong Equation of state = %0.4f \"%(phi2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of n-butane in the equimolar mixture using the Redlich-Kwong Equation of state = 0.9644 \n", - " The fugacity coefficient of n-octane in the equimolar mixture using the Redlich-Kwong Equation of state = 0.8326 \n" - ] - } - ], - "prompt_number": 27 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.21 Page No : 346" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 600.\t\t\t #temperature of the equimolar n-butane and n-octane mixture in K\n", - "P = 16. \t\t\t #pressure of the equimolar n-butane and n-octane mixture in bar\n", - "B_11 = -131*10**-6\t\t\t #pure component (n-butane) second virial coefficient in m**3/mol taken from Example(9.7)\n", - "B_22 = -577*10**-6\t\t\t #pure component (n-octane) second virial coefficient in m**3/mol taken from Example(9.7)\n", - "B_12 = -264*10**-6\t\t\t #mixture interaction virial coefficient in m**3/mol taken from Example(9.7)\n", - "Bm = -309*10**-6\t\t\t #second virial coefficient in m**3/mol taken from Example(9.7)\n", - "R = 8.314 \t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "y1 = 0.5\n", - "y2 = 0.5\n", - "Zm = (1./2)*(1+math.sqrt(1+((4*Bm*P*10**5)/(R*T))))\n", - "phi1 = math.exp((((2*P*10**5)/(Zm*R*T))*((y1*B_11)+(y2*B_12)))-math.log(Zm))\n", - "phi2 = math.exp((((2*P*10**5)/(Zm*R*T))*((y1*B_12)+(y2*B_22)))-math.log(Zm))\n", - "\n", - "# Results\n", - "print \" The fugacity coefficient of n-butane in the equimolar mixture using the\\\n", - " Virial Equation of state = %0.3f \"%(phi1);\n", - "print \" The fugacity coefficient of n-octane in the equimolar mixture using the Virial\\\n", - " Equation of state = %f \"%(phi2);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity coefficient of n-butane in the equimolar mixture using the Virial Equation of state = 0.976 \n", - " The fugacity coefficient of n-octane in the equimolar mixture using the Virial Equation of state = 0.830827 \n" - ] - } - ], - "prompt_number": 29 - }, - { - "cell_type": "heading", - "level": 3, - "metadata": {}, - "source": [ - "Example 9.22 Page No : 349" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import math\n", - "# Variables\n", - "T = 427.85 \t\t\t #temperature of n-octane vapour in K\n", - "Psat = 0.215;\t\t\t #saturation pressure of n-octane vapour at T in MPa\n", - "P = 1.\t\t \t #pressure at which the fugacity of liquid n-octane is to be determined in MPa\n", - "f_sat = 0.2368;\t\t\t #fugacity of n-octane vapour at T and Psat taken from Example(9.5) in MPa\n", - "vl = 0.2003*10**-3;\t\t\t #molar volume of n-octane liquid at T and Psat taken from Example(3.16) in m**3/mol\n", - "R = 8.314;\t\t\t #universal gas constant in J/molK\n", - "\n", - "# Calculations\n", - "f_l = (0.2368*math.exp((vl*(P-Psat)*10**6)/(R*T)));\t\t\t \n", - "\n", - "# Results\n", - "print \" The fugacity of liquid n-octane at 427.85K and 1MPa = %0.4f MPa\"%(f_l);\n", - "\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " The fugacity of liquid n-octane at 427.85K and 1MPa = 0.2475 MPa\n" - ] - } - ], - "prompt_number": 30 - } - ], - "metadata": {} - } - ] -} \ No newline at end of file diff --git a/Chemical_Engineering_Thermodynamics/hardythe1/attachment/20150521.pdf b/Chemical_Engineering_Thermodynamics/hardythe1/attachment/20150521.pdf deleted file mode 100755 index a01e3318..00000000 Binary files a/Chemical_Engineering_Thermodynamics/hardythe1/attachment/20150521.pdf and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/1.png b/Chemical_Engineering_Thermodynamics/screenshots/1.png deleted file mode 100755 index 2ec2e814..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/1.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/2.png b/Chemical_Engineering_Thermodynamics/screenshots/2.png deleted file mode 100755 index 91cda60b..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/2.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/3.png b/Chemical_Engineering_Thermodynamics/screenshots/3.png deleted file mode 100755 index 61ce8534..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/3.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_gE-RTx1x2_vs_x1.png b/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_gE-RTx1x2_vs_x1.png deleted file mode 100755 index 90bbaf61..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_gE-RTx1x2_vs_x1.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_ln(gamma1-gamma2)_vs_x1.png b/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_ln(gamma1-gamma2)_vs_x1.png deleted file mode 100755 index b7a97cb1..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/Plot_of_ln(gamma1-gamma2)_vs_x1.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/T-x-y_diagram.png b/Chemical_Engineering_Thermodynamics/screenshots/T-x-y_diagram.png deleted file mode 100755 index f231eb76..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/T-x-y_diagram.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/ch1.png b/Chemical_Engineering_Thermodynamics/screenshots/ch1.png deleted file mode 100755 index ae25b279..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/ch1.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/ch8.png b/Chemical_Engineering_Thermodynamics/screenshots/ch8.png deleted file mode 100755 index 29959197..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/ch8.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic111.png b/Chemical_Engineering_Thermodynamics/screenshots/pic111.png deleted file mode 100755 index 0564964c..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/pic111.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic222.png b/Chemical_Engineering_Thermodynamics/screenshots/pic222.png deleted file mode 100755 index 2442734b..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/pic222.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pic333.png b/Chemical_Engineering_Thermodynamics/screenshots/pic333.png deleted file mode 100755 index 2fcec895..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/pic333.png and /dev/null differ diff --git a/Chemical_Engineering_Thermodynamics/screenshots/pressureVSvol3.png b/Chemical_Engineering_Thermodynamics/screenshots/pressureVSvol3.png deleted file mode 100755 index 9e02c340..00000000 Binary files a/Chemical_Engineering_Thermodynamics/screenshots/pressureVSvol3.png and /dev/null differ -- cgit