summaryrefslogtreecommitdiff
path: root/Modern_Physics_by_K_S_Krane/chapter4_1.ipynb
blob: 9b118dda71eee751b870c39b58b0d3cd4f0fe052 (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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
{
 "metadata": {
  "name": "",
  "signature": "sha256:f3a8bba44ff010c0f1004529fad8de811f19168b5752929eb1e0272cfc5fc53c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "4: Crystallography"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.2, Page number 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "d=2180;      #density of NaCl(kg/m^3)\n",
      "M=23+35.5;      #Molecular weight of NaCl(gm)\n",
      "Na=6.02*10**26;         #Avgraodo no(per kg mole)\n",
      "n=4;        #for f.c.c\n",
      "\n",
      "#calculation\n",
      "a=(n*M/(Na*d))**(1/3);       #lattice constant(m)\n",
      "d=a/2;               #distance(m)\n",
      "d=d*10**10;        #distance(angstrom)\n",
      "d=math.ceil(d*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"distance between two adajcent atoms is\",d,\"angstrom\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "distance between two adajcent atoms is 2.815 angstrom\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.3, Page number 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "d=2.163;      #density(gm/cm^3)\n",
      "M=58.45;      #molecular weight(gm)\n",
      "Na=6.02*10**23;      #Avgraodo no.(molecules/gm mole)\n",
      "\n",
      "#calcualtion\n",
      "n=Na/M;      #no. of molecules(per gram)\n",
      "n=n*d;       #no. of molecules(per cm^3) \n",
      "n=2*n;       #no. of atom(per cm^3)\n",
      "n=n**(1/3);        #no. of atoms in a row 1cm long\n",
      "d=1/n;           #spacing between atoms(cm)\n",
      "\n",
      "#Result\n",
      "print \"spacing between atoms is\",round(d/1e-8,2),\"angstrom\"\n",
      "print \"answer in the book varies due to rounding off errors\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "spacing between atoms is 2.82 angstrom\n",
        "answer in the book varies due to rounding off errors\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.4, Page number 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "r=1.278;     #radius(A.U)\n",
      "n=4;        #structure is f.c.c\n",
      "M=63.54;      #atomic weight(gm)\n",
      "Na=6.02*10**23;       #Avgraodo no.(per gm mole)\n",
      "\n",
      "#calculation \n",
      "a=4*r/(math.sqrt(2));        #lattice constant(A.U)\n",
      "V=a**3;          #volume(cm^3)\n",
      "rho=n*M/(Na*V);    #density(gm/cm^3)\n",
      "rho=rho*(10**8)**3      #density(gm/m^3)\n",
      "\n",
      "#Result\n",
      "print \"Density is\",round(rho,2),\"g/m^3\"\n",
      "print \"answer in the textbook varies due to rounding off errors\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Density is 8.94 g/m^3\n",
        "answer in the textbook varies due to rounding off errors\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.10, Page number 85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Vaiable declaration\n",
      "r=1.746;    #atomic radius(AU)\n",
      "\n",
      "#calulation\n",
      "a=4*r/math.sqrt(2);         #lattice constant(AU)\n",
      "#for (200)\n",
      "h=2;k=0;l=0;\n",
      "d=a/math.sqrt(h**2+k**2+l**2);          #interplanar spacing(AU)\n",
      "#for (220)\n",
      "h=2;k=2;l=0;            \n",
      "d1=a/math.sqrt(h**2+k**2+l**2);         #interplanar spacing(AU)\n",
      "#for (111)\n",
      "h=1;k=1;l=1;\n",
      "d2=a/math.sqrt(h**2+k**2+l**2);         #interplanar spacing(AU)\n",
      "d=math.ceil(d*10**4)/10**4;   #rounding off to 4 decimals\n",
      "d1=math.ceil(d1*10**3)/10**3;   #rounding off to 3 decimals\n",
      "d2=math.ceil(d2*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"spacing for (200) is\",d,\"A.U\"\n",
      "print \"answer in the book varies in 3rd decimal due to rounding off errors\"\n",
      "print \"spacing for (220) is\",d1,\"A.U\"\n",
      "print \"spacing for (111) is\",d2,\"A.U\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "spacing for (200) is 2.4693 A.U\n",
        "answer in the book varies in 3rd decimal due to rounding off errors\n",
        "spacing for (220) is 1.746 A.U\n",
        "spacing for (111) is 2.852 A.U\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.11, Page number 86"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#calculation\n",
      "#for (i)\n",
      "l=1;m=0;n=0;\n",
      "p=0;q=1;r=0;\n",
      "d=math.acos(((l*p)+(m*q)+(n*r))/(math.sqrt(l**2+m**2+n**2)*math.sqrt(p**2+q**2+r**2)));      #angle between 2 normals(radian)\n",
      "theta=math.degrees(d);         #angle between 2 normals(degrees) \n",
      "\n",
      "#for (ii)\n",
      "l=1;m=2;n=1;\n",
      "p=1;q=1;r=1;\n",
      "d1=math.acos(((l*p)+(m*q)+(n*r))/(math.sqrt(l**2+m**2+n**2)*math.sqrt(p**2+q**2+r**2)));       #angle between 2 normals(radian)\n",
      "theta1=math.degrees(d1);              #angle between 2 normals(degrees)  \n",
      "deg=int(theta1);             #angle(degrees)\n",
      "t=60*(theta1-deg);\n",
      "m=int(t);                   #angle(minutes)\n",
      " \n",
      "#Result\n",
      "print \"angle between the normal to pair of miller incdices (100) and (010) is\",theta,\"degrees\"\n",
      "print \"angle between the normal to pair of miller incdices (121) and (111) is\",deg,\"degrees\",m,\"minutes\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle between the normal to pair of miller incdices (100) and (010) is 90.0 degrees\n",
        "angle between the normal to pair of miller incdices (121) and (111) is 19 degrees 28 minutes\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 4.13, Page number 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#import modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#variable declaration\n",
      "a=3.61*10**-7;      #lattice constant(mm)\n",
      "\n",
      "#Calcualtion\n",
      "#for plane (100)\n",
      "SA=a*a;      #surface area(mm^2)\n",
      "tamc=2;     #total atoms included\n",
      "ans=tamc/SA;        #number of atoms per mm^2\n",
      "#for (ii) plane (110)\n",
      "A=a*(math.sqrt(2)*a);      #area of the plane(mm^2)\n",
      "tamc=2;     #total atoms included according to sketch\n",
      "ans1=tamc/A;       #number of atoms per mm^2\n",
      "#for (iii) plane (111)\n",
      "A=0.866*a*a;      #area of the plane(mm^2)\n",
      "tamc=2;         #total atoms included according to sketch\n",
      "ans2=tamc/A;      #number of atoms per mm^2\n",
      "\n",
      "#Result\n",
      "print \"atoms per mm^2 for (100) is\",round(ans/1e+13,3),\"*10**13 atoms/mm^2\"\n",
      "print \"atoms per mm^2 for (110) is\",round(ans1/1e+13,3),\"*10**13 atoms/mm^2\"\n",
      "print \"atoms per mm^2 for (111) is\",round(ans2/1e+13,3),\"*10**13 atoms/mm^2\"\n",
      "print \"answer for plane (111) given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "atoms per mm^2 for (100) is 1.535 *10**13 atoms/mm^2\n",
        "atoms per mm^2 for (110) is 1.085 *10**13 atoms/mm^2\n",
        "atoms per mm^2 for (111) is 1.772 *10**13 atoms/mm^2\n",
        "answer for plane (111) given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}