summaryrefslogtreecommitdiff
path: root/Materials_Science_and_Engineering/Chapter3.ipynb
blob: 6aa9a60dfd732c1beb01d87c97d7ac60ad5b4d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 03 : Crystalgeometry and Structure Determination"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, Page No 25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "sc_n = 1.0/8 \t\t# sharing of one lattice point in a unit cell\n",
      "sc_N = 8.0\t\t \t# Number of lattice points in Simple cubic \n",
      "bcc_n_e = 1.0/4\t\t# sharing of one edge lattice point in a BCC \n",
      "bcc_N_e = 4.0\t\t# Number of edge lattice point in a BCC \n",
      "bcc_n_c  = 1.0\t\t# sharing of one body center lattice point in a BCC \n",
      "bcc_N_c = 1.0\t\t# Number of body center lattice point in a BCC \n",
      "fcc_n_e = 1.0/8 \t# sharing of one corner lattice point in a FCC \n",
      "fcc_N_e = 8.0\t\t# Number of corner lattice point in a FCC \n",
      "fcc_n_f = 1.0/2 \t# sharing of one face center lattice point in a FCC \n",
      "fcc_N_f = 6.0\t\t# Number of face center lattice point in a FCC \n",
      "\n",
      "#Calculations\n",
      "sc_net = sc_n*sc_N\n",
      "bcc_net = bcc_n_e*bcc_N_e+bcc_n_c*bcc_N_c\n",
      "fcc_net = fcc_n_e*fcc_N_e+fcc_n_f*fcc_N_f\n",
      "\n",
      "#Results\n",
      "\n",
      "print(\"Effective number of lattice points are as:\")\n",
      "print(\"Space lattice \\t Abbreviation \\t Effective number of lattice point in unit cell \\n\")\n",
      "print(\"Simple cubic \\t\\tSC \\t\\t %.2f \" %sc_net)\n",
      "print(\"Body center cubic\\tBCC \\t\\t %.2f \" %bcc_net)\n",
      "print(\"Face centered cubic\\tFCC \\t\\t %.2f \" %fcc_net)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Effective number of lattice points are as:\n",
        "Space lattice \t Abbreviation \t Effective number of lattice point in unit cell \n",
        "\n",
        "Simple cubic \t\tSC \t\t 1.00 \n",
        "Body center cubic\tBCC \t\t 2.00 \n",
        "Face centered cubic\tFCC \t\t 4.00 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7, Page No 40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "a = 3.16    #lattice parameter in angstrom\n",
      "l1 = 1.0    # line number\n",
      "l2 = 2.0    # line number\n",
      "l3 = 3.0    # line number\n",
      "l4 = 4.0    # line number\n",
      "theta1 = 20.3   # angle for line 1\n",
      "theta2 = 29.2   # angle for line 2\n",
      "theta3 = 36.7   # angle for line 3\n",
      "theta4 = 43.6   # angle for line 4\n",
      "n = 1           # order \n",
      "lambda1 = 1.54   # wavelength in angstrom\n",
      "\n",
      "#Calculations\n",
      "d1 = lambda1/(2*math.sin(theta1*math.pi/180))\n",
      "d2 = lambda1/(2*math.sin(theta2*math.pi/180))\n",
      "d3 = lambda1/(2*math.sin(theta3*math.pi/180))\n",
      "d4 = lambda1/(2*math.sin(theta4*math.pi/180))\n",
      "x1 = a**2/d1**2  \n",
      "x2 = a**2/d2**2  \n",
      "x3 = a**2/d3**2  \n",
      "x4 = a**2/d4**2 \t\t# where x is function of h,k and l\n",
      "\n",
      "#Results\n",
      "print(\"Interplanar spacing is  %.3f angstrom \" %x1) # answer in book is 2.220 angstrom\n",
      "if  math.floor(x1) == 2 :\n",
      "    print(\"For a^2/d^2 = %.2f \\t Reflection plane is 110\" %math.floor(x1))\n",
      "\n",
      "if math.floor(x2) == 4 :\n",
      "\tprint(\"For a^2/d^2 = %.2f \\t Reflection plane is 200\" %math.floor(x2))\n",
      "\n",
      "if math.floor(x3) == 6 :\n",
      "    print(\"For a^2/d^2 = %.2f \\t Reflection plane is 211\" %math.floor(x3))\n",
      "\n",
      "if math.floor(x4) == 8 :\n",
      "\tprint(\"For a^2/d^2 = %.2f \\t Reflection plane is 220\" %math.floor(x4))\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Interplanar spacing is  2.027 angstrom \n",
        "For a^2/d^2 = 2.00 \t Reflection plane is 110\n",
        "For a^2/d^2 = 4.00 \t Reflection plane is 200\n",
        "For a^2/d^2 = 6.00 \t Reflection plane is 211\n",
        "For a^2/d^2 = 8.00 \t Reflection plane is 220\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8, Page No 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "d = 114.6 # diameter of power camera in angstrom\n",
      "lambda1 = 1.54 # wavelength in angstrom\n",
      "s1 = 86.0\n",
      "s2 = 100.0\n",
      "s3 = 148.0\n",
      "s4 = 180.0\n",
      "s5 = 188.0\n",
      "s6 = 232.0 \n",
      "s7 = 272.0\n",
      "\n",
      "#Calculations\n",
      "R = d/2      # Radius \n",
      "if R==57.3 :\n",
      "    k = 1.0/4 \t\t\t# Bragg angle factor\n",
      "a1 = (math.sin(s1*k*math.pi/180))**2\n",
      "a2 = (math.sin(s2*k*math.pi/180))**2\n",
      "a3 = (math.sin(s3*k*math.pi/180))**2\n",
      "a4 = (math.sin(s4*k*math.pi/180))**2\n",
      "a5 = (math.sin(s5*k*math.pi/180))**2\n",
      "a6 = (math.sin(s6*k*math.pi/180))**2\n",
      "a7 = (math.sin(s7*k*math.pi/180))**2\n",
      "\n",
      "c = 22 # constant to convert into integral number\n",
      "\n",
      "#Results\n",
      "print(\"Within experimental error, values are as in integral ratio are as:\")\n",
      "print(\"%.2f  \" %math.ceil(c*a1))\n",
      "print(\"%.2f  \" %math.ceil(c*a2))\n",
      "print(\"%.2f  \" %math.ceil(c*a3))\n",
      "print(\"%.2f  \" %math.ceil(c*a4))\n",
      "print(\"%.2f  \" %math.ceil(c*a5))\n",
      "print(\"%.2f  \" %math.ceil(c*a6))\n",
      "print(\"%.2f  \" %math.ceil(c*a7))\n",
      "\n",
      "print(\"\\n So, this structure is FCC and material is copper with 3.62 angstrom lattice parameter\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Within experimental error, values are as in integral ratio are as:\n",
        "3.00  \n",
        "4.00  \n",
        "8.00  \n",
        "11.00  \n",
        "12.00  \n",
        "16.00  \n",
        "19.00  \n",
        "\n",
        " So, this structure is FCC and material is copper with 3.62 angstrom lattice parameter\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}