summaryrefslogtreecommitdiff
path: root/2912/CH2/EX2.3/Ex2_3.sce
blob: 0d8d5de9cf078e78c222cd481b58878ce590e0c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//chapter 2
//example 2.3
//calculate lattice constant
//page 41-42
clear;
clc;
//given
N=6.02E26; // in /Kg-atom (Avogadro's number)
n=2; // number of molecules per unit cell for bcc lattice
M=55.85; // in Kg/Kg-atom (atomic weight of Iron)
p=7860; // in Kg/m^3 (density)
//calculate
a=nthroot((n*M/(N*p)),3);
printf('\nThe lattice constant is\ta=%1.3E m',a); 
a=a*1E10; // changing unit to Angstrom
printf('\n\t\t\ta=%.3f Angstrom',a);