{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 11: Crystal Structure" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 1, Page number 299" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "lattice constant is 4 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "n=4; #number of molecules per unit cell\n", "M=60.2; #molecular weight\n", "N=6.02*10**26; #avagadro number(kg mol-1)\n", "rho=6250; #density(kg/m**3)\n", "\n", "#Calculations\n", "a=(n*M/(rho*N))**(1/3); #lattice constant(m)\n", "\n", "#Result\n", "print \"lattice constant is\",int(a*10**10),\"angstrom\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 2, Page number 299" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "lattice constant is 2.867 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "n=2; #number of molecules per unit cell\n", "M=55.8; #molecular weight\n", "N=6.02*10**26; #avagadro number(kg mol-1)\n", "rho=7870; #density(kg/m**3)\n", "\n", "#Calculations\n", "a=(n*M/(rho*N))**(1/3); #lattice constant(m)\n", "\n", "#Result\n", "print \"lattice constant is\",round(a*10**10,3),\"angstrom\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 3, Page number 299" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "distance between two nearest copper atoms is 2.55 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "n=4; #number of molecules per unit cell\n", "M=63.5; #molecular weight\n", "N=6.02*10**23; #avagadro number(kg mol-1)\n", "rho=8.96; #density(gm/cm**3)\n", "\n", "#Calculations\n", "a=(n*M/(rho*N))**(1/3); #lattice constant(m)\n", "d=a/math.sqrt(2); #distance between two nearest copper atoms(cm)\n", "\n", "#Result\n", "print \"distance between two nearest copper atoms is\",round(d*10**8,2),\"angstrom\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 4, Page number 303" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "miller indices of plane are ( 3 2 1 )\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "a=1/2;\n", "b=1/3;\n", "c=1/6; #intercepts along the three axes\n", "\n", "#Calculations\n", "def lcm(x, y):\n", " if x > y:\n", " greater = x\n", " else:\n", " greater = y\n", " while(True):\n", " if((greater % x == 0) and (greater % y == 0)):\n", " lcm = greater\n", " break\n", " greater += 1\n", " \n", " return lcm\n", "\n", "z=lcm(1/a,1/b);\n", "lcm=lcm(z,1/c);\n", "h=a*lcm;\n", "k=b*lcm;\n", "l=c*lcm; #miller indices of plane\n", "\n", "#Result\n", "print \"miller indices of plane are (\",int(h),int(k),int(l),\")\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 5, Page number 303" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "miller indices of plane are ( 3 4 0 )\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "a=1/4;\n", "b=1/3;\n", "x=float(\"inf\");\n", "c=1/x; #intercepts along the three axes\n", "\n", "#Calculations\n", "def lcm(x, y):\n", " if x > y:\n", " greater = x\n", " else:\n", " greater = y\n", " while(True):\n", " if((greater % x == 0) and (greater % y == 0)):\n", " lcm = greater\n", " break\n", " greater += 1\n", " \n", " return lcm\n", "\n", "lcm=lcm(1/a,1/b);\n", "h=a*lcm;\n", "k=b*lcm;\n", "l=c*lcm; #miller indices of plane\n", "\n", "#Result\n", "print \"miller indices of plane are (\",int(h),int(k),int(l),\")\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 6, Page number 303" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "miller indices of plane are ( 6 -2 3 )\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "a=1/1;\n", "b=-1/3;\n", "c=1/2; #intercepts along the three axes\n", "\n", "#Calculations\n", "def lcm(x, y):\n", " if x > y:\n", " greater = x\n", " else:\n", " greater = y\n", " while(True):\n", " if((greater % x == 0) and (greater % y == 0)):\n", " lcm = greater\n", " break\n", " greater += 1\n", " \n", " return lcm\n", "\n", "z=lcm(1/a,1/b);\n", "lcm=lcm(z,1/c);\n", "h=a*lcm;\n", "k=b*lcm;\n", "l=c*lcm; #miller indices of plane\n", "\n", "#Result\n", "print \"miller indices of plane are (\",int(h),int(k),int(l),\")\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 7, Page number 304" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "intercept on y-axis is 1.2 angstrom\n", "intercept on z-axis is 4.0 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration \n", "p1=1.2; #x-primitive(angstrom)\n", "p2=1.8; #y-primitive(angstrom)\n", "p3=2.0; #z-primitive(angstrom)\n", "x=2; #x-intercept\n", "y=3; #y-intercept\n", "z=1; #z-intercept\n", "h=1.2; #intercept on x-axis(angstrom)\n", "\n", "#Calculations\n", "h1=p1/x; \n", "k1=p2/y;\n", "l1=p3/z;\n", "k=h*k1/h1; #intercept on y-axis(angstrom)\n", "l=h*p3/h1; #intercept on z-axis(angstrom)\n", "\n", "#Result\n", "print \"intercept on y-axis is\",k,\"angstrom\"\n", "print \"intercept on z-axis is\",l,\"angstrom\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }