summaryrefslogtreecommitdiff
path: root/Material_Science_In_Engineering/ch5.ipynb
diff options
context:
space:
mode:
authorhardythe12014-07-28 14:01:58 +0530
committerhardythe12014-07-28 14:01:58 +0530
commit7876eeaf85f7c020ec1f3530963928cd2bc26a66 (patch)
tree67f4da564402aeb9869eaaf6f1e83ec7f1f75aa9 /Material_Science_In_Engineering/ch5.ipynb
parent1c1ea29e3e213559fef5f928df109b7d17c21f24 (diff)
downloadPython-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.tar.gz
Python-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.tar.bz2
Python-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.zip
adding book
Diffstat (limited to 'Material_Science_In_Engineering/ch5.ipynb')
-rwxr-xr-xMaterial_Science_In_Engineering/ch5.ipynb384
1 files changed, 384 insertions, 0 deletions
diff --git a/Material_Science_In_Engineering/ch5.ipynb b/Material_Science_In_Engineering/ch5.ipynb
new file mode 100755
index 00000000..701408be
--- /dev/null
+++ b/Material_Science_In_Engineering/ch5.ipynb
@@ -0,0 +1,384 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Miller Indices and X-Ray Crystallograph Techniques"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 pageno : 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p = 1.;\n",
+ "q = 1./2;\n",
+ "r = 3.;\n",
+ "\n",
+ "# Calculations\n",
+ "h = 1./p;\n",
+ "k = 1./q;\n",
+ "l = 1./r;\n",
+ "h1 = 3.*h;\n",
+ "k1 = 3.*k;\n",
+ "l1 = 3.*l;\n",
+ "\n",
+ "# Results\n",
+ "print \"MILLER INDICES OF THE PLANE are h = \",h1\n",
+ "print \"k = \",k1\n",
+ "print \"l = \",l1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MILLER INDICES OF THE PLANE are h = 3.0\n",
+ "k = 6.0\n",
+ "l = 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 pageno : 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "p = 2./4;\t\t\t#intercepts\n",
+ "q = 3./3;\n",
+ "r = 4./2;\n",
+ "\n",
+ "# Calculations\n",
+ "h = 1./p;\n",
+ "k = 1./q;\n",
+ "l = 1./r;\n",
+ "h1 = 2.*h;\n",
+ "k1 = 2.*k;\n",
+ "l1 = 2.*l;\n",
+ "\n",
+ "# Results\n",
+ "print \"MILLER INDICES ARE \",l1,k1,h1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "MILLER INDICES ARE 1.0 2.0 4.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 pageno : 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "r = 1.246;\t\t\t#radius in angstorm\n",
+ "h = 2.;\n",
+ "k = 0.;\n",
+ "l = 0.;\n",
+ "h1 = 2.;\n",
+ "k1 = 2.;\n",
+ "l1 = 0.;\n",
+ "h2 = 1.;\n",
+ "k2 = 1.;\n",
+ "l2 = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "x = math.sqrt(h**2+k**2+l**2);\n",
+ "a = 2*math.sqrt(2)*r;\t\t\t#in angstorm\n",
+ "d_200 = a/x;\t\t\t #interplanar spacing in angstorm\n",
+ "x1 = math.sqrt(h1**2+k1**2+l1**2);\n",
+ "d_220 = a/x1; \t\t\t#interplanar spacing in angstorm\n",
+ "x2 = math.sqrt(h2**2+k2**2+l2**2);\n",
+ "d_111 = a/x2;\t\t \t#interplanar spacing in angstorm\n",
+ "\n",
+ "\n",
+ "print \"Interplanar Spacing (200) (in Angstorm) = %.3f A\"%d_200\n",
+ "print \"Interplanar Spacing (220) (in Angstorm) = %.3f A\"%d_220\n",
+ "print \"Interplanar Spacing (111) (in Angstorm) = %.3f A\"%d_111\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Interplanar Spacing (200) (in Angstorm) = 1.762 A\n",
+ "Interplanar Spacing (220) (in Angstorm) = 1.246 A\n",
+ "Interplanar Spacing (111) (in Angstorm) = 2.035 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 pageno : 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "a = 3.61*10**-10;\t\t\t#unit cell in m\n",
+ "\n",
+ "# Calculations\n",
+ "r_110 = 2/(math.sqrt(2)*a);\t\t\t#in atoms/m\n",
+ "r_a = r_110/10**3;\t \t\t#in atoms/mm\n",
+ "r_111 = 1/(math.sqrt(3)*a);\t\t\t#in atoms/m\n",
+ "r_b = r_111/10**3;\t\t\t #in atoms/mm\n",
+ "\n",
+ "# Results\n",
+ "print \"Linear Density per unit length along direction [110] (in atoms/mm) = %.2e atoms/mm\"%r_a\n",
+ "print \"Linear Density per unit length along direction [111] (in atoms/mm) = %.2e atoms/mm\"%r_b\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Linear Density per unit length along direction [110] (in atoms/mm) = 3.92e+06 atoms/mm\n",
+ "Linear Density per unit length along direction [111] (in atoms/mm) = 1.60e+06 atoms/mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 pageno : 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "r_po = 1.7*10**-10;\t\t\t #radius of polonium in m\n",
+ "r_rh = 1.34*10**-10;\t\t\t#radius of rhodium in m\n",
+ "r_cr = 1.25*10**-10;\t\t\t#radius of chromium in m\n",
+ "\n",
+ "# Calculations\n",
+ "a_po = 2*r_po;\t\t \t#in m\n",
+ "a_rh = 2*math.sqrt(2)*r_rh;\t\t#in m\n",
+ "a_cr = 4*r_cr/math.sqrt(3);\n",
+ "p_po = 1/a_po**2;\t\t\t # /sqm\n",
+ "p_rh = 1.414/a_rh**2;\t\t\t# /sqm\n",
+ "p_cr = 1.732/a_cr**2;\t\t\t# /sqm\n",
+ "\n",
+ "# Results\n",
+ "print \"Planar Density on [100] in Polonium (per sqm) = %.2e /m**2\"%p_po\n",
+ "print \"Planar Density on [110] in Rhodium (per sqm) = %.2e /m**2\"%p_rh\n",
+ "print \"Planar Density on [111] in Chromium (per sqm) = %.2e /m**2\"%p_cr\n",
+ "\n",
+ "# Note : To check answer , please calculate manually for p_rh"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Planar Density on [100] in Polonium (per sqm) = 8.65e+18 /m**2\n",
+ "Planar Density on [110] in Rhodium (per sqm) = 9.84e+18 /m**2\n",
+ "Planar Density on [111] in Chromium (per sqm) = 2.08e+19 /m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 pageno : 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "w = 0.824;\t\t\t#wavelength in angstorm\n",
+ "theta1 = 8.35;\t\t\t#angle at n = 1 in degrees\n",
+ "n1 = 1.;\n",
+ "n3 = 3.;\n",
+ "\n",
+ "# Calculations\n",
+ "d = w/(2*math.sin(math.radians(theta1)));\t\t\t#in angstorm\n",
+ "theta3 = math.degrees(math.asin(3*math.sin(math.radians(theta1))))\n",
+ "\n",
+ "# Results\n",
+ "print \"Glancing angle for third order diffraction = %f degrees\"%theta3\n",
+ "print \"Interplanar spacing of the crystal (in Angstorm) = %.3f A\"%d\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Glancing angle for third order diffraction = 25.827235 degrees\n",
+ "Interplanar spacing of the crystal (in Angstorm) = 2.837 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 pageno : 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "a = 17.03;\t\t\t#in degrees\n",
+ "w = 0.71;\t\t\t#in angstorm\n",
+ "n = 1.;\n",
+ "\n",
+ "# Calculations\n",
+ "d = n*w/(2*math.sin(math.radians(a)));\t\t\t#interplanar spacing in angstorm\n",
+ "# given that h**2+k**2+l**2 = 8\n",
+ "a = math.sqrt(8)*d; \t\t\t#in angstorm\n",
+ "\n",
+ "# Results\n",
+ "print \"Interplanar Spacing (in angstorm) = %.3f A\"%d\n",
+ "print \"Lattice parameter of the crystal (in Angstorm) = %.2f A\"%a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Interplanar Spacing (in angstorm) = 1.212 A\n",
+ "Lattice parameter of the crystal (in Angstorm) = 3.43 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10 pageno : 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "# Variables\n",
+ "w = 0.0708;\t\t\t #wavelength in nm\n",
+ "h = 1.;\n",
+ "k = 0.;\n",
+ "l = 0.;\n",
+ "s = 0.0132; \t\t\t#a common divisor i.e.math.sin**2(theta) = 0.0132\n",
+ "\n",
+ "# Calculations\n",
+ "a = math.sqrt((w**2*(h**2+k**2+l**2))/(4*s));\t\t\t#in nm\n",
+ "a1 = 10.**3*a;\t\t\t #in pm\n",
+ "\n",
+ "# Results\n",
+ "print \"Dimension of unit cell (in Picometer) = %.1f pm\"%a1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dimension of unit cell (in Picometer) = 308.1 pm\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file