PyStratify against scattnlay: near fields

← Verification · Spheres · Plane wave
Reference
scattnlay, near fields
Kind
code: another group's code
Calculated
E and H in every layer and in the host of eight spheres and multilayers (x ≤ 12)
Agreement
1e-10; observed ≤ 8.2e-13. Shown, not asserted: scattnlay fails in the inner three layers of the 10-layer graded sphere (nan, up to 1e3; PyStratify's coefficients there are pinned to 60 digits) and loses digits toward the centre (≤ 4.7e-3 at r = 0, where PyStratify is exact)
The matryoshka (ε = −10 + i / silica / ε = −10 + i, 10/20/30 nm) in water, 600 nm: |E|² through every layer against scattnlay Through the gold core, the silica spacer, the gold shell and out into the water, along the polarisation. scattnlay's fields are double precision; in the 10-layer graded sphere of the report it returns nan in the three inner layers, where PyStratify's logarithmic coefficients stay finite (shown there, not asserted).
-60-40-20020406010⁻¹11010²10³10⁴x [nm]|E|²
|E|², PyStratify |E|², scattnlay (fieldnlay)
Hover to read values.
  • largest relative difference (vector field): 1.02×10⁻¹²
  • PyStratify the lines, the reference the circles

Run it yourself: mie_codes.py · test_mie_codes.py · figures.py · MIE_CODES.md on GitHub, PyStratify 97e52a9