summaryrefslogtreecommitdiff
path: root/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter11.ipynb
blob: b8b395f7cca2cca6c84e7bf94e30175ccab6ada7 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:d710461b968e986411ee49bb4f3e24c283e59536cefcb736abd7424eef7f3627"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11: Electrochemical Cells, Batteries, and Fuel Cells"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.1, Page Number 256"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log, sqrt\n",
      "\n",
      "#Variable Declaration\n",
      "aH = 0.770        #Activity of \n",
      "fH2 = 1.13        #Fugacity of Hydrogen gas\n",
      "E0 = 0.0          #Std. electrode potential, V\n",
      "n = 1.0           #Number of electrons transfered\n",
      "\n",
      "#Calculations\n",
      "E = E0 - (0.05916/n)*log(aH/sqrt(fH2),10)\n",
      "\n",
      "#Results\n",
      "print 'The potential of H+/H2 half cell %5.4f V'%E"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "THe potential of H+/H2 half cell 0.00829 V\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.2, Page Number 256"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log, sqrt\n",
      "\n",
      "#Variable Declaration\n",
      "E0r1 = -0.877       #Std Electrod potential for Rx2 : Al3+ + 3e- ------> Al (s)                   \n",
      "E0r2 = -1.660       #Std Electrod potential for Rx2 : Al3+ + 3e- ------> Al (s)\n",
      "E0r3 = +0.071       #Std Electrod potential for Rx3 : AgBr (s) + e- ------> Ag(s) +Br- (aq.)\n",
      "\n",
      "#Calculations\n",
      "#3Fe(OH)2 (s)+ 2Al (s)  <---------> 3Fe (s)  + 6(OH-) + 2Al3+\n",
      "E0a = 3*E0r1 + (-2)*E0r2\n",
      "#Fe (s) + 2OH- +   2AgBr (s) -------> Fe(OH)2 (s)  + 2Ag(s) +  2Br- (aq.)\n",
      "E0b = -E0r1 + (2)*E0r3\n",
      "\n",
      "#Results\n",
      "print '%5.3f %5.3f'%(E0a,E0b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.689 1.019\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.3, Page Number 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable Declaration\n",
      "E01 = 0.771      #Rx1 : Fe3+ + e- -----> Fe2+\n",
      "E02 = -0.447     #Rx2 : Fe2+ + 2e- -----> Fe\n",
      "F = 96485        #Faraday constant, C/mol\n",
      "n1,n2,n3 = 1.,2.,3.\n",
      "\n",
      "#Calculations\n",
      "dG01 = -n1*F*E01\n",
      "dG02 = -n2*F*E02\n",
      "                #For overall reaction\n",
      "dG0 = dG01 + dG02\n",
      "E0Fe3byFe = -dG0/(n3*F)\n",
      "\n",
      "#Results\n",
      "print 'E0 for overall reaction is %5.3f V'%(E0Fe3byFe)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E0 for overall reaction is -0.041 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.4, Page Number 258"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "E01 = +1.36             #Std. electrode potential for Cl2/Cl\n",
      "dE0bydT = -1.20e-3      #V/K\n",
      "F = 96485               #Faraday constant, C/mol\n",
      "n = 2.\n",
      "S0H = 0.0               #Std. entropy J/(K.mol) for H+ ,Cl-,H2, Cl2 \n",
      "S0Cl = 56.5\n",
      "S0H2 = 130.7\n",
      "S0Cl2 = 223.1\n",
      "nH, nCl, nH2, nCl2 = 2, 2, -1,-1\n",
      "#Calculations\n",
      "dS01 = n*F*dE0bydT\n",
      "dS02 =nH*S0H + nCl*S0Cl + nH2*S0H2 + nCl2*S0Cl2\n",
      "\n",
      "#Results\n",
      "print 'Std. entropy change of reaction from dE0bydT is %4.2e and\\nStd entropy values is %4.2e V'%(dS01,dS02)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Std. entropy change of reaction from dE0bydT is -2.32e+02 and\n",
        "Std entropy values is -2.41e+02 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.5, Page Number 259"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import exp\n",
      "#Variable Declaration\n",
      "E0 = +1.10              #Std. electrode potential for Danniel cell, V\n",
      "                        #Zn(s) + Cu++ ----->  Zn2+   +  Cu\n",
      "T = 298.15              #V/K\n",
      "F = 96485               #Faraday constant, C/mol\n",
      "n = 2.\n",
      "R = 8.314               #Gas constant, J/(mol.K)\n",
      "\n",
      "#Calculations\n",
      "K = exp(n*F*E0/(R*T))\n",
      "\n",
      "#Results\n",
      "print 'Equilibrium constant for reaction is %4.2e'%(K)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equilibrium constant for reaction is 1.55e+37\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.6, Page Number 259"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "E = +0.29               #Cell emf, V\n",
      "\n",
      "#Calculations\n",
      "Ksp = 10**(-n*E/0.05916)\n",
      "\n",
      "#Results\n",
      "print 'Equilibrium constant for reaction is %4.2e'%(Ksp)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equilibrium constant for reaction is 1.57e-10\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example Problem 11.8, Page Number 262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable Declaration\n",
      "E = +1.51               #EMF for reduction of permangnet, V\n",
      "E01 = -0.7618           #Zn2+  + 2e-  -------->  Zn (s)\n",
      "E02 = +0.7996           #Ag+  + e-  -------->  Ag (s)\n",
      "E03 = +1.6920           #Au+  + e-  -------->  Au (s)        \n",
      "\n",
      "#Calculations\n",
      "EZn = E - E01\n",
      "EAg = E - E02\n",
      "EAu = E - E03\n",
      "animals = {\"parrot\": 2, \"fish\": 6}\n",
      "Er = {\"Zn\":EZn,\"Ag\":EAg,\"Au\":EAu}\n",
      "#Results\n",
      "print 'Cell potentials for Zn, Ag, Au are %4.2f V, %4.2f V, and %4.2f V'%(EZn, EAg,EAu)\n",
      "for i in Er:\n",
      "    if Er[i] >0.0:\n",
      "        print '%s has positive cell potential of %4.3f V and Can be oxidized bypermangnate ion' %(i,Er[i])\n",
      "    "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cell potentials for Zn, Ag, Au are 2.27 V, 0.71 V, and -0.18 V\n",
        "Zn has positive cell potential of 2.272 V and Can be oxidized bypermangnate ion\n",
        "Ag has positive cell potential of 0.710 V and Can be oxidized bypermangnate ion\n"
       ]
      }
     ],
     "prompt_number": 25
    }
   ],
   "metadata": {}
  }
 ]
}