Question: what would persuade you to accept a simulation result? Work through the chapter, predict each experiment, then use the lab and notebook to test the prediction.
Learning path¶
| Stage | Prediction | Evidence |
|---|---|---|
| 1 | A tiny residual can coexist with a large wave error | Compare the three mesh diagnostics |
| 2 | Refinement changes the accumulated phase | Overlay numerical and exact fields |
| 3 | Correct face coefficients are independent of padding | Hold mesh fixed and move the boundary |
| 4 | A phase-plane error can preserve power | Change only deembedding |
| 5 | Harmonic conservation precedes amplitude convergence | Compare saved supercell refinements |
| 6 | Numerical accuracy does not remove model discrepancy | Name the omitted physics in a report |
Example 1: define the transmitted wave before comparing it¶
The reference slab has wavelength , thickness , film index 2.4, exterior index 1, normal incidence, and unit incident electric amplitude at . Transmission is measured at . Even a uniform medium has with these two distinct reference planes; its transmission phase is not generally zero.
Check this limit with Slab(n_film=1.0). The finite-grid counterpart is with zero reflection. It exactly solves the discrete system while its phase differs from the continuum result. This isolates numerical dispersion without a material interface.
Example 2: solve accurately, predict inaccurately¶
For the default slab with only four film cells, the saved experiment has about 0.82 and circular phase error about , although power balance is near floating-point precision. The coarse grid is a deliberately bad prediction.
This is possible because a real symmetric interior stencil has a conserved discrete current. A linear solver can solve that coarse conservative system accurately. Neither property establishes that its wave number or interface scattering approximates the continuum well. Inspect fields and complex coefficients instead of accepting a green conservation indicator.
Example 3: ask whether the sequence is asymptotic¶
For the aligned reference slab, use . Compare exact complex-transmission errors and their ratios. If successive errors fall by approximately four, the observed order is near two:
At the default error is about . This is an acceptance result for a specified observable and geometry. It does not give every high-index resonator the same required cell count. Repeat the experiment after changing material contrast or optical thickness.
When no exact answer exists, compare three complex amplitudes using the chapter’s successive-difference formula. Check that an asymptotic trend exists before extrapolating. A nearly zero difference can also arise from cancellation or shared errors.
Example 4: a monitor can introduce a phase mistake¶
At fixed , add exterior grid cells without changing the slab. Matched discrete boundaries plus discrete deembedding recover the same face coefficients. Now use continuum to remove propagation from the same grid solution. The resulting transmission error has phase
The notebook uses circular phase differences and records actual left/right distances. Power is unchanged by this unit-modulus phase factor. Correcting an extraction formula can fix this error without changing the electromagnetic solve.
Example 5: distinguish boundary reflection from monitor phase¶
Replace the right outgoing ghost multiplier by while holding everything else fixed. This creates a backward wave in the exterior. Padding changes its interference with the slab, so errors can oscillate rather than decrease monotonically.
Decompose forward/backward amplitudes and compare their difference in power with the discrete current. The squared total field at one output node contains interference and is not a transmitted-power measurement. Restoring the matched boundary removes this deliberate reflection; correcting only the monitor phase does not.
Example 6: transfer the test to a beam-steering supercell¶
The saved Chapter 5 extended supercell has an almost zero power defect at low harmonic count, while its target-order power still changes upon refinement. Open-order powers must be compared on the same order labels and incident normalization. The dataset identifies which higher-order calculation is the comparison reference.
Ask for both incident-normalized target power and complex transmitted amplitude. A converged total transmitted power could conceal redistribution among open diffraction orders. Maintain the same geometry and physical wavelength during a harmonic sweep; increasing harmonics is a numerical change, increasing ridge height is a new experiment.
Self-check and report rubric¶
Does establish accuracy? It checks lossless conservation within the modeled system; compare refinements and independent references as well.
Does agreement of two RCWA implementations validate FEM/FDTD? It tests implementation choices within RCWA. A different method must solve the same physical geometry with its own converged controls.
Does an exact slab check validate a finite lens? It verifies a useful limit and conventions. A finite lens adds geometry, vector fields, boundaries, and different observables.
Must padding errors decrease monotonically? No; reflections interfere coherently. Vary boundary quality separately and inspect amplitudes.
Can phase error be reported at zero transmission? Its interpretation is unstable there. Use a stated amplitude floor and complex error.
Suggested report grading: problem/conventions 20%, independent controlled experiments 30%, numerical evidence and plots 30%, interpretation/model limits/provenance 20%. Submit a failed coarse case alongside the accepted result, explaining exactly which evidence changed your decision.