summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Malik/Chapter_11.ipynb
blob: 0cd9f3f6785e8267559d65aae53a0ab07bac4844 (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
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11: Theory of Relativity"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.5, Page 11.19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "# Given \n",
      "x = 100 # in meter\n",
      "y = 10 # in meter\n",
      "z = 5  # in meter\n",
      "t = 1e-4 # in sec\n",
      "# coordinates of point in frame F\n",
      "v = 2.7e8 # velocity of frame F_ w.r.t. frame F in m/sed\n",
      "c=3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "# according to Galilean transformation\n",
      "x__ = x-v*t\n",
      "y__=y\n",
      "z__=z\n",
      "t__=t\n",
      "# according to Lorentz transformation\n",
      "x_ = (x-v*t)/sqrt(1-(v/c)**2)\n",
      "y_=y\n",
      "z_=z\n",
      "t_=(t-(v*x/c**2))/sqrt(1-(v/c)**2)\n",
      "\n",
      "#Results\n",
      "print \"Coordinate of the event in reference frame F_ using \\n(a)Galilean transformation-x=%.f m, y=%.f m, z = %.f m, t = %.e sec\"%(x__,y__,z__,t__) \n",
      "print \"(b)Lorentz transformation-x=%.f m,y =%.f m, z = %.f m, t=%.e sec \"%(x_,y_,z_,t_)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coordinate of the event in reference frame F_ using \n",
        "(a)Galilean transformation-x=-26900 m, y=10 m, z = 5 m, t = 1e-04 sec\n",
        "(b)Lorentz transformation-x=-61713 m,y =10 m, z = 5 m, t=2e-04 sec \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.6, Page 11.19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "r = 4 # ratio of mass of particle to the rest mass\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / r)**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of particle is %.e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of particle is 3e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.7, Page 11.20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "r = 1.2 # ratio of mass of particle to the rest mass\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / r)**2)\n",
      "\n",
      "#Results\n",
      "print \"Speed of particle is %.3f c\"%(v/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of particle is 0.553 c\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.9, Page 11.20"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "E = 2 # kinetic energy of electron in Mev\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / (1 + (1.6e-19 * 2e6) / (9.1e-31 * 3e8**2)))**2)\n",
      "m = (9.1e-31) / sqrt(1 - (v / 3e8)**2)\n",
      "\n",
      "#Results\n",
      "print \"Speed of electron is %.2f c\\nMass of electron is %.2e kg\"%(v/3e8,m)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of electron is 0.98 c\n",
        "Mass of electron is 4.47e-30 kg\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.11, Page 11.21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "r = 2.25 # ratio of mass of particle to the rest mass\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / r)**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of particle is %.2e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of particle is 2.69e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.12, Page 11.22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "r = 2. # ratio of kinetic energy of body to its rest mass\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / (r + 1))**2)\n",
      "\n",
      "#Result\n",
      "print \"Velocity of particle is %.2f c\"%(v/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of particle is 0.94 c\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.13, Page 11.22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "r = 11. # ratio of mass of particle to the rest mass of electron\n",
      "\n",
      "#Calculations\n",
      "KE = (r - 1) * 9.1e-31 * 3e8**2 / (1.6e-19)\n",
      "m = 3e8 * sqrt(1 - (1 / r)**2) * 9.1e-31 * 11\n",
      "\n",
      "#Result\n",
      "print \"Kinetic energy of electron is %.1f MeV\\nMomentum of particle is %.2e N-sec\"%(KE/1e6,m)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Kinetic energy of electron is 5.1 MeV\n",
        "Momentum of particle is 2.99e-21 N-sec\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.14, Page 11.23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "m = 1.67e-27  # mass of electron in kg\n",
      "m_ = 9.1e-31 # rest mass of electron in kg\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (m_ / m)**2)\n",
      "\n",
      "#Result\n",
      "print \"Velocity of electron is %.3e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of electron is 3.000e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.15, Page 11.23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "E = 0.1 # kinetic speed of electron in Mev\n",
      "\n",
      "#Calculations\n",
      "v_ = sqrt(2 * (E * 1.6e-13) / 9.1e-31)\n",
      "v = 3e8 * sqrt(1 - (1 / (1 + (1.6e-13 * E) / (9.1e-31 * 3e8**2)))**2)\n",
      "\n",
      "#Results\n",
      "print \"Speed according to classical mechanics is %.2e meter/sec\\nSpeed according to relativistic mechanics is %.2e meter/sec\"%(v_,v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed according to classical mechanics is 1.88e+08 meter/sec\n",
        "Speed according to relativistic mechanics is 1.64e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.17, Page 11.24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "r1 = 3. # ratio of kinetic energy of body to its rest mass in first case\n",
      "r2 = 1. # ratio of kinetic energy of body to its rest mass in second case\n",
      "\n",
      "#Calculations\n",
      "v1 = 3e8 * sqrt(1 - (1 / (r1 + 1))**2)\n",
      "v2 = 3e8 * sqrt(1 - (1 / (r2 + 1))**2)\n",
      "\n",
      "#Results\n",
      "print \"Velocity of particle if kinetic energy is %d times of rest mass energy  is %.2e meter/sec\\nVelocity of particle if kinetic energy is %.1e times of rest mass energy  is %e meter/sec\"%(r1,v1,r2,v2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of particle if kinetic energy is 3 times of rest mass energy  is 2.90e+08 meter/sec\n",
        "Velocity of particle if kinetic energy is 1.0e+00 times of rest mass energy  is 2.598076e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.19, Page 11.25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "E = 1.5 # kinetic energy of electron in Mev\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / (1 + (1.6e-19 * 2e6) / (9.1e-31 * 3e8**2)))**2)\n",
      "m = (E * 1.6e-13 / (3e8)**2) + 9.1e-31\n",
      "\n",
      "#Results\n",
      "print \"Speed of electron is %.2e meter/sec\\nMass of electron is %.1e kg\"%(v,m)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of electron is 2.94e+08 meter/sec\n",
        "Mass of electron is 3.6e-30 kg\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.20, Page 11.26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "r = 3. / 2 # ratio of mass of metre stick to the rest mass of metre stick\n",
      "\n",
      "#Calculations\n",
      "l = 1 * (1. / r)\n",
      "\n",
      "#Result\n",
      "print \"Length of meter stick is %.2f meter if mass is %.2f times of its rest mass\"%(l,r)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length of meter stick is 0.67 meter if mass is 1.50 times of its rest mass\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.21, Page 11.26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "# Given \n",
      "r = 1. / 2 # ratio of area of circular lamina in frame S_ to the ratio of area of circular lamina in frame S\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - r**2)\n",
      "\n",
      "#Result\n",
      "print \"Velocity of frame S_ w.r.t. frame S is %.1e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of frame S_ w.r.t. frame S is 2.6e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.22, Page 11.27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import * \n",
      "# Given \n",
      "t = 1 # lose in time in an hour in minute\n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - ((60. - t) / 60)**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of clock is %.2e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of clock is 5.45e+07 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.23, Page 11.27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "# Given \n",
      "t_ = 2.5e-8 # proper life of pi+ mesons in sec\n",
      "v = 2.4e8 # velocity of beam of mesons in m/sec\n",
      "r = 1. / exp(2) # ratio of final flux to initial flux of the meson beam\n",
      "\n",
      "#Calculations\n",
      "t = t_ / sqrt(1 - (v / 3e8)**2)\n",
      "T = t * log(1. / r)\n",
      "d = T * v\n",
      "\n",
      "#Result\n",
      "print \"Distance travel by the beam is %.2f meter\"%d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distance travel by the beam is 20.00 meter\n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.24, Page 11.27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "v = 1.8e8 # velocity of space ship away from the earth in m/sec\n",
      "v1 = 2.1e8 # velocity of rocket w.r.t. space ship away from the earth in first case in m/sec\n",
      "v2 = -2.1e8 # velocity of rocket w.r.t. space ship away from the earth in second case in m/sec\n",
      "\n",
      "#Calculations\n",
      "u1 = (v1 + v) / (1 + ((v1 * v) / (3e8)**2))\n",
      "u2 = (v2 + v) / (1 + ((v2 * v) / (3e8)**2))\n",
      "\n",
      "#Results\n",
      "print \"Velocity of rocket w.r.t. earth in first case = %.2f c away from the earth\\nVelocity of rocket w.r.t. earth in second case = %.2f c away from the earth \"%(u1/3e8,u2/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of rocket w.r.t. earth in first case = 0.92 c away from the earth\n",
        "Velocity of rocket w.r.t. earth in second case = -0.17 c away from the earth \n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.25, Page 11.28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "l = 1 # length of the rod in meter\n",
      "v = 1.8e8 # speed of rod along its length in meter/sec\n",
      "\n",
      "#Calculations\n",
      "L = l * sqrt(1- (v / 3e8)**2)\n",
      "\n",
      "#Result\n",
      "print \"Length as it appear to the observer is %.1f meter\"%L"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length as it appear to the observer is 0.8 meter\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.26, Page 11.28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "l = 2 # length of the rod in meter\n",
      "v = 2.7e8 # speed of rod along its length in meter/sec\n",
      "\n",
      "#Calculations\n",
      "L = l * sqrt(1- (v / 3e8)**2)\n",
      "\n",
      "#Result\n",
      "print \"Length as it appear to the observer is %.3f meter\"%L"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length as it appear to the observer is 0.872 meter\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.27, Page 11.28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "l = 100. # consider the length of the rod in meter\n",
      "v = 2.4e8 # speed of rod in meter/sec\n",
      "theta = pi / 3 # direction of velocity of rod along its length in radian\n",
      "\n",
      "#Calculations\n",
      "Lx = l * cos(theta)\n",
      "Ly = l * sin(theta)\n",
      "L_x = Lx * sqrt(1 - (v / 3e8)**2)\n",
      "L_y = Ly \n",
      "L = sqrt(L_x**2 + L_y**2)\n",
      "p_l = ((l - L) / l) * 100 \n",
      "\n",
      "#Result\n",
      "print \"Percentage length contraction is %.1f percent\"%p_l"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Percentage length contraction is 8.3 percent\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.28, Page 11.29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "# Given \n",
      "r = 0.5 # ratio of length of rod when it is in motion to the length of the rod when it is in rest \n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - r**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of the rod relative to observer is %.3f c\"%(v/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of the rod relative to observer is 0.866 c\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.29, Page 11.29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "l = 5 # length of the rod in meter\n",
      "v = 1.8e8 # speed of rod in meter/sec\n",
      "theta = pi / 6 # direction of velocity of rod along its length in radian\n",
      "\n",
      "#Calculations\n",
      "Lx = l * cos(theta)\n",
      "Ly = l * sin(theta)\n",
      "L_x = Lx * sqrt(1 - (v / 3e8)**2)\n",
      "L_y = Ly \n",
      "L = sqrt(L_x**2 + L_y**2)\n",
      "orientation = atan(L_y / L_x) * (180 / pi)\n",
      "\n",
      "#Results\n",
      "print \"Length of the rod in moving frame is %.2f meter\\nOrientation of the rod is %.2f degree\"%(L,orientation)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length of the rod in moving frame is 4.27 meter\n",
        "Orientation of the rod is 35.82 degree\n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.30, Page 11.30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "T = 17.8e-9 # half-life of prticle at rest in sec\n",
      "v = 2.4e8 # speed of particle in meter/sec\n",
      "\n",
      "#Calculations\n",
      "t = T / (sqrt(1 - (v / 3e8)**2))\n",
      "\n",
      "#Result\n",
      "print \"New half-life of particle is %.2f nanosec\"%(t/1e-9)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New half-life of particle is 29.67 nanosec\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.31, Page 11.30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "T = 24 # no. of hours in a day\n",
      "v = 1e8 # speed of spaceship in meter/sec\n",
      "\n",
      "#Calculations\n",
      "t = T * (sqrt(1 - (v / 3e8)**2))\n",
      "T_ = T - t\n",
      "m=(T_-1)*60\n",
      "s=(m-22)*60\n",
      "\n",
      "#Result\n",
      "print \"Time lost per day is %d hours %d minute %d sec\"%(T_,m,s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Time lost per day is 1 hours 22 minute 21 sec\n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.32, Page 11.30"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "T = 4. # no. of year when rocket is moving corresponding to one year \n",
      "\n",
      "#Calculations\n",
      "v = 3e8 * sqrt(1 - (1 / T)**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of rocket is %.2f c\"%(v/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of rocket is 0.97 c\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.33, Page 11.31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "d = 4 # distance of star from the earth in light years\n",
      "v = 3e8 * sqrt(0.9999) # speed of rocket in meter/sec\n",
      "\n",
      "#Calculations\n",
      "t = (2 * d * 3e8) / v\n",
      "T_ = t * sqrt(1 - (v / 3e8)**2)\n",
      "\n",
      "#Result\n",
      "print \"Time taken by the rocket is %.2f year\"%T_"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Time taken by the rocket is 0.08 year\n"
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.34, Page 11.31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "t = 2e-7 # life time of particle when it is moving in sec\n",
      "v = 2.8e8 # speed of particle in meter/sec\n",
      "\n",
      "#Calculations\n",
      "T_ = t * sqrt(1 - (v / 3e8)**2)\n",
      "\n",
      "#Result\n",
      "print \"Proper life time of particle is %.2e sec\"%T_"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Proper life time of particle is 7.18e-08 sec\n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.35, Page 11.31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "v1 = 2.7e8 # velocity of first electron beam in meter/sec\n",
      "v2 = -2.7e8 # velocity of second electron beam in meter/sec\n",
      "\n",
      "#Calculations\n",
      "u = v1 - v2\n",
      "u_ = (v1 - v2) / (1 - (v1 * v2) / (3e8)**2)\n",
      "\n",
      "#Results\n",
      "print \"Velocity of electrons beam w.r.t. another electron beam according to Newtonian mechanics is %.1f c\\nVelocity of electrons beam measured by the observer moving with other electron beam = %.2f c\"%(u/3e8,u_/3e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of electrons beam w.r.t. another electron beam according to Newtonian mechanics is 1.8 c\n",
        "Velocity of electrons beam measured by the observer moving with other electron beam = 0.99 c\n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.37, Page 11.32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "E = 900 # total relativistic energy of proton in Mev\n",
      "m = 1.63-27 # rest mass of proton in kg\n",
      "c = 3e8 # velocity of photon in meter/sec\n",
      "\n",
      "#Calculations\n",
      "m_ = (E * 1.6e-13) / (c)**2\n",
      "\n",
      "#Results\n",
      "print \"Relativistic mass of proton is %.2e kg\\nHere relativistic mass is same as rest mass\\n hence proton is at rest and speed and kinetic energy of proton will be zero\"%(m_)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relativistic mass of proton is 1.60e-27 kg\n",
        "Here relativistic mass is same as rest mass\n",
        " hence proton is at rest and speed and kinetic energy of proton will be zero\n"
       ]
      }
     ],
     "prompt_number": 64
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.38, Page 11.32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "E = 5.4e6 # energy liberates during dynamite explosion in J/kg\n",
      "c = 3e8 # velocity of photon in meter/sec\n",
      "\n",
      "#Calculations\n",
      "E_ = 1 * c**2 # energy liberated by 1 kg content in J\n",
      "f = E / E_\n",
      "\n",
      "#Result\n",
      "print \"Fraction of total energy content in it is %.1e per kg\"%f"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fraction of total energy content in it is 6.0e-11 per kg\n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.39, Page 11.32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import * \n",
      "# Given \n",
      "k = 1.02 # kinetic energy of electron in Mev\n",
      "E_ = 0.51 # rest mass energy of electron in Mev\n",
      "c = 3e8 # velocity of photon in meter/sec\n",
      "\n",
      "#Calculations\n",
      "E = k + E_\n",
      "v = c * sqrt(1 - (E_ / E)**2)\n",
      "\n",
      "#Result\n",
      "print \"Speed of the electron is %.2e meter/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of the electron is 2.83e+08 meter/sec\n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.40, Page 11.33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "E = 1400 # solar energy receives by the earth in W/square meter\n",
      "d = 1.5e11 # distance between earth and the sun in meter\n",
      "c = 3e8 # velocity of photon in meter/sec\n",
      "\n",
      "#Calculations\n",
      "E_ = 4 * pi * d**2 * E\n",
      "m = E_ / c**2\n",
      "\n",
      "#Result\n",
      "print \"Rate of decrement of mass of the sun is %.2e kg/sec\"%m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rate of decrement of mass of the sun is 4.40e+09 kg/sec\n"
       ]
      }
     ],
     "prompt_number": 67
    }
   ],
   "metadata": {}
  }
 ]
}