# Part 1: Setting Up the Model

Geometry

The first step is to set up the geometry cards. The values are in meters. The Z values on the GW (Wire specification) cards could be used to set height above ground, but use a GM (Coordinate Transformation) card instead. That will make it easier to try different elevations. Also note that the antenna can not touch the ground (no Z=0.00 values, after transformed) even when a ground plane is not included in the calculation. At least one comment (CM) card and a comment end (CE) card are required.

CM yagi4elem_2m.nec - Geometry Control Cards for 4-element Yagi

CM Tag NS X1 Y1 Z1 X2 Y2 Z2 RAD

CE

GW 1 11 -0.504E+00 0.140E+00 0.00E+00 0.504E+00 0.140E+00 0.000E+00 0.005E+00

GW 2 11 -0.481E+00 0.520E+00 0.00E+00 0.481E+00 0.520E+00 0.000E+00 0.005E+00

GW 3 11 -0.453E+00 0.711E+00 0.00E+00 0.453E+00 0.711E+00 0.000E+00 0.005E+00

GW 4 11 -0.457E+00 1.091E+00 0.00E+00 0.457E+00 1.091E+00 0.000E+00 0.005E+00

GW 5 11 0.000E+00 0.000E+00 0.00E+00 0.000E+00 1.118E+00 0.000E+00 0.022E+00

GM 0 0 0.000E+00 0.000E+00 0.00E+00 0.000E+00 0.000E+00 1.000E+00 0.000E+00

GE 1

Check that it looks correct using xnecview:

$ xnecview yagi4elem_2m.nec

Program Control Cards

We'll start by looking at the antenna in free space and sweep the frequency over a range that should include the resonate frequency. Adding these cards to the end of the geometry cards will do the job:

EX 0 2 6 00 1.000E+00 0.000E+00

FR 0 9 0 0 1.400E+02 1.000E+00

RP 0 37 36 1000 0.000E+00 0.000E+00 5.000E+00 1.000E+01 0.000E+00 0.000E+00

EN 0 0 0 0

EX sets a voltage source at the middle segment of wire #2.

FR specifies that values should be calculated at 9 frequencies, starting at 140MHz, in steps of 1MHz.

RP specifies the radiation sampling pattern. In this case there are 37 steps, 5 degrees each, around the Y-axis (0-180 deg) and 36 steps of 10 degrees around the X axis. The fifth field is actually 4 separate values, each 1 or 0, that control the output format. Details are on the RP page of the NEC2 User's Manual.

Run NEC2 and display the results. I like to use a script, attached below, to automate the process a bit:

$ ./nec_run.sh yagi4elem_2m.nec

XNECVIEW 1.35

# freq. Zr Zi SWR gain f/b phi theta

140 25.019 -16.559 2.27933 9.03 9.91 90 90

141 27.935 -8.3439 1.8611 9.24 10.58 90 90

142 31.928 0.21067 1.56607 9.39 10.89 90 90

143 37.616 9.0631 1.42196 9.49 10.85 90 90

144 46.062 17.879 1.46112 9.55 10.56 90 90

145 59.053 25.391 1.63417 9.56 10.12 90 90

146 78.873 27.494 1.86763 9.54 9.61 90 90

147 103.7 13.494 2.11946 9.47 9.09 90 90

148 111.37 -25.63 2.37289 9.38 8.63 90 90

$