summaryrefslogtreecommitdiff
path: root/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.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 /Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.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 'Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb')
-rw-r--r--Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb514
1 files changed, 514 insertions, 0 deletions
diff --git a/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb
new file mode 100644
index 00000000..4b127966
--- /dev/null
+++ b/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb
@@ -0,0 +1,514 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : The Chemical Reaction Equation and Stoichiometry"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no. 228\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Balancing a reaction for a Biological Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# variables\n",
+ "# Given \n",
+ "#Main eqn. C6H12O6 + aO2 ---> bCO2 + cH2O\n",
+ "# By carbon balance\n",
+ "b = 6 ;\n",
+ "\n",
+ "#By hydrogen balance\n",
+ "c = 6;\n",
+ "\n",
+ "# calculation\n",
+ "#Balancing oxygen in reaction\n",
+ "a = (c*1+b*2-6)/2.0;\n",
+ "\n",
+ "#result\n",
+ "print 'Value of a is %i'%a\n",
+ "print 'Value of b is %i'%b\n",
+ "print 'Value of c is %i'%c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of a is 6\n",
+ "Value of b is 6\n",
+ "Value of c is 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.2 Page no. 229\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Use of Chemical Reaction to Calculate the Mass of Reactants given the Mass of Products\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_CO2 = 44.0 ; #molecular wt-[g]\n",
+ "m_C7H16 = 100.1 ; #molecular wt-[g]\n",
+ "p_con = 50. ; # percentage conversion of CO2 to dry ice\n",
+ "amt_di = 500. ; # amount of dry ice to be produce per hour-[kg]\n",
+ "\n",
+ "# Calculation\n",
+ "# By using the given equation \n",
+ "amt_C7H16 = (amt_di*m_C7H16)/((p_con/100.)*m_CO2*7) ;# [kg]\n",
+ "\n",
+ "# Result\n",
+ "print 'Amount of heptane required per hour to produce 500kg dry ice per hour is %.1f kg.'%amt_C7H16"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of heptane required per hour to produce 500kg dry ice per hour is 325.0 kg.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.3 Page no. 230\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Application of Stoichiometry when more than one Reaction occurs\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_CaCO3 = 100.1 ; #molecular wt-[g]\n",
+ "m_MgCO3 = 84.32 ; #molecular wt-[g]\n",
+ "m_CaO = 56.08 ; #molecular wt-[g]\n",
+ "m_MgO = 40.32 ; #molecular wt-[g]\n",
+ "m_CO2 = 44.0 ; #molecular wt-[g]\n",
+ "\n",
+ "# Limestone analysis\n",
+ "p_CaCO3 = 92.89 ; # percentage of CaCO3\n",
+ "p_MgCO3 = 5.41 ; # percentage of MgCO3 \n",
+ "inrt = 1.7 ; #percentage of inert\n",
+ "\n",
+ "# Calculation and Results\n",
+ "#(a)\n",
+ "amt_CaO = (((p_CaCO3/100)*m_CaO)/m_CaCO3)*2000 ; #Pounds of CaO produced from 1 ton(2000lb) of limestone\n",
+ "print ' Amount of CaO produced from 1 ton(2000lb) of limestone is %.0f lb.'%amt_CaO\n",
+ "\n",
+ "#(b)\n",
+ "mol_CaCO3 = (p_CaCO3/100)/m_CaCO3 ; # lb mol of CaCO3\n",
+ "mol_MgCO3 = (p_MgCO3/100)/m_MgCO3 ; # lb mol of MgCO3\n",
+ "total_mol = mol_CaCO3+mol_MgCO3;\n",
+ "amt_CO2 = total_mol*m_CO2 ; # Amount of CO2 recovered per pound of limestone-[lb]\n",
+ "print ' Amount of CO2 recovered per pound of limestone is %.3f lb.'%amt_CO2\n",
+ "\n",
+ "#(c)\n",
+ "amt_CaO = m_CaO*mol_CaCO3 ; # since lb mol of CaO = CaCO3\n",
+ "amt_MgO = m_MgO*mol_MgCO3 ; # since lb mol of MgO = MgCO3\n",
+ "total_lime = amt_CaO+amt_MgO+(inrt)/100 ; # total amount of lime per pound limestone\n",
+ "amt_lmst = 2000/total_lime ; # Amount of limestone required to make 1 ton(2000lb) of lime \n",
+ "print ' Amount of limestone required to make 1 ton(2000lb) of lime %.1f lb.'%amt_lmst"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Amount of CaO produced from 1 ton(2000lb) of limestone is 1041 lb.\n",
+ " Amount of CO2 recovered per pound of limestone is 0.437 lb.\n",
+ " Amount of limestone required to make 1 ton(2000lb) of lime 3550.7 lb.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.4 Page no. 235\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of extent of Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "f_NH3 = 5. ; # NH3 in feed-[g]\n",
+ "f_N2 = 100. ; # N2 in feed-[g]\n",
+ "f_H2 = 50. ; # H2 in feed-[g]\n",
+ "p_NH3 = 90. # NH3 in product-[g]\n",
+ "m_NH3 = 17. ; # Molecular wt. of NH3-[g]\n",
+ "m_N2 = 28. ; # Molecular wt. of N2-[g]\n",
+ "m_H2 = 2. ; # Molecular wt. of H2-[g]\n",
+ "\n",
+ "# Calculations \n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# For NH3\n",
+ "ni = p_NH3/m_NH3 ; #[g mol NH3]\n",
+ "nio = f_NH3/m_NH3 ; #[g mol NH3]\n",
+ "vi = 2 ; # coefficint of NH3\n",
+ "ex_r = (ni-nio)/vi # Extent of reaction - moles reacting\n",
+ "\n",
+ "#Determine H2 and N2 in product of reaction by Eqn. 9.4\n",
+ "# For N2\n",
+ "nio_N2 = f_N2/m_N2 ; #[g mol N2]\n",
+ "vi_N2 = -1 ; # coefficint of N2\n",
+ "ni_N2 = nio_N2 + vi_N2*ex_r ; #N2 in product of reaction-[g moles ]\n",
+ "m_N2 = ni_N2*m_N2 ; # mass of N2 in product of reaction-[g]\n",
+ "\n",
+ "# Results\n",
+ "print ' N2 in product of reaction is %.2f g moles '%ni_N2\n",
+ "print ' Mass of N2 in product of reaction is %.2f g '%m_N2\n",
+ "# For H2\n",
+ "nio_H2 = f_H2/m_H2 ; #[g mol H2]\n",
+ "vi_H2 = -3 ; # coefficint of H2\n",
+ "ni_H2 = nio_H2 + vi_H2*ex_r ; #H2 in product of reaction-[g moles ]\n",
+ "m_H2 = ni_H2*m_H2 ; # mass of H2 in product of reaction-[g]\n",
+ "print ' H2 in product of reaction is %.2f g moles '%ni_H2\n",
+ "print ' Mass of H2 in product of reaction is %.2f g '%m_H2\n",
+ "\n",
+ "# ARP\n",
+ "m_SO2 = 64. ; # Molecular wt.of SO2-[g]\n",
+ "mol_SO2 = 2. ; # moles of SO2\n",
+ "ARP = (1./m_NH3)/(mol_SO2/m_SO2);\n",
+ "print ' ARP is %.2f '%ARP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " N2 in product of reaction is 1.07 g moles \n",
+ " Mass of N2 in product of reaction is 30.00 g \n",
+ " H2 in product of reaction is 17.50 g moles \n",
+ " Mass of H2 in product of reaction is 35.00 g \n",
+ " ARP is 1.88 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.5 Page no. 238\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of Limiting and Excess Reactants\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "f_N2 = 10. ; # N2 in feed-[g]\n",
+ "f_H2 = 10. ; # H2 in feed-[g]\n",
+ "m_NH3 = 17.02 # Molecular wt. of NH3-[g]\n",
+ "m_N2 = 28. ; # Molecular wt. of N2-[g]\n",
+ "m_H2 = 2. ; # Molecular wt. of H2-[g]\n",
+ "\n",
+ "# Calculations\n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# Based on N2\n",
+ "nio_N2 = f_N2/m_N2 #[g mol N2]\n",
+ "vi_N2 = -1 ; # coefficint of N2\n",
+ "ex_N2 = -(nio_N2)/vi_N2 ; # Max. extent of reaction based on N2\n",
+ "\n",
+ "# Based on H2\n",
+ "nio_H2 = f_H2/m_H2 ; #[g mol H2]\n",
+ "vi_H2 = -3 ; # coefficint of H2\n",
+ "ex_H2 = -(nio_H2)/vi_H2 # Max. extent of reaction based on H2\n",
+ "\n",
+ "#(a)\n",
+ "vi_NH3 = 2 ; # coefficint of NH3\n",
+ "mx_NH3 = ex_N2*vi_NH3*m_NH3 ; # Max. amount of NH3 that can be produced\n",
+ "\n",
+ "# Results\n",
+ "print ' (a) Max. amount of NH3 that can be produced is %.1f g'%mx_NH3\n",
+ "\n",
+ "#(b) and (c)\n",
+ "if (ex_H2 > ex_N2 ):\n",
+ " print ' (b) N2 is limiting reactant '\n",
+ " print ' (c) H2 is excess reactant '\n",
+ " ex_r = ex_N2\n",
+ "else:\n",
+ " print ' (b) H2 is limiting reactant '\n",
+ " print ' (c) N2 is excess reactant '\n",
+ " ex_r = ex_H2 ;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " (a) Max. amount of NH3 that can be produced is 12.2 g\n",
+ " (b) N2 is limiting reactant \n",
+ " (c) H2 is excess reactant \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.6 Page no. 242\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Yeilds in the Reaction of Glucose to produce Ethanol\n",
+ "# Solution\n",
+ "\n",
+ "# variables\n",
+ "#(a)\n",
+ "mol_bms = 0.59 ; # Biomass produced per g mol of glucose-[g mol biomass/ g mol glucose]\n",
+ "mw_bms = 23.74 ; # molecular wt. of biomass -[g]\n",
+ "mw_gls = 180.0 ; # molecular wt. of glucose -[g]\n",
+ "\n",
+ "# calculations and Results\n",
+ "ms_bms = (mol_bms*mw_bms)/mw_gls ; # Biomass produced per gram of glucose-[g biomass/ g glucose]\n",
+ "print '(a) Biomass produced per gram of glucose is %.4f g biomass/ g glucose.'%ms_bms\n",
+ "\n",
+ "#(b)\n",
+ "mol_etol = 1.3 ; #Ethanol produced per g mol of glucose-[g mol ethanol/ g mol glucose]\n",
+ "mw_etol = 46.0 ; # molecular wt. of ethanol -[g]\n",
+ "ms_etol = (mol_etol*mw_etol)/mw_gls ; # Ethanol produced per gram of glucose-[g ethanol/ g glucose]\n",
+ "print ' (b) Ethanol produced per gram of glucose is %.3f g ethanol/ g glucose.'%ms_etol"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Biomass produced per gram of glucose is 0.0778 g biomass/ g glucose.\n",
+ " (b) Ethanol produced per gram of glucose is 0.332 g ethanol/ g glucose.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.7 Page no. 243\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Selectivity in the Production of Nanotubes\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "# By using reaction (a)\n",
+ "H2_a = 3-0.50 # H2 produced in reaction (a)\n",
+ "\n",
+ "# Calculations\n",
+ "C_a = (2./3)*H2_a ; # Nanotubes(the C) produced by reaction (a)\n",
+ "sel = C_a/0.50 ; # Selectivity of C reletive to C2H4-[g mol C/ g mol C2H4]\n",
+ "\n",
+ "# Results\n",
+ "print 'Selectivity of C reletive to C2H4 is %.2f g mol C/ g mol C2H4.'%sel"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Selectivity of C reletive to C2H4 is 3.33 g mol C/ g mol C2H4.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ " Example 9.8 Page no. 244\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Calculation of various terms Pertaning to Reaction\n",
+ "# Solution\n",
+ "\n",
+ "# Variables\n",
+ "m_C3H6 = 42.08 # molecular wt. of propene-[g]\n",
+ "m_C3H5Cl = 76.53 ; # molecular wt. of C3H5Cl-[g]\n",
+ "m_C3H6Cl2 = 112.99 ; # molecular wt. of C3H6Cl2-[g]\n",
+ "\n",
+ "# Product analysis\n",
+ "pml_Cl2 = 141.0 ; # [g mol]\n",
+ "pml_C3H6 = 651.0 ; #[g mol]\n",
+ "pml_C3H5Cl = 4.6 ; # [g mol]\n",
+ "pml_C3H6Cl2 = 24.5 ; # [g mol]\n",
+ "pml_HCL = 4.6 ; #[g mol]\n",
+ "\n",
+ "# Calculation & Results\n",
+ "#(a)\n",
+ "a_Cl = pml_C3H5Cl; # Chlorine reacted by eqn.(a)\n",
+ "b_Cl = pml_C3H6Cl2 ; # Chlorine reacted by eqn.(b)\n",
+ "fed_Cl = pml_Cl2+a_Cl+b_Cl ; # Total chlorine fed to reactor-[g mol]\n",
+ "\n",
+ "#by analysing reaction (a) and (b)\n",
+ "a_C3H6 = a_Cl+b_Cl ; # C3H6 reacted by reaction (a)\n",
+ "fed_C3H6 = pml_C3H6+a_C3H6 ; #Total C3H6 fed to reactor-[g mol]\n",
+ "\n",
+ "\n",
+ "print '(a) Total chlorine fed to reactor is %.2f g mol '%fed_Cl\n",
+ "print ' Total C3H6 fed to reactor is %.2f g mol '%fed_C3H6\n",
+ "\n",
+ "#(b) and (c)\n",
+ "# Extent of reaction can be calculated by using eqn. 9.3 \n",
+ "# Based on C3H6\n",
+ "nio_C3H6 = fed_C3H6 ; #[g mol C3H6]\n",
+ "vi_C3H6 = -1 ; # coefficint of C3H6\n",
+ "ex_C3H6 = -(nio_C3H6)/vi_C3H6 ; # Max. extent of reaction based on C3H6\n",
+ "\n",
+ "# Based on Cl2\n",
+ "nio_Cl2 = fed_Cl; #[g mol Cl2]\n",
+ "vi_Cl2 = -1 ; # coefficint of Cl2\n",
+ "ex_Cl2 = -(nio_Cl2)/vi_Cl2 ;# Max. extent of reaction based on Cl2\n",
+ "\n",
+ "if (ex_Cl2 > ex_C3H6 ):\n",
+ " print ' (b) C3H6 is limiting reactant '\n",
+ " print ' (c)Cl2 is excess reactant '\n",
+ " ex_r = ex_C3H6;\n",
+ "else:\n",
+ " print ' (b) Cl2 is limiting reactant '\n",
+ " print ' (c) C3H6 is excess reactant '\n",
+ " ex_r = ex_Cl2;\n",
+ "\n",
+ "#(d)\n",
+ "fr_cn = pml_C3H5Cl/fed_C3H6 ; #Fractional conversion of C3H6 to C3H5Cl\n",
+ "print ' (d) Fractional conversion of C3H6 to C3H5Cl is %.2e '%fr_cn\n",
+ "\n",
+ "#(e)\n",
+ "sel = pml_C3H5Cl/pml_C3H6Cl2 ; # Selectivity of C3H5Cl relative to C3H6Cl2\n",
+ "print ' (e) Selectivity of C3H5Cl relative to C3H6Cl2 is %.2f g mol C3H5Cl/g mol C3H6Cl2 '%sel\n",
+ "\n",
+ "#(f)\n",
+ "yld = (m_C3H5Cl*pml_C3H5Cl)/(m_C3H6*fed_C3H6) # Yield of C3H5Cl per g C3H6 fed to reactor\n",
+ "print ' (f) Yield of C3H5Cl per g C3H6 fed to reactor is %.3f g C3H5Cl/g C3H6 '%yld\n",
+ "\n",
+ "#(g)\n",
+ "vi_C3H5Cl = 1 ; # coefficint of C3H5Cl\n",
+ "vi_C3H6Cl2 = 1 ; # coefficint of C3H6Cl2\n",
+ "ex_a = (pml_C3H5Cl-0)/vi_C3H5Cl ; # Extent of reaction a as C3H5Cl is produced only in reaction a\n",
+ "ex_b = (pml_C3H6Cl2-0)/vi_C3H6Cl2 ; # Extent of reaction b as C3H6Cl2 is produced only in reaction b\n",
+ "print ' (g) Extent of reaction a as C3H5Cl is produced only in reaction a is %.1f '%ex_a\n",
+ "print ' Extent of reaction b as C3H6Cl2 is produced only in reaction b %.1f '%ex_b\n",
+ "\n",
+ "#(h)\n",
+ "in_Cl = fed_Cl*2 ; #Entering Cl -[g mol]\n",
+ "out_Cl = pml_HCL ; # Exiting Cl in HCl-[g mol]\n",
+ "ef_w = out_Cl/in_Cl ; # Mole efficiency of waste\n",
+ "ef_pr = 1-ef_w ; # Mole efficiency of product\n",
+ "print ' (h) Mole efficiency of product is %.3f '%ef_pr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total chlorine fed to reactor is 170.10 g mol \n",
+ " Total C3H6 fed to reactor is 680.10 g mol \n",
+ " (b) Cl2 is limiting reactant \n",
+ " (c) C3H6 is excess reactant \n",
+ " (d) Fractional conversion of C3H6 to C3H5Cl is 6.76e-03 \n",
+ " (e) Selectivity of C3H5Cl relative to C3H6Cl2 is 0.19 g mol C3H5Cl/g mol C3H6Cl2 \n",
+ " (f) Yield of C3H5Cl per g C3H6 fed to reactor is 0.012 g C3H5Cl/g C3H6 \n",
+ " (g) Extent of reaction a as C3H5Cl is produced only in reaction a is 4.6 \n",
+ " Extent of reaction b as C3H6Cl2 is produced only in reaction b 24.5 \n",
+ " (h) Mole efficiency of product is 0.986 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file