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
|
{
"metadata": {
"name": "",
"signature": "sha256:d8ffd8fd29d5d24b3cc8b2545e898e818e9d8ef837edfe4af93ac3d5f1b9fea0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1: RELATIVITY"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.2, page no. 18"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"#Variable declaration\n",
"T1 = 3.0 #proper time(s)\n",
"c = 3 * 10**8 #Speed of light(m/s)\n",
"v = 0.95 * c #speed of observer(m/s)\n",
"\n",
"#calculation\n",
"\n",
"Y = 1/math.sqrt((1-(v/c)**2)) #factor by which it runs slower\n",
"T = Y * T1 #Period of the pendulum (s)\n",
"\n",
"#result\n",
"print \"The Period of the pendulum when measured by the observer is\",round(T,1),\"s\"\n",
"\n",
"\n",
"#Variable declaration\n",
"T1 = 3.0 #proper time(s)\n",
"c = 3 * 10**8 #Speed of light(m/s)\n",
"Vnew = (0.95 + 0.05*0.95) * c #speed of observer(m/s)\n",
"\n",
"#calculation\n",
"\n",
"Y = 1/math.sqrt((1-(Vnew/c)**2))\n",
"T = Y * T1 \n",
"\n",
"#result\n",
"print \"Exercise:The Period of the pendulum when measured by the observer is\",round(T,1),\"s\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Period of the pendulum when measured by the observer is 9.6 s\n",
"Exercise:The Period of the pendulum when measured by the observer is 42.5 s\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.3, page no. 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math\n",
"\n",
"#variable declaration\n",
"\n",
"Lp = 100 #proper length of the spaceship(m)\n",
"c = 3 * 10**8 #speed of light(m/s)\n",
"v = 0.99 * c #speed of the observer(m/s)\n",
"\n",
"#calculation\n",
"\n",
"L = Lp * math.sqrt((1-(v/c)**2)) #Length of the spaceship (m)\n",
"\n",
"#result\n",
"\n",
"print \"The length measured as the spaceship flies by is\",round(L),\"m\"\n",
"\n",
"#variable declaration\n",
"\n",
"Lp = 100 #proper length of the spaceship(m)\n",
"c = 3 * 10**8 #speed of light(m/s)\n",
"v = 0.01 * c #speed of the observer(m/s)\n",
"\n",
"#calculation\n",
"\n",
"L = Lp * math.sqrt((1-(v/c)**2))\n",
"\n",
"#result\n",
"\n",
"print \"Exercise:The length measured as the spaceship flies by is\",round(L,2),\"m\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The length measured as the spaceship flies by is 14.0 m\n",
"Exercise:The length measured as the spaceship flies by is 99.99 m\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.4, page no. 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"#variable declaration\n",
"\n",
"Lp = 435 #proper length of the spaceship(m)\n",
"c = 3 * 10**8 #speed of light(m/s)\n",
"v = 0.97 * c #speed of the spaceship(m/s)\n",
"\n",
"#calculation\n",
"\n",
"L = Lp * math.sqrt((1-(v/c)**2)) #altitude of the spaceship (m)\n",
"\n",
"#result\n",
"\n",
"print \"The altitude of the spaceship as measured by an observer in the spaceship is\",round(L),\"m\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The altitude of the spaceship as measured by an observer in the spaceship is 106.0 m\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.5, page no. 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"#variable declaration\n",
"\n",
"Lp = 50 #horizontal length of the spaceship (m)\n",
"c = 3 * 10**8 #speed of light (m/s)\n",
"v = 0.95 * c #speed of the observer (m/s)\n",
"\n",
"#calculation\n",
"\n",
"L = Lp * math.sqrt((1-(v/c)**2)) #length (m)\n",
"\n",
"#result\n",
"\n",
"print \"The horizontal length measured as seen by the observer\",round(L,1),\"m.\\nThe 25m vertical height is unchanged because it is perpendicular to the direction of relative motion between the observer and the spaceship.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The horizontal length measured as seen by the observer 15.6 m.\n",
"The 25m vertical height is unchanged because it is perpendicular to the direction of relative motion between the observer and the spaceship.\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.6, page no. 25"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"#variable declaration\n",
"\n",
"Yobs = 475.0 #observed wavelength (nm)\n",
"Ysource = 394.0 #source wavelength (nm)\n",
"c = 3 * 10**8 #speed of light (m/s)\n",
"\n",
"#calculation\n",
"\n",
"v = c*(((Yobs**2)-(Ysource**2))/((Yobs**2)+(Ysource**2))) #velocity (m/s)\n",
"\n",
"#result\n",
"\n",
"print \"The Hydra is receding from us at\",round(v/10**7,2),\"x 10^7 m/s\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Hydra is receding from us at 5.54 x 10^7 m/s\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.8, page no. 30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"#Variable declaration\n",
"\n",
"c = 3 * 10 **8 #speed of light (m/s)\n",
"v = 0.750 * c #speed of spacecraft A relative to an observer on Earth(m/s)\n",
"ux = -0.850 *c #speed of spacecraft B relative to an observer on Earth(m/s)\n",
"\n",
"#calculation\n",
"\n",
"ux1 = (ux-v)/(1-((ux*v)/(c**2))) #velocity (m/s)\n",
"\n",
"#results\n",
"\n",
"print \"The velocity of B with respect to A is\",round(ux1/c,4),\"c\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The velocity of B with respect to A is -0.9771 c\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.9, page no. 30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"#Variable declaration\n",
"\n",
"c = 3 * 10 **8 #speed of light (m/s)\n",
"v = 0.800 * c #velocity of the motorcycle with respect to the stationary observer (m/s)\n",
"ux1 = 0.700 *c #velocity of the ball in the frame of reference of the motorcyclist (m/s)\n",
"\n",
"#calculation\n",
"\n",
"ux = (ux1+v)/(1+((ux1*v)/(c**2))) #velocity (m/s)\n",
"\n",
"#results\n",
"\n",
"print \"The velocity of the ball relative to the stationary observer is\",round(ux/c,4),\"c\"\n",
"\n",
"\n",
"#Variable declaration\n",
"\n",
"c = 3 * 10 **8 #speed of light (m/s)\n",
"v = 0.800 * c #velocity of the motorcycle with respect to the stationary observer (m/s)\n",
"ux1 = c #velocity of the beam of light in the frame of reference of the motorcyclist (m/s)\n",
"\n",
"#calculation\n",
"\n",
"ux = (ux1+v)/(1+((ux1*v)/(c**2))) #velocity (m/s)\n",
"\n",
"#results\n",
"\n",
"print \"The speed of the beam of light relative to the stationary observer is\",round(ux/c,4),\"c\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The velocity of the ball relative to the stationary observer is 0.9615 c\n",
"The speed of the beam of light relative to the stationary observer is 1.0 c\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.10, page no. 30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"#Variable declaration\n",
"\n",
"c = 3 * 10 **8 #speed of light (m/s)\n",
" #observations of stationary police officer\n",
"uxa = 0.75 * c # velocity of pack leader Alpha in x direction (m/s)\n",
"uya = 0 # velocity of pack leader Alpha in y direction (m/s)\n",
"uxb = 0 # velocity of pack leader Beta in x direction (m/s)\n",
"uyb = -0.9 * c # velocity of pack leader Beta in y direction (m/s) \n",
" \n",
"#calculation\n",
"\n",
"ux1 = (uxb-uxa)/(1-((uxb*uxa)/(c**2))) #speed in X axis (m/s)\n",
"uy1 = (math.sqrt(1-((uxa**2)/(c**2)))*(uyb))#/(1-((uxb*uxa)/(c**2))) #speed in Y axis (m/s)\n",
"u1 = math.sqrt(ux1**2 + uy1**2) #total speed (m/s)\n",
"\n",
"#results\n",
"\n",
"print \"The speed of recession of Beta away from Alpha as observed by Alpha is then found to be\",round(u1/c,2),\"c\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The speed of recession of Beta away from Alpha as observed by Alpha is then found to be 0.96 c\n"
]
}
],
"prompt_number": 15
}
],
"metadata": {}
}
]
}
|