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
|
{
"metadata": {
"name": "",
"signature": "sha256:4ffa24abd34ea1d807c13e9c49ee68a5b2044c03e6300e8fc08c3e8ef3625eac"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter2-Water and its Treatment"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_1-pg no 23"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.1##\n",
"import math\n",
"W1=12.5;##CaCO3 in water in mg/lit##\n",
"W2=8.4;##MgCO3 in water in mg/lit##\n",
"W3=22.2;##CaCl2 in water in mg/lit##\n",
"W4=9.5;##MgCl2 in water in mg/lit##\n",
"W5=33.;##CO2 in water in mg/lit##\n",
"W6=6.68;##NaHCO3 in water in mg/lit##\n",
"M1=100./100.;##multiplication factor of CaCO3##\n",
"M2=100./84.;##multiplication factor of MgCO3##\n",
"M3=100./111.;##multiplication factor of CaCl2##\n",
"M4=100./95.;##multiplication factor of MgCl2##\n",
"M6=100./84.;##multiplication factor of NaHCO3##\n",
"P1=W1*M1;##CaCO3 in terms of CaCO3##\n",
"P2=W2*M2;##MgCO3 in terms of CaCO3##\n",
"P3=W3*M3;##CaCl2 in terms of CaCO3##\n",
"P4=W4*M4;##MgCl2 in terms of CaCO3##\n",
"P6=W6*M6;##NaHCO3 in terms of CaCO3##\n",
"print (\"We do not take CO2 since it does not contribute to hardness \");\n",
"C=P1+P2+P6;\n",
"print'%s %.2f %s'%(\"\\nCarbonate hardness is \",C,\" mg/l or ppm\");\n",
"NC=P3+P4;\n",
"print'%s %.2f %s'%(\"\\nNon Carbonate hardness is \",NC,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"We do not take CO2 since it does not contribute to hardness \n",
"\n",
"Carbonate hardness is 30.45 mg/l or ppm\n",
"\n",
"Non Carbonate hardness is 30.00 mg/l or ppm\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_2-pg no 26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.2##\n",
"import math\n",
"W1=40.5;##Ca(HCO3)2 in water in mg/lit##\n",
"W2=33.3;##CaCl2 in water in mg/lit##\n",
"W3=41.;##Ca(NO3)2 in water in mg/lit##\n",
"W4=101.;##KNO3 in water in mg/lit##\n",
"W5=33.6;##MgCO3 in water in mg/lit##\n",
"M1=100./162.;##multiplication factor of Ca(HCO3)2##\n",
"M2=100./111.;##multiplication factor of CaCl2##\n",
"M3=100./164.;##multiplication factor of Ca(NO3)2##\n",
"M5=100./84.;##multiplication factor of MgCO3##\n",
"P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##\n",
"P2=W2*M2;##CaCl2 in terms of CaCO3##\n",
"P3=W3*M3;##Ca(NO3)2 in terms of CaCO3##\n",
"P5=W5*M5;##MgCO3 in terms of CaCO3##\n",
"print (\"We do not take KNO3 since it does not contribute to hardness \");\n",
"C=P1+P5;\n",
"print'%s %.2f %s'%(\"\\nCarbonate hardness is \",C,\" mg/l or ppm\");\n",
"NC=P2+P3;\n",
"print'%s %.2f %s'%(\"\\nNon Carbonate hardness is \",NC,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"We do not take KNO3 since it does not contribute to hardness \n",
"\n",
"Carbonate hardness is 65.00 mg/l or ppm\n",
"\n",
"Non Carbonate hardness is 55.00 mg/l or ppm\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_3-pg no 27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.3##\n",
"import math\n",
"W1=29.1;##Mg(HCO3)2 in water in mg/lit##\n",
"W2=40.5;##Ca(HCO3)2 in water in mg/lit##\n",
"W3=11.1;##CaCl2 in water in mg/lit##\n",
"W4=15.82;##MgCl2 in water in mg/lit##\n",
"W5=28.5;##NaCl in water in mg/lit##\n",
"W6=22.0;##CO2 in water in mg/lit##\n",
"M1=100./146.007;##multiplication factor of Mg(HCO3)2##\n",
"M2=100./162.;##multiplication factor of Ca(HCO3)2##\n",
"M3=100./111.;##multiplication factor of CaCl2##\n",
"M4=100./95.005;##multiplication factor of MgCl2##\n",
"P1=W1*M1;##Mg(HCO3)2 in terms of CaCO3##\n",
"P2=W2*M2;##Ca(HCO3)2 in terms of CaCO3##\n",
"P3=W3*M3;##CaCl2 in terms of CaCO3##\n",
"P4=W4*M4;##MgCl2 in terms of CaCO3##\n",
"print(\"We do not take NaCl and CO2 since they do not contribute to hardness \");\n",
"C=P1+P2;\n",
"print'%s %.2f %s'%(\"\\nCarbonate hardness is \",C,\" mg/l or ppm\");\n",
"NC=P3+P4;\n",
"print'%s %.2f %s'%(\"\\nNon Carbonate hardness is \",NC,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"We do not take NaCl and CO2 since they do not contribute to hardness \n",
"\n",
"Carbonate hardness is 44.93 mg/l or ppm\n",
"\n",
"Non Carbonate hardness is 26.65 mg/l or ppm\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_4-pg no 28"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.4##\n",
"import math\n",
"W1=16.2;##Ca(HCO3)2 in water in mg/lit##\n",
"W2=14.6;##Mg(HCO3)2 in water in mg/lit##\n",
"W3=9.5;##MgCl2 in water in mg/lit##\n",
"W4=48.;##MgSO4 in water in mg/lit##\n",
"W5=12.;##KCl in water in mg/lit##\n",
"M1=100./162.;##multiplication factor of Ca(HCO3)2##\n",
"M2=100./146.;##multiplication factor of Mg(HCO3)2 ##\n",
"M3=100./95.;##multiplication factor of MgCl2##\n",
"M4=100./120.;##multiplication factor of MgSO4##\n",
"P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##\n",
"P2=W2*M2;##Mg(HCO3)2 in terms of CaCO3##\n",
"P3=W3*M3;##MgCl2 in terms of CaCO3##\n",
"P4=W4*M4;##MgSO4 in terms of CaCO3##\n",
"print (\"We do not take KCl since it does not contribute to hardness \");\n",
"C=P1+P2;\n",
"print'%s %.2f %s'%(\"\\nCarbonate hardness is \",C,\" mg/l or ppm\");\n",
"NC=P3+P4;\n",
"print'%s %.2f %s'%(\"\\nNon Carbonate hardness is \",NC,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"We do not take KCl since it does not contribute to hardness \n",
"\n",
"Carbonate hardness is 20.00 mg/l or ppm\n",
"\n",
"Non Carbonate hardness is 50.00 mg/l or ppm\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_5-pg no30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.5##\n",
"import math\n",
"W1=81;##Ca(HCO3)2 in water in mg/lit##\n",
"W2=84;##MgCO3 in water in mg/lit##\n",
"W3=22.2;##CaCl2 in water in mg/lit##\n",
"W4=60;##MgSO4 in water in mg/lit##\n",
"W5=30;##KCl in water in mg/lit##\n",
"M1=100/162;##multiplication factor of Ca(HCO3)2##\n",
"M2=100/84;##multiplication factor of MgCO3##\n",
"M3=100/111;##multiplication factor of CaCl2##\n",
"M4=100/120;##multiplication factor of MgSO4##\n",
"P1=W1*M1;##Ca(HCO3)2 in terms of CaCO3##\n",
"P2=W2*M2;##MgCO3 in terms of CaCO3##\n",
"P3=W3*M3;##CaCl2 in terms of CaCO3##\n",
"P4=W4*M4;##MgSO4 in terms of CaCO3##\n",
"print (\"We do not take KCl since it does not contribute to hardness \");\n",
"T=P1+P2;\n",
"print'%s %.2f %s'%(\"\\nTemporary hardness is \",T,\" mg/l or ppm\");\n",
"P=P3+P4;\n",
"print'%s %.f %s'%(\"\\nPermanant hardness is \",P,\" mg/l or ppm\");\n",
"To=T+P;\n",
"print'%s %.2f %s'%(\"\\nTotal hardness is \",To,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"We do not take KCl since it does not contribute to hardness \n",
"\n",
"Temporary hardness is 84.00 mg/l or ppm\n",
"\n",
"Permanant hardness is 0 mg/l or ppm\n",
"\n",
"Total hardness is 84.00 mg/l or ppm\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_6-pg no 33"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.6##\n",
"import math\n",
"W1=29.2;##MgCO3 in water in mg/lit##\n",
"W2=36.;##MgSO4 in water in mg/lit##\n",
"W3=22.2;##CaCl2 in water in mg/lit##\n",
"W4=142.5;##MgCl2 in water in mg/lit##\n",
"M1=100./84.;##multiplication factor of MgCO3##\n",
"M2=100./120.;##multiplication factor of MgSO4##\n",
"M3=100./111.;##multiplication factor of CaCl2##\n",
"M4=100./95.;##multiplication factor of MgCl2##\n",
"P1=W1*M1;##MgCO3 in terms of CaCO3##\n",
"P2=W2*M2;##MgSO4 in terms of CaCO3##\n",
"P3=W3*M3;##CaCl2 in terms of CaCO3##\n",
"P4=W4*M4;##MgCl2 in terms of CaCO3##\n",
"T=P1;\n",
"print'%s %.2f %s'%(\"\\nCarbonate hardness is \",T,\" mg/l or ppm\");\n",
"P=P2+P3+P4;\n",
"print'%s %.2f %s'%(\"\\nNon Carbonate hardness is \",P,\" mg/l or ppm\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Carbonate hardness is 34.76 mg/l or ppm\n",
"\n",
"Non Carbonate hardness is 200.00 mg/l or ppm\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex2_18_7-pg no 34"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"##water and its treatment##\n",
"##example 2.18.7##\n",
"import math\n",
"Hardness_ppm=304.##ppm in terms of CaCO3##\n",
"Cl=0.07*Hardness_ppm##0.07 Clarke =1 ppm##\n",
"Fr=0.1*Hardness_ppm##0.1 French =1 ppm##\n",
"mgperlit=Hardness_ppm\n",
"print'%s %.2f %s'%(\"Hardness in terms of Clarke \",Cl,\" Cl\");\n",
"print'%s %.2f %s'%(\"\\nHardness in terms of French \",Fr,\" Fr\");\n",
"print'%s %.2f %s'%(\"\\nHardness in terms of mg/lit \",mgperlit,\" mg/l\");"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Hardness in terms of Clarke 21.28 Cl\n",
"\n",
"Hardness in terms of French 30.40 Fr\n",
"\n",
"Hardness in terms of mg/lit 304.00 mg/l\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
|