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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4: Geometrical Optics"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.2, Page 191"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import *\n",
"\n",
"#Variable declaration\n",
"r = 1; # For convenience assume radius of the circle to be unity, unit\n",
"alpha = 0.8*r; # Distance of light source from the centre of the spherical shell, unit\n",
"\n",
"#Calculations\n",
"cos_phi_by_2 = sqrt((alpha+1)/(4*alpha));\n",
"\n",
"#Result\n",
"print \"cos(phi/2) = %d/4\"%(cos_phi_by_2*4)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"cos(phi/2) = 3/4\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.3, Page 193"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"f1 = 5.; # Focal length of thin convex lens, cm \n",
"f2 = 3.; # Focal length of thin convex lens, cm \n",
"d = 2.; # Separation between the lenses, cm\n",
"\n",
"#Calculations\n",
"F = (1./f1)+(1./f2)-(d/(f1*f2)); # Equivalent focal length of a combination of the two lenses, cm\n",
"\n",
"#Result\n",
"print \"The equivalent focal length of the combination of lenses = %3.1f cm\"%F\n",
"#incorrect answers in the textbook"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The equivalent focal length of the combination of lenses = 0.4 cm\n"
]
}
],
"prompt_number": 33
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.4, Page 194"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"P1 = 5; # Power of first converging lens, diopter\n",
"P2 = 4; # Power of second converging lens, diopter\n",
"d = 0.1; # Separation distance between two lenses, cm\n",
"\n",
"#Calculations\n",
"P = P1+P2-d*P1*P2;\n",
"f = 1/P*100; # The corresponding value of the focal length of the lens combination, cm\n",
"\n",
"#Result\n",
"print \"The focal length of the combination of lenses of given powers = %5.2f cm\"%f\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The focal length of the combination of lenses of given powers = 14.29 cm\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.5, Page 194"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"f1 = 30.; # Focal length first convex lens, cm \n",
"f2 = -50.; # Focal length of second convex lens, cm \n",
"d = 20.; # Separation distance between lenses, cm \n",
"\n",
"#Calculations\n",
"F = f1*f2/(f1+f2-d); # Equivalent focal length of a combination of the two lenses, cm\n",
"\n",
"#Result\n",
"print \"The equivalent focal length of the combination = %4.1f cm\"%F\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The equivalent focal length of the combination = 37.5 cm\n"
]
}
],
"prompt_number": 34
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.7, Page 195"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"f1 = 4.; # Focal length of thin convex lens, cm \n",
"f2 = 12.; # Focal length of thin convex lens, cm \n",
"d = 8.; # Separation distance between the lenses, cm\n",
"\n",
"#Calculations&Results\n",
"F = f1*f2/(f1+f2-d); # Equivalent focal length of the combination, cm\n",
"L1H1 = d*F/f2; # Distance of first principal point H1 from first lens, cm\n",
"print \"The distance of the first principal point H1 from the first lens = %d cm\"%L1H1\n",
"L2H2 = -d*F/f1; # Distance of first principal point H2 from second lens, cm\n",
"print \"The distance of the second principal point H2 from the second lens = %d cm\"%L2H2\n",
"L1F1 = -F*(1-d/f2); # Distance of first focal point F1 from first lens, cm\n",
"print \"The distance of the first focal point F1 from the first lens = %d cm\"%L1F1\n",
"L2F2 = F*(1-d/f1); # Distance of second focal point F2 from first lens, cm\n",
"print \"The distance of the second focal point F2 from the second lens= %d cm\"%L2F2\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The distance of the first principal point H1 from the first lens = 4 cm\n",
"The distance of the second principal point H2 from the second lens = -12 cm\n",
"The distance of the first focal point F1 from the first lens = -2 cm\n",
"The distance of the second focal point F2 from the second lens= -6 cm\n"
]
}
],
"prompt_number": 35
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.8, Page 195"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"f1 = 25.; # Focal length of thin convex lens, cm \n",
"f2 = -15.; # Focal length of thin concave lens, cm \n",
"d = 15.; # Separation distance between the lenses, cm \n",
"\n",
"#Calculations&Results\n",
"# We know that, F = f1*f2/f1+f2-d then\n",
"F = f1*f2/(f1+f2-d); # The equivalent focal length of the combination\n",
"L1H1 = d*F/f2; # The distance of the first principal point H1 from the first lens, cm\n",
"print \"The distance of the first principal point H1 from the first lens = %d cm\"%L1H1\n",
"L2H2 = -d*F/f1; # The distance of the second principal point H2 from the first lens, cm\n",
"print \"The distance of the second principal point H2 from the second lens = %d cm\"%L2H2\n",
"L1F1 = -F*(1-d/f2); # The distance of the first focal point F1 from the first lens, cm\n",
"print \"The distance of the first focal point H1 from the first lens = %d cm\"%L1F1\n",
"L2F2 = F*(1-d/f1); # The distance of the second principal point F2 from the first lens, cm\n",
"print \"The distance of the second focal point H2 from the second lens= %d cm\"%L2F2\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The distance of the first principal point H1 from the first lens = -75 cm\n",
"The distance of the second principal point H2 from the second lens = -45 cm\n",
"The distance of the first focal point H1 from the first lens = -150 cm\n",
"The distance of the second focal point H2 from the second lens= 30 cm\n"
]
}
],
"prompt_number": 36
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.9, Page 196"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"from scipy.linalg import solve\n",
"from numpy import *\n",
"\n",
"#Variable declaration\n",
"w1 = 0.024; # Magnitude of the print ersive power of first lens\n",
"w2 = 0.036; # Magnitude of the print ersive power of second lens\n",
"\n",
"#Calculations\n",
"# Let 1/f1 = x and 1/f2 = y, then\n",
"# The condition for achromatic combination of two lenses, w1/f1 + w2/f2 = 0 => w1*x + w2*y = 0 --- [i]\n",
"F = 90.; # Given focal length, cm\n",
"# Also F = 1/f1 + 1/f2 => F = x + y ---- (II)\n",
"A = array([[w1 ,w2],[ 1, 1]]); # Square matrix\n",
"B = array([0,1/F]); # Column vector\n",
"X = solve(A,B)\n",
"f1 = 1/X[0]; # Focal length of convex lens, cm\n",
"f2 = 1/X[1]; # Focal length of concave lens, cm\n",
"\n",
"#Results\n",
"print \"The focal length of convex lens = %.f cm\"%((f1))\n",
"print \"The focal length of concave lens = %.f cm\"%((f2))\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The focal length of convex lens = 30 cm\n",
"The focal length of concave lens = -45 cm\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.10, Page 197"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"from scipy.linalg import solve\n",
"from numpy import *\n",
"\n",
"\n",
"#Variable declaration\n",
"w1 = 0.02; # Magnitude of the dispersive power of first lens\n",
"w2 = 0.04; # Magnitude of the dispersive power of second lens\n",
"\n",
"#Calculations\n",
"# Let 1/f1 = x and 1/f2 = y, then\n",
"# The condition for achromatic combination of two lenses, w1/f1 + w2/f2 = 0 => w1*x + w2*y = 0 --- (I)\n",
"F = 20.; # Given focal length of achromatic doublet, cm\n",
"# Also F = 1/f1 + 1/f2 => F = x + y ---- (II)\n",
"A = [[w1, w2], [1, 1]]; # Square matrix\n",
"B = [0,1/F]; # Column vector\n",
"X = solve(A,B); # Characteristic roots of the simultaneous equations, cm\n",
"f1 = 1/X[0]; # Focal length of convex lens, cm\n",
"f2 = 1/X[1]; # Focal length of concave lens, cm\n",
"\n",
"#Results\n",
"print \"The focal length of convex lens = %2d cm\"%(ceil(f1))\n",
"print \"The focal length of concave lens = %2d cm\"%(ceil(f2))\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The focal length of convex lens = 10 cm\n",
"The focal length of concave lens = -20 cm\n"
]
}
],
"prompt_number": 17
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.11, Page 197"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math \n",
"from numpy import *\n",
"from scipy.linalg import solve\n",
"#Variable declaration\n",
"w1 = 0.017; # Magnitude of the print ersive power of first lens\n",
"w2 = 0.034; # Magnitude of the print ersive power of second lens\n",
"\n",
"\n",
"# Let 1/f1 = x and 1/f2 = y, then\n",
"# The condition for achromatic combination of two lenses, w1/f1 + w2/f2 = 0 => w1*x + w2*y = 0 --- [i]\n",
"F = 40.; # Given focal length of achromatic doublet, cm\n",
"# Also F = 1/f1 + 1/f2 => F = x + y ---- (II)\n",
"A = [[w1, w2],[ 1, 1]]; # Square matrix\n",
"B = [0,1/F]; # Column vector\n",
"X = solve(A,B); # Characteristic roots of the simulmath.taneous equations, cm\n",
"f1 = 1/X[0]; # Focal length of convex lens, cm\n",
"f2 = 1/X[1]; # Focal length of concave lens, cm\n",
"# For the convex lens\n",
"R2 = -25.; # Radius of curvature of the contact surface, cm \n",
"mu = 1.5; # Mean refractive index of crown glass\n",
"# From the Lens Maker formula, 1/f = (mu - 1)*(1/R1-1/R2), solving for R1\n",
"f = f1;\n",
"R1 = 1/(1/(f*(mu-1))+1/R2); # Radius of curvature of second surface of first lens, cm\n",
"print \"The radius of curvature of second surface of first lens = %5.2f cm\"%R1\n",
"# For the concave lens\n",
"R1 = -25.; # Radius of curvature of the contact surface, cm \n",
"mu = 1.7; # Mean refractive index of flint glass\n",
"# From the Lens Maker formula, 1/f = (mu - 1)*(1/R1-1/R2), solving for R1\n",
"f = f2;\n",
"R2 = 1/(1/R1-1/(f*(mu-1))); # Radius of curvature of second surface of second lens, cm\n",
"print \"The radius of curvature of second surface of second lens = %5.2f cm\"%R2\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The radius of curvature of second surface of first lens = 16.67 cm\n",
"The radius of curvature of second surface of second lens = -233.33 cm\n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.12, Page 199"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"# For flint glass\n",
"mu_C = 1.665; # Refractive index of flint glass for C line\n",
"mu_F = 1.700; # Refractive index of flint glass for F line\n",
"\n",
"#Calculations\n",
"mu_D = (mu_F+mu_C)/2; # Refractive index of flint glass for D line\n",
"w2 = (mu_F-mu_C)/(mu_D-1); # Magnitude of the dispersive power of second lens of flint glass\n",
"# For crown glass\n",
"mu_C = 1.510; # Refractive index of crown glass for C line\n",
"mu_F = 1.536; # Refractive index of crown glass for F line\n",
"mu_D = (mu_F+mu_C)/2; # Refractive index of flint glass for D line\n",
"w1 = (mu_F-mu_C)/(mu_D-1); # Magnitude of the dispersive power of second lens of crown glass\n",
"f = 50.; # Focal length of acromatic doublet, cm\n",
"FD = f*(w2-w1)/w2; # Focal length of D line of the Fraunhofer spectrum due to convex lens of crown glass\n",
"FC = FD*(mu_D - 1)/(mu_C - 1); # Focal length of C component of converging lens, cm\n",
"\n",
"#Result\n",
"print \"The focal length of C component of converging lens = %4.2f cm\"%FC\n",
"#rounding-off error"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The focal length of C component of converging lens = 1.57 cm\n"
]
}
],
"prompt_number": 37
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.13, Page 200"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"F = 50.; # Equivalent focal length of combination of two lenses, cm\n",
"\n",
"#Calculations\n",
"#d = f1+f2/2, condition for no chromatic aberration (1)\n",
"#d = f2-f1, condition for minimum spherical aberration (2)\n",
"# From (1) and (2), f1 = 3*d/2, f2 = d/2\n",
"# As 1/F = 1/f1 + 1/f2 - d/(f1*f2), solving for d\n",
"d = 4./3*50; # Distance of separation betwen two lenses, cm\n",
"f1 = 3*d/2,\n",
"f2 = d/2;\n",
"\n",
"#Results\n",
"print \"f1 = %.f cm\"%(f1)\n",
"print \"f2 = %5.2f cm\"%(f2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"f1 = 100 cm\n",
"f2 = 33.33 cm\n"
]
}
],
"prompt_number": 40
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.14, Page 201"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"mu_R = 1.5230; # Refractive index for red wavelength\n",
"mu_V = 1.5145; # Refractive index for violet wavelength\n",
"R1 = 40.; # Radius of curvature for red wavelength, cm\n",
"R2 = -10.; # Radius of curvature for violet wavelength, cm\n",
"\n",
"#Calculations\n",
"# As 1/f = (mu - 1)*(1/R1 - 1/R2), solving for fV and fR\n",
"fV = 1./((mu_V-1)*(1/R1-1/R2)); # Focal length for violet wavelength, cm \n",
"fR = 1./((mu_R-1)*(1/R1-1/R2)); # Focal length for violet wavelength, cm \n",
"l = fR - fV; # Longitudinal chromatic aberration, cm\n",
"\n",
"#Result\n",
"print \"The longitudinal chromatic aberration = %5.3f cm\"%(abs(l))\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The longitudinal chromatic aberration = 0.253 cm\n"
]
}
],
"prompt_number": 41
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.15, Page 202"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"F = 10; # Equivalent focal length of a combination of two lenses, cm\n",
"d = 2; # Separation distance between two lenses, cm\n",
"\n",
"#Calculations\n",
"# As d = f1-f2, condition for minimum spherical aberration => f1 = d+f2\n",
"# and F = f1*f2/(f1+f2-d), so solving for f2\n",
"f2 = 2*F-d; # Focal length of second lens, cm\n",
"f1 = d+f2; # Focal length of first lens, cm\n",
"\n",
"#Result\n",
"print \"f1 = %2d cm, f2 = %2d cm\"%(f1, f2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"f1 = 20 cm, f2 = 18 cm\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.16, Page 202"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"mu = 1.6; # Refractive index of aplanatic surface\n",
"R = 3.2; # Radius of curvature, cm\n",
"\n",
"#Calculations&Results\n",
"R1 = R/mu; # First radius of the aplanatic surface, cm \n",
"print \"R1 = %3.1f cm\"%R1\n",
"R2 = R*mu; # Second radius of the aplanatic surface, cm \n",
"print \"R2 = %4.2f cm\"%R2\n",
"#Since the image of an object at one aplanatic point will be formed by the sphere at the other aplantic point,so the is\n",
"m = mu**2; # The lateral magnification of the image\n",
"print \"The lateral magnification of the image = %4.2f\"%m\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"R1 = 2.0 cm\n",
"R2 = 5.12 cm\n",
"The lateral magnification of the image = 2.56\n"
]
}
],
"prompt_number": 23
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.17, Page 203"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"mu = 1.52; # Refractive index of aplanatic surface\n",
"R = 30; # Radius of curvature, cm\n",
"\n",
"#Calculations&Results\n",
"R1 = R/mu; # First radius of the aplanatic surface, cm \n",
"print \"R1 = %5.2f cm\"%R1\n",
"R2 = R*mu; # Second radius of the aplanatic surface, cm \n",
"print \"R2 = %4.1f cm\"%R2\n",
"#Since the image of an object at one aplanatic point will be formed by the sphere at the other aplantic point,so the is\n",
"m = mu**2; # The lateral magnification of the image\n",
"print \"The lateral magnification of the image = %4.2f\"%m\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"R1 = 19.74 cm\n",
"R2 = 45.6 cm\n",
"The lateral magnification of the image = 2.31\n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.18, Page 203"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"F = 5; # Equivalent focal length of Huygens eyepiece, cm\n",
"\n",
"#Calculations\n",
"# as f1 = 3*f, f2 = f and d = 2*f, therefore\n",
"f = 2./3*F; # Focal length of base lens, cm\n",
"f1 = 3*f; # Focal length of field lens, cm\n",
"\n",
"#Result\n",
"print \"The focal length of the field lens = %2d cm\"%f1\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The focal length of the field lens = 10 cm\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.19, Page 204"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"f = 10; # Given focal length of each lens, cm\n",
"f1 = f; # Focal length of first lens, cm \n",
"f2 = f; # Focal length of second lens, cm\n",
"\n",
"#Calculations\n",
"d = 2./3*f; # Separation distance between two lenses, cm\n",
"F = f1*f2/(f1+f2-d); # Equivalent focal length of Ramsden eyepiece, cm\n",
"\n",
"#Result\n",
"print \"The equivalent focal length of the field lenses is = %3.1f cm\"%F\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The equivalent focal length of the field lenses is = 7.5 cm\n"
]
}
],
"prompt_number": 27
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.20, Page 204"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"d = 10; # Distance between the two thin plano convex lenses in the Huygens eyepiece, \n",
"\n",
"#Calculations&Results\n",
"f = d/2; # Base focal length\n",
"f1 = 3*f; # Focal length of the first component lens, cm\n",
"print \"f1 = %d cm\"%f1\n",
"f2 = f; # Focal length of the second component lens, cm\n",
"print \"f2 = %d cm\"%f2\n",
"F = 3./2*f; # Equivalent focal length of the lens, cm\n",
"print \"F = %3.1f cm\"%F\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"f1 = 15 cm\n",
"f2 = 5 cm\n",
"F = 7.5 cm\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.21, Page 204"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable declaration\n",
"F = 4.2; # Equivalent focal length of Ramsden eyepiece, cm\n",
"#F = 3/4*f, Equivalent focal length of Ramsden eyepiece, \n",
"f = 5.6; #focal length,in cm\n",
"\n",
"#Calculations&Results\n",
"f1 = f;\n",
"f2 = f;\n",
"print \"f1 = %3.1f cm\"%f1\n",
"print \"f2 = %3.1f cm\"%f2\n",
"d = 2./3*f;\n",
"print \"d = %4.2f cm\"%d\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"f1 = 5.6 cm\n",
"f2 = 5.6 cm\n",
"d = 3.73 cm\n"
]
}
],
"prompt_number": 29
}
],
"metadata": {}
}
]
}
|