wavenumber correction must take dx into account

This commit is contained in:
Jan Petykiewicz 2019-07-09 20:09:12 -07:00
parent c3f248a73c
commit 5dd26915fc

View File

@ -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 = {