summaryrefslogtreecommitdiff
path: root/Chemistry_by_Raymond_Chang/Chapter_16.ipynb
blob: 96bc5bbb358932858a1ad98752ee1b0a96ddee43 (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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16:Acid-Base Equilibria and Solubility Equilibria"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.1,Page no:715"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "InitCH3COOH1=0.2                #Initial concentration of CH3COOH solution, M\n",
      "#Let 'x' be the equilibrium concentration of the [H+] and [CH3COO-] ions after dissociation of [CH3COOH], M\n",
      "Ka=1.8*10**-5                   #equilibrium constant of acid, M\n",
      "InitCH3COONa=0.3                #Initial concentration of CH3COONa solution and is equal to conc of Na+ and CH3COO- as it completely dissociates, M\n",
      "InitCH3COOH2=0.2                #Initial concentration of CH3COOH solution, M\n",
      "\n",
      "#Calculation\n",
      "#(a)\n",
      "import math\n",
      "x1=math.sqrt(Ka*InitCH3COOH1)   #from the definition of ionisation constant Ka=[H+]*[CH3COO-]/[CH3COOH]=x*x/(0.2-x), which reduces to x*x/0.2, as x<<0.2 (approximation)\n",
      "pH1=-math.log10(x1)             #since x is the conc. of [H+] ions\n",
      "\n",
      "#(b)\n",
      "#Let 'x' be the equilibrium concentration of the [H+] and hence conc of [CH3COO-] ions is '0.3 + x', M\n",
      "x2=Ka*InitCH3COOH2/InitCH3COONa           #from the definition of ionisation constant Ka=[H+]*[CH3COO-]/[CH3COOH]=x*(0.3+x)/(0.2-x), which reduces to x*0.3/0.2(approximation)\n",
      "pH2=-math.log10(x2)                       #since x is the conc. of [H+] ions\n",
      "\n",
      "#Result\n",
      "print\"(a) the pH of CH3COOH solution is \",round(pH1,2)\n",
      "print\"(b) the pH of CH3COOH and CH3COONa solution is :\",round(pH2,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) the pH of CH3COOH solution is  2.72\n",
        "(b) the pH of CH3COOH and CH3COONa solution is : 4.92\n"
       ]
      }
     ],
     "prompt_number": 92
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.3,Page no:719"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Ka=1.8*10**-5                     #ionisation constant of acid\n",
      "InitCH3COONa=1                    #Initial concentration of CH3COONa solution and is equal to conc of Na+ and CH3COO- as it completely dissociates, M\n",
      "InitCH3COOH=1 #Initial concentration of CH3COOH solution, M\n",
      "HCl=0.1 #moles of HCl added to 1L solution\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "#(a)\n",
      "x=Ka*InitCH3COOH/InitCH3COONa #from the definition of ionisation constant Ka=[H+]*[CH3COO-]/[CH3COOH]=x*(1+x)/(1-x), which reduces to x(approximation)\n",
      "pH=-math.log10(x) #since x is the conc. of [H+] ions\n",
      "#(b)\n",
      "CH3COO=InitCH3COONa-HCl #conc of CH3COO- ions, M\n",
      "CH3COOH=InitCH3COOH+HCl #conc of CH3COOH, M\n",
      "x2=Ka*CH3COOH/CH3COO #from the definition of ionisation constant Ka=[H+]*[CH3COO-]/[CH3COOH]=x*(0.9+x)/(1.1-x), which reduces to x*0.9/1.1(approximation)\n",
      "pH2=-math.log10(x2) #since x is the conc. of [H+] ions\n",
      "\n",
      "#Result\n",
      "print\"(a) the pH of CH3COOH and CH3COONa solution is :\",round(pH,2)\n",
      "print\"(b) the pH of solution after adding HCl is :\",round(pH2,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) the pH of CH3COOH and CH3COONa solution is : 4.74\n",
        "(b) the pH of solution after adding HCl is : 4.66\n"
       ]
      }
     ],
     "prompt_number": 93
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.5,Page no:728"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "InitCH3COOH=0.1 #Initial concentration of CH3COOH solution, M\n",
      "VCH3COOH=25 #volumeof CH3COOH, mL\n",
      "nCH3COOH=InitCH3COOH*VCH3COOH/1000 \n",
      "Ka=1.8*10**-5 #equilibrium constant of acid, M\n",
      "Kb=5.6*10**-10 #equilibrium constant of base, M\n",
      "N=0.1 #Initial concentration of NaOH solution, M\n",
      "V=10 #Initial volume of NaOH solution, mL\n",
      "\n",
      "\n",
      "#Calculation\n",
      "#(a)\n",
      "n=N*V/1000 #Initial moles of NaOH solution\n",
      "import math\n",
      "nCH3COOH_tit=nCH3COOH-n #moles of CH3COOH after titration\n",
      "nCH3COO=n #moles of CH3COO after titration\n",
      "H=nCH3COOH_tit*Ka/nCH3COO #conc of H+ ions, M\n",
      "pH=-math.log10(H) #since H is the conc. of [H+] ions\n",
      "\n",
      "#Result\n",
      "print\"(a) the pH of the solution is :\",round(pH,2)\n",
      "\n",
      "\n",
      "#Calculation\n",
      "#(b)\n",
      "V2=25.0 #Initial volume of NaOH solution, mL\n",
      "n2=N*V2/1000.0 #Initial moles of NaOH solution\n",
      "nCH3COOH_tit2=nCH3COOH-n2 #moles of CH3COOH after titration\n",
      "nCH3COO2=n2 #moles of CH3COO- ions after titration\n",
      "V_total=V2+VCH3COOH #total volume after titration\n",
      "CH3COO=nCH3COO2/V_total*1000 #conc of CH3COO- ions, M\n",
      "x=math.sqrt(Kb*CH3COO) #from the definition of ionisation constant Kb=[OH-]*[CH3COOH]/[CH3COO-]=x*x/(0.05-x), which reduces to x*x/0.05, as x<<0.05 (approximation)\n",
      "pOH=-math.log10(x) #since x is the conc. of [OH-] ions\n",
      "pH2=14.0-pOH \n",
      "\n",
      "#Result\n",
      "print\"(b) the pH of the solution is :\",round(pH2,2)\n",
      "\n",
      "#Calculation\n",
      "#(c)\n",
      "N=0.1 #Initial concentration of NaOH solution, M\n",
      "V=35 #Initial volume of NaOH solution, mL\n",
      "n=N*V/1000 #Initial moles of NaOH solution\n",
      "n_tit=n-nCH3COOH #moles of NaOH after titration\n",
      "nCH3COO=nCH3COOH #moles of CH3COO- ions after titration\n",
      "V_total=V+VCH3COOH #total volume\n",
      "OH=n_tit/V_total*1000 #conc of OH- ions, M\n",
      "pOH=-math.log10(OH) #since OH is the conc. of [OH-] ions\n",
      "pH=14-pOH \n",
      "\n",
      "#Result\n",
      "print\"(c) the pH of the solution is :\",round(pH,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) the pH of the solution is : 4.57\n",
        "(b) the pH of the solution is : 8.72\n",
        "(c) the pH of the solution is : 12.22\n"
       ]
      }
     ],
     "prompt_number": 94
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.6,Page no:730"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "InitNH3=0.1 #Initial concentration of NH3 solution, M\n",
      "VNH3=25 #volume of NH3, mL\n",
      "nNH3=InitNH3*VNH3/1000 \n",
      "Ka=5.6*10**-10 #equilibrium constant of acid, M\n",
      "N=0.1 #Initial concentration, M\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "V=VNH3/InitNH3*N #Initial volume, mL\n",
      "V_total=V+VNH3 #total volume of the mixture, mL\n",
      "n_NH4Cl=nNH3 #moles of NH4Cl\n",
      "NH4Cl=n_NH4Cl/V_total*1000 #conc of NH4+ ions formed, M\n",
      "x=math.sqrt(Ka*NH4Cl) #from the definition of ionisation constant Ka=[H+]*[NH3]/[NH4+]=x*x/(NH4+-x), which reduces to x*x/NH4+, as x<<NH4+ (approximation)\n",
      "pH=-math.log10(x) #since x is the conc. of [H+] ions\n",
      "\n",
      "#Result\n",
      "print\"The pH of the solution at equivalent point is :\",round(pH,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The pH of the solution at equivalent point is : 5.28\n"
       ]
      }
     ],
     "prompt_number": 95
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.8,Page no:738"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "solubility=0.67 #solubility of CaSO4, g/L\n",
      "\n",
      "#Calculation\n",
      "M=136.2 #mol mass of CaSO4, g\n",
      "s=solubility/M #concentration, M\n",
      "Ksp=s**2 #solubility product\n",
      "\n",
      "#Result\n",
      "print\"The Ksp of CaSO4 is :%.1e\"%Ksp"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Ksp of CaSO4 is :2.4e-05\n"
       ]
      }
     ],
     "prompt_number": 96
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.9,Page no:739"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Ksp=2.2*10**-20 #solubility product\n",
      "M=97.57 #mol mass of Cu(OH)2, g\n",
      "\n",
      "#Calculation\n",
      "s=(Ksp/4.0)**(1.0/3.0) #concentration, M\n",
      "solubility=s*M #solubility of Cu(OH)2, g/L\n",
      "\n",
      "#Result\n",
      "print\"The solubility of Cu(OH)2 is :%.2e\"%solubility,\"g/L\"\n",
      "\n",
      "#ALTERNATIVE METHOD:\n",
      "\n",
      "#Variable declaration\n",
      "Kspt=2.2*10**-20             #Ksp value from table 16.2\n",
      "M=97.75          #Molar mass of Cu(OH)2\n",
      "\n",
      "#Calculation\n",
      "from scipy.optimize import fsolve\n",
      "def f(s):\n",
      "    Cu2=s\n",
      "    OH_=2*s\n",
      "    return(Kspt-(Cu2*(OH_**2)))\n",
      "s=fsolve(f,1)\n",
      "solubility=round(s,8)*M\n",
      "\n",
      "#Result\n",
      "print \"Alternative method: Solubility of Cu(OH)2=%.1e\"%solubility,\"g/L\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The solubility of Cu(OH)2 is :1.72e-05 g/L\n",
        "Alternative method: Solubility of Cu(OH)2=1.8e-05"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " g/L\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.10,Page no:741"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Ksp=1.1*10**-10 #solubility product of BaSO4\n",
      "#for Ba2+ ion\n",
      "N=0.004 #normality, M\n",
      "V=200 #vol in mL\n",
      "n=N*V/1000 #moles\n",
      "#for K2SO4sol\n",
      "N1=0.008 #normality, M\n",
      "V1=600 #vol in mL\n",
      "\n",
      "#Calculation\n",
      "n1=N1*V1/1000 #moles\n",
      "Nnew=n*1000/(V+V1) #conc of Ba2+ ions in final sol\n",
      "N1new=n1*1000/(V+V1) #conc of SO4 2- ions in final sol\n",
      "Q=Nnew*N1new #as Q=[Ba2+][SO4 2-]\n",
      "\n",
      "#Result\n",
      "print\"Q=\",Q\n",
      "if(Q>Ksp): #determination of precipitation\n",
      "    print\"Q>Ksp, The solution is supersaturated and hence a precipitate will form\"\n",
      "else: \n",
      "    print\"Q<Ksp, The solution is not supersaturated and hence a precipitate will not form\"  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Q= 6e-06\n",
        "Q>Ksp, The solution is supersaturated and hence a precipitate will form\n"
       ]
      }
     ],
     "prompt_number": 99
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.11,Page no:743"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Br=0.02 #conc of Ag+ ions, M\n",
      "Ksp1=7.7*10**-13 #solubility product of AgBr\n",
      "Ksp2=1.6*10**-10 #solubility product of AgCl\n",
      "Cl=0.02 #conc of Cl- ions, M\n",
      "\n",
      "#Calculation\n",
      "#for Br\n",
      "Ag1=Ksp1/Br #conc of Ag+ ions at saturated state, M\n",
      "#for Cl\n",
      "Ag2=Ksp2/Cl #conc of Ag+ ions at saturated state, M\n",
      "\n",
      "#Result\n",
      "print \"[Ag+]=\",Ag2,\"M\"\n",
      "print\"To precipitate Br- without precipitating Cl- the concentration of Ag must be greater than %.1e\"%Ag1,\"M but less than\",Ag2,\"M\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[Ag+]= 8e-09 M\n",
        "To precipitate Br- without precipitating Cl- the concentration of Ag must be greater than 3.9e-11 M but less than 8e-09 M\n"
       ]
      }
     ],
     "prompt_number": 100
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.12,Page no: 745"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "N_AgNO3=6.5*10**-3 #normality of AgNO3, M\n",
      "AgCl=143.4 #mol mass of AgCl, g\n",
      "Ksp=1.6*10**-10 #solubility product of AgCl\n",
      "\n",
      "#Calculation\n",
      "Ag=N_AgNO3 #conc of Ag+ ions as 's' is negligible, M\n",
      "s=Ksp/Ag #as Ksp=[Ag+][Cl-], molar solubility of AgCl, M\n",
      "solubility=s*AgCl #solubility of AgCl in AgBr solution, g/L\n",
      "\n",
      "#Result\n",
      "print\"The solubility of AgCl in AgBr solution is :%.2e\"%solubility,\"g/L\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The solubility of AgCl in AgBr solution is :3.53e-06 g/L\n"
       ]
      }
     ],
     "prompt_number": 101
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.14,Page no:748"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "FeCl2=0.003 #normality of FeCl2, M\n",
      "Fe=FeCl2 #as Fe2+ is strong electrolyte, conc of Fe2+=conc of FeCl2, M\n",
      "Ksp=1.6*10**-14 #solubility product of FeCl2\n",
      "Kb=1.8*10**-5 #ionisation constant of base\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "OH=math.sqrt(Ksp/Fe) #as Ksp=[Fe2+][OH-]**2, conc of OH- ions, M\n",
      "x=(OH**2)/Kb+OH #as Kb=[NH4+][OH-]/[NH3]\n",
      "\n",
      "#Result\n",
      "print\"To initiate precipitation the conc of NH3 must be slightly greater than :%.1e\"%x,\"M\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "To initiate precipitation the conc of NH3 must be slightly greater than :2.6e-06 M\n"
       ]
      }
     ],
     "prompt_number": 102
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.15,Page no:750"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "CuSO4=0.2 #normality of CuSO4, M\n",
      "NH3=1.2 #initial conc of NH3, M\n",
      "VNH3=1 #volume of NH3, L\n",
      "Kf=5*10**13 #formation constant\n",
      "\n",
      "#Calculation\n",
      "CuNH34=CuSO4 #conc of Cu(NH3)4 2+, M\n",
      "NH3=NH3-4*CuNH34 #conc of NH3 after formation of complex, as 4 moles of NH3 react to form 1 mole complex, M\n",
      "x=CuNH34/(NH3**4*Kf) #as Kf=[Cu(SO4)3 2+]/[Cu2+][NH3]**4\n",
      "\n",
      "#Result\n",
      "print\"The conc of Cu2+ ions in equilibrium is :%.1e\"%x,\"M\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conc of Cu2+ ions in equilibrium is :1.6e-13 M\n"
       ]
      }
     ],
     "prompt_number": 103
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example no:16.16,Page no:751"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "InitNH3=1 #initial conc of NH3, M\n",
      "Ksp=1.6*10**-10 #solubility product of AgCl\n",
      "Kf=1.5*10**7 #formation constant of complex\n",
      "\n",
      "#Calculation\n",
      "K=Ksp*Kf #overall equilibrium constant\n",
      "import math\n",
      "s=math.sqrt(K)/(1+2*InitNH3*math.sqrt(K)) #molar solubility of AgCl, M\n",
      "\n",
      "#Result\n",
      "print\"Amount of AgCl which can be dissolved in 1 L of 1 M NH3 sol in equilibrium is :\",round(s,3),\"M\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Amount of AgCl which can be dissolved in 1 L of 1 M NH3 sol in equilibrium is : 0.045 M\n"
       ]
      }
     ],
     "prompt_number": 91
    }
   ],
   "metadata": {}
  }
 ]
}