While details on the algorithm can be found elsewhere, a few remarks are necessary to make reasonable choices of the parameters that affect the mode analysis process:
The following list of parameters contains quantities both for controlling the spectral discretization and for influencing the behaviour of the search algorithm.
The more general specifications are collected in a class WMM_Parameters
,
declared in wmm.h and preset in wmm.cpp.
vform 
For vectorial simulations only:
Decides, whether the two transverse electric, the two transverse magnetic, or the two longitudinal mode components are employed as basic fields. All other components are derived from these two. Possible values are EXEY ,
HXHY , or
EZHZ .
The type Vecform is declared in
maxweq.h.
While in principle all formulations should be equivalent, the representation
of the mode components by the trial functions differs in the three cases,
and the results will be slightly different as well.
vform=HXHY is the most popular formulation and the default. 
vnorm 
For vectorial simulations only:
Decides, which expression is used for normalization in order to compare two trial fields with respect to their least squares error. Integration of the sum of the squared values of two or three field components constitutes the normalization factor. These are the three magnetic components for vnorm=NRMMH ,
the three electric components for vnorm=NRMME , the two basic fields
for vnorm=NRMMS , and the two longitudinal components for vnorm=NRMMZ .
The type Vecnormmode is declared in wmm.h.
Only NRMMH and
NRMME have been found to be reasonable.
Both values give almost identical results, vnorm=NRMMH is the
default. 
ccomp 
For vectorial simulations only:
Selects, which boundary conditions are directly incorporated into the least squares error matrices. The type Contcomp is declared in
wmm.h.
Possible choices are ccomp=CCALL , boundary conditions for all
six mode components, ccomp=CCHXYZEZ , boundary conditions for the
three magnetic components and the longitudinal electric component, or ccomp=CCEXYZHZ ,
boundary conditions for the three electric components and the longitudinal
magnetic field. For an exact solution, the two restricted sets are equivalent
to the full set of six components. While CCHXYZEZ , CCEXYZHZ
are somewhat faster, and may yield results which are closer to the results
of other mode solvers, the error in the mode field appears to be concentrated
in the field components which are not directly incorporated (cf. the paper
on the vectorial WMM) Hence ccomp=CCALL is the default. 
ini_d_alpha
ini_N_alpha
ini_alpha_max 
Spectral discretization parameters
for the initial survey process. These parameters correspond directly to
quantities introduced in the first publication
on the WMM.
ini_d_alpha=0.05 ,
ini_N_alpha=10 ,
ini_alpha_max=2.0
can be sufficient end efficient. Note that usually a certain spectral density is required for the minima to appear in the error function. Hence, to reveal the minima for all modes of a multimode waveguide, a finer spectral discretization ini_d_alpha=0.01 ,
ini_N_alpha=25 ,
ini_alpha_max=2.5
might be required. 
ini_steps 
Number of equidistant steps to initially scan the effective index interval for minima. Reasonable values range between 10 and 100. Note that the stepsize must be sufficient to bracket all minima that are expected. A value of 10 should be sufficient for an effective index interval with only one guided mode in it, i.e. for a single mode waveguide. Choose at least a value of 50 for a multimode structure with error functions as shown in the example. 
ref_num
ref_exp
ref_sdf 
Parameters influencing the
search refinement:

fin_d_alpha
fin_N_alpha
fin_alpha_max 
Spectral discretization parameters
for finally fixing the propagation constant and for computing the mode
profile. See the comment on the initial values for the interpretation and
possible values. Usually, a final spectral discretization of
fin_d_alpha=0.01 ,
fin_N_alpha=30 ,
fin_alpha_max=3.0
is sufficient to achieve state of the art accuracy in the propagation constant. These are the default values. 
btol 
Relative tolerance for the approximation of the propagation constant. Do not choose this value below 1.0e8 (minimum search for an almost square function with double precision). 1.0e7 is the default. 
mshift 
Parameter to enforce numerical positivity of the least squares error. The default is 1.0e10. Set this parameter to a higher value (1.0e8) if the program should stop with a message like "matrix not positive". 
penfacTE
penfacTM 
Weight factors for separating
closely spaced modes. Preset by 1.0 in all matrix entries in order to have
no effect. If the parabolic sections belonging to two different modes are
almost superimposed in the error function, these factors can be used to
force the mode solver to select one of them.

If the mode solver seems to have missed a guided mode, one should at
first take a look at the least squares error file (see below). The figure
shown in the introduction of this page is an example. If no minimum appears
at all in the region of the prospective propagation constant,
try to refine the initial spectral discretization. If a minimum
is visible which was not trapped by the mode solver,
a slight alteration of the stepsize for the initial search procedure
(i.e. slightly changing the ini_steps
parameter) may help.
The basic mode analysis procedures are declared in wmm.h:
WMM_modeanalysis
WMM_ModeArray
argument with the corresponding WMM_Mode
s.
WMM_findfundmode
WMM_ModeArray
argument gives access to the mode information.
WMM_survey
The procedures write log information to the terminal output. All evaluations of the error function are recorded in a file "???sev??.xyf" as well, where identifiers for the type of mode analysis fill the free places in the filename string.
Apart from the Waveguide
under investigation and the list of
WMM_Parameters
,
there are a few more parameters which are directly connected to the simulation
task. They are supplied as arguments to the mode analysis functions.
pol 
An argument of type Polarization
as declared in maxweq.h. Defines the type of
simulation and the polarization of the output modes:

sym 
An argument of type Symmetry
as declared in maxweq.h. Defines the symmetry
with respect to the xzplane which is assumed for the calculation and for
the output modes.

nmin
nmax 
The interval that is to be
investigated for effective mode indices. A value of 0.0 for one of these
parameters indicates that the default values for the waveguide under investigation
are to be used:
In some cases the choices are wrong (there are guided modes with lower
effective indices) or ineffective (the interval is much too large). Usually
a better initial guess can be based on the viewpoint of the effective index
method: For a planarlike structure, choose the maximum of the effective
mode indices of the outermost left and right slices for Note that the mode solver itself is not able to decide if the field belonging to a minimum in the error function is an approximation of a physically real guided mode or not (these minima may well appear in a 'forbidden' region of small effective indices). Even the effective index viewpoint is sometimes ambiguous. However, the question "guided or not" can often be decided by inspection of the mode field: if the profile shows pronounced amplitude maxima in the regions of one of the outermost rectangles, the field should probably be discarded. 
ext0
ext1 
Filename identification chraracters for the least squares error log file. Confer the previous remarks on filenames. 
The (stderr) output stream of the mode analysis procedures contains the following parts:
# 100
[c] (13.91759326) > 1.587047445
[l]
, [c]
, or [r]
:
[]
, [0]
, or [+]
:
[f]
:
[*]
:
The stderr output stream receives further data by file input/output operations
(indicated by double brackets << >>
), including explicit
data on propagation constants, effective indices and filenames. You may
find it convenient to collect this information by redirecting the output
to a file.