Skip to main content

Antenna Modeling Tutorial: NEC-2 Online, Step by Step

A guide to the antenna modeler: what every field means, how to read the results, and how to get from an empty model to a drawing to build from. At the end, three antennas are computed step by step: a dipole for 40 m, a vertical for 20 m and a three-element Yagi.

The program runs in a browser tab, with nothing to install, and remembers the model between visits. Every name in it has a pop-up hint: rest the pointer on it, and it tells briefly what this guide tells at length.

The window​

  • The top bar — the name of the model, files, templates, undo, language, theme, hints, the PDF sheet and the main button, “Compute”.
  • The editor on the left — wires (or elements), sources, loads, frequency, ground and material.
  • The results strip above the tabs — the main numbers of the last computation.
  • The workspace — the tabs “View and patterns”, “Currents”, “Sweep”, “Matching”, “Optimizer” and “NEC-2 report”.

The ↗ button in the corner of any card spreads it over the whole workspace, and Esc puts it back. On a narrow screen everything goes into one column, and the tabs wrap into a second row.

A first antenna in a minute​

  1. Press “Templates…” in the top bar, choose an antenna, give the frequency and the height it hangs at, and press “Create”. The program builds the antenna and cuts it to resonance.
  2. Press “Compute” or Ctrl+Enter. The input impedance, the SWR and the gain appear at the top, the radiation patterns on the right.
  3. On the “Sweep” tab, press “Sweep”: you see the band where the SWR stays below 2, and the impedance on a Smith chart.

Then change the model — a length, the height, the ground — and compute again. The “Keep for comparison” button leaves the earlier result dashed beside the new one.

The top bar​

ButtonWhat it does
Model nameThe name of the antenna. It heads the PDF sheet and names the saved files.
OpenOpens a file of this program (.json) or of MMANA (.maa). After an MMANA file, notes above the editor say what could not be taken over and what was taken instead.
SaveSaves the model as .json: wires, sources, loads, ground, material, sweep range — all of it.
.maaWrites the model as an MMANA file. The sweep range and the parameters of a real ground do not go into it, and a conductivity of your own becomes the nearest metal; a note says so.
.necWrites a deck of NEC-2 cards for 4nec2, xnec2c and other programs.
Templates…Builds a ready antenna from a few numbers — see Templates.
↶ ↷Undoes and redoes a change of the model: Ctrl+Z, Ctrl+Shift+Z or Ctrl+Y. It remembers 100 steps; changes made within a second of each other are one step.
⛶Only on the site: the program takes the whole window, over the menu, the sidebar and the footer, and a list of languages and a theme switch appear in it. The same button gives it all back.
LanguageUkrainian or English: labels, messages, hints and the PDF sheet.
ThemeLight or dark. At first, that of the system.
HintsTurns the pop-up hints on and off. Names with a hint are underlined with dots.
PDFA sheet for building: in the print dialog, choose “Save as PDF”.
ComputeComputes the model with the NEC-2 engine at the frequency of the model. While it computes, the button becomes “Stop”.

The program remembers the language, the theme and the hints in this browser. Embedded in a site — like the tool page of this blog — it takes the language and the theme of the site and shows no switches of its own for them until it is spread over the whole screen.

Templates​

A template builds an antenna from a few numbers and cuts its driven element to resonance with the NEC-2 engine itself — at the height and over the ground of the model. So the antenna is resonant where it will hang, not in free space. The ground, the wire material and the line come from the current model; the wires, sources and loads are replaced. Ctrl+Z brings the earlier model back.

AntennaThe height is the height of…Good to know
Dipolethe wire itselfA horizontal wire half a wavelength long, fed at the centre. It radiates both ways, across the wire, at 60–80 Ω.
Inverted Vthe apexA dipole with its ends 30° below the horizontal: one mast is enough. 50–70 Ω.
Vertical with radialsthe baseA quarter-wave radiator and four radials 45° down. Alike all round at a low angle, near 50 Ω.
Delta loopthe apexA triangular loop a wavelength around, apex up, fed at the middle of its bottom side. Over 100 Ω — it needs a transformer.
Quadthe centre of the loops1–3 square loops on a boom. One radiates both ways; a reflector and a director make it directional. 90–130 Ω.
Yagithe boom2–6 elements, sized for a 50-ohm cable without matching.
  • Frequency, MHz — where the driven element has no reactance. The template sets the sweep range to ±4 % around it.
  • Height — the height above the ground of the point the antenna hangs from; the name of the field says which point. It becomes the “Add height” of the model, so the antenna can later be raised or lowered without touching the wires. If the lowest point of the antenna would come close to the ground, the template says how high to hang it. In free space there is no such field: the height changes nothing there.
  • Wire diameter, mm — the diameter, not the radius. For a Yagi of tubes on HF, 15–25 mm. A thicker wire makes an antenna a little shorter and its band wider, and the template allows for it.
  • Elements — for a quad and a Yagi.

The dimensions of the Yagis and quads were found by the program itself: a search for the most gain with a given front/back and an SWR up to 1.5 over ±1.5 % around the frequency. In free space:

AntennaGainFront/back over ±1.5 %Boom
Yagi, 2 elements6.1 dBifrom 10 dB0.17 λ
Yagi, 3 elements7.5 dBifrom 20 dB0.34 λ
Yagi, 4 elements8.4 dBifrom 20 dB0.42 λ
Yagi, 5 elements10.7 dBifrom 22 dB0.8 λ
Yagi, 6 elements11.4 dBifrom 22 dB0.96 λ
Quad, 2 loops7.2 dBifrom 15 dB0.15 λ
Quad, 3 loops8.4 dBifrom 20 dB0.39 λ

Over a ground the gain is 4–6 dB higher: the reflected wave adds to the direct one.

Wires​

Every row of the table is a straight wire. An antenna of any shape is made of such pieces.

ColumnWhat it is
X1, Y1, Z1The start of the wire, in metres.
X2, Y2, Z2The end of the wire, in metres. The Z axis points up.
R, mmThe radius of the wire — half the diameter. For a tube 20 mm in diameter, write 10.
SegsHow many segments NEC-2 divides the wire into. −1 lets the program choose, about 40 per wavelength; the grey number on the right shows how many it took.
×Removes the wire. The sources and loads of other wires stay on their wires.
  • Wires are joined when their ends have exactly the same coordinates. The two wires of the inverted V in the screenshot meet at the point (0; 0; 0) — the apex.
  • Over a ground, Z counts from its surface, and “Add height” is added to it. In the templates the point the antenna hangs from is at Z = 0 and the height is in “Add height”: a negative Z in the table means “below that point”.
  • The decimal sign is a comma or a point. “Add wire” repeats the last row.
  • Limits: up to 3000 segments in all; a segment must be longer than eight radii of its wire, or a warning appears; a wire cannot go under the ground.

Elements​

The “Wires / Elements” switch above the table shows the same model by its elements, like the Yagi editor of MMANA. An element is a wire or several wires in one line, such as telescoping tubes.

  • Length changes symmetrically about the centre: only the ends move, the joints of the tubes stay.
  • Centre (X, Y, Z) moves the whole element, with the ends of the wires joined to it.
  • Diameter, mm — the diameter here. An element of tubes of several diameters lists them from the centre out; they are changed in the wire table.
  • Copy puts the same element beyond the last one at the same spacing — a new director. Sources and loads are not copied.

Sources​

A source is a feed point. Its place is written as in MMANA:

NotationWhere
w1cthe centre of wire 1
w1bthe beginning of wire 1
w1ethe end of wire 1
w1c22 segments from the centre towards the end
w1c-22 segments from the centre towards the beginning
w1b11 segment from the beginning

On the joint of two wires the source sits exactly on the joint, as in MMANA. That is how an inverted V is fed at its apex: w2b is the beginning of wire 2, where wire 1 ends.

  • Phase, ° — the phase of this source against the others. Phased antennas need it: an HB9CV, for example, is fed at 0° and 135°. With one source it changes nothing.
  • Voltage, V — with one source it only scales the currents. With several, it sets their ratio. Zero turns the source off.

Loads​

A load is a coil, a capacitor, a trap or a resistor at a point of a wire. Its place is written as for a source.

  • LC — a coil (L, µH), a capacitor (C, pF) or both in parallel, a trap: its resonant frequency is shown on the right. Zero means there is no such part. The reactance of a coil grows with frequency, so the sweep computes it again at every frequency.
  • Q — the losses of the coil, or of the capacitor without a coil: 0 for none, 100–300 for ordinary coils, 200–400 for the air-wound coils of traps.
  • R + jX — an impedance that is the same at every frequency: for example, the resistor of a T2FD or a rhombic.

On the joint of two wires a load is split in half between the segments of the joint, and the program makes the segment under it short — so a trap acts as a lumped part, not one smeared over a segment.

Frequency, ground, material​

  • Frequency, MHz — the frequency of the computation. The automatic segmentation depends on it too.
  • Move to a frequency… — scales the whole antenna to another frequency, as MMANA does: every length and the height are multiplied by the old frequency over the new one. Coils and capacitors get values with the same reactance, and the sweep range moves with the frequency. With “with the diameters” checked the antenna is electrically the same; without it the resonance moves a little.
  • Line, Ω — the impedance of the feed line. Only the SWR depends on it, not the impedance of the antenna: 50 for an ordinary coaxial cable, 75 for a TV cable, 12.5 or 28 for a Yagi with a DK7ZB match, about 300 for a folded dipole.
  • Wire material — the losses in the metal: lossless, copper (58 MS/m), aluminium (35 MS/m) or a conductivity of your own (brass about 15, stainless steel about 1.4). It shows for short antennas, magnetic loops and thin wires; for a full-size copper antenna it is a fraction of a percent.
  • Leeson correction — appears when the model has elements of tubes of several diameters. NEC-2 computes the steps between such tubes poorly, and the resonance of a Yagi element moves by percent. The correction replaces the element with a uniform cylinder of the same resonance — the method of D. Leeson, the same as in EZNEC. The drawing and the PDF keep the real tubes.

Ground — what is under the antenna:

ChoiceWhen
Free spaceThe antenna is far from everything; the pattern is a whole sphere.
PerfectA lossless conducting plane.
RealSoil with a permittivity and a conductivity, by the Sommerfeld method. The most accurate for low antennas.

MMANA computes the input impedance over a perfect ground. Here it is computed over the real one, which is more accurate, especially below a quarter of a wavelength: for a 20 m dipole 3 m up, 58 − j3 Ω instead of 39 + j12 Ω.

  • Add height, m — added to the Z of every wire, like “Add height” in MMANA.
  • Permittivity ε: dry sandy soil 4–5, average soil 13, wet soil 20–30, fresh water 80, sea water 81.
  • Conductivity, S/m: poor soil (city, rocks) 0.001, average 0.005, good (black earth, marsh) 0.01–0.03, sea water 5.

Results​

NumberWhat it meansHow to read it
Input impedanceThe impedance at the feed point: resistance R and reactance jX.X = 0 — resonance. X > 0 — the antenna is too long (inductive), X < 0 — too short (capacitive).
SWRThe standing wave ratio against the “Line, Ω” field.1 is a perfect match, up to 1.5 is good, 2 is the usual edge of the working band, above 3 needs a matching unit.
GainThe greatest gain over an isotropic radiator, dBi.Over a dipole: dBd = dBi − 2.15. Over a real ground its reflection and losses are included.
Front/backThe gain ahead over the gain straight back, at the same angle.MMANA takes the worst value over the whole rear sector, so its number can be lower.
Elevation angleThe angle of the maximum above the horizon.For long-distance HF, 5–20° is wanted; for short distances (NVIS), high angles.
Azimuth of maximumThe direction of the maximum in the horizontal plane.From the X axis anticlockwise, seen from above: 90° is the Y axis.
EfficiencyThe share of the power not lost in wires and loads.Appears when the model has losses. Losses in the ground show in the gain.

With several sources, a table replaces the impedance and the SWR: the impedance, SWR and share of power of every source. If the model changes after a computation, the numbers fade: they belong to the earlier model.

View and patterns​

  • The view in space: the left mouse button turns it, the wheel zooms, the right button pans; “Show all” brings the camera back. Over a ground there is a grid with lines down to it from the ends of the wires.
  • The pattern in space comes out of the feed point. Its distance from there and its colour show the gain on a scale of 40 dB, as in the flat patterns.
  • Currents — curves over the wires: the height of a curve is the magnitude of the current there. At free ends the current falls to zero.
  • The horizontal pattern is the gain by azimuth at the angle of the maximum. The vertical pattern is in the plane through the maximum: 0° is the horizon towards the maximum, 90° the zenith, 180° the horizon behind. The outer ring is the greatest gain, rounded up; the other rings are 3, 10, 20 and 30 dB lower. Rest the pointer on a pattern to read it.

Currents​

The magnitude and phase of the current along every element. The currents are RMS values for 100 W fed in: what an RF ammeter would show at that spot, so they can be compared between antennas. Where the current is greater, the thickness of the wire and the quality of the coils matter more. The phase differences between the elements of a Yagi or a phased array are what make them directional.

Sweep​

  • From, To, Points — the frequency range in megahertz and the number of frequencies in it, 2 to 201.
  • Sweep computes the input impedance and SWR at every frequency. While it computes, the button becomes “Stop”.
  • Above the charts: the lowest SWR and the band where the SWR stays at or below 2, and for a directional antenna the gain and front/back over that band. An antenna for several bands has several. A band edge at the end of the sweep means the band goes on: widen the range.
  • SWR with dashed lines at 1.5 and 2, R and X, gain in the direction of the maximum at the model frequency, and front/back. The vertical tick is the model frequency. Rest the pointer on a chart to read it.

The Smith chart shows the input impedance at all the frequencies of the sweep at once. The centre is a perfect match to the line; the farther from the centre, the higher the SWR.

What is on itHow to read it
CirclesThe same resistance R; the labels on the horizontal axis are in ohms.
ArcsThe same reactance X: inductive above (+j), capacitive below (−j).
Dashed circlesSWR 1.5 and 2: inside a circle the SWR is lower.
Ring and hollow dotThe model frequency and the start of the sweep.

As the frequency rises, the curve usually turns clockwise, and the longer it stays near the centre, the wider the band.

Matching​

The tab takes the input impedance of the last computation and shows how to match the antenna to the line at the model frequency.

  • L network — a coil and a capacitor that turn the impedance of the antenna exactly into that of the line. There are usually two solutions, with part values and a diagram. The network is narrow: at another frequency it must be computed again.
  • Hairpin (beta match) — for a Yagi whose resistance is below that of the line: the driven element is shortened a little so that it becomes capacitive, and a hairpin — a piece of two-wire line, shorted at its end — goes across the feed point. The tab gives the reactance to shorten the element to, and the length of a hairpin of tubes of a given diameter and spacing.
  • Quarter-wave transformer — a quarter wave of cable between the antenna and the line. The ideal impedance of the piece is √(R·Z₀); a table gives the SWR with common cables, single and two in parallel, and the length for a velocity factor: 0.66 for solid polyethylene (RG-58, RG-213), 0.78–0.85 for foam, 0.95–0.98 for open two-wire line.

Optimizer​

The optimizer finds dimensions, loads and phases for the goals you choose — as in MMANA.

  • Variables: the length of an element (symmetric about its centre), its position along X, Y or Z, the L, C, R or X of a load, the phase of a source. Each has limits and a first step.
  • Goals with weights: gain (each decibel is a point), front/back (each 3 dB is a point, nothing above 30 dB), SWR (takes points away: SWR 1.4 costs 2 points, 2 costs 4, 4 costs 8), reactance (each 20 Ω off the target X costs a point), elevation angle (each 3° off the target angle costs a point). A weight of 0 turns a goal off; only the ratio of the weights matters.
  • How it searches: every variable in turn takes a step either way, and a step that improves the score is kept; when none does, the steps are halved. The best model shows at once, the search can be stopped at any time, “Restore the start” brings the starting model back, and Ctrl+Z undoes the whole search as one step.

For a hairpin, give the target X from the “Matching” tab, with the length of the driven element as the variable.

NEC-2 report​

The full text report of the engine for the last computation: structure, currents, input parameters, pattern. Useful to check a model or to compare it with another program built on NEC-2.

Comparing variants​

The “Keep for comparison” button under the results keeps the current result. Change the model — another size, height, an optimization or another antenna altogether — and compute again: the numbers of the kept variant stand under the current ones, and its patterns, sweep curves and Smith chart lie dashed on the same charts. Δ next to the gain and the front/back is the difference, “current minus kept”. To compare the sweep too, sweep the model before keeping it.

The PDF sheet​

The PDF button prepares a sheet for building and for a report: the frequency, ground and material, the results, a drawing of the antenna with the lengths of its elements and the spacings between them in millimetres, tables of elements, tubes, wires, sources and loads, both patterns, the last sweep and the matching. In the print dialog, choose “Save as PDF”. Results that are out of date are computed first. The sheet is always light, whatever the theme on the screen.

Files​

  • .json — the file of this program. It keeps everything.
  • .maa — a file of MMANA or MMANA-GAL. It opens with notes on what could not be taken over, and is written without the sweep range and the parameters of a real ground, which .maa does not hold. MMANA saves the frequency a model was made at, which may not be the one it was computed at: if the antenna in a file is far too small for its frequency, a note says which frequency it fits.
  • .nec — a deck of NEC-2 cards for other programs, with coils and capacitors written as such.

Between visits the model stays in the browser's memory, but to keep it for good, save it to a file.

Example 1. A dipole for 40 m, 10 m up​

  1. “Templates…” → “Dipole”, frequency 7.1, height of the wire 10, diameter 2 → “Create”.
  2. The table has one wire from (0; −10.164; 0) to (0; 10.164; 0): 20.3 m, radius 1 mm, segments −1 (the program divides it into 21). The source w1c is at the centre of the wire. “Add height” is 10 m, the ground is real and average: ε = 13, σ = 0.005 S/m.
  3. “Compute”: input impedance 79.5 − j0.1 Ω — resonance, almost no reactance; SWR 1.59 on a 50-ohm line; gain 6.02 dBi; elevation angle 66.7°.
  4. “Sweep” tab → “Sweep”: the lowest SWR is 1.59 at 7.072 MHz, and the band with SWR ≤ 2 is 6.943–7.234 MHz, the whole of the 7.0–7.2 MHz band.

What it means. Ten metres is only a quarter of a wavelength on 40 m, and such a dipole radiates mostly upwards: 66.7°. For contacts over 100–500 km (NVIS) that is just right; for long distances it is too high. Raise the antenna: type 20 into “Add height” and compute again — the angle drops to 29.4° and the gain rises to 7.32 dBi. The impedance becomes 68.1 − j28.3 Ω: the resonance moved with the height, so create the template again for the new height, or trim the length with the optimizer (the variable is the length of the element, the goal is reactance with a target X of 0).

Example 2. A vertical with radials for 20 m​

  1. “Templates…” → “Vertical with radials”, frequency 14.2, height of the base 5, diameter 2 → “Create”.
  2. Wire 1 is the radiator, from the base (0; 0; 0) up to (0; 0; 5.109). Wires 2–5 are the radials, from the base to (±3.613; 0; −3.613) and (0; ±3.613; −3.613): each also 5.109 m and 45° down. The source w1b is the beginning of the radiator, at the base where all five wires meet.
  3. “Compute”: 57.7 + j0.0 Ω, SWR 1.15; gain 0.76 dBi; elevation angle 18.6°; the horizontal pattern is a perfect circle.
  4. Sweep: SWR ≤ 2 over 13.634–14.792 MHz, the whole 20 m band with room to spare.

What it means. The low gain is not a fault: a vertical does not gather its energy in one direction but sends it all round at a low angle, where distant stations come from. The vertical pattern has two lobes near the horizon and a null at the zenith. The radials 45° down raised the impedance close to 50 Ω: with horizontal ones it would be about 25–35 Ω. Try another height of the base and watch the impedance and the angle change.

Example 3. A three-element Yagi for 20 m​

  1. “Templates…” → “Yagi”, frequency 14.15, height of the boom 12, diameter 20 (aluminium tubes), elements 3 → “Create”.
  2. Three wires of 10 mm radius along Y: the reflector, 10.736 m at X = −3.795 m; the driven element, 10.132 m at X = 0, with the source w2c at its centre; the director, 9.332 m at X = 3.417 m. The boom is 7.212 m.
  3. “Compute” (the first screenshot of this guide): 40.0 + j0.1 Ω, SWR 1.25 with no matching at all; gain 12.18 dBi; front/back 18.5 dB; elevation angle 23.3°; azimuth 0° — along the X axis, towards the director.
  4. Sweep: SWR ≤ 2 over 13.691–14.495 MHz (803 kHz), with a gain of 12.1–12.5 dBi and a front/back of 15.8–18.9 dB over that band.

What the third element gives. First create a two-element Yagi with the same fields, compute it, sweep it and press “Keep for comparison”. Then create the three-element one and compute again: the director adds 1.03 dB of gain and 7.3 dB of front/back, and lowers the impedance from 50.7 to 40 Ω — SWR 1.25 instead of 1.01 (the screenshot is in Comparing variants).

What next. The PDF button gives a drawing with dimensions in millimetres. If you build with telescoping tubes, enter them in the wire table as separate wires, and the Leeson correction allows for the joints. And the optimizer can raise the front/back at the band edges: the variables are the lengths of the reflector and the director, the goals are gain, front/back and SWR.

Tips​

  • Start from a template and change one thing at a time: that way you see what affects what.
  • Look at the sweep, not just at one frequency: the band matters more than a perfect SWR at a point.
  • Height changes everything: impedance, angle and gain, especially below half a wavelength. After changing the height, check the resonance.
  • A real ground matters for low antennas. A VHF antenna many wavelengths up does fine in free space — and computes faster.
  • Keep your variants in .json, and give .maa to MMANA users.
  • A model is not hardware. Wire insulation, mounts, masts and houses nearby move the resonance: tune the finished antenna with an analyzer.