/sompy

Computing Wave Pattern with Sommerfeld Integrals in Python

Primary LanguagePythonOtherNOASSERTION

Computing Wave Pattern with Sommerfeld Integrals in Python

Author: Ralf Schlatterbeck <rsc@runtux.com>

This package – called sompy is a re-implementation of the Sommerfeld integral [Som09] computation and the approximation by Norton [Nor37] found in the public domain Numerical Electromagnetics Code (NEC) in version 2 [BP81]. In particular this computes an interpolation grid, in the original Fortran implementation this was in a separate program named SOMNEC. The interpolation code that uses the grid computed by somnec is found in the nec2 source code. Nowadays the re-implementation of NEC2, in C called nec2c [Kyr] or Tim Moltenos C++ implementation [Mol.a] and Python wrapper [Mol.b] are more useful than the original Fortran code.

The current code uses an infinitesimal dipole for generating the field. The observation points are also thought as infinitesimal, so we can get away with skipping a lot of integrations along antenna segments. The interpolation grid used by NEC is re-implemented but for the (cubic) interpolation a ready-made implementation from scipy.interpolate is used. The grid can be exported – and read – from the original fortran format (when compiled with the GNU Fortran compiler, the file format seems to be compiler specific).

The code is mainly useful in antenna simulation. When used in that way in a Method of Moments code, the field contributions need to be integrated over the antenna segments.

In the current version the code can be used to display the waves created by an infinitesimal dipole. In the example the lower edge is the ground, what is seen as the Y-axis in the plot is in fact the Z-axis (height above ground). The plot shows the field around the infinitesimal dipole located at X=0, Z=1, lengths are in wavelength, i.e. the dipole is located 1 wavelengths above ground. The program which has been used for the plot is in the file display_sommerfeld.py.

The code currently doesn't have a python installer and is not on Pypi, this may change if I make use of the code myself or you drop me a note that you do something with it and need an installer.

The code is licensed under the MIT license, see LICENSE file.

https://raw.githubusercontent.com/schlatterbeck/sompy/master/plot.png

Some notes about timing: The SOMNEC code originally took a long time to compute a grid with some 200 points. One of the reasons is that numeric integration is performed with an increasing number of points. Even back in the 1990's the computation took 257 seconds on a DEC VAX 8600 and 100 seconds on a Silicon Graphics 4D/440 workstation (this is from an old SOMNEC readme file). The implementation in Python takes about a second. But the Fortran code today – we have floating point units in every CPU – takes only about 20ms. So the Python code is a lot slower even though using full vectorization in numpy. But now that there is a Python implementation, experiments with different integration methods might prove faster than the current variant of Romberg integrals [Mil70].

Bibliography

[Som09]A. Sommerfeld. Über die Ausbreitung der Wellen in der drahtlosen Telegraphie. Annalen der Physik, 28(4):665–736, 1909.
[Nor37]K. A. Norton. The propagation of radio waves over the surface of the earth and in the upper atmosphere, part II: The propagation from vertical, horizontal, and loop antennas over a plane earth of finite conductivity. Proceedings of the Institute of Radio Engineers, 25(9):1203–1236, September 1937.
[BP81]G. J. Burke and A. J. Poggio. Numerical electromagnetics code (NEC) – method of moments, part I-III, January 1981. All three parts available as ADA956129
[Kyr]Neoklis Kyriazis: NEC2 in C
[Mol.a]Tim Molteno: NEC2++ Numerical Electromagnetic Code in C++
[Mol.b]Tim Molteno: Python NEC2++ Module
[Mil70]Edmund K. Miller. A variable interval width quadrature technique based on Romberg’s method. Journal of Computational Physics, 5(2):265–279, April 1970.