123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- import scattnlay
- from scattnlay import fieldnlay
- from scattnlay import scattnlay
- import numpy as np
- import cmath
- from fieldplot import fieldplot
- def SetXM(design):
- """ design value:
- 1: AgSi - a1
- 2: SiAgSi - a1, b1
- 3: SiAgSi - a1, b2
- """
- epsilon_Si = 18.4631066585 + 0.6259727805j
- epsilon_Ag = -8.5014154589 + 0.7585845411j
- index_Si = np.sqrt(epsilon_Si)
- index_Ag = np.sqrt(epsilon_Ag)
- isSiAgSi=True
- isBulk = False
- if design==1:
-
- isSiAgSi=False
- WL=500
- core_width = 0.0
- inner_width = 31.93
- outer_width = 4.06
- elif design==2:
-
- WL=500
- core_width = 29.44
- inner_width = 10.33
- outer_width = 22.73
- elif design == 3:
-
- WL=500
- core_width = 5.27
- inner_width = 8.22
- outer_width = 67.91
- elif design==4:
- WL=800
- epsilon_Si = 13.64 + 0.047j
- epsilon_Ag = -28.05 + 1.525j
- core_width = 17.74
- inner_width = 23.31
- outer_width = 22.95
- elif design==5:
- WL=354
- core_r = WL/20.0
- epsilon_Ag = -2.0 + 0.28j
- index_Ag = np.sqrt(epsilon_Ag)
- x = np.ones((1), dtype = np.float64)
- x[0] = 2.0*np.pi*core_r/WL
- m = np.ones((1), dtype = np.complex128)
- m[0] = index_Ag
-
-
-
-
-
-
- return x, m, WL
- core_r = core_width
- inner_r = core_r+inner_width
- outer_r = inner_r+outer_width
- nm = 1.0
- if isSiAgSi:
- x = np.ones((3), dtype = np.float64)
- x[0] = 2.0*np.pi*core_r/WL
- x[1] = 2.0*np.pi*inner_r/WL
- x[2] = 2.0*np.pi*outer_r/WL
- m = np.ones((3), dtype = np.complex128)
- m[0] = index_Si/nm
- m[1] = index_Ag/nm
-
- m[2] = index_Si/nm
- else:
-
- x = np.ones((2), dtype = np.float64)
- x[0] = 2.0*np.pi*inner_r/WL
- x[1] = 2.0*np.pi*outer_r/WL
- m = np.ones((2), dtype = np.complex128)
- m[0] = index_Ag/nm
- m[1] = index_Si/nm
- return x, m, WL
- design = 4
- comment='SiAgSi-flow'
- x, m, WL = SetXM(design)
- WL_units='nm'
- print "x =", x
- print "m =", m
- npts = 101
- factor=2.1
- flow_total = 39
- crossplane='XZ'
- field_to_plot='Pabs'
- fieldplot(x,m, WL, comment, WL_units, crossplane, field_to_plot, npts, factor, flow_total)
|