86. NEC-2 Manual Sample Files

L. B. Cebik, W4RNL




The NEC-2 User Manual contains a series of examples designed to familiarize the NEC-2 user with many of the facets of the program outputs. Unfortunately, many NEC-2 users restrict themselves to the subset of outputs provided by entry-level programs, such as far-fields, near-fields, segment currents, etc. As well, many users employ only voltage sources (or indirectly provided current sources).

NEC-2 offers a command structure that is considerably more sophisticated than entry-level programs display. One way to approach the refinements that are possible is to work one's way through the sample models. The pages of sample output files generally strike users as unfathomable. However, if one runs the model for oneself, the output file generated by one's own core tends to make more sense and become infinitely more interesting. For example, the user can make small but significant variations in the initial sample and see what happens to the output data as a result of these changes. Suddenly, relatively opaque manual pages become transparent vehicles of illuminating data.

To ease the process of testing the examples from the NEC-2 User's Manual, I have transscribed them into this text. To use a file, simply block copy the model file text and insert it as an ASCII file to the input of your core. If you encounter any stray codes from this HTML version, you may run the models through Notepad, cleanse them, and then save them in .txt format, but with a .NEC extension--or whatever the proper input file extension may be for your program.

Alternatively, you may download from my web site a zipped file containing all of the examples, called NEC2-EXAMPLES. Unzip the file and store the example models in the directory/folder of your choice.

Virtually all of the examples contain codes that the common entry level programs may not recognize. Therefore, it is best to use them with full-featured programs or with cores having input sections that recognize all of the NEC command structure.

In the NEC User's Manual, Examples 1-4 are combined into one input file, as are Examples 7 and 8. I have separated them here as a convenience. However, by referring to the manual for the NX (Next Structure) command, you may recombine the files into their original format.

The introductions to each file come from the NEC-2 User's Manual, pp. 95-153. Quotation marks ("..") indicate material from the Manual. There are occasional references to discussions in other sections of the Manual. I have omitted here the referenced material for brevity.

Example 1

"Examples 1 through 4 are simple cases intended to illustrate the basic formats. Example 1 includes a calculation of near-electric-field along the wire. When the field is computed at the center of a segment without an applied field or loading, the Z-component of electric field is small since the solution procedure enforces the boundary condition at these points. This is a check that the program is operating correctly. The values would be still smaller if the field points were more precisely at the segment centers. The radial, or X, components of the near-field can also be compared with the charge densities at the segment centers (rho = 2 PI alpha epsilono Ex). If the fields were computed along the wire axis, the radial field would be set to zero. For a nonplanar structure, however, computation along the axis is the only way to reproduce the conditions of the current solution and obtain small fields at the match points."

CE EXAMPLE 1. CENTER FED LINEAR ANTENNA
GW 0 7 0. 0. -.25 0. 0. .25 .001
GE
EX 0 0 4 0 1.
XQ
LD 0 0 4 4 10. 3.000E-09 5.300E-11
PQ
NE 0 1 1 15 .001 0. 0. 0. 0. .01786
EN

Example 2

"In example 2 the wire has an even number of segments so that a charge discontinuity voltage source can be used at the center. The symbol "*" in the table of antenna input parameters is a reminder that this type of source has been used. Three frequencies are run for this case and the EX card option is used to collect and normalize the input impedances. At the end of example 2 the wire is given the conductivity of aluminum. This has a significant effect since the wire is relatively thin."

CM EXAMPLE 2. CENTER FED LINEAR ANTENNA.
CM CURRENT SLOPE DISCONTINUITY SOURCE.
CM 1. THIN PERFECTLY CONDUCTING WIRE
CE 2. THIN ALUMINUM WIRE
GW 0 8 0. 0. -.25 0. 0. .25 .00001
GE
FR 0 3 0 0 200. 50.
EX 5 0 5 1 1. 0. 50.
XQ
LD 5 0 0 0 3.720E+07
FR 0 1 0 0 300.
EX 5 0 5 0 1.
XQ
EN

Example 3

"Example 3 is a vertical dipole over ground. Since the wire is thick, the extended thin-wire approximation has been used. Computation of the average power gain is requested on the RP cards. Over a perfectly conducting ground the average power gain should be 2. The computed result differs by about 1.5%, probably due to the 10-degree steps used in integrating the radiated power. For a more complex structure, the average gain can provide a check on the accuracy of the computed input impedance over a perfect ground where it should equal 2 or in free space where it should equal 1. Example 3 also includes a finitely conducting ground where the average gain of 0.72 indicates that only 36% of the power leaving the antenna is going into the space wave. The formats for normalized gain and the combined space-wave and ground-wave fields are illustrated. At the end of example 3, the wire is excited with an incident wave at 10-degree angles and the PT card option is used to print receiving antenna patterns."

CM EXAMPLE 3. VERTICAL HALF WAVELENGTH ANTENNA OVER GROUND
CM 1. PERFECT GROUND
CM 2. IMPERFECT GROUND INCLUDING GROUND WAVE AND RECEIVING
CE PATTERN CALCULATIONS
GW 0 9 0. 0. 2. 0. 0. 7. .3
GE 1
EK
FR 0 1 0 0 30.
EX 0 0 5 0 1.
GN 1
RP 0 10 2 1301 0. 0. 10. 90.
GN 0 0 0 0 6. 1.000E-03
RP 0 10 2 1301 0. 0. 10. 90.
RP 1 10 1 0 1. 0. 2. 0. 1.000E+05
EX 1 10 1 0 0. 0. 0. 10.
PT 2 0 5 5
XQ
EN

Example 4

"Example 4 includes both patches and wires. Although the structure is over a perfect ground, the average power gain is 1.8. This indicates that the input impedance is inaccurate, probably due to the crude patch model used for the box. Since there is no ohmic loss, a more accurate input resistance can be obtained as

Radiated power  = 1/2 (avg. gain) x (computed input power)
                = 1.016 (10^-3) W

Radiation resistance = 2 (radiated power)/|I source|^2
                     = 162.6 ohms.

"Since the input power used in computing the gains in the radiation pattern table is too large by 0.46 dB, the gains can be corrected by adding this factor."

CE EXAMPLE 4. T ANTENNA ON A BOX OVER PERFECT GROUND
SP 0 0 .1 .05 .05 0. 0. .01
SP 0 0 .05 .1 .05 0. 90. .01
GX 0 110
SP 0 0 0. 0. .1 90. 0. .04
GW 1 4 0. 0. .1 0. 0. .3 .001
GW 2 2 0. 0. .3 .15 0. .3 .001
GW 3 2 0. 0. .3 -.15 0. .3 .001
GE 1
GN 1
EX 0 1 1 0 1.
RP 0 10 4 1001 0. 0. 10. 30.
EN

Example 5

"Example 5 is a practical log-periodic antenna with 12 elements. Input data for the transmission line sections is printed in the table "Network Data." The table "Structure Excitation Data at Network Connection Points" contains the voltage, current, impedance, admittance, and power in each segment to which transmission lines or networks connect. This segment current will differ from the current into the connected transmission line if there are other transmission lines, network ports, or a voltage source providing alternate current paths. Thus, the current printed here for segment 3 differs from that in the table antenna "Input Parameters." The latter is the current through the voltage source and includes the current into the segment and into the transmission line. Power listed in the network-connection table is the power being fed into the segment. A negative power indicates that the structure is feeding power into the network or transmission line."

"With 78 segments, file storage must be used for the interaction matrix. The line after data card number 14 shows how the matrix has been divided into blocks for transfer between core and the files. The line "CP TIME TAKEN FOR FACTORIZATION," gives the amount of central processor time used to factor the matrix excluding time spent transferring data between core and the files. Hence it is less than the total time for factoring printed below."

"The EX card option has been used to print the relative asymmetry of the driving-point admittance matrix. The driving-point admittance matrix is the matrix of self and mutual admittances of segments connected to transmission lines, network ports, or voltage sources and should be symmetric."

CM EXAMPLE 5. 12 ELEMENT 10G PERIODIC ANTENNA IN FREE SPACE.
CM 78 SEGMENTS. SIGMA=D/L RECEIVING AND TRANS. PATTERNS
CM DIPOLE LENGTH TO DIAMETER RATIO=150.
CE TAU=0.93, SIGMA=0.70, BOOM IMPEDANCE=50. OHMS.
GW 1 5 0. -1. 0. 0. 1. 0. .00667
GW 2 5 -.7527 -1.0753 0. -.7527 1.0753 0. .00717
GW 3 5 -1.562 -1.1562 0. -1.562 1.1562 0. .00771
GW 4 5 -2.4323 -1.2432 0. -2.4323 1.2432 0. .00829
GW 5 5 -3.368 -1.3368 0. -3.368 1.3368 0. .00891
GW 6 7 -4.3742 -1.4374 0. -4.3742 1.4374 0. .00958
GW 7 7 -5.4562 -1.5456 0. -5.4562 1.5456 0. .0103
GW 8 7 -6.6195 -1.6619 0. -6.6195 1.6619 0. .01108
GW 9 7 -7.8705 -1.787 0. -7.8705 1.787 0. .01191
GW 10 7 -9.2156 -1.9215 0. -9.2156 1.9215 0. .01281
GW 11 9 -10.6619 -2.0662 0. -10.6619 2.0662 0. .01377
GW 12 9 -12.2171 -2.2217 0. -12.2171 2.2217 0. .01481
GE
FR 0 0 0 0 46.29
TL 1 3 2 3 -50.
TL 2 3 3 3 -50.
TL 3 3 4 3 -50.
TL 4 3 5 3 -50.
TL 5 3 6 4 -50.
TL 6 4 7 4 -50.
TL 7 4 8 4 -50.
TL 8 4 9 4 -50.
TL 9 4 10 4 -50.
TL 10 4 11 5 -50.
TL 11 5 12 5 -50.00 0 0 0 .02 0
EX 0 1 3 10 1.
RP 0 37 1 1110 90. 0. -5. 0.
EN

Example 6

"The geometry data for the cylinder with attached wires was discussed in section III-2 [of the Manual]. The wire on the end of the cylinder is excited first and a radiation pattern is computed. The CP card requests the coupling between the base segments of the two wires. Hence after the second wire has been excited, the table "ISOLATION DATA" is printed. The coupling printed is the maximum that would occur when the source and load are simultaneously matched to their antennas. The table includes the matched load impedance for the second segment and the corresponding input impedance at the first segment. The source impedance would be the conjugate of this input impedance for maximum coupling."

CE EXAMPLE 6.  CYLINDER WITH ATTACHED WIRES.
SP      0       0       10.     0.      7.3333  0.      0.      38.4
SP      0       0       10.     0.      0.      0.      0.      38.4
SP      0       0       10.     0.      -7.3333 0.      0.      38.4
GM      0       1       0.      0.      30.
SP      0       0       6.89    0.      11.     90.     0.      44.88
SP      0       0       6.89    0.      -11.    -90.    0.      44.88
GR      0       6
SP      0       0       0.      0.      11.     90.     0.      44.89
SP      0       0       0.      0.      -11.    -90.    0.      44.89
GW      1       4       0.      0.      11.     0.      0.      23.     .1
GW      2       5       10.     0.      0.      27.6    0.      0.      .2
GS      0       0       .01
GE
FR      0       1       0       0       465.84
CP      1       1       2       1
EX 0    1       1       0       1.
RP 0    73      1 1000  0.      0.      5.      0.
EX 0    2       1       0       1.
XQ
EN

Example 7

"Examples 7 and 8 demonstrate the use of NEC for scattering. The columns labeled "gain" are, in this case, scattering cross section in square wavelengths (rho/lambda^2)."

CM EXAMPLE 7. SAMPLE PROBLEMS FOR NEC - SCATTERING BY A WIRE.
CM 1. STRAIGHT WIRE - FREE SPACE
CM 2. STRAIGHT WIRE - PERFECT GROUND
CM 3. STRAIGHT WIRE - FINITELY CONDUCTING GROUND
CE (SIG.=1.E-4 MHOS/M., EPS.=6.)
GW 0 15 -55. 0. 10. 55. 0. 10. .01
GE 1
FR 0 1 0 0 3.
EX 1 2 1 0 0.
RP 0 2 1 1000 0. 0. 45. 0.
GN 1
EX 1 1 1 0 45. 0. 0.
RP 0 19 1 1000 90. 0. -10. 0.
GN 0 0 0 0 6. 1.000E-04
RP 0 19 1 1000 90. 0. -10. 0.
EN

Example 8

"Example 8 is a stick model of an aircraft as shown in figure 19."

CM EXAMPLE 8. SAMPLE PROBLEM FOR NEC
CE STICK MODEL OF AIRCRAFT - FREE SPACE
GW 1 1 0. 0. 0. 6. 0. 0. 1.
GW 2 6 6. 0. 0. 44. 0. 0. 1.
GW 3 4 44. 0. 0. 68. 0. 0. 1.
GW 4 6 44. 0. 0. 24. 29.9 0. 1.
GW 5 6 44. 0. 0. 24. -29.9 0. 1.
GW 6 2 6. 0. 0. 2. 11.3 0. 1.
GW 7 2 6. 0. 0. 2. -11.3 0. 1.
GW 8 2 6. 0. 0. 2. 0. 10. 1.
GE
FR 0 1 0 0 3.
EX 1 1 1 0 0. 0. 0.
RP 0 1 1 1000 0. 0. 0.
EX 1 1 1 0 90. 30. -90.
RP 0 1 1 1000 90. 30.
EN

Example 9

"Example 9 shows scattering by a sphere with ka of 2.9 (ka = circumference/ wavelength). Bistatic scattering patterns are computed in the E and H planes, followed by near E and H field. The near fields within the sphere should be the negative of the incident field to produce zero total field. This condition is approximately satisfied in the example."

"If the frequency is changed to ka = 2.744, however, large internal fields will exist in the TM101 mode of the spherical cavity which is resonant at this ka. Such internal resonances may occur in any closed structure and result in severe errors. The errors may be avoided by placing wires inside the sphere to destroy the resonance condition at a given frequency. Since the magnetic field integral equation enforces zero tangential magnetic field on the inside of the surface, the surface acts as a perfect magnetic conductor on the inside. Hence, the resonant fields are the dual of those that would exist in a perfect electric conductor. Unfortunately, while the correct magnetic currents for the internal fields would not radiate externally, the electric currents radiate strongly."

CM EXAMPLE 9. BISTATIC SCATTERING BY A SPHERE.
CM PATCH DATA ARE INPUT FOR A SPHERE OF 1. M. RADIUS
CM THE SPHERE IS THEN SCALED SO THAT KA=FREQUENCY IN MHZ.
CM THE PATCH MODEL MAY BE USED FOR KA LESS THAN ABOUT 3.
CE FOR THIS RUN *-* KA=2.9 ***
SP 0    0 .13795 .13795 .98079  78.75   45.     .11957
SP 0    0 .51328 .21261 .83147  56.25   22.5    .17025
SP 0    0 .21261 .51328 .83147  56.25   67.5    .17025
SP 0    0 .80314 .21520 .55557  33.75   15.     .16987
SP 0    0 .58794 .58794 .55557  33.75   45.     .16987
SP 0    0 .21520 .80314 .55557  33.75   75.     .16987
SP 0    0 .96194 .19134 .19509  11.25   11.25   .15028
SP 0    0 .81549 .54490 .19509  11.25   33.75   .15028
SP 0    0 .54490 .81549 .19509  11.25   56.25   .15028
SP 0    0 .19134 .96194 .19509  11.25   78.75   .15028
GX 0 111
GS 0 0 47.71465
GE
FR 0    1 0     0       2.9
EX 1    1 1     0       90.     0.      0.
RP 0    19      1 1000  90.     0.      -10.    0.
RP 0    1       19 1000 90.     0.      0.      10.
NE 0    1       1       11      0.      0.      0.      0.      0.      5.
NE 0    1       11      1       0.      0.      0.      0.      5.      0.
NE 0    11      1       1       0.      0.      0.      5.      0.      0.
NH 0    1       1       11      0.      0.      0.      0.      0.      5.
NH 0    1       11      1       0.      0.      0.      0.      5.      0.
NH 0    11      1       1       0.      0.      0.      5.      0.      0.
EN

Example 10

"Example 10 is a monopole antenna on a sparse radial wire ground screen using the Sommerfeld/Norton ground method. Part of the interpolation grid from SOMNEC is reproduced so that the user can check that his code is operating correctly."

"The NGF has been used to take advantage of the symmetry of the ground screen before adding the monopole on the axis of rotation. The addition of the monopole results in 12 new unknowns. This includes the six segments in the monopole and segments at the junction of the six radial wires. The basis functions for these junction segments are modified and have become new unknowns. The currents represented by these new unknowns are printed in their normal locations in the table of currents."

"The NGF can be tested on any of the other examples in this section by splitting the structure at some point. The results should be unchanged, although small differences may occur on computers with less than a 60-bit word length."

Note: Depending on the core or program used to test this example, you may be able to (and wish to) give the .WGF file a unique name, especially useful if you have other NGF files within the same directory/folder.

CM EXAMPLE 10. Green's Function for Radial-Wire Screen over Finite Ground
CM Screen Radius = 30 m (1. wavelength radius)
CE Screen height = .01 m  6 radial wires
GW 0 12 0. 0. .01 30. 0. .01 .003
GR 0 6
GE 1
FR 0 1 0 0 10.
GN 2 0 0 0 4. .001
WG
NX
CE Monopole on radial wire ground screen from the NGF file.
GF
GW 1 6 0. 0. 0.01 0. 0. 7.51 .003
GE
EX 0 1 1 0 1.
RP 0 19 2 1001 0. 0. 5. 90.
EN

These model files are provided to encourage newer users of raw cores or of programs above the entry level to familiarize themselves with the complete scope of what NEC can do. As well, since many of the example narratives point to limiting factors, the user can familiarize himself or herself with NEC limitations and correctives or work-arounds.


Go to Main Index