From c306bb1f46c40e7f4aad32d4cd6591cd8345b0d5 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 26 Aug 2019 00:26:54 -0700 Subject: [PATCH] Correct for numerical dispersion at 3d solve_waveguide_mode level --- meanas/fdfd/waveguide_mode.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meanas/fdfd/waveguide_mode.py b/meanas/fdfd/waveguide_mode.py index 300d3e6..2f32c89 100644 --- a/meanas/fdfd/waveguide_mode.py +++ b/meanas/fdfd/waveguide_mode.py @@ -111,6 +111,9 @@ def solve_waveguide_mode(mode_number: int, ''' Apply corrections and expand to 3D ''' + # Correct wavenumber to account for numerical dispersion. + fields_2d['wavenumber'] = 2/dx_prop * numpy.arcsin(fields_2d['wavenumber'] * dx_prop/2) + # Adjust for propagation direction fields_2d['E'][2] *= polarity fields_2d['H'][2] *= polarity