Usually a proper field plot gives the best idea about the guiding characteristics of a dielectric structure. Besides, profile visualizations are required e.g. for checking the correctness of results, and for purposes of demonstration.
Since graphics capabilities are not directly incorporated into the
WMM programs, a plot requires to export suitable data sets, where the
output format naturally depends on the numerical sofware for which the
data is intended. The export routines are favourably implemented as
member functions of
||Evaluate a mode component on a finite rectangular regular mesh in the x-y-plane, store the profile data in a file.|
||Evaluate a mode component on equidistant points on a line segment in the x-y-plane, save the profile section data to a file (extension .xyf).|
as examples, and as candidates for adapting the WMM output to a new
information about mode profiles and the underlying structures.
WMM_ModeArray.field gives access to propagating guided fields.
This section describes a collection of functions which export the field data to MATLAB script files (extension '.m'). The routines are defined in mode.h, mode.cpp for the mode profiles, and in wmmarr.h, wmmarr.cpp for mode interference fields, with helper functions found in wmmvis.h and wmmvis.cpp (the latter actually write the MATLAB commands).
Besides the field data, a proper figure requires further information, e.g. about axis annotations or scaling ratios. In the present case, a sketch of the structure under consideration is usually appropriate (helpful for immediate on-screen inspection as well as for publishing). This information is at hand when the export routine is executed, and at this moment one has usually a shape of the final plot already in mind. Therefore, the output m-files produce an entire figure when invoked in MATLAB, including plot commands, axis annotations, scaling, and, if appropriate, lines or patches to indicate the dielectric structure. In this way the path from the raw mode solver output to an acceptable plot is short and almost automatized.
Since 'acceptable' is a matter of taste (and of the actual problem), some ways to change the look of the final figure are to be mentioned:
The type of plot is determined by selecting the appropriate
function, or its
argument, respectively. Additionally, a few global options influence
the output (possible settings are
Decides, whether the plot uses colours.
Set this value to
Most types of m-files contain print commands at the very end, which
are commented, if this option is not set to
In conclusion, for plotting a field profile you may adhere to the following steps:
m.mfile(HX, SQR, display, 75, 115, '0', '0', 'I');
Hx >> vcsqHx00I.m
Most of the the figures shown below are generated in this way, without any further editing.
The following functions,
mode.h and mode.cpp as
WMM_Mode objects, initiate mode profile plots.
Comments on some of the common arguments can be found
at the bottom of this page. See e.g.
rib.cpp for examples
on the use of the plot commands; the figures in this section correspond to
the profile of the fundamental symmetrical vectorial mode of the rib
waveguide, which is analysed in that program.
Surface plots of the six (all) electromagnetic components collected in
one figure. The subplot's axes are adjusted such that the field amplitudes
are comparable within each row.
The script file contains a line '
||Generate a m-file for a single mode component. The last argument specifies the type of plot. 'N' or a character which is not listed below yields a m-file that contains merely the field data, without any plot commands.|
A contour plot of one field component with a sketch of lines and
patches that indicates the guiding structure.
The gray scale levels of the patches are adjusted to the actual refractive indices (darker shading means higher refractive index). To enlarge the contrast (e.g. between substrate and film regions with, compared to the cover, very similar permittivity), change these values, such that the steps between the refractive index levels become equal. The waveguide data can be found at the beginning of the m-file.
A surface mesh plot of one field component.
The waveguide boundaries are indicated on top of the axis box.
If the mode solver happens to have made the wrong choice of signs for a proper
look of the selected component, you might wish to invert the plot:
insert a minus sign in
the line starting '
Intensity plot of one field component.
The field amplitude is indicated by blue scale shading, with the levels
extending linearly from the minimum amplitude (blue) to the maximum field
In case one is tired of blue, MATLAB offers several beautiful predefined colormaps. With '
Here the colour scaling renders larger regions with small field amplitudes visible. A somewhat more objective method, i.e. plotting the modulus of the field instead of its square (
..., bred esp. for bizarre or ornamental qualities that lack
practical utility, ...
(Merriam-Websters Collegiate Dictionary).
A lighted surface plot. Black lines at the surface level indicate the dielectric discontinuities:
At present, the function accepts no
For a strictly quantitative illustration of mode profiles, one should restrict
the graphics to two dimensional data.
There is one
WMM_Mode member function, which stores mode profile
section data into m-files (see
mode.h, mode.cpp for
the precise definition):
With argument 'L', the function evaluates a mode component on equidistant
points on a line segment in the x-y-plane and writes the data to a file
*L.m, together with figure initialization commands, axis annotations,
plot commands, and instructions for illustrating the relevant
dielectric structure. The line segment is to be specified by the
'V' restricts the output to field data and plot commands. The output
is named *V.m.
These files are intended to add curves to an m-file produced by the 'L' version
Replacing the second line by the (uncommented) base filename of an *V.m file adds the curve to the figure.
... and vertical lines of the x-y-plane:
rib.cpp writes eight files, which contain mode profile section data.
First the files *h?V.m and *v?V.m were included
into *haL.m or *vaL.m, respectively. To indicate all horizontal
boundaries in the bottom figure, vcsEyvaL.m
was edited to read
% Crossed boundaries
Then invoking the *L scripts in MATLAB resulted in the figures as shown.
nbd = 3;
bd = [0.0 0.5 1.0];
ri = [1.9 2.2 1.5 1.0];
The transverse components
Ex and Ey of the mode profile may be discontinuous
at dielectric boundaries. Therefore, if different media are involved,
the m-files written by
secmfile usually define more than one
curve. While the points in each segment are connected, the segments
are not joined, such that the discontinuities become explicitely
secmfile is retricted to either horizontal
y1) profile sections. A profile on a tilted
line must be processed manually, e.g. using the output of the
several procedures for illustrating the interference of
The functions are members of
WMM_ModeArrays. Confer the section
below for comments on some of the arguments, and the
corresponding section on the preceding page for remarks
on mode interference.
The application mmi.cpp exemplifies the use of the interference visualization procedures. All figures included in this section belong to that program. It simulates the guided wave propagation in a multimode interference (MMI) coupler, here a wide, multimode raised strip waveguide. Semivectorial analysis yields three symmetrical and two antisymmetrical TE modes:
The following functions evaluate superpositions of these fields.
Single waveguide segment:
Initial mode amplitudes are supplied as explicit arguments.
The function generates
a plot of the mode interference field versus the position on the
waveguide cross section plane, at a certain propagation distance.
After propagating a certain distance, the power concentrates around two focus points (note that the contour levels of the two plots are not comparable):
Where appropriate, the figures contain the z-position as an annotation.
||A lighted surface plot of the interference field over the x-y-plane at a fixed z-position, cf. WMM_Mode.fancymfile.|
An animated sequence of plots of the two former types, for a specified
number of equidistant z-positions.
repeats the animation 10 times.
This is what it looks like for the MMI example with 32 frames on a distance of one focusing length (click on the figures for a magnified version):
A plot of the interference pattern in the y-z-plane
For the MMI waveguide from above, the
This almost periodic pattern justifies repeating the animations shown before.
Three segment couplers:
Overlap integrals determine the initial mode amplitudes.
A function similar to
Depending on the position z, the plot displays the following information:
The function exist in three versions, which differ by their
input arguments. The information about the input respectively output
channels can be supplied either as a single
In the case of more than one input or output channel, the model requires spatially well separated input and output ports; coupling between the port waveguides is assumed to be negligible. Note that the model neglects reflections at the waveguide junctions completely. Parts of the electromagnetic fields which are radiated in forward direction do not enter the plot as well (this shows up in small discontinuities in the intensity at the junctions).
Applied to the MMI example,
One input port, device length is half the focusing length, two properly spaced output channels, a TE power splitter:
Two input waveguides, symmetrical excitation, one centered output channel, constructive interference:
Antisymmetrical excitation, destructive interference:
Only one input channel of the combiner is excited; about half of the power passes the device:
Some of the plot output functions listed above take arguments of somewhat exotic types, which may need commenting:
A rectangular region, defined in
The class contains four double values
The field component which is to be plotted, one of
An attribute for the field output, declared in
Possible values are
Note that usually not all choices and combinations of
Additionally, in most cases two character arguments
have to be supplied to fill two identifier places in
the automatically composed