# 74. Some Numerical Green's Function Rudiments

### L. B. Cebik, W4RNL

Suppose that you need to use a geometric structure over and over, each time varying some relatively simple appurtenance. We might have a wire-grid model of a ship, plane or ground vehicle and wish to know the best type of antenna and placement for a certain purpose. We might even have a fixed-size reflector--again constructed as a wire-grid assembly--and wish to find the best drive element for it, as well as the best place to put the driver.

We always have the option of running new models of the entire geometric structure composed of GW, GM, etc. entries. Very often, we can make the necessary changes using cut and paste methods within whatever ASCII editor we happen to use to create .NEC files. However, each run takes the same amount of time, plus or minus a little for variations in the new model sections that we introduce.

There is a better way--at least better in the sense of saving some time. How much time we save will vary not only with our computer speed, but as well with certain ratios between the size of what we create to use many times and the size of what we add to the model. The modeling technique involves Numerical Green's functions, which pre-calculate certain portions of the modeling problem and then use the results as substitute elements in the final set of matrix solutions. Mathematical details appear (for NEC-4) in section 6.3 of the program description and theory portion of the manual. NEC-2 handles these functions in essentially the same way as NEC-4. However, the feature is only available on advanced version of implementing programs and is generally omitted from entry level programs.

For the user, the task is a double one: first, learning the rudiments of incorporating Green's functions into a model. and second, learning when it is useful to employ them. If we take first things first, then we need to start with a little big model, that is, a model eligible for Green's function treatment but small enough to handle within the confines of these notes.

A Planar Reflector and a Double-Diamond-Quad Driver

If we begin with a complete model, we can then more easily sort out the elements of a Green's function version of it. So let's begin with a double-quad driver in front of a planar reflector. The reflector uses a wire-grid in standard ways. Fig. 1 shows a portion of the model: the driver and the start and end of the reflector.

The model also shows the commands necessary to complete the model. For simplicity, I have set all of the wires to the same conductivity in one LD5 line. The ground setting is for free space. The frequency (FR) is 435 MHz only. The pattern request (RP0) is a simple azimuth or phi request at 0 degrees elevation or 90 degrees theta. If I run this example, I obtain the pattern shown in Fig. 2.

My sample has only 450 wires and 678 segments, so it is not all that large. It took 22.03 second for the core run on my slower machine. The model shows 11.25 dBi forward gain and a 180-degree front-to-back ratio of 21.28 dB, with a source impedance (at the center of the diamonds) of 45.11 - j 6.40 Ohms. I cite these reference figures only for comparison with those that we get from running the model in a different way: the Green's function way.

Green's Functions: the File

Operationally, there are two steps to using Green's functions in a model: the structure for which we create a file and the model that calls up the file so that we can get a final result. We shall take them one at a time.

In our example, the portion of the model that we may wish to use many times is the wire-grid reflector that runs from GW 10 through GW 446. So we shall include those lines in the file part of the Green's function model without even changing the wire numbers. You can see an abbreviated portion of the structure in Fig. 3.

The file portion of our work must also include a few other items. If we wish to assign a conductivity to the wire-grid wires, then we must have an LD5 entry in this unit. As well, we specify the frequency, the FR entry. (A Green's file may not use multiple frequencies.) Since lumped loads, networks, and transmission lines do not affect the basic matrix calculations done within the file that we are creating, we may omit them. The file created would only ignore such entries anyway. We also specify ground conditions (GN) (or free-space, as in this example) within the file part of the effort.

The last line (before EN) in this example is a request to write the result to a file. We can specify any filename, but the .WGF extension is what the core recognizes as a Green's file. If there are other output requests, such as RP, NE, or NH, they come after the WG (write Green's file) command. However, in most cases, the modeler will save such requests for the other part of the modeling process.

Note: early versions of NEC-2 do not permit the addition of a user-created filename. Rather, the earliest--unmodified--versions of the core automatically assigned the file the name TAPE20. NEC-2 Programs such as NEC-Win Pro have added the ability of the user to specify filenames, since one may wish to maintain a collection of Green's files for any number of modeling tasks.

When we run this model, that we can save as a regular .NEC model file, we may discover no noticeable return. That is, we created a .WGF file, but not a complete model. The process is not a storage of what the modeler has written, but a filling and factoring of the matrix for the structure, along with a reservation of array space in memory for the matrix in subsequent runs when the users calls the file. That is step two.

Green's Functions: the Model

To use the Green's function file that we just created, we must create one or more models that call on the file. The file will consist of a GF entry to call up the file, followed by whatever else we may add to complete the model. Fig. 4 shows the model file for our complete planar reflector and double-diamond-quad driver.

In the new model, we begin (after the CM and CE lines) with a GF, a call for the Green's file that we have created. Note that besides mentioning the filename, the line also has a zero. That zero indicates a call for normal printing in the NEC output file. A 1 in this position would have been a call for a list of wire ends, in case we wanted to join a new wire to an wire within the Green's file structure. We do not need that feature for our examples, since our driver elements do not make contact with the wire-grid reflector.

Note: early versions of NEC-2 do not permit the addition of a user-created filename. Rather, the earliest--unmodified--versions of the core automatically assigned the file the name TAPE20. Therefore, be sure to use the procedure that applies to the core that you are using.

Following the GF entry, we add whatever geometric structure we may need to complete the full antenna model. In this case, we enter the 9 lines that form the double-diamond-quad driver assembly. It does not matter whether the GW tag numbers precede or follow the tag numbers in the Green's function file, so long as the numbers are unique.

The new modeling file does not contain either frequency (FR) or ground (GN) commands. When the model runs, it will take these commands from the Green's file.

In this file, we need to add an LD5 entry if we wish the wires in the GW lines to have a different conductivity from those in the Green's file. I arbitrarily assigned copper values to these lines. Even though the LD5 card specifies all wires in the model, an LD in this part of the model will not reflect back into the Green's file, where the wires are aluminum.

No matter where we may place the Excitation (EX), it goes into this part of the model. The last major entry is the output request, in this case, a simple RP0 phi-pattern request. We may use any of the legitimate output requests within the model. As well, if we had an lumped loads (LD0 - LD4), networks (NT), or transmission lines (TL), we would place them in this portion of the total model.

Once we have our model complete, let's run it. If we do, again using my slow machine, we obtain 11.25 dBi free-space gain, 21.28 dB 180-degree front-to-back ratio, and 45.06 - j 6.44 Ohms source impedance. The slight difference in source impedance results from the change of material conductivity that I imposed to illustrate the separation of file and model values. Otherwise, the result is identical. If you look into the NEC output file, you will see all segments listed, with the notation "241 new unknowns."

The double-diamond-quad driver has so many segments because the source segment is very short as it forms a common link between the two quad loops. But we still have the same total number of wires (450) and the same total number of segments (678) that we had in our single model containing everything in one file. The total number of new unknowns does have an important consequence: the total run time for the model was 19.88 seconds, just a bit over two seconds shorter than the run time for the single complete model.

With that sort of run time, one might well ask why one should use a Green's function file. For this small model, where overhead, patterns requests, etc. occupy a significant portion of the run time, it may make no great sense to use a Green's file. However, we have only begun to scratch the surface of NGF use.

Re-Using the .WGF File

The total structure of the double-diamond-quad plus planar reflector looks like the views shown in Fig. 5.

If we wish to look at other candidates for antennas using planar reflectors, we might well wish to save the wire-grid structure and simply replace the driver portion of the overall model. (The antenna view is actually for the original full model because in many systems, the antenna view facility may not show the contents of the Green's file.)

Suppose that I wished to find out how well a horizontal dipole might perform ahead of the given planar reflector. (In the real world, I would recognize that the double-diamond-quad driver is vertically polarized and also that the optimal size for a planar reflector may vary with the driver in front of it. However, in this context, we may by-pass such matters.) Suppose that I select a wire radius. I still have to find the right length so that the dipole is nearly resonant (or perfectly resonant, if I am lucky or patient). As well, I shall set myself the task of finding a dipole length and position ahead of the reflector so that the source impedance is very close to 50-Ohms at resonance. My final model will look like Fig. 6. The face view is slightly tipped, since the dipole lines up with the center horizontal wires in the reflector structure.

The model for the dipole plus planar reflector appears in Fig. 7. Note that we simply re-use the Green's file. In fact, we re-used that file about a dozen times before arriving at this final model, since the X and Y coordinates required considerable shifting to achieve our goals.

The model showed a free-space gain of 8.83 dBi, with a 180-degree front-to-back ratio of 24.14 dB. The reported source impedance was 49.93 + j 1.53 Ohms. The run time for this model was 4.12 seconds.

Two aspects of the model and its run time are important here. First, the model has 458 segments, of which only 21 represent new unknowns--the 21 segments of the dipole. Note the much larger ratio of total segments to new unknowns than we found in our double-diamond model.

The second important aspect of the model is called to our attention by creating a full model of the antenna using only GW entries for the wires. You need not always create such a check model, but for this column, I had no choice. He who cites time must take time to run the models.

The non-Green's-file model reported 8.83 dBi free-space gain, 24.14 dB 180-degree front-to-back ratio, and 49.95 + j 1.55 Ohms impedance. However, the full model had all aluminum wires, whereas the Green's version used a copper dipole. Hence, we obtained a 0.02 difference in both resistance and reactance at the source. (Of course, these differences are not operationally significant, but in this exercise, we are comparing calculation results for the sake of establishing confidence in the modeling technique.)

The run time for the non-Green's version was 13.95 seconds. The Green's version took less than 30% of that amount of time to run. If I had had to make my dozen or so runs to zero in on the targets of the modeling design exercise, it would have taken me well over 3 times as long per run.

Fig. 8 shows the phi pattern for the dipole plus planar reflector, not at all a bad pattern for such a simple antenna. Although 2.5 dB lower in gain that the double-diamond, the dipole version may be that much easier to construct. Turned the other way for vertical polarization and translated into the region just below a GHz, the antenna might be suitable for use in a back-to-back pair of passive repeating antennas for use when one's phone site is in a hollow of other area shielded from normal line-of-sight contact with the cell tower. (Of course, the vertical positioning of the antenna will show a wider beamwidth.)

Some Potentials and Some Cautions

The use of a Green's functions file can save time in model formation. Instead of using cut and paste methods to patch a set of GW lines into a model, we merely need to repeat the GF or file call line of the model. The resulting model, as the dipole example illustrates, is very much easier to read, since the added structure is so much simpler than the full model. In addition, the load, source, and output request lines are more immediately at hand. For example, it was easy for me to see that I had initially placed my source on the wrong segment of the dipole model. Separating the dipole GW line from the EX line by 400+ other lines of model might have made the error search a longer one.

However, with every potential comes a caution. If the added structure is to contact the structure within the Green's file, it may be important to print the wire-end file. The error to avoid is either having no contact when one is desired or having the new wire intersect an existing wire in the Green's file at other than a segment or wire junction. There is always a big difference between saving time and becoming careless. The latter often requires much more time in the hunt for the errant entry.

The use of a Green's file may also save run time for the model. However, as we saw from the two examples, the relative time that we save appears to be a function of how much we can pack into the Green's file and how little is left over for the variable new structures that we wish to test. The lower the number of new unknowns relative to the total number of segments in a model, the more run time that we are likely to save, all other aspects of our model being equal.

Of course, there is no objection to having a collection of Green's files and calling them up sequentially in certain types of tests. For example, with our planar reflector, we might have up to a dozen or more wire-grid reflector files, each with a different shape or size. To find the one closest to optimal for a given driver system, we need only change the GF line of the model. The utility of the collection depends in part on having a constant test frequency for all of the members of our collection so that moving from one file to the next yields reliable results.

Do not expect to build up a collection of multiple-use Green's files overnight--unless you have a graduate student or other indentured servant to whom you can assign the task. (And if your work based on these models results in a publication, at least give the grad student a footnote, if not co-authorship.) The collection will emerge with time. Hence, it pays to think from the first use of such models what the test frequency should be for the most profitable work. Then, design each Green's file for that frequency. As well, from the start, give some thought to properly descriptive filenames so that you can sort out the files and know at a glance what is in each of them.

Green's files are especially useful where an overall structure may have a symmetrical portion and another portion that is non-symmetrical. For example, one may use symmetry (the GX entry) to create ships, planes, and ground vehicles with half the wires, using a centerline and symmetry to complete the overall structure. Placing this structure in a Green's file gives you the ability to place--in the model that calls the file--an antenna of any shape anywhere on or about the structure without harming the symmetry. In fact, we can place structures that are mostly, but not completely, symmetrical into two files, the Green's file for the symmetrical portion, and a regular modeling file with a GF line for the portions that are not symmetrical. We can then evaluate such structures not only for antenna placement using voltage sources, but as well using plane-wave excitation to see the consequences for the structure.

The use of Green's functions is not a means of increasing the overall number of segments in a model. MAXSEG needs to be set at or above the total number of segments, including those held in the Green's file. As well, a Green's file does not relinquish the memory space needed by the model. Although it omits the fill and factor times, it retains the matrix storage time--and the memory space needed for that function.

(As an aside, the key limiting factor for model size is not the NEC-4 core itself. The core can be and has been modified by various implementations to expand the number of allowable segments in a model. Moving the region reserved for SP entries from above 10,000 to above 80,000 theoretically raises the number of allowable segments beyond anything that almost any modeler might imagine. However, it appears that the 32-bit Windows operating system is limited to about 4 GB, divided between system operations and applications. Hence, the practical limit for the number of segments on a Windows platform with about 2GB maximum available memory for a run that does not involve file-swapping with the hard drive is just above 11,000 (if there are no surface patches). The run time for hard-drive file swapping depends on the input and output speeds of the drive--as the slowest procedure in the process--and may take 10 or more times as long as runs wholly within memory. The ability of a machine to handle such runs varies with the machine set-up, what may be running in the background, and a host of other factors outside the control of an implementing program for NEC-4. NEC-2, which handles Green's files in the same way as NEC-4, tends to be limited at most to 10,000 segments or less by most implementations of the core.)

Wisely used, Green's function files may save a modeler both time and error-hunting energy. These notes are designed only to introduce the rudiments of the process of using them. Modeler task assignment and creativity will in the end determine if they are worth the development time.

Go to Main Index