summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_G._Aruldhas/Chapter8_1.ipynb
blob: af1e48b491fb266eb8c190d8e29cfeb92fc0a391 (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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
{
 "metadata": {
  "name": "",
  "signature": "sha256:1888e774039c89bc21625752ef2171fa6b8e8f5f67497ebbdba82729676e8946"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "8: Special Theory of Relativity"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.1, Page number 171"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "L_0 = 1;     #For simplicity, we assume classical length to be unity(m)\n",
      "c = 1;       #For simplicity assume speed of light to be unity(m/s)\n",
      "\n",
      "#Calculation\n",
      "L = (1-1/100)*L_0;     #Relativistic length(m)\n",
      "#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\n",
      "v = math.sqrt(1-(L/L_0)**2)*c;    #Speed at which relativistic length is 1 percent of the classical length(m/s)\n",
      "v = math.ceil(v*10**4)/10**4;     #rounding off the value of v to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The speed at which relativistic length is 1 percent of the classical length is\",v, \"c\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed at which relativistic length is 1 percent of the classical length is 0.1411 c\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.2, Page number 171"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;      #For simplicity assume speed of light to be unity(m/s)\n",
      "delta_t = 5*10**-6;    #Mean lifetime of particles as observed in the lab frame(s)\n",
      "\n",
      "#Calculation\n",
      "v = 0.9*c;    #Speed at which beam of particles travel(m/s)\n",
      "delta_tau = delta_t*math.sqrt(1-(v/c)**2);     #Proper lifetime of particle as per Time Dilation rule(s)\n",
      "\n",
      "#Result\n",
      "print \"The proper lifetime of particle is\",delta_tau, \"s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The proper lifetime of particle is 2.17944947177e-06 s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.3, Page number 171. theoritical proof"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.4, Page number 172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;      #For simplicity assume speed of light to be unity(m/s)\n",
      "\n",
      "#Calculation\n",
      "v = 0.6*c;    #Speed with which the rocket leaves the earth(m/s)\n",
      "u_prime = 0.9*c;     #Relative speed of second rocket w.r.t. the first rocket(m/s)\n",
      "u1 = (u_prime+v)/(1+(u_prime*v)/c**2);     #Speed of second rocket for same direction of firing as per Velocity Addition Rule(m/s)\n",
      "u1 = math.ceil(u1*10**4)/10**4;     #rounding off the value of u1 to 4 decimals\n",
      "u2 = (-u_prime+v)/(1-(u_prime*v)/c**2);     #Speed of second rocket for opposite direction of firing as per Velocity Addition Rule(m/s)\n",
      "u2 = math.ceil(u2*10**4)/10**4;     #rounding off the value of u2 to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The speed of second rocket for same direction of firing is\",u1,\"c\"\n",
      "print \"The speed of second rocket for opposite direction of firing is\",u2,\"c\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of second rocket for same direction of firing is 0.9741 c\n",
        "The speed of second rocket for opposite direction of firing is -0.6521 c\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.5, Page number 172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;     #For simplicity assume speed of light to be unity(m/s)\n",
      "L0 = 1;    #For simplicity assume length in spaceship's frame to be unity(m)\n",
      "tau = 1;     #Unit time in the spaceship's frame(s)\n",
      "\n",
      "#Calculation\n",
      "L = 1/2*L0;    #Length as observed on earth(m)\n",
      "#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\n",
      "v = math.sqrt(1-(L/L0)**2)*c;    #Speed at which length of spaceship is observed as half from the earth frame(m/s)\n",
      "t = tau/math.sqrt(1-(v/c)**2);    #Time dilation of the spaceship's unit time(s)\n",
      "v = math.ceil(v*10**4)/10**4;     #rounding off the value of v to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The speed at which length of spaceship is observed as half from the earth frame is\",v, \"c\"\n",
      "print \"The time dilation of the spaceship unit time is\",t,\"delta_tau\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed at which length of spaceship is observed as half from the earth frame is 0.8661 c\n",
        "The time dilation of the spaceship unit time is 2.0 delta_tau\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.6, Page number 172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "t1 = 2*10**-7;      #Time for which first event occurs(s)\n",
      "t2 = 3*10**-7;      #Time for which second event occurs(s)\n",
      "x1 = 10;       #Position at which first event occurs(m)\n",
      "x2 = 40;       #Position at which second event occurs(m)\n",
      "\n",
      "#Calculation\n",
      "v = 0.6*c;       #Velocity with which S2 frame moves relative to S1 frame(m/s)\n",
      "L_factor = 1/math.sqrt(1-(v/c)**2);     #Lorentz factor\n",
      "delta_t = L_factor*(t2 - t1)+L_factor*v/c**2*(x1 - x2);     #Time difference between the events(s)\n",
      "delta_x = L_factor*(x2 - x1)-L_factor*v*(t2 - t1);       #Distance between the events(m)\n",
      "\n",
      "#Result\n",
      "print \"The time difference between the events is\",delta_t, \"s\" \n",
      "print \"The distance between the events is\",delta_x, \"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time difference between the events is 5e-08 s\n",
        "The distance between the events is 15.0 m\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.7, Page number 173"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "tau = 2.6*10**-8;     #Mean lifetime the particle in its own frame(s)\n",
      "d = 20;     #Distance which the unstable particle travels before decaying(m)\n",
      "\n",
      "#Calculation\n",
      "#As t = d/v and also t = tau/sqrt(1-(v/c)^2), so that\n",
      "#d/v = tau/sqrt(1-(v/c)^2), solving for v\n",
      "v = math.sqrt(d**2/(tau**2+(d/c)**2));     #Speed of the unstable particle in lab frame(m/s)\n",
      "v = v/10**8;\n",
      "v = math.ceil(v*10)/10;     #rounding off the value of v to 1 decimal\n",
      "\n",
      "#Result\n",
      "print \"The speed of the unstable particle in lab frame is\",v,\"*10**8 m/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of the unstable particle in lab frame is 2.8 *10**8 m/s\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.8, Page number 174"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;     #For simplicity assume speed of light to be unity(m/s)\n",
      "me = 1;    #For simplicity assume mass of electron to be unity(kg)\n",
      "tau = 2.3*10**-6;     #Average lifetime of mu-meson in rest frame(s)\n",
      "t = 6.9*10**-6;       #Average lifetime of mu-meson in laboratory frame(s)\n",
      "e = 1.6*10**-19;     #Energy equivalent of 1 eV(J/eV)\n",
      "C = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "m_e = 9.1*10**-31;     #Mass of an electron(kg)\n",
      "\n",
      "#Calculation\n",
      "#Fromm Time Dilation Rule, tau = t*sqrt(1-(v/c)^2), solving for v\n",
      "v = c*math.sqrt(1-(tau/t)**2);     #Speed of mu-meson in the laboratory frame(m/s)\n",
      "v = math.ceil(v*10**5)/10**5;     #rounding off the value of v to 5 decimals\n",
      "m0 = 207*me;     #Rest mass of mu-meson(kg)\n",
      "m = m0/math.sqrt(1-(v/c)**2);      #Relativistic variation of mass with velocity(kg)\n",
      "m = math.ceil(m*10)/10;     #rounding off the value of m to 1 decimal\n",
      "T = (m*m_e*C**2 - m0*m_e*C**2)/e;     #Kinetic energy of mu-meson(eV)\n",
      "T = T*10**-6;        #Kinetic energy of mu-meson(MeV)\n",
      "T = math.ceil(T*100)/100;     #rounding off the value of T to 2 decimals\n",
      " \n",
      "#Result\n",
      "print \"The speed of mu-meson in the laboratory frame is\",v, \"c\"\n",
      "print \"The effective mass of mu-meson is\",m, \"me\"\n",
      "print \"The kinetic energy of mu-meson is\",T, \"MeV\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of mu-meson in the laboratory frame is 0.94281 c\n",
        "The effective mass of mu-meson is 621.1 me\n",
        "The kinetic energy of mu-meson is 211.97 MeV\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.9, Page number 174"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;      #For simplicity assume speed of light to be unity(m/s)\n",
      "m0 = 1;     #For simplicity assume rest mass to be unity(kg)\n",
      "\n",
      "#Calculation\n",
      "m = (20/100+1)*m0;     #Mass in motion(kg)\n",
      "#As m = m0/sqrt(1-(u/c)^2), solving for u\n",
      "u = math.sqrt(1-(m0/m)**2)*c;     #Speed of moving mass(m/s) \n",
      "u = math.ceil(u*10**3)/10**3;     #rounding off the value of u to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"The speed of moving body is\",u, \"c\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The speed of moving body is 0.553 c\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.10, Page number 175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "dE = 4*10**26;     #Energy radiated per second my the sun(J/s)\n",
      "\n",
      "#Calculation\n",
      "dm = dE/c**2;       #Rate of decrease of mass of sun(kg/s)\n",
      "dm = dm/10**9;\n",
      "dm = math.ceil(dm*10**3)/10**3;     #rounding off the value of dm to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"The rate of decrease of mass of sun is\",dm,\"*10**9 kg/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate of decrease of mass of sun is 4.445 *10**9 kg/s\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.11, Page number 175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 1;     #For simplicity assume speed of light to be unity(m/s)\n",
      "m0 = 9.1*10**-31;    #Mass of the electron(kg)\n",
      "E0 = 0.512;         #Rest energy of electron(MeV)\n",
      "T = 10;         #Kinetic energy of electron(MeV)\n",
      "\n",
      "#Calculation\n",
      "E = T + E0;     #Total energy of electron(MeV)\n",
      "# From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for p\n",
      "p = math.sqrt(E**2-m0**2*c**4)/c;      #Momentum of the electron(MeV)\n",
      "p = math.ceil(p*100)/100;     #rounding off the value of p to 2 decimals\n",
      "#As E = E0/sqrt(1-(u/c)^2), solving for u\n",
      "u = math.sqrt(1-(E0/E)**2)*c;     #Velocity of the electron(m/s)\n",
      "u = math.ceil(u*10**4)/10**4;     #rounding off the value of u to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The momentum of the electron is\",p,\"/c MeV\"\n",
      "print \"The velocity of the electron is\",u, \"c\"\n",
      "\n",
      "#answer for velocity given in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The momentum of the electron is 10.52 /c MeV\n",
        "The velocity of the electron is 0.9989 c\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.12, Page number 175. theoritical proof"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.13, Page number 176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8;      #Speed of light in vacuum(m/s)\n",
      "E = 4.5*10**17;   #Total energy of object(J)\n",
      "px = 3.8*10**8;    #X-component of momentum(kg-m/s)\n",
      "py = 3*10**8;      #Y-component of momentum(kg-m/s)\n",
      "pz = 3*10**8;      #Z-component of momentum(kg-m/s)\n",
      "\n",
      "#Calculation\n",
      "p = math.sqrt(px**2+py**2+pz**2);     #Total momentum of the object(kg-m/s)\n",
      "#From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for m0\n",
      "m0 = math.sqrt(E**2/c**4 - p**2/c**2);    #Rest mass of the body(kg)\n",
      "m0 = math.ceil(m0*100)/100;     #rounding off the value of m0 to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"The rest mass of the body is\",m0, \"kg\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rest mass of the body is 4.63 kg\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.14, Page number 176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "c = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "m = 50000;       #Mass of high speed probe(kg)\n",
      "\n",
      "#Calculation\n",
      "u = 0.8*c;       #Speed of the probe(m/s)\n",
      "p = m*u/math.sqrt(1-(u/c)**2);     #Momentum of the probe(kg-m/s)\n",
      "\n",
      "#Result\n",
      "print \"The momentum of the high speed probe is\",p, \"kg-m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The momentum of the high speed probe is 2e+13 kg-m/s\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 8.15, Page number 177"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "e = 1.6*10**-19;     #Electronic charge, C = Energy equivalent of 1 eV(J/eV)\n",
      "m0 = 9.11*10**-31;   #Rest mass of electron(kg)\n",
      "c = 3*10**8;     #Speed of light in vacuum(m/s)\n",
      "\n",
      "#Calculation\n",
      "u1 = 0.98*c;     #Inital speed of electron(m/s)\n",
      "u2 = 0.99*c;     #Final speed of electron(m/s)\n",
      "m1 = m0/math.sqrt(1-(u1/c)**2);    #Initial relativistic mass of electron(kg)\n",
      "m2 = m0/math.sqrt(1-(u2/c)**2);    #Final relativistic mass of electron(kg)\n",
      "dm = m2 - m1;     #Change in relativistic mass of the electron(kg)\n",
      "W = dm*c**2/e;      #Work done on the electron to change its velocity(eV)\n",
      "W = W*10**-6;      #Work done on the electron to change its velocity(MeV)\n",
      "W = math.ceil(W*100)/100;     #rounding off the value of W to 2 decimals\n",
      "#As W = eV, V = accelerating potential, solving for V\n",
      "V = W*10**6;     #Accelerating potential(volt)\n",
      "V = V/10**6;\n",
      "\n",
      "#Result\n",
      "print \"The change in relativistic mass of the electron is\",dm, \"kg\"\n",
      "print \"The work done on the electron to change its velocity is\",W, \"MeV\"\n",
      "print \"The accelerating potential is\",V, \"*10**6 volt\"\n",
      "\n",
      "#answers given in the book are wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in relativistic mass of the electron is 1.87996052912e-30 kg\n",
        "The work done on the electron to change its velocity is 1.06 MeV\n",
        "The accelerating potential is 1.06 *10**6 volt\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}