In this example, Ansys Lumerical FDTD capability in modeling a wire grid polarizer is combined with optiSLang’s powerful optimization capability for finding designs with the best performance in terms of the TE (p-polarization) transmission and the extinction ratio of the device.
Understand the simulation workflow and key results
This article is built on the existing example of a microwire polarizer . Here we aim to find the designs with the best figures of merit, specifically the TE transmission and the extinction ratio (=contrast ratio) of the device by using Ansys optiSlang. A metamodel of the design is created by running relatively small numbers of FDTD simulations and then optimization over a vast number of inputs is performed to find the best designs in an efficient way compared to the in-built particle swarm optimization in FDTD.
This step provides a quick check-up on the settings of the 2D FDTD simulation as described below.
There are four design parameters that we want to optimize. But here, we will sweep only the grating period and substrate thickness, and see how they affect the performance of the grating in terms of the TE transmission (\(T_p\)) and the extinction ratio (\(ER)\):
where \(T_s\) stands for the transmission of s-polarized (TM) light.
The optiSLang optimization process starts by identifying the inputs and responses of the FDTD simulation and relating them with the Parametric solver system in optiSlang.
Afterward, a sensitivity wizard is applied to the system to create the metamodel module (here named AMOP). Running this module will run the FDTD simulations as many times as specified in its settings and will obtain the results for the corresponding inputs.
Finally, the optimization wizard is used to find the best results as a function of the chosen inputs. This relies on the created metamodel and is therefore able to find the best designs over a wide range of inputs very quickly. In this example, the Evolutionary Algorithm module is used for optimization. Additional tips for working with the project files in optiSLang are provided in Additional Resources.
Run and results
Instructions for running the model and discussion of key results
Step 1: Initial simulations in FDTD
- Run the FDTD project file, [[optiSlang_grating.fsp]].
- Run the script file, [[plot_sweep_results.lsf]], to visualize the transmission and extinction ratio results.
The following figures show the TE-transmission and Extinction ratio for different periods. The duty cycle, grating thickness, and substrate thickness are fixed at 0.3, 0.15 um, and 0.4 um, respectively. The changes in the TE-transmission are negligible, but there is a noticeable improvement in the extinction ratio as the period gets smaller.
The following figures show the TE-transmission and Extinction ratio for different substrate thicknesses. The period, duty cycle, and grating thickness are fixed at 0.25 um, 0.35, and 0.17 um, respectively. The averaged TE-transmission increase as the substrate thickness increases, but the extinction ratio shows general improvement over the longer wavelength range as the substrate gets thicker.
Step 2: optiSLang - Creating the metamodel
- Open the file optiSlang_grating.opf . This is the optimization file that uses the input parameters from the FDTD simulation to create the initial sample set (metamodel) and then extensively optimizes and visualizes the results.
Double-click the AMOP module. This is the created metamodel sampler which specifies settings such as optimization parameters, criteria, and the number of samples.
(OPTIONAL: If you want to run a module, you only need to define the paths to the [[optiSlang_grating.fsp]] and the [[optiSlang_grating.lsf]] in the settings.
- Go back to Scenery, right-click on AMOP and select 'show post-processing. The file already contains the results for this metamodel, and the visualizations indicate results such as the transmission and the extinction ratio. This is the basis for the next step which allows a quick assessment over a vast range of inputs.
The metamodel aims to maximize two figures of merits: the TE transmission and the extinction ratio. Since optimization requires a single value for each FOM, we use the transmission and extinction values averaged over the wavelength. These are specified in the Criteria tab of the AMOP object.
The optimization is done over the grating period, duty cycle, grating thickness, and substrate thickness. These inputs are selected in the Parameter tab of the module.
Finding the appropriate number of samples is important to obtain a metamodel that faithfully represents the response of the system to the chosen input parameters. The FDTD simulations are run as many times as specified in the Adaption tab. Increasing this number improves the probability of reaching a good representation of the model while increasing the time needed for completion. You can set the sampling options by checking the 'Show advanced setting' button. For this project, we chose the Advanced Latin Hypercube Sampling option with 60 initial samples and a 70-30 split between the importance of local CoP (Coefficient of Prognosis) and optimization criteria. We also chose 12 samples per iteration with a minimum of 6 iterations to generate the metamodel. Once run the individual results for each design are reported in the Result designs tab (below) and the metamodel is generated.
In the post-processing results, the model quality is reported in the CoP matrix. The total effectivity for each input is reported in red. Clicking on each of these values also updates the 3D surface plot, representing the dependency of the output on the specified inputs. The Tp_avg in terms of T_sub and duty_cycle is shown below as an example:
The CoP matrix shows that the substrate thickness does not have much impact on the Tp and ER. So, it should be fine to exclude the substrate thickness from the design parameter for optimization.
With the metamodel created, we can proceed to the optimization step for identifying the best designs.
Step 3: optiSLang - Optimization and best designs
- Double-click on the Evolutionary Algorithm module. Settings including the optimization method, maximum number of samples, and criteria are set up for this module.
- Go back to Scenery, right-click on the module, and select show post-processing. The overview of all individual designs is shown in a Pareto plot (2D or 3D). The best designs with their input values can be selected here.
Here we are aiming for the best outputs for TE transmission and ER. In the post-processing page, you can drag the 3D Cloud plot from the Visuals section to get an overview of all designs for these two figures of merit. The best designs are all the points located at the edge of the plot also referred to as the Pareto frontier (marked red).
As we are considering two FOM’s here, you can better visualize the Pareto frontier using the Pareto 2D option as shown below:
There are many designs reported as the best since there will be an inevitable compromise between the figures of merits. Depending on the model requirements or optimization priorities, the final selection could be different. To see the corresponding design parameters for a specific FOM pair, click on any of the points in the Pareto plot. The following images show the best design #55, where TE transmission of 92% and ER of over 51 dB are achieved.
Updating the model with your parameters
Instructions for updating the model based on your device parameters
Using new input parameters:
The input parameters in FDTD are defined in the model object to be accessible by optiSLang. To use new inputs in your optimization, make sure they are defined in the model object. You would then need to add them as Parameters in their AMOP block (drag the input from the Inputs column to the Parameter column on the left).
Customizing figure of merits: To customize the figures of merit to track, you first need to update them in the script file, [[optiSlang_grating.lsf]]. The updated results are then used as a response in optiSLang (by dragging them from the Outputs section to Responses). Then update the criteria for optimization in steps 2 and 3 (AMOP and Evolutionary Algorithm settings) with the figure of merit of interest.
Additional documentation, examples, and training material
- S. Shena, Y Yuanab, Z Ruana, and H Tanab, “Optimizing the design of an embedded grating polarizer for infrared polarization light field imaging,” Results in Physics, 12 (2019), 21–31
Related Ansys Innovation Courses
Notes on working with the OptiSLang project files
This section provides additional information about working with the OptiSLang project files, including some of the prompts when opening the project.
- Updating the launcher directory: The directory for the Lumerical launcher can be different for each user, for example depending on the installed version. In the AMOP module, make sure the directory for FDTD is selected correctly by checking the executable path in the Settings tab.
- Relocating the files: When opening optiSLang, you might get a prompt related to finding the associated files from other simulations. You might decide to use one of the three options (e.g. automatic or custom relocating) depending on your preferences.
- Referenced values: If the initial input values are different between the saved component level simulation and the one specified in optiSLang, you will get a prompt asking you to choose the value of interest. Choose either of the two options depending on which values you want to proceed with.
- Newer Versions: You might receive a prompt stating the file has been created with a former version of optiSLang. This shouldn't pose any issues as long as you keep using the newer release of the software.