-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generating Fourier Coefficients for an Imperfect (Asymmetric) Grating Function.nb
1147 lines (1113 loc) · 43.8 KB
/
Generating Fourier Coefficients for an Imperfect (Asymmetric) Grating Function.nb
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
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 12.2' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 43564, 1139]
NotebookOptionsPosition[ 41038, 1088]
NotebookOutlinePosition[ 41524, 1106]
CellTagsIndexPosition[ 41481, 1103]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["\<\
Generating Fourier Coefficients for an Imperfect (Asymmetric) Grating Function\
\>", "Section",
CellChangeTimes->{{3.8459135054728713`*^9, 3.845913561166174*^9}, {
3.883555525217134*^9,
3.883555573350759*^9}},ExpressionUUID->"406a4d65-f0ea-4009-91a6-\
88b9fa292416"],
Cell[CellGroupData[{
Cell["\<\
Graphing what a single slit of the perfect grating structure looks like :\
\>", "Subsection",
CellChangeTimes->{{3.845913573017366*^9,
3.8459136727693977`*^9}},ExpressionUUID->"85cf2bce-3a44-41cf-82d3-\
2998d654fd50"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"Gratings", " ", "=", " ",
RowBox[{"Piecewise", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{
RowBox[{"-", "25"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "50"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{"25", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "25"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", ">",
RowBox[{"25", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", "<",
RowBox[{"50", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}]}], "}"}], ",", "0"}],
"]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"Plot", "[",
RowBox[{"Gratings", ",", " ",
RowBox[{"{",
RowBox[{"x", ",", " ",
RowBox[{
RowBox[{"-", "50"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}], ",", " ",
RowBox[{"50", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], "}"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.8459136278626184`*^9, 3.845913811798208*^9}, {
3.8459138457807336`*^9, 3.845914000521548*^9}, 3.8459141207789593`*^9, {
3.8459141577131195`*^9, 3.8459141720951986`*^9}, {3.8459142109926157`*^9,
3.845914243228965*^9}},
CellLabel->"In[28]:=",ExpressionUUID->"c48f2ee3-0a72-42ba-a35d-b254fe6375de"],
Cell[BoxData[
GraphicsBox[{{{}, {},
TagBox[
{RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
1.], LineBox[CompressedData["
1:eJxTTMoPSmViYGDQBmIQ/eVhVMen61n7GKCgJOV0/u7LCP6XZ9bhLecR/M+v
ZdTEjiP4n77eO2y5DcH/wJn8v2EKgv/GMLuMPxDBf9pYnaJzKhPOv++VIrd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iBN+HLy3v7BQEf8/mzEvHryP4s/4V
zNoTGwPnh02p11qWGQvn783l6b+9Lh7OV+6Uf7TsWQKcH7fpg9xEniQ433sP
N5OCbjKcf3J1pa+vVQqcb1ckv1s7LhXOd5aTmLgiLw3O/70qivdUZTqcv5Lv
6uo5szPg/BfhizbxrsqE8wWsfroeXYfgW8gE3KzZjOB3Pvj7//UeBF8rM9L3
1HkEP7tK4EXbVwT/3Zw6WQbHLDhfrP7qhu2uCL5doo5LvheC3696K+teMIJv
sM50x540BL9w/5ugyh4Ef9ZC52cGExH8Q82zKl9MRfCFPDwWhM9H8DddWPzW
dBOCf2vTr4a32xB8pqmBIkt3I/jBkf+tRI4i+DXWYedOn0Twl8iuTWw+h+Cf
+c/81eoygv/lYVTHp+sIPgDx4rNT
"]]},
Annotation[#, "Charting`Private`Tag$5107#1"]& ], {}}, {}},
AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{False, False}, {False, False}},
FrameLabel->{{None, None}, {None, None}},
FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
GridLines->{None, None},
GridLinesStyle->Directive[
GrayLevel[0.5, 0.4]],
ImagePadding->All,
Method->{
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" ->
AbsolutePointSize[6], "ScalingFunctions" -> None,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& )}},
PlotRange->NCache[{{
Rational[-1, 20000000],
Rational[1, 20000000]}, {0., 1.}}, {{-5.*^-8, 5.*^-8}, {0., 1.}}],
PlotRangeClipping->True,
PlotRangePadding->{{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.05],
Scaled[0.05]}},
Ticks->{Automatic, Automatic}]], "Output",
CellChangeTimes->{3.8459140056553307`*^9, 3.8459141241867*^9,
3.845914163359217*^9, 3.8459142153961086`*^9, 3.845914245678293*^9,
3.8459156272944865`*^9, 3.845915820540675*^9, 3.8459178212697816`*^9,
3.845917875241065*^9},
CellLabel->"Out[29]=",ExpressionUUID->"55f9b7fb-5598-4415-b56d-0c43ee1bcb60"]
}, Open ]],
Cell["\<\
This has a period of 100 nm, with slits 50 nm wide and 50 nm of separation\
\>", "Text",
CellChangeTimes->{{3.84591425853643*^9, 3.8459142859611254`*^9}, {
3.8459143166962976`*^9,
3.8459143715253396`*^9}},ExpressionUUID->"bc54ee2f-72bc-4f2b-ac35-\
10e575c6cf65"]
}, Open ]],
Cell[CellGroupData[{
Cell["Graphing an imperfect grating structure", "Subsection",
CellChangeTimes->{{3.845914375100935*^9, 3.8459143908509226`*^9}, {
3.8459158882751675`*^9,
3.845915892755235*^9}},ExpressionUUID->"3a982564-4f14-4bd8-bd7c-\
a77ffaa8d2f6"],
Cell["\<\
Now model non - uniform separation
45 nm and 55 nm alternating separation \
\>", "Text",
CellChangeTimes->{{3.845914435232197*^9, 3.8459144808781404`*^9}, {
3.8459153595780287`*^9,
3.845915412539686*^9}},ExpressionUUID->"b17e0c12-f785-432e-8e4f-\
d4d2da1adc91"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"Gratings2", " ", "=", " ",
RowBox[{"Piecewise", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{
RowBox[{"x", ">", " ",
RowBox[{"-",
RowBox[{"95", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}], "&&",
RowBox[{"x", "<",
RowBox[{
RowBox[{"-", "70"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{
RowBox[{"-", "25"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "70"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{"25", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "25"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", ">",
RowBox[{"25", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", "<",
RowBox[{"80", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{
RowBox[{"x", ">",
RowBox[{"80", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", "<",
RowBox[{"105", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}]}], "}"}], ",", "0"}],
"]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"Plot", "[",
RowBox[{"Gratings2", ",", " ",
RowBox[{"{",
RowBox[{"x", ",", " ",
RowBox[{
RowBox[{"-", "95"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}], ",", " ",
RowBox[{"105", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], "}"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.845915417910287*^9, 3.8459156231761665`*^9}},
CellLabel->"In[30]:=",ExpressionUUID->"44b73308-f139-437e-9e84-810fce1c8e50"],
Cell[BoxData[
GraphicsBox[{{{}, {},
TagBox[
{RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
1.], LineBox[{{-9.499999591836735*^-8, 1.}, {-9.303713183903064*^-8,
1.}, {-9.107426775969393*^-8, 1.}, {-8.681832858290828*^-8,
1.}, {-8.28444232859696*^-8, 1.}, {-7.894847023622481*^-8,
1.}, {-7.47223061683678*^-8, 1.}, {-7.275024107436277*^-8,
1.}, {-7.077817598035775*^-8, 1.}, {-7.05110296549751*^-8,
1.}, {-7.024388332959246*^-8, 1.}, {-7.01770967482468*^-8,
1.}, {-7.011031016690114*^-8, 1.}, {-7.006377551020409*^-8, 1.}}],
LineBox[CompressedData["
1:eJxTTMoPSmViYGCwAGIw7dMr9Pto0T4GKDjasuaWzhEEv2nVsndT9yP4f77O
EsvYhuDvlJ6qdXEjgl/m2G9ntRbB/9DTnMazBMF/rJyzbcNEBP9UoG3YzxwE
v73cPCspA8F3mWtYdzoZwd/3QnXZ3CgEf2M93zdHDwR/xtr7U7uUEfw0zqar
0rcK4fwF7I/DZl1F8G+xutyQuIjg+zGx3RY9geCb/+58wL8Nwed4O/E18yQE
f+WFhYxvPBH8N9MP6u7ZWQDnH2mMsa6JzIfzD6keuyYrlAvnz//XubDpYxac
Ly62S37e7Qw4f2F9VWT4jDQ4n0tu6qHL1Slwfhufw/O3hklwvmX1urrap/Fw
fgTbK7ldVxD8iomq+78dR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4lrGvmWLla+LU6+0faZVjGqp7PbIDttR9GT7tgpqDrmn4FFriS
3d/XYSXTvWr6BQ+GxzVmmpG4qIsqucmEmyOVGbaj8PZRbvi5FfbVSHsXG+DG
g43ihNswrWfGe8sGb96wt8oewyEBXUgdg13rGes8H6x6WvZEG4Bn40ZiJ6fg
4Gb1V+c8/G5oxpa31YR7jIxT1h2wiHOc8oIBe9vtqgQWPGQu5K9yYHPa9ZWk
VJi30O+UHYKfnaXvHDsGu3gjc225sCoc6vAXwHscrEJqMdwTe2VYK4dL/b1V
3Qo4vn4icbIctq9xmwQ6WNwvzTEZ4VclEyGOCf4DQ0HyVw==
"]],
LineBox[{{8.006377551020409*^-8, 1.}, {8.023180370186013*^-8, 1.}, {
8.035421119870321*^-8, 1.}, {8.247783665724864*^-8, 1.}, {
8.460146211579409*^-8, 1.}, {8.8566679153038*^-8, 1.}, {
9.245394394308801*^-8, 1.}, {9.667141975125024*^-8, 1.}, {
1.0060686167956551`*^-7, 1.}, {1.0280342879896644`*^-7, 1.}, {
1.0499999591836734`*^-7, 1.}}]},
Annotation[#, "Charting`Private`Tag$5154#1"]& ], {}}, {}},
AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{False, False}, {False, False}},
FrameLabel->{{None, None}, {None, None}},
FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
GridLines->{None, None},
GridLinesStyle->Directive[
GrayLevel[0.5, 0.4]],
ImagePadding->All,
Method->{
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" ->
AbsolutePointSize[6], "ScalingFunctions" -> None,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& )}},
PlotRange->NCache[{{
Rational[-19, 200000000],
Rational[21, 200000000]}, {0., 1.}}, {{-9.5*^-8, 1.05*^-7}, {0., 1.}}],
PlotRangeClipping->True,
PlotRangePadding->{{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.05],
Scaled[0.05]}},
Ticks->{Automatic, Automatic}]], "Output",
CellChangeTimes->{3.845915627450652*^9, 3.8459158207570944`*^9,
3.8459178249974923`*^9, 3.8459178753862295`*^9},
CellLabel->"Out[31]=",ExpressionUUID->"89e89456-5fb3-40b9-aca9-0435c5427083"]
}, Open ]],
Cell["\<\
We maintain the same open fraction (.5), but some slits are now offset by 5 nm
We\[CloseCurlyQuote]ve had to graph two slits over a range -95 nm to 105 nm
Center our function over -100 nm to 100 nm:\
\>", "Text",
CellChangeTimes->{{3.8459156466858025`*^9,
3.845915738674531*^9}},ExpressionUUID->"d5dff651-978c-4755-ba1d-\
76945c2774ed"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"Gratings3", " ", "=", " ",
RowBox[{"Piecewise", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{
RowBox[{"x", ">", " ",
RowBox[{
RowBox[{"-", "100"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], "&&",
RowBox[{"x", "<",
RowBox[{
RowBox[{"-", "75"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{
RowBox[{"-", "30"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "75"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{
RowBox[{"x", "<",
RowBox[{"20", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", ">",
RowBox[{
RowBox[{"-", "30"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",", " ",
RowBox[{
RowBox[{"x", ">",
RowBox[{"20", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", "<",
RowBox[{"75", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{
RowBox[{"x", ">",
RowBox[{"75", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], " ", "&&", " ",
RowBox[{"x", "<",
RowBox[{"100", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}]}]}], "}"}]}], "}"}], ",", "0"}],
"]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"Plot", "[",
RowBox[{"Gratings3", ",", " ",
RowBox[{"{",
RowBox[{"x", ",", " ",
RowBox[{
RowBox[{"-", "100"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}], ",", " ",
RowBox[{"100", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], "}"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.845915750304367*^9, 3.8459158158737726`*^9}},
CellLabel->"In[32]:=",ExpressionUUID->"aa6f93de-9230-4fad-aca0-c489fae900df"],
Cell[BoxData[
GraphicsBox[{{{}, {},
TagBox[
{RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
1.], LineBox[{{-9.999999591836734*^-8, 1.}, {-9.803713183903062*^-8,
1.}, {-9.607426775969392*^-8, 1.}, {-9.181832858290827*^-8,
1.}, {-8.784442328596959*^-8, 1.}, {-8.39484702362248*^-8,
1.}, {-7.972230616836779*^-8, 1.}, {-7.775024107436276*^-8,
1.}, {-7.577817598035774*^-8, 1.}, {-7.55110296549751*^-8,
1.}, {-7.524388332959245*^-8, 1.}, {-7.517709674824679*^-8,
1.}, {-7.511031016690112*^-8, 1.}, {-7.506377551020407*^-8, 1.}}],
LineBox[CompressedData["
1:eJxTTMoPSmViYGCwAGIQ/StkA8MU2ZJ9DFDQ3nv+xFFpBN9l88k7euII/r5/
e1kY+RD8apUdElmcCL6F1yadyywI/qapy0KW/i6G85fq9C/xfIng90QluEw6
guB7NkRF/N6P4LMtC8lJ2Y3gN3z0mGK2CcEv7jB8cms+gh+1jalFuRrB1xRa
eniLIYKfIsDmaqyL4M/jSz+2UQPBF+LWPLlOHsH/xbz23ApeBP/U1y0357ws
gvNzbh5537IQwV+/4Il0qCCCv9TzInc4SyGc72HOs9n/YD6crypwoXbLglw4
f646w5/zXdlwvvrEA6ad7plw/gT92/NYtdPhfB6FtsPyD1PgfCX/ubM/LExC
hL/I7td9MxF8p1s3rHUnIviJqSJ3MhsQ/AXV3TKP4xB8+RWVc69KI/gyjGHz
d01NhPPXHCt+H9GL4Nv0TLT/3oLgx4ifvW9cguDP1nVRWBuE4EtFGS2cz4/g
r5IP+GjLjuBbPc11vPMvAc6PLFj5UOIdgj+jTUFp0hkEX3wz3+KWTgT/w06p
rNwGBP/EATXDsHIEv+Kc3X71VAQ/4KpXm0AMgq9xJ8z3ZxCCf+Nl3u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hJ8GJa6pG
4PyJimc94/BstGMbfwp28rULq37BTY5X5rBFOK1+PkX5G570jH0z4KYibrBe
vOzOhBOLmgUiL/jDtIfOuBHW6AXxY5vhBaqZVrMF/gPn4fVR
"]],
LineBox[{{7.506377551020407*^-8, 1.}, {7.523180370186015*^-8, 1.}, {
7.535421119870322*^-8, 1.}, {7.747783665724867*^-8, 1.}, {
7.96014621157941*^-8, 1.}, {8.3566679153038*^-8, 1.}, {
8.745394394308802*^-8, 1.}, {9.167141975125025*^-8, 1.}, {
9.560686167956552*^-8, 1.}, {9.780342879896643*^-8, 1.}, {
9.999999591836734*^-8, 1.}}]},
Annotation[#, "Charting`Private`Tag$5200#1"]& ], {}}, {}},
AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{False, False}, {False, False}},
FrameLabel->{{None, None}, {None, None}},
FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
GridLines->{None, None},
GridLinesStyle->Directive[
GrayLevel[0.5, 0.4]],
ImagePadding->All,
Method->{
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" ->
AbsolutePointSize[6], "ScalingFunctions" -> None,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& )}},
PlotRange->NCache[{{
Rational[-1, 10000000],
Rational[1, 10000000]}, {0., 1.}}, {{-1.*^-7, 1.*^-7}, {0., 1.}}],
PlotRangeClipping->True,
PlotRangePadding->{{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.05],
Scaled[0.05]}},
Ticks->{Automatic, Automatic}]], "Output",
CellChangeTimes->{3.8459158208692217`*^9, 3.845917825437729*^9,
3.8459178755759387`*^9},
CellLabel->"Out[33]=",ExpressionUUID->"9a7e6a64-85b6-4a24-88f1-4df8a0b8ca65"]
}, Open ]],
Cell["\<\
The middle slit has center at - 5 nm
Although the slits are the same size (50 nm) our function is no longer \
repeating with a period of 100 nm
Our function repeats every 200 nm, so we now use d = 200 nm when calculating \
our Fourier components\
\>", "Text",
CellChangeTimes->{{3.8459158332822857`*^9, 3.8459158800274105`*^9}, {
3.8459160002975197`*^9,
3.845916115937722*^9}},ExpressionUUID->"fcb90d65-05df-4ace-a73c-\
b174231f3cb2"]
}, Open ]],
Cell[CellGroupData[{
Cell["The fourier components", "Subsection",
CellChangeTimes->{{3.845915966931408*^9,
3.8459159856410966`*^9}},ExpressionUUID->"4d159d0a-4e2d-43e3-bad5-\
9a642a47fb09"],
Cell["\<\
Define fc = 2*Pi*n*ex/d, then sum Cos[fc] and Sin[fc] for each n value (ints \
from - 20 to 20) over a certain number of values of ex (on the interval where \
the slit is open/has a value of 1) determined by the variable res . The cos \
sum for each n is placed in a matrix to contain real values (ReT) and the sin \
terms are placed in ImT . The sums are then divided by res
This should approximate the integral of F (x)*e^(2 Pi*n*x/d) over the period, \
where F (x) is a square wave representing the grating - which is the formula \
to find the coefficients of the Fourier series representing F(x)
Following this procedure:\
\>", "Text",
CellChangeTimes->{{3.8459159900574813`*^9, 3.845915992447037*^9}, {
3.845916151469589*^9, 3.845916351884606*^9}, {3.8459164207135305`*^9,
3.845916445827789*^9}, {3.845916485769373*^9, 3.845916618996718*^9}, {
3.8459167035650797`*^9, 3.845916743017292*^9}, {3.8459180411570663`*^9,
3.8459180594256916`*^9}, {3.883555703864374*^9,
3.88355571114648*^9}},ExpressionUUID->"2c09a94c-5091-447f-ae66-\
6839fea52d49"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"ReT", "=",
RowBox[{"Transpose", "[",
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{
RowBox[{"-", "20"}], "+",
RowBox[{"(",
RowBox[{"#", "-", "1"}], ")"}]}], "&"}], "/@",
RowBox[{"Range", "[", "41", "]"}]}], ",",
RowBox[{"ConstantArray", "[",
RowBox[{"0", ",", "41"}], "]"}]}], "}"}], "]"}]}], ";"}], " ",
RowBox[{"(*", " ",
RowBox[{
RowBox[{
RowBox[{
"ReT", " ", "matrix", " ", "holds", " ", "the", " ", "real", " ",
"components", " ", "of", " ", "the", " ", "Fourier", " ",
"coefficients", " ", "for", " ", "n", " ", "values", " ", "from"}], " ",
"-",
RowBox[{"20", " ", "to", " ", "20"}]}], ",", " ",
RowBox[{"not", " ", "yet", " ", "filled", " ", "it"}]}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ImT", " ", "=", " ", "ReT"}], ";"}], " ",
RowBox[{"(*",
RowBox[{
"Same", " ", "as", " ", "above", " ", "for", " ", "the", " ", "imaginary",
" ", "components"}], "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"res", "=", "1000"}], ";"}],
RowBox[{"(*", " ",
RowBox[{
"number", " ", "of", " ", "terms", " ", "summed", " ", "to", " ", "find",
" ", "the", " ", "coefficients"}], " ", "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"d", " ", "=", " ",
RowBox[{"200", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], " ",
RowBox[{"(*",
RowBox[{"new", " ", "period", " ", "is", " ", "200", " ", "nm"}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"nu", " ", "=", " ", "0.5"}], ";"}], " ",
RowBox[{"(*", " ",
RowBox[{
RowBox[{"open", " ", "fraction"}], ",", " ",
RowBox[{"50", "%", " ", "of", " ", "grating", " ", "is", " ", "open"}]}],
" ", "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"width", " ", "=", " ",
RowBox[{"nu", "*", "d"}]}], ";"}], " ",
RowBox[{"(*", " ",
RowBox[{
RowBox[{
"open", " ", "fraction", " ", "times", " ", "period", " ", "gives", " ",
"open", " ", "width", " ", "in", " ", "a", " ", "period"}], ",", " ",
RowBox[{
"this", " ", "now", " ", "gives", " ", "double", " ", "the", " ", "width",
" ", "of", " ", "a", " ", "slit", " ", "AKA", " ", "the", " ", "total",
" ", "width", " ", "of", " ", "two", " ", "slits"}]}], " ", "*)"}],
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"locations", " ", "of", " ", "edges", " ", "of", " ", "slits"}],
",", " ",
RowBox[{
"start", " ", "and", " ", "end", " ", "points", " ", "for", " ",
"sums"}]}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{"first", " ", "half", " ", "slit"}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"minslit1", " ", "=", " ",
RowBox[{
RowBox[{"-", "100"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"maxslit1", " ", "=", " ",
RowBox[{
RowBox[{"-", "75"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"middle", "/", "full"}], " ", "slit"}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"minslit2", " ", "=", " ",
RowBox[{
RowBox[{"-", "30"}], "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"maxslit2", " ", "=", " ",
RowBox[{"20", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"third", " ", "slit"}], ",", " ", "half"}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"minslit3", " ", "=", " ",
RowBox[{"75", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"maxslit3", " ", "=", " ",
RowBox[{"100", "*",
RowBox[{"10", "^",
RowBox[{"(",
RowBox[{"-", "9"}], ")"}]}]}]}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"x2pnt", "[",
RowBox[{"arr__", ",", "n_"}], "]"}], ":=",
RowBox[{
RowBox[{
RowBox[{"Position", "[",
RowBox[{
RowBox[{"arr", "[",
RowBox[{"[",
RowBox[{"All", ",", "1"}], "]"}], "]"}], ",", "n"}], "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}]}],
RowBox[{"(*",
RowBox[{
"this", " ", "is", " ", "a", " ", "function", " ", "that", " ", "is", " ",
"used", " ", "to", " ", "return", " ", "index", " ", "where", " ", "n",
" ", "occurs", " ", "in", " ", "the", " ", "index", " ", "of", " ", "ImT",
" ", "or", " ", "ReT"}], "*)"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"increment", " ", "=", " ",
RowBox[{"width", "/", "res"}]}], ";"}], " ", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
RowBox[{"we", "'"}], "re", " ", "breaking", " ", "up", " ", "the", " ",
"Do", " ", "loop", " ", "into", " ", "separate", " ", "sums", " ", "for",
" ", "each", " ", "slit"}], " ", "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
"this", " ", "does", " ", "the", " ", "sum", " ", "for", " ", "the", " ",
"first", " ", "slit"}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"fc", "=",
RowBox[{"2", "*", "Pi", "*", "n", "*",
RowBox[{"ex", "/", "d"}]}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ReT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ReT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Cos", "[", "fc", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ImT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ImT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Sin", "[", "fc", "]"}]}]}], ",", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"n", ",",
RowBox[{"-", "20"}], ",", "20", ",", "1"}], "}"}], ",",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"ex", ",", "minslit1", ",",
RowBox[{"maxslit1", "-", "increment"}], ",", " ", "increment"}],
"}"}]}], "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{"now", " ", "add", " ", "the", " ", "second", " ", "slit"}], " ",
"*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"fc", "=",
RowBox[{"2", "*", "Pi", "*", "n", "*",
RowBox[{"ex", "/", "d"}]}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ReT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ReT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Cos", "[", "fc", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ImT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ImT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Sin", "[", "fc", "]"}]}]}], ",", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"n", ",",
RowBox[{"-", "20"}], ",", "20", ",", "1"}], "}"}], ",",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"ex", ",", "minslit2", ",",
RowBox[{"maxslit2", "-", "increment"}], ",", " ", "increment"}],
"}"}]}], "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{"and", " ", "the", " ", "third"}], " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"fc", "=",
RowBox[{"2", "*", "Pi", "*", "n", "*",
RowBox[{"ex", "/", "d"}]}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ReT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ReT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Cos", "[", "fc", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ImT", "[",
RowBox[{"[",
RowBox[{"x2pnt", "[",
RowBox[{"ImT", ",", "n"}], "]"}], "]"}], "]"}], "[",
RowBox[{"[", "2", "]"}], "]"}], "+=",
RowBox[{"Sin", "[", "fc", "]"}]}]}], ",", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"n", ",",
RowBox[{"-", "20"}], ",", "20", ",", "1"}], "}"}], ",",
"\[IndentingNewLine]",
RowBox[{"{",
RowBox[{"ex", ",", "minslit3", ",",
RowBox[{"maxslit3", "-", "increment"}], ",", " ", "increment"}],
"}"}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
"each", " ", "of", " ", "the", " ", "fourier", " ", "terms", " ", "in",
" ", "each", " ", "array", " ", "are", " ", "divided", " ", "by", " ",
"res"}], " ", "*)"}], " "}], "\[IndentingNewLine]",
RowBox[{" ",
RowBox[{
RowBox[{
RowBox[{"ReT", "[",
RowBox[{"[",
RowBox[{"All", ",", "2"}], "]"}], "]"}], "/=", "res"}],
";"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"ImT", "[",
RowBox[{"[",
RowBox[{"All", ",", "2"}], "]"}], "]"}], "/=", "res"}], ";"}], " ",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{"Plot", " ", "the", " ", "terms"}], " ",
"*)"}]}], "\[IndentingNewLine]",
RowBox[{"ListPlot", "[",
RowBox[{"ReT", ",",
RowBox[{"Frame", "\[Rule]", "True"}], ",",
RowBox[{"FrameLabel", "\[Rule]",
RowBox[{"{",
RowBox[{"\"\<index\>\"", ",", "\"\<ReT\>\""}], "}"}]}]}],
"]"}], "\[IndentingNewLine]",
RowBox[{"ListPlot", "[",
RowBox[{"ImT", ",",
RowBox[{"Frame", "\[Rule]", "True"}], ",",
RowBox[{"FrameLabel", "\[Rule]",
RowBox[{"{",
RowBox[{"\"\<index\>\"", ",", "\"\<ImT\>\""}], "}"}]}]}],
"]"}]}], "Input",
CellChangeTimes->{{3.845916845942668*^9, 3.8459170350459394`*^9}, {
3.845917122866746*^9, 3.845917144225139*^9}, {3.8459171864572363`*^9,
3.845917302146758*^9}, {3.845917342401203*^9, 3.8459175315604095`*^9}, {
3.845917577873886*^9, 3.8459178121566896`*^9}, {3.845917867987506*^9,
3.8459178721498775`*^9}},
CellLabel->"In[34]:=",ExpressionUUID->"972be1bf-d9c2-413b-ab20-90d4a490f31a"],
Cell[BoxData[
GraphicsBox[{{},
{RGBColor[0.368417, 0.506779, 0.709798], PointSize[0.012833333333333334`],
AbsoluteThickness[1.6], PointBox[CompressedData["
1:eJxTTMoPSmViYGDQBGIQDQEmB6JSrO/7927dA+EbH6jm2/3EU3PFfgjf6IDd
64sdSV7h9hC+4YGtH3X4j55eCZU3ODBrJghMhOrXO/BMkZnRtXoVVL3OgWMy
RrovYiZB1WsdOLvn2rQnEjB5jQNvAnfItb5eC9WvdqD7qZn/p6kw+1UOXFPQ
XufKtQGqXunA7N+9qxq/LoXKKxy4ee578OOlk20gfJkDu9SSuHf4LIKqlzhg
yrJSelfpUah6kQPdxWYzJjfPhsoLHLDccqJs3/yNUPs5DvxTPsOUKzwRqp7h
gORBLTWWu4+h6j/sV/m5MzJVvRwmDwUfYPL2aPIOqPo5HFDNF3BAtV/EAdV9
Eg6o7pdxQPWfggOq/5UcUMNHxQE1/NQcUMNXwwE1/LUcUONHxwE1/vQcUOPX
wAE1/g0dUNOHkQNq+jF2QE1fJg6w9AcAu+XElA==
"]]}, {{}, {}}},
AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{True, True}, {True, True}},
FrameLabel->{{
FormBox["\"ReT\"", TraditionalForm], None}, {
FormBox["\"index\"", TraditionalForm], None}},
FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
GridLines->{None, None},
GridLinesStyle->Directive[