It was originally written in FORTRAN during the 1970s by Gerald Burke and Andrew Poggio of the Lawrence Livermore National Laboratory.
The code was made publicly available for general use and has subsequently been distributed for many computer platforms from mainframes to PCs.
There is a wide and varied market of applications that embed the NEC-2 code within frameworks to simplify or automate common tasks.
NEC traces its history to an earlier program, BRACT, which was used to analyze antennas consisting of many thin wires in free space.
It was useful for modeling certain common types of antennas used on aircraft or spacecraft or other examples where the ground was far enough away that it did not affect the signals.
BRACT was developed in the early 1970s by MBAssociates for the US Air Force's Space and Missile Systems Center.
MBAssociates, named after the founding partners of Bob Mainhardt and Art Biehl, are better known for the development of the Gyrojet rocket gun.
NEC-2 added two major features to the original NEC, a numerical Green's function for working with large planes, and an expansion of the ground-plane code to deal with partially lossy materials that are more realistic for antennas near the ground.
The code was written in FORTRAN and designed to take input from punched card stacks in column-delimited format and then print the results on a line printer.
Development of the original NEC codes continued at LLNL, producing NEC-3 which added the ability to model elements buried in or projecting out of the ground, and NEC-4, which included a wide variety of updates.
[9] To calculate the net result, NEC breaks the antenna's elements into a number of sampled points, called segments.
It uses simple calculations based on the diameter of the conductor and the wavelength of the signal to determine the induced voltage and currents at each of these segments.
Antennas are self-interacting in this respect; the waves reradiated by the elements superimpose on the original radio signal being studied.
[11] NEC uses a separate method to calculate the contribution of extended planes of material, like a wire mesh reflector.
Similarly, inductive and capacitive loads, insulated transmission wires above and buried in the ground and other common parts of an extended antenna system are also modeled using simpler numeric methods.
The results are then normalized to the strongest signal received (almost always at X and Y = 0, or "head on") to produce a 3D pattern illustrating the relative gain for every angle.
[16] The algorithm has no theoretical size limit and can be applied to very large arrays or for detailed modeling of very small antenna systems.
The algorithm has proven reliable (likely to converge to a solution) and accurate (likely to produce results comparable to measured performance) at modeling thin-element structures like Yagi antennas and radiating towers.
A common example is to run the entire calculation suite for different input frequencies, and then plot samples on a single chart.
One might use this to sample through the UHF television frequencies, for instance, producing a diagram that illustrates the gain across the band.
Another common feature is an iterative solver that adjusts a given parameter between runs, say the spacing between elements, in order to maximize performance.
One of the most common identifiers found in NEC codes is GW, which defines a single wire (element) in the antenna.
At this point, NEC scans the geometry for overlapping endpoints, which it then connects together to make a single longer conductor.
The EX (excitation) line indicates the location of the energy supplied to the design, in this case 1 Volt of electric potential difference is applied at the middle of the wire tagged 1, while the RP (radiation pattern) sets up some specifics of the signal.
[18] Finally the EN line (end of input) indicates the deck is complete, at which point the NEC code starts the simulation and generates reports.
[18] BRACT was a pure method of moments implementation, suitable for use on antennas consisting of uniform diameter conductors arranged in free space and connected to each other at their ends (if at all).
[20] NEC-5 solves the Electric-field integral equation for wires and surfaces using the newer mixed potential method developed by Rao, Wilton and Glisson.