1D multilayer slab waveguide mode solver

Online mode solver
A mode solver for integrated optical dielectric multilayer slab waveguides with 1D cross sections. Following the waveguide definition in terms of refractive indices, layer thicknesses, and the vacuum wavelength, the Java applet calculates the propagation constants / effective indices of guided modes and allows to inspect the corresponding optical field patterns. It is intended as a basic tool for integrated optics design, in particular for purposes of demonstration.Input
For a Nlayer structure, the Define frame receives the vacuum wavelength, the refractive index values n_{s} (substrate), n_{1}, ... , n_{N} (inner layers 1 to N), n_{c} (cover), and the thicknesses t_{1}, ... , t_{N} of the inner layers. All dimensions are meant in micrometers. The figure illustrates the relevant geometry:
Light propagates along the zdirection, with the refractive index profile and all fields assumed to be constant along the yaxis. The xdirection is perpendicular to the film plane.
The text fields accept ordinary numbers as well as simple Cstyle expressions, provided that the result is reasonable for the current problem. Try e.g. an input 'pi/2' for a layer thickness.
Output
A window titled "Mode solver status" informs about propagation constants beta (in µm^{1}) and effective mode indices neff = beta / k, where k = 2 pi / lambda is the vacuum wavenumber associated with the specified vacuum wavelength lambda. The mode identifier indicates the number of nodes in the basic electric component E_{y} of TE modes, and in the basic magnetic component H_{y} of TM modes. npcB is a normalized effective permittivity, the ratio (neff^{2}n_{min}^{2})/( n_{max}^{2}n_{min}^{2}), with the maximum refractive index n_{max} of all layers. n_{min} denotes the larger one of the substrate and cover refractive indices.In a waveguide with one inner layer, a mode angle theta (output in degrees) can be associated with a guided mode, defined by cos(theta) = beta / k n_{1} = n_{eff} / n_{1} (This refers to the common ray picture for confined wave propagation in a single core waveguide). For a structure that supports two guided modes, the program calculates the coupling length or half beat length Lc = pi / (beta_{0}  beta_{1}) that corresponds to the interference pattern of the two modes with propagation constants beta_{0} and beta_{1}.
Mode profile plots show the field or squared field (Intensity checkbox) of the basic electric component E_{y} for TE modes, and of the basic magnetic component H_{y} for TM modes. The background shading (Geometry checkbox) indicates the dielectric structure. Darker shading means higher refractive index. TE mode profiles are normalized with respect to the integral over E_{y}^{2} along the xaxis. For TM profiles, the normalization integral involves H_{y}^{2} divided by the local permittivity. These integrals are evaluated only roughly numerically over an interval that extends by two times the total layering thickness into the substrate and cover regions. Hence, while the shape of the field profile should be accurate, simply do not assume anything about the mode normalization.