{ "metadata": { "name": "", "signature": "sha256:23882ec0847c225b7b257c6443fe29684678f1f963a02f167a621eba14c49963" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 10 : Vapor Liquid Equillibrium Introduction" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10.1 page no : 148" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "\n", "from matplotlib.pyplot import plot,subplot,suptitle,xlabel,ylabel\n", "from numpy import array,linspace,exp\n", "import math \n", "\n", "#Antoinie Equations\n", "#ln P1_sat = 14.2724-(2945.47/(T-49.15)) [KPa]\n", "#ln P2_sat = 14.2043-(2972.64/(T-64.15)) [KPa]\n", "#(a) Graph Showing P vs x1 and P vs y1 for T = 348.15K\n", "T = 348.15;\t\t\t#[K]\n", "#using BUBL P calculations\n", "\n", "#Calculation of P1_sat and P2_sat at T = 348.15K\n", "P1_sat = round(math.exp(14.2724-(2945.47/(T-49.15))),2) \t\t\t#KPa\n", "P2_sat = round(math.exp(14.2043-(2972.64/(T-64.15))),2) \t\t\t#KPa\n", "\n", "#Using Eqn P = P2_sat+(P1_sat-P2_sat)x1\n", "\n", "x = linspace(0,1,6)\n", "P = round(P2_sat+((P1_sat-P2_sat)*x),2);\n", "y = round(x*P1_sat/P,4);\n", "\n", "print ('Explanations Of graph')\n", "\n", "Ans = [x,y,P];\n", "print ' x1 y1 P/PKa',Ans\n", "\n", "y1 = 0.6;\n", "y2 = 1-y1;\n", "P_dew = round(1/((y1/P1_sat)+(y2/P2_sat)),2)\n", "x1 = round(y1*P_dew/P1_sat,4)\n", "\n", "# Plotting the graph\n", "T = 348.15;\t\t\t#[K]\n", "P1_sat = round(exp(14.2724-(2945.47/(T-49.15))),2) \t\t\t#KPa\n", "P2_sat = round(exp(14.2043-(2972.64/(T-64.15))),2) \t\t\t#KPa\n", "\n", "x = linspace(0,1,6)\n", "P = round(P2_sat+((P1_sat-P2_sat)*x),2);\n", "y = round(x*P1_sat/P,4);\n", "\n", "plot(x,P,'g-') \t\t\t#P vs x1\n", "plot(y,P,'b-') \t\t\t#P vs y1\n", "x = [0,0.1];\n", "P = [P2_sat,P2_sat];\n", "plot(x,P,'--') \t\t\t#P2_sat\n", "x = [0.9,1];\n", "P = [P1_sat,P1_sat];\n", "plot(x,P,'r--') \t\t\t#P1_sat\n", "\n", "x1 = 0.6;\n", "P_b = round(P2_sat+((P1_sat-P2_sat)*x1),2);\n", "y1 = round(x1*P1_sat/P_b,4);\n", "x = [x1,y1];\n", "P = [P_b,P_b];\n", "plot(x,P,'bo-') \t\t\t#b--b'\n", "\n", "y1 = 0.6;\n", "y2 = 1-y1;\n", "P_c = round(1/((y1/P1_sat)+(y2/P2_sat)),2)\n", "x1 = round(y1*P_c/P1_sat,4)\n", "\n", "x = [x1,y1];\n", "P = [P_c,P_c];\n", "plot(x,P,'ro-') \t\t\t#c'--c\n", "\n", "P = [(P_b+10),P_b,P_c,(P_c-10)];\n", "x = [0.6,0.6,0.6,0.6];\n", "plot(x,P,'go-') \t\t\t#a--b--c--d--0.6\n", "\n", "P = [(P_c-10),30];\n", "x = [0.6,0.6];\n", "plot(x,P,'yo--')\n", "\n", "P = [110,80];\n", "x = [0.6,0.6];\n", "plot(x,P,'w')\n", "suptitle('(a)T/t = 348.15K')\n", "xlabel('x1,y1')\n", "ylabel('P/Kpa')\n", "\n", "print (\"This is the liquid-phase composition at point c''\")\n", "\n", "#(b) Graph showing (t vs x1) and (t vs y1) for a pressure of 70KPa\n", "#Example 10.2(b)\n", "P = 70;\t\t\t#[KPa]\n", "\n", "T1_sat = round(2945.47/(14.2724-math.log(P))+49.15,2);\n", "T2_sat = round(2972.64/(14.2043-math.log(P))+64.15,2);\n", "\n", "T = array([T1_sat,347.15,351.15,355.15,359.15,T2_sat]);\n", "\n", "P1_sat = round(exp(14.2724-(2945.47/(T-49.15))),2); \t\t\t#KPa\n", "P2_sat = round(exp(14.2043-(2972.64/(T-64.15))),2); \t\t\t#KPa\n", "\n", "x = round((P-P2_sat)/(P1_sat-P2_sat),3);\n", "y = round((x*P1_sat)/P,3);\n", "\n", "Ans = [x,y,T];\n", "print ' x1 y1 T/t(K/C)',Ans\n", "\n", "#at x1 = 0.6;\n", "x1_b = 0.6;\n", "x2_b = 1-x1_b;\n", "\n", "T_a = 347.15;\t\t\t# Intermediate Temperature (Point a in graph)\n", "P1_sat_a = round(exp(14.2724-(2945.47/(T_a-49.15))),2); \t\t\t#KPa\n", "P2_sat_a = round(exp(14.2043-(2972.64/(T_a-64.15))),2); \t\t\t#KPa\n", "alpha = P1_sat_a/P2_sat_a; \t\t\t#Initial\n", "a = T_a;\n", "i = -1;\n", "while(i == -1):\n", " P2_sat_b = P/((x1_b*alpha)+x2_b);\n", " b = round(2972.64/(14.2043-math.log(P2_sat_b))+64.15,2);\n", " dT = abs(a-b);\n", " if(dT == 0):\n", " i = 0;\n", " T_b = b;\n", " alpha = math.exp(0.0681-(2945.47/(b-49.15))+(2972.64/(b-64.15))); \t\t\t#Eqn C\n", " a = b;\n", "\n", "P1_sat_b = round(math.exp(14.2724-(2945.47/(T_b-49.15))),2); \t\t\t#KPa\n", "y1_b = round((x1_b*P1_sat_b)/P,4); \t\t\t#b\n", "\n", "print 'Hence by iteration Temp(Temp at b) at x1 = 0.6 is ',T_b,'K'\n", "print 'Hence by iteration P1_sat at x1 = 0.6 is ',P1_sat_b,'KPa'\n", "print 'Composition of Vapor(b) at x1 = 0.6',y1_b\n", "\n", "\n", "#At y1 = 0.6\n", "y1_c = 0.6;\n", "y2_c = 1-y1_c;\n", "T_d = 355.15;\t\t\t# Intermediate Temperature (Point a in graph)\n", "P1_sat_d = round(math.exp(14.2724-(2945.47/(T_d-49.15))),2); \t\t\t#KPa\n", "P2_sat_d = round(math.exp(14.2043-(2972.64/(T_d-64.15))),2); \t\t\t#KPa\n", "alpha = P1_sat_d/P2_sat_d; \t\t\t#Initial\n", "d = T_d;\n", "i = -1;\n", "while(i == -1):\n", " P1_sat_c = P*(y1_c+(y2_c*alpha));\n", " c = round(2945.47/(14.2724-math.log(P1_sat_c))+49.15,2);\n", " dT = abs(d-c);\n", " if(dT == 0):\n", " i = 0;\n", " T_c = c;\n", " alpha = math.exp(0.0681-(2945.47/(c-49.15))+(2972.64/(c-64.15))); \t\t\t#Eqn C\n", " d = c;\n", "\n", "P1_sat_c = round(math.exp(14.2724-(2945.47/(T_c-49.15))),2); \t\t\t#KPa\n", "x1_c = round((y1_c*P)/P1_sat_c,4); \t\t\t#c\n", "\n", "print 'Hence by iteration Temp(Temp at b) at y1 = 0.6 is ',T_c,'K'\n", "print 'Hence by iteration P1_sat at y1 = 0.6 is ',P1_sat_c,'KPa'\n", "print 'Composition of liqiud(c) at y1 = 0.6',x1_c\n", "\n", "#Graph\n", "T = linspace(T1_sat,T2_sat,10); \n", "\n", "P1_sat = round(exp(14.2724-(2945.47/(T-49.15))),2); \t\t\t#KPa\n", "P2_sat = round(exp(14.2043-(2972.64/(T-64.15))),2); \t\t\t#KPa\n", "\n", "x = round((P-P2_sat)/(P1_sat-P2_sat),3);\n", "y = round((x*P1_sat)/P,3);\n", "\n", "plot(x,T,'g-'); \n", "plot(y,T,'b-'); \n", "\n", "xsat = [0,0.1];\n", "T2sat = [T2_sat,T2_sat];\n", "plot(xsat,T2sat,'--') \t\t\t#T2_sat\n", "\n", "xsat = [0.9,1];\n", "T1sat = [T1_sat,T1_sat];\n", "plot(xsat,T1sat,'r--') \t\t\t#T1_sat\n", "\n", "Tcc = [T_c,T_c];\n", "xc = [x1_c,y1_c];\n", "plot(xc,Tcc,'ro-') \t\t\t#c--c'\n", "\n", "Tbb = [T_b,T_b];\n", "xb = [x1_b,y1_b];\n", "plot(xb,Tbb,'bo-') \t\t\t#b--b'\n", "\n", "Tabcd = [T_d,T_c,T_b,T_a];\n", "xabcd = [0.6,0.6,0.6,0.6];\n", "plot(xabcd,Tabcd,'go-') \t\t\t#a--b--c--d--0.6\n", "\n", "Tao = [T_a,340];\n", "xao = [0.6,0.6];\n", "plot(xao,Tao,'yo--')\n", "suptitle('(b)P = 70KPa')\n", "xlabel('x1,y1')\n", "ylabel('T(K)')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Explanations Of graph\n", " x1 y1 P/PKa [array([ 0. , 0.2, 0.4, 0.6, 0.8, 1. ]), array([ 0. , 0.3313, 0.5692, 0.7483, 0.888 , 1. ]), array([ 41.98, 50.23, 58.47, 66.72, 74.96, 83.21])]\n", "This is the liquid-phase composition at point c''" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", " x1 y1 T/t(K/C) [array([ 1. , 0.738, 0.516, 0.318, 0.142, 0. ]), array([ 1. , 0.849, 0.676, 0.474, 0.239, 0. ]), array([ 342.99, 347.15, 351.15, 355.15, 359.15, 362.73])]\n", "Hence by iteration Temp(Temp at b) at x1 = 0.6 is 349.57 K\n", "Hence by iteration P1_sat at x1 = 0.6 is 87.17 KPa\n", "Composition of Vapor(b) at x1 = 0.6 0.7472\n", "Hence by iteration Temp(Temp at b) at y1 = 0.6 is 352.73 K\n", "Hence by iteration P1_sat at y1 = 0.6 is 96.54 KPa\n", "Composition of liqiud(c) at y1 = 0.6 0.4351\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 9, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEhCAYAAACKklw+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYXGWB7/FvLV1bb+lOQkjCktCAENSBARlHEUu5JJHM\nJeDMRcW5oqLXuVzT0RlUAsOkUaOA4mhwGZfBYc0MMz5stoawtdFRwAUYNGYIDUEiEMjSne6uverc\nP95TXdVVdaqruruqqyu/z/Oc55x6z6mqtw/k/dV537OAiIiIiIiIiIiIiIiIiIiIiIiIiIiIiNRJ\nOzAEeIBPAK84b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ar/Nen5D3+kng\nhRmvqUgNNeoN/kRm2y8xNwX8PBAEbgV2VPC+QcyzPf4EEzIfwjwtTEREmkwLpqF/lIm3Vw5Tvrvp\nYswty92YMYiugvXqbpI5Q91NIs4WYLqa2jBHE1mTPb/gB5gbzv0F5lbUzXrrdjkMKCREnH0b+Hvg\nDuC6vPJSDzL6InCBvRwH7sc8He/7Dp/drA9DEhE5LHwA+Hd72Y3pcnoH5sE9rwIRzK2Yz7W3uQ/z\nYPmsN9vr88Og1y5LYB708p0a1V1ERBrM1oLXlwPXzEZFRESksd2FOd1Vg9MiIiIiIiIiIiIiIiIi\nIiIiIiIiIiIi9fX/AcBZfstMwAr6AAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10.2 page no : 149" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Variables\n", "H = 990.;\t\t\t#[Bar] Henry's Law const\n", "T = 283.15;\t\t\t#[K]\n", "P2_sat = 0.01227;\t\t\t#[Bar] from Steam Tables\n", "x1 = 0.01;\t\t\t#Assumed\n", "x2 = 1-x1;\n", "y1 = 1;\n", "\n", "# Calculations\n", "P = round((x1*H)+(x2*P2_sat),3);\n", "x1 = round((y1*P)/H,4);\n", "x2 = 1-x1;\n", "y2 = round((x2*P2_sat)/P,4);\n", "y1 = 1-y2;\n", "\n", "# Results\n", "print 'Composition in liquid Phase',x1\n", "print 'Composition in vapor Phase',y1\n", "print 'Pressure Exerted on Can',P,'Bar'\n", "print ('Hence Vapor phase chosen is nearly pure')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Composition in liquid Phase 0.01\n", "Composition in vapor Phase 0.9988\n", "Pressure Exerted on Can 9.912 Bar\n", "Hence Vapor phase chosen is nearly pure\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10.3 page no : 150" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math \n", "\n", "#Equations to be Used\n", "# ln v1 = A*(x2**2) ln v2 = A*(x1**2) Where A = 2.771-0.00523T\n", "\n", "#Antoine Equations\n", "#ln P1_sat = 16.59158-(3643.31/(T-33.424)) \n", "#ln P2_sat = 14.25326-(2665.54/(T-53.424))\n", "#P = E(xi * Vi * Pi_sat) E--Summation Eqn 10.6\n", "#P = 1/E(yi / (vi * Pi_sat)) E--Summation Eqn 10.7\n", "\n", "#(a) Calculate P and (yi) , for T = 318.15K and x1 = 0.25\n", "\n", "# Variables\n", "T = 318.15;\t\t\t#[K] Given\n", "x1 = 0.25; \t\t\t#Given\n", "x2 = 1-x1;\n", "\n", "# Calculations and Results\n", "P1_sat = round(math.exp(16.59158-(3643.31/(T-33.424))),2);\t\t\t#[KPa]\n", "P2_sat = round(math.exp(14.25326-(2665.54/(T-53.424))),2);\t\t\t#[KPa]\n", "A = round(2.771-(0.00523*T),3);\n", "v1 = round(math.exp(A*(x2**2)),3);\n", "v2 = round(math.exp(A*(x1**2)),3);\n", "\n", "#Form Eqn(10.6)\n", "P_a = round((x1*v1*P1_sat)+(x2*v2*P2_sat),2);\t\t\t#[KPa]\n", "y1_a = round((x1*v1*P1_sat)/P_a,3);\n", "y2_a = round((x2*v2*P2_sat)/P_a,3);\n", "\n", "print ('(a)P and [yi] for T = 318.15K and x1 = 0.25')\n", "print ('BUBL P calculations')\n", "print 'P = ',P_a,'KPa'\n", "print 'y1 = ',y1_a\n", "print 'y2 = ',y2_a\n", "\n", "#(b) Calculate P and (xi) , for T = 318.15K and y1 = 0.60\n", "\n", "#DEW P calculation\n", "y1 = 0.6;\n", "y2 = 1-y1;\n", "T = 318.15;\t\t\t#[K]\n", "P1_sat = round(math.exp(16.59158-(3643.31/(T-33.424))),2);\t\t\t#[KPa]\n", "P2_sat = round(math.exp(14.25326-(2665.54/(T-53.424))),2);\t\t\t#[KPa]\n", "A = round(2.771-(0.00523*T),3);\n", "v1 = 0.1;\t\t\t#Assumed\n", "v2 = 0.1;\t\t\t#Assumed\n", "a1 = v1;\n", "a2 = v2;\n", "i = -1;\n", "while(i == -1):\n", " P = round(1/((y1/(a1*P1_sat))+(y2/(a2*P2_sat))),2); \n", " x1 = round(y1*P/(a1*P1_sat),4);\n", " x2 = 1-x1;\n", " b1 = round(math.exp(A*(x2**2)),4);\n", " b2 = round(math.exp(A*(x1**2)),4);\n", " dt = abs(b1-a1);\n", " if(dt == 0):\n", " i = 0;\n", " v1 = b1;\n", " v2 = b2;\n", " break;\n", " a1 = b1;\n", " a2 = b2;\n", "\n", "x1_b = x1;\n", "x2_b = 1-x1_b;\n", "P_b = P;\n", "v1_b = v1;\n", "v2_b = v2;\n", "print ('(b)P and [xi] for T = 318.15K and y1 = 0.60')\n", "print ('DEW P calculations')\n", "print 'P = ',P_b,'kPa'\n", "print 'x1 = ',x1_b\n", "print 'x2 = ',x2_b\n", "\n", "#(c) Calculate T and (yi) for P = 101.33 KPa and x1 = 0.85\n", "\n", "#BUBL T calculation\n", "P = 101.33;\n", "x1 = 0.85;\n", "x2 = 1-x1;\n", "T1_sat = round((3643.31/(16.59158-math.log(P)))+33.424,2);\n", "T2_sat = round((2665.54/(14.25326-math.log(P)))+53.424,2);\n", "T = (x1*T1_sat)+(x2*T2_sat);\n", "a = T;\t\t\t#Initial\n", "i = -1;\n", "while(i == -1):\n", " A = round(2.771-(0.00523*a),4);\n", " v1 = round(math.exp(A*(x2**2)),4);\n", " v2 = round(math.exp(A*(x1**2)),4);\n", " P1_sat = round(math.exp(16.59158-(3643.31/(a-33.424))),2);\t\t\t#[KPa]\n", " P2_sat = round(math.exp(14.25326-(2665.54/(a-53.424))),2);\t\t\t#[KPa]\n", " alpha = P1_sat/P2_sat; \n", " P1_sat = round(P/((x1*v1)+(x2*v2/alpha)),2);\n", " b = round((3643.31/(16.59158-math.log(P1_sat)))+33.424,2);\n", " dt = abs(b-a);\n", " if(dt == 0):\n", " i = 0;\n", " T = b;\n", " break;\n", " a = b;\n", "\n", "T_c = T;\n", "y1_c = round(x1*v1*P1_sat/P,3);\n", "y2_c = 1-y1_c;\n", "print ('(c)T and [yi] for P = 101.33kPa and x1 = 0.')\n", "print ('BUBL T calculations')\n", "print 'Temperature = ',T_c,'K'\n", "print 'y1 = ',y1_c\n", "print 'y2 = ',y2_c\n", "\n", "#(d) Calculate T and (xi) for P = 101.3 KPa and y1 = 0.4\n", "P = 101.3;\n", "y1 = 0.4;\n", "y2 = 1-y1;\n", "T1_sat = round((3643.31/(16.59158-math.log(P)))+33.424,2);\n", "T2_sat = round((2665.54/(14.25326-math.log(P)))+53.424,2);\n", "T = (y1*T1_sat)+(y2*T2_sat);\n", "v1 = 1; \t\t\t#Initially\n", "v2 = 1; \t\t\t#Initially\n", "a = T; \t\t\t#Initial\n", "i = -1;\n", "while(i == -1):\n", " A = round(2.771-(0.00523*a),4);\n", " P1_sat = round(math.exp(16.59158-(3643.31/(a-33.424))),2);\t\t\t#[KPa]\n", " P2_sat = round(math.exp(14.25326-(2665.54/(a-53.424))),2);\t\t\t#[KPa]\n", " alpha = P1_sat/P2_sat;\n", " x1 = round((y1*P)/(v1*P1_sat),4);\n", " x2 = 1-x1;\n", " v1 = round(math.exp(A*(x2**2)),4);\n", " v2 = round(math.exp(A*(x1**2)),4);\n", " P1_sat = P*((y1/v1)+(y2*alpha/v2));\n", " b = round((3643.31/(16.59158-math.log(P1_sat)))+33.424,2);\n", " dt = abs(a-b);\n", " if(dt == 0):\n", " T = a;\n", " i = 0;\n", " break;\n", " a = b;\n", "T_d = T;\n", "x1_d = x1;\n", "x2_d = x2;\n", "print ('(d)T and [xi] for P = 101.33kPa and y1 = 0.40')\n", "print ('DEW T calculations')\n", "print 'T = ',T,'K'\n", "print 'x1 = ',x1_d\n", "print 'x2 = ',x2_d\n", "\n", "#(e) Taz , (xi_az) and (yi_az) for T = 318.15K \n", "T = 318.15;\n", "# Relative Volatility alpha_12 = (y1/x1)/(y2/x2)\n", "#At Azeotrope y1 = x1 and y2 = x2 and alpha_12 = 1\n", "P1_sat = round(math.exp(16.59158-(3643.31/(T-33.424))),2);\t\t\t#[KPa]\n", "P2_sat = round(math.exp(14.25326-(2665.54/(T-53.424))),2);\t\t\t#[KPa]\n", "#From eqn (10.5) alpha_12 = (v1*P1_sat)/(v2*P2_sat)\n", "A = round(2.771-(0.00523*T),4);\n", "\n", "#When x1 = 0 v2 = 1 and v1 = math.exp(A)\n", "alpha_12_x10 = P1_sat*math.exp(A)/P2_sat; \n", "\n", "#When x1 = 1 v1 = 1 and v2 = math.exp(A)\n", "alpha_12_x11 = P1_sat/(P2_sat*math.exp(A));\n", "\n", "#But this is not Azeotrope (at Azeotrope alpha_12 = 1)\n", "\n", "#v1_az/v2_az = (P2_sat/P1_sat) = K\n", "K = P2_sat/P1_sat;\n", "\n", "#ln(v1/v2) = ln(K) = A(1-(2*x1))\n", "x1_az = round((A-math.log(K))/(2*A),3);\n", "x2_az = 1-x1_az;\n", "y1_az = x1_az;\n", "y2_az = x2_az;\n", "v1_az = round(math.exp(A*(x2_az**2)),3);\n", "v2_az = round(math.exp(A*(x1_az**2)),3);\n", "P_az = round(v1_az*P1_sat,2);\n", "\n", "print ('Azeotropic Pressure and Azeotropic Composition for T = 318.15K')\n", "print 'Azeotropic Pressure = ',P_az,'KPa'\n", "print 'x1_az',x1_az\n", "print 'y1_az',y1_az\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)P and [yi] for T = 318.15K and x1 = 0.25\n", "BUBL P calculations\n", "P = 73.52 KPa\n", "y1 = 0.282\n", "y2 = 0.718\n", "(b)P and [xi] for T = 318.15K and y1 = 0.60\n", "DEW P calculations\n", "P = 62.89 kPa\n", "x1 = 0.8168\n", "x2 = 0.1832\n", "(c)T and [yi] for P = 101.33kPa and x1 = 0.\n", "BUBL T calculations\n", "Temperature = 331.2 K\n", "y1 = 0.67\n", "y2 = 0.33\n", "(d)T and [xi] for P = 101.33kPa and y1 = 0.40\n", "DEW T calculations\n", "T = 326.69 K\n", "x1 = 0.4598\n", "x2 = 0.5402\n", "Azeotropic Pressure and Azeotropic Composition for T = 318.15K\n", "Azeotropic Pressure = 73.71 KPa\n", "x1_az 0.325\n", "y1_az 0.325\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10.4 page no : 151" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import array,round\n", "import math \n", "\n", "# Variables\n", "T = 283.15;\t\t\t#[K]\n", "#(a) Dew Point Pressure\n", "#Species = [\" Methane \";\" Ethane \";\" Propane \"];\n", "y = array([0.1,0.2,0.7]);\n", "\n", "P1 = 6.9;\t\t\t#[bar]\n", "K1 = array([20,3.25,0.92]);\n", "x1 = round(y/K1,3);\n", "\n", "P2 = 10.34;\t\t\t#[bar]\n", "K2 = array([13.2,2.25,0.65]);\n", "x2 = round(y/K2,3);\n", "\n", "P3 = 8.7;\t\t\t#[bar]\n", "K3 = array([16,2.65,0.762]);\n", "x3 = round(y/K3,3);\n", "\n", "P = [P1,P2,P3];\n", "x = [x1,x2,x3];\n", "E1 = zeros(3);\n", "\n", "# Calculations and Results\n", "for i in range(3):\n", " for j in range(3):\n", " E1[i] = E1[i]+x[i][j];\t\t\t#Summation\n", "\n", "P_dew = 8.7;\n", "Ans = [[y,K1,x1,K2,x2,K3,x3],[1,0,E1[0],0,E1[1],0,E1[2]]];\n", "print ( ' P = 6.9 bar P = 10.34 bar P = 8.7 bar')\n", "print ' yi Ki yi/Ki Ki yi/Ki Ki yi/Ki',Ans\n", "print ('Last Row Represents the summation')\n", "print 'The dew Point Pressure',P_dew,'KPa'\n", "\n", "T = 283.15;\t\t\t#[K]\n", "#(b) Bubble Point Pressure\n", "#Species = [\" Methane \";\" Ethane \";\" Propane \"];\n", "x = array([0.1,0.2,0.7]);\n", "\n", "P1 = 26.2;\t\t\t#[bar]\n", "K1 = array([5.6,1.11,0.335]);\n", "y1 = round(x*K1,3);\n", "\n", "P2 = 27.6;\t\t\t#[bar]\n", "K2 = array([5.25,1.07,0.32]);\n", "y2 = round(x*K2,3);\n", "\n", "P3 = 26.54;\t\t\t#[bar]\n", "K3 = [5.49,1.1,0.33];\n", "y3 = round(x*K3,3);\n", "\n", "i = 1;\n", "j = 1;\n", "P = [P1,P2,P3];\n", "y = [y1,y2,y3];\n", "E2 = zeros(3);\n", "for i in range(3):\n", " for j in range(3):\n", " E2[i] = E2[i] + y[i][j] \t\t\t#Summation\n", "\n", "P_Bubble = 26.54;\n", "Ans = [[x,K1,y1,K2,y2,K3,y3],[1,0,E2[0],0,E2[1],0,E2[2]]]\n", "print ( ' P = 26.2 bar P = 27.6 bar P = 26.54 bar')\n", "print ' xi Ki xiKi Ki xiKi Ki xiKi',Ans\n", "print ('Last Row Represents the summation')\n", "print 'The Bubble Point Pressure',P_Bubble,'KPa'\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " P = 6.9 bar P = 10.34 bar P = 8.7 bar\n", " yi Ki yi/Ki Ki yi/Ki Ki yi/Ki [[array([ 0.1, 0.2, 0.7]), array([ 20. , 3.25, 0.92]), array([ 0.005, 0.062, 0.761]), array([ 13.2 , 2.25, 0.65]), array([ 0.008, 0.089, 1.077]), array([ 16. , 2.65 , 0.762]), array([ 0.006, 0.075, 0.919])], [1, 0, 0.82800000000000007, 0, 1.1739999999999999, 0, 1.0]]\n", "Last Row Represents the summation\n", "The dew Point Pressure 8.7 KPa\n", " P = 26.2 bar P = 27.6 bar P = 26.54 bar\n", " xi Ki xiKi Ki xiKi Ki xiKi [[array([ 0.1, 0.2, 0.7]), array([ 5.6 , 1.11 , 0.335]), array([ 0.56 , 0.222, 0.234]), array([ 5.25, 1.07, 0.32]), array([ 0.525, 0.214, 0.224]), [5.49, 1.1, 0.33], array([ 0.549, 0.22 , 0.231])], [1, 0, 1.016, 0, 0.96299999999999997, 0, 1.0]]\n", "Last Row Represents the summation\n", "The Bubble Point Pressure 26.54 KPa\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10.5 page no : 152" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math \n", "\n", "# Variables\n", "z1 = 0.45;\n", "z2 = 0.35;\n", "z3 = 0.2;\n", "P = 110.;\t\t\t#[KPa]\n", "T = 353.15;\t\t\t#[K]\n", "P1_sat = 195.75;\t\t\t#[KPa]\n", "P2_sat = 97.84;\t\t\t#[KPa]\n", "P3_sat = 50.32;\t\t\t#[KPa]\n", "\n", "# Calculations\n", "#BUBL Calculation\n", "x1 = z1;\n", "x2 = z2;\n", "x3 = z3;\n", "P_BUBL = (x1*P1_sat)+(x2*P2_sat)+(x3*P3_sat);\n", "\n", "#DEW Calculation\n", "y1 = z1;\n", "y2 = z2;\n", "y3 = z3;\n", "P_Dew = 1/((y1/P1_sat)+(y2/P2_sat)+(y3/P3_sat));\n", "\n", "#Since P_Bubl