Antenna Modeling with EZNEC and 4nec2: A Beginner’s Walkthrough

Building an antenna and hoping it performs as expected is how most hams start out, and it works fine for a simple dipole cut to a published length formula. Once the question becomes more interesting — how will this Yagi’s gain and pattern actually look at my install height, what happens to my vertical’s feedpoint impedance with four radials instead of sixteen, will this design actually clear the SWR I need across the whole band — modeling software answers those questions before a single piece of wire or aluminum gets cut. EZNEC and 4nec2 are the two programs most hams encounter, and this walkthrough covers what they actually do, how they differ, and how to avoid the mistakes that make a model’s output meaningless.
Why Model an Antenna Before Building It
Antenna modeling doesn’t replace the ARRL Antenna Book’s design formulas, a builder’s own experience, or the practical tradeoffs discussed in our first HF antenna guide, but it answers questions that a formula alone can’t: how gain and takeoff angle change with height above ground, how a ground plane vertical’s radial count affects feedpoint resistance, or how close two elements of a Yagi can be before interaction hurts pattern and gain instead of helping. It also lets a design be iterated cheaply — moving a wire endpoint or adjusting element spacing in software costs nothing, while doing the same on a real antenna up a tower is a genuine undertaking.
The NEC Engine Underneath Both Programs
Both EZNEC and 4nec2 are front ends built around the same underlying calculation engine: the Numerical Electromagnetics Code (NEC), originally developed at Lawrence Livermore National Laboratory and widely used in antenna engineering well beyond amateur radio. This matters practically: the two programs will generally agree closely on results for the same model, because the physics engine doing the actual calculation is fundamentally the same family of code. What differs between them is the user interface, workflow, licensing, and some of the convenience features layered on top.
EZNEC vs 4nec2
| Aspect | EZNEC | 4nec2 |
|---|---|---|
| Cost | Free basic version with paid tiers for larger models and more features | Free |
| Platform | Windows | Windows (runs under Wine on other platforms with varying success) |
| Interface style | Considered more polished and beginner-friendly by many users | More utilitarian, feature-dense interface |
| Model size limits | Free version limits segment/source counts; paid versions raise them | No equivalent licensing limit |
| Optimization tools | Available in higher tiers | Built-in optimizer included free |
| Community and tutorials | Long-established, extensive third-party tutorials | Large user base, especially popular for free access to full feature set |
Neither is strictly “better” — many experienced modelers use both, since a model built in one can often be adapted to the other with modest effort, and the free 4nec2 removes any cost barrier to trying antenna modeling for the first time.
A Basic Modeling Walkthrough
The steps below outline the general workflow common to both programs, though exact menus and dialog names differ between them.
1. Define the Geometry
Wires are entered as start and end coordinates plus a diameter, building up the physical structure — a simple dipole is just two wires (or one wire with a center source), while a Yagi adds parallel director and reflector elements at specified spacings. Wire diameter matters more than beginners expect: using an unrealistically thin or thick wire diameter compared to the actual material shifts the modeled resonant frequency and impedance, so match the modeled diameter to the real conductor being used.
2. Set the Source and Frequency
A source (feedpoint) is placed on a wire segment, and a frequency or frequency sweep is specified. Running a sweep across a band, rather than a single frequency, is what produces a usable SWR-vs-frequency curve instead of a single data point.
3. Choose a Ground Type
Ground modeling is one of the most consequential and most frequently mishandled settings. “Free space” ignores ground entirely and is appropriate only for antennas genuinely far from any ground influence (rare for typical amateur installations). “Perfect ground” is an idealized, lossless reflector that overstates real performance, especially for low-angle radiation important to DX work. “Real/lossy ground,” with a soil conductivity and permittivity appropriate to the actual install site, gives the most realistic result for most home station modeling and should be the default choice unless there’s a specific reason to use another type.
4. Run the Model and Read the Outputs
Key outputs include the far-field pattern (showing gain and directivity, both azimuth and elevation), feedpoint impedance (real and reactive components, from which SWR relative to the feedline’s characteristic impedance is derived), and gain figures typically expressed relative to a theoretical isotropic radiator or a dipole. Elevation pattern is particularly informative for HF antennas since it shows the takeoff angle — the vertical angle where the antenna radiates most strongly — which strongly affects DX performance and is something a formula-only design approach can’t reveal.
Using an Optimizer Without Fooling Yourself
4nec2 includes a built-in optimizer that can automatically adjust chosen parameters — element lengths, spacings, or a wire’s position — to maximize gain, minimize SWR, or balance several goals at once across a specified frequency range. This is a genuinely powerful feature, but it comes with a real trap: an optimizer will happily converge on a mathematically excellent result that’s physically impractical or unrealistic, such as element spacings so tight they’d be difficult to build, or a design so narrowly optimized for one exact frequency that it becomes unstable across the rest of the band. Constraining the optimizer’s allowed ranges to physically sensible values, and checking the optimized result’s bandwidth and mechanical practicality afterward rather than accepting the raw output, keeps the process useful rather than misleading.
A related discipline worth adopting early: save and label variations of a model as you experiment, rather than repeatedly overwriting a single file. Comparing a height-above-ground sweep, or several radial-count variations for a ground-mounted vertical, side by side is far more informative than remembering what last week’s numbers were from memory.
Common Modeling Pitfalls
| Pitfall | Why It Matters |
|---|---|
| Too few segments per wire | NEC’s accuracy depends on adequate segmentation; too coarse a model gives unreliable impedance and pattern results |
| Wrong ground type for the situation | Perfect ground overstates low-angle gain; free space is wrong for anything near real earth |
| Unrealistic wire diameter | Shifts modeled resonance and impedance away from what the real antenna will do |
| Ignoring nearby structures in the model | A real installation near a house, tower, or other metal structure behaves differently than an idealized isolated model |
| Trusting a single frequency point instead of a sweep | Misses how SWR and pattern actually vary across the band of interest |
What Modeling Can’t Tell You
A model is only as good as its inputs, and several real-world factors are difficult or impossible to model precisely: actual soil conductivity at the install site (measured values are rarely available and default library values are approximations), nearby structures, trees, and buried utilities that a simplified model omits, and construction tolerances like actual wire sag or slightly different element lengths than specified. Modeling predicts trends and relative comparisons — this design should outperform that one, this height should improve low-angle radiation — more reliably than it predicts exact real-world numbers. Treat a model’s absolute gain figure, feedpoint impedance, or resonant frequency as a well-informed estimate rather than a guaranteed outcome, and treat comparisons between two model variants, run with identical assumptions, as the more trustworthy result. Comparing a model’s SWR prediction against a real, on-air measurement, discussed from the measurement side in our guide to what an SWR meter tells you and what it hides, is the natural next step after a design looks promising on screen.
Frequently Asked Questions
Do I need to learn NEC file syntax directly?
No. Both EZNEC and 4nec2 provide a graphical interface for building models without writing raw NEC card syntax by hand, though understanding what’s happening underneath helps when troubleshooting unexpected results.
Which is better for a first antenna model, EZNEC or 4nec2?
4nec2’s free full feature set removes any cost barrier, making it a common starting point. EZNEC’s interface is considered friendlier by many users, and its free tier is enough for simple models like a basic dipole or vertical before hitting its segment limits.
Can modeling replace real-world antenna testing?
No. Modeling is excellent for comparing design options and understanding trends before committing to a build, but real ground conditions, nearby structures, and construction details mean on-air testing and measurement remain necessary to confirm actual performance.
How accurate is the “real ground” model compared to my actual soil?
Reasonably close for typical soil types using standard conductivity and permittivity presets, but not exact without a genuine soil conductivity measurement at the site, which most hams don’t have. It’s still far more realistic than assuming perfect or free-space ground.
Why does my modeled SWR differ from what I measure after building?
Common causes include actual ground conditions differing from the model, nearby objects not represented in the model, wire diameter or length differences from construction tolerances, and feedline or connector effects the model doesn’t include at all.
Is antenna modeling only useful for beams and arrays?
No, even a simple dipole or vertical benefits from modeling height-above-ground effects, radial count sensitivity for verticals, and expected takeoff angle, all of which affect real performance beyond what a basic length formula captures.
Can I model a Yagi with a rotator and multiple heights?
Yes, height above ground is a standard model parameter, and comparing the same design at several install heights is a common and useful exercise before finalizing a tower or mast plan.
The Bottom Line
EZNEC and 4nec2 both put a genuinely capable antenna modeling engine within reach of any ham willing to spend an evening learning the workflow, and 4nec2’s free full feature set means cost is no longer a real barrier to trying it. The payoff isn’t perfectly predicting real-world numbers — ground conditions and nearby structures see to that — but comparing design options, understanding how height and ground type change performance, and catching an unrealistic design before it becomes an expensive tower project. Start with a simple, known design like a basic dipole to learn the workflow, verify the model reproduces expected textbook behavior, then apply the same process to the actual antenna in question.