## Trial Function

A trial function is the starting point for the mode solver. The choice of a trial function determines which mode is found, and the speed of convergence, but it should not affect the accuracy of the computed mode. Just like the refractive index profiles, the trial function can be entered in one of two ways:

• An arbitrary two-dimensional profile can be uploaded as ASCII numeric values. This profile must conform to the following format:

 xp xd[1] xd[2] xd[3] xd[4] ... yd[1] N(x=1,y=1) N(x=2,y=1) N(x=3,y=1) N(x=4,y=1) ... yd[2] N(x=1,y=2) N(x=2,y=2) N(x=3,y=2) N(x=4,y=2) ... .. ... ... ... ... ... yd[N] N(x=1,y=N) N(x=2,y=N) N(x=3,y=N) N(x=4,y=N) ...
where xp is the number of points along the x direction, and xd[1], xd[2] etc.. are the grid point distances along the x-axis. yd[1], yd[2[ etc.. are the grid point distances along the y-direction. Click here for an example file.

• The trial function can be created using a set of built-in polygon functions. Each polygon is a two dimenssional shape. The field value inside the polygon is specified by the user, and the field outside the polygon is zero. Multiple polygons can be entered, and most geometries of interest can be constructed this way. Click here for a complete description.

Unlike the definitions of refractive index, the default background value is 0.0 (not 1.0). Therefore, the trial function cannot be left blank. A trial function of zero everywhere will crash the program. At the very least, a 'b 1.0' polygon must be specified.