summaryrefslogtreecommitdiff
path: root/Chemical_Reaction_Engineering/ch7.ipynb
diff options
context:
space:
mode:
authorhardythe12014-08-06 16:41:00 +0530
committerhardythe12014-08-06 16:41:00 +0530
commitd883118364a7a13fa6e139a7dab6fc9a34980a8a (patch)
tree41afec8408863e1ae835c7adb17e8a4a5b88642d /Chemical_Reaction_Engineering/ch7.ipynb
parent73b0bffc1781c6cf1eec459813767508da507c33 (diff)
downloadPython-Textbook-Companions-d883118364a7a13fa6e139a7dab6fc9a34980a8a.tar.gz
Python-Textbook-Companions-d883118364a7a13fa6e139a7dab6fc9a34980a8a.tar.bz2
Python-Textbook-Companions-d883118364a7a13fa6e139a7dab6fc9a34980a8a.zip
adding books
Diffstat (limited to 'Chemical_Reaction_Engineering/ch7.ipynb')
-rwxr-xr-xChemical_Reaction_Engineering/ch7.ipynb233
1 files changed, 233 insertions, 0 deletions
diff --git a/Chemical_Reaction_Engineering/ch7.ipynb b/Chemical_Reaction_Engineering/ch7.ipynb
new file mode 100755
index 00000000..6785eea5
--- /dev/null
+++ b/Chemical_Reaction_Engineering/ch7.ipynb
@@ -0,0 +1,233 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : Design for Parallel Reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2 page no : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "#Initial Concentration(mol/litre)eactant in combined feed\n",
+ "CAo = 10.\n",
+ "CBo = 10. \n",
+ "XA = 0.9; # conversion\n",
+ "CAf = CAo*(1-XA);\n",
+ "CA = CAf;\n",
+ "\n",
+ "# Calculations\n",
+ "def f4(CA): \n",
+ "\t return 1./(1+CA**0.5)\n",
+ "\n",
+ "Qp = (-1./(CAo-CAf))* quad(f4,CAo,CAf)[0]\n",
+ "\n",
+ "CRf = 9*Qp;\n",
+ "CSf = 9*(1-Qp)\n",
+ "# Results\n",
+ "print \" Part a\"\n",
+ "print \" For Plug Flow\"\n",
+ "print \" Concentration of R in the product stream is %.2f mol/litre\"%(CRf)\n",
+ "print \" Csf is %.2f mol/litre\"%(CSf)\n",
+ "\n",
+ "Qm = CA/(CA+CA**1.5);\n",
+ "CRf = 9*Qm;\n",
+ "Csf = 9*(1-Qm)\n",
+ "print \" Part b\"\n",
+ "print \" For Mixed Flow\"\n",
+ "print \" Concentration of R in the product stream is %.2f mol/litre \"%(CRf)\n",
+ "print \" Csf is %.2f mol/litre\"%(Csf)\n",
+ "\n",
+ "CAo = 19.\n",
+ "CB = 1;\n",
+ "\n",
+ "def f5(CA): \n",
+ "\t return CA/(CA+CB**1.5)\n",
+ "\n",
+ "Q = -1./(CAo-CAf)* quad(f5,CAo,CAf)[0]\n",
+ "CRf = 9*Q;\n",
+ "Csf = 9*(1-Q)\n",
+ "print \" Part c\"\n",
+ "print \" For Plug flow A Mixed flow B\"\n",
+ "print \" Concentration of R in the product stream is %.2f mol/litre\"%(CRf)\n",
+ "print \" Csf is %.2f mol/litre\"%(Csf)\n",
+ "print ('The result for plug flow varies as there seems to be typographical error in integration done in book')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Part a\n",
+ " For Plug Flow\n",
+ " Concentration of R in the product stream is 2.86 mol/litre\n",
+ " Csf is 6.14 mol/litre\n",
+ " Part b\n",
+ " For Mixed Flow\n",
+ " Concentration of R in the product stream is 4.50 mol/litre \n",
+ " Csf is 4.50 mol/litre\n",
+ " Part c\n",
+ " For Plug flow A Mixed flow B\n",
+ " Concentration of R in the product stream is 7.85 mol/litre\n",
+ " Csf is 1.15 mol/litre\n",
+ "The result for plug flow varies as there seems to be typographical error in integration done in book\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3 page no : 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "CAo = 2; # decomposition of A\n",
+ "CA = 0.5;\n",
+ "CAf = 0.;\n",
+ "\n",
+ "Csf = (CAo-CA)*2*CA/(1+CA)**2;\n",
+ "\n",
+ "print \" Part a\"\n",
+ "print \" For Mixed Flow Reactor\"\n",
+ "print \" Maximum expected Cs is %.3f\"%(Csf)\n",
+ "\n",
+ "# Calculations\n",
+ "def f12(CA): \n",
+ "\t return 2*CA/(1+CA)**2\n",
+ "\n",
+ "Csf = -1* quad(f12,CAo,CAf)[0]\n",
+ "\n",
+ "# Results\n",
+ "print \" Part b\"\n",
+ "print \" For Plug Flow\"\n",
+ "print \" Maximum expected concentration of S is %.3f \"%(Csf)\n",
+ "\n",
+ "CA = 1.;\n",
+ "Csf = (CAo-CA)*2*CA/(1+CA)**2;\n",
+ "\n",
+ "print \"Part c\"\n",
+ "print \" For MFR with separation and recycle\" \n",
+ "print \" Concentration of Csf is %.2f\"%(Csf)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Part a\n",
+ " For Mixed Flow Reactor\n",
+ " Maximum expected Cs is 0.667\n",
+ " Part b\n",
+ " For Plug Flow\n",
+ " Maximum expected concentration of S is 0.864 \n",
+ "Part c\n",
+ " For MFR with separation and recycle\n",
+ " Concentration of Csf is 0.50\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4 page no : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "from scipy.integrate import quad \n",
+ "\n",
+ "# Variables\n",
+ "CAo = 2. # based on example 7.3\n",
+ "CA = 1.\n",
+ "Q = 0.5\n",
+ "\n",
+ "# Calculations\n",
+ "Cs1 = Q*(CAo-CA);\n",
+ "\n",
+ "def f6(CA): \n",
+ "\t return 2*CA/(1+CA)**2\n",
+ "\n",
+ "Cs2 = -1* quad(f6,1,0)[0]\n",
+ "\n",
+ "#Total amount of CS formed is\n",
+ "Cs = Cs1+Cs2;\n",
+ "\n",
+ "# Results\n",
+ "print \"Mixed flow followed by plug flow would be best\"\n",
+ "print \" Total amount of CS formed is %.3f mol/litre\"%(Cs)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mixed flow followed by plug flow would be best\n",
+ " Total amount of CS formed is 0.886 mol/litre\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file