{ "metadata": { "name": "ch14_1", "signature": "sha256:98f2e1e0f1c561d3ee302fd629093b7572c8b263613f73036059e7020f90d8cc" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 14 : Activity Coefficients Models for Liquid Mixtures" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.4 Page Number : 461" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "import math\n", "\n", "# Variables,\n", "T = 300;\t\t\t#[K] - Temperature\n", "b = 100;\t\t\t#[cal/mol]\n", "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n", "# R*T*math.log(Y_1) = b*x_2**(2)\n", "# R*T*math.log(Y_2) = b*x_1**(2)\n", "\n", "#For equimolar mixture\n", "x_1 = 0.5;\t\t\t#Mole fraction of component 1\n", "x_2 = 0.5;\t\t\t#Mole fraction of component 2\n", "\n", "# Calculations and Results\n", "#The excess Gibbs free energy is given by\n", "# G_excess = R*T*(x_1*math.log(Y_1) + x_2*math.log(Y_2)) = b*x_1*x_2**(2) + b*x_2*x_1**(2) = b*x_1*(x_1 + x_2) = b*x_1*x_2\n", "G_excess = b*x_1*x_2;\t\t\t#[cal/mol]\n", "\n", "#The ideal Gibbs free energy change of mixing is given by,\n", "delta_G_id_mix = R*T*(x_1*math.log(x_1)+x_2*math.log(x_2));\t\t\t#[cal/mol]\n", "\n", "#The Gibbs free energy of mixing is given by\n", "delta_G_mix = delta_G_id_mix + G_excess;\t\t\t#[cal/mol]\n", "\n", "\n", "# delta_S_mix = delta_S_id_mix = - R*sum(x_i*math.log(x_i))\n", "\n", "#delta_G_mix = delta_H_mix - T*delta_S_mix = delta_H_mix + R*T*(x_1*math.log(x_1)+x_2*math.log(x_2))\n", "delta_H_mix = b*x_1*x_2;\t\t\t#[cal/mol]\n", "\n", "print \"The value of Gibbs free energy change for equimolar mixture formation is %f cal/mol\"%(delta_G_mix);\n", "print \"The value of enthalpy change for equimolar mixture formation is %f cal/mol\"%(delta_H_mix);\n", "\n", "#Work required for separation of mixture into pure components is\n", "W = delta_G_mix;\n", "print \"The least amount of work required for separation at 300 K is %f cal/mol\"%(W);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of Gibbs free energy change for equimolar mixture formation is -388.185034 cal/mol\n", "The value of enthalpy change for equimolar mixture formation is 25.000000 cal/mol\n", "The least amount of work required for separation at 300 K is -388.185034 cal/mol\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.10 Page Number : 466" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "import math \n", "from numpy import zeros\n", "from scipy.stats import linregress\n", "\n", "# Variables,\n", "T = 25 +173.15;\t\t\t#[K] - Temperature\n", "x_1=[0.0115,0.0160,0.0250,0.0300,0.0575,0.1125,0.1775,0.2330,0.4235,0.5760,0.6605,0.7390,0.8605,0.9250,0.9625];\n", "y_1=[8.0640,7.6260,7.2780,7.2370,5.9770,4.5434,3.4019,2.8023,1.7694,1.3780,1.2302,1.1372,1.0478,1.0145,1.0070];\n", "y_2=[1.0037,1.0099,1.0102,1.0047,1.0203,1.0399,1.1051,1.1695,1.4462,1.8520,2.2334,2.6886,3.7489,4.8960,5.6040];\n", "\n", "x_2 = zeros(15);\t\t\t# x_2 = (1 - x_1)\n", "G_RT = zeros(15);\t\t\t# G_RT = G_excess/(R*T)\n", "x1x2_G_RT = zeros(15);\t\t\t# x1x2_G_RT = (x_1*x_2/(G_excess/(R*T)))\n", "G_RTx1x2 = zeros(15);\t\t\t# G_RTx1x1 = G_excess/(R*T*x_1*x_2)\n", "\n", "# Calculations and Results\n", "for i in range(15):\n", " x_2[i]=(1-x_1[i]);\n", " G_RT[i]=(x_1[i]*math.log(y_1[i]))+(x_2[i]*math.log(y_2[i]));\n", " x1x2_G_RT[i]=(x_1[i]*x_2[i])/G_RT[i];\n", " G_RTx1x2[i]=1/x1x2_G_RT[i];\n", "\n", "\n", "slop,intr,sig,d,e=linregress(x_1,x1x2_G_RT);\n", "\n", "A = 1/intr;\n", "B = 1/(slop+(1/A));\n", "print \" The value of van Laar parameters are A = %f and B = %f\"%(A,B);\n", "\n", "# Now from Margules equation\n", "# G_RTx1x2 = G_excess/(R*T*x_1*x_2) = B1*x_1 + A1*x_1 = A1 + (B1 - A1)*x_1\n", "#slope = (B1 - A1) and intercept = A1\n", "\n", "# Again employing the concept of linear regression of the data ( x_1 , G_RTx1x2 ) to find the value of intercept and slope of the above equation\n", "#Let slope = slop1 and intercept = intr1\n", "\n", "slop1,intr1,sig1,d,e=linregress(x_1,G_RTx1x2);\n", "\n", "A1 = intr1;\n", "B1 = slop1 + A1;\n", "print \" The value of Margules parameters are A = %f and B = %f\"%(A1,B1);\n", "\n", "print \" Because of the higher value of correlation factor for Van Laar model it fits the data better.\"\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The value of van Laar parameters are A = 2.271326 and B = 1.781420\n", " The value of Margules parameters are A = 2.293274 and B = 1.746000\n", " Because of the higher value of correlation factor for Van Laar model it fits the data better.\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.11 Page Number : 470" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables,\n", "T = 60 + 273.15;\t\t\t#[K] - Temperature\n", "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n", "#component 1 = acetone\n", "#component 2 = water\n", "x_1 = 0.3;\t\t\t# Mole fraction of component 1\n", "x_2 = 1 - x_1;\t\t\t#Mole fraction of component 2\n", "V_mol_1 = 74.05;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n", "V_mol_2 = 18.07;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n", "\n", "#for Wilson equation\n", "a_12 = 291.27;\t\t\t#[cal/mol]\n", "a_21 = 1448.01;\t\t\t#[cal/mol]\n", "\n", "#For NRTL\n", "b_12 = 631.05;\t\t\t#[cal/mol]\n", "b_21 = 1197.41;\t\t\t#[cal/mol]\n", "alpha = 0.5343;\n", "\n", "# Calculations and Results\n", "#Froom wilson equation\n", "A_12=(V_mol_2/V_mol_1)*(math.exp(-a_12/(R*T)));\n", "A_21 = (V_mol_1/V_mol_2)*(math.exp(-a_21/(R*T)));\n", "Beta = A_12/(x_1+x_2*A_12) - A_21/(x_2+x_1*A_21);\n", "#math.log(Y1) = -math.log(x_1 + x_2*A_12) + x_2*Beta; \n", "Y1 = math.exp(-math.log(x_1+x_2*A_12)+x_2*Beta);\n", "#similarly for Y2\n", "Y2 = math.exp(-math.log(x_2+x_1*A_21)-x_1*Beta);\n", "print \"The value of activity coefficients for Wilson equation are Y1 = %f \\t and \\t Y2 = %f\"%(Y1,Y2);\n", "\n", "#From NRTL equation,\n", "t_12 = b_12/(R*T);\n", "t_21 = b_21/(R*T);\n", "G_12 = math.exp(-alpha*t_12);\n", "G_21 = math.exp(-alpha*t_21);\n", "\n", "#math.log(Y1) = x_1**(2)*[t_12*(G_12/(x_1+x_2*G_12))**(2) + (G_12*t_12)/((G_12/(x_1+x_2*G_12))**(2))]\n", "Y1_prime = math.exp(x_2**(2)*(t_21*(G_21/(x_1+x_2*G_21))**(2)+(G_12*t_12)/(((x_2+x_1*G_12))**(2))));\n", "#Similarly for Y2\n", "Y2_prime = math.exp(x_1**(2)*(t_12*(G_12/(x_2+x_1*G_12))**(2)+(G_21*t_21)/(((x_1+x_2*G_21))**(2))));\n", "\n", "print \"The value of activity coefficients for NRTL equation are Y1 = %f \\t and \\t Y2 = %f\"%(Y1_prime,Y2_prime);\n", "\n", "\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of activity coefficients for Wilson equation are Y1 = 2.172258 \t and \t Y2 = 1.254121\n", "The value of activity coefficients for NRTL equation are Y1 = 2.143030 \t and \t Y2 = 1.262506\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.12 Page Number : 474" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables \n", "T = 307;\t\t\t#[K]\n", "x_1 = 0.047;\n", "x_2 = 1 - x_1;\n", "\n", "# The subgroups in the two components are\n", "# Acetone (1) : 1 CH3, 1 CH3CO\n", "# n-pentane (2) : 2 CH3, 3 CH2\n", "\n", "#Group volume (Rk) and surface area (Qk) parameters of the subgroup are\n", "k_CH3 = 1;\n", "k_CH2 = 2;\n", "k_CH3CO = 19;\n", "Rk_CH3 = 0.9011;\n", "Rk_CH2 = 0.6744;\n", "Rk_CH3CO = 1.6724;\n", "Qk_CH3 = 0.848;\n", "Qk_CH2 = 0.540;\n", "Qk_CH3CO = 1.4880;\n", "\n", "# Interaction parameters of the subgroups in kelvin (K) are\n", "a_1_1 = 0;\n", "a_1_2 = 0;\n", "a_1_19 = 476.40;\n", "a_2_1 = 0;\n", "a_2_2 = 0;\n", "a_2_19 = 476.40;\n", "a_19_1 = 26.76;\n", "a_19_2 = 26.76;\n", "a_19_19 = 0;\n", "\n", "# Calculations\n", "r_1 = 1*Rk_CH3 + 1*Rk_CH3CO;\n", "r_2 = 2*Rk_CH3 + 3*Rk_CH2;\n", "q_1 = 1*Qk_CH3 + 1*Qk_CH3CO;\n", "q_2 = 2*Qk_CH3 + 3*Qk_CH2;\n", "\n", "J_1 = r_1/(r_1*x_1+r_2*x_2);\n", "J_2 = r_2/(r_1*x_1+r_2*x_2);\n", "L_1 = q_1/(q_1*x_1+q_2*x_2);\n", "L_2 = q_2/(q_1*x_1+q_2*x_2);\n", "t_1_1 = math.exp(-a_1_1/T);\n", "t_1_2 = math.exp(-a_1_2/T);\n", "t_1_19 = math.exp(-a_1_19/T);\n", "t_2_1 = math.exp(-a_2_1/T);\n", "t_2_2 = math.exp(-a_2_2/T);\n", "t_2_19 = math.exp(-a_2_19/T);\n", "t_19_1 = math.exp(-a_19_1/T);\n", "t_19_2 = math.exp(-a_19_2/T);\n", "t_19_19 = math.exp(-a_19_19/T);\n", "\n", "e_1_1 = 1*Qk_CH3/q_1;\n", "e_2_1 = 0;\n", "e_19_1 = (1*Qk_CH3CO/q_1);\n", "e_1_2 = 2*Qk_CH3/q_2;\n", "e_2_2 = 3*Qk_CH2/q_2;\n", "e_19_2 = 0;\n", "\n", "B_1_1 = e_1_1*t_1_1 + e_2_1*t_2_1 + e_19_1*t_19_1;\n", "B_1_2 = e_1_1*t_1_2 + e_2_1*t_2_2 + e_19_1*t_19_2;\n", "B_1_19 = e_1_1*t_1_19 + e_2_1*t_2_19 + e_19_1*t_19_19;\n", "B_2_1 = e_1_2*t_1_1 + e_2_2*t_2_1 + e_19_2*t_19_1;\n", "B_2_2 = e_1_2*t_1_2 + e_2_2*t_2_2 + e_19_2*t_19_2;\n", "B_2_19 = e_1_2*t_1_19 + e_2_2*t_2_19 + e_19_2*t_19_19;\n", "\n", "theta_1 = (x_1*q_1*e_1_1 + x_2*q_2*e_1_2)/(x_1*q_1 + x_2*q_2);\n", "theta_2 = (x_1*q_1*e_2_1 + x_2*q_2*e_2_2)/(x_1*q_1 + x_2*q_2);\n", "theta_19 = (x_1*q_1*e_19_1 + x_2*q_2*e_19_2)/(x_1*q_1 + x_2*q_2);\n", "\n", "s_1 = theta_1*t_1_1 + theta_2*t_2_1 + theta_19*t_19_1;\n", "s_2 = theta_1*t_1_2 + theta_2*t_2_2 + theta_19*t_19_2;\n", "s_19 = theta_1*t_1_19 + theta_2*t_2_19 + theta_19*t_19_19;\n", "\n", "# math.log(Y1_C) = 1 - J_1 + math.log(J_1) - 5*q_1*(1- (J_1/L_1) + math.log(J_1/L_1))\n", "# math.log(Y2_C) = 1 - J_2 + math.log(J_2) - 5*q_2*(1- (J_2/L_2) + math.log(J_2/L_2))\n", "Y1_C = math.exp(1 - J_1 + math.log(J_1) - 5*q_1*(1- (J_1/L_1) + math.log(J_1/L_1)));\n", "Y2_C = math.exp(1 - J_2 + math.log(J_2) - 5*q_2*(1- (J_2/L_2) + math.log(J_2/L_2)));\n", "\n", "# For species 1\n", "summation_theta_k_1 = theta_1*(B_1_1/s_1) + theta_2*(B_1_2/s_2) + theta_19*(B_1_19/s_19);\n", "summation_e_ki_1 = e_1_1*math.log(B_1_1/s_1) + e_2_1*math.log(B_1_2/s_2) + e_19_1*math.log(B_1_19/s_19);\n", "\n", "# For species 2\n", "summation_theta_k_2 = theta_1*(B_2_1/s_1) + theta_2*(B_2_2/s_2) + theta_19*(B_2_19/s_19);\n", "summation_e_ki_2 = e_1_2*math.log(B_2_1/s_1) + e_2_2*math.log(B_2_2/s_2) + e_19_2*math.log(B_2_19/s_19);\n", "\n", "# math.log(Y1_R) = q_1(1 - summation_theta_k_1 + summation_e_ki_1)\n", "# math.log(Y2_R) = q_2(1 - summation_theta_k_2 + summation_e_ki_2)\n", "Y1_R = math.exp(q_1*(1 - summation_theta_k_1 + summation_e_ki_1));\n", "Y2_R = math.exp(q_2*(1 - summation_theta_k_2 + summation_e_ki_2));\n", "\n", "# math.log(Y1) = math.log(Y1_C) + math.log(Y1_R)\n", "# math.log(Y2) = math.log(Y2_C) + math.log(Y2_R)\n", "Y1 = math.exp(math.log(Y1_C) + math.log(Y1_R));\n", "Y2 = math.exp(math.log(Y2_C) + math.log(Y2_R));\n", "\n", "# Results\n", "print \" The activity coefficients are Y1 = %f and Y2 = %f\"%(Y1,Y2);\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " The activity coefficients are Y1 = 4.992034 and Y2 = 1.005260\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.13 Page Number : 481" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables,\n", "T = 25 + 273.15;\t\t\t#[K] - Temperature\n", "R = 1.987;\t\t\t#[cal/mol*K] - Universal gas constant\n", "#component 1 = chloroform\n", "#component 2 = carbon tetrachloride\n", "x_1 = 0.5;\t\t\t#Mole fraction of component 1 \t\t\t#Equimolar mixture\n", "x_2 = 0.5;\t\t\t#Mole fraction of component 2\n", "V_mol_1 = 81;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 1\n", "V_mol_2 = 97;\t\t\t#[cm**(3)/mol] - Molar volume of pure component 2\n", "del_1 = 9.2;\t\t\t#[(cal/cm**(3))**(1/2)] - Mole fraction of component 1\n", "del_2 = 8.6;\t\t\t#[(cal/cm**(3))**(1/2)] - Mole fraction of component 2\n", "\n", "# Calculations\n", "#Scatchard - Hilderbrand model\n", "phi_1 = (x_1*V_mol_1)/(x_1*V_mol_1+x_2*V_mol_2);\n", "phi_2 = (x_2*V_mol_2)/(x_1*V_mol_1+x_2*V_mol_2);\n", "\n", "#math.log(Y1) = (V_mol_1/(R*T))*phi_1**(2)*(del_1-del_2)**(2)\n", "Y1 = math.exp((V_mol_1/(R*T))*(phi_1**(2))*((del_1-del_2)**(2)));\n", "\n", "#Similarly, for Y2\n", "Y2 = math.exp((V_mol_2/(R*T))*(phi_2**(2))*((del_1-del_2)**(2)));\n", "\n", "# Results\n", "print \"The value of activity coefficients for Scatchard-Hilderbrand model are Y1 = %f \\t and \\t Y2 = %f\"%(Y1,Y2);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of activity coefficients for Scatchard-Hilderbrand model are Y1 = 1.010245 \t and \t Y2 = 1.017658\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.14 Page Number : 485" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables,\n", "T = 25 + 273.15;\t\t\t#[K] - Temperature\n", "mol_HCl = 0.001;\t\t\t#[mol/kg] - Molality of HCl\n", "A = 0.510;\t\t\t#[(kg/mol)**(1/2)]\n", "Z_positive = 1;\t\t\t#Stoichiometric coefficient of 'H' ion\n", "Z_negative = -1;\t\t\t#Stoichiometric coefficient of 'Cl' ion\n", "m_H_positive = mol_HCl;\t\t\t#\n", "m_Cl_negative = mol_HCl;\n", "\n", "# Calculations and Results\n", "# I = 1/2*[((Z_positive)**(2))*m_H_positive + ((Z_negative)**(2))*m_Cl_negative]\n", "I = 1./2*(((Z_positive)**(2))*m_H_positive + ((Z_negative)**(2))*m_Cl_negative);\n", "\n", "#Using Debye-Huckel limiting law wee get,\n", "# math.log(Y1) = -A*(abs(Z_positive*Z_negative))*(I**(1/2)))\n", "Y = 10**(-A*(abs(Z_positive*Z_negative))*(I**(1./2)));\n", "print \"The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = %f\"%(Y);\n", "\n", "#Using Debye-Huckel extended model we get\n", "#math.log(Y_prime) = (-A*(abs(Z_positive*Z_negative))*(I**(1/2)))/(1 + (I**(1/2)));\n", "Y_prime = 10**((-A*(abs(Z_positive*Z_negative))*(I**(1./2)))/(1 + (I**(1./2))));\n", "print \"The mean activity coefficient at 25 C using Debye-Huckel extended model is Y = %f\"%(Y_prime);\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = 0.963546\n", "The mean activity coefficient at 25 C using Debye-Huckel extended model is Y = 0.964643\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.15 Page Number : 485" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables,\n", "T = 25 + 273.15;\t\t\t#[K] - Temperature\n", "mol_CaCl2 = 0.001;\t\t\t#[mol/kg] - Molality of HCl\n", "A = 0.510;\t\t\t#[(kg/mol)**(1/2)]\n", "Z_positive = 2;\t\t\t#Stoichiometric coefficient of 'Ca' ion\n", "Z_negative = -1;\t\t\t#Stoichiometric coefficient of 'Cl' ion\n", "m_Ca_positive = mol_CaCl2;\n", "m_Cl_negative = 2*mol_CaCl2;\n", "\n", "# Calculations\n", "# I = 1/2*[((Z_positive)**(2))*m_Ca_positive + ((Z_negative)**(2))*m_Cl_negative]\n", "I = 1./2*(((Z_positive)**(2))*m_Ca_positive + ((Z_negative)**(2))*m_Cl_negative);\n", "\n", "#Using Debye-Huckel limiting law wee get,\n", "# math.log(Y1) = -A*(abs(Z_positive*Z_negative))*(I**(1/2)))\n", "Y = 10**(-A*(abs(Z_positive*Z_negative))*(I**(1./2)));\n", "\n", "# Results\n", "print \"The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = %f\"%(Y);\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = 0.879290\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.17 Page Number : 488" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables,\n", "T = 50 + 273.15;\t\t\t#[K] - Temperature\n", "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n", "x_1 = 0.3;\t\t\t# Mole fraction of component 1\n", "x_2 = (1-x_1);\t\t\t# Mole fraction of component 2\n", "#Increment of 1% means Y2 = 1.01*Y1\n", "\n", "# Calculations\n", "#Excess volume of the mixture is given by,\n", "V_excess = 4*x_1*x_2;\t\t\t#[cm**(3)/mol]\n", "#Amd threfore\n", "V_1_excess = 4*x_2*x_2*10**(-6);\t\t\t#[m**(3)/mol] - Exces volume of component 1\n", "V_2_excess = 4*x_1*x_1*10**(-6);\t\t\t#[m**(3)/mol] - Exces volume of component 2\n", "\n", "#We have from equation 14.89 of the book,\n", "#V_i_excess/(R*T) = (del_math.log(Y_i)/del_P)_T,x\n", "\n", "#Rearranging above equation\n", "#d(math.log(Y1)) = (V1_excess/(R*T))dP\n", "#Integrating the above equation at constant 'T' and 'x' in the limit from 'Y1' to '1.01*Y1' in the LHS and from 'P' to 'P+delta_P' in the RHS\n", "#On simplification we get\n", "#math.log(1.01*Y1/Y1) = (V_1_exces/(R*T))*delta_P\n", "delta_P = math.log(1.01)/(V_1_excess/(R*T));\t\t\t#[N/m**(2)]\n", "delta_P = delta_P*10**(-6);\t\t\t#[MPa]\n", "\n", "# Results\n", "print \"The required pressure to increase the activity coefficient by 1%% is %f MPa\"%(delta_P);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The required pressure to increase the activity coefficient by 1% is 13.639411 MPa\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.21 Page Number : 490" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Variables\n", "T = 293.15;\t\t\t#[K] - Temperature\n", "R=8.314;\t\t\t#[J/mol*K] - Universal gas constant\n", "A = 1280;\t\t\t#[J/mol]\n", "\n", "#(dA/dT)_P,x = del_A (say)\n", "dA_dT = -7.0;\t\t\t#[J/mol-K]\n", "\n", "#For equilomar mixture,\n", "x_1 = 0.5;\t\t\t# Mole fraction of component 1\n", "x_2 = 0.5;\t\t\t# Mole fraction of component 2\n", "\n", "# Calculations\n", "#math.log(Y1) = (A/(R*T))*x_2**(2)\n", "#math.log(Y2) = (A/(R*T))*x_1**(2)\n", "Y1 = math.exp((A/(R*T))*x_2**(2));\n", "Y2 = math.exp((A/(R*T))*x_1**(2));\n", "\n", "#G_excess/(R*T*) = x_1*math.log(Y1) + x_2*math.log(Y2) = (A/(R*T))*x_1*x_2\n", "G_excess = A*x_1*x_2;\t\t\t#[J/mol] - Excess Gibbs free energy\n", "\n", "#H_excess/(R*T**(2)) = -[d/dT(G_excess/(R*T))]_P,x\n", "#H_excess/(R*T**(2)) = -((x_1*x_2)/R)*[d/dT(A/T)]_P,x\n", "#On simplification and putting the values we get\n", "H_excess = A*x_1*x_2 - T*dA_dT*x_1*x_2;\t\t\t#[J/mol] - Excess enthalpy\n", "\n", "#Now excess entropy is given by\n", "S_excess = (H_excess - G_excess)/T;\t\t\t#[J/mol-K] - Excess entropy\n", "\n", "# Results\n", "print \"For equimolar mixture\";\n", "print \"Excess Gibbs free energy G_excess) is %f J/mol\"%(G_excess);\n", "print \"Excess enthalpy H_excess) is %f J/mol\"%(H_excess);\n", "print \"Excess entropy S_excess) is %f J/mol\"%(S_excess);\n", "print \"The value of activity coefficient Y1 is %f\"%(Y1);\n", "print \"The value of activity coefficient Y2 is %f\"%(Y2);\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "For equimolar mixture\n", "Excess Gibbs free energy G_excess) is 320.000000 J/mol\n", "Excess enthalpy H_excess) is 833.012500 J/mol\n", "Excess entropy S_excess) is 1.750000 J/mol\n", "The value of activity coefficient Y1 is 1.140305\n", "The value of activity coefficient Y2 is 1.140305\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 14.22 Page Number : 491" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "# Given\n", "T = 60 + 273.15;\t\t\t#[K] - Temperature\n", "R = 8.314;\t\t\t#[J/mol*K] - Universal gas constant\n", "\n", "# math.log(Y1_inf) = math.log(Y2_inf) = 0.15 + 10/T\n", "\n", "\n", "# From van L# Variablesr equation \n", "# A = math.log(Y1_inf) and B = math.log(Y2_inf) and since it is given that math.log(Y1_inf) = math.log(Y2_inf), therefore A = B\n", "#(x_1*x_2)/(G_excess/R*T) = x_1/B + x_2/A = X_1/A + x_2/A = 1/A\n", "# G_excess/(R*T) = A*x_1*x_2\n", "\n", "# For equilomar mixture,\n", "x_1 = 0.5;\t\t\t# Mole fraction of component 1\n", "x_2 = 0.5;\t\t\t# Mole fraction of component 2\n", "\n", "# Calculations and Results\n", "# Expression for A can be written as\n", "# A = 0.15 + 10/T, where T is in C. Therefore\n", "A = 0.15 + 10/(T - 273.15);\n", "# Differentiating it with respect to temprature we get\n", "dA_dT = - 10/((T-273.15)**(2));\n", "\n", "# The excess Gibbs free energy can be calculated as\n", "G_excess = A*x_1*x_2*(R*T);\t\t\t#[J/mol]\n", "\n", "# The ideal Gibbs free energy change can be calculated as\n", "delta_G_id_mix = R*T*(x_1*math.log(x_1) + x_2*math.log(x_2));\t\t\t#[J/mol]\n", "\n", "# Finally we have,\n", "delta_G_mix = G_excess + delta_G_id_mix;\t\t\t#[J/mol]\n", "\n", "print \"The Gibbs free energy change of mixing for equimolar mixture is %f J/mol\"%(delta_G_mix);\n", "\n", "\n", "# Now let us determine the excess enthalpy. We know that\n", "# H_excess/(R*T**(2)) = -[d/dT(G_excess/R*T)]_P,x = - x_1*x_2*[d/dT(A)]_P,x\n", "# Therefore at 'T' = 60 C the excess enthalpy is given by\n", "H_excess = -R*(T**(2))*x_1*x_2*dA_dT;\t\t\t#[J/mol]\n", "\n", "delta_H_id_mix = 0;\t\t\t#[J/mol] - Enthalpy change of mixing for ideal solution is zero.\n", "\n", "#Thus enthalpy change of mixing for an equimolar mixture at 333.15 K is given by\n", "delta_H_mix = delta_H_id_mix + H_excess;\t\t\t#[J/mol]\n", "\n", "\n", "print \"The enthalpy change of mixing for equimolar mixture is %f J/mol\"%(delta_H_mix);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The Gibbs free energy change of mixing for equimolar mixture is -1700.608815 J/mol\n", "The enthalpy change of mixing for equimolar mixture is 640.806876 J/mol\n" ] } ], "prompt_number": 12 } ], "metadata": {} } ] }