summaryrefslogtreecommitdiff
path: root/sample_notebooks/testingtesting/ajinkya.ipynb
blob: 2e81c43dab19f6edbd8d7f102ad42686a1d801b3 (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
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
{
 "metadata": {
  "celltoolbar": "Raw Cell Format",
  "name": "",
  "signature": "sha256:8ade9358728d8873e3787f09037539bd355e8453094fed25ae256529fe52d8d4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17: Water Treatment"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1,Page number 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import  math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "m1 = 146    #mass of Mg(HCO3)2\n",
      "\n",
      "m2 = 162    #mass of Ca(HCO3)2\n",
      "\n",
      "m3 = 95    #mass of MgCl2\n",
      "\n",
      "m4 = 136    #mass of CaSO4\n",
      "\n",
      "amnt_1 = 7.5     #amount of Mg(HCO3)2 in mg/l\n",
      "\n",
      "amnt_2 = 16     #amount of Ca(HCO3)2 in mg/l\n",
      "\n",
      "amnt_3 = 9     #amount of MgCl2 in mg/l\n",
      "\n",
      "amnt_4 = 13.6     #amount of CaSO4 in mg/l\n",
      "\n",
      "temp_hard= (amnt_1*100./m1)+(amnt_2*100./m2)\n",
      "\n",
      "perm_hard= (amnt_3*100./m3)+(amnt_4*100./m4)\n",
      "\n",
      "total= temp_hard +perm_hard\n",
      "\n",
      "print\"the temporary hardness is =\",temp_hard,\"mg/l\"\n",
      "\n",
      "print\"the total  hardness is =\",total,\"mg/l\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the temporary hardness is = 15.0135295112 mg/l\n",
        "the total  hardness is = 34.4872137218 mg/l\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 2,Page number 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "m1= 136   # mass of FeSO4\n",
      "\n",
      "m2 = 100  #mass of CaCO3\n",
      "\n",
      "#for 100 ppm hardness FeSO4 required per 10**6 parts of water is 136 parts\n",
      "#for 200 ppm hardness\n",
      "\n",
      "amt= m1*200./m2\n",
      "\n",
      "print\"the amount of FeSO4 required is =\",amt,\"mg/l\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the amount of FeSO4 required is = 272 mg/l\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3,Page number 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "conc = 15.6 *10**-6    #concentration of (CO3)-2\n",
      "\n",
      "m = 60                 #mass of CO3\n",
      "\n",
      "Molarity= conc*100./m\n",
      "\n",
      "print\"the molarity of (CO3)-2  is =\",Molarity,\"M\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the molarity of (CO3)-2  is = 2.6e-05 M\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 4,Page number 370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "m1 = 146    #mass of Mg(HCO3)2\n",
      "\n",
      "m2 = 162    #mass of Ca(HCO3)2\n",
      "\n",
      "m3 = 111    #mass of CaCl2\n",
      "\n",
      "m4 = 120    #mass of MgSO4\n",
      "\n",
      "m5 = 136    #mass of CaSO4\n",
      "\n",
      "amnt_1 = 12.5     #amount of Mg(HCO3)2 in ppm\n",
      "\n",
      "amnt_2 = 10.5     #amount of Ca(HCO3)2 in ppm\n",
      "\n",
      "amnt_3 = 8.2     #amount of CaCl2 in ppm \n",
      "\n",
      "amnt_4 = 2.6     #amount of MgSO4 in ppm\n",
      "\n",
      "amnt_5 = 7.5     #amount of CaSO4 in ppm\n",
      "\n",
      "temp_hard= (amnt_1*100./m1)+(amnt_2*100./m2)\n",
      "\n",
      "perm_hard= (amnt_3*100./m3)+(amnt_4*100./m4)+(amnt_5*100./m5)\n",
      "\n",
      "total= temp_hard +perm_hard\n",
      "\n",
      "print\"the temporary hardness is =\",temp_hard,\"mg/l\"\n",
      "\n",
      "print\"the permanent hardness is =\",perm_hard,\"mg/l\"\n",
      "\n",
      "print\"the total  hardness is =\",total,\"mg/l\"\n",
      "\n",
      "v= 100    #volume of sample\n",
      "\n",
      "v_EDTA = total*v/1000   #volume of EDTA \n",
      "\n",
      "print\"the volume of M/100 EDTA required is =\",v_EDTA,\"ml\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the temporary hardness is = 15.0431253171 mg/l\n",
        " the permanent hardness is = 15.0687599364 mg/l\n",
        " the total  hardness is = 30.1118852535 mg/l\n",
        " the volume of M/100 EDTA required is = 3.01118852535 ml\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 5,Page number 370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "v= 50000  #volume of water\n",
      "\n",
      "m1 = 84    #mass of MgCO3\n",
      "\n",
      "m2 = 100    #mass of CaCO3\n",
      "\n",
      "m3 = 95    #mass of MgCl2\n",
      "\n",
      "m4 = 111    #mass of CaCl2\n",
      "\n",
      "amnt_1 = 144     #amount of MgCO3 in ppm\n",
      "\n",
      "amnt_2 = 25     #amount of CaCO3 in ppm\n",
      "\n",
      "amnt_3 = 95     #amount of MgCl2 in ppm \n",
      "\n",
      "amnt_4 = 111     #amount of CaCl2 in ppm\n",
      "\n",
      "lime = (74./100)*(2*(amnt_1*100./m1)+(amnt_2*100./m2)+(amnt_3*100./m3))*v\n",
      "\n",
      "print\"the lime required is =\",lime,\"mg\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the lime required is = 17310714.2857 mg\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 6,Page number 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "v= 10**6  #volume of water\n",
      "\n",
      "m1 = 40.0  #mass of Ca+2\n",
      "\n",
      "m2 = 24.0    #mass of Mg+2\n",
      "\n",
      "m3 = 44.0    #mass of CO2\n",
      "\n",
      "m4 = 122.0    #mass of HCO3-\n",
      "\n",
      "amnt_1 = 20.0     #amount of Ca+2 in ppm\n",
      "\n",
      "amnt_2 = 25.0     #amount of Mg+2 in ppm\n",
      "\n",
      "amnt_3 = 30.0     #amount of CO2 in ppm \n",
      "\n",
      "amnt_4 = 150.0     #amount of HCO3- in ppm\n",
      "\n",
      "lime_1 = (74./100)*((amnt_2*100./m2)+(amnt_3*100./m3)+(amnt_4*100./m4))*v\n",
      "\n",
      "soda = (106./100)*((amnt_1*100./m1)+(amnt_2*100./m2)-(amnt_4*100./m4))*v\n",
      "\n",
      "print\"the lime required is =\",lime_1,\"mg\"\n",
      "\n",
      "print\"the soda required is =\",soda,\"mg\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the lime required is = 218521485.345 mg\n",
        "the soda required is = 33088797.8142 mg\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7,Page number 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "v= 150        #volume of NaCl \n",
      "\n",
      "conc = 150.   #concentration of NaCl\n",
      "\n",
      "amnt =v*conc *100./117    #amnt of NaCl\n",
      "\n",
      "hard = 600.   #hardness of water\n",
      "\n",
      "vol= amnt*1000./hard\n",
      "\n",
      "print\"the volume of water is =\",round(vol,4),\"litres\"\n",
      "\n",
      "#calculation mistake in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the volume of water is = 32051.2821 litres\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 8,Page number 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "strength = 10*0.85/9    #strength of EDTA\n",
      "\n",
      "#1000 ml EDTA solution == 1 g CaCO3\n",
      "\n",
      "#for 20 ml EDTA solution\n",
      "\n",
      "amnt= 20.*strength/1000\n",
      "\n",
      "#50 ml smple of water contains amnt CaCO3\n",
      "\n",
      "hard= amnt*10**6/50    #hardness of water \n",
      "\n",
      "print\"the hardness of water is =\",round(hard,3),\"ppm\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the hardness of water is = 377.778 ppm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 9,Page number 372"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given Data\n",
      "\n",
      "m1 = 146    #mass of Mg(HCO3)2\n",
      "\n",
      "m2 = 162    #mass of Ca(HCO3)2\n",
      "\n",
      "m3 = 111    #mass of CaCl2\n",
      "\n",
      "m4 = 120    #mass of MgSO4\n",
      "\n",
      "m5 = 136    #mass of CaSO4\n",
      "\n",
      "amnt_1 = 12.5     #amount of Mg(HCO3)2 in ppm\n",
      "\n",
      "amnt_2 = 10.5     #amount of Ca(HCO3)2 in ppm\n",
      "\n",
      "amnt_3 = 8.2     #amount of CaCl2 in ppm \n",
      "\n",
      "amnt_4 = 2.6     #amount of MgSO4 in ppm\n",
      "\n",
      "amnt_5 = 7.5     #amount of CaSO4 in ppm\n",
      "\n",
      "temp_hard= ((amnt_1*100./m1)+(amnt_2*100./m2))*0.1\n",
      "\n",
      "perm_hard= ((amnt_3*100./m3)+(amnt_4*100./m4)+(amnt_5*100./m5))*0.1\n",
      "\n",
      "print\"the temporary hardness is =\",round(temp_hard,3),\"degree Fr\"\n",
      "\n",
      "print\"the permanent hardness is =\",round(perm_hard,3),\"degree Fr\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the temporary hardness is = 1.504 degree Fr\n",
        "the permanent hardness is = 1.507 degree Fr\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}