summaryrefslogtreecommitdiff
path: root/Engineering_Physics/chapter1.ipynb
blob: 69791eee36373161a3fea7da94ce06bfcf938d32 (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
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
{

 "metadata": {

  "name": "",

  "signature": "sha256:0e6e83846c51774a2df15d43a35bd12afc7130920f3c7a5b4cb2d5a70d8dae4a"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter1:RELATIVISTIC MECHANICS"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.1:pg-12"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# example 1\n",

      "import math\n",

      "#to calculate length of the bar measured by the ststionary observer\n",

      "lo =1  #length in metre\n",

      "v=0.75*3*10**8 #speed (m/s)\n",

      "c=3*10**8 #light speed(m/s)\n",

      "l=lo*math.sqrt(1-(v**2/c**2))\n",

      "print \"\\n the length of bar in is\",round(l,2),\"m\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "\n",

        " the length of bar in is 0.66 m\n"

       ]

      }

     ],

     "prompt_number": 11

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.2:pg-12"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# example 2\n",

      "import math\n",

      "#to calculate velocity of rocket \n",

      "#lo be the length at rest \n",

      "l=99.0/100 #length is 99 per cent of its length at rest is l=(99/100)lo\n",

      "c=3*10**8   #light speed(m/s)\n",

      "v=c*math.sqrt(1-l**2) #formula is v=c math.sqrt(1-(l/lo)**2)\n",

      "print\" the velocity of rocket is v=\",\"{:.2e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " the velocity of rocket is v= 4.23e+07 m/s\n"

       ]

      }

     ],

     "prompt_number": 21

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.4:pg-13"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to percentage contraction of a rod\n",

      "c=3.0*10**8 #light speed(m/s)\n",

      "v=0.8*c #velocity(m/s)\n",

      "#let lo be the length of the rod in the frame in which it is at rest\n",

      "#s' is the frame which is moving with a speed 0.8c in a direction making an angle 60 with x-axis\n",

      "#components of lo along perpendicular to the direction of motion are lo cos60 and lo sin60 respectively\n",

      "l1=math.cos(math.pi/3)*math.sqrt(1-(v/c)**2) #length of the rod alond the direction of motion =lo math.cos(pi/3)math.sqrt(1-(v/c)**2)\n",

      "l2=math.sin(math.pi/3)  #length of the rod perpendicular to the direction of motion =lo sin60\n",

      "l=math.sqrt(l1**2+l2**2) # length of the moving rod\n",

      "per=(1-l)*100/1\n",

      "print \"percentage contraction of a rod is\",round(per,2),\"%\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "percentage contraction of a rod is 8.35 %\n"

       ]

      }

     ],

     "prompt_number": 23

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.7:pg-14"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# example 7\n",

      "import math\n",

      "#to calculate velocity of the circular lamina  \n",

      "c=3*10**8 #light speed (m/s)\n",

      "#R'=R/2 (radius)\n",

      "#R'=R math.sqrt(1-(v/c)**2)\n",

      "v=(math.sqrt(3)/2)*c \n",

      "print \"velocity of the circular lamina relative to frame s is v=\",v,\"m/s\"\n",

      "#answer is given in terms of c in the textbook\n",

      "\n",

      "\n",

      "\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "velocity of the circular lamina relative to frame s is v= 259807621.135 m/s\n"

       ]

      }

     ],

     "prompt_number": 4

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.8:pg-17"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# example 8\n",

      "import math\n",

      "#to calculate speed of the clock\n",

      "#clock should record l=59 minutes for each hour recorded by clocks stationary with respect to the observer\n",

      "l=59.0 \n",

      "lo=60\n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=math.sqrt(c**2*(1-l**2/lo**2))\n",

      "print \"speed of the clock is v =\",\"{:.2e}\".format(v),\"m/s\"\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "speed of the clock is v = 5.45e+07 m/s\n"

       ]

      }

     ],

     "prompt_number": 31

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.9:pg-17"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate distance travelled by the beam \n",

      "deltat0=2.5*10**-8 #proper half life of pi mesons in (s)\n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=0.8*c #mesons velocity (m/s)\n",

      "deltat=deltat0/math.sqrt(1-(v/c)**2) #half life (s)\n",

      "#No=initial flux ,N=flux after time t\n",

      "#N=N0 e**(-t/T)\n",

      "#N=N0/e**2 (given)=No e(-t/T)\n",

      "#t=2 deltat\n",

      "d=2*deltat*v #d=vt\n",

      "print \"distance travelled by the beam is d=\",d,\"m\" \n",

      "#answer is given in the textbook=19.96 m\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "distance travelled by the beam is d= 20.0 m\n"

       ]

      }

     ],

     "prompt_number": 6

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.10:pg-17"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate distance travelled by the particle \n",

      "deltat0=2*10**-8 #proper half life to of the particle in (s) \n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=0.96*c #speed of the particle (m/s)\n",

      "deltat=(deltat0)/(math.sqrt(1-(v/c)**2)) #half life in the laboratory frame t in (s) \n",

      "#t=deltat (flux of the beam falls to (1/2) times initial flux)\n",

      "d=v*deltat #d=vt\n",

      "print \"distance travelled by the particle in this time is d=\",d,\"m\"\n",

      "#answer is given wrong in the textbook =20.45 m\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "distance travelled by the particle in this time is d= 20.5714285714 m\n"

       ]

      }

     ],

     "prompt_number": 8

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.11:pg-18"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate speed\n",

      "deltat0=1440 #proper time interval measured by an observer moving with the clock (min)\n",

      "deltat=1444 #time interval measured by a stationary observer (min)\n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=c*math.sqrt(1-(deltat0/deltat)**2)\n",

      "print \" moving clock appears to lose 4min in 24 hours from the stationary observer is v=\",\"{:.1e}\".format(v),\"m/s\"\n",

      "#answer is given wrong in the book =2.32*10**7 m/s\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " moving clock appears to lose 4min in 24 hours from the stationary observer is v= 3.0e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 33

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.12:pg-18"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate velocity of beta particle\n",

      "c=3*10**8 #light velocity(m/s)\n",

      "u1=0.9*c #velocity of the beta particle relative to the atom in the direction of motion\n",

      "v=0.25*c #velocity of the radioactive atom relative to an experimenter\n",

      "u=(u1+v)/(1+u1*v/c**2)  \n",

      "print \" velocity of the beta particle as observed by the experimenter is u=\",\"{:.3e}\".format(u),\"m/s\"\n",

      "#answer is given in terms of c in the book =0.94c\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " velocity of the beta particle as observed by the experimenter is u= 2.816e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 34

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.13:pg-18"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate velocity\n",

      "c=3*10**8 # light velocity\n",

      "v=0.75*c #speed of A\n",

      "ux=-0.85*c #speed of B\n",

      "ux1=(ux-v)/(1-ux*v/c**2)\n",

      "print\"\\n the velocity of B with respect to A (m/s) is\",\"{:.3e}\".format(ux1),\"m/s\"\n",

      "#answer is given in terms of c in the book=-0.9771c\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "\n",

        " the velocity of B with respect to A (m/s) is -2.931e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 36

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.14:pg-19"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate velocity in the laboratory frame\n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=0.8*c #velocity relative to laboratory along positive direction of x-axis\n",

      "#given that u'=3 i+4 j+12 k (m/s)\n",

      "ux1=3 #in (m/s)\n",

      "uy1=4 #in (m/s)\n",

      "uz1=12 #in (m/s)\n",

      "ux=(ux1+v)/(1+v*ux1/c**2)\n",

      "uy=(uy1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n",

      "uz=(uz1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n",

      "print \"u=ux i+uy j+uz k\"\n",

      "print \"where\"\n",

      "print \"ux=\", \"{:.1e}\".format(ux),\"m/s\"\n",

      "print \"uy=\",round(uy,1),\"m/s\"\n",

      "print \"uz=\",round(uz,1),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "u=ux i+uy j+uz k\n",

        "where\n",

        "ux= 2.4e+08 m/s\n",

        "uy= 2.4 m/s\n",

        "uz= 7.2 m/s\n"

       ]

      }

     ],

     "prompt_number": 41

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.17:pg-21"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "# to calculate velocity of the particle\n",

      "c=3.0*10**8 #light speed (m/s)\n",

      "v=0.4*c #velocity of frame s' relative to s along axis x\n",

      "ux=0.8*c*(1.0/2) #component of velocity u(=0.8 c) of the particle along x axis ux=0.8 c cos60\n",

      "uy=0.8*c*sin (math.pi/3) #component of the velocity u of the particle along y axis \n",

      "ux1=(ux-v)/(1-ux*v/c**2)\n",

      "uy1=uy*math.sqrt(1-(v/c)**2)/(1-(ux*v/c**2))\n",

      "print \"resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\"\n",

      "print \"where\"\n",

      "print \"ux1=\",ux1,\"m/s\"\n",

      "print \"uy1=\",\"{:.1e}\".format(uy1),\"m/s\"\n",

      "#answer is given in terms of c in the book i.e. uy1=0.756c m/s\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\n",

        "where\n",

        "ux1= 0.0 m/s\n",

        "uy1= 2.3e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 48

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.18:pg-25"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate mass, momentum,total energy,kinetic energy\n",

      "c=3*10**8 #light speed (m/s)\n",

      "v=c/sqrt (2) #velocity (m/s)\n",

      "#let mo be the rest mass of the particle \n",

      "#relativistic mass m of the particle is m=mo/math.sqrt(1-(v/c)**2)\n",

      "m=1/sqrt (1-v**2/c**2) #in kg\n",

      "print \"mass m=\",round(m,2),\" mo\"\n",

      "#momentum p of the particle is p=mv\n",

      "p=m*v #in kg-m/s\n",

      "print \"momentum p=\",\"{:.1e}\".format(p),\" mo\"\n",

      "#total energy E of the particle\n",

      "E=m*c**2 #in J\n",

      "print \"energy E=\",\"{:.3e}\".format(E,3),\" mo\"\n",

      "#kinetic energy K=E-mo c**2\n",

      "K=E-c**2 #in J\n",

      "print \"kinetic energy K=\",\"{:.3e}\".format(K),\" mo\"\n",

      "#answer is given in terms of m0 and c in the book\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "mass m= 1.41  mo\n",

        "momentum p= 3.0e+08  mo\n",

        "energy E= 1.273e+17  mo\n",

        "kinetic energy K= 3.728e+16  mo\n"

       ]

      }

     ],

     "prompt_number": 56

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.19:pg-26"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate velocity of the parcticle \n",

      "c=3*10**8 #light speed(m/s)\n",

      "# we know that E(energy)=mc**2\n",

      "# mo=rest mass\n",

      "#E=3 moc**2=mc**2 or m=3 mo (given that total energy of the particle is thrice its rest energy)  \n",

      "m=3.0 # relativistic mass \n",

      "#formula is v=c math.sqrt(1-(mo/m)**2)\n",

      "v=math.sqrt(c**2*(1-(1/m)**2))\n",

      "print \"velocity of the particle is v=\",\"{:.3e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "velocity of the particle is v= 2.828e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 57

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.20:pg-26"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate mass(m),speed(v) of an electron\n",

      "K=1.5*10**6*1.6*10**-19 #kinetic energy(J)\n",

      "m0=9.11*10**-31 #rest mass of an electron(kg)\n",

      "c=3*10**8 # velocity of light in vacuum(m/s)\n",

      "m=(K/c**2)+m0 #relativistic kinetic energy(k=(m-mo)c**2)\n",

      "print \"mass is m=\",\"{:.2e}\".format(m),\"kg \"\n",

      "v=c*math.sqrt(1-m0**2/m**2)\n",

      "print \"speed of an electron is v=\",\"{:.1e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "mass is m= 3.58e-30 kg \n",

        "speed of an electron is v= 2.9e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 59

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.21:pg-27"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate work to be done \n",

      "E=0.5*10**6 #rest energy of electron (MeV) E=m0*c**2\n",

      "v1=0.6*3*10**8 #speed of electron in (m/s)\n",

      "v2=0.8*3*10**8\n",

      "c=3.0*10**8 #speed of light in (m/s)\n",

      "K1=E*((1.0/math.sqrt(1-v1**2/c**2))-1) #kinetic energy in (eV)\n",

      "K2=E*((1.0/math.sqrt(1-v2**2/c**2))-1)\n",

      "w=(K2-K1)*1.6*10**-19\n",

      "print \"amount of work to be done is w=\",\"{:.1e}\".format(w),\"J\"\n",

      "\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "amount of work to be done is w= 3.3e-14 J\n"

       ]

      }

     ],

     "prompt_number": 64

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.22:pg-27"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate speed\n",

      "c=3*10**8 #light speed (m/s)\n",

      "m=2.25 #mass m of a body be 2.25 times its rest mass mo i.e. m=2.25m0\n",

      "#formula is v=c math.sqrt(1-(m0/m)**2)\n",

      "v=c*math.sqrt(1-(1/m)**2)\n",

      "print \" speed is v=\",\"{:.3e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " speed is v= 2.687e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 67

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.23:pg-27"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate speed of the rocket\n",

      "m0=50.0 #weight of man on the earth(kg)\n",

      "m=50.5 #weight of man in rocket ship (kg)\n",

      "c=3*10**8 #speed of light(m/s)\n",

      "v=c*math.sqrt(1-m0**2/m**2)\n",

      "print \"speed of the rocket is v=\",\"{:.2e}\".format(v),\"m/s\" \n",

      "#to calculate speed of electron\n",

      "m0=9.11*10**-31 #mass of electron =rest mass of proton\n",

      "m=1.67*10**-27\n",

      "v=c*math.sqrt(1-m0**2/m**2)\n",

      "print \"speed of an electron is v=\",\"{:.2e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "speed of the rocket is v= 4.21e+07 m/s\n",

        "speed of an electron is v= 3.00e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 71

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.24:pg-28"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate velocity\n",

      "c=3*10**8 #light speed (m/s)\n",

      "#K(kinetic energy)=(m-mo(rest mass))c**2\n",

      "#it can also be written as mc**2=K+m0c**2\n",

      "#given that K=2m0c**2(rest mass energy)\n",

      "#m=3m0\n",

      "m=3.0 #relativistic mass\n",

      "#formula is v=c math.sqrt(1-(m0/m)**2)\n",

      "v=c*math.sqrt(1-(1/m)**2)\n",

      "print \"velocity of a body is v=\",\"{:.3e}\".format(v),\"m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "velocity of a body is v= 2.828e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 73

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.25:pg-28"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate kinetic energy ,momentum of electron\n",

      "m0=9.11*10**-31 #its rest mass (kg)\n",

      "c=3*10**8 #light velocity in (m/s)\n",

      "m=11*m0 #mass of moving electron is 11 times its rest mass\n",

      "K=(m-m0)*c**2/(1.6*10**-19) # kinetic energy\n",

      "print \"kinetic energy is K=\",\"{:.2e}\".format(K),\"eV\" \n",

      "v=c*math.sqrt(1-(m0/m)**2) #velocity(m/s)\n",

      "p=m*v #momentum\n",

      "print \"momentum is p=\",\"{:.2e}\".format(p),\"kg m/s\"\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "kinetic energy is K= 5.12e+06 eV\n",

        "momentum is p= 2.99e-21 kg m/s\n"

       ]

      }

     ],

     "prompt_number": 74

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.26:pg-29\n",

      " "

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate proton gain in mass\n",

      "c=3*10**8 #light speed(m/s)\n",

      "K=500*10**6*1.6*10**-19 #kinetic energy (J)\n",

      "deltam=K/c**2\n",

      "print \"proton gain in mass is delm=\",\"{:.2e}\".format(deltam),\"kg\"\n",

      "#answer is given wrong in the book=8.89*10**28 kg\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " proton gain in mass is delm= 8.89e-28 kg\n"

       ]

      }

     ],

     "prompt_number": 76

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.27:pg-29"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#to calculate speed of 0.1MeV electron\n",

      "E=0.512*10**6 #rest mass energy E=m0*c**2\n",

      "c=3*10**8 #velocity of light (m/s)\n",

      "K=0.1*10**6 #kinetic energy (MeV)\n",

      "v=c*math.sqrt(1-(E/(K+E))**2) \n",

      "print \"speed of electron is v=\",\"{:.3e}\".format(v),\"m/s\" \n",

      "#to calculate mass and speed of 2MeV electron\n",

      "E=2*10**6*1.6*10**-19 #in (J)\n",

      "m=E/c**2 \n",

      "print \"mass is m=\",\"{:.2e}\".format(m),\"kg\"\n",

      "m0=9.11*10**-31 #electron mass (kg)\n",

      "v=c*math.sqrt(1-m0**2/m**2)\n",

      "print \"speed is v=\",\"{:.2e}\".format(v),\"m/s\"\n",

      "\n",

      "\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "speed of electron is v= 1.643e+08 m/s\n",

        "mass is m= 3.56e-30 kg\n",

        "speed is v= 2.90e+08 m/s\n"

       ]

      }

     ],

     "prompt_number": 78

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [],

     "language": "python",

     "metadata": {},

     "outputs": []

    }

   ],

   "metadata": {}

  }

 ]

}