summaryrefslogtreecommitdiff
path: root/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
diff options
context:
space:
mode:
authorJovina Dsouza2014-06-18 12:43:07 +0530
committerJovina Dsouza2014-06-18 12:43:07 +0530
commit206d0358703aa05d5d7315900fe1d054c2817ddc (patch)
treef2403e29f3aded0caf7a2434ea50dd507f6545e2 /Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
parentc6f0d6aeb95beaf41e4b679e78bb42c4ffe45a40 (diff)
downloadPython-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.gz
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.bz2
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.zip
adding book
Diffstat (limited to 'Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb')
-rw-r--r--Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb319
1 files changed, 319 insertions, 0 deletions
diff --git a/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
new file mode 100644
index 00000000..3eab43ea
--- /dev/null
+++ b/Physical_And_Chemical_Equilibrium_For_Chemical_Engineers/ch15.ipynb
@@ -0,0 +1,319 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : The Phase Rule"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.2 Page: 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculate independent relations among these four species\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "\n",
+ "# The system contains four species\n",
+ "print \" In this system there are four identifiable chemical species%(which are C,O2,CO2 and CO. The balanced equations we can write among them are\"\n",
+ "\n",
+ "print \" C + 0.5O2 = CO\"\n",
+ "print \" C + O2 = CO2\"\n",
+ "print \" CO + 0.5O2 = CO2\"\n",
+ "print \" CO2 + C = 2CO\"\n",
+ "\n",
+ "# Let we call these equations A, B, C and D respectively\n",
+ "# These relations are not independent.\n",
+ "# If we add A and C and cancel like terms, we obtain B.\n",
+ "# So, If we want independent chemical equilibria we must remove equation C\n",
+ "\n",
+ "# Now, if we reverse the direction of B and add it to A, we see that D is also not independent.\n",
+ "# Thus, there are only two independent relations among these four species and \n",
+ "print \" There are only two independent relations among these four species and\"\n",
+ "\n",
+ "# V = C + 2 - P\n",
+ "# and we have\n",
+ "V = 2# No of the variable\n",
+ "P = 2# No of the phases\n",
+ "# So\n",
+ "C = V + P - 2\n",
+ "print \" C = V + P - 2\"\n",
+ "print \" C = 4 - 2 = 2\"\n",
+ "print \" Thus, this is a two-component system\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " In this system there are four identifiable chemical species%(which are C,O2,CO2 and CO. The balanced equations we can write among them are\n",
+ " C + 0.5O2 = CO\n",
+ " C + O2 = CO2\n",
+ " CO + 0.5O2 = CO2\n",
+ " CO2 + C = 2CO\n",
+ " There are only two independent relations among these four species and\n",
+ " C = V + P - 2\n",
+ " C = 4 - 2 = 2\n",
+ " Thus, this is a two-component system\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.3 Page: 402\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Define Phase rule\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# This contains three species.\n",
+ "print \" The three species in this system are H2 N2 and NH3\"\n",
+ "N = 3\n",
+ "print \" There is only one balanced chemical reaction among these species\"\n",
+ "Q = 1\n",
+ "\n",
+ "# 2NH3 = N2 + 3H2\n",
+ "C = N - Q\n",
+ "print \" C = N - Q = %0.0f\"%(C)\n",
+ "# Now let us we made the system by starting with pure ammonia.\n",
+ "# Assuming that all the species are in the gas phase, ammonia dissociates in H2 and N2 in the ratio of 3:1.\n",
+ "print \" Let we start with pure ammonia in the system then ammonia will dissociate in H2 and N2 in the ratio of 3:1.\"\n",
+ "\n",
+ "# We can write an equation among their mole fractions, viz\n",
+ "# y_H2 = 3*y_N2\n",
+ "print \" And the relation between their mole fraction is y_H2 = 3*y_N2\"\n",
+ "\n",
+ "# We might modify the phase rule to put in another symbol for stoichiometric restrictions, but the common usage is to write that \n",
+ "# Components = species - (independent reactions) - (stoichiometric restriction)\n",
+ "# and stoichiometric restriction SR is \n",
+ "SR = 1\n",
+ "# so\n",
+ "c = N-Q-SR\n",
+ "print \" We have the modified phase rule as Components = species - independent reactions - stoichiometric restriction\"\n",
+ "print \" C = N - Q - SR = %0.0f\"%(c)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The three species in this system are H2 N2 and NH3\n",
+ " There is only one balanced chemical reaction among these species\n",
+ " C = N - Q = 2\n",
+ " Let we start with pure ammonia in the system then ammonia will dissociate in H2 and N2 in the ratio of 3:1.\n",
+ " And the relation between their mole fraction is y_H2 = 3*y_N2\n",
+ " We have the modified phase rule as Components = species - independent reactions - stoichiometric restriction\n",
+ " C = N - Q - SR = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.4 Page: 403\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Find number of the components present in the test tube\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# We have been given the reaction \n",
+ "# CaCO3(s) = CaO(s) + CO2(g)\n",
+ "\n",
+ "# Here we have three species and one balanced chemical reaction between them\n",
+ "# So\n",
+ "N = 3# No of species\n",
+ "Q = 1 # no of reaction\n",
+ "\n",
+ "# Since CO2 will mostly be in the gas phase and CaCO3 and CaO will each form separate solid phases, \n",
+ "# there is no equation we can write among the mole fractions in any of the phases.\n",
+ "# Hence, there is no stoichiometric restriction i.e.\n",
+ "SR = 0\n",
+ "# and the number of the components is\n",
+ "C = N - Q - SR\n",
+ "\n",
+ "print \"Number of the components presents in the test tube are %0.0f\"%(C)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of the components presents in the test tube are 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.5 Page: 403\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "find\n",
+ "(a) How many phases are present?\n",
+ "(b) How many degrees of freedom are there?\n",
+ "(c) If we place a sample of pure CaCO 3 in an evacuated container and heat it, will we find a unique P-T curve?\n",
+ "'''\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# We have been given the reaction \n",
+ "# CaCO3(s) = CaO(s) + CO2(g)\n",
+ "# The CaCO3 and CaO form separate solid phases, so we have three phases, two solid and one gas. \n",
+ "# So\n",
+ "P = 3\n",
+ "# This is a two component system, so\n",
+ "C = 2\n",
+ "\n",
+ "# From the phase rule\n",
+ "V = C + 2 - P\n",
+ "\n",
+ "# If there is only one degree of freedom, then the system should have a unique P-T curve.\n",
+ "# Reference [ 2, page 214 ] as reported in the book, shows the data to draw such a curve, which can be well represented by\n",
+ "# math.log(p/torr) = 23.6193 - 19827/T\n",
+ "\n",
+ "print \" The no. of phases present in the system are %0.0f \"%(P)\n",
+ "print \" Total no of degrees of freedom is %0.0f \"%(V)\n",
+ "print \" Since there is only one degree of freedom so the system has a unique P-T curve\"\n",
+ "print \" which can be well represented by logp/torr = 23.6193 - 19827/T\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The no. of phases present in the system are 3 \n",
+ " Total no of degrees of freedom is 1 \n",
+ " Since there is only one degree of freedom so the system has a unique P-T curve\n",
+ " which can be well represented by logp/torr = 23.6193 - 19827/T\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 15.6 Page: 404\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# find number of components\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "#***Data***#\n",
+ "# The system consists of five species.\n",
+ "print \" The five species present in the system are H2O%( HCl%( H+%( OH- and Cl-. \"\n",
+ "# So\n",
+ "N = 5 # Number of the species \n",
+ "print \" Here we have two chemical relations:\"\n",
+ "print \" H2O = H+ + OH- \"\n",
+ "print \" HCl = H+ + Cl- \"\n",
+ "\n",
+ "# so\n",
+ "Q = 2 # No of the reactions\n",
+ "\n",
+ "# In addition we have electroneutrality, which says that at equilibrium the total no of positive ions in the solution must be the same as the total no of nagative ions,or\n",
+ "# [H+] = [OH-] + [Cl-]\n",
+ "# To maintain electroneutrality number of positive and negative ion should be same.\n",
+ "# Here [H+] smath.radians(numpy.arcmath.tan(s for the molality of hydrogen ion. This is convertible to a relation among the 'mu's' hence,\n",
+ "# it is an additional restriction, so\n",
+ "SR = 1 \n",
+ "# So\n",
+ "# The number of components is\n",
+ "C = N - Q - SR\n",
+ "\n",
+ "print \" Number of the components present in the system are C = N - Q - SR = %0.0f\"%(C)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The five species present in the system are H2O%( HCl%( H+%( OH- and Cl-. \n",
+ " Here we have two chemical relations:\n",
+ " H2O = H+ + OH- \n",
+ " HCl = H+ + Cl- \n",
+ " Number of the components present in the system are C = N - Q - SR = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file