summaryrefslogtreecommitdiff
path: root/Applied_Physics_for_Engineers/Chapter_6.ipynb
blob: 2e0b3f8c7143168a15656142d9e8d8ad64560ef6 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 6: X-rays"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.1, Page 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "i = 2e-003;  # Current through X-ray tube, A\n",
      "e = 1.6e-019;  # Charge on an electron, C\n",
      "V = 12.4e+003;  # Potential difference applied across X-ray tube, V \n",
      "m0 = 9.1e-031;  # Rest mass of the electron, Kg \n",
      "\n",
      "#Calculations&Results\n",
      "n = i/e;    # Number of electrons striking the target per second\n",
      "print \"The number of electrons striking the target per sec = %4.2e electrons\"%n\n",
      "v = sqrt(2*e*V/m0);  # Velocity of the electrons, m/s\n",
      "print \"The speed with which electrons strike the target = %4.2e m/s\"%v\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of electrons striking the target per sec = 1.25e+16 electrons\n",
        "The speed with which electrons strike the target = 6.60e+07 m/s\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.2, Page 370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "e = 1.6e-019;  # Charge on an electron, C\n",
      "V = 13.6e+003;  # Potential difference applied across X-ray tube, V \n",
      "m0 = 9.1e-031;  # Rest mass of the electron, Kg \n",
      "\n",
      "#Calculations\n",
      "v = sqrt(2*e*V/m0);  # Velocity of the electron, m/s \n",
      "\n",
      "#Result\n",
      "print \"The maximum speed with which the electrons strike the target = %4.2e m/s\"%v\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum speed with which the electrons strike the target = 6.92e+07 m/s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.3, Page 370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "d = 2.82e-010;  # Spacing of the rock-salt, m \n",
      "n = 2;  # Order of diffraction\n",
      "\n",
      "#Calculations\n",
      "theta = pi/2;    # Angle of diffraction, radian\n",
      "# Braggs equation for X-rays of wavelength lambda is n*lambda = 2*d*sin(theta), solving for lambda\n",
      "lamda = 2*d*sin(theta)/n;    # Wavelength of X-ray using Bragg's law, m\n",
      "\n",
      "#Result\n",
      "print \"The longest wavelength that can be analysed by a rock-salt crystal = %4.2f angstrom\"%(lamda/1e-010)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The longest wavelength that can be analysed by a rock-salt crystal = 2.82 angstrom\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.4, Page 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 3e-011;  # Wavelength of the X-ray, m\n",
      "d = 5e-011;  # Lattice spacing, m \n",
      "\n",
      "#Calculations&Results\n",
      "# Bragg's equation for X-rays of wavelength lambda is n*lambda = 2*d*sin(theta), solving for thetas\n",
      "for n in range(2,4):\n",
      "    theta = degrees(asin((n*lamda)/(2*d)));    \n",
      "    print \"For n = %d, theta = %.1f degrees\"%(n, theta)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For n = 2, theta = 36.9 degrees\n",
        "For n = 3, theta = 64.2 degrees\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.5, Page 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 3.6e-011;  # Wavelength of X-rays, m\n",
      "n = 1;    # Order of diffraction\n",
      "theta = 4.8;    # Angle of diffraction, degrees\n",
      "\n",
      "#Calculations\n",
      "# Braggs equation for X-rays is n*lambda = 2*d*sin(theta), solving for d\n",
      "d = n*lamda/(2*sin(theta*pi/180));    # Interplanar spacing, m\n",
      "\n",
      "#Result\n",
      "print \"The interplanar separation of atomic planes in the crystal = %4.2f angstrom\"%(d/1e-010)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interplanar separation of atomic planes in the crystal = 2.15 angstrom\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.6, Page 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "lambda1 = 0.71;  # Wavelength of k alpha line in molybdenum, angstrom\n",
      "Z1 = 42;        # Atomic number of Mo\n",
      "Z2 = 29;        # Atomic number of Cu\n",
      "\n",
      "#Calculations\n",
      "# Wavelength of characteristic X-ray for K-alpha spectral line is given by \n",
      "# 1/lambda = 3/4*R*(Z-1)^2 then\n",
      "lambda2 = lambda1*(Z1-1)**2/(Z2-1)**2;    # The wavelength of K alpha radiation in copper, m\n",
      "\n",
      "#Result\n",
      "print \"The wavelength of K-alpha radiation in copper = %4.2f angstrom\"%lambda2\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength of K-alpha radiation in copper = 1.52 angstrom\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.7, Page 372"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "phi = pi/2;    # Scattering angle, degrees\n",
      "m0 = 9.1e-031;  # Rest mass of an electron, kg\n",
      "h =  6.62e-034;  # Planck's constant, J-s\n",
      "c = 3e+008;  # Speed of light in vacuum, m/s \n",
      "E = 8.16e-014;  # Energy of gamma radiation, J\n",
      "\n",
      "#Calculations\n",
      "lamda = h*c/(E*1e-010);    # Wavelength of incident photon, angstrom \n",
      "lambda_prime = lamda+h*(1-cos(phi*pi/180))/(m0*c*1e-010);    # Wavelength of scattered photon, angstrom\n",
      "\n",
      "#Result\n",
      "print \"The wavelength of radiation at 90 degrees = %6.4f angstrom\"%(lambda_prime+lamda)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength of radiation at 90 degrees = 0.0487 angstrom\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.8, Page 372"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "phi = 90;    # Scattering angle, radian\n",
      "m0 = 9.1e-031;  # Rest mass of the electron, kg\n",
      "h =  6.62e-034;  # Planck's constant, J-s\n",
      "c = 3e+008;  # Speed of light in vacuum, m/s \n",
      "lamda = 1.00 ;  # Wavelength of incident photon,in angstrom\n",
      "\n",
      "#Calculations\n",
      "del_lambda = (h*(1-round(cos(degrees(phi))))/(m0*c))/10**-10;    # Compton shift, angstrom\n",
      "\n",
      "#Result\n",
      "print \"The Compton shift = %.4f angstrom\"%del_lambda\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Compton shift = 0.0242 angstrom\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.9, Page 373"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "#Variable declaration\n",
      "phi = pi/2;       # Scattering angle, radian\n",
      "m0 = 9.1e-031;  # Rest mass of the electron, kg\n",
      "h =  6.62e-034;  # Planck's constant, J-s\n",
      "c = 3e+008;  # Speed of light in vacuum, m/s \n",
      "\n",
      "#Calculations\n",
      "# As Compton shift = del_lambda = lambda, so\n",
      "lamda = h*(1-cos(phi))/(m0*c*1e-010);    # Wavelength of incident photon, angstrom\n",
      "\n",
      "#Result\n",
      "print \"The wavelength of incident radiation = %6.4f angstrom\"%lamda\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength of incident radiation = 0.0242 angstrom\n"
       ]
      }
     ],
     "prompt_number": 55
    }
   ],
   "metadata": {}
  }
 ]
}