Warnings and Errors: What Does NEC Do and What Should You Do?

L. B. Cebik, W4RNL (SK)

Newer modelers often encounter situations in which a model aborts a core calculation run and simply returns an error notation. Some implementations of NEC, such as EZNEC, try to prevent the core run by pre-detecting the modeling error (or bad modeling practice), locating it, and labeling it to provide the modeler with a guide as to what should be changed. Other implementations of NEC, such as GNEC, provide pre-run checks within the antenna view system, but the modeler need not examine this facility before ordering the core to perform its calculations. Still other implementations provide no other error identifications other than what may appear in the NEC output report.

In fact, when a run aborts, the first place that a modeler should look is in the NEC output file. Unfortunately, newer modelers fail to realize that NEC produces an output report even for an aborted run, and it identifies errors and warning that fall within its stock of checks. NEC-2 makes only a few checks and reports on very few errors. Some implementations of NEC have expanded the checklist. Therefore, any existing facilities that a program makes available should become a regular part of the modeler's pre-run routine. NEC-4's checking system is far more elaborate, but as we shall see, it is by no means complete, and some warning and error conditions may require considerable hunting to find.

These notes will examine a few kinds of error and warning conditions. The goals interlace, since we sometimes presume that some NEC limits are the same throughout. So in the process of providing a few samples error and warning cases, we can also distinguish among a few ways in which NEC applies different limiting standards to models.

Note that we shall push NEC of its limits on purpose. Therefore, the existence of a full output report on a model does not necessarily mean that the model follows good modeling practices. Reliable NEC output reports generally require us to stay well within the program's limits.

Case 1: Crossed wires meeting at other than a segment or wire junction: Our first case is a clear violation of NEC rules. In the model below, the two wires cross and join in the middle of the center segment of each wire. Fig. 1 shows the view of the situation.

CM crossing wires
CE
GW 1 9 0 0 0 0 0 .25 .001
GW 2 9 -.125 0 .125 .125 0 .125 .001
GE 0 0 0
FR 0 1 0 0 299.7925 1
EX 0 1 1 00 1 0
EN

NEC-2 will run this model without comment. However, NEC-4 may abort the run, depending on the setting of the GE command. Even if the model runs in accord with the user's instructions, the output report will return the error message in Fig. 2. The three lines are essentially encapsulated in the first line, but the segment-check feature aims for completeness.

The second entry in the GE command dictates whether NEC-4 aborts the run in the presence of errors along or in the presence of either errors and/or warnings. Fig. 3 shows the GNEC set-up screen with explanations for the options to run or to abort in the center section. I have added the numbers that will appear in the command line for each user selection. NEC-2 does not have anything corresponding to the NEC-4 GE options.

Regardless of which option you choose, referring to the output file is necessary to understand what error or warning is at work and hence what may be at fault with a model. Errors and warning applicable to the geometry (wire) structure of the model appear at the very beginning of the output report, immediately after the core's interpretation of the geometry commands through the GE command.

There is a distinction between error and warning messages. "When segment testing is requested. . ., error messages are printed [in the output report] for illegal segment intersections and warning messages are printed for violations of the thin-wire approximation. An illegal intersection is indicated when the minimum separation of the segments at a point other than at the segment ends is less than 10-3 times the length of the shorter of the two segments. A violation of the thin-wire approximation is indicated when the minimum separation of non-connected segments is less than the sum of their radii. A warning message is also printed if the center of a segment is within the volume of another segment." (p. 27, NEC-4 Manual) This latter warning sets up a limit to the angle at which two wires may met based upon both the radius and the segment lengths in each wire. These are not the totality of warnings that may appear in a NEC-4 output report.

Case 2: The interpenetration of parallel wires: When two wires are separated by less than the sum of their radii, we generically refer to them as interpenetrating. In other words, even though their axes are separate, their surfaces are not. The following model samples this condition with parallel wires. The sum of the radii is 0.012 m, but their axes are separated by only 0.01 m. Fig. 4 shows the outline of the situation and the set of warnings generated by NEC.

CM interpenetrating wires
CE
GW 1 9 0 0 0 0 0 .25 .006
GW 2 9 .01 0 0 .01 0 .25 .006
GE 0 0 0
FR 0 1 0 0 299.7925 1
EX 0 1 1 00 1 0
EN

The outline of the parallel wires shows two distinct wires and does not reveal the interpenetration. Most (but not necessarily all) graphic representations of models use simple lines connecting the wire end coordinates. They normally do not show the wire thickness. Therefore, the outline may not show an error or a warning condition.

Note that these are warnings and not an error. Therefore, it is possible to set up the GE command to allow this model to run, while still trapping errors with an abort of the run. However, the results of the run will not be reliable. Indeed, merely increasing the separation of the wires to eliminate the warning list may not be enough separation to yield a reliable model. For close spacing that does not result in interpenetration of wires, the average gain (AGT) test is still the most important first-order test of model reliability.

Cases 3a and 3b: Angularly approaching wires: If two wires approach each other at an angle, it is possible to incur warnings of interpenetration at the narrow end of the angle. The following model, in which the wires meet at the "top", is such a case. Fig. 5 on the left shows the outline with a distinct junction of the wires at one end.

CM interpenetrating wires
CE
GW 1 9 0 0 0 0 0 .25 .006
GW 2 9 .013 0 0 0 0 .25 .006
GE 0 0 0
FR 0 1 0 0 299.7925 1
EX 0 1 1 00 1 0
RP 0 181 1 1000 -90 90 1.00000 1.00000
EN

Because the wires are not parallel, the warning message differs from the previous case. The top four segments of each wire interpenetrate to the degree where the center of the listed wire is within the volume, that is, inside the radius, of the noted segment of the adjacent wire. This condition normally results in errors in the current calculations for the affected wire segments. (Also note that the error messages use the absolute segment number rather than the tag number and the relative segment number.)

We may modify the case just slightly so that the wires do not join at the ends. We need modify only 1 of the 2 GW entries.

GW 1 9 0 0 0 0 0 .25 .006
GW 2 9 .013 0 0 .007 0 .25 .006

The revision results in the outline at the right of Fig. 5. The close center-to-center (C-C) spacing of the wires at the top indicates, by reference to the wire radii, that we certainly have wire segment interpenetration for at least two or three segments. However, because the wires are not parallel and do not meet at the end, NEC-4 shows no warnings. Wherever wires come into close proximity, the AGT test is a necessary step in model evaluation. Despite the seeming simplicity of the revised model, its AGT score is 0.937, meaning a gain error that approaches -0.3-dB. In most instances, model revision to improve the AGT score would be advisable.

If the implementation of NEC applies additional checks to the model, the situation might well be detected and reported. For example, some implementations take wire radius into consideration for all geometry situations. Such a system would report the interpenetration and either prevent a core calculation run or advise a model revision.

Case 4: Crossing interpenetrating wires: Although NEC-4 will not detect the situation of case 3b, it will detect wires that cross without touching at mid-segment while in a condition of surface interpenetration. The following model, with wires at right angles to each other, illustrates the condition.

CM interpenetrating wires
CE
GW 1 9 0 0 0 0 0 .25 .006
GW 2 9 -.125 .01 .125 .125 .01 .125 .006
GE 0 0 0
FR 0 1 0 0 299.7925 1
EX 0 1 1 00 1 0
EN

The wire axes are separated by 0.010 m while the radii are both 0.006. Hence there is a 0.002-m interpenetration at the crossing point, that is, relative to the center segments of both wires. Fig. 6 shows the outline and the warning. The warning message is specific to this type of modeling situation. As usual, the outline uses a single wire along the axis of each wire and therefore does not itself reveal the interpenetration.

All of the errors and warnings that we have so far illustrated show themselves in the form of messages that occur immediately following the core's interpretation of the geometry entries. Although we have been using very simple cases with only GW entries, it is possible to incur "hidden" errors or warnings by the use of some of the other geometry commands. CW, GM, GX, GR, and GA all create wire segments that may or may not be in the clear relative to other wires in the geometry structure. Therefore, reference to the output report is essential to ensure that the overall structure meets the NEC guideline limits.

Case 5: Interpenetration insulated sheaths: Not all warnings and errors involve the geometry commands. Errors and warnings that concern control commands do not occur in the geometry section of the output report. Rather, they occur in the report section directly relevant to the command interpretation. As a result, we may easily overlook them and miss an unintended modification to the model.

The following model sets up two crossing wires that are--with respect to the GW commands--separated enough to pass all tests. The wire radii are 0.001-m, while the separation is 0.01-m. However, the subsequent IS commands set up two sheaths, each with a radius of 0.006-m. Therefore, the sheaths interpenetrate at the crossing point between wires.

CM interpenetrating wires-IS
CE
GW 1 9 0 0 0 0 0 .25 .001
GW 2 9 -.125 .01 .125 .125 .01 .125 .001
GE 0 0 0
IS 0 1 1 9 1 1e-10 .006
IS 0 1 1 9 1 1e-10 .006
FR 0 1 0 0 299.7925 1
EX 0 1 1 00 1 0
RP 0 181 1 1000 -90 90 1.00000 1.00000
EN

The 0.002-m interpenetration of insulating material may seem innocuous. However, as shown in Fig. 7, the warning advises otherwise. The interpenetration of sheaths results in one of the sheath commands being ignored, which modifies the model relative to the modeler's original intent to have two insulated wires.

The warning appears only in the section of the output report devoted to the IS command. Unless an implementation of NEC uses an error checking system sufficiently extensive to report such problems before a core run, a careful reading of the output report may be the only way of catching the difficulty.

Case 6: Horizontal wires close to but above ground: The NEC-2 manual is quite explicit about the limits of a wire's height (z-coordinates) when the wire is not vertical. As shown in Fig. 8, the NEC-2 Manual, Section 3. Modeling Structures Over Ground, specifies that for a wire of radius a and height h to the wire axis, (h2 + a2)1/2 > (about) 10-6 wavelength. It also notes that h should be several times the radius for the thin-wire approximation to be valid.

In the user guide for the GE command, the manual also states, "If the height of a horizontal wire is less than 10-3 times the segment length, I1 equal to 1 will connect the end of every segment in the wire to ground. I1 should then be -1 to avoid this disaster." I1 is the first digit of the GE command (where a zero means free space or no ground at all). A 1 means that there is a ground plane and that the currents on segments touching the ground in the X-Y plane are interpolated to their images below the ground and the charge at the wire base is zero. In contrast, -1 results in no current expansion modification so that the current on wires touching ground go to zero at ground or Z=0.

The situation sounds straightforward until we pose the question of when a horizontal wire is close enough to ground to incur the difference between setting GE at 1 or at -1. The options are the surface of the wire, as defined by its Z-coordinate plus the radius of the wire, or the axis of the wire, that is, its Z-coordinate alone. The warnings that emerge from the various cases of interpenetration might strongly suggest the first option to some, although the manual is not explicit on the matter.

Therefore, I set up a test model consisting of 36 horizontal radials with a simple monopole, as shown in Fig. 9. The wire radius is 0.001 m. The segment length for a radial is 0.025 m, while the segment length for the monopole is 0.0239 m. (At the test frequency, 1 m = 1 wavelength.)

The basic model appears below. The initial height is 0.003 m above ground. This places the horizontal radial wires along their axes at 3 times the wire radius, a rough meeting of the injunction that the value of h be several times the value of a. The height also easily meets the minimum value of h and a taken together.

CM GR Radials for Monopole
CE
GW 1 10 0 0 .003 .25 0 .003 .001
GR 1 36
GW 37 10 0 0 .003 0 0 .243 .001
GE 1 2 0
GN 2 0 0 0 13.0000 0.0050
FR 0 1 0 0 299.7925 1
EX 0 37 1 00 1 0
RP 0 181 1 1000 -90 90 1.00000 1.00000
EN

I then gradually lowered the height of the entire assembly in small steps. Among the more important steps is a height of 0.0011 m. This height would be the last allowable height if NEC faulted the model when the horizontal wire surfaces touched ground. A height of 0.001 m would place the radial wire surfaces in contact with ground. The next height, 0.0009 m would count as a definite penetration of the wire surface into ground. A height of 0.00002 m would place the horizontal wire axes just below the limit of being greater than 1/1000 of the segment length above ground.

The question becomes at what height the model shows a fault with GE = 1 and with GE = -1. I ran the sequence of models in both NEC-2 and NEC-4 to see what kinds of error conditions might appear with each core. The results appear in Table 1.

All heights from 0.003 m down to 0.0002 m produce no error reports in either NEC-2 or NEC-4 with GE set to 1. Moreover, the sequence of gain, theta-angle, and impedance values are quite sensible. In fact, both cores, although they return very slightly different numbers, show the same trends in all three categories. The progressions of both source resistance and source reactance are parallel throughout the progression. These results do not mean that pressing the base of the monopole and the radials downward represents good modeling practice, since the height no longer meets the height-to-wire-radius recommendation. It merely records the fact that nothing disastrous occurs.

With GE = 1, the lowest two entries record the fact that the cores of both NEC-2 and NEC-4 abort the run and show an error (not a warning) message, as indicated in the table. Since I have only a limited number of NEC-2 cores, it is not clear whether the error report using that core originally came with the core or whether the implementation (NSI) added the message. The NEC-4 core message apparently is inherent to the core as issued.

With GE = -1, both cores allow the full run with no error reported. When the wire axis is as close as 0.00002 m from the ground, both cores record sensible additions to the progression of values for higher values of Z. However, at Z=0, only the NEC-2 core records a seemingly sensible result, while the NEC-4 core result is not an extension of the progression of values in the table.

In both settings for the GE command, the models fall well below guidelines for good modeling practice and do not represent values for h that anyone should recommend for virtually any wire radius. Nevertheless, they allow one kind of answer to our inquiry into whether NEC uses the surface or the axis of the wire in determining when an error has occurred with GE = 1. The answer is that it uses the wire axis. Those who create implementations of either NEC-2 or NEC-4, of course, are free to alter this limit by applying run-abort messages or other flags to indicate when some part of a model lies outside the limits of recommended modeling practices. EZNEC, for example, applies the implicit Z-coordinate of the lowest point on a wire's surface to determine when the wire is too close to ground.

Vertical and sloping wires, of course, can legitimately reach ground or have a terminating Z-coordinate of zero. Both types of wires are useful in NEC-2 with a perfect ground. For a sloping wire, NEC ignores the wire's surface penetration below ground. Likewise, when penetrating below ground in NEC-4, the wire must reach Z=0 at a segment junction or end, which includes a wire end. A new segment takes up the below-ground portion of the wire in either case. Again, NEC ignores the angular penetration of the segment either above or below ground.

Conclusion: We have examined a number of error and warning conditions that can arise in NEC, especially NEC-4, with reference to messages and actions taken by the cores themselves. We have had several goals. The first has been to show the conditions under which NEC will return an error or warning message. Most, but not all, such messages are built into NEC-4 alone, which has an internal segment-checking system. For the most part, NEC-2 lacks the system and may let such models run.

When NEC aborts a run--or even when it does not--we need to know where to find the error. The NEC output report is the locus of such reports. Reports relating to the basic geometry of the wire structure occur at the very beginning of the report. However, examining every section of the report is useful, since it may catch warning relating to control commands that can modify a model relative to one's initial intentions. The IS-command case well illustrated the need for close scrutiny of the report. That was our second goal.

The final aim was to clarify some of the error and warning reports and when they occur and do not occur. The wire penetration of sloping but unjoined wires was a case in point that showed the limitations of the segment-checking system. The monopole + radial model in Case 6 allowed us to determine the basis for NEC error reports for horizontal wires that are too close to ground.

Nothing in these notes is a license for any violation of good modeling practice. Applying the average gain test remains the first line of defense against inadequate models, but it only establishes the necessary, not the sufficient conditions of model adequacy. In the end, the final test is a correlation of the model with reliable measurements of physical implementations of the antenna modeled.

Go to Main Index