With small scale, Harminv has rounding error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-meep |
New
|
Undecided
|
Unassigned |
Bug Description
(This may be an error in the MEEP utilities themselves.) Harminv uses integers instead of floats at some place. When all the constants (resolution, dimensions and time) are scaled properly so that the simulation output looks the same, Harminv does behave differently.
When the simulation resolution is scaled down, one comes to a zero "data capture time":
runWithHarminv starting : sources will stop at time = 0 and will capture data for Harminv analysis during an additional time of 0.
This causes Harminv to fail, mostly returning "On entry to ZGEBAL parameter number 3 had an illegal value" or "...invalid argument to ZGEEV". Unfortunately I can not fix the error in the harminv C++ code.
A quick workaround is to get along without SI units and rescale all constants to use high enough numeric values.
To reproduce the error, see the script attached.