diff options
Diffstat (limited to 'Engineering_Physics/Chapter_6.ipynb')
-rw-r--r-- | Engineering_Physics/Chapter_6.ipynb | 611 |
1 files changed, 555 insertions, 56 deletions
diff --git a/Engineering_Physics/Chapter_6.ipynb b/Engineering_Physics/Chapter_6.ipynb index 1445b978..df63cdce 100644 --- a/Engineering_Physics/Chapter_6.ipynb +++ b/Engineering_Physics/Chapter_6.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "Chapter 6" + "name": "", + "signature": "sha256:95589aa74fb7b8b919d364696d403ce9619ba363e3435f491e57c82d78d5e42c" }, "nbformat": 3, "nbformat_minor": 0, @@ -11,25 +12,53 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": "Crystallography" + "source": [ + "Crystallography" + ] }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.1, Page number 185" + "source": [ + "Example number 6.1, Page number 185" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the density of diamond\n\n#importing modules\nimport math\n\n#Variable declaration\nr=0.071; #radius in nm\nN=6.022*10**26; \n\n#Calculation\nr=r*10**-9; #converting r from nm to m\n#mass of carbon atom m = 12/N\nm=12/N;\n#mass of diamond M = 8*mass of one carbon atom\nM=8*m;\n#volume of diamond V = (8*r/sqrt(3))^3\nV=(8*r/math.sqrt(3))**3;\nd=M/V; #density in kg/m^3\nd=math.ceil(d*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"density of diamond in kg/m^3 is\",d);\n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "r=0.071; #radius in nm\n", + "N=6.022*10**26; \n", + "\n", + "#Calculation\n", + "r=r*10**-9; #converting r from nm to m\n", + "#mass of carbon atom m = 12/N\n", + "m=12/N;\n", + "#mass of diamond M = 8*mass of one carbon atom\n", + "M=8*m;\n", + "#volume of diamond V = (8*r/sqrt(3))^3\n", + "V=(8*r/math.sqrt(3))**3;\n", + "d=M/V; #density in kg/m^3\n", + "d=math.ceil(d*100)/100; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"density of diamond in kg/m^3 is\",d);\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('density of diamond in kg/m^3 is', 4520.31)\n" + "text": [ + "('density of diamond in kg/m^3 is', 4520.31)\n" + ] } ], "prompt_number": 3 @@ -38,19 +67,47 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.2, Page number 185" + "source": [ + "Example number 6.2, Page number 185" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the percentage volume change\n\n#importing modules\nimport math\n\n#Variable declaration\naBCC=0.332; #lattice constant in nm\naHCP=0.296; #lattice constant in nm\nc=0.468; #c in nm\n\n#Calculation\naBCC=aBCC*10**-9; #converting nm to m\nVbcc=aBCC**3;\naHCP=aHCP*10**-9; #converting nm to m\nc=c*10**-9; #converting nm to m\nVhcp=6*(math.sqrt(3)/4)*aHCP**2*c;\nV=Vhcp-Vbcc;\nVch=(V*100)/Vbcc;\nVch=math.ceil(Vch*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"percentage change in volume is\",Vch);\n\n#answer given in the book is wrong", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "aBCC=0.332; #lattice constant in nm\n", + "aHCP=0.296; #lattice constant in nm\n", + "c=0.468; #c in nm\n", + "\n", + "#Calculation\n", + "aBCC=aBCC*10**-9; #converting nm to m\n", + "Vbcc=aBCC**3;\n", + "aHCP=aHCP*10**-9; #converting nm to m\n", + "c=c*10**-9; #converting nm to m\n", + "Vhcp=6*(math.sqrt(3)/4)*aHCP**2*c;\n", + "V=Vhcp-Vbcc;\n", + "Vch=(V*100)/Vbcc;\n", + "Vch=math.ceil(Vch*100)/100; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"percentage change in volume is\",Vch);\n", + "\n", + "#answer given in the book is wrong" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('percentage change in volume is', 191.12)\n" + "text": [ + "('percentage change in volume is', 191.12)\n" + ] } ], "prompt_number": 4 @@ -59,19 +116,44 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.3, Page number 186" + "source": [ + "Example number 6.3, Page number 186" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the density\n\n#importing modules\nimport math\n\n#Variable declaration\nr=1.278; #atomic radius of Cu in Angstrom\nA=63.54; #atomic weight of Cu\nn=4; #for FCC n=4\nNa=6.022*10**26;\n\n#Calculation\nr=r*10**-10; #converting atomic radius from Angstrom to m\na=2*math.sqrt(2)*r; \nrho=(n*A)/(Na*a**3);\nrho=math.ceil(rho*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"density of Cu in kg/m^3 is\",rho);\n\n#answer given in the book is wrong", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "r=1.278; #atomic radius of Cu in Angstrom\n", + "A=63.54; #atomic weight of Cu\n", + "n=4; #for FCC n=4\n", + "Na=6.022*10**26;\n", + "\n", + "#Calculation\n", + "r=r*10**-10; #converting atomic radius from Angstrom to m\n", + "a=2*math.sqrt(2)*r; \n", + "rho=(n*A)/(Na*a**3);\n", + "rho=math.ceil(rho*100)/100; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"density of Cu in kg/m^3 is\",rho);\n", + "\n", + "#answer given in the book is wrong" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('density of Cu in kg/m^3 is', 8935.92)\n" + "text": [ + "('density of Cu in kg/m^3 is', 8935.92)\n" + ] } ], "prompt_number": 6 @@ -80,19 +162,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.4, Page number 186" + "source": [ + "Example number 6.4, Page number 186" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the distance between adjacent atoms\n\n#importing modules\nimport math\nimport numpy as np\n\n#Variable declaration\nrho=2180; #density of NaCl in kg/m^3\nwNa=23; #atomic weight of Na\nwCl=35.5; #atomic weight of Cl\nn=4; #for FCC n=4\nNa=6.022*10**26;\n\n#Calculation\nA=wNa+wCl; #molecular weight of NaCl\nx=np.reciprocal(3.);\na=((n*A)/(Na*rho))**x;\n\n#Result\nprint(\"interatomic distance in NaCl in m is\",a); \n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "import numpy as np\n", + "\n", + "#Variable declaration\n", + "rho=2180; #density of NaCl in kg/m^3\n", + "wNa=23; #atomic weight of Na\n", + "wCl=35.5; #atomic weight of Cl\n", + "n=4; #for FCC n=4\n", + "Na=6.022*10**26;\n", + "\n", + "#Calculation\n", + "A=wNa+wCl; #molecular weight of NaCl\n", + "x=np.reciprocal(3.);\n", + "a=((n*A)/(Na*rho))**x;\n", + "\n", + "#Result\n", + "print(\"interatomic distance in NaCl in m is\",a); \n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('interatomic distance in NaCl in m is', 5.6278114346454509e-10)\n" + "text": [ + "('interatomic distance in NaCl in m is', 5.6278114346454509e-10)\n" + ] } ], "prompt_number": 7 @@ -101,19 +207,48 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.5, Page number 187" + "source": [ + "Example number 6.5, Page number 187" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the interplanar spacing\n\n#importing modules\nimport math\n\n#Variable declaration\na=0.42; #lattice constant in nm\nh1=1;\nk1=0;\nl1=1; #indices of the plane (101)\nh2=2;\nk2=2;\nl2=1; #indices of the plane (221)\n\n#Calculation\na=a*10**-9; #converting from nm to m\nd1=a/math.sqrt((h1**2)+(k1**2)+(l1**2)); #interplanar spacing for plane (101)\nd1=d1*10**9; #converting from m to nm\nd1=math.ceil(d1*10**5)/10**5; #rounding off to 5 decimals\nd2=a/math.sqrt((h2**2)+(k2**2)+(l2**2)); #interplanar spacing for plane (221)\nd2=d2*10**9; #converting from m to nm\n\n#Result\nprint(\"interplanar spacing for (101) in nm is\",d1);\nprint(\"interplanar spacing for (221) in nm is\",d2);\n\n", + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "a=0.42; #lattice constant in nm\n", + "h1=1;\n", + "k1=0;\n", + "l1=1; #indices of the plane (101)\n", + "h2=2;\n", + "k2=2;\n", + "l2=1; #indices of the plane (221)\n", + "\n", + "#Calculation\n", + "a=a*10**-9; #converting from nm to m\n", + "d1=a/math.sqrt((h1**2)+(k1**2)+(l1**2)); #interplanar spacing for plane (101)\n", + "d1=d1*10**9; #converting from m to nm\n", + "d1=math.ceil(d1*10**5)/10**5; #rounding off to 5 decimals\n", + "d2=a/math.sqrt((h2**2)+(k2**2)+(l2**2)); #interplanar spacing for plane (221)\n", + "d2=d2*10**9; #converting from m to nm\n", + "\n", + "#Result\n", + "print(\"interplanar spacing for (101) in nm is\",d1);\n", + "print(\"interplanar spacing for (221) in nm is\",d2);\n", + "\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('interplanar spacing for (101) in nm is', 0.29699)\n('interplanar spacing for (221) in nm is', 0.14)\n" + "text": [ + "('interplanar spacing for (101) in nm is', 0.29699)\n", + "('interplanar spacing for (221) in nm is', 0.14)\n" + ] } ], "prompt_number": 8 @@ -122,19 +257,48 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.6, Page number 187" + "source": [ + "Example number 6.6, Page number 187" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To identify the axial intercepts\n\n#Variable declaration\nh1=1;\nk1=0;\nl1=2; #indices for plane (102)\nh2=2;\nk2=3;\nl2=1; #indices for plane (231)\nh3=3;\nk3=-1;\nl3=2; #indices for plane (31'2)\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for plane (102) intercepts are a/1=a, b/0=infinite, c/2\n#for plane (231) intercepts are a/2, b/3, c/1=c\n#for plane (31'2) intercepts are a/3=a, b/-1=-b, c/2\n\n#Result\nprint(\"for plane (102) intercepts are a/1=a, b/0=infinite, c/2\");\nprint(\"for plane (231) intercepts are a/2, b/3, c/1=c\");\nprint(\"for plane (312) intercepts are a/3=a, b/-1=-b, c/2\");\n", + "input": [ + " \n", + "#Variable declaration\n", + "h1=1;\n", + "k1=0;\n", + "l1=2; #indices for plane (102)\n", + "h2=2;\n", + "k2=3;\n", + "l2=1; #indices for plane (231)\n", + "h3=3;\n", + "k3=-1;\n", + "l3=2; #indices for plane (31'2)\n", + "\n", + "#Calculation\n", + "#intercepts made by the plane is a/h, b/k, c/l\n", + "#for plane (102) intercepts are a/1=a, b/0=infinite, c/2\n", + "#for plane (231) intercepts are a/2, b/3, c/1=c\n", + "#for plane (31'2) intercepts are a/3=a, b/-1=-b, c/2\n", + "\n", + "#Result\n", + "print(\"for plane (102) intercepts are a/1=a, b/0=infinite, c/2\");\n", + "print(\"for plane (231) intercepts are a/2, b/3, c/1=c\");\n", + "print(\"for plane (312) intercepts are a/3=a, b/-1=-b, c/2\");\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "for plane (102) intercepts are a/1=a, b/0=infinite, c/2\nfor plane (231) intercepts are a/2, b/3, c/1=c\nfor plane (312) intercepts are a/3=a, b/-1=-b, c/2\n" + "text": [ + "for plane (102) intercepts are a/1=a, b/0=infinite, c/2\n", + "for plane (231) intercepts are a/2, b/3, c/1=c\n", + "for plane (312) intercepts are a/3=a, b/-1=-b, c/2\n" + ] } ], "prompt_number": 10 @@ -143,19 +307,57 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.7, Page number 188" + "source": [ + "Example number 6.7, Page number 188" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the angle between 2 planes\n\n#importing modules\nimport math\n\n#Variable declaration\nu1=1;\nv1=1;\nw1=1; #indices for plane (111)\nu2=2;\nv2=1;\nw2=2; #indices for plane (212)\n\n#Calculation\nA=u1*u2+v1*v2+w1*w2; \nB1=math.sqrt((u1**2)+(v1**2)+(w1**2));\nB2=math.sqrt((u2**2)+(v2**2)+(w2**2));\nB=A/(B1*B2);\nB=math.ceil(B*10**4)/10**4; #rounding off to 4 decimals\ntheta=math.acos(B); #angle in radian\ntheta=theta*57.2957795; #converting radian to degrees\ntheeta=math.ceil(theta*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(theta); #converting to degrees\nt=60*(theta-deg);\nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"angle between the planes in degrees is\",theeta);\nprint(\"angle between the planes is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer given in the book is wrong", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "u1=1;\n", + "v1=1;\n", + "w1=1; #indices for plane (111)\n", + "u2=2;\n", + "v2=1;\n", + "w2=2; #indices for plane (212)\n", + "\n", + "#Calculation\n", + "A=u1*u2+v1*v2+w1*w2; \n", + "B1=math.sqrt((u1**2)+(v1**2)+(w1**2));\n", + "B2=math.sqrt((u2**2)+(v2**2)+(w2**2));\n", + "B=A/(B1*B2);\n", + "B=math.ceil(B*10**4)/10**4; #rounding off to 4 decimals\n", + "theta=math.acos(B); #angle in radian\n", + "theta=theta*57.2957795; #converting radian to degrees\n", + "theeta=math.ceil(theta*10**3)/10**3; #rounding off to 3 decimals\n", + "deg=int(theta); #converting to degrees\n", + "t=60*(theta-deg);\n", + "mi=int(t); #converting to minutes\n", + "sec=60*(t-mi); #converting to seconds\n", + "sec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"angle between the planes in degrees is\",theeta);\n", + "print(\"angle between the planes is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n", + "\n", + "#answer given in the book is wrong" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('angle between the planes in degrees is', 15.783)\n('angle between the planes is', 15, 'degrees', 46, 'minutes', 57.85, 'seconds')\n" + "text": [ + "('angle between the planes in degrees is', 15.783)\n", + "('angle between the planes is', 15, 'degrees', 46, 'minutes', 57.85, 'seconds')\n" + ] } ], "prompt_number": 13 @@ -164,12 +366,16 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.8, Page number 188" + "source": [ + "Example number 6.8, Page number 188" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#sketching the crystallographic planes", + "input": [ + "#sketching the crystallographic planes" + ], "language": "python", "metadata": {}, "outputs": [], @@ -179,19 +385,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.9, Page number 189" + "source": [ + "Example number 6.9, Page number 189" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the lattice constant\n\n#importing modules\nimport math\n\n#Variable declaration\nd=0.2338; #interplanar distance in nm\nh=-1;\nk=1;\nl=1; #indices of the plane (1'11)\n\n#Calculation\nd=d*10**-9; #converting from nm to m\na=d*math.sqrt((h**2)+(k**2)+(l**2));\na=a*10**9; #converting lattice constant from m to nm\na=math.ceil(a*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"lattice constant in nm is\",a);\n\n", + "input": [ + "\n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "d=0.2338; #interplanar distance in nm\n", + "h=-1;\n", + "k=1;\n", + "l=1; #indices of the plane (1'11)\n", + "\n", + "#Calculation\n", + "d=d*10**-9; #converting from nm to m\n", + "a=d*math.sqrt((h**2)+(k**2)+(l**2));\n", + "a=a*10**9; #converting lattice constant from m to nm\n", + "a=math.ceil(a*10**5)/10**5; #rounding off to 5 decimals\n", + "\n", + "#Result\n", + "print(\"lattice constant in nm is\",a);\n", + "\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('lattice constant in nm is', 0.40496)\n" + "text": [ + "('lattice constant in nm is', 0.40496)\n" + ] } ], "prompt_number": 15 @@ -200,19 +430,63 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.10, Page number 189" + "source": [ + "Example number 6.10, Page number 189" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To show that for a simple cubic system d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n\n#importing modules\nimport math\n\n#variable declaration\nh1=1;\nk1=0;\nl1=0; #indices for plane (100)\nh2=1;\nk2=1;\nl2=0; #indices for plane (110)\nh3=1;\nk3=1;\nl3=1; #indices for plane (111)\n\n#Calculation\n#d=a/math.sqrt((h**2)+(k**2)+(l**2))\n#d100=a/math.sqrt((h1**2)+(k1**2)+(l1**2))\nx1=math.sqrt((h1**2)+(k1**2)+(l1**2));\n#d100=a/x1 = a/1 = a\n#d110=a/math.sqrt((h2**2)+(k2**2)+(l2**2))\nx2=math.sqrt((h2**2)+(k2**2)+(l2**2));\nx2=math.ceil(x2*10**4)/10**4; #rounding off to 4 decimals\n#d110=a/x2 = a/sqrt(2)\n#d111=a/math.sqrt((h3**2)+(k3**2)+(l3**2))\nx3=math.sqrt((h3**2)+(k3**2)+(l3**2));\nx3=math.ceil(x3*10**4)/10**4; #rounding off to 4 decimals\n#d111=a/x3 = a/sqrt(3)\n#hence d100:d110:d111=a:a/sqrt(2):a/sqrt(3)\n#multiplying RHS by sqrt(6) we get d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n\n#Result\nprint(\"value of x1 is\",x1);\nprint(\"value of x2 is\",x2);\nprint(\"value of x3 is\",x3);\nprint(\"d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\");", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#variable declaration\n", + "h1=1;\n", + "k1=0;\n", + "l1=0; #indices for plane (100)\n", + "h2=1;\n", + "k2=1;\n", + "l2=0; #indices for plane (110)\n", + "h3=1;\n", + "k3=1;\n", + "l3=1; #indices for plane (111)\n", + "\n", + "#Calculation\n", + "#d=a/math.sqrt((h**2)+(k**2)+(l**2))\n", + "#d100=a/math.sqrt((h1**2)+(k1**2)+(l1**2))\n", + "x1=math.sqrt((h1**2)+(k1**2)+(l1**2));\n", + "#d100=a/x1 = a/1 = a\n", + "#d110=a/math.sqrt((h2**2)+(k2**2)+(l2**2))\n", + "x2=math.sqrt((h2**2)+(k2**2)+(l2**2));\n", + "x2=math.ceil(x2*10**4)/10**4; #rounding off to 4 decimals\n", + "#d110=a/x2 = a/sqrt(2)\n", + "#d111=a/math.sqrt((h3**2)+(k3**2)+(l3**2))\n", + "x3=math.sqrt((h3**2)+(k3**2)+(l3**2));\n", + "x3=math.ceil(x3*10**4)/10**4; #rounding off to 4 decimals\n", + "#d111=a/x3 = a/sqrt(3)\n", + "#hence d100:d110:d111=a:a/sqrt(2):a/sqrt(3)\n", + "#multiplying RHS by sqrt(6) we get d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n", + "\n", + "#Result\n", + "print(\"value of x1 is\",x1);\n", + "print(\"value of x2 is\",x2);\n", + "print(\"value of x3 is\",x3);\n", + "print(\"d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\");" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('value of x1 is', 1.0)\n('value of x2 is', 1.4143)\n('value of x3 is', 1.7321)\nd100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n" + "text": [ + "('value of x1 is', 1.0)\n", + "('value of x2 is', 1.4143)\n", + "('value of x3 is', 1.7321)\n", + "d100:d110:d111=sqrt(6):sqrt(3):sqrt(2)\n" + ] } ], "prompt_number": 16 @@ -221,19 +495,39 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.11, Page number 190" + "source": [ + "Example number 6.11, Page number 190" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To find the ratio of intercepts in a simple cubic crystal\n\n#variable declaration\nh=2;\nk=3;\nl=1; #indices for plane (231)\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for a cubic unit cell, a=b=c\n#for plane (231) intercepts are a/2, a/3, a/1 = a\n#ratio of the intercepts is 1/2:1/3:1\n#LCM is 6. multiplying by LCM, we get ratio l1:l2:l3 = 3:2:6\n\n#Result\nprint(\"l1:l2:l3 = 3:2:6\");", + "input": [ + " \n", + "#variable declaration\n", + "h=2;\n", + "k=3;\n", + "l=1; #indices for plane (231)\n", + "\n", + "#Calculation\n", + "#intercepts made by the plane is a/h, b/k, c/l\n", + "#for a cubic unit cell, a=b=c\n", + "#for plane (231) intercepts are a/2, a/3, a/1 = a\n", + "#ratio of the intercepts is 1/2:1/3:1\n", + "#LCM is 6. multiplying by LCM, we get ratio l1:l2:l3 = 3:2:6\n", + "\n", + "#Result\n", + "print(\"l1:l2:l3 = 3:2:6\");" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "l1:l2:l3 = 3:2:6\n" + "text": [ + "l1:l2:l3 = 3:2:6\n" + ] } ], "prompt_number": 17 @@ -242,19 +536,46 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.12, Page number 190" + "source": [ + "Example number 6.12, Page number 190" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To find the lengths of intercepts along Y and Z axes\n\n#variable declaration\nh=1;\nk=2;\nl=3; #indices for plane (123)\nl1=0.8; #l1 in armstrong\na=0.8; #a in armstrong\nb=1.2; #b in armstrong\nc=1.5; #c in armstrong\n\n#Calculation\n#intercepts made by the plane is a/h, b/k, c/l\n#for plane (123) intercepts are a/1 = a, b/2, c/3\n#ratio of the intercepts l1:l2:l3 = a:b/2:c/3\n#thus 0.8:l2:l3 = 0.8:1.2/2:1.5/3\nl2=1.2/2; #l2 in armstrong\nl3=1.5/3; #l3 in armstrong\n\n#Result\nprint(\"value of l2 in armstrong is\",l2);\nprint(\"value of l3 in armstrong is\",l3);", + "input": [ + " \n", + "#variable declaration\n", + "h=1;\n", + "k=2;\n", + "l=3; #indices for plane (123)\n", + "l1=0.8; #l1 in armstrong\n", + "a=0.8; #a in armstrong\n", + "b=1.2; #b in armstrong\n", + "c=1.5; #c in armstrong\n", + "\n", + "#Calculation\n", + "#intercepts made by the plane is a/h, b/k, c/l\n", + "#for plane (123) intercepts are a/1 = a, b/2, c/3\n", + "#ratio of the intercepts l1:l2:l3 = a:b/2:c/3\n", + "#thus 0.8:l2:l3 = 0.8:1.2/2:1.5/3\n", + "l2=1.2/2; #l2 in armstrong\n", + "l3=1.5/3; #l3 in armstrong\n", + "\n", + "#Result\n", + "print(\"value of l2 in armstrong is\",l2);\n", + "print(\"value of l3 in armstrong is\",l3);" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('value of l2 in armstrong is', 0.6)\n('value of l3 in armstrong is', 0.5)\n" + "text": [ + "('value of l2 in armstrong is', 0.6)\n", + "('value of l3 in armstrong is', 0.5)\n" + ] } ], "prompt_number": 18 @@ -263,19 +584,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.13, Page number 191" + "source": [ + "Example number 6.13, Page number 191" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the nearest neighbour distance\n\n#Calculation\n#in simple cubic unit cell, corner atom is the nearest neighbour to another corner atom. \n#Hence nearest neighbour distance is a.\n#in BCC the body centered atom is the nearest neighbour to a corner atom.\n#the distance between body centered atom and corner atom is 2r\n#but r=sqrt(3)*a/4\n#distance = 2*sqrt(3)*a/4 = sqrt(3)*a/2\n#in FCC the face centered atom is the nearest neighbour to a corner atom.\n#the distance between face centered atom and corner atom is 2r\n#but r = a/sqrt(8)\n#distance = 2*a/sqrt(8) = a/sqrt(2)\n\n#Result\nprint(\"in simple cubic unit cell nearest neighbour distance is a\");\nprint(\"in body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\");\nprint(\"in face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\");", + "input": [ + " \n", + "#Calculation\n", + "#in simple cubic unit cell, corner atom is the nearest neighbour to another corner atom. \n", + "#Hence nearest neighbour distance is a.\n", + "#in BCC the body centered atom is the nearest neighbour to a corner atom.\n", + "#the distance between body centered atom and corner atom is 2r\n", + "#but r=sqrt(3)*a/4\n", + "#distance = 2*sqrt(3)*a/4 = sqrt(3)*a/2\n", + "#in FCC the face centered atom is the nearest neighbour to a corner atom.\n", + "#the distance between face centered atom and corner atom is 2r\n", + "#but r = a/sqrt(8)\n", + "#distance = 2*a/sqrt(8) = a/sqrt(2)\n", + "\n", + "#Result\n", + "print(\"in simple cubic unit cell nearest neighbour distance is a\");\n", + "print(\"in body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\");\n", + "print(\"in face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\");" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "in simple cubic unit cell nearest neighbour distance is a\nin body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\nin face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\n" + "text": [ + "in simple cubic unit cell nearest neighbour distance is a\n", + "in body centered cubic unit cell nearest neighbour distance is sqrt(3)*a/2\n", + "in face centered cubic unit cell nearest neighbour distance is a/sqrt(2)\n" + ] } ], "prompt_number": 19 @@ -284,19 +629,42 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.14, Page number 191" + "source": [ + "Example number 6.14, Page number 191" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the spacing of the lattice plane\n\n#importing modules\nimport math\n\n#variable declaration\na=2.04; #lattice parameter in armstrong\nh=2;\nk=1;\nl=2; #indices for plane (212)\n\n#Calculation\na=a*10**-10; #converting from armstrong to m\nd=a/math.sqrt((h**2)+(k**2)+(l**2));\nd=d*10**10; #converting from m to armstrong\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"interplanar distance in armstrong is\",d);\n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#variable declaration\n", + "a=2.04; #lattice parameter in armstrong\n", + "h=2;\n", + "k=1;\n", + "l=2; #indices for plane (212)\n", + "\n", + "#Calculation\n", + "a=a*10**-10; #converting from armstrong to m\n", + "d=a/math.sqrt((h**2)+(k**2)+(l**2));\n", + "d=d*10**10; #converting from m to armstrong\n", + "d=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"interplanar distance in armstrong is\",d);\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('interplanar distance in armstrong is', 0.681)\n" + "text": [ + "('interplanar distance in armstrong is', 0.681)\n" + ] } ], "prompt_number": 20 @@ -305,19 +673,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.15, Page number 191" + "source": [ + "Example number 6.15, Page number 191" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the number of atoms per unit cell\n\n#importing modules\nimport math\n\n#variable declaration\nr=1.278; #radius of Cu in armstrong\nM=63.54; #atomic weight of Cu\nrho=8980; #density in kg/m^3\nNa=6.022*10**26;\n\n#Calculation\nr=r*10**-10; #radius in m\na=math.sqrt(8)*r;\nn=(rho*Na*a**3)/M;\n\n#Result\nprint(\"interatomic distance in m is\",a);\nprint(\"number of atoms per Cu unit cell is\",int(n));", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#variable declaration\n", + "r=1.278; #radius of Cu in armstrong\n", + "M=63.54; #atomic weight of Cu\n", + "rho=8980; #density in kg/m^3\n", + "Na=6.022*10**26;\n", + "\n", + "#Calculation\n", + "r=r*10**-10; #radius in m\n", + "a=math.sqrt(8)*r;\n", + "n=(rho*Na*a**3)/M;\n", + "\n", + "#Result\n", + "print(\"interatomic distance in m is\",a);\n", + "print(\"number of atoms per Cu unit cell is\",int(n));" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('interatomic distance in m is', 3.6147298654256317e-10)\n('number of atoms per Cu unit cell is', 4)\n" + "text": [ + "('interatomic distance in m is', 3.6147298654256317e-10)\n", + "('number of atoms per Cu unit cell is', 4)\n" + ] } ], "prompt_number": 21 @@ -326,19 +718,47 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.16, Page number 192" + "source": [ + "Example number 6.16, Page number 192" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the Miller indices \n\n#variable declaration\na=0.429;\nb=1;\nc=0.379; #intercepts of an orthorhombic crystal\n\n#Calculation\n#ratio of intercepts are 0.214:1:0.188 = (a/0.429)*0.214:1:(c/0.379)*0.188 = a/2:b:c/2\n#thus the coefficients are 1/2:1:1/2. inverses are 2,1,2.\n#thus miller indices for the first plane are (212)\n#ratio of intercepts are 0.858:1:0.754 = (a/0.429)*0.0.858:1:(c/0.379)*0.754 = 2a:b:2c\n#thus the coefficients are 2:1:2. inverses are 1/2,1,1/2. LCM is 2. multiplying with LCM we get 1,2,1\n#thus miller indices for the second plane are (121)\n#ratio of intercepts are 0.429:infinite:0.126 = (a/0.429)*0.429:infinite:(c/0.379)*0.126 = a:infiniteb:c/3\n#thus the coefficients are 1:infinte:1/3. inverses are 1,0,3.\n#thus miller indices for the third plane are (103)\n\n#Result\nprint(\"miller indices for the first plane are (212)\");\nprint(\"miller indices for the second plane are (121)\");\nprint(\"miller indices for the third plane are (103)\");\n", + "input": [ + " \n", + "#variable declaration\n", + "a=0.429;\n", + "b=1;\n", + "c=0.379; #intercepts of an orthorhombic crystal\n", + "\n", + "#Calculation\n", + "#ratio of intercepts are 0.214:1:0.188 = (a/0.429)*0.214:1:(c/0.379)*0.188 = a/2:b:c/2\n", + "#thus the coefficients are 1/2:1:1/2. inverses are 2,1,2.\n", + "#thus miller indices for the first plane are (212)\n", + "#ratio of intercepts are 0.858:1:0.754 = (a/0.429)*0.0.858:1:(c/0.379)*0.754 = 2a:b:2c\n", + "#thus the coefficients are 2:1:2. inverses are 1/2,1,1/2. LCM is 2. multiplying with LCM we get 1,2,1\n", + "#thus miller indices for the second plane are (121)\n", + "#ratio of intercepts are 0.429:infinite:0.126 = (a/0.429)*0.429:infinite:(c/0.379)*0.126 = a:infiniteb:c/3\n", + "#thus the coefficients are 1:infinte:1/3. inverses are 1,0,3.\n", + "#thus miller indices for the third plane are (103)\n", + "\n", + "#Result\n", + "print(\"miller indices for the first plane are (212)\");\n", + "print(\"miller indices for the second plane are (121)\");\n", + "print(\"miller indices for the third plane are (103)\");\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "miller indices for the first plane are (212)\nmiller indices for the second plane are (121)\nmiller indices for the third plane are (103)\n" + "text": [ + "miller indices for the first plane are (212)\n", + "miller indices for the second plane are (121)\n", + "miller indices for the third plane are (103)\n" + ] } ], "prompt_number": 12 @@ -347,19 +767,66 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.17, Page number 193" + "source": [ + "Example number 6.17, Page number 193" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the number of atoms per unit area\n\n#importing modules\nimport math\nimport numpy as np\n\n#variable declaration\nh1=1;\nk1=0;\nl1=0; #indices of the first plane (100)\nh2=1;\nk2=1;\nl2=0; #indices of the second plane (110)\nh3=1;\nk3=1;\nl3=1; #indices of the third plane (111)\n\n#Calculation\nn_1=np.reciprocal(4.);\nn_2=np.reciprocal(2.);\nn_3=np.reciprocal(6.);\nn1=(n_1*4)+1; #number of atoms per unit cell in (100)\n#number of atoms per m^2 is 2/a**2. but a=sqrt(8)*r.\n#hence number of atoms per m^2 is 1/(4*r**2)\nn2=(n_1*4)+(2*n_2); #number of atoms per unit cell in (110)\n#number of atoms per m^2 is 1/a*sqrt(2)*a. but a=sqrt(8)*r.\n#hence number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\nn3=(n_3*3)+(3*n_2); #number of atoms per unit cell in (111)\n#number of atoms per m^2 is 2/(sqrt(3)/4)*a**2. but a=4*r.\n#hence number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n\n#Result\nprint(\"number of atoms per unit cell in (100)\",n1);\nprint(\"number of atoms per m^2 is 1/(4*r**2)\");\nprint(\"number of atoms per unit cell in (110)\",n2);\nprint(\"number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\");\nprint(\"number of atoms per unit cell in (111)\",n3);\nprint(\"number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\");\n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "import numpy as np\n", + "\n", + "#variable declaration\n", + "h1=1;\n", + "k1=0;\n", + "l1=0; #indices of the first plane (100)\n", + "h2=1;\n", + "k2=1;\n", + "l2=0; #indices of the second plane (110)\n", + "h3=1;\n", + "k3=1;\n", + "l3=1; #indices of the third plane (111)\n", + "\n", + "#Calculation\n", + "n_1=np.reciprocal(4.);\n", + "n_2=np.reciprocal(2.);\n", + "n_3=np.reciprocal(6.);\n", + "n1=(n_1*4)+1; #number of atoms per unit cell in (100)\n", + "#number of atoms per m^2 is 2/a**2. but a=sqrt(8)*r.\n", + "#hence number of atoms per m^2 is 1/(4*r**2)\n", + "n2=(n_1*4)+(2*n_2); #number of atoms per unit cell in (110)\n", + "#number of atoms per m^2 is 1/a*sqrt(2)*a. but a=sqrt(8)*r.\n", + "#hence number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\n", + "n3=(n_3*3)+(3*n_2); #number of atoms per unit cell in (111)\n", + "#number of atoms per m^2 is 2/(sqrt(3)/4)*a**2. but a=4*r.\n", + "#hence number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n", + "\n", + "#Result\n", + "print(\"number of atoms per unit cell in (100)\",n1);\n", + "print(\"number of atoms per m^2 is 1/(4*r**2)\");\n", + "print(\"number of atoms per unit cell in (110)\",n2);\n", + "print(\"number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\");\n", + "print(\"number of atoms per unit cell in (111)\",n3);\n", + "print(\"number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\");\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('number of atoms per unit cell in (100)', 2.0)\nnumber of atoms per m^2 is 1/(4*r**2)\n('number of atoms per unit cell in (110)', 2.0)\nnumber of atoms per m^2 is 1/(8*sqrt(2)*r**2)\n('number of atoms per unit cell in (111)', 2.0)\nnumber of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n" + "text": [ + "('number of atoms per unit cell in (100)', 2.0)\n", + "number of atoms per m^2 is 1/(4*r**2)\n", + "('number of atoms per unit cell in (110)', 2.0)\n", + "number of atoms per m^2 is 1/(8*sqrt(2)*r**2)\n", + "('number of atoms per unit cell in (111)', 2.0)\n", + "number of atoms per m^2 is 1/(2*sqrt(3)*r**2)\n" + ] } ], "prompt_number": 22 @@ -368,19 +835,51 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 6.18, Page number 194" + "source": [ + "Example number 6.18, Page number 194" + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the atomic packing fraction and ionic packing fraction of NaCl\n\n#importing modules\nimport math\n\n#variable declaration\nr=0.97; #radius of Na+ ion in armstrong\nR=1.81; #radius of Cl- ion in armstrong\n\n#Calculation\n#atomic packing factor=packing density PD\n#PD=Volume of atoms/Volume of unit cell\n#volume of unit cell=a**3\n#volume of atoms=number of atoms*volume of 1 atom = 4*(4/3)*math.pi*r**3\n#but r=a/sqrt(8). hence PD = 4*(4/3)*math.pi*(a/(2*sqrt(2)))**3*(1/a**3) = 0.74\n#atomic packing factor = 0.74\nr=r*10**-10; #radius of Na+ ion in m\nR=R*10**-10; #radius of Cl- ion in m\nVna = (4*4*math.pi*r**3)/3; #volume of Na atoms\nVcl = (4*4*math.pi*R**3)/3; #volume of Cl atoms \nV=(2*(r+R))**3; #volume of unit cell\nIPF=(Vna+Vcl)/V; #ionic packing factor\nIPF=math.ceil(IPF*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"atomic packing factor = 0.74\");\nprint(\"ionic packing factor of NaCl crystal is\",IPF);", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#variable declaration\n", + "r=0.97; #radius of Na+ ion in armstrong\n", + "R=1.81; #radius of Cl- ion in armstrong\n", + "\n", + "#Calculation\n", + "#atomic packing factor=packing density PD\n", + "#PD=Volume of atoms/Volume of unit cell\n", + "#volume of unit cell=a**3\n", + "#volume of atoms=number of atoms*volume of 1 atom = 4*(4/3)*math.pi*r**3\n", + "#but r=a/sqrt(8). hence PD = 4*(4/3)*math.pi*(a/(2*sqrt(2)))**3*(1/a**3) = 0.74\n", + "#atomic packing factor = 0.74\n", + "r=r*10**-10; #radius of Na+ ion in m\n", + "R=R*10**-10; #radius of Cl- ion in m\n", + "Vna = (4*4*math.pi*r**3)/3; #volume of Na atoms\n", + "Vcl = (4*4*math.pi*R**3)/3; #volume of Cl atoms \n", + "V=(2*(r+R))**3; #volume of unit cell\n", + "IPF=(Vna+Vcl)/V; #ionic packing factor\n", + "IPF=math.ceil(IPF*10**4)/10**4; #rounding off to 4 decimals\n", + "\n", + "#Result\n", + "print(\"atomic packing factor = 0.74\");\n", + "print(\"ionic packing factor of NaCl crystal is\",IPF);" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "atomic packing factor = 0.74\n('ionic packing factor of NaCl crystal is', 0.6671)\n" + "text": [ + "atomic packing factor = 0.74\n", + "('ionic packing factor of NaCl crystal is', 0.6671)\n" + ] } ], "prompt_number": 24 @@ -388,7 +887,7 @@ { "cell_type": "code", "collapsed": false, - "input": "", + "input": [], "language": "python", "metadata": {}, "outputs": [] |