Data Science

Xnec2c – graphical NEC2 antenna simulation

Xnec2c is a high-performance multi-threaded electromagnetic simulation package to model antenna near- and far-field radiation patterns for Linux and UNIX operating systems.

The original FORTRAN version of NEC2 was ported to C by Neoklis Kyriazis, 5B4AZ and released as nec2c. Later he wrote xnec2c, a graphical interface for ease of use with many more features.

Xnec2c now has a built-in editor for NEC2 input files which can be used to edit geometry or command “card” data. This basic editor displays comment, geometry and command cards in tree views where individual rows, each representing a card, can have their cells edited directly for “raw” entry of data. More useful are pop-up “editor” windows that open when appropriate buttons are clicked or when a selected row is right-clicked with the mouse. These editors allow easier, more convenient entry and editing of individual rows, with no need for detailed knowledge of “card” formats. When editing is completed, the contents of the nec2 editor can be saved in a NEC2-compatible input file which can then be re-loaded by xnec2c for execution.

This is free and open source software.

Features include:

  • Multi-threading operation on SMP machines: xnec2c can run multi-threaded (by forking) on SMP machines, when executing a frequency loop. Multi-threading is enabled by using the -j option, where n is the number of processors in a SMP machine. xnec2c will spawn n child processes, to which it will delegate calculation of frequency-dependent data for each frequency step. Thus data related to n frequency steps will be calculated concurrently and passed on the the parent process by pipes, to be further processed for graphical display. Child processes are spawned before GTK is initialized and started so that only the parent process is tied to the GUI interface.
  • On-demand Calculation: Since xnec2c collects data to be displayed in buffers directly from the functions that produce them, there is no need to produce and parse an output file and no need to re-run the program when certain input data (currently the frequency) is changed or when different output data (gain, near-fields, input impedance etc) is required. The frequency can be changed either from spin buttons in the Main and Radiation Pattern windows or by clicking on the Frequency Data window’s graph drawing area. The frequency corresponding to the pointer position will then be used to re-calculate whatever data is on display.
  • Built-in NEC2 input file editor: Xnec2c has a built-in editor for NEC2 input files. Data in NEC2 “cards” can be entered or edited either directly in the main editor window (tree view) or in more convenient dedicated editors for each type of card. Edited data can be saved to a NEC2 input file and reloaded for execution so that the edit-execute-display cycle is quicker and more convenient.
  • Accelerated Linear Algebra Support – Support for accelerated libraries was added in version 4.3. Accelerated math libraries such as ATLAS, OpenBLAS and Intel MKL can speed up xnec2c EM simulations if available on your platform. Library detection details are available in the terminal. See File->Math Libraries->Help for more information. Accelerated operation is optional, it will fall back to the original NEC2 algorithms if necessary. Accelerated library support has been tested on Ubuntu , Debian, CentOS/RHEL, and VOID Linux. Generally speaking, if you can install the requisite libraries, it will be detected. If libraries are not detected on your OS then please open a bug report.
  • Interactive Operation: Xnec2c is interactive in its operation, e.g. when started it just shows its Main window in a “blank” state, indicating that no valid input data has been read in yet. The NEC2-type input file can be specified at start-up in the command line optionally with the -i option or it can be opened from the file selection dialog that appears via the File->Open menu of the Main window. Once a valid input file is opened, all the normal widgets in the Main window appear so as to allow proper operation. The NEC2 “commands” in the input file are read in but not executed, until a request is issued by the user via buttons or menus in the appropriate windows.
  • User Interface: In its current form, xnec2c has three windows for the graphical display of output data: When started without an input file specified optionally by the -i option, the Main window opens with most of the button and menu widgets hidden. When a valid input file is opened, all the hidden widgets are shown and the structure is drawn in the Main window’s drawing area widget. From the View menu, the Radiation Pattern and Frequency Related data display windows can be opened, to draw either the Gain pattern or the Near E/H fields or Frequency-related Data like Input Impedance, VSWR, Max gain, F/B Ratio, Gain in the Viewer’s direction etc. Both the Main window and the Radiation Pattern window have buttons to select fixed viewing angles of the structure or the radiation pattern, as well as spin buttons to input specific viewing angles.
  • Color Coding: Xnec2c uses color coding to visualize the Current or Charge distribution in the Structure’s segments or patches as well as the Gain pattern or the Near E/H field pattern. Color coding is also used to clarify the Graphs of Frequency-related data. A color code strip is shown in the Main and Radiation Pattern windows.

Website: www.xnec2c.org
Support: GitHub Code Repository
Developer: Neoklis Kyriazis
License: GNU General Public License v2.0

Xnec2c in action

Xnec2c is written in C. Learn C with our recommended free books and free tutorials.


Popular series
Free and Open Source SoftwareThe largest compilation of the best free and open source software in the universe. Each article is supplied with a legendary ratings chart helping you to make informed decisions.
ReviewsHundreds of in-depth reviews offering our unbiased and expert opinion on software. We offer helpful and impartial information.
The Big List of Active Linux Distros is a large compilation of actively developed Linux distributions.
Alternatives to Proprietary SoftwareReplace proprietary software with open source alternatives: Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle, Atlassian, Corel, Cisco, Intuit, SAS, Progress, Salesforce, and Citrix
GamesAwesome Free Linux Games Tools showcases a series of tools that making gaming on Linux a more pleasurable experience. This is a new series.
Artificial intelligence iconMachine Learning explores practical applications of machine learning and deep learning from a Linux perspective. We've written reviews of more than 40 self-hosted apps. All are free and open source.
Guide to LinuxNew to Linux? Read our Linux for Starters series. We start right at the basics and teach you everything you need to know to get started with Linux.
Alternatives to popular CLI tools showcases essential tools that are modern replacements for core Linux utilities.
System ToolsEssential Linux system tools focuses on small, indispensable utilities, useful for system administrators as well as regular users.
ProductivityLinux utilities to maximise your productivity. Small, indispensable tools, useful for anyone running a Linux machine.
AudioSurveys popular streaming services from a Linux perspective: Amazon Music Unlimited, Myuzi, Spotify, Deezer, Tidal.
Saving Money with LinuxSaving Money with Linux looks at how you can reduce your energy bills running Linux.
Home ComputersHome computers became commonplace in the 1980s. Emulate home computers including the Commodore 64, Amiga, Atari ST, ZX81, Amstrad CPC, and ZX Spectrum.
Now and ThenNow and Then examines how promising open source software fared over the years. It can be a bumpy ride.
Linux at HomeLinux at Home looks at a range of home activities where Linux can play its part, making the most of our time at home, keeping active and engaged.
Linux CandyLinux Candy reveals the lighter side of Linux. Have some fun and escape from the daily drudgery.
DockerGetting Started with Docker helps you master Docker, a set of platform as a service products that delivers software in packages called containers.
Android AppsBest Free Android Apps. We showcase free Android apps that are definitely worth downloading. There's a strict eligibility criteria for inclusion in this series.
Programming BooksThese best free books accelerate your learning of every programming language. Learn a new language today!
Programming TutorialsThese free tutorials offer the perfect tonic to our free programming books series.
Linux Around The WorldLinux Around The World showcases usergroups that are relevant to Linux enthusiasts. Great ways to meet up with fellow enthusiasts.
Stars and StripesStars and Stripes is an occasional series looking at the impact of Linux in the USA.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our Comment FAQ before posting.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments