

Its dimensions are optimized with a local search, and the path through the search space is visualized with a heat map. monopole_realistic_ground_plane.py plots the vertical gain pattern of a monopole antenna.This requires scipy >= 0.15.0 due to the usage of _evolution. The resulting gains and VSWR are plotted over the frequency range of interest. logperiodic_opt.py is an example on how to combine PyNECPP with scipy.optimize to use a genetic algorithm to optimize an antenna for multiple frequency bands at the same time (which I thin is not possible in 4nec2).The example directory contains the following additional examples (that are inspired by excercises from a course on antennas): Install from PyPI $ sudo pip install pynec $ python setup.py bdist_wheel (For generating wheel, requires wheel package) Then do following: $ git clone -recursive Note: Download and extract swigwin.zip and add the path to swig.exe to environment. $ pip install -upgrade pip setuptools wheel numpy Latest python packages: pip, setuptools, numpy, wheel, numpy.Phis = rp.get_phi_angles() * 3.1415 / 180.0Īx.plot(thetas, gains, color='r', linewidth=3)Īx.set_title("Gain at an elevation of 45 degrees", va='bottom')

#add a "rp" card to specify radiation pattern sampling parameters and to cause program executionĬontext.rp_card(0, 91, 1, 0, 5, 0, 0, 0.0, 45.0, 4.0, 2.0, 1.0, 0.0) #add a "fr" card to specify the frequency Here is an example that plots a radiation pattern. It is easier to work with, and more powerful than the C-style API wrapper. This module wraps the C++ API for antenna simulation of nec2++.
