summaryrefslogtreecommitdiff
path: root/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch9.ipynb
blob: 53f8e501fe3a039b9a5e11ebcf9eb938d1b3c77b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
{
 "metadata": {
  "name": "",
  "signature": "sha256:fa0721f1d96e3929565a094cfe21c7d86b4e801aa71b0940b32ef9174b4285dc"
 },
 "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": [
      "\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": [
      "\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": [
      "\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": [
      "\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": [
      "\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": [
      "\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": [
      "\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": [
      "\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": {}
  }
 ]
}