This example demonstrates the basic functions of the RCWA solver. The reflection and transmission from a silicon photonic crystal slab is calculated, as well as the electric field inside the slab. The results with different number of k-vectors will be compared to simulation results from the literature through convergence testing. Lastly, the reflection and transmission are calculated as a function of frequency, incident angle, and polarization.

## Overview

Understand the simulation workflow and key results

The simulations in this example are performed with the RCWA solver object, available in FDTD starting with release 2023 R1.

### Step 1: Initial Calculation

Typical simulation parameters are used for computing transmission and reflection from the photonic crystal slab at normal incidence with the RCWA solver.

### Step 2: Convergence Tests

Convergence testing is performed using a sweep of the number of k-vectors used by the RCWA solver to determine how the transmission peak positions converge to the results from [1].

### Step 3: Incident Angle Sweep

The RCWA solver is used to calculate the reflection and transmission from the photonic crystal slab at a range of incident angles.

## Run and Results

Instructions for running the model and discussion of key results

### Step 1: Initial Calculation

- Open the simulation file pc_slab_rcwa.fsp and the script file pc_slab_rcwa.lsf in FDTD.
- Run the first section of the script (lines 10-42). You can do this by highlighting these lines in the Script File Editor, right clicking, and choosing
**Run Selection**. You can also run this section by placing the text cursor in this section, clicking the**Select current code block**button , and then clicking the**Run current code block and advance**button .

The script pc_slab_rcwa.lsf sets some simulation and source properties of the RCWA solver, runs the simulation, and plots the results. One unit cell of the photonic crystal, consisting of a slab of silicon with a single hole in the middle, is already present in the simulation file. The RCWA solver assumes that the structure is periodic in the directions transverse to the injection axis of the source.

The calculated transmission and reflection results are shown below:

The transmission results are similar to the results in Fig. 7 in [1]. Due to the symmetry of the geometry these results are the same for both S and P polarizations. Similar to the results in [1], the frequency is normalized to the period of the photonic crystal:

$$Normalized frequency = f\left(\frac{a}{c}\right)$$

Where \(f\) is the frequency, \(a\) is the period, and \(c\) is the speed of light.

### Step 2: Convergence Testing

- Run the next section (lines 43-68) of the script file pc_slab_rcwa.lsf in FDTD.

In this step, the geometry and source settings from step 1 are reused and the "k vector sweep" parameter sweep changes the **max number k vectors** property of the RCWA solver object. The script then finds the frequencies of the three peaks in the transmission spectrum and calculates the relative error compared to the approximate converged peak locations from Fig. 8 in [1]. These reference values were chosen to be 0.5058, 0.526, and 0.542 for peak 1, peak 2 and peak 3, respectively. The relative error \(\sigma\) is defined as

$$\sigma = \left|\frac{f_{sim} - f_{ref}}{f_{ref}}\right|$$

Where \(f_{sim}\) is the frequency of the peak in the simulation results and \(f_{ref}\) is the approximate frequency of the peak from [1]. The results are plotted below:

We can see that the peak locations converge to values in good agreement with the values in [1] as the number of k-vectors is increased. The accuracy of the RCWA simulation increases as the number of k-vectors increases, so these are the expected results.

### Step 3: Incident Angle Sweep

- Run the next section (lines 69-91) of the script file pc_slab_rcwa.lsf in FDTD. The script may take a few minutes to run.

In this section of the script, the RCWA solver is run for a range of frequencies and incident radial angles with the same geometry from steps 1 and 2. Based on the results from step 2, the maximum number of k-vectors was set to 40 to achieve a balance between accuracy and simulation time. The transmission results for both the S and P polarizations are plotted by the script. The results are shown below:

## Updating the Model With Your Parameters

Instructions for updating the model based on your device parameters

### Geometry

The structure of the model can be changed by adjusting the properties of the geometry objects. Additional geometry objects can be added to create a more complex model. It is also important to ensure that the dimension of the layer position property makes sense with the new geometry. If the number of layers has been changed, the layer positions of the RCWA solver object must be updated in the **Geometry **tab of the **Edit RCWA simulation** window.

### Plane Wave Source

The properties defining the incident plane wave are set in the Excitation tab of the **Edit RCWA simulation** window. The frequency range and angle of incidence of the incident light can be changed.

## Additional Resources

Additional documentation, examples and training material

### Related Publications

- Liu and S. Fan, "S4: A free electromagnetic solver for layered periodic structures", Computer Physics Communications, 183, 2233-2244, 2012