C. Formulas and Blocks

We have been looking at some of the elements of modeling via the use of variables and equations in slow motion for the benefit of newer modelers who have never modeled in this manner before. Our progress into new territory will be equally patient, since there are better and worse ways of getting to various ends--and we want always to choose the better way. Since we are working with the variable and equation provisions of a specific program--in this case, NECWin Plus--it is inevitable that certain aspects of the work will be program-specific. The more detail we understand about the processes, the easier it will be to adapt the procedures to other programs having the same capability.

This is the third episode of this sequence (but perhaps not the last word that will ever be said in this series about modeling by equation). We shall look at the rudiments of other mathematical techniques used to define variables--leaning especially on a little trigonometry as applied to spreadsheet formulations. In addition, we shall also explore ways to cut long repetitive model-creation tasks down to simple work. Finally, we shall look at when and how to freeze a design that we initially create for frequency-scaling purposes.

**A Little Trig**

Many antenna designs are amenable to trig-treatment. Theoretically, most antenna designs can be handled with trig, since we can transform almost any geometry into a collection of angles and triangles. For example, a linear element can be viewed as two lines with a 180-degree angle. This way of thinking, of course, gets into the extremes of the unnecessary, although there are always a few folks who live by the motto, "Stop! Look! There must be a harder way!"

More realistically, loop antennas--especially triangles or "deltas"--are most apt for trig-treatment. So let's pick one and see what we might do with it.

**Fig. 1** shows a typical equilateral delta, much used on the lower HF bands. The antenna
consists of 3 sides of equal length (z). Since the angles of every triangle add up to 180
degrees, each corner angle is 60 degrees. Now we can appeal to basic trig functions to
determine the values of +/-y and x so that we can model the antenna within 2 of the 3
Cartesian dimensions that form the basis of model construction in NEC. Note that we have
cut the equilateral triangle in half along a vertical line to get two equal right
triangles. This conversion makes the calculation of dimensions much easier.

The two most important trig functions to absorb are sine and cosine (abbreviated "sin" and "cos"). The sine of an angle in a right triangle (or sin X in the sketch) is simply the length of the side opposite to the angle (x) divided by the hypotenuse (z). The cosine of that same angle, or cos X, is the side adjacent to the angle (y as equaling half the length of the base) divided by the hypotenuse. Now, if we know the angle and the hypotenuse, we can derive the length and hence the coordinates of the remaining sides. Of course, we also need to know some values for sines and cosines.

Many modelers keep a few handy trig values in their head for rough calculations. The sine of 30 degrees is 0.5, which is also the cosine of 60 degrees. The sine of 60 degrees is about 0.866, which is also the cosine of 30 degrees. With an angle of 45 degrees, the sine and the cosine are equal: 0.707. These familiar numbers are handy and deserve commission to memory. However, if we model using variables and equations, we only need the numbers to check up on our work--an error detection system.

Since a delta loop has a circumference of about 1 wl, we know that each side is about
1/3 wl long. We also know that the equations for half the base and the overall height
shown in **Fig. 1** are simple transformations of the basic trig relationships. Now, we can
let the spreadsheet equations system of the program help us create a perfectly general
delta loop.

**Fig. 2** shows the equations page for an equilateral delta loop. And nothing seems to
correlate with what we have just said. The length of the hypotenuse (A) is not shown as
W/3, but as W/2.84. The loop is larger than a wl in circumference, as it was with the
quad loops we looked at earlier. Actually, the denominator of the equation for A was
derived by resonating the final model--which used #12 AWG copper wire in free space--to a
source impedance of 117 - j0.4 Ohms at 7 MHz. (We can by-pass absolute generality of
design with the wire size specified in terms of a wavelength for this exercise. However,
that option is always open to the modeler.)

The second deviance from our initial discussion are the equations for B and C, the height and half-base length equations. This deviance results from the fact that spreadsheet math is a derivative of Basic, a programming language that does all its angles in radians rather than degrees. To use radians effectively requires that we remember just one fact: a circle has 2*PI radians or 360 degrees. Hence, to convert an angle from degrees to radians, we simply divide 2*PI by the result of 360/angle, where "angle" is the angle with which we are concerned. Since our equilateral triangle uses an angle of 60 degrees, 360/60 = 6. PI is about 3.1416, so 2*PI is about 6.2832. Hence, our angle in radians is 6.2832/6. We shall let the spreadsheet finish the calculation, but we know the angle is a little over 1 radian.

Remember: if you forget to make the conversion into radians, your results will not make any sense at all. As well, you may do some of the conversion calculations on the scratch pad facility available on the equations page of NECWin Plus.

We can construct our equilateral delta by using the variables we have just defined, as
shown in **Fig. 3**. The baseline of the delta lies along the X axis (at Z = 0) from -C to
+C, with the source centered. The two angled wires go to or from these end points to a
common height, B. This is the easiest part of the process.

Flipping from the variables version of the wires page to the dimensions version in **Fig. 4**,
we find the final results of our modeling. Note that this will not necessarily be the
first set of values you see if you begin the process by setting A = W/3 and then refine
the denominator by checking for resonance. However, at 7 MHz and using #12 AWG copper
wire in free space, this is where you will end up.

Sometimes, trig can simplify our equations more than we might initially expect. Consider
the right-angle delta, an alternative version of the delta we just explored. We shall
retain the same wire size and material, and we shall keep the antenna in free space.
Our interest will be in the angles, shown in **Fig. 5**.

First, let's think about the perimeter of the right-angle delta. If we start with a wavelength, it is divided into three legs, but only 2 of them are equal: z. However, we know that a right triangle has two 45-degree angles and a 90-degree angle. The length y is the cosine of angle X times Z. Since the sin of 45 degrees is 0.707, y is .707*z, and the total length of the base is 1.414*z. (We can also use the old right-angle theorem from plane geometry: The square root of the sum of the squares of the two sides of the entire right triangle is the length of the entire base, which is the hypotenuse. The base is still 1.414*z.) So in terms of z, the total perimeter is 3.414*z. In terms of a wavelength, the length of z will be W/3.414 as a starting value.

One of the conveniences of a right triangle is that the sine and the cosine of 45 degrees are both 0.707. Hence, we can define our right-angle delta with only two equations, one to define z in terms of a wavelength and one to define both the lengths x and y. Let's now turn to the equations page of our spreadsheet.

In **Fig. 6**, we find the final equations for the right-angle delta. Values for the X and Z
axes appear in the equation for variable B. This follows the same pattern we used earlier
in converting from degrees to radians. We recognize the value of 2*PI. The denominator
of 8 derives from dividing 360 degrees by 45 degrees.

The final value for A comes from adjusting our initial denominator of 3.414 until the antenna achieved resonance with a source impedance of 196 + j0.6 Ohms. Once more, for a loop, the final size to give 1-wl resonance will be physically longer than 1 wl.

The simplification of our set-up also shows up in the variables version of the wires page,
**Fig. 7**.

For a right triangle, we only need to set the baseline ends at -B and +B, and the height will be +B. For both deltas, we set the baseline at zero on the Z-axis. Should we wish to center the model vertically, using +/-Z values that are the same, we shall have to wait until we know the final physical dimensions, or we shall have to create a further equation for this purpose to the short list on the equations page. For example, we might have defined C as 1/2 the value of B and then specified Z coordinate of the baseline as -C and the peak as +C. Once we start down the road of modeling by equation, we can get as sophisticated as we desire. The key questions are these: Do we need the added fanciness? Will the resulting model be easy to read in the future? For this example, a baseline of zero on the Z axis will do just fine. If we develop a special need later on, we can adjust the equations. For example, a particular project might set a maximum height. In that case, we can revise the equations to work downward from that height.

The final dimensions for the resonant right-angle delta appear in **Fig. 8**. As always,
round off the excess precision to the level appropriate to the task at hand.

**Something Bigger: A Helical Dipole**

We have lingered over the basics of using trig functions in a spreadsheet model-by-equations system to prepare ourselves for larger tasks. The larger task I have chosen as an exercise is the creation of a helical dipole for 10 meters. What I wish to achieve is a helical dipole that is under 10' from end to end for a frequency of 28.5 MHz, using #12 wire. Since I might run into difficulties with the limits of NEC if I wind the helix too tightly, I shall specify a radius of 4".

NEC must create a helix from straight wires. In fact, NEC has an input card that will automate the creation of a helix, but that card is normally not available on entry-level commercial versions of the program. No matter: manually creating a helix will give us some understanding of what goes on when we implement that card in an advanced NEC program.

**Fig. 9** shows us an outline of the helical dipole. Almost any representation of a helix
made from straight wires will give some visual distortion of what is actually happening to
the wire, and **Fig. 9** is no exception. However, we can see the straight wire sections of
each turn of the helix. Each one forms part of the circumference and also proceeds part
way down the line from one end to the other. Since each wire is the same length, the
increment of movement along the total length will also be the same for each successive
wire.

For the example, the total number of wires turned out to be an even number. Hence, I specified a split feed, using the last segment of one wire (28) and the first segment of the next wire (29). We shall look at the consequences of placing the source in this manner later on. First, we need to figure out how to make up the turns of the helix.

**Fig. 10** shows the cross section of one complete turn of the helix. Since the length of
the entire assembly will lie along the X-axis, the turns will be defined for the Y- and Z-
axes. The circle shows the true helical shape. For this exercise, I have chosen to use a
hexagon as the substitute. An octagon would have been more true to the circle, but the
hexagon is more interesting for our purposes. Obviously, when translating the final model
into a physical antenna, we would likely discover that a true circular radius a bit under
6" will best capture the model.

A hexagon can be subdivided into a collection of equilateral triangles. If we let the radius lie along the Y axis, the first set of X, Y, Z coordinates will be 0, 4, 0, indicating no progress along the length of the antenna, and a peak of +4" on the Y axis.

The angle between successive point of the hexagon is 60 degrees. Therefore, we can use the same subdivisions of each triangle that we used with the equilateral delta. The value of Y for the second point will be half the base, or 2". The height of the triangle will be the sine of 60 degrees (0.866) times the radius, which becomes the hypotenuse of the triangle. The result is 3.46 for the Z-axis. The value of X increases by 2", which is half the radius.

Continuing counterclockwise, the values for X increase regularly. However, the values for Y and Z are simple repetitions of the values already derived, with some sign changes depending on which side of the axis the value falls. Consequently, we can define our helical dipole with very few equations.

**Fig. 11** shows the equations page for the final helical dipole. The values used in the
equations are fussy beyond belief--simply because I wished the subsequent wires page to
have simple numbers. The radius is defined in terms of a wavelength at 28.5 MHz. The
extended decimal value is simply what was necessary to get a radius of 4.0000000".
Likewise, the value of 2*PI is carried out to many significant figures so that the
equation shown on the working line (B5) would yield exactly 2.000000". You may truncate
these values to practical sizes--if you are willing to live with longer decimals on the
wires page.

The equations page also involves a small fudge, intentionally placed there to illustrate a point. The denominator for variables B and C is 12. The number is the result of dividing 360 by 30. However, since the sine of 30 degrees = the cosine of 60 degrees, and vice versa, we simply assign the cosine of 30 to the Z axis and the sine of 30 to the Y axis to arrive at correct values. Familiarizing yourself with a little trig is very handy in antenna design. However, not in every case can you get away with doing something backwards.

The variables we have just defined complete one turn of the helix. The next question is how we create the total structure of the entire dipole.

**Fig. 12** partially reveals a wires page, showing the variables through wire 29 of the 56
total wires in the model. There are just enough lines to show the source assignments.
The wires table has some features we have not shown to this point.

Let's begin with the easy part. Note that the Y and Z columns repeat themselves periodically, in fact, every 6 lines. To create the first 6 lines in each column, we manually enter the variables. Then we copy that block of 6 lines in the column and paste them to the next six lines. We can continue to paste until we reach line 54, the last line divisible by 6. The final step is to copy only the first two lines and past them to lines 55 and 56.

Of equal ease is the specification of the wire diameter and material conductivity, since each can be selected in a single block operation encompassing all 56 lines of the model.

We have covered every part of the model except the progression of the helix along the X axis. Here we use another spreadsheet facility. We enter the values of X on line 1. Then we set an equation on line 2 for the X-entries that, in each case, references the first line box and the increment defined by variable D. The values for X1 occur in column B, so the first formula become =B1+D. Likewise, for X2, in the E column, we get =E1+D. The spread sheet knows to read "D" as a variable from the equations page and to read "B1" and "E1" as the values within the boxes with those names.

So much for the hard work. Spreadsheets have a special function that works this way. Let's place the heavily outlined box on line 2 and the column with the X1 values, which is B. We can now type CTL-C for "copy." The value goes to what Windows calls the "clipboard." Now, with the mouse, block the entire column from B3 (the next line) down to B56, the end of the model. Next, type CTL-V, which pastes the value on the clipboard to the boxes in the block. However, remember that this is a spreadsheet, and the special function is at work. Each new box value created will have the same form as the original formula: it will use the preceding B line and add D to it for the box at hand. Hence, the progression of values increases regularly from line 1 to line 56. We do the same for the X2 column, which is column E on the spreadsheet.

Had we wished to keep the precise value within box B2, we would have had to signal that with a special sign. On this spreadsheet, surrounding B1 with $s (dollar signs) fore and aft would have done the job. Other spreadsheets may use other symbols.

In the end, the laborious task of manually entering even the simple variables for the model is reduced to about a 5 minute job. As well, we have reduced the potential for entry errors of all sorts. If an error appears, we know to look back to the equations page or to the equations we entered on the variables version of the wires page. Hence, error correction also becomes a short-order task.

**Fig. 13** replicates the portion of the wires page shown in **Fig. 12**, but with the dimensions
rather than the variables. My fussiness with the equations makes this page easy to read
as an example. The increment of progression along the X-axis is clear, and we can
extrapolate that the total number of wires is 56, with a total antenna length of 112".
This value is under the 10' limit set out as a requirement for the antenna. As well, the
regular cycles of the turns in the helix are also clear, as they repeat themselves every 6
wires.

If we run the model at 28.5 MHz, we will obtain two values of impedance, each of which is about 12.68 + j2.69 Ohms. The impedance of the antenna for a single feed is simply the sum of the resistances and reactances: 25.5 + j5.4 Ohms, which is close to resonance. Although incidental to this exercise, the free-space gain of the helical dipole is 1.74 dBi, about 0.4 dB below a full length linear dipole for the same frequency. Helical dipoles are certainly usable, but even as open a helix as this one shows losses in dipole use. Had we tightened the increment or shrunk the diameter, we would have seen even lower gain.

Nonetheless, the helical dipole has allowed us to create an extensive structure using the equations and variables provisions of a spreadsheet entries page for our model geometry. Other types of equations are certainly possible for other geometries, but the trig relationships we used allowed us to draw out some of the features of spreadsheet use. As well, the long repetitive structure of the helix gave us the occasion to use some of the time-saving features that spreadsheets offer.

However, before we close the book on modeling by equations and variables, we have one more question to pose. When is maximum generality too much generality?

**Confining Our Models**

Suppose we wished to do a frequency sweep for the range from 28 to 29 MHz of the helical dipole we just designed for 28.5 MHz. Models designed by equations and variables are linked to the "Start" frequency (in the upper left corner of any of the screen captures shown) in NECWin Plus. Remember that we defined the variable A in terms of a wavelength and then defined the other variables in terms of the value of A. If we change the start frequency from the design frequency of 28.5 MHz down to 28 MHz, the dimensions of the antenna will change.

To preserve the dimensions of the design we just created, we must "freeze" it. This task
involves only one change in the equations page, and the change appears in **Fig. 14**.

Note that we have changed the value of A from a wavelength-dependent value to a constant. The value of 4 (inches) derives from the dimensions on the wires page that proved successful when we ran the model. Now, all of the other variables depend on the set value of A and are independent of the frequency. At this point, we can set the frequency sweep with a start frequency of 28 MHz, an end frequency of 29 MHz, and any desired interval for the sweep check frequencies.

Incidental to this exercise, but relevant to the modeling task at hand, is the fact that the Zo against which SWR will be calculated has been set to the design frequency source resistance for each of the sources. The resulting SWR curve will track a composite curve set to the value we might have used had we specified only a single source for the antenna. The helix, relative to the source resistance at or near resonance, shows a 2:1 SWR curve that is about 700 kHz wide, slightly reduced from the curve we might obtain from a full-length linear dipole of #12 AWG copper wire.

If our interest in this particular design goes beyond the modeling session, we should save the revised model under a new file name.

The upshot of this final move is to note that there are limitations to designing models by equations and variables for maximum generality. For every task, there is an appropriate level of generality somewhere between the maximum and, at the other extreme, specifying each dimension as simply a number on the wires page. It is not possible to specify in advance of knowing the task parameters what the proper level of generality should be. However, with some practice in both "normal" modeling with numbers and modeling with equations and variables, the modeler gains a sense of the level of generality that works best in each circumstance.

In these three episodes, we have certainly only begun the process of modeling by equations and variables. Next month, we shall close the series by looking at a pair of examples that show a. there is always more than one way to formulate a model via equations, and b. the scratch pad facility can come in handy at times.