From 5dd26915fc66ada63d64b628a08211dd47aed0b0 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 9 Jul 2019 20:09:12 -0700 Subject: [PATCH] wavenumber correction must take dx into account --- fdfd_tools/waveguide_mode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdfd_tools/waveguide_mode.py b/fdfd_tools/waveguide_mode.py index b7a17a3..96ab16a 100644 --- a/fdfd_tools/waveguide_mode.py +++ b/fdfd_tools/waveguide_mode.py @@ -58,7 +58,8 @@ def solve_waveguide_mode_2d(mode_number: int, more pronounced as the wavenumber increases. ''' if wavenumber_correction: - wavenumber -= 2 * numpy.sin(numpy.real(wavenumber / 2)) - numpy.real(wavenumber) + dx_mean = (numpy.hstack(dxes[0]) + numpy.hstack(dxes[1])).mean() / 2 #TODO figure out what dx to use here + wavenumber -= 2 * numpy.sin(numpy.real(wavenumber * dx_mean / 2)) / dx_mean - numpy.real(wavenumber) shape = [d.size for d in dxes[0]] fields = {