diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1646/CH3/EX3.5/Ch03Ex5.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1646/CH3/EX3.5/Ch03Ex5.sce')
-rwxr-xr-x | 1646/CH3/EX3.5/Ch03Ex5.sce | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/1646/CH3/EX3.5/Ch03Ex5.sce b/1646/CH3/EX3.5/Ch03Ex5.sce new file mode 100755 index 000000000..44feac180 --- /dev/null +++ b/1646/CH3/EX3.5/Ch03Ex5.sce @@ -0,0 +1,34 @@ +// Scilab Code Ex3.5: Page:134 (2011)
+clc;clear;
+n = 5; // Number of distinguishable particles which are to be distributed among cells
+n1 = [5 4 3 3 2]; // Possible occupancy of particles in first cell
+n2 = [0 1 2 1 2]; // Possible occupancy of particles in second cell
+n3 = [0 0 0 1 1]; // Possible occupancy of particles in third cell
+BIG_W = 0;
+printf("\n_____________________________________");
+printf("\nn1 n2 n3 5/(n1!n2!n3!)");
+printf("\n_____________________________________");
+for i = 1:1:5
+W = factorial(n)/(factorial(n1(i))*factorial(n2(i))*factorial(n3(i)));
+if BIG_W < W then
+ BIG_W = W;
+ ms = [n1(i) n2(i) n3(i)];
+end
+printf("\n%d %d %d %d", n1(i), n2(i), n3(i), W);
+end
+printf("\n_____________________________________");
+printf("\nThe macrostates of most probable distribution with thermodynamic probability %d are:", BIG_W);
+printf("\n(%d, %d, %d), (%d, %d, %d) and (%d, %d, %d)", ms(1), ms(2), ms(3), ms(2), ms(3), ms(1),ms(3), ms(1), ms(2));
+
+// Result
+// _____________________________________
+// n1 n2 n3 5/(n1!n2!n3!)
+// _____________________________________
+//5 0 0 1
+// 4 1 0 5
+// 3 2 0 10
+// 3 1 1 20
+// 2 2 1 30
+// _____________________________________
+// The macrostates of most probable distribution with thermodynamic probability 30 are:
+// (2, 2, 1), (2, 1, 2) and (1, 2, 2)
|