edmundsj / rcwa

Rigorous Coupled Wave Analysis for the calculation of Photonic Crystal R/T spectra
MIT License
93 stars 29 forks source link

Add convergence testing in Solve() #31

Closed edmundsj closed 2 years ago

edmundsj commented 2 years ago

RCWA has only a single parameter to vary for the purpose of convergence testing: the number of harmonics. Technically, x- and y-resolution might also be relevant, but these can be made arbitrarily good without significantly impacting compute time. It would be relatively easy to add convergence testing, and would be a substantial value-add to avoid the need for it on the user side. This should be integrated directly into the Solve() method and should be the default behavior.

The only thing I am uncertain of is, when doing sweeps, should we do convergence testing for every sweep value, or just for the first one? In principle, it may be necessary to redo, but in practice, if things do not change too much, it is likely unnecessary.

edmundsj commented 2 years ago

Added in 2dc993d