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
|
{
"metadata": {
"name": "",
"signature": "sha256:a0be5f6d37f6b1696997f58d0cc492cc18c5483e1f769555c228f3249920c51f"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 13: Boltzmann Distribution"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.1, Page Number 309"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import factorial\n",
"\n",
"#Variable Declaration\n",
"\n",
"aH = 40\n",
"N = 100\n",
"\n",
"#Calculations\n",
"aT = 100 - aH\n",
"We = factorial(N)/(factorial(aT)*factorial(aH))\n",
"Wexpected = factorial(N)/(factorial(N/2)*factorial(N/2))\n",
"\n",
"#Results\n",
"print 'The observed weight %5.2e compared to %5.2e'%(We,Wexpected)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The observed weight 1.37e+28 compared to 1.01e+29\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.2, Page Number 310"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.3, Page Number 314"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"p0 = 0.633 #Probabilities of Energy level 1,2,3 \n",
"p1 = 0.233\n",
"p2 = 0.086\n",
"\n",
"#Calculation\n",
"p4 = 1. -(p0+p1+p2)\n",
"\n",
"#Results\n",
"print 'Probability of finding an oscillator at energy level of n>3 is %4.3f i.e.%4.1f percent'%(p4,p4*100)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Probability of finding an oscillator at energy level of n>3 is 0.048 i.e. 4.8 percent\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.4, Page Number 315"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"p0 = 0.394 #Probabilities of Energy level 1,2,3 \n",
"p1by2 = 0.239\n",
"p2 = 0.145\n",
"\n",
"#Calculation\n",
"p4 = 1. -(p0+p1by2+p2)\n",
"\n",
"#Results\n",
"print 'Probability of finding an oscillator at energy level of n>3 is %4.3f'%(p4)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Probability of finding an oscillator at energy level of n>3 is 0.222\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.5, Page Number 321"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import exp\n",
"\n",
"#Variable Declaration\n",
"I2 = 208 #Vibrational frequency, cm-1 \n",
"T = 298 #Molecular Temperature, K\n",
"c = 3.00e10 #speed of light, cm/s\n",
"h = 6.626e-34 #Planks constant, J/K\n",
"k = 1.38e-23 #Boltzman constant, J/K\n",
"#Calculation\n",
"q = 1./(1.-exp(-h*c*I2/(k*T)))\n",
"p2 = exp(-2*h*c*I2/(k*T))/q\n",
"\n",
"#Results\n",
"print 'Partition function is %4.3f'%(q)\n",
"print 'Probability of occupying the second vibrational state n=2 is %4.3f'%(p2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Partition function is 1.577\n",
"Probability of occupying the second vibrational state n=2 is 0.085\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example Problem 13.6, Page Number 322"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"B = 1.45 #Magnetic field streangth, Teslas \n",
"T = 298 #Molecular Temperature, K\n",
"c = 3.00e10 #speed of light, cm/s\n",
"h = 6.626e-34 #Planks constant, J/K\n",
"k = 1.38e-23 #Boltzman constant, J/K \n",
"gnbn = 2.82e-26 #J/T\n",
"#Calculation\n",
"ahpbyahm = exp(-gnbn*B/(k*T))\n",
"\n",
"#Results\n",
"print 'Occupation Number is %7.6f'%(ahpbyahm)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Occupation Number is 0.999990\n"
]
}
],
"prompt_number": 18
}
],
"metadata": {}
}
]
}
|