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.4/Ex7_4.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.4/Ex7_4.sce')
-rwxr-xr-x | 2411/CH7/EX7.4/Ex7_4.sce | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/2411/CH7/EX7.4/Ex7_4.sce b/2411/CH7/EX7.4/Ex7_4.sce new file mode 100755 index 000000000..b7c8a446e --- /dev/null +++ b/2411/CH7/EX7.4/Ex7_4.sce @@ -0,0 +1,24 @@ +// Scilab Code Ex7.4: Page-377 (2008)
+clc; clear;
+function p = find_cell_type(x)
+ if x == 1 then
+ p = 'simple cubic';
+ end
+ if x == 2 then
+ p = 'body centered';
+ end
+ if x == 4 then
+ p = 'face centered';
+ end
+endfunction
+M = 130; // Gram atomic weight of Cs, g/mole
+N = 6.023e+023; // Avogadro's number
+rho = 2; // Density of Cs, g/cc
+a = 6e-008; // Distance between two adjacent atoms in the Cs, cm
+m = M/N; // Mass of each Cs atom, g
+x = rho*a^3*N/M; // Number of Cs atoms in cubic unit cell
+c_type = find_cell_type(int(x)); // Call function to determine the type of cell
+printf("\nThe cubic unit cell of Cs is %s.", c_type);
+
+// Result
+// The cubic unit cell of Cs is body centered.
\ No newline at end of file |