summaryrefslogtreecommitdiff
path: root/635/CH1/EX1.2/Ch01Ex2.sci
blob: 50be14759d281c514ce8aa7c20cef768944fac44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Scilab Code Ex1.2 Primitive unit cell: Page-4 (2010)
a = 3, b = 3;     // Lattice translation vectors along X and Y direction, angstrom
c_bar = 3;    // Assumed translation vector along Z direction, angstrom
c = 1.5*(a+b+c_bar);    // Real translation vector along Z direction, angstrom
printf("\n%3.1f is the body centered position of a cubic unit cell defined by the primitive translation vectors a, b and c_bar.", c);
V_con = a^3;    // Volume of conventional unit cell, metre cube
V_primitive = 1/2*V_con;    // Volume of primitive unit cell, metre cube
printf("\nThe volume of conventional unit cell: %2d angstrom cube", V_con);
printf("\nThe volume of primitive unit cell: %4.1f angstrom cube", V_primitive);

// Result 
// 13.5 is the body centered position of a cubic unit cell defined by the primitive translation vectors a, b and c_bar.
// The volume of conventional unit cell: 27 angstrom cube
// The volume of primitive unit cell: 13.5 angstrom cube