summaryrefslogtreecommitdiff
path: root/Elementary_Principles_of_Chemical_Processes/Chapter11.ipynb
blob: bec154764e7ad922c13d184bc39d78c52cb2c4db (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:9a8a7685dfe3ac94231d04568a5fa2ca80f262b83285bc314eef1bc912a7ecc6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11: Balances on Transient Processes"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.1-2, page no. 547"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#Initialization of variables\n",
      "import math\n",
      "import numpy\n",
      "from numpy import linalg\n",
      "import scipy\n",
      "from scipy import integrate\n",
      "v0=math.pow(10.,9)\n",
      "\n",
      "#Calculations and printing :\n",
      "\n",
      "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n",
      "def dv(t):\n",
      "    dv=math.pow(10,6)*math.exp(-t/100) -math.pow(10,7)\n",
      "    return dv\n",
      "\n",
      "vol, err=scipy.integrate.quad(dv,0,60) #integrate.quad is an inbult function used for definite integration\n",
      "print '%s %.3E' %(\" \\n Volume at the end of 60 days=\",vol+v0)\n",
      "raw_input('press enter key to exit')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n",
        " \n",
        " Volume at the end of 60 days= 4.451E+08\n"
       ]
      },
      {
       "name": "stdout",
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "press enter key to exit\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 1,
       "text": [
        "''"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.3-1, page no. 556"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#Initialization of variables\n",
      "import math\n",
      "import numpy\n",
      "from numpy import linalg\n",
      "\n",
      "m1=1.50 #kg\n",
      "m2=3.0 #kg\n",
      "Cv1=0.9 #cal/g C\n",
      "Cv2=0.12 #cal/g C\n",
      "Qdot=500.0 #W\n",
      "T1=250.0 #C\n",
      "T2=25.0 #C\n",
      "\n",
      "#Calculations and printing :\n",
      "\n",
      "print(\" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\")\n",
      "MCv=(m1*Cv1 + m2*Cv2)*1000*4.184\n",
      "print(MCv)\n",
      "tf=(T1-T2)*MCv/Qdot\n",
      "print '%s %d %s %.3f' %(\" \\n Time required\",tf+1,\" in sec and in min =\",tf/60)\n",
      "raw_input('press enter key to exit')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " All the values in the textbook are Approximated hence the values in this code differ from those of Textbook\n",
        "7154.64\n",
        " \n",
        " Time required 3220  in sec and in min = 53.660\n"
       ]
      },
      {
       "name": "stdout",
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "press enter key to exit\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 2,
       "text": [
        "''"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}