summaryrefslogtreecommitdiff
path: root/Applied_Physics/Chapter5.ipynb
blob: cf16b683300d93b0aeffa1f48ce48ee1f8ab960b (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
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
{
 "metadata": {
  "name": "",
  "signature": "sha256:17ded29a54411f524d1901cc530f956cb4706c517e993f5acba4014789eca0bd"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5:Principles of Quantum Mechanics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1 , Page no:102"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "lambda1=1; #in Angstrom (wavelength)\n",
      "m=1.67E-27; #in Kg (mass of neutron)\n",
      "h=6.625E-34; #in J-s (Planck's constant)\n",
      "e=1.6E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "lambda2=lambda1*1E-10; #since lambda is in Angstrom\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "v=h/(m*lambda2); #calculation of velocity\n",
      "K=m*v**2/2; #calculation of kinetic energy\n",
      "K1=K/e; #changing unit fro J to eV\n",
      "\n",
      "#result\n",
      "print\"The velocity is v=\",v,\"m/s\";\n",
      "print\"The kinetic energy is K=\",K,\"J\";\n",
      "print\"\\t\\t       =\",K1,\"eV\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity is v= 3967.06586826 m/s\n",
        "The kinetic energy is K= 1.31409056886e-20 J\n",
        "\t\t       = 0.0821306605539 eV\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2 , Page no:103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "K=50; #in eV (Kinetic energy)\n",
      "m0=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.625E-34; #in J-s (Planck's constant)\n",
      "e=1.6E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "K=K*e; #changing unit from eV to J\n",
      "#Since K=m*v^2/2\n",
      "#Therefore v=sqrt(2*K/m)\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "lambda1=h/math.sqrt(2*m0*K); #calculation of wavelength\n",
      "lambda2=lambda1*1E10; #changing unit from m to Angstrom\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t\\t  =\",round(lambda2,3),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 1.73622176082e-10 m\n",
        "\t\t  = 1.736 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3 , Page no:104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "E=2000; #in eV (Kinetic energy)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.625E-34; #in J-s (Planck's constant)\n",
      "e=1.6E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "E=E*e; #changing unit from eV to J\n",
      "#Since E=m*v^2/2\n",
      "#Therefore v=sqrt(2*E/m)\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "lambda1=h/math.sqrt(2*m*E); #calculation of wavelength\n",
      "lambda2=lambda1*1E9; #changing unit from m to nanometer\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t\\t  =\",round(lambda2,4),\"nm\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 2.74520764367e-11 m\n",
        "\t\t  = 0.0275 nm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4 , Page no:104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "m_e=9.1E-31; #in Kg (mass of electron)\n",
      "m_n=1.676E-27; #in Kg (mass of neutron)\n",
      "h=6.625E-34; #in J-s (Planck's constant)\n",
      "c=3E8; #in m/s (velocity of light)\n",
      "\n",
      "#calculate\n",
      "E_e=m_e*c**2; #rest mass energy of electron\n",
      "E_n=2*E_e; #given (kinetic energy of neutron)\n",
      "#Since K=m*v^2/2\n",
      "#Therefore v=sqrt(2*K/m)\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "lambda1=h/math.sqrt(2*m_n*E_n); #calculation of wavelength\n",
      "lambda2=lambda1*1E10; #changing unit from m to Angstrom\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",lambda1,\"m\";\n",
      "print\"\\t\\t  =\",lambda2,\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 2.82733278331e-14 m\n",
        "\t\t  = 0.000282733278331 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5 , Page no:104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "V=1600; #in V (Potential)\n",
      "\n",
      "#calculate\n",
      "lambda1=12.27/math.sqrt(V); #calculation of wavelength in Angstrom\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",round(lambda1,3),\"Angstrom\";\n",
      "print \"Note : The answer in the book is wrong \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 0.307 Angstrom\n",
        "Note : The answer in the book is wrong \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6 , Page no:105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "E=1000; #in eV (Kinetic energy of photon)\n",
      "K=1000; #in eV (Kinetic energy of electron)\n",
      "m0=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.6E-34; #in J-s (Planck's constant)\n",
      "c=3E8; #in m/s (velocity of light)\n",
      "e=1.6E-19; #in C (charge on electron)\n",
      "\n",
      "#calculate\n",
      "E=E*e; #changing unit from eV to J\n",
      "lambda_p=h*c/E; #For photon E=hc/lambda\n",
      "lambda_p1=lambda_p*1E10; #changing unit from m to Angstrom\n",
      "#Since K=m*v^2/2\n",
      "#Therefore v=sqrt(2*K/m)\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "K=K*e; #changing unit from eV to J\n",
      "lambda_e=h/math.sqrt(2*m0*K); #calculation of wavelength\n",
      "lambda_e1=lambda_e*1E10; #changing unit from m to Angstrom\n",
      "\n",
      "#result\n",
      "print\"For photon,the wavelength is =\",lambda_p,\"m\";\n",
      "print\"\\t\\t\\t     =\",round(lambda_p1,1),\"Angstrom\";\n",
      "print\"For electron,the wavelength is =\",lambda_e,\"m\";\n",
      "print\"\\t\\t\\t       =\",round(lambda_e1,2),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For photon,the wavelength is = 1.2375e-09 m\n",
        "\t\t\t     = 12.4 Angstrom\n",
        "For electron,the wavelength is = 3.86765965524e-11 m\n",
        "\t\t\t       = 0.39 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7 , Page no:105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "lambda1=1.66*10**-10; #in m (wavelength)\n",
      "m=9.1*10**-31; #in Kg (mass of electron)\n",
      "h=6.626*10**-34; #in J-s (Planck's constant)\n",
      "e=1.6E-19; #in C (charge on electron)\n",
      "\n",
      "#calculate\n",
      "#Since lambda=h/(m*v)\n",
      "#Therefore we have\n",
      "v=h/(m*lambda1); #calculation of velocity\n",
      "K=m*v**2/2; #calculation of kinetic energy\n",
      "K1=K/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The velocity of electron is v=\",v,\"m/s\";\n",
      "print\"The kinetic energy is K=\",K,\"J\";\n",
      "print\"\\t\\t       =\",round(K1,3),\"eV\";\n",
      "print \"Note: The answer in the book for kinetic energy is wrong \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of electron is v= 4386336.55501 m/s\n",
        "The kinetic energy is K= 8.75417651009e-18 J\n",
        "\t\t       = 54.714 eV\n",
        "Note: The answer in the book for kinetic energy is wrong \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8 , Page no:106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "T=400; #in K (temperature)\n",
      "m=6.7E-27; #in Kg (mass of He-atom)\n",
      "h=6.6E-34; #in J-s (Planck's constant)\n",
      "k=1.376E-23; #in J/degree (Boltzmann constant)\n",
      "\n",
      "#calculate\n",
      "#Since lambda=h/(m*v)\n",
      "#E=mv^2/2;\n",
      "#Therefore lambda=h/sqrt(2*m*E)\n",
      "#E=kT\n",
      "#Therefore lambda=h/sqrt(2*m*k*T)\n",
      "lambda1=h/math.sqrt(2*m*k*T)\n",
      "lambda2=lambda1*1E10; #changing unit from m to Angstrom\n",
      "\n",
      "#result\n",
      "print\"The de-Broglie wavelength of He-atom is =\",lambda1,\"m\";\n",
      "print\"\\t\\t\\t\\t        =\",round(lambda2,4),\"Angstrom\";    "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de-Broglie wavelength of He-atom is = 7.6851495611e-11 m\n",
        "\t\t\t\t        = 0.7685 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9 , Page no:106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "m_e=9.1E-31; #in Kg (mass of electron)\n",
      "m_p=1.6E-27; #in Kg (mass of proton)\n",
      "h=6.626E-34; #in J-s (Planck's constant)\n",
      "c=3E8; #in m/s (velocity of light)\n",
      "\n",
      "#calculate\n",
      "E=m_e*c**2; #in J (rest energy of electron)\n",
      "#Since lambda=h/(m*v)\n",
      "#E=mv^2/2;\n",
      "#herefore lambda=h/sqrt(2*m*E)\n",
      "#Also E=m_e*c^2;\n",
      "#therefore lambda=h/sqrt(2*m_p*m_e*c^2)\n",
      "lambda1=h/math.sqrt(2*m_p*m_e*c**2); #calculation of wavelength\n",
      "lambda2=lambda1*1*10**10; #changing unit from m to Angstrom\n",
      "\n",
      "#result\n",
      "print\"The de-Broglie wavelength of proton is =\",lambda1,\"m\";\n",
      "print\"\\t\\t\\t\\t       =\",lambda2,\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The de-Broglie wavelength of proton is = 4.0929316435e-14 m\n",
        "\t\t\t\t       = 0.00040929316435 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10 , Page no:106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "V=10000; #in V (Potential)\n",
      "\n",
      "#calculate\n",
      "lambda1=12.27/math.sqrt(V); #calculation of wavelength in Angstrom\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",round(lambda1,3),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 0.123 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11 , Page no:107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "V=100; #in V (Potential)\n",
      "n=1; #order of diffraction\n",
      "d=2.15; #in Angstrom (lattice spacing)\n",
      "\n",
      "#calculate\n",
      "lambda1=12.27/math.sqrt(V); #calculation of wavelength in Angstrom\n",
      "#Since 2*d*sind(theta)=n*lambda\n",
      "#therefore we have\n",
      "theta=math.asin(n*lambda1/(2*d)); #calculation of glancing angle\n",
      "theta1=theta*180/3.14;\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",round(lambda1,3),\"Angstrom\";\n",
      "print\"The glancing angle is =\",round(theta1,1),\"degree\";\n",
      "print \"Note: In question V=100 eV but the solution is using V=100V \"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 1.227 Angstrom\n",
        "The glancing angle is = 16.6 degree\n",
        "Note: In question V=100 eV but the solution is using V=100V \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12 , Page no:107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "V=344; #in V (Potential)\n",
      "n=1; #order of diffraction\n",
      "theta=60; #in degree (glancing angle)\n",
      "\n",
      "#calculate\n",
      "lambda1=12.27/math.sqrt(V); #calculation of wavelength in Angstrom\n",
      "#Since 2*d*sind(theta)=n*lambda\n",
      "#therefore we have\n",
      "d=n*lambda1/(2*math.sin(math.radians(theta))); #calculation of spacing constant\n",
      "\n",
      "#result\n",
      "print\"The wavelength is =\",round(lambda1,3),\"Angstrom\";\n",
      "print\"The spacing of the crystal is =\",round(d,4),\"Angstrom\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is = 0.662 Angstrom\n",
        "The spacing of the crystal is = 0.3819 Angstrom\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.13 , Page no:107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "r=0.53*10**-10; #in m (radius of first Bohr orbit)\n",
      "h=6.6*10**-34; #in J-s (Planck's constant)\n",
      "m=9.1*10**-31; #in Kg (mass of electron)\n",
      "n=1; #First Bohr orbit\n",
      "pi=3.14; #value of pi used in the solution\n",
      "\n",
      "#calculate\n",
      "#Since 2*pi*r=n*lambda  and  lambda=h/(m*v)\n",
      "#Threfore we have v=h*n/(2*pi*r*m)\n",
      "v=h*n/(2*pi*r*m); #calculation of velocity\n",
      "\n",
      "#result\n",
      "print\"The velocity of electron is =\",v,\"m/s\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of electron is = 2179049.16859 m/s\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.14 , Page no:108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dx=0.2; #in Angstrom (uncertainty in the position)\n",
      "h=6.6E-34; #in J-s (Planck's constant)\n",
      "m0=9.1E-31; #in Kg (mass of electron)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "\n",
      "#calculate\n",
      "dx=dx*1E-10; #since dx is in Angstrom\n",
      "#Since dx*dp=h/4*pi  (uncertainty relation)\n",
      "dp=h/(4*pi*dx); #calculation of uncertainty in the momentum\n",
      "#since dp=m*dv\n",
      "dv=dp/m0; #calculation of uncertainty in the velocity\n",
      "\n",
      "#result\n",
      "print\"The uncertainty in the momentum is dp=\",dp,\"Kg-m/\";\n",
      "print\"The uncertainty in the velocity is dv=\",dv,\"m/s\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainty in the momentum is dp= 2.62738853503e-24 Kg-m/\n",
        "The uncertainty in the velocity is dv= 2887240.14839 m/s\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.15 , Page no:108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "m_e=9.1E-31; #in Kg (mass of electron)\n",
      "m_p=1.67E-27; #in Kg (mass of proton)\n",
      "dx_p=1; #in nanometer (uncertainty in position of electron)\n",
      "dx_n=1; #in nanometer (uncertainty in position of proton)\n",
      "\n",
      "#calculate\n",
      "#since dp=h/(4*pi*dx)\n",
      "#since h/(4*pi) is constant and dx is same for electron and proton \n",
      "#therefor both electron and proton have same uncertainty in the momentum\n",
      "#since dv=dp/m  and  dp is same for both\n",
      "#therefore dv_e/dv_p=m_p/m_e\n",
      "#therefore\n",
      "K=m_p/m_e; #ratio of uncertainty in the velocity of electron and proton\n",
      "\n",
      "#result\n",
      "print\"The ratio of uncertainty in the velocity of electron to that of proton is =\",round(K);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The ratio of uncertainty in the velocity of electron to that of proton is = 1835.0\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.16 , Page no:108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dx=5*10**-15; #in m (radius of nucleus or uncertainty in the position)\n",
      "h=6.6*10**-34; #in J-s (Planck's constant)\n",
      "m=1.67E-27; #in Kg (mass of proton)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "e=1.6E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "#Since dx*dp=h/4*pi  (uncertainty relation)\n",
      "dp=h/(4*pi*dx); #calculation of uncertainty in the momentum\n",
      "p=dp; #minimum value of momentum to calculate mimimum kinetic energy\n",
      "K=(p**2)/(2*m); #calculation of minimum kinetic energy of proton\n",
      "K1=K/e; #changing unit from J to eV\n",
      "K2=K1/1E6; #changing unit from eV to MeV\n",
      "\n",
      "#result\n",
      "print\"The minimum uncertainty in the momentum of proton is dp =\",dp,\"Kg-m/s\";\n",
      "print\"The minimum kinetic energy of proton is K=\",K,\"J\";\n",
      "print\"\\t\\t\\t\\t \\t =\",K1,\"eV\";\n",
      "print\"\\t\\t\\t\\t\\t =\",K2,\"MeV\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum uncertainty in the momentum of proton is dp = 1.05095541401e-20 Kg-m/s\n",
        "The minimum kinetic energy of proton is K= 3.30690803067e-14 J\n",
        "\t\t\t\t \t = 206681.751917 eV\n",
        "\t\t\t\t\t = 0.206681751917 MeV\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.17 , Page no:109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "K=1; #in KeV (kinetic energy of electron)\n",
      "dx=1; #in Angstrom (uncertainty in the position)\n",
      "h=6.63E-34; #in J-s (Planck's constant)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "e=1.6E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "dx=dx*1E-10; #since dx is in Angstrom\n",
      "#Since dx*dp=h/4*pi  (uncertainty relation)\n",
      "dp=h/(4*pi*dx); #calculation of uncertainty in the momentum\n",
      "K=K*1E3*1.6E-19; #changing unit from KeV to J\n",
      "p=math.sqrt(2*m*K); #calculation of momentum \n",
      "poc=(dp/p)*100; #calculation of percentage of uncertainty\n",
      "\n",
      "#result\n",
      "print\"The uncertainty in the momentum of electron is dp=\",dp,\"Kg-m/s\";\n",
      "print\"The momentum of electron is p=\",p,\"Kg-m/s\";\n",
      "print\"The percentage of uncertainty in the momentum  is =\",round(poc,1);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainty in the momentum of electron is dp= 5.27866242038e-25 Kg-m/s\n",
        "The momentum of electron is p= 1.70645832062e-23 Kg-m/s\n",
        "The percentage of uncertainty in the momentum  is = 3.1\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.18 , Page no:109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "v=6.6E4; #m/s (speed of electron)\n",
      "poc=0.01; #percentage of uncertainty\n",
      "h=6.63E-34; #in J-s (Planck's constant)\n",
      "m=9E-31; #in Kg (mass of electron)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "\n",
      "#calculate\n",
      "p=m*v; #calculation of momentum\n",
      "dp=(poc/100)*p; #calculation of uncertainty in the momentum\n",
      "#Since dx*dp=h/4*pi  (uncertainty relation)\n",
      "dx=h/(4*pi*dp); #calculation of uncertainty in the position\n",
      "\n",
      "#result\n",
      "print\"The momentum of electron is p=\",p,\"Kg-m/s\";\n",
      "print\"The uncertainty in the momentum of electron is dp=\",dp,\"Kg-m/s\";\n",
      "print\"The uncertainty in the position of electron is dx=\",dx,\"Kg-m/s\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The momentum of electron is p= 5.94e-26 Kg-m/s\n",
        "The uncertainty in the momentum of electron is dp= 5.94e-30 Kg-m/s\n",
        "The uncertainty in the position of electron is dx= 8.88663707135e-06 Kg-m/s\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.19 , Page no:111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "lambda1=1; #in Angstrom (wavelength)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "dlambda=1E-6; #uncertainty in wavelength\n",
      "\n",
      "#calculate\n",
      "lambda2=lambda1*1E-10; #sinc lambda is in Angstrom\n",
      "#By uncertainty principle, dx*dp>=h/(4*pi)  --(1)\n",
      "#since p=h/lambda  -----(2)\n",
      "#Or p*lambda=h \n",
      "#diffrentiting this equation\n",
      "#p*dlambda+lambda*dp=0\n",
      "#dp=-p*dlambda/lambda     ----(3)\n",
      "#from (2) and (3)  dp=-h*dlambda/lambda^2   ---(4)\n",
      "#from (1) and(4)  dx*dlambda>=lambda^2/4*pi\n",
      "#Or dx=lambda^2/(4*pi*dlambda)\n",
      "dx=lambda2**2/(4*pi*dlambda); #calculation of uncertainty in the position\n",
      "\n",
      "#result\n",
      "print\"The uncertainty in the position of X-ray photon is dx=\",dx,\"m\";\n",
      "print \"Note: wavelength accuracy is given as 1 in 1E8 but in book solution has used 1 in 1E6 \"\n",
      "print \" ANSWEER IS WRONG IN THE TEXTBOOK\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainty in the position of X-ray photon is dx= 7.96178343949e-16 m\n",
        "Note: wavelength accuracy is given as 1 in 1E8 but in book solution has used 1 in 1E6 \n",
        " ANSWEER IS WRONG IN THE TEXTBOOK\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.20 , Page no:111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dt=1*10**-8; #in sec (average life time)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "\n",
      "#calculate\n",
      "#Since dE*dt>=h/(4*pi)  (uncertainty relation for energy)\n",
      "#and E=h*v      v is the frequency\n",
      "#therefore we have dv>=1/(4*pi*dt)\n",
      "dv=1/(4*pi*dt); #calculation of minimum uncertainty in the frequency\n",
      "\n",
      "#result\n",
      "print\"The minimum uncertainty in the frequency of the photon is dv=\",dv,\"sec^-1\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum uncertainty in the frequency of the photon is dv= 7961783.43949 sec^-1\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.21 , Page no:111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dt=1E-12; #in sec (average life time)\n",
      "h=6.63E-34; #in J-s (Planck'c constant)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "e=1.6*1E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "#Since dE*dt>=h/(4*pi)  (uncertainty relation for energy)\n",
      "dE=h/(4*pi*dt); #calculation of minimum uncertainty in the energy\n",
      "dE1=dE/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The uncertainty in the energy of the photon is dE=\",dE,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t         =\",dE1,\"eV\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainty in the energy of the photon is dE= 5.27866242038e-23 J\n",
        "\t\t\t\t\t         = 0.000329916401274 eV\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.22 , Page no:111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dT=2.5E-14; #in sec (average life time)\n",
      "h=6.63E-34; #in J-s (Planck'c constant)\n",
      "pi=3.14; #value of pi used in the solution\n",
      "e=1.6*1E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "#Since dE*dt>=h/(4*pi)  (uncertainty relation for energy)\n",
      "dE=h/(4*pi*dT); #calculation of minimum uncertainty in the energy\n",
      "dE1=dE/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The uncertainty in the energy of the photon is dE=\",dE,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t         =\",dE1,\"eV\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The uncertainty in the energy of the photon is dE= 2.11146496815e-21 J\n",
        "\t\t\t\t\t         = 0.013196656051 eV\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.23 , Page no:112"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "a=2; #in Angstrom (length of the box)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.626E-34; #in J-s (Planck'c constant)\n",
      "n2=2; n4=4; #two quantum states\n",
      "e=1.6*1E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "a=a*1E-10; #since a is in Angstrom \n",
      "#Since  E_n=n^2*h^2/(8*m*a^2)   (Energy corresponding to nth quantum state)\n",
      "E2=n2**2*h**2/(8*m*a**2); #calculation of energy corresponding to the 2nd quantum state\n",
      "E21=E2/e; #changing unit from J to eV\n",
      "E4=n4**2*h**2/(8*m*a**2); #calculation of energy corresponding to the 4nd quantum state\n",
      "E41=E4/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The energy corresponding to the 2nd quantum state is E2=\",E2,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t\\t       =\",E21,\"eV\";\n",
      "print\"The energy corresponding to the 4nd quantum state is E4=\",E4,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t\\t       =\",E41,\"eV\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy corresponding to the 2nd quantum state is E2= 6.0307521978e-18 J\n",
        "\t\t\t\t\t\t       = 37.6922012363 eV\n",
        "The energy corresponding to the 4nd quantum state is E4= 2.41230087912e-17 J\n",
        "\t\t\t\t\t\t       = 150.768804945 eV\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.24 , Page no:113"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "a=1E-10; #in m (width of the well)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.626E-34; #in J-s (Planck'c constant)\n",
      "n1=1; n2=2; n3=3; #ground and first two excited states\n",
      "e=1.6*1E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "#Since  E_n=n^2*h^2/(8*m*a^2)   (Energy corresponding to nth quantum state)\n",
      "E1=n1**2*h**2/(8*m*a**2); #calculation of energy corresponding to the Ground state\n",
      "E11=E1/e; #changing unit from J to eV\n",
      "E2=n2**2*h**2/(8*m*a**2); #calculation of energy corresponding to the 1st excited state\n",
      "E21=E2/e; #changing unit from J to eV\n",
      "E3=n3**2*h**2/(8*m*a**2); #calculation of energy corresponding to the 2nd excited state\n",
      "E31=E3/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The energy corresponding to the ground state is E1=\",E1,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t =\",E11,\"eV\";\n",
      "print\"The energy corresponding to the 1st excited state is E2=\",E2,\"\";\n",
      "print\"\\t\\t\\t\\t\\t =\",E21,\"eV\";\n",
      "print\"The energy corresponding to the 2nd excited state is E3=\",E3,\"J\";\n",
      "print\"\\t\\t\\t\\t\\t =\",E31,\"eV\";\n",
      "print \" There is slight variation in the answer due to round off error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy corresponding to the ground state is E1= 6.0307521978e-18 J\n",
        "\t\t\t\t\t = 37.6922012363 eV\n",
        "The energy corresponding to the 1st excited state is E2= 2.41230087912e-17 \n",
        "\t\t\t\t\t = 150.768804945 eV\n",
        "The energy corresponding to the 2nd excited state is E3= 5.42767697802e-17 J\n",
        "\t\t\t\t\t = 339.229811126 eV\n",
        " There is slight variation in the answer due to round off error\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.25 , Page no:113"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "dx=1E-8; #in m (length of box or uncertainty in the position)\n",
      "h=6.626E-34; #in J-s (Planck'c constant)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "\n",
      "#calculate\n",
      "#From uncertainty principle dx*dp=h and dp=m*dv\n",
      "#therefore we have\n",
      "dv=h/(m*dx); #calculation of minimum uncertainty in the velocity\n",
      "dv1=dv*1E-3; #changing unit from m/s to Km/s\n",
      "\n",
      "#result\n",
      "print\"The minimum uncertainty in the velocity of electron i dv=\",dv,\"m/s\";\n",
      "print\"\\t\\t\\t\\t\\t\\t        =\",round(dv1,2),\"Km/s\";\n",
      "print \"Note: There is slight variation in the answer due to round off error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum uncertainty in the velocity of electron i dv= 72813.1868132 m/s\n",
        "\t\t\t\t\t\t        = 72.81 Km/s\n",
        "Note: There is slight variation in the answer due to round off error\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.26 , Page no:113"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#given\n",
      "a=4E-10; #in m (length of the box)\n",
      "m=9.1E-31; #in Kg (mass of electron)\n",
      "h=6.626E-34; #in J-s (Planck'c constant)\n",
      "n1=1; #ground state\n",
      "e=1.6*1E-19; #in C (charge of electron)\n",
      "\n",
      "#calculate\n",
      "#Since  E_n=n^2*h^2/(8*m*a^2)   (Energy corresponding to nth quantum state)\n",
      "E1=n1**2*h**2/(8*m*a**2); #calculation of energy corresponding to the ground state\n",
      "E11=E1/e; #changing unit from J to eV\n",
      "\n",
      "#result\n",
      "print\"The minimum energy of electron is E1=\",E1,\"J (Note: The answer in the book  is wrong due to printing error)\";\n",
      "print\"\\t\\t\\t\\t    =\",round(E11,3),\"eV\";\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum energy of electron is E1= 3.76922012363e-19 J (Note: The answer in the book  is wrong due to printing error)\n",
        "\t\t\t\t    = 2.356 eV\n"
       ]
      }
     ],
     "prompt_number": 26
    }
   ],
   "metadata": {}
  }
 ]
}