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 /2411/CH7/EX7.1/Ex7_1.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 '2411/CH7/EX7.1/Ex7_1.sce')
-rwxr-xr-x | 2411/CH7/EX7.1/Ex7_1.sce | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/2411/CH7/EX7.1/Ex7_1.sce b/2411/CH7/EX7.1/Ex7_1.sce new file mode 100755 index 000000000..fc030887e --- /dev/null +++ b/2411/CH7/EX7.1/Ex7_1.sce @@ -0,0 +1,23 @@ +// Scilab Code Ex7.1: Page-376 (2008)
+clc; clear;
+a = poly(0, 'a'); // Lattice parameter for a cubic unit cell, m
+// For simple cubic cell
+n = 1; // Number of atoms per simple cubic unit cell
+r = a/2; // Atomic radius for a simple cubic cell, m
+f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a simple cubic cell
+printf("\nFor simple cubic cell, f = %s percent", f);
+// For face centered cubic cell
+n = 2; // Number of atoms per face centered cubic unit cell
+r = sqrt(3)/4*a; // Atomic radius for a face centered cubic cell, m
+f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a face centered cubic cell
+printf("\nFor face centered cubic cell, f = %s percent", f);
+// For body centered cubic cell
+n = 4; // Number of atoms per body centered cubic unit cell
+r = a/(2*sqrt(2)); // Atomic radius for a body centered cubic cell, m
+f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a body centered cubic cell
+printf("\nFor body centered cubic cell, f = %s percent", f);
+
+// Result
+// For simple cubic cell, f = 52 percent
+// For face centered cubic cell, f = 68 percent
+// For body centered cubic cell, f = 74 percent
\ No newline at end of file |