Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lab 6: When Is a Simulation Accurate?

Question: how can a perfectly balanced simulation mislead a designer? Predict what will happen when the film mesh is refined, then compare the same observables at the same physical reference planes.

Read Chapter 6 and its worked examples. The executed notebook is the authoritative calculation. The source bundle contains the solver, notebook, reference data and validator. The browser explorer is hosted on this site.

Before reading the results, use the model and geometry guide. Identify the object, dimensions, incident wave, invariant/repeated directions, and reference planes in the drawing.

Explore the saved evidence

The controls select saved Python calculations; they do not solve Maxwell’s equations in the browser. All values correspond to the published slab and specified numerical settings. Broad intuition diagrams and classroom demonstrations are reserved for the companion course site.

Open the browser lab in a new tab · Download complete executable sources

Run the investigation

Extract the complete ZIP, preserve its folders, use Python 3.12, install requirements-labs.txt, and launch JupyterLab. Open notebooks/06-numerical-methods.ipynb, restart the kernel, and run all cells. NumPy/SciPy/Matplotlib run on a CPU. No commercial solver, GPU, network dataset, or optional grcwa package is required. Saved outputs document the published run; edits create a new experiment.

Run python scripts/validate_chapter06.py from the extracted root for independent checks. In a full checkout, after executing/saving and validating, run python scripts/export_chapter06.py to regenerate figures, explorer, and ZIP. Physical inputs and numerical controls are separate in the first parameter cell. Revalidate changed parameters; the fixed benchmark audit describes the stated reference cases.

Executed stages and student tasks

StageChange onlyPredict and report
A: meshCells through the filmComplex transmission error, circular phase error, power defect, algebraic residual, field error
B: domainExterior padding at fixed meshFace-referenced coefficient invariance and actual monitor distances
C: boundaryRight outgoing multiplierBackward-wave power and oscillatory padding dependence
D: extractionDiscrete versus continuum deembeddingPhase drift while powers remain unchanged
E: harmonicsRCWA retained ordersDifferences in target-order power with tiny conservation error
  1. Save a prediction before changing a control. Which diagnostic certifies the assembled equations, and which compares with the independent physical reference?

  2. Find a coarse mesh that balances power but fails ∣t−texact∣<10−3|t-t_{\rm exact}|<10^{-3}. Then identify the first sampled mesh satisfying that amplitude target. Also test a 0.1∘0.1^\circ phase criterion where transmission exceeds a stated floor.

  3. Compute observed convergence order using four consecutive fine meshes. State the range used, and explain why a coarse or roundoff-limited range is unsuitable.

  4. Move only the exterior boundary. Compare the matched case, the deliberately mismatched case, and wrong deembedding. Use outgoing/backward flux rather than the squared total field at a single node.

  5. Inspect the Chapter 5 harmonic companion. State why the highest retained result is a comparison reference, and why RCWA agreement does not constitute experimental validation.

  6. Change one physical input, rerun, and assess whether the published mesh remains sufficient. Preserve the original result alongside the new one.

Further lab outlines

These stages are not executed in this release.

Deliverable

Submit an editable notebook, parameters/environment, data and original plots, one rejected coarse case, one accepted result, a table of independent refinement controls and tolerances, and a paragraph on unsupported claims. Include figure provenance and references following the source and reuse guide. The worked guide supplies self-check answers and a suggested rubric.