In general, increasing the number of modes should make the results more accurate, and
this makes sense intuitively, however, there are rare cases where this is not true in practice.
Consider this periodic waveguide Bragg grating.
Using the mode convergence sweep tool and sweeping up to 150 modes in each cell, we
can see that the reflection, absolute value squared of S11, seemingly converges
by 30 modes, but the results start to show sharp peaks and dips as the number of modes
increases, and then above 118 modes the results are smooth again.
What can happen is that as you include more modes, at some point a high order mode is
found in one cell which has very little overlap with any modes in neighboring cells.
This can lead to large perturbations of the S matrix of the cell interface, which also
affects the internal and user s matrix results when energy conservation is applied.
The S matrix can be perturbed when the energy conservation setting is set to either "make
passive" or "conserve energy", or if the CVCS subcell method is used.
If energy conservation is set to "none" and the CVCS subcell method is not used, then
this problem will not occur.
The perturbations in the S-matrix cause sharp peaks or dips that can bee seen in the S parameter
plot from the mode convergence sweep, like we see here.
As you further increase the number of modes, a matching mode may be found in the neighboring
cell and the plot becomes smooth again.
Note that energy conservation will perturb the full S-matrix, so even if no power gets
coupled into the mode which has no matching mode in neighboring cells, the S parameter
results can still be affected.
Although this type of effect where you see large perturbations in the S-matrix doesn't
commonly occur for most devices, we almost always want to use the "make passive" energy
conservation setting, so the best practice is to always perform a mode convergence
sweep for any device that you are simulating just to make sure that you are getting S parameter
results over a range where the results are smooth.
For this particular example, the results in the range between using 19-30 modes is almost
the same as the results in the range 118 modes and above, but the simulation is faster using
fewer modes so you may choose to operate in the range using about 25 modes for further
simulations of this device.