summaryrefslogtreecommitdiff
path: root/Applied_Physics/Chapter4.ipynb
blob: 6c9c83eb15bbb30efb996efbc934fdab225ed1bd (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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
{
 "metadata": {
  "name": "",
  "signature": "sha256:177e44357417b2cfb0b476ada5b36a934225ade51d50763b09586ba8679f08fc"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4:Crystal Diffraction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 , Page no:75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "lambda1=2.6; #in Angstrom (wavelength)\n",
      "theta=20; #in Degree (angle)\n",
      "n=2;\n",
      "\n",
      "#calculate\n",
      "lambda1=lambda1*1E-10; #since lambda is in Angstrom\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore d=n(lambda)/2sin(theta)\n",
      "d=n*lambda1/(2*math.sin(math.radians(theta)));\n",
      "\n",
      "#result\n",
      "print\"The spacing constant is d=\",d,\"m\";\n",
      "print\"\\t\\t\\td=\",d*10**10,\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The spacing constant is d= 7.60189144042e-10 m\n",
        "\t\t\td= 7.60189144042 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 , Page no:75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "h=1;k=1;l=0; #miller indices\n",
      "a=0.26; #in nanometer (lattice constant)\n",
      "lambda1=0.065; #in nanometer (wavelength)\n",
      "n=2; #order\n",
      "\n",
      "#calculate\n",
      "d=a/math.sqrt(h**2+k**2+l**2); #calculation of interlattice spacing\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "theta=math.asin(n*lambda1/(2*d));\n",
      "theta1=theta*180/3.14;\n",
      "\n",
      "#result\n",
      "print\"The glancing angle is =\",round(theta1,2),\"degree\";\n",
      "print \"Note: there is slight variation in the answer due to round off error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The glancing angle is = 20.72 degree\n",
        "Note: there is slight variation in the answer due to round off error\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3 , Page no:75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "d=3.04E-10; #in mm (spacing constant)\n",
      "lambda1=0.79; #in Angstrom (wavelength)\n",
      "n=3; #order\n",
      "\n",
      "#calculate\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "lambda2=lambda1*1E-10; #since lambda is in angstrom\n",
      "theta=math.asin(n*lambda2/(2*d));\n",
      "theta1=theta*180/3.14;\n",
      "\n",
      "#result\n",
      "print\"The glancing angle is\",round(theta1,3),\"degree\";\n",
      "print \"Note: In question the value of d=3.04E-9 cm but in solution is using d=3.04E-10 m. So I have used d=3.04E-10 cm as used in the solution\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The glancing angle is 22.954 degree\n",
        "Note: In question the value of d=3.04E-9 cm but in solution is using d=3.04E-10 m. So I have used d=3.04E-10 cm as used in the solution\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 , Page no:76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "d=0.282; #in nanometer (spacing constant)\n",
      "n=1; #order\n",
      "theta=8.35; #in degree (glancing angle)\n",
      "\n",
      "#calculate\n",
      "d=d*1E-9; #since d is in nanometer\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "lambda1=2*d*math.sin(math.radians(theta))/n; \n",
      "lambda_1=lambda1*1E10; #changing unit from m to Angstrom\n",
      "theta_1=90; #in degree (for maximum order theta=90)\n",
      "n_max=2*d*math.sin(math.radians(theta_1))/lambda1; #calculation of maximum order. \n",
      "\n",
      "#result\n",
      "print\"The wavelength  =\",lambda1,\"m\";\n",
      "print\"\\t\\t=\" ,round(lambda_1,3),\"Angstrom\";\n",
      "print\"The maximum order possible is n=\",round(n_max);\n",
      "print \"Note: In question value of theta=8 degree and 35 minutes but solution uses theta=8.35 degree.So I am using theta=8.35 degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength  = 8.19038939236e-11 m\n",
        "\t\t= 0.819 Angstrom\n",
        "The maximum order possible is n= 7.0\n",
        "Note: In question value of theta=8 degree and 35 minutes but solution uses theta=8.35 degree.So I am using theta=8.35 degree\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5 , Page no:76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "theta=6; #in degree (glancing angle)\n",
      "p=2170; #in Kg/m^3 (density)\n",
      "M=58.46; #Molecular weight of NaCl\n",
      "N=6.02E26; #in Kg-molecule (Avogadro's number)\n",
      "n=1; #order\n",
      "XU=1E-12; #since 1X.U.= 1E-12m\n",
      "\n",
      "#calculate\n",
      "d=(M/(2*N*p))**(1/3); #calclation of lattice constant\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "lambda1=2*d*math.sin(math.radians(theta))/n; #calculation of wavelength\n",
      "lambda2=lambda1/XU;\n",
      "\n",
      "#result\n",
      "print\"The spacing constant is d=\",d,\"m\";\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t\\t  =\",lambda2,\"X.U\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The spacing constant is d= 2.81789104396e-10 m\n",
        "The wavelength is = 5.89099640962e-11 m\n",
        "\t\t  = 58.9099640962 X.U\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6 , Page no:77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "h=1;k=1;l=1; #miller indices\n",
      "a=5.63; #in Angstrom  (lattice constant)\n",
      "theta=27.5; #in degree (Glancing angle)\n",
      "n=1; #order\n",
      "H=6.625E-34; #in J-s (Plank's constant)\n",
      "c=3E8; #in m/s (velocity of light)\n",
      "e=1.6E-19; #charge of electron\n",
      "\n",
      "#calculate\n",
      "d=a/math.sqrt(h**2+k**2+l**2); #calculation for interplanar spacing\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "lambda1=2*d*math.sin(math.radians(theta))/n; #calculation for wavelength\n",
      "E=H*c/(lambda1*1E-10); #calculation of Energy\n",
      "E1=E/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The lattice spacing is d=\",round(d,2),\"Angstrom\";\n",
      "print\"The wavelength is =\",round(lambda1),\"Angstrom\";\n",
      "print\"The energy of X-rays is E=\",E,\"J\";\n",
      "print\"\\t\\t\\tE=\",E1,\"eV\";\n",
      "print \"Note: c=3E8 m/s but in solution c=3E10 m/s \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lattice spacing is d= 3.25 Angstrom\n",
        "The wavelength is = 3.0 Angstrom\n",
        "The energy of X-rays is E= 6.62100284311e-16 J\n",
        "\t\t\tE= 4138.12677695 eV\n",
        "Note: c=3E8 m/s but in solution c=3E10 m/s \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7 , Page no:77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "V=344; #in V (accelerating voltage)\n",
      "theta=60; #in degree (glancing angle)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.625e-34; #in J-s (Plank's constant)\n",
      "n=1; #order\n",
      "e=1.6E-19; #charge on electron\n",
      "\n",
      "#calculate\n",
      "#Since K=m*v^2/2=e*V\n",
      "#therefore  v=sqrt(2*e*V/m)\n",
      "#since lambda=h/(m*v)\n",
      "#therefore we have lambda=h/sqrt(2*m*e*V)\n",
      "lambda1=h/math.sqrt(2*m*e*V); #calculation of lambda\n",
      "lambda2=lambda1*1E10; #changing unit from m to Angstrom\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "d=n*lambda2/(2*math.sin(math.radians(theta)));\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t\\t  =\",round(lambda2,2),\"Angstrom\";\n",
      "print\"The interplanar spacing  is  d=\",round(d,2),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 6.61928340764e-11 m\n",
        "\t\t  = 0.66 Angstrom\n",
        "The interplanar spacing  is  d= 0.38 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8 , Page no:78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "K=0.02; #in eV (kinetic energy)\n",
      "d=2.0; #in Angstrom (Bragg's spacing)\n",
      "m=1.00898; #in amu (mass of neutron)\n",
      "amu=1.66E-27; #in Kg (1amu=1.66E-27 Kg)\n",
      "h=6.625e-34; #in J-s (Plank's constant)\n",
      "n=1; #order\n",
      "e=1.6E-19; #charge on electron\n",
      "\n",
      "#calculate\n",
      "#Since K=m*v^2/2\n",
      "#therefore  v=sqrt(2*K/m)\n",
      "#since lambda=h/(m*v)\n",
      "#therefore we have lambda=h/sqrt(2*m*K)\n",
      "m=m*amu; #changing unit from amu to Kg\n",
      "K=K*e; #changing unit to J from eV\n",
      "lambda1=h/math.sqrt(2*m*K); #calculation of lambda\n",
      "lambda2=lambda1*1E10; #changing unit from m to Angstrom\n",
      "theta=math.asin(n*lambda2/(2*d)); #calculation of angle of first order diffraction maximum\n",
      "theta1=theta*180/3.14;\n",
      "#result\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t    \\t  =\",round(lambda2),\"Angstrom\";\n",
      "print\"The angle of first order diffraction maximum is \",round(theta1),\"Degree\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 2.02348771817e-10 m\n",
        "\t    \t  = 2.0 Angstrom\n",
        "The angle of first order diffraction maximum is  30.0 Degree\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9 , Page no:79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "lambda1=0.586; #in Angstrom (wavelength of X-rays)\n",
      "n1=1; n2=2; n3=3; #orders of diffraction\n",
      "theta1=5+(58/60); #in degree (Glancing angle for first order of diffraction)\n",
      "theta2=12+(01/60); #in degree (Glancing angle for second order of diffraction)\n",
      "theta3=18+(12/60); #in degree (Glancing angle for third order of diffraction)\n",
      "\n",
      "#calculate\n",
      "K1=math.sin(math.radians(theta1));\n",
      "K2=math.sin(math.radians(theta2));\n",
      "K3=math.sin(math.radians(theta3));\n",
      "#Since 2dsin(theta)=n(lambda)\n",
      "#therefore we have\n",
      "d1=n1*lambda1/(2*K1);\n",
      "d2=n2*lambda1/(2*K2);\n",
      "d3=n3*lambda1/(2*K3);\n",
      "d1=d1*1E-10; #changing unit from Angstrom to m\n",
      "d2=d2*1E-10; #changing unit from Angstrom to m\n",
      "d3=d3*1E-10; #changing unit from Angstrom to m\n",
      "d=(d1+d2+d3)/3;\n",
      "\n",
      "#result\n",
      "print\"The value of sine of different angle of diffraction is \\nK1=\",K1;\n",
      "print\"K2=\",K2;\n",
      "print\"K3=\",K3;\n",
      "#Taking the ratios of K1:K2:K3\n",
      "#We get K1:K2:K3=1:2:3\n",
      "#Therefore we have\n",
      "print\"Or we have K1:K2:K3=1:2:3\";\n",
      "print\"Hence these angles of incidence are for Ist, 2nd and 3rd order reflections respectively\";\n",
      "print\"The spacing constants are \\nd1=\",d1;\n",
      "print\"d2=\",d2;\n",
      "print\"d3=\",d3;\n",
      "print\"The mean value of crystal spacing is d=\",d,\"m\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of sine of different angle of diffraction is \n",
        "K1= 0.103949856225\n",
        "K2= 0.208196213621\n",
        "K3= 0.312334918512\n",
        "Or we have K1:K2:K3=1:2:3\n",
        "Hence these angles of incidence are for Ist, 2nd and 3rd order reflections respectively\n",
        "The spacing constants are \n",
        "d1= 2.81866671719e-10\n",
        "d2= 2.81465253286e-10\n",
        "d3= 2.81428667722e-10\n",
        "The mean value of crystal spacing is d= 2.81586864243e-10 m\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}