[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Stack
A stack of waveguides.
Constructor:
Stack(Expression)
Member functions:
calc()
: calculates the scattering matrices of the stack.
free()
: frees the memory allocated for the scattering matrices.
inc()
: returns incidence waveguide.
ext()
: return exit waveguide.
length()
: returns length of the stack along the z
-axis.
width()
: returns the c1
-length of the stack.
n(Coord)
: returns refraction index at a given coordinate.
eps(Coord)
: returns permittivity at a given coordinate.
mu(Coord)
: returns permeability at a given coordinate.
R12()
: returns reflection matrix for fields incident from the left
(z=0
).
R12(i,j)
: returns element of the reflection matrix R12, index starting
at zero. Because of the definition of this matrix, this is the reflection from
mode j
to mode i
. Similar functions exist for the transmission
matrix T12
, and for R21
and T21
describing incidence
from the right side. (z=stack.length()
)
set_inc_field(vector)
: sets incident field from left side (z=0
).
set_inc_field(vector, vector)
: sets incident field from left and
right side.
set_inc_field_gaussian(A, sigma, x0, eps)
: set a gaussian incident field
A*exp(-0.5*((x-x0)/sigma)**2
and use precision eps
to calculate
the overlap integrals.
set_inc_field_plane_wave(A, theta, eps)
: set a plane wave incident field
with amplitude A
, angle theta
in radians, and use precision eps
to calculate the overlap integrals.
set_inc_field_function(f, eps)
: set an incident field described by
a function f
and use precision eps
to calculate the overlap
integrals. f
describes the E2
for TE polarisation and the
H2
field for TM polarisation.
plot_n(stack, r_x, r_z)
: lower level routine to plot the refractive index.
r_x
and r_z
are range objects (e.g arange(x0, x1, dx)
) specifying which
interval to plot and with which resolution. x
is the transverse
direction, z
the propagation direction. An extra named argument filename='outputname.formatextension'
is supported. For pictures, a variety of formats are supported (gif, jpg, png, bmp, eps, ps, tiff, pdf, xbm, dib), where the suffix of the filename will determine the format to be used.
The following functions are only meaningful when an incident field has been set:
plot()
: interactively plots the fields in the stack.
plot_field(component, r_x, r_z))
: lower level field plotting routine.
component
is a function operating on a Field
object specifying
which field component to plot, e.g. lambda f : f.E2().real
.
r_x
and r_z
are range objects (e.g arange(x0, x1, dx)
)
specifying which interval to plot and with which resolution. x
is the
transverse direction, z
the propagation direction. Note that the function
also supports an additional named argument filename='outputname.formatextension'
. For pictures, a variety of formats are
supported (gif, jpg, png, bmp, eps, ps, tiff, pdf, xbm, dib), where the
suffix of the filename will determine the format to be used. Other arguments
are overlay_n
(defaults to true) which overlays the index profile
on the field plot, and contour
(defaults to true) which uses contours
to show the index profile rather than gray scale.
animate_field(stack, component, r_x, r_z)
: animates the
2D field profile. component
is a
function operating on a Field
object specifying which (complex)
field component to plot, e.g. lambda f : f.E2()
. r_x
and
r_z
are range objects (e.g arange(x0, x1, dx)
) specifying
which interval to plot and with which resolution. x
is the
transverse direction, z
the propagation direction. Note that the function
also supports an additional named argument filename='outputname'
, which writes the animation to an uncompressed gif. Other arguments are overlay_n
(defaults to true) which overlays the index profile on the field plot, and contour
(defaults to true) which uses contours to show the index profile rather than gray scale.
field(Coord)
: returns field at a given coordinate.
inc_field()
: returns incident field from left side.
refl_field()
: returns reflected field from left side.
trans_field()
: returns transmitted field to right side.
fw_bw(z, limit=Min)
: returns a tuple with two vectors containing the
forward and backward field expansions at position z, limit
.
limit
is optional and can be either Min
or Plus
.
inc_S_flux(Complex x0, Complex x1, Real eps)
: returns power flux in the
z
-direction at z=0
between x0
and x1
, calculated
with relative precision eps
.
ext_S_flux(Complex x0, Complex x1, Real eps)
: returns power flux in the
z
-direction at z=stack.length()
between x0
and
x1
, calculated with relative precision eps
.
lateral_S_flux(Complex x0)
: returns power flux in the x-direction
at x=x0
between z=0
and z=stack.length()
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by root on August, 27 2008 using texi2html 1.76.