Some tips for sweeping single frequency simulations



Although time domain simulation method is able to return broadband results, we still would want to run single frequency simulations in some situations to obtain a full spectrum. We have a built in parameter sweep GUI tool for this purpose, or users can always choose to make use some script commands to achieve this. No matter which way the sweep is done, there are several tips to improve the smoothness of a spectrum.

FDTD and varFDTD

In FDTD and varFDTD, there is a setting in the Advanced options tab in the Edit simulation window, like this screenshot below. This can make sure the material fit and mesh generation are in a good shape for the sweep.

Material fitting

Without the “set simulation bandwidth” on, the material data will be interpolated from the closest points. The interpolated data can show a sudden jump due to the discrete experimental data points, like this index data (green dots) of gold at 0.9 um.

With the “set simulation bandwidth” on, the material data is fitted over your entire frequency range and therefore it should be continues.

Note:Users can also use the “specify fit range” option but then it will have not effect on the mesh size.

Mesh size

By default, the mesh type is “auto non-uniform mesh”. Based on the mesh accuracy setting, it will automatically calculate the mesh size based on the min wavelength (see mesh settings tab). When “set simulation bandwidth” is on, it ensures that it always uses the same mesh size for all the single frequency simulations to avoid problems that are related to inconsistent mesh size when sweeping over the frequencies. Note this there is a simulation speed trade off since the simulation always uses the pre-set min wavelength to calculate mesh sizes.


For frequency domain solvers, it has similar problem for the material fitting and there is a KB article that describes this problem. Mesh types are not “auto non-uniform” for these two solvers, by default.

Solar cell simulation with angled incidence
How to simulate layered hyperbolic metamaterials
converging simulation about graphene plasmonic
Mesh problem in Graphene silulation
PML reflection that is prevalent on a specific wavelength range
PML reflection that is prevalent on a specific wavelength range
Simulate diffraction grating using FDTD
Different results from simulations with different wavelength ranges
Mode calculations for a waveguide coupler with FDTD Solutions

One more additional tip:

When running a sweep over single frequency simulations you need to make sure the monitors record data at the desired frequency for each simulation. Since the set simulation bandwidth option affects the monitor frequency ranges, the use source limits option in the monitor settings will actually use the limits you set for the simulation bandwidth so you should set the monitor frequency in a different way.

A simple approach to force the monitors to record data at the same center frequency as the source is to create a property for the wavelength in the model setup and use this property as a parameter in the sweep. This is done in this simple example: single_freq_sweep.fsp (303.6 KB)

Note that in the Variables tab of the model setup we created the property “freq” for the frequency value and we use the setup script to adjust all the relevant properties of the source and the monitors: