summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb
diff options
context:
space:
mode:
authorPrashant S2020-04-14 10:25:32 +0530
committerGitHub2020-04-14 10:25:32 +0530
commit06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch)
tree2b1df110e24ff0174830d7f825f43ff1c134d1af /Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb
parentabb52650288b08a680335531742a7126ad0fb846 (diff)
parent476705d693c7122d34f9b049fa79b935405c9b49 (diff)
downloadall-scilab-tbc-books-ipynb-master.tar.gz
all-scilab-tbc-books-ipynb-master.tar.bz2
all-scilab-tbc-books-ipynb-master.zip
Merge pull request #1 from prashantsinalkar/masterHEADmaster
Initial commit
Diffstat (limited to 'Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb')
-rw-r--r--Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb594
1 files changed, 594 insertions, 0 deletions
diff --git a/Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb b/Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb
new file mode 100644
index 0000000..30b7e25
--- /dev/null
+++ b/Engineering_Physics_by_D_C_Ghosh/7-Classical_Statistics_and_Quantum_Statistics.ipynb
@@ -0,0 +1,594 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Classical Statistics and Quantum Statistics"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10: Interplanar_spacing_for_a_set_of_planes_in_a_cubic_lattice.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.10: Page-380 (2008)\n",
+"clc; clear;\n",
+"h = 3; k = 2; l = 1; // Miller Indices for planes in a cubic crystal\n",
+"a = 4.21D-10; // Interatomic spacing, m\n",
+"d = a/(h^2+k^2+l^2)^(1/2); // The interplanar spacing for cubic crystals, m\n",
+"printf('\nThe interplanar spacing between consecutive (321) planes = %3.1e m', d);\n",
+"\n",
+"// Result\n",
+"// The interplanar spacing between consecutive (321) planes = 1.1e-010 m "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.11: Determining_Planck_constant_from_given_set_of_X_ray_data.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.11: Page-380 (2008)\n",
+"clc; clear;\n",
+"e = 1.6e-019; // The energy equivalent of 1 eV, J\n",
+"c = 3e+008; // Speed of light in vacuum, m/s\n",
+"V = [30 44 50 200]; // Operating voltages of X ray, kV\n",
+"lambda_min = [0.414 0.284 0.248 0.062]; // Minimum wavelengths of emitted continuous X rays, angstrom\n",
+"for i = 1:1:4\n",
+" h = e*V(i)*1e+003*lambda_min(i)*1e-010/c; // Planck's constant, Js\n",
+" printf('\nFor V = %d kV and lambda_min = %5.3f angstrom, h = %4.2e Js', V(i), lambda_min(i), h);\n",
+"end\n",
+" \n",
+"// Result\n",
+"// For V = 30 kV and lambda_min = 0.414 angstrom, h = 6.62e-034 Js\n",
+"// For V = 44 kV and lambda_min = 0.284 angstrom, h = 6.66e-034 Js\n",
+"// For V = 50 kV and lambda_min = 0.248 angstrom, h = 6.61e-034 Js\n",
+"// For V = 200 kV and lambda_min = 0.062 angstrom, h = 6.61e-034 Js "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.12: Maximum_speed_of_striking_electron_and_the_shortest_wavelength_of_X_ray_produced.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.12: Page-381 (2008)\n",
+"clc; clear;\n",
+"e = 1.6e-019; // The energy equivalent of 1 eV, J\n",
+"m = 9.11e-031; // Rest mass of an electron, kg\n",
+"h = 6.62e-034; // Planck's constant, Js\n",
+"c = 3e+008; // Speed of light in vacuum, m/s\n",
+"V = [20 100]; // Operating voltages of X ray, kV\n",
+"for i = 1:1:2\n",
+" v = sqrt(2*e*V(i)*1e+003/m); // Maximum striking speed of the electron, m/s\n",
+" lambda_min = c*h/(e*V(i)*1e+003*1e-010); // Minimum wavelength of emitted continuous X rays, angstrom\n",
+" printf('\nFor V = %d kV:', V(i));\n",
+" printf('\nThe maximum striking speed of the electron = %5.2e m/s', v);\n",
+" printf('\nThe minimum wavelength of emitted continuous X rays = %5.3f angstrom\n', lambda_min);\n",
+"end\n",
+" \n",
+"// Result\n",
+"// For V = 20 kV:\n",
+"// The maximum striking speed of the electron = 8.38e+007 m/s\n",
+"// The minimum wavelength of emitted continuous X rays = 0.621 angstrom\n",
+"//\n",
+"// For V = 100 kV:\n",
+"// The maximum striking speed of the electron = 1.87e+008 m/s\n",
+"// The minimum wavelength of emitted continuous X rays = 0.124 angstrom\n",
+"// There are small variation in the answers as approximations are used in the text\n",
+" "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.13: Interatomic_spacing_using_Bragg_relation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.13: Page-381 (2008)\n",
+"clc; clear;\n",
+"n = 1; // Order of diffraction\n",
+"lambda = 1.75e-010; // Wavelength of X rays, m\n",
+"h = 1, k = 1, l = 1; // Miller indices for the set of planes\n",
+"theta = 30; // Bragg's angle, degree\n",
+"// As from Bragg's law, 2*d*sind(theta) = n*lambda and d = a/sqrt(h^2+k^2+l^2). solving for a we have\n",
+"a = sqrt(h^2+k^2+l^2)*n*lambda/(2*sind(theta)*1e-010); // Interatomic spacing of the crystal, angstrom\n",
+"printf('\nThe interatomic spacing of the crystal = %5.3f angstrom', a);\n",
+"\n",
+"// Result\n",
+"// The interatomic spacing of the crystal = 3.031 angstrom "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.14: Value_of_Planck_constant_from_Bragg_relation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.14: Page-382 (2008)\n",
+"clc; clear;\n",
+"e = 1.6e-019; // The energy equivalent of 1 eV, J\n",
+"c = 3e+008; // Speed of light in vacuum, m/s\n",
+"n = 1; // Order of diffraction\n",
+"d = 2.82e-010; // Interplanar spacing, m\n",
+"V = 9.1e+003; // Operating voltage of X rays\n",
+"theta = 14; // Bragg's angle, degree\n",
+"lambda = 2*d*sind(theta)/n; // Wavelength of X rays, m\n",
+"nu = c/lambda; // Frequency of X rays, Hz\n",
+"h = e*V/nu; // Planck's constant, Js\n",
+"printf('\nThe value of Planck constant, h = %4.2e Js', h);\n",
+"\n",
+"// Result\n",
+"// The value of Planck constant, h = 6.62e-034 Js "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.15: Diffraction_of_X_rays_from_a_crystal.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.15: Page-382 (2008)\n",
+"clc; clear;\n",
+"e = 1.6e-019; // The energy equivalent of 1 eV, J\n",
+"c = 3e+008; // Speed of light in vacuum, m/s\n",
+"lambda = 0.5e-010; // Wavelength of X rays, m\n",
+"theta = 5; // Bragg's angle, degree\n",
+"n = 1; // Order of diffraction\n",
+"d = n*lambda/(2*sind(theta)*1e-010); // Interplanar spacing, angstrom\n",
+"n = 2; // Ordr of diffraction\n",
+"theta1 = asind(n*lambda/(2*d*1e-010)); // Angle at which the second maximum occur, degree\n",
+"printf('\nThe spacing between adjacent planes of the crystal = %4.2f angstrom', d);\n",
+"printf('\nThe angle at which the second maximum occur = %5.2f degree', theta1);\n",
+"\n",
+"// Result\n",
+"// The spacing between adjacent planes of the crystal = 2.87 angstrom\n",
+"// The angle at which the second maximum occur = 10.04 degree "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.16: Wavelength_of_X_rays_from_grating_space_of_the_rock_salt.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.16: Page-383 (2008)\n",
+"clc; clear;\n",
+"M = 58.5 // Gram atomic mass of NaCl, kg/mole\n",
+"N = 6.023e+026; // Avogadro's number per kmol\n",
+"rho = 2.17e+003; // Density of NaCl, kg/metre-cube\n",
+"m = M/N; // Mass of each NaCl molecule, g\n",
+"V = m/rho; // Volume of each NaCl molecule, metre-cube\n",
+"d = (V/2)^(1/3)/1e-010; // Atomic apacing in the NaCl crystal, angstrom\n",
+"theta = 26; // Bragg's angle, degree\n",
+"n = 2; // Order of diffraction\n",
+"lambda = 2*d*sind(theta)/n; // Wavelength of X rays, m\n",
+"printf('\nThe grating spacing of rock salt = %4.2f angstrom', d);\n",
+"printf('\nThe wavelength of X rays = %4.2f angstrom', lambda);\n",
+"\n",
+"// Result\n",
+"// The grating spacing of rock salt = 2.82 angstrom\n",
+"// The wavelength of X rays = 1.24 angstrom "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.17: Diffraction_of_X_rays_by_the_calcite_crystal.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.17: Page-383 (2008)\n",
+"clc; clear;\n",
+"d = 3.02945e-010; // Atomic apacing in the calcite crystal, m\n",
+"lambda_alpha = 0.563e-010; // Wavelength of the K-alpha line of Ag, m\n",
+"n = 1; // Order of diffraction\n",
+"theta = asind(n*lambda_alpha/(2*d)); // Angle of reflection for the first order, degree\n",
+"theta_max = 90; // Angle of reflection for the highest order, degree\n",
+"n = 2*d*sind(theta_max)/lambda_alpha; // The highest order for which the line may be observed\n",
+"printf('\nThe angle of reflection for the first order = %4.2f degree', theta);\n",
+"printf('\nThe highest order for which the line may be observed = %d', n);\n",
+"\n",
+"// Result\n",
+"// The angle of reflection for the first order = 5.33 degree\n",
+"// The highest order for which the line may be observed = 10 "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.18: Interatomic_spacing_for_given_crystal_planes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.18: Page-384 (2008)\n",
+"clc; clear;\n",
+"lambda = 1.8e-010; // Wavelength of the X rays, m\n",
+"n = 1; // Order of diffraction\n",
+"theta = 60; // Angle of diffraction for the first order, degree\n",
+"d = n*lambda/(2*sind(theta)); // Interplanar spacing, m\n",
+"// Since for a simple cubic lattice, d_111 = d = a/sqrt(3), solving for a\n",
+"a = sqrt(3)*d; // The interatomic spacing for the given crystal planes, m\n",
+"printf('\nThe interatomic spacing for the given crystal planes, a = %3.1f angstrom', a/1e-010);\n",
+"\n",
+"// Result\n",
+"// The interatomic spacing for the given crystal planes, a = 1.8 angstrom "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.19: Smallest_angle_between_the_crystal_plane_and_the_X_ray_beam.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.19: Page-384 (2008)\n",
+"clc; clear;\n",
+"function [d, m] = deg2degmin(theta)\n",
+" d = int(theta);\n",
+" m = (theta-d)*60;\n",
+"endfunction\n",
+"h = 6.626e-034; // Planck's constant, Js\n",
+"e = 1.6e-019; // The energy equivalent of 1 eV, J\n",
+"c = 3e+008; // Speed of light in vacuum, m/s\n",
+"V = 50e+003; // Operating voltage of X ray, V\n",
+"lambda_min = h*c/(e*V); // Minimum wavelength of emitted continuous X rays, angstrom\n",
+"n = 1; // Order of diffraction\n",
+"d = 3.02945e-010; // Interplanar spacing, m\n",
+"theta = asind(n*lambda_min/(2*d)); // The smallest angle between the crystal plane and the X ray beam, degree\n",
+"[deg , m] = deg2degmin(theta);\n",
+"printf('\nThe smallest angle between the crystal plane and the X ray beam = %d degree %d min', deg, m);\n",
+"\n",
+"// Result\n",
+"// The smallest angle between the crystal plane and the X ray beam = 2 degree 21 min "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1: Atomic_packing_fractions_of_SC_FCC_and_BCC_unit_cells.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.1: Page-376 (2008)\n",
+"clc; clear;\n",
+"a = poly(0, 'a'); // Lattice parameter for a cubic unit cell, m\n",
+"// For simple cubic cell\n",
+"n = 1; // Number of atoms per simple cubic unit cell\n",
+"r = a/2; // Atomic radius for a simple cubic cell, m\n",
+"f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a simple cubic cell\n",
+"printf('\nFor simple cubic cell, f = %s percent', f);\n",
+"// For face centered cubic cell\n",
+"n = 2; // Number of atoms per face centered cubic unit cell\n",
+"r = sqrt(3)/4*a; // Atomic radius for a face centered cubic cell, m\n",
+"f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a face centered cubic cell\n",
+"printf('\nFor face centered cubic cell, f = %s percent', f);\n",
+"// For body centered cubic cell\n",
+"n = 4; // Number of atoms per body centered cubic unit cell\n",
+"r = a/(2*sqrt(2)); // Atomic radius for a body centered cubic cell, m\n",
+"f = pol2str(int(numer(n*4/3*%pi*r^3/a^3)*100)); // Atomic packing fraction for a body centered cubic cell\n",
+"printf('\nFor body centered cubic cell, f = %s percent', f);\n",
+"\n",
+"// Result\n",
+"// For simple cubic cell, f = 52 percent\n",
+"// For face centered cubic cell, f = 68 percent\n",
+"// For body centered cubic cell, f = 74 percent "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3: Distance_between_two_adjacent_atoms_in_the_NaCl.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.3: Page-377 (2008)\n",
+"clc; clear;\n",
+"M = 58.46; // Gram atomic mass of NaCl, g/mole\n",
+"N = 6.023e+023; // Avogadro's number\n",
+"rho = 2.17; // Density of NaCl, g/cc\n",
+"m = M/N; // Mass of each NaCl molecule, g\n",
+"n = rho/m; // Number of NaCl molecules per unit volume, molecules/cc\n",
+"N = 2*n; // Number of atoms per unit volume, atoms/cc\n",
+"a = (1/N)^(1/3); // Distance between two adjacent atoms in the NaCl, cm\n",
+"printf('\nThe distance between two adjacent atoms in the NaCl = %4.2f angstrom', a/1e-008);\n",
+"\n",
+"// Result\n",
+"// The distance between two adjacent atoms in the NaCl = 2.82 angstrom "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4: Type_of_unit_cell_of_Cs.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.4: Page-377 (2008)\n",
+"clc; clear;\n",
+"function p = find_cell_type(x)\n",
+" if x == 1 then\n",
+" p = 'simple cubic';\n",
+" end \n",
+" if x == 2 then\n",
+" p = 'body centered';\n",
+" end \n",
+" if x == 4 then \n",
+" p = 'face centered'; \n",
+" end\n",
+"endfunction\n",
+"M = 130; // Gram atomic weight of Cs, g/mole\n",
+"N = 6.023e+023; // Avogadro's number\n",
+"rho = 2; // Density of Cs, g/cc\n",
+"a = 6e-008; // Distance between two adjacent atoms in the Cs, cm\n",
+"m = M/N; // Mass of each Cs atom, g\n",
+"x = rho*a^3*N/M; // Number of Cs atoms in cubic unit cell\n",
+"c_type = find_cell_type(int(x)); // Call function to determine the type of cell\n",
+"printf('\nThe cubic unit cell of Cs is %s.', c_type);\n",
+"\n",
+"// Result\n",
+"// The cubic unit cell of Cs is body centered. "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5: Miller_indices_of_given_planes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.5: Page-378 (2008)\n",
+"clc; clear;\n",
+"m = 2; n = 3; p = 6; // Coefficients of intercepts along three axes\n",
+"m_inv = 1/m; // Reciprocate the first coefficient\n",
+"n_inv = 1/n; // Reciprocate the second coefficient\n",
+"p_inv = 1/p; // Reciprocate the third coefficient\n",
+"mul_fact = double(lcm(int32([m,n,p]))); // Find l.c.m. of m,n and p\n",
+"m1 = m_inv*mul_fact; // Clear the first fraction\n",
+"m2 = n_inv*mul_fact; // Clear the second fraction\n",
+"m3 = p_inv*mul_fact; // Clear the third fraction\n",
+"printf('\nThe required miller indices are : (%d %d %d) ', m1,m2,m3);\n",
+"\n",
+"// Result\n",
+"// The required miller indices are : (3 2 1) "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.6: Meaning_of_hkl_notation_of_planes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.6: Page-378 (2008)\n",
+"clc; clear;\n",
+"// For first set (3, 2, 2)\n",
+"m = 3; n = 2; p = 2; // Coefficients of intercepts along three axes\n",
+"m_inv = 1/m; // Reciprocate the first coefficient\n",
+"n_inv = 1/n; // Reciprocate the second coefficient\n",
+"p_inv = 1/p; // Reciprocate the third coefficient\n",
+"mul_fact = double(lcm(int32([m,n,p]))); // Find l.c.m. of m,n and p\n",
+"m1 = m_inv*mul_fact; // Clear the first fraction\n",
+"m2 = n_inv*mul_fact; // Clear the second fraction\n",
+"m3 = p_inv*mul_fact; // Clear the third fraction\n",
+"printf('\nThe plane (%d %d %d) has intercepts %da, %db and %dc on the three axes.', m, n, p, m1, m2, m3);\n",
+"// For second set (1 1 1)\n",
+"m = 1; n = 1; p = 1; // Coefficients of intercepts along three axes\n",
+"m_inv = 1/m; // Reciprocate the first coefficient\n",
+"n_inv = 1/n; // Reciprocate the second coefficient\n",
+"p_inv = 1/p; // Reciprocate the third coefficient\n",
+"mul_fact = double(lcm(int32([m,n,p]))); // Find l.c.m. of m,n and p\n",
+"m1 = m_inv*mul_fact; // Clear the first fraction\n",
+"m2 = n_inv*mul_fact; // Clear the second fraction\n",
+"m3 = p_inv*mul_fact; // Clear the third fraction\n",
+"printf('\nThe plane (%d %d %d) has intercepts a, b and c on the three axes.', m, n, p);\n",
+"\n",
+"// Result\n",
+"// The plane (3 2 2) has intercepts 2a, 3b and 3c on the three axes.\n",
+"// The plane (1 1 1) has intercepts a, b and c on the three axes. "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9: Lengths_of_intercepts_along_y_and_z_axis.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Scilab Code Ex7.9: Page-379 (2008)\n",
+"clc; clear;\n",
+"h = 2; k = 3; l = 1; // Miller indices of the set of planes\n",
+"p = 1/h; // Reciprocate h\n",
+"q = 1/k; // Reciprocate k\n",
+"r = 1/l; // Reciprocate l\n",
+"lx = 1.2; // Intercept cut by plane along x-axis, angstrom\n",
+"a = 1.2, b = 1.8, c = 2; // Primitives of the crystal, angstrom\n",
+"mul_fact = double(lcm(int32([h, k, l]))); // Find l.c.m. of h, k and l\n",
+"pa = mul_fact*p*a; \n",
+"qb = mul_fact*q*b;\n",
+"rc = mul_fact*r*c;\n",
+"ly = lx*qb/pa; // Length of intercept along y-axis\n",
+"lz = lx*rc/pa; // Length of intercept along z-axis\n",
+"printf('\nThe length of intercept along y-axis = %3.1f angstrom', ly);\n",
+"printf('\nThe length of intercept along z-axis = %3.1f angstrom', lz);\n",
+"\n",
+"// Result\n",
+"// The length of intercept along y-axis = 1.2 angstrom\n",
+"// The length of intercept along z-axis = 4.0 angstrom "
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}