summaryrefslogtreecommitdiff
path: root/Elements_of_Physical_Chemistry/Chapter4.ipynb
blob: b5b8ff9080785d164e7667602cc78d6e1bd71f9f (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4 - Thermodynamics: the Second Law"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example I1 - Pg 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the entropy change at 273 and 373 K\n",
      "#Initialization of variables\n",
      "H=100. #kJ\n",
      "T1=273. #K\n",
      "T2=373.#K\n",
      "#calculations\n",
      "S1=H*1000/T1\n",
      "S2=H*1000/T2\n",
      "#results\n",
      "print '%s %d %s' %('Entropy change at 273 K is',S1,'J/K ')\n",
      "print '%s %d %s' %('\\n Entropy change at 373 K is',S2,'J/K ')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change at 273 K is 366 J/K \n",
        "\n",
        " Entropy change at 373 K is 268 J/K \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example I2 - Pg 84"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the enthalpy of vaporization\n",
      "#Initialization of variables\n",
      "T=59.2 #K\n",
      "#calculations\n",
      "Hvap=85*(273.2+T)/1000.\n",
      "#results\n",
      "print '%s %d %s' %('Enthalpy of vaportization  =',Hvap,'kJ/mol')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Enthalpy of vaportization  = 28 kJ/mol\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example I3 - Pg 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the change in entropy\n",
      "#Initialization of variables\n",
      "SH2O=70 #J/K mol\n",
      "SH2=131 #J/K mol\n",
      "SO2=205 #J/K mol\n",
      "#calculations\n",
      "deltaS=2*SH2O-2*SH2-SO2\n",
      "print '%s %d %s' %('Change in entropy =',deltaS,'J/K mol')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in entropy = -327 J/K mol\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 84"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the net heat transferred and entropy production per day\n",
      "#Initialization of variables\n",
      "Power=100. #W\n",
      "time=1 #day\n",
      "T=20 #C\n",
      "#calculations\n",
      "timeins=1*24*3600\n",
      "qsurr=timeins*Power\n",
      "Ssurr=qsurr/(T+273.)\n",
      "#results\n",
      "print '%s %d %s' %('Heat transferred to surroundings =',qsurr,'J')\n",
      "print '%s %.2e %s' %('\\n Entropy production per day =',Ssurr,'J/k')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat transferred to surroundings = 8640000 J\n",
        "\n",
        " Entropy production per day = 2.95e+04 J/k\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the amount of food bird must consume\n",
      "#Initialization of variables\n",
      "import math\n",
      "g=9.81 #m/s^2\n",
      "m=30*math.pow(10,-3) #kg\n",
      "d=10 #m\n",
      "H=2.828*math.pow(10,6) #j/mol\n",
      "M=180. #g/mol\n",
      "#calculations\n",
      "w=g*m*d\n",
      "n=w/H\n",
      "m=n*M\n",
      "#results\n",
      "print '%s %.1e %s' %('Amount bird must consume =',m,'g')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Amount bird must consume = 1.9e-04 g\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}