I am trying to do a simple wavelength sweep for a 2D thin-film simulation. I have been running into problems when comparing the reflectivity from the simulation vs the theory from the stackrt function (they don’t match). I have gone back to this example from lumerical (https://kb.lumerical.com/en/diffractive_optics_stack_planewave_technique.html), and only modified it to add a wavelength sweep, to see if the problem went away, but they still don’t match. I believe now that the problem is possibly in how I am setting up the sweep, or using the stackrt function. I’ve included my simulation and script.