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
|
{
"metadata": {
"celltoolbar": "Raw Cell Format",
"name": "",
"signature": "sha256:0fda5ad610d37dd806c4c513ae5112b4ea24471ff454c480ace9533d3079b418"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1: Elements of Optics And Quantum Physics"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.1,Page number 5"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Given\n",
"\n",
"print\"(i) t1=d/c\";\n",
"print\"(ii) t2=[(d-5)/c]+[5/v2]\";\n",
"print\" v2=c/n2\";\n",
"print\" t2=(d+2.5)/c\";\n",
"print\"(iii)delta_t=t2-t1=(d+2.5-d)/c\";\n",
"c=3*10**8; #Speed of light in m/s\n",
"delta_t=2.5*10**-2/c; #converted 2.5 cm into meters\n",
"print\"The time difference\",\"{0:.3e}\".format(delta_t),\"s\" ;\n",
"print\"Arrival time difference of two monochromatic beams is\",delta_t*10**12,\"ps\";\n",
"# Answer misprinted in the book\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(i) t1=d/c\n",
"(ii) t2=[(d-5)/c]+[5/v2]\n",
" v2=c/n2\n",
" t2=(d+2.5)/c\n",
"(iii)delta_t=t2-t1=(d+2.5-d)/c\n",
"The time difference 8.333e-11 s\n",
"Arrival time difference of two monochromatic beams is 83.3333333333 ps\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.2,Page number 5"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"#Applying Snell's law\n",
"a=1*math.sin(428)/1.333; #a=sin(w2)\n",
"print\"Angle of refraction is\",round(math.degrees(math.asin(a)),3),\"degree\";\n",
"\n",
"c=3*10**8; #speed of light in m/s\n",
"n2=1.333; #refractive index of 2nd medium\n",
"v2=c/n2; #velocity in second medium in m/s\n",
"n1=1; #refractive index of 1st medium\n",
"l1=620; #in nm wavelength\n",
"\n",
"print\"Velocity of optical ray through medium second\",\"{0:.3e}\".format(v2),\"m/s\";\n",
"\n",
"l2= (n1*l1)/n2; #wavelength in 2nd medium in nm\n",
"print\"Wavelenght of optical ray through medium second\",round(l2,4),\"nm\"; #Result\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Angle of refraction is 30.512 degree\n",
"Velocity of optical ray through medium second 2.251e+08 m/s\n",
"Wavelenght of optical ray through medium second 465.1163 nm\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.3,Page number 5"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"n1=1; #refractive index of air\n",
"n2=1.56; #refractive index of medium\n",
"w1=60; #in deg C\n",
"#using snell's law\n",
"a= n1*sin(w1*math.pi/180)/n2; #a=sin(w1)\n",
"w2=math.degrees(math.asin(a)); #in degree\n",
"print\"Angle of refraction is\",round(w2,4),\"degree\";\n",
"B=w1-w2; #in degree\n",
"print\"Angle of deviation is\",round(B,4),\"degree\";\n",
"# The answer doesn't match because of priting errorsin calculation as sin(608)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Angle of refraction is 33.7207 degree\n",
"Angle of deviation is 26.2793 degree\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.4,Page number 6"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"print\"Solution (i)\";\n",
"w=5/12.5; #tan(w)=5/12.5;\n",
"print\"The value of tan(w2) is\",w;\n",
"w2=math.atan(w)*180/math.pi;\n",
"\n",
"print\"The value of w2 is\",round(w2,4),\"degree\";\n",
"print\"The value of sin(w2) is\",round(math.sin(w2*math.pi/180),4);\n",
"\n",
"print\"Solution (ii)\";\n",
"#Applying snell's law\n",
"n1=1.05;\n",
"n2=1.5;\n",
"w1=(n2*sin(w2*math.pi/180))/n1; #a=sin(w1)\n",
"print\"The value of sin(w1) is\",round(w1,4);\n",
"print\"The value of w1 is\",round(math.degrees(math.asin(w1)),4),\"degree\";\n",
"#value of w1\n",
"#tan(w1)=(p-x)12.5;\n",
"k=0.62*12.5;\n",
"d=1.05*((12.5)**2+(k)**2)**0.5 +1.5*(12.5**2+5**2)**0.5; #d=1.05[(h1)^2+(k)^2]^0.5 +n2(h2**2+x**2)^0.5;\n",
"print\"The optical distance is\",round(d,4),\"cm\";\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"The value of tan(w2) is 0.4\n",
"The value of w2 is 21.8014 degree\n",
"The value of sin(w2) is 0.3714\n",
"Solution (ii)\n",
"The value of sin(w1) is 0.5306\n",
"The value of w1 is 32.0432 degree\n",
"The optical distance is 35.6373 cm\n"
]
}
],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.5,Page number 11"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"c=3*10**8;\n",
"print\"Solution (i)\";\n",
"ri=1.5; #refractive index\n",
"u=830; # in nm\n",
"l=u/ri; #in nm\n",
"print\"Wavelength is\",round(l,4),\"nm\\n\";\n",
"\n",
"print\"Solution (ii)\";\n",
"l=round(l); # rounding to nearest integer\n",
"f=c/(l*10**-9)*10**-12; #in THz\n",
"print\"frequency is\",round(f,4),\"THz\\n\";\n",
"\n",
"print\"Solution (iii)\";\n",
"f=round(f); #rounding to nearest integer\n",
"v=l*10**-9*f*10**12; #in m/s\n",
"print\"phase velocity is\",\"{0:.3e}\".format(v),\"m/s\";\n",
"\n",
"#answer is getting rounding off due to larger calculation\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"Wavelength is 553.3333 nm\n",
"\n",
"Solution (ii)\n",
"frequency is 542.4955 THz\n",
"\n",
"Solution (iii)\n",
"phase velocity is 2.997e+08 m/s\n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.6,Page number 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"print\"Solution (i)\";\n",
"l=720; #wavelength in nm\n",
"n=1.5; #refractive index\n",
"lm=l/n;\n",
"print\"Wavelenth is\",lm,\"nm\"; #result\n",
"\n",
"print\"Solution (ii)\";\n",
"c=3*10**8; #in m/s speed of light\n",
"u=c/n;\n",
"print\"Velocity is\",\"{0:.3e}\".format(u),\"m/s\"; #result\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"Wavelenth is 480.0 nm\n",
"Solution (ii)\n",
"Velocity is 2.000e+08 m/s\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.7,Page number 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"print\"Solution (i)\";\n",
"c=3*10**8; #in m/s speed of light\n",
"l=640; #in nm\n",
"u=2.2*10**8; #in m/s\n",
"lm=u*l/c; #wavelenth in medium\n",
"print\"The wavelength is\",round(lm,4),\"nm\"; #The answer in the book is misprinted\n",
"\n",
"print\"Solution (ii)\";\n",
"n=l/lm; #refractive index\n",
"print\"Refractive Index is\",round(n,4); #The answer in the book is misprinted\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"The wavelength is 469.3333 nm\n",
"Solution (ii)\n",
"Refractive Index is 1.3636\n"
]
}
],
"prompt_number": 29
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.8,Page number 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"#k=aa+as=6.3;\n",
"#Given values from research\n",
"k=6.3; #combined attenuation due to absorption and scattering\n",
"d=25; #in cm\n",
"print\"Solution (ii)\";\n",
"#Io/Ii=exp(-(ao+ai)*d); d in m\n",
"j=math.e**(-(k)*d/100); #Io/Ii ratio\n",
"print\"Io is\",round(j,4),\"of Ii\"; #result"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (ii)\n",
"Io is 0.207 of Ii\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.9,Page number 13"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"# Given formula Io/Ii=exp(-(ao+ai)*d);\n",
"# k=aa+as=63.1;\n",
"# Io/Ii=1.5\n",
"d=log(0.15)/-63.1; #length of tube\n",
"print\"Length of tube, d =\",round(d*100,4),\"cm\"; #Result\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Length of tube, d = 3.0065 cm\n"
]
}
],
"prompt_number": 32
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.10,Page number 26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"\n",
"#p=m/{m+[2*n/(1-n)^2]^2};\n",
"\n",
"m=5; #no. of reflective plates\n",
"n=1.33; #refractive indices\n",
"p=m/(m+(2*n/(1-(n)**2))**2); #degree of polarisation\n",
"print\"The degree of polarisation is\",round(p,1);\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The degree of polarisation is 0.3\n"
]
}
],
"prompt_number": 35
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.11,Page number 26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"\n",
"#m= p*{m+[2*n/(1-n)^2]^2};\n",
"\n",
"n=1.5; #refractive indices\n",
"p=0.45; #degree of polarisation\n",
"m=(p*(2*n/(1-n**2))**2)/(1-p);\n",
"print\"Thus it will require\",round(m,4),\"reflective plate to achive a degree of polarization equal to 0.45\"; \n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Thus it will require 4.7127 reflective plate to achive a degree of polarization equal to 0.45\n"
]
}
],
"prompt_number": 41
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.12,Page number 27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"#I1/I0=cos(w)^2\n",
"#k=I1/I0;\n",
"\n",
"w=30; #angle bw polarizer and analyser in degee\n",
"k=math.cos(w*math.pi/180)**2;\n",
"print\"The ratio of optical ray intensity ,I1/I0=\",k; #Result\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The ratio of optical ray intensity ,I1/I0= 0.75\n"
]
}
],
"prompt_number": 43
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.13,Page number 27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given data\n",
"\n",
"#I1/I0=cos(w)^2\n",
"#Given I1/I0=0.55\n",
"\n",
"k=math.sqrt(0.55); #from above formulae\n",
"\n",
"print\"The angle bw polarizer and analyser , w is\",round(math.degrees(math.acos(k)),4),\"degree\";\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The angle bw polarizer and analyser , w is 42.1304 degree\n"
]
}
],
"prompt_number": 48
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.14,Page number 29"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"print\"Solution (i)\";\n",
"ne=1.4; #refractive index\n",
"no=1.25; #refractive index\n",
"c=3*10**8; #in m/s\n",
"T=2*10**-5; #in m\n",
"l=740; #in nm\n",
"t=(ne-no)*T/c; #time difference\n",
"print\"Time difference, t is\",t*10**12,\"ps\";\n",
"print\"Solution (ii)\";\n",
"le=l/ne; \n",
"lo=l/no;\n",
"fi=2*math.pi*T*(1/le-1/lo)*10**9;\n",
"print\"Phase difference is\",round(fi,4),\"rad\"; \n",
"# Answer misprinted in book"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"Time difference, t is 0.01 ps\n",
"Solution (ii)\n",
"Phase difference is 25.4724 rad\n"
]
}
],
"prompt_number": 51
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.15,Page number 31"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given \n",
"\n",
"#E=h*v=h*c/l;\n",
"\n",
"E=3; #In KeV\n",
"#1eV=1.6*10^-19\n",
"h=6.63*10**-34; #plank constant in J/s\n",
"c=3*10**8; # speed of light in m/s\n",
"l=h*c/(E*10**3*1.6*10**-19); #wavelength in nm\n",
"print\"wavelength of a electromagnetic radiation is\",round(l*10**9,4),\"nm\";\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"wavelength of a electromagnetic radiation is 0.4144 nm\n"
]
}
],
"prompt_number": 53
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.16,Page number 31"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"\n",
"print\"Solution (i)\";\n",
"l=670 #in nm\n",
"h=6.63*10**-34; #plank constant in J/s\n",
"c=3*10**17 #speed of light in nm/sec\n",
"Ek=0.75 #In eV\n",
"phi=(h*c/l)/(1.6*10**-19) -Ek;\n",
"phi=round(phi*10)/10; #round to 1 decimal point\n",
"print\"Characteristic of material =\",phi,\"eV\";\n",
"\n",
"print\"Solution (ii)\";\n",
"fc=phi*1.6*10**-19/h*10**-12; #frequency in THz#result\n",
"fc=round(fc);\n",
"print\"Cuttoff frequency is =\",fc,\"THz\";\n",
"lc=c/(fc*10**12); #in nm\n",
"print\"Cuttoff wavelength is =\",round(lc,4),\"nm\";\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"Characteristic of material = 1.1 eV\n",
"Solution (ii)\n",
"Cuttoff frequency is = 265.0 THz\n",
"Cuttoff wavelength is = 1132.0755 nm\n"
]
}
],
"prompt_number": 62
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.17,Page number 31"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"\n",
"print\"Solution (i)\";\n",
"l=0.045; #wavelength in nm\n",
"h=6.63*10**-34; #planks constant in J/s\n",
"c=3*10**8; #speed of light in m/s\n",
"E=h*c/l/10**-9; #energy of photon in eV\n",
"print\"E =\",\"{0:.3e}\".format(E),\"J\";\n",
"\n",
"E1=E/(1.6*10**-19); # energy in joule\n",
"print\"E =\",\"{0:.3e}\".format(E1),\"eV\";\n",
" \n",
"e=1.6*10**-19; # charge of electron\n",
"\n",
"print\"Solution (ii)\";\n",
"V=E/e;\n",
"print\"Required voltage is =\",V/1000,\"KV\";\n",
"\n",
"#Value of wavelenght in problem is .45 but in the solution is .045 \n",
"#the value considered above is .045\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"E = 4.420e-15 J\n",
"E = 2.762e+04 eV\n",
"Solution (ii)\n",
"Required voltage is = 27.625 KV\n"
]
}
],
"prompt_number": 59
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.18,Page number 36"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#given\n",
"\n",
"print\"Solution (i)\";\n",
"x=620 # difference in particle momentum In nm\n",
"h=6.63*10**-34 # planks constant In J/s\n",
"#p=h/(4*pi*x);\n",
"#m*v=h/(4*pi*x);\n",
"m=9.11*10**-31 #mass of electron in kg \n",
"v=h /(4*math.pi* x *10**-9*m); #electron velocity\n",
"print\"The uncertanity in electron velocity is\",round(v,4),\"m/s\";\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Solution (i)\n",
"The uncertanity in electron velocity is 93.41 m/s\n"
]
}
],
"prompt_number": 61
}
],
"metadata": {}
}
]
}
|