![]() |
![]() |
![]() |
![]() |
![]() |
We go ahead with the simulation of a 1D grating. Next script shows how to
from rodis import * # rodis data set_lambda(1.0) set_N(5) set_polarisation(TE) # make device GaAs = Material(3.5) air = Material(1.0) front = Slab( GaAs(0.6) ) period = Slab( air(0.15) + GaAs(0.3) + air(0.15)) back = Slab( air(0.6) ) grating = Stack( front(1.) + period(0.3) + back(1.)) # start calculations grating.calc() # ask data print grating.diffr_eff().R(-1) print grating.diffr_eff().T(0) print grating.field().R(2) print grating.field().T(3) |

The first line, from rodis import *, will insert the RODIS
library into 'Python'. From this moment on,
we can use all of the RODIS-commands.
The next line is a simple comment, (all #-lines)
so not read by the Python interpreter.
Next block of code sets the free space wavelentgh,
the number of orders used during the calculation,
and the polarisation.
set_lambda(1.0) set_N(5) set_polarisation(TE) |
set_polarisation(TM) to change it.
Now we make the materials that we will use to build
the grating with, using Material(refractive index)
GaAs = Material(3.5) air = Material(1.0) |
Slab(material1+material2)
Since the width of a layer is the period of the grating
all layers have the same width.
front = Slab( GaAs(0.6) ) period = Slab( air(0.15) + GaAs(0.3) + air(0.15)) back = Slab( air(0.6) ) |
front is a slab with period 0.6, period
is a slab with period 0.15 + 0.3 + 0.15 and back
has a period of the same size.
So we made three slabs.
Ok, we just have to stack these slabs to make the device
grating = Stack( front(1.) + period(0.3) + back(1.)) |
grating.calc() will start the calculation of the device.
After the calculation is done, we just simply have
to ask the needed data and print it on the screen.
print grating.diffr_eff().R(-1) print grating.diffr_eff().T(0) print grating.field().R(2) print grating.field().T(3) |
set_N(5)),
we can ask data from -5 to 5
the script will result in this output:
RODIS 0.0871190000258 0.689968431786 (-0.104378951709+0.451485554898j) (0.0646782627315-0.070856654796j) |
![]() |
![]() |
![]() |
![]() |
![]() |