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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1:Preliminary Concepts "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:1,Page no:258"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"N=2 #no. of particles\n",
"n1=2 #occupation no. of particles\n",
"g1=3 #degeneracy of particles\n",
"\n",
"#Calculation\n",
"import math\n",
"#(i) particles are distinguishable\n",
"state1=(math.factorial(N)*g1**n1)/math.factorial(n1) #possible microstates of distinguishable particles\n",
"#(ii) particles are indistinguishable bosons \n",
"state2=math.factorial(n1+g1-1)/(math.factorial(n1)*math.factorial(g1-1)) #possible microstates of indistinguishable bosons\n",
"#(iii) particles are indistinguishable fermions\n",
"state3=math.factorial(g1)/(math.factorial(n1)*math.factorial(g1-n1)) #possible microstates of indistinguishable fermions\n",
"\n",
"#Result\n",
"print\"\\n(i) \u03a9(distinguishable) =\",state1,\"\\n(ii) \u03a9(indistinguishable bosons) = \",state2,\"\\n(iii) \u03a9(indistinguishable fermions) =\",state3 \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"(i) \u03a9(distinguishable) = 9 \n",
"(ii) \u03a9(indistinguishable bosons) = 6 \n",
"(iii) \u03a9(indistinguishable fermions) = 3\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:2,Page no:259"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"N=4 #no. of particles\n",
"A1=[2,0,0,2] #possible macrostate\n",
"A2=[1,1,1,1] #possible macrostate\n",
"A3=[0,3,0,1] #possible macrostate\n",
"A4=[1,0,3,0] #possible macrostate\n",
"A5=[0,2,2,0] #possible macrostate\n",
"g1=1 #degeneracy of particles\n",
"g2=2 #degeneracy of particles\n",
"g3=2 #degeneracy of particles\n",
"g4=1 #degeneracy of particles\n",
"\n",
"import math\n",
"#(i) particles are distinguishable\n",
"print\"\\n(i)Possible macrostates are\\n \"\n",
"print A1,A2,A3,A4,A5\n",
"micro1=((math.factorial(N)*g1**A1[0]*g2**A1[1]*g3**A1[2]*g4**A1[3])/(math.factorial(A1[0])*math.factorial(A1[1])*math.factorial(A1[2])*math.factorial(A1[3]))) #The number of microstates\n",
"micro2=((math.factorial(N)*g1**A2[0]*g2**A2[1]*g3**A2[2]*g4**A2[3])/(math.factorial(A2[0])*math.factorial(A2[1])*math.factorial(A2[2])*math.factorial(A2[3]))) #The number of microstates\n",
"micro3=((math.factorial(N)*g1**A3[0]*g2**A3[1]*g3**A3[2]*g4**A3[3])/(math.factorial(A3[0])*math.factorial(A3[1])*math.factorial(A3[2])*math.factorial(A3[3]))) #The number of microstates\n",
"micro4=((math.factorial(N)*g1**A4[0]*g2**A4[1]*g3**A4[2]*g4**A4[3])/(math.factorial(A4[0])*math.factorial(A4[1])*math.factorial(A4[2])*math.factorial(A4[3]))) #The number of microstates\n",
"micro5=((math.factorial(N)*g1**A5[0]*g2**A5[1]*g3**A5[2]*g4**A5[3])/(math.factorial(A5[0])*math.factorial(A5[1])*math.factorial(A5[2])*math.factorial(A5[3]))) #The number of microstates\n",
"\n",
"print\"No. of macrostates is given by:\"\n",
"print A1,\"=\",micro1,\"\\n\",A2,\"=\",micro2,\"\\n\",A3,\"=\",micro3,\"\\n\",A4,\"=\",micro4,\"\\n\",A5,\"=\",micro5,\"\\n\",\n",
"\n",
"print\"\\nMost probable macrostates are\\n \" \n",
"if(micro1>=micro2 and micro1>=micro3 and micro1>=micro4 and micro1>=micro5) :\n",
" print A1 \n",
" \n",
"if(micro2>=micro1 and micro2>=micro3 and micro2>=micro4 and micro2>=micro5) :\n",
" print A2 \n",
" \n",
"if(micro3>=micro1 and micro3>=micro2 and micro3>=micro4 and micro3>=micro5) :\n",
" print A3 \n",
" \n",
"if(micro4>=micro1 and micro4>=micro2 and micro4>=micro3 and micro4>=micro5) :\n",
" print A4 \n",
" \n",
"if(micro5>=micro1 and micro5>=micro2 and micro5>=micro3 and micro5>=micro4) :\n",
" print A5 \n",
" \n",
"\n",
"#(ii) particles are indistinguishable bosons\n",
"print\"\\n(ii)Possible macrostates are\\n \" \n",
"print A1,A3,A3,A4,A5\n",
"micro1=(math.factorial(A1[0]+g1-1)*math.factorial(A1[1]+g2-1)*math.factorial(A1[2]+g3-1)*math.factorial(A1[3]+g4-1))/(math.factorial(A1[0])*math.factorial(A1[1])*math.factorial(A1[2])*math.factorial(A1[3])*math.factorial(g1-1)*math.factorial(g2-1)*math.factorial(g3-1)*math.factorial(g4-1)) \n",
"micro2=(math.factorial(A2[0]+g1-1)*math.factorial(A2[1]+g2-1)*math.factorial(A2[2]+g3-1)*math.factorial(A2[3]+g4-1))/(math.factorial(A2[0])*math.factorial(A2[1])*math.factorial(A2[2])*math.factorial(A2[3])*math.factorial(g1-1)*math.factorial(g2-1)*math.factorial(g3-1)*math.factorial(g4-1)) \n",
"micro3=(math.factorial(A3[0]+g1-1)*math.factorial(A3[1]+g2-1)*math.factorial(A3[2]+g3-1)*math.factorial(A3[3]+g4-1))/(math.factorial(A3[0])*math.factorial(A3[1])*math.factorial(A3[2])*math.factorial(A3[3])*math.factorial(g1-1)*math.factorial(g2-1)*math.factorial(g3-1)*math.factorial(g4-1)) \n",
"micro4=(math.factorial(A4[0]+g1-1)*math.factorial(A4[1]+g2-1)*math.factorial(A4[2]+g3-1)*math.factorial(A4[3]+g4-1))/(math.factorial(A4[0])*math.factorial(A4[1])*math.factorial(A4[2])*math.factorial(A4[3])*math.factorial(g1-1)*math.factorial(g2-1)*math.factorial(g3-1)*math.factorial(g4-1)) \n",
"micro5=(math.factorial(A5[0]+g1-1)*math.factorial(A5[1]+g2-1)*math.factorial(A5[2]+g3-1)*math.factorial(A5[3]+g4-1))/(math.factorial(A5[0])*math.factorial(A5[1])*math.factorial(A5[2])*math.factorial(A5[3])*math.factorial(g1-1)*math.factorial(g2-1)*math.factorial(g3-1)*math.factorial(g4-1)) \n",
"\n",
"print\"No. of macrostates is given by:\"\n",
"print A1,\"=\",micro1,\"\\n\",A2,\"=\",micro2,\"\\n\",A3,\"=\",micro3,\"\\n\",A4,\"=\",micro4,\"\\n\",A5,\"=\",micro5,\"\\n\"\n",
"\n",
"print\"\\nMost probable macrostate is\\n \"\n",
"if(micro1>=micro2 and micro1>=micro3 and micro1>=micro4 and micro1>=micro5) :\n",
" print A1\n",
" \n",
"if(micro2>=micro1 and micro2>=micro3 and micro2>=micro4 and micro2>=micro5) :\n",
" print A2 \n",
" \n",
"if(micro3>=micro1 and micro3>=micro2 and micro3>=micro4 and micro3>=micro5) :\n",
" print A3 \n",
" \n",
"if(micro4>=micro1 and micro4>=micro2 and micro4>=micro3 and micro4>=micro5) :\n",
" print A4 \n",
" \n",
"if(micro5>=micro1 and micro5>=micro2 and micro5>=micro3 and micro5>=micro4) :\n",
" print A5 \n",
" \n",
"\n",
"#(iii) Particles are indistinguishable fermions\n",
"print\"\\n(iii)Possible macrostates are\\n \"\n",
"print A2,A5\n",
"micro2=4/(math.factorial(A2[0])*math.factorial(A2[1])*math.factorial(A2[2])*math.factorial(A2[3])*math.factorial(g1-A2[0])*math.factorial(g2-A2[1])*math.factorial(g3-A2[2])*math.factorial(g4-A2[3])) \n",
"micro5=4/(math.factorial(A5[0])*math.factorial(A5[1])*math.factorial(A5[2])*math.factorial(A5[3])*math.factorial(g1-A5[0])*math.factorial(g2-A5[1])*math.factorial(g3-A5[2])*math.factorial(g4-A5[3])) \n",
"\n",
"print\"No. of macrostates is given by:\"\n",
"print A2,\"=\",micro2,\"\\n\",A5,\"=\",micro5,\"\\n\"\n",
"\n",
"print\"\\nMost probable macrostate is\\n \"\n",
"if(micro2>=micro5) :\n",
" print A2\n",
" \n",
"if(micro5>=micro2) :\n",
" print A5 \n",
" \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"(i)Possible macrostates are\n",
" \n",
"[2, 0, 0, 2] [1, 1, 1, 1] [0, 3, 0, 1] [1, 0, 3, 0] [0, 2, 2, 0]\n",
"No. of macrostates is given by:\n",
"[2, 0, 0, 2] = 6 \n",
"[1, 1, 1, 1] = 96 \n",
"[0, 3, 0, 1] = 32 \n",
"[1, 0, 3, 0] = 32 \n",
"[0, 2, 2, 0] = 96 \n",
"\n",
"Most probable macrostates are\n",
" \n",
"[1, 1, 1, 1]\n",
"[0, 2, 2, 0]\n",
"\n",
"(ii)Possible macrostates are\n",
" \n",
"[2, 0, 0, 2] [0, 3, 0, 1] [0, 3, 0, 1] [1, 0, 3, 0] [0, 2, 2, 0]\n",
"No. of macrostates is given by:\n",
"[2, 0, 0, 2] = 1 \n",
"[1, 1, 1, 1] = 4 \n",
"[0, 3, 0, 1] = 4 \n",
"[1, 0, 3, 0] = 4 \n",
"[0, 2, 2, 0] = 9 \n",
"\n",
"\n",
"Most probable macrostate is\n",
" \n",
"[0, 2, 2, 0]\n",
"\n",
"(iii)Possible macrostates are\n",
" \n",
"[1, 1, 1, 1] [0, 2, 2, 0]\n",
"No. of macrostates is given by:\n",
"[1, 1, 1, 1] = 4 \n",
"[0, 2, 2, 0] = 1 \n",
"\n",
"\n",
"Most probable macrostate is\n",
" \n",
"[1, 1, 1, 1]\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:3,Page no:262"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#vairable initialization\n",
"N=4 #no. of particles\n",
"A1=(4,0) #possible macrostate\n",
"A2=(3,1) #possible macrostate\n",
"A3=(2,2) #possible macrostate\n",
"A4=(1,3) #possible macrostate\n",
"A5=(0,4) #possible macrostate\n",
"import math\n",
"#calculation\n",
"print\"\\nPossible macrostates are\\n \"\n",
"print A1,A2,A3,A4,A5\n",
"micro1=math.factorial(N)/(math.factorial(A1[0])*math.factorial(A1[1])) #no. of microstate corresponding to macrostate1\n",
"micro2=math.factorial(N)/(math.factorial(A2[0])*math.factorial(A2[1])) #no. of microstate corresponding to macrostate2\n",
"micro3=math.factorial(N)/(math.factorial(A3[0])*math.factorial(A3[1])) #no. of microstate corresponding to macrostate3\n",
"micro4=math.factorial(N)/(math.factorial(A4[0])*math.factorial(A4[1])) #no. of microstate corresponding to macrostate4\n",
"micro5=math.factorial(N)/(math.factorial(A5[0])*math.factorial(A5[1])) #no. of microstate corresponding to macrostate5\n",
"print\"No.of macrostates is:\"\n",
"print A1,\"=\",micro1,\"\\n\",A2,\"=\",micro2,\"\\n\",A3,\"=\",micro3,\"\\n\",A4,\"=\",micro4,\"\\n\",A5,\"=\",micro5,\"\\n\"\n",
"\n",
"\n",
"print\"\\nTotal no. of microstates are \",micro1+micro2+micro3+micro4+micro5\n",
"print\"\\nMost probable macrostate is\\n \" \n",
"if(micro1>=micro2 and micro1>=micro3 and micro1>=micro4 and micro1>=micro5) :\n",
" print A1\n",
"if(micro2>=micro1 and micro2>=micro3 and micro2>=micro4 and micro2>=micro5) :\n",
" print A2\n",
"if(micro3>=micro1 and micro3>=micro2 and micro3>=micro4 and micro3>=micro5):\n",
" print A3\n",
"if(micro4>=micro1 and micro4>=micro2 and micro4>=micro3 and micro4>=micro5):\n",
" print A4\n",
"if(micro5>=micro1 and micro5>=micro2 and micro5>=micro3 and micro5>=micro4):\n",
" print A5\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Possible macrostates are\n",
" \n",
"(4, 0) (3, 1) (2, 2) (1, 3) (0, 4)\n",
"No.of macrostates is:\n",
"(4, 0) = 1 \n",
"(3, 1) = 4 \n",
"(2, 2) = 6 \n",
"(1, 3) = 4 \n",
"(0, 4) = 1 \n",
"\n",
"\n",
"Total no. of microstates are 16\n",
"\n",
"Most probable macrostate is\n",
" \n",
"(2, 2)\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:4,Page no:263"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"N=4 #no. of particles\n",
"A1=(1,0,1,2) #possible macrostate\n",
"A2=(0,2,0,2) #possible macrostate\n",
"A3=(0,1,2,1) #possible macrostate\n",
"A4=(0,0,4,0) #possible macrostate\n",
"\n",
"#calculation\n",
"print\"\\nPossible macrostates are\\n \"\n",
"print A1,A2,A3,A4\n",
"micro1=math.factorial(N)/(math.factorial(A1[0])*math.factorial(A1[1])*math.factorial(A1[2])*math.factorial(A1[3])) #no. of microstate corresponding to macrostate1\n",
"micro2=math.factorial(N)/(math.factorial(A2[0])*math.factorial(A2[1])*math.factorial(A2[2])*math.factorial(A2[3])) #no. of microstate corresponding to macrostate2\n",
"micro3=math.factorial(N)/(math.factorial(A3[0])*math.factorial(A3[1])*math.factorial(A3[2])*math.factorial(A3[3])) #no. of microstate corresponding to macrostate3\n",
"micro4=math.factorial(N)/(math.factorial(A4[0])*math.factorial(A4[1])*math.factorial(A4[2])*math.factorial(A4[3])) #no. of microstate corresponding to macrostate4\n",
"print\"\\nThe number of microstates belonging to the above macrostates is:\"\n",
"print A1,\"=\",micro1,\"\\n\",A2,\"=\",micro2,\"\\n\",A3,\"=\",micro3,\"\\n\",A4,\"=\",micro4,\"\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Possible macrostates are\n",
" \n",
"(1, 0, 1, 2) (0, 2, 0, 2) (0, 1, 2, 1) (0, 0, 4, 0)\n",
"\n",
"The number of microstates belonging to the above macrostates is:\n",
"(1, 0, 1, 2) = 12 \n",
"(0, 2, 0, 2) = 6 \n",
"(0, 1, 2, 1) = 12 \n",
"(0, 0, 4, 0) = 1 \n",
"\n"
]
}
],
"prompt_number": 17
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:5,Page no:264"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def p(A): #function to calculate probability\n",
" probability=1 \n",
" i=0\n",
" for i in range(0,7):\n",
" probability=probability*(math.factorial(A[i]+2))/(2*math.factorial(A[i])) \n",
" return(probability)\n",
"#Variable declaration\n",
"A1=(5,0,0,0,0,0,1) #possible macrostate\n",
"A2=(4,1,0,0,0,1,0) #possible macrostate\n",
"A3=(4,0,1,0,1,0,0) #possible macrostate\n",
"A4=(3,2,0,0,1,0,0) #possible macrostate\n",
"A5=(4,0,0,2,0,0,0) #possible macrostate\n",
"A6=(3,1,1,1,0,0,0) #possible macrostate\n",
"A7=(2,3,0,1,0,0,0) #possible macrostate\n",
"A8=(3,0,3,0,0,0,0) #possible macrostate\n",
"A9=(2,2,2,0,0,0,0) #possible macrostate\n",
"A10=(1,4,1,0,0,0,0) #possible macrostate\n",
"A11=(0,6,0,0,0,0,0) #possible macrostate\n",
"\n",
"#calculation\n",
"p1=p(A1) #Thermodynamic probability of macrostate 1\n",
"p2=p(A2) #Thermodynamic probability of macrostate 2\n",
"p3=p(A3) #Thermodynamic probability of macrostate 3\n",
"p4=p(A4) #Thermodynamic probability of macrostate 4\n",
"p5=p(A5) #Thermodynamic probability of macrostate 5\n",
"p6=p(A6) #Thermodynamic probability of macrostate 6\n",
"p7=p(A7) #Thermodynamic probability of macrostate 7\n",
"p8=p(A8) #Thermodynamic probability of macrostate 8\n",
"p9=p(A9) #Thermodynamic probability of macrostate 9\n",
"p10=p(A10) #Thermodynamic probability of macrostate 10\n",
"p11=p(A11) #Thermodynamic probability of macrostate 11\n",
"\n",
"print\"\\nP1 =\",p1,\"P2 =\",p2,\"P3 =\",p3,\"P4 =\",p4,\"P5 =\",p5,\"P6 =\",p6,\"P7 =\",p7,\"P8 =\",p8,\"P9 =\",p9,\"P10 =\",p10,\"P11 =\",p11\n",
"print\"\\nThermodyanmic probability of the system = \",p1+p2+p3+p4+p5+p6+p7+p8+p9+p10+p11\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"P1 = 63 P2 = 135 P3 = 135 P4 = 180 P5 = 90 P6 = 270 P7 = 180 P8 = 100 P9 = 216 P10 = 135 P11 = 28\n",
"\n",
"Thermodyanmic probability of the system = 1532\n"
]
}
],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example no:6,Page no:265"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"def p(A): #function to calculate no. of microstates\n",
" micro=1 \n",
" i=1\n",
" for i in range(0,5):\n",
" micro=micro*(6/(math.factorial(A[i])*math.factorial(3-A[i]))) \n",
" return(micro)\n",
"#Variable declaration\n",
"A1=(3,2,0,0,1) #possible macrostate\n",
"A2=(3,1,1,1,0) #possible macrostate\n",
"A3=(2,3,0,1,0) #possible macrostate\n",
"A4=(3,0,3,0,0) #possible macrostate\n",
"A5=(2,2,2,0,0) #possible macrostate\n",
"\n",
"#calculation\n",
"p1=p(A1) #no. of microstates\n",
"p2=p(A2) #no. of microstates\n",
"p3=p(A3) #no. of microstates\n",
"p4=p(A4) #no. of microstates\n",
"p5=p(A5) #no. of microstates\n",
"\n",
"print\"No.of microstates associated with macrostates are :\"\n",
"print A1,\"=\",p1,\"\\n\",A2,\"=\",p2,\"\\n\",A3,\"=\",p3,\"\\n\",A4,\"=\",p4,\"\\n\",A5,\"=\",p5,\"\\n\"\n",
"print\"\\nThe thermodynamic probability of the system = \",(p1+p2+p3+p4+p5)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"No.of microstates associated with macrostates are :\n",
"(3, 2, 0, 0, 1) = 9 \n",
"(3, 1, 1, 1, 0) = 27 \n",
"(2, 3, 0, 1, 0) = 9 \n",
"(3, 0, 3, 0, 0) = 1 \n",
"(2, 2, 2, 0, 0) = 27 \n",
"\n",
"\n",
"The thermodynamic probability of the system = 73\n"
]
}
],
"prompt_number": 27
}
],
"metadata": {}
}
]
}
|