# 27. Modeling By Equation A. A Beginning

### L. B. Cebik, W4RNL

Most beginning modelers acquire the habit of simply placing physical wire dimensions into the structure grid of NEC and MININEC input systems. The wire geometry may be systematic or random, initially, but that is a problem we looked at in an early installment in this series. In this episode, I should like to start an exploration of another way to model antennas: by the use of variables and equations.

In MININEC programs, AO permitted the use of variables and equations. Of presently available NEC-2 programs, perhaps NECWin Plus offers the most versatile system of modeling in this way. For example, the input file for AO does not itself show the physical values resulting from the use of variables and equations. However, the spreadsheet input screen of NECWin Plus allows the user to see, in alternative views of the structure spreadsheet, a. the numbers and equations used to set the values of variables, b. the values that result from those equations, c. the assignment of variables to the X, Y, and Z coordinates of the model structure, and d. the physical values of the X, Y, and Z coordinates that result from the preceding steps. So for this exercise, I shall make use of NECWin Plus to demonstrate a few (but by no means all) of the steps involved in modeling by variables--along with a couple of the advantages that accrue to the modeler. (In future episodes, we shall look at more complex structures and more complex ways of formulating variables.)

Fig. 1 represents our sample antenna--a simple quad loop. For simplicity, we shall begin with a free space model for 300 MHz, composed of #20 AWG (0.032" diameter) copper wire. A square quad loop consists of 4 equal sides. A simplistic approach to modeling by variables might simple let some variable A equal the physical length of a side and proceed from there.

Dimensions as Variables

However, when modeling by variables, it pays to do a preliminary inspection of the geometry of the antenna to see if one might obtain a more sophisticated and ultimately more useful selection of variables and values. Fig. 1 shows that a square quad loop can be framed against a center point so that we can take advantage of the Cartesian reference system. The example takes the 2-dimensional square and assigns the horizontal dimension to the X axis and the vertical dimension to the Z axis. Initially, Y will always equal zero.

In a free-space model, we can keep the structure centered by using values of A as +/-X and +/-Z values. This will come in handy later when we move the antenna over real ground. For initial purposes, A becomes about 1/8 wavelength long to form the approximately 1 wl total loop circumference. For the present, we shall not be concerned with whether the loop should be exactly 1 wl long, since that is something we shall discover from out modeling. Unless otherwise specified, the dimensional units for our exercise will be inches.

The first step is to define a variable as 1/8 wl long. Fig. 2 shows the NECWin Plus equations page, with A defined as W/8. (I shall by-pass the program specific instruction set by which we accomplish this, but it follows standard spreadsheet procedures.) Note that two other variables are already assigned permanent values: F for the initial frequency (and in this case the only frequency) of test, and W for the wavelength. Note that the wavelength entry has a reference to model parameters. The parameter of relevance here is the conversion factor for changing the modeling units (inches in this instance) into the NEC core requirement of meters. The result is the wavelength in the unit of choice.

The lower half of Fig. 2 shows the value of A in inches that results from establishing the equation that defines A. At the top of Fig. 2, is a button labeled Fn. When highlighted, we see the equations. When dark, we see the values that the equations yield. In this model, we have let A = W/8, whatever the value of W might be. You may also note the header information that establishes this as a free-space ("No Ground") model at 300 MHz. At 300 MHz, A has a value of 4.91797. . ." because a wavelength is 39.34383. . ." long.

We might have defined the value of A in terms of frequency, but that would have required that we confine the units of measure to a single system, or that we define conversion variables. Defining A in terms of the wavelength will give us some versatility later on.

The next question is how to set up a structure that makes use of the variable A to set antenna dimensions.

If we go from the equations page to the wires page, as we have in Fig. 3, we can set up the antenna structure using the variable A. Note the highlighted Fn button--we shall "un-highlight" it in a moment. We construct the quad in the normal manner, but we use values of "=-A" and "=A" instead of the normal numerical values we might otherwise use. Note that the structure parallels the set-up shown in Fig. 1, using the X and Z axes as the dimensional columns, leaving Y at zero. Many modelers prefer to use Y and Z, leaving X at zero, which achieves the same goal, but with the antenna aligned 90 degrees relative to the convention selected for the example. The antenna is constructed sequentially, beginning with the lower horizontal wire, then the right vertical, then the top horizontal, and finally the left vertical. Connections are sequential in order to facilitate an examination of the segment currents, should that become relevant to a task.

The remaining wire data to the right of the chart is constant for now. The source segment is the center segment of the lower horizontal wire. The conductivity entry of "copper" represents a specific numerical value built into a program table. You may discover that different programs (for proper reasons within the context of each program) may use very slightly different values for the conductivity of any material, mostly varying in the number of decimal places to which the value is carried.

Now, just how big is our antenna?

By flipping to the unhighlighted Fn version of the wires page (Fig. 4), we can view the values (in inches, our chosen unit of measure) for the variables in each position of the antenna structure. Perhaps the most difficult facet of this page to which we must grow accustomed is the number of digits in each value. We must remember that NEC programs are essentially calculating machines and do not choose the number of significant digits for us. We must do that according to the task at hand. For building this loop, we might round the figure for A into 4.92, and then translate that into 4 15/16" for measuring wire. Some other tasks involved in finding the trends in values might relevantly preserve additional decimal places. For now, we can simply accept the calculated value of A and focus on making sure that we have constructed the loop correctly by checking appropriate End 1s and End 2s of each wire.

We characterized this model as a trial. So let's run the model and see what we get. See Fig. 5.

Fig. 5 places all of the data we need at this point on the free-space azimuth pattern--even though the data comes from different places in the program. For this exercise, the most essential figure to note is the source impedance: 109 - j144 Ohms. Our loop is much too small to be a resonant quad loop for 300 MHz.

Had we entered our coordinate values in terms of individual numbers, we would now be faced with revising each coordinate value by the amount we think might move the quad loop toward resonance. To suggest that this is a time consuming procedure is to make a very serious understatement. We would have to revise 16 values however many times it takes to find a value that allows the loop to be resonant with an Ohm or two. I have found that many modelers enlarge the concept of resonance to encompass many Ohms of reactance, not because the task does not require close tolerances, but because they simply tire of adjusting coordinate values on the wires page. Some programs have shortcuts that permit adjusting junctions and wire groups together, but there are still multiple steps involved--and each becomes an invitation to drop, double strike, or transpose a number along the way.

With our model-by-variable system in place, we shall change the loop dimensions by changing only one number. For this we return to the equations page and look back at Fig. 2. Where we had entered the value for A as W/8, we shall enter a new value. To make the loop larger, we should choose a smaller value than 8 as the denominator. To keep the story brief, let's replace 8 with 7.43.

Had we exercised a preference for multipliers rather than divisors, we might have started with a value of a of W*.125. Given that choice of equation formulation, to make the loop larger, we need a larger constant. The result would have been W*.1346 or thereabouts.

The change we just made will make no difference to the version of the wires page that shows the assignment of variables to the coordinates of the structure. So we shall by-pass that version of the wires page and go directly to Fig. 6, the version of the wires page that shows the actual dimensions that result from the revised value for A.

The value for A is now (at 300 MHz) about 5.3, a full 7% larger than the value with which we made our trial start. Each side of the quad is now about 10.6" long. The question is whether we have achieved resonance. So let's run the model once more.

Fig. 7 shows the free-space azimuth pattern of the antenna, with the critical data added at the top. The loop achieves a resonant impedance of 129 Ohms, indicating that our initial task is complete. At this point, we should take a moment to appreciate the time we have saved in creeping up on the resonant dimensions of this simple loop. A little time spent with an initial analysis of the antenna geometry resulted in a much larger amount of time saved in the optimizing process.

Wire Diameter as a Variable

There is a limitation on the exercise we have just run. In order to focus on the aspects of dimensional modeling by the use of variables, we let the wire diameter become a constant. In virtually all programs, selecting a wire size from a chart--that is specifying the wire size in AWG values--creates a constant. For some purposes, it is better to make the wire size a variable.

Therefore, let's return to Fig. 2 and add a new variable B to our list. We might simply list the value of B as 0.032 or so to represent the diameter of #20 AWG wire. However, let's go to the trouble of making the wire size a function of a wavelength. If we let B = W/1227.68 (or W*.008145), we shall have captured the diameter of #20 wire at 300 MHz. Wire size tables are readily available in many basic radio and electronics handbooks. Keeping a table handy at the computer is never a bad idea. We must now go back to the "variables" version of the wires page and replace all of the wire diameter entries with "=B" to put the variable into effect. The end result on the dimensions version of the wires page will look like Fig. 8.

I shall not guarantee that the wire diameter shown is accurate for #20 AWG past the first 4 decimal places in inches, since paper tables end at that position. However, the wire size that is twice that diameter is listed at 0.0641, indicating the next digit in the #20 sequence is just below a 5. Some computer tables go much further--to 6 or more significant figures. Procedurally, one can seek out a value of the divisor (or multiplier) that yields a usable wire diameter value. Or, one can simply divide the wire size of #20 AWG by a wavelength. The actual wavelength is available on the equations page by clicking the Fn button. (For 300 MHz, the length is 39.34383202", according to the spreadsheet. If we divide .0320473 by this number, we arrive at about the same number for the divisor: 1227.68 or so. Once more, the calculating machine provides more digits than would be useful to most operational tasks. 6 significant digits is far beyond relevance to any imaginable task.)

What we gain by making the making the wire diameter a function of a wavelength is a good bit more than the little trouble it took to create the variable and to put it into place on the wires page. Here are just two examples.

1. Units conversion: Programs vary in the manner in which they handle the conversion of units. When changing units in some programs, it may be possible to specify whether we convert all of the numerical values or whether we keep the numerical values and only change the units they represent. In other programs, a change of units only changes the conversion factor for getting everything into meters for the NEC run. In such programs, any changes in numbers will be a task for the modeler.

Design by variables and equations can change all of that. Since we defined all of our physical dimensions as functions of a wavelength, changing the units of measure will automatically change all of the physical values. If we remember from Fig. 2, the value for W, a wavelength, included adjustment into the currently selected units of measure by taking into account the adjustment factor for the eventual conversion into meters. Hence, the numerical value of W changes with each change we make in the units of measure. And if we change the value of W, then the values of A and B (the variables in our example) also change to the correct values for the selected unit of measure.

As an experiment, let us change from inches to millimeters. The units of measure are listed in NECWin Plus at the right and above the geometry table. To see what happens with our change to millimeters, see Fig. 9.

The numerical difference in all of the values on the dimensions version of the wires page are instantly evident. Since the physical lengths and diameters have not changed, running the program from this version of the page would make no difference in the output. Fig. 7 would still tell the same performance story. The NEC core input procedures would reconvert everything into meters for further processing.

2. Frequency scaling: Complete frequency scaling requires that we multiply every dimension of an antenna by the ratio of the old frequency to the new frequency. Hence, if we go lower in frequency, we obtain larger dimensions, and vice versa. There may be a very slight adjustment to be made for differences in skin effect, but if we scale the wire diameter as well as the wire lengths, we come as close to perfection as is possible.

If we fail to scale the wire diameter, we will find that the antenna at the new frequency may not perform as it did at the old frequency. The greater the frequency jump, the greater the difference in performance, if we simply let the wire size be a constant. For perfect scaling, we must make the wire diameter--like the wire lengths--a function of a wavelength.

Fig. 10 shows the dimensions version of the wires page of our quad loop. The only change made was to change (at the upper left corner) the frequency. We moved from 300 MHz to 144 MHz. On the equations page, since F changed, so to did W, the length of a wave, and so on through every variable defined in terms of W. The result is the series of numerical values shown in Fig. 10.

It is not necessary to show an azimuth pattern for this new antenna, since it is identical to that in Fig. 7. The reported source impedance is 129 - j0.4 Ohms.

The wire diameter calls for comment. Our new diameter is 0.067", which does not coincide exactly with any AWG value. However, it is close enough to #14 AWG (0.0641") that using this size would likely turn up no measurable differences in loop dimensions--given the variables of physical construction.

The exercise does suggest that there is a limit to physically scaling antennas. When the wire diameter reaches unreasonably thin or thick values, it is time to redesign the antenna. If we scale our 300 MHz loop of #20 wire to 28 MHz, it calls for 0.343" diameter copper wire. This diameter is an unreasonably heavy wire for a quad loop (unless one simulates it with a double strand of thinner wire, spaced to achieve the same resonance with the same loop length). Nevertheless, the model shows a resonant loop with a source impedance of 128 - j0.8 Ohms: a good model without any hope of direct implementation.

Is There More?

The exercise we have just run is only the beginning of modeling by the use of variables and equations. We took the process beyond the first step of merely assigning numerical values to our variables. By letting each variable be a function of a wavelength, we accumulated some advantages in addition to saving time in optimizing the antenna structure for a desired set of operating parameters. We gained the ability to switch units of measure and operating frequencies with a simple choice in each case.

The type of modeling we have done--using wavelength as the key to our variables--can be simulated in other programs. For example, EZNEC allows direct conversion on its wires page from dimensional units to either other dimensional units or to wavelengths--with the wire diameter an additional option for this latter conversion. Much of what we have so far done can thus be accomplished in either popular NEC program.

There are instances where simpler schemes for assigning variables may be preferable, but they would not have been as interesting. In the other direction, there are two directions in which we should look before leaving the subject of modeling by variables. One is how we might deal with more complex antenna structures, for example, those involving numerous elements. The second direction involves more complex equations by which we might specify the dimensions of an antenna element. This latter task is restricted to programs that contain a complete equations-and-variables facility. We shall also want to take a longer look at the importance of conventions in making the task of modeling by variables and equations as efficient as possible.

Go to Main Index