Antenna modelling with genetic algorithms.

Antenna modelling with genetic algorithms.

Author: Onno (VK6FLAB) July 5, 2025 Duration: 5:08
Foundations of Amateur Radio

Recently I was helping a friend erect their newly refurbished multi-band antenna and during the process we discussed the notion of tuning an antenna that's high in the air. They made a curious response, in that they'd tuned the antenna on the ground before we started.

I asked how this would work, since as I understand the process, this changes things once it gets in the air. They assured me that while the actual SWR might change, the frequencies at which it was resonant would not.

This was news to me because I've been putting off erecting my own multi-band 6BTV antenna mainly because I didn't really want to face having to erect it, tune it, lower it, modify the elements, erect it, tune it, etc., all whilst standing on the steel roof of my patio. Would this phenomenon be true for my antenna?

It occurred to me that I could test this idea, not only for my antenna, but for other antennas as well. In my minds-eye, I saw a video displaying the pertinent attributes of an antenna, SWR, gain, radiation pattern, and whatever else I could think of, animated with the modifications of things like height and ground radials.

If this sounds familiar in some way, it's because I've been here before. This time the outcome was slightly different, since I found a tool that can optimise antennas using a genetic algorithm. What I mean by that is an automated process where you can test variations of a thing, in this case antennas. Rather than design each antenna and test it, you essentially generate antenna designs and tweak them to determine the best one. Then you use that to generate the next series of designs. Rinse and repeat until you have what you're looking for. There's a whole field of computer science dedicated to this and unsurprisingly the rabbit hole goes deep.

The tool is called "xnec2c-gao" and it's written by Maurizio DC1MDP. The name of the tool hints at its nature, working in combination with "xnec2c", written by Neoklis 5B4AZ and maintained by Eric KJ7LNW, you'll find links to both tools on the xnec2c.org website.

How the two tools work together is a beautiful dance. The antenna modelling tool, xnec2c, can read an antenna definition file and detect if it changes, at which point it can redo the simulation, which it can output to another file. The genetic algorithm optimisation tool, xnec2c-gao, can detect the changed output and update the antenna definition file, and the process repeats. Which brings me to a pro-tip, for this to work, you need to configure xnec2c to do two things, detect the changed definition file, and write the output to CSV, both of these options can be found in the "Optimization Settings" menu, just so you don't spend an hour banging your head against the desk.

Between the two tools, the antenna definition evolves and you end up with a design optimised for your purpose. The default does this for SWR and gain. Mind you, I tested a multi-band dipole which managed to find some interesting designs, but didn't pick them because a low SWR combined with a high gain, for reason't I don't yet understand, wasn't considered better than a high SWR with a high gain, so there's some work to be done. As a software developer I have a sneaking suspicion that it's adding the two, rather than picking the highest gain combined with the lowest SWR, but I haven't confirmed that. As I said, deep rabbit hole.

While we're not yet at the video display stage, for the first time I can get a sense that this might come to pass. There's plenty of work to be done. For example, the antenna display on xnec2c during the process seems broken, there's no way to output gnuplot files during the process, and capturing the various charts in real-time will require work, but all that seems if not easy, at least possible.

Meanwhile, I'm attempting to locate an antenna definition file, preferably in .NEC format for my 6BTV antenna, so I can use this combination of tools to discover if tuning it on the ground will work and while I'm at it, discover if the installation I'm working on will give me something worthwhile.

I realise that this is well beyond "try it and see", but my body isn't up to climbing up and down ladders 17 times in a day and I think that getting a feel for what might occur is a good way to learn.

When was the last time you climbed on a roof and what did you do to avoid it?

I'm Onno VK6FLAB


For anyone curious about the crackle of a distant voice emerging from the static or the thrill of making a contact across the globe using nothing but radio waves, Foundations of Amateur Radio offers a friendly, steady guide. Hosted by Onno (VK6FLAB) from Australia, this long-running podcast acts as a companion for newcomers navigating the initial, often overwhelming, steps into this vast hobby. Each episode deliberately unpacks a single facet of amateur radio, breaking down technical concepts, equipment, and operating practices into digestible pieces. You'll hear practical advice on how to get started, find your place within the global community, and discover which of the hobby's countless avenues-from building antennas to satellite communication or emergency service-might spark your passion. It’s not about dry theory; it’s about demystifying the process and sharing the genuine rewards that keep enthusiasts engaged for a lifetime. Having evolved from its earlier incarnation in 2011, this podcast builds from the ground up, week by week, creating a solid resource that grows with you. Tune in for a down-to-earth conversation that makes the airwaves feel a little more accessible and a lot more inviting.
Author: Language: en-au Episodes: 100

Foundations of Amateur Radio
Podcast Episodes
Transmitting into a dummy load .. for a year .. on purpose. [not-audio_url] [/not-audio_url]

Duration: 8:34
Foundations of Amateur Radio Just under a year ago I started an experiment. I set-up a beacon for WSPR, or Weak Signal Propagation Reporter, transmitting at 200 mW into a dummy load using eight bands between 80m and 10m.…
How to become a radio amateur today? [not-audio_url] [/not-audio_url]

Duration: 6:02
Foundations of Amateur Radio The other day a fellow amateur revealed that they qualified for membership of the QWCA, the Quarter Century Wireless Association .. twice over .. there may have been some innocent whistling i…
Building a shack: Part 8 - Will it ever end? [not-audio_url] [/not-audio_url]

Duration: 3:45
Foundations of Amateur Radio Building a shack makes a number of assumptions about your situation and to make it abundantly clear, it's not the only way to enjoy the hobby of amateur radio. Visiting clubs locally and remo…
Building a shack: Part 7 - Powering your shack [not-audio_url] [/not-audio_url]

Duration: 8:15
Foundations of Amateur Radio On your amateur radio journey, you'll likely discover that many transceivers run on 13.8 volt DC, give or take. For example my FT-857d requires 13.8 volt plus or minus 15 percent, with a nega…
Building a shack: Part 6 - Noise [not-audio_url] [/not-audio_url]

Duration: 8:05
Foundations of Amateur Radio Noise la la la la la hinders if I were a rich man effective a noise annoys an oyster communication but a noisy noise annoys an oyster more. Or said differently, when you're trying to communic…
Building a shack: Part 5 - Antenna Shenanigans [not-audio_url] [/not-audio_url]

Duration: 5:40
Foundations of Amateur Radio Putting your station together is best described as a juggling act, since you'll discover that everything depends on everything else and the more you plan, the more you learn and the more vari…
Building a shack: Part 4 - coaxial cable alternatives [not-audio_url] [/not-audio_url]

Duration: 5:55
Foundations of Amateur Radio When you start the process of getting your hobby off the ground, either for the first time, or after a hiatus, you might be left with the impression that the only way to "do amateur radio" is…
Building a shack: Part 3 - the ingress of coaxial cable [not-audio_url] [/not-audio_url]

Duration: 9:40
Foundations of Amateur Radio One of the potentially trickier aspects of putting together your shack is connecting the radio to the antenna. On the face of it, the challenge is limited to making sure that you have mating…
Building a shack: Part 2 - How much space do you need? [not-audio_url] [/not-audio_url]

Duration: 7:27
Foundations of Amateur Radio When you start on the journey of putting together a shack, in whatever form that eventually takes, you'll need to figure out how much space is required. Of course, no matter what you choose,…
Building a shack: Part 1 - Setting the Scene [not-audio_url] [/not-audio_url]

Duration: 7:21
Foundations of Amateur Radio Recently it occurred to me that I haven't been using HF in my shack for much longer than I'd care to admit. Over the years I've spoken about my shack and how it's set-up, more on that shortly…