[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following pages illustrate how to use CAMFR to find modes of waveguides with an arbitrary 2D cross-section. These 2D waveguides can subsequently be stacked together in Stack
, BlochStack
, or Cavity
objects. Since this code is still in development, some of the things mentioned here are subject to change.
The following code looks for the ground mode of a (quarter) of a square waveguide, exploiting symmetry:
from camfr import * set_lambda(1.0) set_N(1) core = Material(1.5) clad = Material(1.0) set_section_solver(L) set_mode_correction(full) set_left_wall(H_wall) set_right_wall(H_wall) set_right_PML(-0.05) set_lower_wall(slab_E_wall) set_upper_wall(slab_E_wall) set_upper_PML(-0.05) wg = Slab(core(0.25) + clad(1)) air = Slab(clad(wg.width())) all = wg(0.25) + air(1) s = Section(all, 10, 40) s.calc() print s |
In order to explain all the options, some insight into the nature of the 3D model is needed.
As a first step of the model, a coarse estimate of all the modes of a Section
(a waveguide with a 2D cross section) is created using a plane-wave model. In a second step, these estimates (or a subset of them) are refined using an expansion based on modes of the 1D waveguides making up the Section
. Since these can better satisfy the boundary conditions, more accurate results can be obtained.
The line s = Section(all, 10, 40)
means we use (2*10+1)^2 plane waves in the first stage, and refine it using 40 1D modes in each Slab during the second stage. all
can be any 2D stack, including those fabricated with the Geometry
function. Note: currently the 100 is a rough estimate: the software will print out how many modes were actually used.
The user has the option of choosing which modes get refined during the second stage:
set_mode_correction(full)
: all modes.
set_mode_correction(guided_only)
: only guided modes
set_mode_correction(snap)
: don't refine any modes, but set numerical noise on the imaginary part of kz
for guided modes to zero (obsolete)..
set_mode_correction(none)
: don't refine any modes (default).
When you're only interested in the modes of a Section
, and not putting Section
s together is a Stack
, set_mode_correction(full)
is the way to go, as it is more accurate. For a full 3D model with different Section
s however, such an approach can be very time-consuming, especially in the calculation of the overlap integrals, which are much quicker in a plane wave basis. In that case, it's better to use guided_only
or none
. none
is the fastest, but can sometimes require a lot of plane waves to get accurate results. guided_only
is a hybrid approach, which is more accurate, but can sometimes miss a mode. When using guided_only
, it's adviseable to use set_orthogonal(False)
as well, as using a mixture of two expansion sets somewhat distorts the mode orthogonality.
Some loose remarks:
s.set_estimate(n_eff1)
, s.set_estimate(n_eff2)
, ... .
set_N(1)
. However, sometimes this yields a higher-order mode, because the noise on the coarse estimate during stage 1 can be such that the order of mode 0 and mode 1 gets swapped. One option is to use more palne waves, but often it works just as well to increase the value of set_N()
. Taking more estimates to stage 2 will improve the chances of finding all modes you are interested in.
Some interface quirks which are due to the development nature of the model and will probably change in the final version :
E_wall
and H_wall
, while for upper and lower walls it's slab_E_wall
and slab_H_wall
. For the left and right side, you can also use no_wall
, which is e.g. very accurately to study leakage losses provided you don't use PML.
NT
and Li
solver, currently opposite walls have to be of the same type (i.e. no electric wall on the left with a magnetic wall on the right).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by root on August, 27 2008 using texi2html 1.76.