summaryrefslogtreecommitdiff
path: root/Chemical_Engineering_Thermodynamics___by_S._Sundaram/ch1_1.ipynb
blob: 04e7e8daa8e7366bca68b68f221b70b5f83a58a5 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:13cb37b7bedc939f2932970f808cc63def43a3ee0a76b1e4d1958377aebef52c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 : Introduction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1  Page No : 8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given \n",
      "m = 100 #m is the mass of the object in kg\n",
      "a = 10 #a is the acceeleration due to gravity in m/s**2\n",
      "\n",
      "#To determine the force exerted\n",
      "F = m*a #F is the force exerted by the object in kg\n",
      "print \"Force exerted by the object= \",\n",
      "print \"%.6f\" %F,\n",
      "print \"N\"\n",
      "F = (1/9.8065)*m*a;#F is the force exerted by the object in kgf\n",
      "print \"Force exerted by the object= \",\n",
      "print \"%.6f\" %F,\n",
      "print \"N\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force exerted by the object=  1000.000000 N\n",
        "Force exerted by the object=  101.973181 N\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4  Page No : 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given\n",
      "h = 100 #h is the height of the water fall in m\n",
      "n = .855 #n is the efficiency of the turbine\n",
      "g = 9.8 #g is the acceleration due to gravity in m/(s**2)\n",
      "E = 100*10*3600;#E is the potential enery of water available to the bulb for 10 hours in watt or J/s\n",
      "\n",
      "#To determine the mass of water required\n",
      "m = (E/(g*h*n)) #m is the mass of water required for lighting the bulb for 10 hours in Kg\n",
      "print \"Mass of water required for lighting the bulb for 10 hours in Kg= \",\n",
      "print \"%.6f\"%m,\n",
      "print \"Kg\"\n",
      "print \"Mass of water required for lighting the bulb for 10 hours in tonnes= \",\n",
      "print \"%.6f\"%(m/907.2),\n",
      "print \"Kg\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of water required for lighting the bulb for 10 hours in Kg=  4296.455424 Kg\n",
        "Mass of water required for lighting the bulb for 10 hours in tonnes=  4.735952 Kg\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5  Page No : 17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "n = 1. #n is the Kg mole of an ideal gas\n",
      "P = 700.*(10**4) #P is the pressure of the system in N/(m**2)\n",
      "W = 45. #W is the weight of the mass in Kg\n",
      "M = 20. #M is the weight of the piston and piston rod together in Kg\n",
      "T = 300. #T is the consmath.tant temperature of the bath in K\n",
      "h = .4 #h is the height difference of the piston after expansion in m\n",
      "\n",
      "#To calculate the work obtained\n",
      "a = (10**-4) #a is the cross sectional area of the cylinder in m**2\n",
      "V = h*a #V is the volume changed as gas expands in m**3\n",
      "\n",
      "#(i). If gas alone is the system\n",
      "#1Kgf = 9.8065Nm\n",
      "P1 = ((W+M)*9.8065)/(10**-4) #P1 is the resisting pressure when the gas confined in the cylinder taken as a system\n",
      "W1 = P1*V #W1 is the work done if the gas confined in the cylinder us taken as system\n",
      "print \"Work done by the system if the gas confined in the cylinder is taken as a system is \",\n",
      "print \"%.6f \"%W1,\n",
      "print \"Nm\"\n",
      "\n",
      "#(ii). If gas + piston + piston rod is a system\n",
      "P2 = ((W*9.8065)/(10**-4)) #P2 is the resisting pressure when the gas plus piston plus piston rod is taken as a system\n",
      "W2 = P2*V #W2 is the Work done by the system if the gas plus piston plus piston rod is taken as a system\n",
      "print \"Work done by the system if the gas plus piston plus piston rod is taken as system is \",\n",
      "print \"%.6f\"%W2,\n",
      "print \"Nm\"\n",
      "\n",
      "#(iii). If gas + piston + piston rod +weight is system\n",
      "P3 = 0 #P3 is the resisting pressure when the gas plus piston plus piston rod plus weight is taken as a system\n",
      "W3 = P3*V #W3 is the work done by the system if the gas plus piston plus piston rod plus weight is taken as a system\n",
      "print \"Work done by the system if the gas plus piston plus piston rod plus weight is taken as a system is \",\n",
      "print \"%.4f\"%W3,\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work done by the system if the gas confined in the cylinder is taken as a system is  254.969000  Nm\n",
        "Work done by the system if the gas plus piston plus piston rod is taken as system is  176.517000 Nm\n",
        "Work done by the system if the gas plus piston plus piston rod plus weight is taken as a system is  0.0000\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.6  Page No : 19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "n = 1 #n is the Kg mole of ideal gas.\n",
      "P1 = 700*(10**4) #P1 is the initial pressure of the system in N/(m**2)\n",
      "P2 = 638*(10**4) #P2 is the final pressure of the system in N/(m**2)\n",
      "T = 300 #T is temperature of the system in K\n",
      "R = 8314.4 #R is gas consmath.tant in Nm/Kgmole deg K\n",
      "\n",
      "#To calculate the work done\n",
      "W = n*R*T*math.log(P1/float(P2)) #W is the work done by the system in Nm\n",
      "print \"Work done by the system is \",\n",
      "print \"%.2e\"%W,\n",
      "print \"Nm\"\n",
      "#end"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work done by the system is  2.31e+05 Nm\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}