Calculates the modes supported by the structure using the current calculation settings. This function is the script equivalent to the "Calculate Modes" button. Each mode will be saved as a D-CARD named "modeX", where X is the xth mode found. The D-CARD saves data such as effective index and mode profile.
n will be equal to the number of modes found.
To perform a frequency sweep on the first mode and plot the dispersion:
setanalysis("track selected mode",1);
setanalysis("detailed dispersion calculation",1);
plot(c/f*1e6,D*1e6,"Wavelength (um)", "Dispersion (ps/nm/km)");