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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 12:Measurement of Non-Electrical Quantities"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12.1,Page No:600"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"Gf = 2; #guage factor \n",
"a = 100*10**6; #stress in N/m**2\n",
"E = 200*10**9; #elasticity of steel in N/m**2\n",
"\n",
"#calculation\n",
"st = (a/float(E)); #strain\n",
"x = Gf*st; # change in guage resistance\n",
"p = (x)*100; #percentage change in resistance in %\n",
"\n",
"#result\n",
"print\"percentage change in resistance %1.1f\"%p,\"%\";\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12.4,Page No:631"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"water flow rate 0.0586 m**3/s\n"
]
}
],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"D1 = 200*10**-3; # inlet horizontal venturimeter in m\n",
"D2 = 100*10**-3; #throat horizontal enturimeter in m\n",
"h = 220*10**-3; #pressure in m\n",
"Cd = 0.98; #coefficient of discharge \n",
"phg = 13.6; #specific gravity of mercury\n",
"p = 1000; #density of water in kg/m**3\n",
"g = 9.81; #gravitational constant\n",
"pw = 1; #density of water in kg/m**3\n",
"w = 9.81; \n",
"\n",
"\n",
"\n",
"#calculation\n",
"x = (g)*(h)*(phg-pw)*1000; #differential pressure head in N/m**2\n",
"a = 1-((D2/float(D1))**4); #velocity approach factor\n",
"M = 1/(float(math.sqrt(a))); #velocity of approach\n",
"b = math.sqrt(((2*g)/(float(w*p)))*x);\n",
"A2 = (math.pi/float(4))*((D2)**2); #area in m**2\n",
"Q = Cd*M*A2*(b); #discharge through venturimeter in m**3/s\n",
" \n",
"#result\n",
"print'water flow rate %3.4f'%Q,'m**3/s'; \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12.5,Page No:631"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"rate of flow of oil 0.137850 m**3/s\n"
]
}
],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"D1 = 400*10**-3; #diameter at inlet in m\n",
"D2 = 200*10**-3; #diameter at throat in m\n",
"y = 50*10**-3; #reading of differential manometer in m\n",
"Shl = 13.6; #specific gravity of mercury in U-tube \n",
"Sp = 0.7; #specific gravity of oil in U-tube \n",
"h = 0.92;\n",
"\n",
"#bernoulli's equation\n",
"#p1/w +z1+V1**2=p2/w +z2+V2**2\n",
"#solving we get h+(V1**2/2*g)-(V2**2/2*g)=0\n",
"# calculations\n",
"\n",
"A1 = (math.pi/float(4))*(D1**2); #area in m**2\n",
"A2 = (math.pi/4)*(D2**2); #area in m**2\n",
"a = A2/float(A1); #ratio of areas\n",
"#V1 = a*V2;\n",
"#h+(V1**2/2*g)*(1-(1/4))=0\n",
"V2 = math.sqrt((2*g*h)/(float(1-((a)**2)))); \n",
"Q = A2*V2; #rate of oil flow in m**3/s\n",
"\n",
"#result\n",
"print'rate of flow of oil %f'%Q,'m**3/s';\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12.6,Page No:633"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"difference in pressure head 4952.073 N/m**2\n"
]
}
],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"Q = 0.015; #rate of flow in m**3/s\n",
"D0 = 100*10**-3; #diameter orifice in m\n",
"D1 = 200*10**-3; #diameter of pipe in m\n",
"Cc = 0.6; #coefficient of contraction\n",
"Cd = 0.6; #coefficient of discharge\n",
"E = 1; #thermal expansion factor\n",
"g = 9.81; #gravitational constant \n",
"w = 9810;\n",
"\n",
"#calculations\n",
"A0 = ((math.pi)/float(4))*(D0**2); #area in m**2\n",
"A1 = ((math.pi)/float(4))*(D1**2); #area in m**2\n",
"a = (Cc*A0)/(float(A1)); \n",
"M = math.sqrt(1-((a)**2));\n",
"K = Cd/float(M);\n",
"x = ((Q/float(K*E*A0))**2);\n",
"dp = (x*w/float(2*g)); #difference in pressure head in N/m**2\n",
"\n",
"#result\n",
"print'difference in pressure head %3.3f'%dp,'N/m**2';\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example:12.7,Page No:633"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"discharge through the orifice 0.742 m**3/s\n"
]
}
],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"C0 = 0.6; #coefficient of orifice\n",
"Cv = 0.97; #coefficient of discharge\n",
"Qv = 1.2; #flow rate in m**3/s\n",
"\n",
"#calculations\n",
"Q0 = (C0/Cv)*Qv; #discharge through the orifice in m**3/s\n",
"\n",
"#result\n",
"print'discharge through the orifice %3.3f'%Q0,'m**3/s'\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example:12.8,Page No:634"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"velocity of submarine 25.0 km/h\n"
]
}
],
"source": [
"import math\n",
"\n",
"#variable declaration\n",
"Shl = 13.6; #specific gravity of mercury\n",
"Sl = 1.025; #specific gravity of sea water\n",
"y = 200*10**-3; #reading in m\n",
"g = 9.81; #constant\n",
"\n",
"#calculation\n",
"x = Shl/float(Sl);\n",
"h = (y*((x)-1)); #head\n",
"V = math.sqrt(2*g*h); #velocity of submarine in km/h\n",
"\n",
"#result\n",
"print'velocity of submarine %3.1f'%(V*(18/float(5))),'km/h';"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|