{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 1: Crystallography" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_10: calculate_free_electron_concentration.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_10,pg 1-62\n", "\n", "A=63.546 //atomic weight of Cu\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "p=8930 //Density\n", "\n", "n=1.23 //no.of electron per atom\n", "\n", "//density=mass/volume\n", "\n", "//therfore 1/volume=density/mass\n", "\n", "//since electron concentration is needed, let us find out no of atoms/volume(x)\n", "\n", "x=N*p/A\n", "\n", "//now one atom contribute n=1.23 electron\n", "\n", "//therefore x atoms contribute y no of free electron\n", "\n", "y=x*n\n", "\n", "printf('free electron concentration=')\n", "\n", "disp(y)\n", "\n", "printf('electron/m^3')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_11: calculate_Y_and_Z_intercept.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_11,pg 1-62\n", "\n", "//primitive vectors\n", "\n", "a=1.5 //in amstrong unit\n", "\n", "b=2 //in amstrong unit\n", "\n", "c=4 //in amstrong unit\n", "\n", "//miller indices of the plane\n", "\n", "h=3\n", "\n", "k=2\n", "\n", "l=6\n", "\n", "//therefore intercepts are a/h,b/k,c/l\n", "\n", "x=a/h\n", "\n", "y=b/k\n", "\n", "z=c/l\n", "\n", "//this gives intercepts along x axis as x amstrong but it is given that plane cut x axis at 1.2 amstrong .\n", "\n", "t=1.5/x\n", "\n", "//this shows that the plane under consideration is another plane which is parallel to it(to keep miller indices same)\n", "\n", "n=t*y //Y intercept\n", "\n", "p=t*z //Z intercept\n", "\n", "printf(' 1) Y intercept=')\n", "\n", "disp(n)\n", "\n", "printf('amstrong')\n", "\n", "printf(' 2)Z intercept=')\n", "\n", "disp(p)\n", "\n", "printf('amstrong')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_12: calculate_Number_of_atom_per_unit_cell.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_12,pg 1-63\n", "\n", "ro=7.87 //density of metal\n", "\n", "A=55.85 //atomic wt of metal\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "a=2.9*10^-8 //lattice constant of metal\n", "\n", "n=(N*(a^3)*ro)/A\n", "\n", "printf('Number of atom per unit cell of a metal=')\n", "\n", "disp(int32(n))" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_13: calculate_Lattice_constant.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_13,pg 1-63\n", "\n", "n=2 //BCC structure\n", "\n", "ro=9.6*10^2 //density of sodium crystal\n", "\n", "A=23 //atomic weight of sodium crystal\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=((n*A)/(N*ro))^(1/3)\n", "\n", "printf('Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_15: calculate_Number_of_atom_per_unit_cell_and_atomic_radius.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_15,pg 1-64\n", "\n", "ro=2.7*10^3 //density of metal\n", "\n", "A=27 //atomic wt of metal\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=4.05*10^-10 //lattice constant of metal\n", "\n", "n=(N*(a^3)*ro)/A\n", "\n", "printf('1) Number of atom per unit cell of a metal=')\n", "\n", "disp(int32(n))\n", "\n", "r=sqrt(2)*a/4 //radius of metal\n", "\n", "printf('2) atomic radius of a metal=')\n", "\n", "disp(r)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_16: calculate_Lattice_constant_and_APF.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_16,pg 1-64\n", "\n", "n=2 //BCC structure\n", "\n", "ro=5.98*10^3 //density of chromium\n", "\n", "A=50 //atomic wt of chromium\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=((n*A)/(N*ro))^(1/3)\n", "\n", "printf(' 1) Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('m')\n", "\n", "//for BCC\n", "\n", "r=sqrt(3)*a/4 //radius of chromium\n", "\n", "APF=(n*(4/3)*%pi*(r^3))/(a^3)\n", "\n", "printf(' 2) A.P.F. for chromium=')\n", "\n", "disp(APF)\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_17: calculate_Lattice_constant.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_17,pg 1-65\n", "\n", "n=4 //FCC structure\n", "\n", "ro=6250 //density\n", "\n", "M=60.2 //molecular weight\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=((n*M)/(N*ro))^(1/3)\n", "\n", "printf('Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_19: calculate_wavlength.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_19,pg 1-66\n", "\n", "a=2.82*10^-9 //lattice constant\n", "\n", "n=2 //FCC crystal\n", "\n", "t=17.167 //glancing angle in degree\n", "\n", "q=%pi/180*t //glancing angle in radians\n", "\n", "//assuming reflection in (1,0,0) plane\n", "\n", "h=1\n", "\n", "k=0\n", "\n", "l=0\n", "\n", "d=a/sqrt(h^2+k^2+l^2)\n", "\n", "//using Bragg's law , 2*d*sin(q)=n*la\n", "\n", "la=2*d*sin(q)/n\n", "\n", "printf('wavlength of X-ray=')\n", "\n", "disp(la)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_1: calculate_lattice_constant.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_1,pg 1-58\n", "\n", "n=4 //FCC structure\n", "\n", "ro=2180 //density of NaCl\n", "\n", "M=23+35.5 //molecular weight of NaCl\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=((n*M)/(N*ro))^(1/3)\n", "\n", "printf('Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_20: calculate_Lattice_constant_and_atomic_radius.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_20,pg 1-66\n", "\n", "n=8 //Diamond structure\n", "\n", "ro=2.33*10^3 //density of diamond\n", "\n", "M=28.9 //atomic weight of diamond\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "a=((n*M)/(N*ro))^(1/3)\n", "\n", "printf(' 1) Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('m')\n", "\n", "r=sqrt(3)*a/8 //radius of diamond structure\n", "\n", "printf(' 2) atomic radius of a metal=')\n", "\n", "disp(r)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_21: calculate_mass_of_one_atom.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_21,pg 1-66\n", "\n", "n=2 //BCC structure\n", "\n", "ro=8.57*10^3 //density of chromium\n", "\n", "d=2.86*10^-10 //nearest atoms distance\n", "\n", "//d=sqrt(3)/2*a\n", "\n", "a=2*d/sqrt(3)\n", "\n", "//now use formulae a^3*ro=n*A/N\n", "\n", "//therefore a^3*ro/n=mass of unit cell/(no of atoms pre unit cell)=mass of one atom\n", "\n", "m=a^3*ro/n\n", "\n", "printf('mass of one atom=')\n", "\n", "disp(m)\n", "\n", "printf('kg')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_2: calculate_Lattice_constant_and_diameter.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_2,pg 1-58\n", "\n", "n=4 //FCC structure\n", "\n", "ro=8.9 //density of Cu atom\n", "\n", "A=63.55 //atomic weight of Cu atom\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "a=((n*A)/(N*ro))^(1/3)\n", "\n", "printf(' 1) Lattice constant=')\n", "\n", "disp(a)\n", "\n", "printf('cm')\n", "\n", "r=sqrt(2)*a/4 //radius of Cu atom\n", "\n", "d=2*r //diameter of Cu atom\n", "\n", "printf(' 2) Diameter of Cu atom=')\n", "\n", "disp(d)\n", "\n", "printf('cm')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_3: calculate_Density_of_diamond.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_3,pg 1-59\n", "\n", "n=8 //diamond structure\n", "\n", "A=12.01 //atomic wt\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "a=3.75*10^-8 //lattice constant of diamond\n", "\n", "ro=(n*A)/(N*(a^3))\n", "\n", "printf('Density of diamond=')\n", "\n", "disp(ro)\n", "\n", "printf('gm/cc')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_4: calculate_miller_indices.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_4,pg 1-59\n", "\n", "//intercept of planeare in proportion 3a:4b:infinity (plane parallel to z axis)\n", "\n", "//as a,b and c are basic vectors the proportin of intercepts 3:4:infinity\n", "\n", "//therefore reciprocal\n", "\n", "r1=1/3\n", "\n", "r2=1/4\n", "\n", "r3=0\n", "\n", "//taking LCM\n", "\n", "v=int32([3,4])\n", "\n", "l=double(lcm(v))\n", "\n", "m1=(l*r1)\n", "\n", "m2=(l*r2)\n", "\n", "m3=(l*r3)\n", "\n", "printf('miler indices=')\n", "\n", "disp(m3,m2,m1)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_5: calculate_miller_indices.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_5,pg 1-59\n", "\n", "//intercept of planeare in proportion 3a:-2b:3/2c\n", "\n", "//as a,b and c are basic vectors the proportin of intercepts 3:-2:3/2\n", "\n", "//therefore reciprocal\n", "\n", "r1=1/3\n", "\n", "r2=-1/2\n", "\n", "r3=2/3\n", "\n", "//taking LCM\n", "\n", "v=int32([3,2,3/2])\n", "\n", "l=double(lcm(v))\n", "\n", "m1=(l*r1)\n", "\n", "m2=(l*r2)\n", "\n", "m3=(l*r3)\n", "\n", "printf('miler indices=')\n", "\n", "disp(m3,m2,m1)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_6: calculate_ratio_of_intercepts.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_6,pg 1-59\n", "\n", "//if a plane cut at length m,n,p on the three crystal axes,then\n", "\n", "//m:n:p=xa:yb:zc\n", "\n", "//when primitive vectors of unit cell and numbers x,y,z,are related to miller indices (h,k,l)of the plane by relation\n", "\n", "//1/x:1/y:1/z=h:k:l\n", "\n", "//since a=b=c (crystal is simple cubic)\n", "\n", "//and (h,k,l)=(1,2,3)\n", "\n", "//therefore reciprocal\n", "\n", "r1=1/1\n", "\n", "r2=1/2\n", "\n", "r3=1/3\n", "\n", "//taking LCM\n", "\n", "v=int32([1,2,3])\n", "\n", "l=double(lcm(v))\n", "\n", "m=(l*r1)\n", "\n", "n=(l*r2)\n", "\n", "p=(l*r3)\n", "\n", "printf('ratio of intercepts=')\n", "\n", "disp(m)\n", "\n", "disp(n)\n", "\n", "disp(p)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_7: calculate_y_and_z_intercepts.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_7,pg 1-60\n", "\n", "//primitive vectors\n", "\n", "a=1.2 //in amstrong unit\n", "\n", "b=1.8 //in amstrong unit\n", "\n", "c=2 //in amstrong unit\n", "\n", "//miller indices of the plane\n", "\n", "h=2\n", "\n", "k=3\n", "\n", "l=1\n", "\n", "//therefore intercepts are a/h,b/k,c/l\n", "\n", "x=a/h\n", "\n", "y=b/k\n", "\n", "z=c/l\n", "\n", "//this gives intercepts along x axis as x amstrong but it is given tthat plane cut x axis at 1.2 amstrong .\n", "\n", "t=1.2/x\n", "\n", "//this shows that the plane under consideration is another plane which is parallel to it(to keep miller indices same)\n", "\n", "n=t*y //Y intercept\n", "\n", "p=t*z //Z intercept\n", "\n", "printf(' 1) Y intercept=')\n", "\n", "disp(n)\n", "\n", "printf('amstrong')\n", "\n", "printf(' 2)Z intercept=')\n", "\n", "disp(p)\n", "\n", "printf('amstrong')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_8: calculate_radius.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_8,pg 1-61\n", "\n", "//the interplanar spacing of plane\n", "\n", "h=1\n", "\n", "k=1\n", "\n", "l=0\n", "\n", "d=2 //interpanar spacing in amstrong unit\n", "\n", "//we know that d=a/sqrt(h^2+k^2+l^2) therefore\n", "\n", "a=d*sqrt(h^2+k^2+l^2)\n", "\n", "//for FCC structure\n", "\n", "r=sqrt(2)*a/4\n", "\n", "printf('radius r=')\n", "\n", "disp(r)\n", "\n", "printf('amstrong')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14_9: calculate_density_and_diameter.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_14_9,pg 1-61\n", "\n", "n=4 //for FCC structure\n", "\n", "//the interplanar spacing of plane\n", "\n", "h=1\n", "\n", "k=1\n", "\n", "l=1\n", "\n", "d=2.08*10^-10 //distance\n", "\n", "A=63.54 //atomic weight of Cu\n", "\n", "N=6.023*10^26 //amstrong no\n", "\n", "//we know that d=a/sqrt(h^2+k^2+l^2) therefore\n", "\n", "a=d*sqrt(h^2+k^2+l^2)\n", "\n", "//also (a^3*q)=n*A/N\n", "\n", "q=n*A/(N*a^3)\n", "\n", "printf(' 1)density=')\n", "\n", "disp(q)\n", "\n", "printf('kg/m^3')\n", "\n", "//for FCC structure\n", "\n", "r=sqrt(2)*a/4\n", "\n", "d=r*2\n", "\n", "printf(' 2)radius r=')\n", "\n", "disp(r)\n", "\n", "printf('m')\n", "\n", "printf(' 3)diameter d=')\n", "\n", "disp(d)\n", "\n", "printf('m')\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_10: calculate_wavelength.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_10,pg 1-73\n", "\n", "//for line -A\n", "\n", "n1=1 //1st order maximum\n", "\n", "q1=30 //glancing angle in degree\n", "\n", "//using Bragg's law for line A n1*l1=2*d1*sin(q1)\n", "\n", "//d1=n1*l1/(2*sin(q1))\n", "\n", "//for line B\n", "\n", "l2=0.97 //wavelength in amstrong unit\n", "\n", "n2=3 //1st order maximum\n", "\n", "q2=60 //glancing angle in degree\n", "\n", "//using Bragg's law for line B n2*l2=2*d2*sin(q2)\n", "\n", "//since for both lines A and B we use same plane of same crystal,therefore\n", "\n", "//d1=d2\n", "\n", "//therefore equution became n2*l2=2*n1*l1/(2*sin(q1))*sin(q2)\n", "\n", "//by arranging terms we get\n", "\n", "\n", "l1=n2*l2*2*sind(q1)/(2*n1*sind(q2))\n", "\n", "printf('wavelength of the line A=')\n", "\n", "disp(l1)\n", "\n", "printf('amstrong')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_11: calculate_glancing_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_11,pg 1-74\n", "\n", "n=1 //first order minimum\n", "\n", "d=5.5*10^-11 //atomic spacing\n", "\n", "e=1.6*10^-19 //charge on one electron\n", "\n", "Ee=10*10^3 //energy in eV\n", "\n", "E=e*Ee //energy in Joule\n", "\n", "m=9.1*10^-31 //mass of elelctron\n", "\n", "h=6.63*10^-34 //plank's constant\n", "\n", "l=h/sqrt(2*m*E) //wavelength\n", "\n", "//using Bragg's law\n", "\n", "Q=asind((n*l)/(2*d)) //glancing angle\n", "\n", "printf('glancing angle=')\n", "\n", "disp(Q)\n", "\n", "printf('degree')\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_12: calculate_glancing_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_12,pg 1-74\n", "\n", "a=2.814*10^-10 //lattice constant\n", "\n", "//for rock salt\n", "\n", "d=a/2 //interplaner spacing\n", "\n", "n=1 //first order maximum\n", "\n", "l=1.541*10^-10 //wavelength of rock salt crystal\n", "\n", "//using Bragg's law\n", "\n", "m=asin((n*l)/(2*d)) //glancing angle\n", "\n", "Q=m*180/%pi\n", "\n", "printf('glancing angle=')\n", "\n", "disp(Q)\n", "\n", "printf('degree')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_1: calculate_glancing_angle_and_highest_order.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_1,pg 1-68\n", "\n", "d=4.255*10^-10 //interplaner spacing\n", "\n", "l=1.549*10^-10 //wavelength of x ray\n", "\n", "//part 1: for smallest glancing angle(n=1)\n", "\n", "n1=1\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "q=asind(n1*l/(2*d))\n", "\n", "printf(' 1)glancing angle=')\n", "\n", "disp(q)\n", "\n", "printf('degree')\n", "\n", "//part 2: for highst order\n", "\n", "//for highest order sin(q) not exceed one i.e maximum value is one\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "n2=2*d/l //since sin(q)is one\n", "\n", "printf(' 2)highest order possible =')\n", "\n", "disp(floor(n2))" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_2: calculate_glancing_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_2,pg 1-69\n", "\n", "a=2.125*10^-10 //lattice constant\n", "\n", "d=a/2 //interplaner spacing\n", "\n", "n=2 //second order maximum\n", "\n", "l=0.592*10^-10 //wavelength of rock salt crystal\n", "\n", "//using Bragg's law\n", "\n", "m=asin((n*l)/(2*d)) //glancing angle\n", "\n", "Q=m*180/%pi\n", "\n", "printf('glancing angle=')\n", "\n", "disp(Q)\n", "\n", "printf('degree')\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_3: calculate_second_order_reflection_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_3,pg 1-69\n", "\n", "n1=1 //for 1st order\n", "\n", "n2=2 //for 2nd order\n", "\n", "t=3.4 //angle where 1st order reflection done\n", "\n", "t1=t*%pi/180 //convert degree to radian\n", "\n", "m=sin(t1)\n", "\n", "//but from Bragg's law\n", "\n", "//n*l=2*d*sin(t)\n", "\n", "//for for constant distance(d) and wavelength(l) \n", "\n", "//order(n) is directly proportionl to sine of angle i.e (sin(t))\n", "\n", "//n1/n2=sin(t1)/sin(t2)\n", "\n", "//assume sin(t2)=a\n", "\n", "a=n2/n1*m\n", "\n", "t2=asind(a) //taking sin inverese in degree\n", "\n", "printf('second order reflection take place at an angle=')\n", "\n", "disp(t2)\n", "\n", "printf('degree')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_4: calculate_shortest_wavelength_and_glancing_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_4,pg 1-70\n", "\n", "V=50*10^3 //operating voltage of x-ray\n", "\n", "M=74.6 //molecular weight\n", "\n", "p=1.99*10^3 //density\n", "\n", "n=4 //no of atoms per unit cell(for FCC structure)\n", "\n", "h=6.63*10^-34 //plank's constant\n", "\n", "c=3*10^8 //velocity \n", "\n", "e=1.6*10^-19 //charge on electron\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "//step 1:clculating shortest wavelength\n", "\n", "l=h*c/(e*V)\n", "\n", "printf(' 1)shortest wavelength=')\n", "\n", "disp(l)\n", "\n", "printf('m')\n", "\n", "//step:2 calculating distance(d)\n", "\n", "//now a^3*p=n*M/N therefore,\n", "\n", "a=(n*M/(N*p))^(1/3)\n", "\n", "//since KCl is ionic crystal herefore,\n", "\n", "d=a/2\n", "\n", "//step 3: calculaing glancing angle\n", "\n", "//using Bragg's law\n", "\n", "//n*l=2*d*sin(t)\n", "\n", "//assume sin(t)=a, wavelength is minimum i.e l and n=1\n", "\n", "n=1\n", "\n", "a=n*l/(2*d)\n", "\n", "t=asind(a) //taking sin inverese in degree\n", "\n", "printf(' 2) glancing angle=')\n", "\n", "disp(t)\n", "\n", "printf('degree')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_5: find_possible_solution_of_planes.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_5,pg 1-70\n", "\n", "n=1 //first order maximum\n", "\n", "l=0.82*10^-10 //wavelength of X ray\n", "\n", "qd=7 //glancing angle in degree\n", "\n", "qm=51/60 //glancing angle in minute\n", "\n", "qs=48/3600 //glancing angle in second\n", "\n", "q=qd+qm+qs //total glancin angle in degree\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "d=n*l/(2*sind(q))\n", "\n", "a=3*10^-10 //lattice constant\n", "\n", "//we know that d=a/root(h^2+k^2+l^2)\n", "\n", "//assume root(h^2+k^2+l^2) =m\n", "\n", "//arranging terms we get\n", "\n", "m=a/d\n", "\n", "printf('square root(h^2+k^2+l^2)=') \n", "\n", "disp(int32(m))\n", "\n", "printf('hence possible solutions are (100),(010),(001)')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_6: calculate_cubic_lattice_structure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_6,pg 1-71\n", "\n", "n=1 //first order maximum\n", "\n", "l=%i //wavelength of X ray\n", "\n", "//part 1:for(100)\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "q1=5.4 //glancing angle in degree\n", "\n", "dl1=n*l/(2*sind(q1))\n", "\n", "//part 2:for(110)\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "q2=7.6 //glancing angle in degree\n", "\n", "dl2=n*l/(2*sind(q2))\n", "\n", "//part 3:for(111)\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "q3=9.4 //glancing angle in degree\n", "\n", "dl3=n*l/(2*sind(q3))\n", "\n", "//for taking ratio divide all dl by dl1\n", "\n", "d1=dl1/dl1\n", "\n", "d2=dl2/dl1\n", "\n", "d3=dl3/dl1\n", "\n", "printf('cubic lattice structure is=')\n", "\n", "disp(d3,d2,d1)\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_7: calculate_lattice_constant.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_7,pg 1-71\n", "\n", "n=1 //first order maximum\n", "\n", "l=1.54*10^-10 //wavelength of rock salt crystal\n", "\n", "q=21.7 //glancing angle in degree\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "d=n*l/(2*sind(q))\n", "\n", "printf('lattice constant of crystal=')\n", "\n", "disp(d)\n", "\n", "printf('meter')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_8: calculate_glancing_angle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_8,pg 1-72\n", "\n", "a=2.814*10^-10 //lattice constant\n", "\n", "//the interplanar spacing of plane\n", "\n", "h=1\n", "\n", "k=0\n", "\n", "l=0\n", "\n", "d=a/sqrt(h^2+k^2+l^2)\n", "\n", "n=2 //first order maximum\n", "\n", "l=0.714*10^-10 //wavelength of X-ray crystal\n", "\n", "//using Bragg's law\n", "\n", "m=asin((n*l)/(2*d)) //glancing angle\n", "\n", "Q=m*180/%pi\n", "\n", "printf('glancing angle=')\n", "\n", "disp(Q)\n", "\n", "printf('degree')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15_9: calculate_wavelength_and_glancing_angle_and_highest_order.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_15_9,pg 1-72\n", "\n", "d=2.82*10^-10 //interplaner spacing\n", "\n", "t=10 //glancing angle\n", "\n", "//for part 1\n", "\n", "n=1 //first order maximum\n", "\n", "//using Bragg's law n*l=2*d*sin(t)\n", "\n", "l=2*d*sind(t)/n\n", "\n", "printf(' 1)wavelength=')\n", "\n", "disp(l)\n", "\n", "printf('meter')\n", "\n", "//for part 2\n", "\n", "n1=2\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "q=asind(n1*l/(2*d))\n", "\n", "printf(' 2)glancing angle=')\n", "\n", "disp(q)\n", "\n", "printf('degree')\n", "\n", "//for part 3\n", "\n", "//for highest order sin(q) not exceed one i.e maximum value is one\n", "\n", "//using Bragg's law n*l=2*d*sin(q)\n", "\n", "n2=2*d/l //since sin(q)is one\n", "\n", "printf(' 3)highest order possible =')\n", "\n", "disp(floor(n2))" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16_1: calculate_ratio_of_vacancies.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_16_1,pg 1-75\n", "\n", "Ev=1.08 //average energy required to creaet a vacancy\n", "\n", "k=1.38*10^-23 //boltzman constant in J/K\n", "\n", "e=1.6*10^-19 //charge on 1 electron\n", "\n", "K=k/e //boltzman constant in eV/K\n", "\n", "//for a low concentration of vacancies a relation is\n", "\n", "//n=Nexp(-Ev/KT)\n", "\n", "//since total no atom is 1 hence N=1\n", "\n", "//at 1000k\n", "\n", "T1=1000 //temperature\n", "\n", "n1=exp(-Ev/(K*T1))\n", "\n", "//at 500k\n", "\n", "T2=500 //temperature\n", "\n", "n2=exp(-Ev/(K*T2))\n", "\n", "v=(n1)/(n2) //ratio of vacancies\n", "\n", "printf('ratio of vacancies=')\n", "\n", "disp(v)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16_2: calculate_ratio_of_vacancies_to_no_of_atom.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_16_2,pg 1-75\n", "\n", "Ev=1.95 //average energy required to creaet a vacancy\n", "\n", "k=1.38*10^-23 //boltzman constant in J/K\n", "\n", "e=1.6*10^-19 //charge on 1 electron\n", "\n", "K=k/e //boltzman constant in eV/K\n", "\n", "T=500 //temperature\n", "\n", "//for a low concentration of vacancies a relation is\n", "\n", "//n=Nexp(-Ev/KT)\n", "\n", "m=exp(-Ev/(K*T)) //ratio of no of vacancies to no of atoms n/N\n", "\n", "printf('ratio of no of vacancies to no of atoms=')\n", "\n", "disp(m)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16_3: calculate_ratio_of_vacancies.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_16_3,pg 1-76\n", "\n", "Ev=1.8 //average energy required to creaet a vacancy\n", "\n", "k=1.38*10^-23 //boltzman constant in J/K\n", "\n", "e=1.6*10^-19 //charge on 1 electron\n", "\n", "K=k/e //boltzman constant in eV/K\n", "\n", "//for a low concentration of vacancies a relation is\n", "\n", "//n=Nexp(-Ev/KT)\n", "\n", "//ratio of vacancy is n/N assume be r=exp(-Ev/KT)\n", "\n", "//since total no atom is 1 hence N=1\n", "\n", "//at 1000k\n", "\n", "t1=-119 //temperature in degree\n", "\n", "T1=t1+273 //temperature in kelvine\n", "\n", "r1=exp(-Ev/(K*T1))\n", "\n", "printf('1)ratio of vacancies at -119 degree=')\n", "\n", "disp(r1)\n", "\n", "//at 500k\n", "\n", "t2=80 //temperature in degree\n", "\n", "T2=t2+273 //temperature in kelvine\n", "\n", "r2=exp(-Ev/(K*T2))\n", "\n", "v=(r1)/(r2) //ratio of vacancies\n", "\n", "printf('2)ratio of vacancies at 80 degree=')\n", "\n", "disp(r2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16_4: calculate_no_of_frankel_defects.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_16_4,pg 1-76\n", "\n", "Ev=1.5 //energy of formaton of frankel defect\n", "\n", "k=1.38*10^-23 //boltzman constant in J/K\n", "\n", "e=1.6*10^-19 //charge on 1 electron\n", "\n", "K=k/e //boltzman constant in eV/K\n", "\n", "T=700 //temperature\n", "\n", "N=6.023*10^26 //avogadro's no\n", "\n", "//for a low concentration of vacancies a relation is\n", "\n", "//n=Nexp(-Ev/KT)\n", "\n", "m=exp(-Ev/(2*K*T)) //ratio of no of vacancies to no of atoms n/N\n", "\n", "qs=5.56 //specific density\n", "\n", "q=5.56*10^3 //real density ke/m^3\n", "\n", "M=0.143 //molecular weight in kg/m^3\n", "\n", "ma=M/N //mass of one molecule\n", "\n", "v=ma/q //vol of one molecule\n", "\n", "//v volume containe 1 molecule\n", "\n", "//therefore 1 m^3 containe x molecule\n", "\n", "x=1/v\n", "\n", "d=m*x //defect per m^3\n", "\n", "dm=d*10^-9 //defect per mm^3\n", "\n", "printf('number of frankel defects per mm^3=')\n", "\n", "disp(dm)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_1: calculate_Unit_cell_dimension.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_1,pg 1-14\n", "\n", "A=26.98 //atomic weight of Al\n", "\n", "N=6.023*10^26 //Avogadro's number\n", "\n", "p=2700 //Density\n", "\n", "n=4 //FCC structure\n", "\n", "a=(n*A/(N*p))^(1/3)\n", "\n", "printf('Unit cell dimension of Al=')\n", "\n", "disp(a)\n", "\n", "printf('m')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_2: calculate_density.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_2,pg 1-15\n", "\n", "As=28.1 //atomic weight of Si\n", "\n", "Ag=69.7 //atomic weight of Ga\n", "\n", "Aa=74.9 //atomic weight of As\n", "\n", "as=5.43*10^-8 //lattice constant of Si\n", "\n", "aga=5.65*10^-8 //lattice constant of GaAs\n", "\n", "ns=8 //no of atoms/unit cell in Si\n", "\n", "nga=4 //no of atoms/unit cell in GaAs\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "//p=(n*A)/(N*a^3) this is formula for density\n", "\n", "//for Si\n", "\n", "ps=(ns*As)/(N*as^3)\n", "\n", "printf(' 1) Density of Si=')\n", "\n", "disp(ps)\n", "\n", "printf('gm/cm^3')\n", "\n", "//for GaAs\n", "\n", "Aga=Ag+Aa //molecular wt of GaAs\n", "\n", "pga=(nga*Aga)/(N*aga^3)\n", "\n", "printf(' 2) Density of GaAs=')\n", "\n", "disp(pga)\n", "\n", "printf('gm/cm^3')\n", "\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_3: calculate_density.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_3,pg 1-16\n", "\n", "A=63.5 //atomic weight of Cu\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "n=4 //FCC structure\n", "\n", "r=1.28*10^-8 //atomic radius of Cu\n", "\n", "//for FCC\n", "\n", "a=4*r/(sqrt(2)) //lattice constant\n", "\n", "p=(n*A)/(N*a^3)\n", "\n", "printf('Density of Cu=')\n", "\n", "disp(p)\n", "\n", "printf('gm/cm^3')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_4: calculate_APF.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_4,pg 1-17\n", "\n", "A=50 //atomic weight of chromium\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "p=5.96 //Density\n", "\n", "n=2 //BCC structure\n", "\n", "//step 1 : claculation for lattice constant (a)\n", "\n", "a=(n*A/(N*p))^(1/3)\n", "\n", "//step 2 : radius of an atom in BCC\n", "\n", "r=sqrt(3)*a/4\n", "\n", "//step 3 : Atomic packing factor (APF)\n", "\n", "APF=n*((4/3)*%pi*r^3)/a^3\n", "\n", "printf('Atomic packing factor (APF)=')\n", "\n", "disp(APF)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_5: calculate_no_of_unit_cell.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_5,pg 1-17\n", "\n", "A=120 //atomic weight of chromium\n", "\n", "N=6.023*10^23 //Avogadro's number\n", "\n", "p=5.2 //Density\n", "\n", "n=2 //BCC structure\n", "\n", "m=20 //mass\n", "\n", "//step 1 : claculation for volume of unit cell(a^3)\n", "\n", "a=(n*A/(N*p))\n", "\n", "//step 2 : volume of 20 gm of the element\n", "\n", "v=m/p\n", "\n", "//step 3 :no of unit cell\n", "\n", "x=v/a\n", "\n", "printf('no of unit cell=')\n", "\n", "disp(x)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_6: calculate_no_of_atoms_per_meter_cube.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_6,pg 1-18\n", "A=132.91 //atomic weight of chromium\n", "N=6.023*10^26 //Avogadro's number\n", "p=1900 //Density\n", "a=6.14*10^-10 //lattice constant\n", "//step 1 : type of structure\n", "n=(p*N*a^3)/A\n", "printf('n =')\n", "disp(round(n))\n", "printf('BCC structure')\n", "//step 2: no of atoms/m^3\n", "x=n/a^3\n", "printf(' no of atoms/m^3=')\n", "disp(x)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3_7: calculate_no_of_unit_cell.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_3_6,pg 1-18\n", "\n", "a=0.4049*10^-9 //lattice constant\n", "\n", "t=0.006*10^-2 //thickness of Al foil\n", "\n", "A=50*10^-4 //Area of foil\n", "\n", "V1=a^3 //volume of unit cell\n", "\n", "V=A*t //volume of the foil\n", "\n", "N=V/V1 //no of unit cell in the foil\n", "\n", "printf('no of unit cell in the foil=')\n", "\n", "disp(N)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_1: calcukate_critical_radius_ratio_of_ligancy_three.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_1,pg 1-29\n", "\n", "//refer diagram from textbook\n", "\n", "//on joining centre of 3 anions,an equilateral triangle is formed and on joining centres of any anion and cation a right angle triangle ABC os formed\n", "\n", "//where AC=rc+ra\n", "\n", "//and BC=ra\n", "\n", "//m(angle (ACB))=30 degree\n", "\n", "//therefore cos (30)=ra/(rc+ra)\n", "\n", "//assume rc/ra=r\n", "\n", "r=(1-cosd(30))/cosd(30) //by arrangimg terms we get value of r\n", "\n", "printf('critical radius ratio of ligancy 3=')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_2: calculate_critical_radius_ratio_for_ligancy_six.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_2,pg 1-30\n", "\n", "//refer diagram from textbook\n", "\n", "//in the said arrangement a cation is squeezed into 4 anions in a plane and 5th anion is in upper layer and 6th in bottom layer \n", "\n", "//join cation anion centres E and B and complete the triangle EBF\n", "\n", "//in triangle EBF m(angle F)=90 and EF=BF\n", "\n", "//m(angle B)=m(angle E)=45\n", "\n", "//and EB=rc+ra and BF=ra\n", "\n", "//cos(45)=ra/(rc+ra)\n", "\n", "//assume rc/ra=r\n", "\n", "r=(1-cosd(45))/cosd(45) //by arrangimg terms we get value of r\n", "\n", "printf('critical radius ratio for ligancy 6 =')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_3: calculate_critical_radius_ratio_for_octohedral.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_3,pg 1-30\n", "\n", "//refer diagram from textbook\n", "\n", "//since plane is square hence it is same as ligancy 6\n", "\n", "//in the said arrangement a cation is squeezed into 4 anions in a plane and 5th anion is in upper layer and 6th in bottom layer \n", "\n", "//join cation anion centres E and B and complete the triangle EBF\n", "\n", "//in triangle EBF m(angle F)=90 and EF=BF\n", "\n", "//m(angle B)=m(angle E)=45\n", "\n", "//and EB=rc+ra and BF=ra\n", "\n", "//cos(45)=ra/(rc+ra)\n", "\n", "//assume rc/ra=r\n", "\n", "r=(1-cosd(45))/cosd(45) //by arrangimg terms we get value of r\n", "\n", "printf('critical radius ratio for ligancy 8 =')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_4: calculate_critical_radius_ratio_for_ligancy_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_4,pg 1-31\n", "\n", "//a tetrahedron CAEH can be considered with C as the apex of the tetrahedron.\n", "\n", "//the edges AE,AH and EH of the tetrahedron will then be the face of the cube faces ABEF,ADHF,EFHG resp.\n", "\n", "//from fig\n", "\n", "//AO=ra+rc and AJ=ra\n", "\n", "//AE=root(2)*a and AG=root(3)*a\n", "\n", "//AO/AJ=AG/AE=(ra+rc)/ra=root(3)*a/root(2)*a\n", "\n", "//assume rc/ra=r\n", "\n", "r=(sqrt(3)-sqrt(2))/sqrt(2)\n", "\n", "printf('critical radius ratio for ligancy 4 =')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_5: calculate_critical_radius_ratio_for_ligancy_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_5,pg 1-32\n", "\n", "//ligancy 8 represents cubic arrangment .8 anions are at the corners and touch along cube edgs.Along the body diagonal the central cation and the corner anion are in contact.\n", "\n", "//cube edge=2*ra\n", "\n", "//refer diagram from textbook\n", "\n", "//and body diagonal=root(3)*cube edge=root(3)[2*(rc+ra)]\n", "\n", "//assume rc/ra=r\n", "\n", "r=sqrt(3)-1\n", "\n", "printf('critical radius ratio of ligancy 8=')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5_6: calculate_critical_radius_ratio_for_ligancy.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_5_6,pg 1-32\n", "\n", "//for an ionic crystal exibiting HCP structure the arrangment of ions refere from textbook\n", "\n", "//at centre we have a cation with radius rc=OA\n", "\n", "//it is an touch with 6 anions with radius ra=AB\n", "\n", "//OB=OC=ra+rc\n", "\n", "//intrangle ODB ,m(angle (OBC))=60 degree ,m(angle (ODB))=90 degree\n", "\n", "//therefore cos(60)=BD/OB=AB/(OA+OB)=ra/(rc+ra)\n", "\n", "//assume rc/ra=r\n", "\n", "r=(1-cosd(60))/cosd(60) //by arrangimg terms we get value of r\n", "\n", "printf('critical radius ratio 0f HCP structure=')\n", "\n", "disp(r)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.6_2: calculate_miller_indices_of_plane.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_6_2,pg 1-35\n", "\n", "//intercept of planeare in proportion a,b/3,2*c\n", "\n", "//as a,b and c are basic vectors the proportin of intercepts 1:1/3:2\n", "\n", "//therefore reciprocal\n", "\n", "r1=1\n", "\n", "r2=3\n", "\n", "r3=1/2\n", "\n", "//taking LCM\n", "\n", "v=int32([2,1])\n", "\n", "l=double(lcm(v))\n", "\n", "m1=(l*r1)\n", "\n", "m2=(l*r2)\n", "\n", "m3=(l*r3)\n", "\n", "printf('miler indices=')\n", "\n", "disp(m3,m2,m1)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.6_4: calculate_interplanar_spacing.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter-1,Example1_6_4,pg 1-38\n", "\n", "r=1.414 //atomic radius in amstrong unit\n", "\n", "//for FCC structure\n", "\n", "a=4*r/sqrt(2)\n", "\n", "//part 1: plane(2,0,0)\n", "\n", "//the interplanar spacing of plane\n", "\n", "h1=2\n", "\n", "k1=0\n", "\n", "l1=0\n", "\n", "//we know that d=a/sqrt(h^2+k^2+l^2)\n", "\n", "d1=a/sqrt(h1^2+k1^2+l1^2)\n", "\n", "printf(' 1)interplanar spacing for (2,0,0) plane=')\n", "\n", "disp(d1)\n", "\n", "printf('amstrong')\n", "\n", "//part 2: plane(1,1,1)\n", "\n", "//the interplanar spacing of plane\n", "\n", "h2=1\n", "\n", "k2=1\n", "\n", "l2=1\n", "\n", "//we know that d=a/sqrt(h^2+k^2+l^2)\n", "\n", "d2=a/sqrt(h2^2+k2^2+l2^2)\n", "\n", "printf(' 2)interplanar spacing for(1,1,1) plane=')\n", "\n", "disp(d2)\n", "\n", "printf('amstrong')" ] } ], "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 }