Nec 4 Antenna Software


Electromagnetics Code or NEC is publicly available for general use and is available for personal computers running Windows, Linux, and macOS. The public version is NEC-2 (www.nec2.org). An updated version, NEC-4, is only available as a compiled binary program under license agreement with LLNL and is best-known to amateurs in the EZNEC-Pro software. 4nec2 is easy to use and comes with a basic 3D editor to help novices create antenna models, compare field patterns, generate SWR charts and learn in the process. However, it also features options. It runs natively on both Intel based and PowerPC based Macintosh computers that use Mac OS X 10.4 (Tiger) or newer. Except for the graphics elements, the Tiger version of cocoaNEC uses multiple cores of a processor only when modeling an antenna at multiple frequencies.

At first, antenna modeling software is difficult to understand, primarily because of the Cartesian coordinate method used. Two recommendations: (1) read the 4-part QST series on antenna modeling by L.B. Cebik; and (2) start with the pre-configured 'Back Yard Dipole' example included in the 4Nec2 package - and carefully study the input page. About NEC-Win Pro The resource is currently listed in dxzone.com in a single category. The main category is Antenna analysis software that is about software,antenna analysis software, for ham radio operators and hams. This link is listed in our web site directory since Sunday Dec 20 1998, and till today 'NEC-Win Pro' has been followed for a total of 31361 times.

Nec 4 Antenna Software

Nec 4 Antenna Software

COMPUTER MODELING
THRU-THE-EARTH COMMUNICATIONS ANTENNAS
Some Experiments

By Brian Pease

For many years the only cave radio computer modeling that I did was to use Steve Shope’s DOS-based FATE-VMD program (which stands for Fields Above The Earth from a Vertical Magnetic Dipole) as an aid in understanding the effects of electrical conductivity on the magnetic fields of a buried transmitter with a horizontal loop antenna. This program assumes that the earth is primarily a conductor. This proved to be an invaluable aid during the design of my 3496 Hz radiolocation system.

When I became interested in wire antennas for voice communications at higher frequencies a couple of years ago, I looked for some suitable modeling software. I was aware of NEC, which stands for Numerical Electromagnetics Code-Method of Moments, but had never used it. It has been developed by the Lawrence Livermore National Laboratory for the military. It is used to model thin wire antennas and 3-D models constructed of thin wires. You can derive the input impedance of an antenna, add a matching network if desired, then calculate the near or far Electric and magnetic fields in any direction or at any distance from the antenna. The program breaks the wires of the model into short segments and calculates the current (and phase) in each. It then uses integral equations to compute the fields at any distant point.

NEC has been improved over the years. NEC-2 is widely available, even for free, and can model wire structures in free space, especially at HF and VHF. NEC-3 does the same but can also model wires buried in the ground or penetrating from the air into the ground. Both versions suffer loss of precision when modeling electrically small structures such as low frequency cave radio antennas. NEC-4 uses revised algorithms which will (with some limitations) model electrically small structures in, on, and above real earth with finite conductivity and permittivity. It also can model insulation around the wire, which is very useful for modeling antennas in water. NEC-4 is not (in theory) available to the public, but having worked in a Navy Lab for 30 years that did antenna work among other things, and still having a security clearance, I was able to borrow a double-precision copy of the basic code, but without a Graphical User Interface.

As I understand it, NEC-4 is a Fortran program (remember the IBM 1620 circa 1960?) adapted to run on a PC. One creates a text file with Windows Notepad in which each line represents a single IBM punch card. Each 'card' starts with a 2-letter command for geometry input or program control, followed by several items of data separated by commas or spaces (your choice). The initial output is an annotated text file giving impedance, efficiency, currents along the antenna, and whatever fields were requested. There is a plotting program, but so far I have found it easier and faster to just request fields at a single distance in the primary directions. This reduces the calculating time to a few seconds.

One can include wire resistance, lossy loading coils, and impedance matching components anywhere in the structure. This is really useful with electrically small ungrounded antennas such as mobile whips where most of the loss is in the matching network. The loading coil can be modeled as a radiating element if it is large.

So far I have run into a few limitations in modeling electrically small antennas. Although in theory NEC-4 can model small loops down to .002 wavelength in circumference, I have not succeeded yet. There is a card that creates a helix, which is a multiturn inductor at our frequencies, but it does not behave properly. The inductive reactance should double when frequency is doubled, and should correspond to a value of inductance that can be easily calculated, but neither is true.

NEC-4 calculates values of resistance for ground stakes that agree exactly with Dave Gibson’s simple equation, but only when the antenna wire connecting the stakes is above ground. This means that it is possible to accurately model the input impedance of grounded or ungrounded antennas on or above the earth’s surface and predict the fields above or below ground at any distance. When antenna is entirely underground, and radiating portion of the antenna is insulated, the resistance is way off. This appears to be due to a modeling problem with the air or plastic insulation that surrounds the antenna wire. Tomodachi life ost. Underground or underwater modeling of grounded antennas is still possible, but first one has to model the antenna on the surface in order to get the actual input impedance to be able calculate the maximum input current from your transmitter. Knowing that the underground antenna will have nearly the same impedance, one can adjust the applied voltage (or power) until the correct input current is obtained. The field strengths should then be close to correct.

The Near Electric fields can be calculated anywhere including the surface of the Earth, but due to the use of a lookup table, the Near Magnetic fields can only be calculated for distances greater than .001 wavelength (in the medium) above or below the surface. At 185 kHz this is only 1.6 meters, which is not a serious limitation, but at 3.5 kHz the minimum distance is 86 meters above or below the surface which really limits what you can do.

Ungrounded Insulated wire wire antennas can be modeled in water. For predicting the fields from underwater antennas, one can assume that the antenna is immersed in water that has the conductivity and permittivity of the surrounding rock. For grounded antennas the impedance will not be correct, but the correct antenna current can be induced which will give approximately the correct field strengths.

It is also possible to model a wire at the center of an air or water filled cave passage, but I have not worked out all of the bugs yet. See Examples 1 & 2. The maximum diameter of the passage depends on the wavelength in the rock. For typical limestone with conductivity of .005 S/m and 185 kHz, the passage could be up to 5 meters in dia. The diameter becomes impractically small at HF.

The uplink signal is usually the weak link in 2-way voice comms as it has to overcome the full atmospheric noise. Generally the in-cave unit requires a better antenna than the surface unit, and/or greater transmit power. If the average rock conductivity and passage depth is known for a particular cave, one can then play 'what if' games with NEC to calculate the expected uplink signal strength on the surface at different locations. This strength can be compared with the expected atmospheric noise level for the operating frequency location, season of year, and time of day that comms are desired. The noise information is published in the CCIR noise tables. 10 dB s/n ratio is a reasonable minimum for SSB voice comms. Comms may be great on a winter morning and impossible on a summer evening at the same location.

The following simple examples barely scratch the surface of what can be done with this software. They may contain errors, especially overlooked limitations of the program itself.

EXAMPLE 1

I modeled a grounded horizontal dipole just above the earth’s surface to obtain the input impedance for matching purposes at 185 kHz. The intended use of the antenna is underwater in limestone springs, but, as noted earlier, the grounds will not model correctly with the entire antenna underwater. The antenna is sketched in Figure 1. All dimensions are in meters because the program itself works in meters (If one wants, there is a card for converting units). The following paragraph is an annotated NEC-4 input text file which calculates the input impedance, wire currents, and the magnetic fields 30 mtrs (100ft) directly below the antenna in the earth. Consider each line to be a 'card'. The CM cards are just comments to document output. The notes following the '!' on the other cards are just reminder notes. The GW cards describe the antenna geometry. For example, the third GW card is the horizontal wire, which runs 5.5 mtrs along the x axis at 0.1 mtrs above the ground and is tagged #3; has 50 segments; starts at x=0, y=0, z=0.1m; ends at x=5.5m, y=0, z=0.1m; radius=.000635m. Card NH tells the program to calculate the near magnetic fields at a single point 30 mtrs directly below the antenna. '0' specifies rectangular coordinates; 1,1,1 specifies one point in x,y,z directions; the point is located at x=2.75 m, y=0, z=-30 m; '0,0,0' sets the distance increments to zero because we are only doing one point.


Input 'cards' for Example 1
CM 5.5 MTR (18 ft) HORIZONTAL GROUNDED WIRE DIPOLE 0.1 MTR OVER GND
CM 1 MTR GROUND RODS, .011 MTR DIA, 185 kHz
CM EARTH COND=.025 S/m, RELATIVE PERMITTIVITY=80 (SPRING WATER)
GW,1,5,0,0,-1,0,0,0,.0055 !1 mtr vertical ground rod, .0055 m radius, at x=0, y=0.
GW,2,2,0,0,0,0,0,.1,.0055 !0.1 mtr vertical 'stub' on ground rod.
GW,3,50,0,0,.1,5.5,0,.1,.0055 !5.5 mtr horiz wire along x axis.
GW,4,2,5.5,0,.1,5.5,0,0,.0055 !0.1 mtr 'stub' on ground rod.
GW,5,5,5.5,0,0,5.5,0,-1,.0055 !1 mtr vertical gnd rod at x=5.5, y=0.
GE,-1 !End of geometry input. Ground plane is present.
LD,4,3,25,25,0,-6.84 !6.84 ohms cap reactance in series with Zin.
EX,0,3,25,1,1,0 !Excitation of 1 volt at center of wire.
GN,2,0,0,0,80,.025 !Earth characteristics (spring water).
FR,0,1,0,0,.185,0 !Excitation frequency 185 kHz.
NH,0,1,1,1,2.75,0,-30,0,0,0 !Calculate Near mag field 30 m below ant.
NE,0,1,1,1,2.75,0,-30,0,0,0 !Calculate Near elec field 30 m below ant.
XQ !Execute program
EN !End of run
Table 1

The entire output file is far too large to reproduce here. After running the program once to find the input impedance (68.5+j6.84 ohms), the reactance was cancelled with the LD card. On the second run, the antenna current (now all in-phase) for 1 volt input was found. The only significant near magnetic field 30 meters directly below the antenna is Hy=1.42E-6 A/m (perpendicular to the wire).

The significant electric fields are Ex=1.11E-5 V/m (parallel to the dipole) and Ez=1.41E-11 V/m (vertical). It is obvious that a horizontal dipole will be better than a vertical whip for receiving this signal.

EXAMPLE 2

I modeled the same 185 kHz horizontal grounded dipole as Example 1, except located 30 meters underground, in the center of a 2 meter diameter air-filled cave passage. I wanted to compare the uplink field strength with that from example 1. The antenna is sketched in Figure 2. I know from experience that the input impedance will not be computed correctly, but the field strengths should be close to correct for whatever current is applied. I have the correct input impedance from Example 1, which will allow me to compute the real input power.

Input 'cards' for Example 2

CM 5.5 MTR GROUNDED WIRE DIPOLE BURIED 30 MTR IN 2 MTR DIA 'CAVE'
CM 1 MTR GROUNDS, .011 MTR DIA, 185 kHz
CM EARTH COND=.025 S/m, RELATIVE PERMITTIVITY=80 (SPRING WATER)
GW 1 15 -3.75 0 -30 3.75 0 -30 .0055 !5.5 mtr wire with 1 mtr gnds
GE -1 !End of geometry input
LD 4 1 7 7 0 3029 !3029 ohms inductive reactance in series with Zin
IS 0 1 3 13 1 0 1 !2 mtr dia air filled 'cave' around wire
EX 0 1 8 1 37.41 0 !1V at center of dipole
GN 2 0 0 0 80 .025 !Earth constants cond=.025 S/m, rel per=80
FR 0 1 0 0 .185 0 !185 kHz excitation
NH 0 1 1 1 0 0 2 0 0 0 !Mag field 2 mtrs up (min height for accuracy)
NE 0 1 1 1 0 0 2 0 0 0 !Elec field 2 mtrs up.
XQ
EN
Table 2

A koutsoyiannis theory of econometrics pdf. After running the program once to find the input impedance (2526-j3029 ohms), the reactance was cancelled with the LD card. On the second run, the antenna current (now all in-phase) for 1 volt input was found, and the voltage raised to 37.41V to give the same current as Example 1. Despite the bogus high ground rod impedance, the antenna current is nearly constant along its insulated length, as shown in table 3 below.

The only significant near magnetic field is, Hy=1.92E-7 A/m. It appears that the program is underestimating the magnetic field on the surface by nearly an order of magnitude. This might be another effect of the IS card.

The significant near electric fields are Ex=1.06E5 V/m (parallel to the dipole) and Ez=1.16E-8 V/m (vertical).

SEG.- - - CURRENT (AMPS)- - -
NO.MAG.PHASE
13.7177E-03-2.996
21.0439E-02-2.699
31.4188E-02-2.229
41.4324E-02-1.743
51.4461E-02-1.265
61.4599E-02-0.796
71.4703E-02-0.336NOTE: Segments 1 & 2, 14 & 15 are the grounds
81.4600E-02 0.011
91.4463E-02-0.327
101.4327E-02-0.787
111.4419E-02-1.256
121.4058E-02-1.734
131.3924E-02-2.220
141.0246E-02-2.691
153.6490E-03-2.988
Currents on Each Segment
Table 3

EXAMPLE 3

I recently modeled some ungrounded 160 meter Amateur band horizontal dipoles for Bonnie Crystal, KQ6XA for use over or in marble caves at the upper end of the band. The rock has such low conductivity (estimated to be ~0.2E-6 S/m) that the displacement currents cannot be ignored. Relative permittivity is ~ 6.2. The antenna wire is insulated. Axis orientation is the same as in Figure 1.

Dipole 1 is 68 meters (223 ft) long. The dipole is resonant at 2 MHz in air at 1 mtr elevation over the marble surface, with Zin=101 ohms. This antenna would be suspended over the ground or passage floor on stakes.

Dipole 2 is 58 meters (190 ft) long. The dipole is resonant at 2 MHZ in air at .03 mtr elevation over the marble surface, with Zin=87 ohms. This antenna would be more or less lying directly on the rock.

Dipole 3 is 30 meters (100 ft) long. The dipole has Zin=20.2 – j919 ohms. I added 38.5 uH inductors in series with each leg of the dipole to resonate it at 2 MHz, with Zin=28 ohms, at .03 mtrs elevation I actually wound an inductor to estimate its loss, and included antenna wire loss in the model.

Dipole 4 is 2 meters (6.6 ft) long with flat tape elements 1.3 cm (0.5 inches) wide. The program calculated Zin=.0827 – j9040 ohms. This is equivalent to 8 pF! I assumed Q=500 for the two series inductors with L=319 uH, which resonated the dipole at 2 MHz, with Zin=18.2 ohms, at 1 mtr elevation. Antenna efficiency is about 0.5%. Bandwidth is only 4 kHz.

I calculated the fields at 3 points, all 100 mtrs underground in the marble with 5 Watts applied to each antenna: a) directly under the antenna; b) 500 mtrs along the x-axis (off the end of the antenna); and c) 500 mtrs along the y-axis (perpendicular to the antenna). The results are shown in Table 4.

On-Surface Dipole length (along x-axis)

a)100m depth directly Below Dipole

b)100m depth,500m along x-axis

c)100m depth,500m along y-axis perp to ant

1) 68 mtrs

1 mtr elevation

Hy=1.53E-3 A/m

Ex=.225 V/m

Hy=3.31E-5 A/m

Ex=2.58E- 3 V/m

Ez=3.67E- 3 V/m

Hy=2.60E-5 A/m

Hz=8.49E-5 A/m

Ex=1.35E- 2 V/m

2) 58 mtrs

.03 mtrs elevation

Hy=1.46E-3 A/m

Ex=.215 V/m

Hy=4.46E-5 A/m

Ex=2.90E-3 V/m

Ez=5.38E-3 V/m

Hy=2.61E-5 A/m

Hz=8.62E-5 A/m

Ex=1.38E-2 V/m

3) 30 mtrs

.03 mtrs elevation

Hy=1.18E-3 A/m

Ex=.175 V/m

Hy=6.40E-5 A/m

Ex=3.30E-3 V/m

Ez=8.39E-3 V/m

Hy=2.08E-5 A/m

Hz=6.84E-5 A/m

Ex=1.09E-2 V/m

4) 2 mtrs

1 mtr elevation

Hy=1.10E-4 A/m

Ex=1.63E-2 V/m

Hy=6.63E-6 A/m

Ex=3.32E-4 V/m

Ez=8.78E-4 V/m

Hy=1.80E-5 A/m

Hz=5.86E-6 A/m

Ex=9.36E-4 V/m


Fields for Example 3
Table 4

The signal 100 m directly under the antenna decreases for the smaller dipoles as one would expect. The 2 meter long dipole has an efficiency of 0.5% which should put its signal about –23 dB compared to the 68 meter dipole, which is the case.

Some of the other results in the above table seem strange. The 100 mtr deep E and H fields at 500 mtrs along the x-axis are stronger for the 30 mtr dipole than for the 58 mtr antenna. Both dipoles are at .03 mtrs elevation.

The 100 mtr deep Hy field at 500 mtrs along the y-axis perpendicular to the dipoles does not decrease as much as one would expect for the shorter dipoles. Hy for the 2 mtr dipole is only 3 dB below the 68 mtr dipole.

CONCLUSIONS

I have a lot to learn before I can be confident in using NEC-4 to predict antenna performance. I must find a better way to model grounded insulated antennas underground, and must find my errors in modeling electrically small loops.

Return to the Top of the Page

Copyright © 2003 Communications & Electronics Section of the NSS, Inc. - All Rights Reserved.

Numerical Electromagnics Code

(Method of Moments)

NEC simulates the electromagnetic response of antennas and metal structures.

Jerry Burke and A. Poggio wrote the NEC/MOM family of programs at Lawrence Livermore Labs in 1981, under contract to the US navy. NEC2 was later released to the public and is now available on most computing platforms.

This website gathers together NEC2 documentation and code examples from a group of leading scientists and engineers

Please send contributions or questions to Trevor Marshall,
the webmaster

Link here for information and instructions on how to run NEC2 in a Microsoft Windows environment. There is also a sample NEC model that you can use to test your setup.

Take a look at my tutorial for BYTE.com describing antennas for WLAN deployment

Nec 4.2 Antenna Software

The BiQuad antenna is a simple 2.4GHz WLAN antenna suitable for for 802.11 use. Details on how to construct this antenna, both as stand-alone and as a parabolic dish feed can be found at this link. The NEC simulation model, and sample output, can be found here.

An HTML version of the Users Manual for NEC has been created by Peter Richeson.
There are three parts to the manual:

Nec 4.2 antenna software
Part I:
NEC Program Description - Theory
  1. PDF Version (view with a left mouse click, download with right click-save target)
Part II:
AntennaNEC Program Description - Code
  1. Not available yet
Nec 4 Antenna Software
Part III:
NEC User's Guide Antenna
  1. Self extracting zipped MS Word Version (download with right click-save target)

Nec4 Antenna Software Download

Peter has also collected a history of NEC development.

Dave Michelson runs the NEC-LIST, a mailing list for discussion of discussing anything and everything to do with computational electromagnetics. This is a good place to discuss NEC with contributors from academic, government and industry labs around the world.Click here to join the NEC mailing list.

Links to other sources of NEC2 information:

  • Ray Anderson's 'UnofficalNEC Archives' contains LINUX, Mac and UNIX versions of NEC2 software
  • Applied Computational Electromagnetics Society Home Page
  • The ElectroScience Laboratory HomePage
  • Unversity of Missouri-Rolla ftp site

Commercial Programs

  • Nittany Scientific,NECBasic, NEC Win Pro and GNEC
  • W7ELCreator of ELNEC, EZNEC,EZNEC Pro etc.
  • Ansoft's - Electrical EngineeringSimulation Software

All information published at this website is (C)Copyright 2002 Trevor G Marshall.
All rights are expressly reserved. Click to email webmaster

Comments are closed.