Select Page

TERA has been under active development and verification for almost a year. From the start, I made heavy use of Anthropic's Claude Code for research, code development and verification. I've placed a summary of my learnings using Claude Code for development at the end of this post. What I learned is relevant to anyone using AI to develop software, especially software aimed at the Ham Community.

My initial efforts focused on developing a 2D ray tracer (the same method used by HFTA). I started from the published papers describing the Uniform Theory of Diffraction. The initial tracer was tested against HFTA, Brian Beezley's (K6STI) TA, and with much help from Dr Jim Breakall, WA3FET, against Altair's FEKO (a commercial full-wave electromagnetics solver).

We started with simple terrain profiles designed to explore reflection, single diffraction and multiple diffraction. The results were encouraging, matching within 1 dB or less.  TERA's 2D ray tracer matched TA and FEKO within these limits. But some HFTA results were puzzling and didn't match TA or FEKO.

Real-world terrain profiles were another matter. Using profiles generated by the K6TU.NET terrain service, I compared results from TERA against HFTA and TA. For many profiles, TERA and TA were within 2-3 dB of one another but HFTA results were often widely different.

By chance, I found an azimuth from one site that caused TERA to show a 22.5 dBi gain response at 1 degree.  This was physically impossible for the isotropic source used in the evaluation. Something was clearly wrong.

Detailed analysis showed the spike came from multiple, closely spaced terrain points, each treated as a diffracting edge. At grazing angles their diffraction products added in phase.

UTD assumes each edge stands alone, well clear of the antenna and of its neighbours. Here that assumption failed. The answer was many dB too high with nothing in the output to show it.

I spent several weeks reviewing different published papers on handling single and higher order diffraction. I tried several approaches but none tamed the spike.

Looking at different locations, I found that almost every location had one, sometimes several, sometimes many azimuths that showed the same problem.  Clearly a different solution was needed.

The answer was a full-wave solver - solving Maxwell's equations for the field induced in the terrain by the antenna and finding the far-field result. I used Claude Code to develop a 2D Method of Moments (MoM) solver from scratch. I wanted a solver that I could use to evaluate solutions to TERA's ray tracing solution. I knew that MoM would be a much heavier compute approach and expected it to take a long time to run. Imagine my surprise when I found it ran in under a second for my initial test fixtures!

MoM went on to replace the ray tracer as TERA's engine.

Verifying the MoM solver

I started testing using the simple profiles. On those, MoM, TERA's 2D ray tracer and TA showed the same results. But as the spike from the 2D ray tracer had shown, these weren't a robust test. Results over real terrain are impossible to prove as there is no exact answer to check against. What could be done was to check the solver against problems with known results, compare it with independent results and document its limitations.

TERA's MoM solver was checked four ways. The first was against problems with an exact answer: flat ground, a curved bump on a ground plane and a lossy cylinder. All these have analytic solutions against which the solver was checked. At the settings TERA Online uses, the error is 0.2 to 0.9 dB near the pattern peak.

The second came from Dr Breakall. In 1994 Gerald Burke of Lawrence Livermore National Laboratory, a co-author of NEC, published patterns over a Gaussian hill and over the Cedar Valley, UT terrain where Dr Breakall and colleagues made their measurements. Burke generated the patterns from the same kind of solver as TERA's MoM solver. The report doesn't include his code, so TERA was compared against the figures included in the report. The TERA MoM solver agrees with the pattern shape in every case. It agrees in absolute level to a median of 0.18 dB on 31 of the 32 test cases. Chasing the remaining differences found two defects in the MoM solver, both now fixed.

The third was measurement. Jim and his colleagues measured elevation patterns at Cedar Valley, UT using a helicopter and different antenna configurations.  The TERA MoM solver matches the measured shapes to 1.2 to 4.2 dB RMS, the same agreement Burke's model reached. Jim advises the TERA project. The Cedar Valley measurements predate TERA and are used as published.

The fourth was TERA Online itself. The checks were repeated at the settings used by the web service, the TERASweep utility (for generating an antenna model by antenna/band), and a command line utility. That found two faults in how terrain was fed to the solver. Both are now fixed.

I used Claude to write up the results of both verification efforts: the known solutions and the comparison against the Burke report.

AI Critique

AI tools can provide feedback on AI generated results. You can use the model that wrote the code, or a different one (ChatGPT, Gemini etc.). I asked Anthropic's Claude Opus 5.5 to critique the verification reports, six times over. This is not an independent expert review. Each round found issues with the reports. I checked every issue raised against the code or calculations before accepting or rejecting. This test cycle found real problems, including the two terrain input faults described above. All six critiques are included as references alongside the reports.

HFTA, and hence OpenHFTA

Many Hams evaluate the tower/antenna system using HFTA, written by Dean Straw, N6BV, and distributed with the ARRL Antenna Book. It was a big step forward when it was released, and Dean was candid about its limits. His manual estimates accuracy at ±3 dB and warns of artificial spikes at particular heights.

I compared HFTA with TERA using HFTA's own calculation engine, the YTWCore.dll released in 2003. The comparison covers three sites and 100 randomly drawn US stations, on 40, 20, 15 and 10m, with Yagis from 30 to 100 ft. There is no exact answer on real terrain, so these are differences between the two programs and not errors against the truth.

Above ~10° the two agree within ~1 dB. Over flat ground HFTA is inside Dean's own ±3 dB.

The lowest angles are a different story. At 1 to 3° HFTA reads optimistic at most stations, by a typical 5.4 dB on 40m, 2.8 dB on 20m, 1.4 dB on 15m and 0.6 dB on 10m. HFTA also shows about HALF the low angle gain that extra height buys: ~0.7 dB per 10 ft against TERA's 1.2 to 1.5 dB. That held at 92 to 97 of the 100 stations. HFTA's profile stops at 4.41 km. At one site a ridge 7.5 to 9.5 km out cost up to 10 dB that HFTA could not see.

The low angle errors are not programming errors on Dean's part. They are the limit of ray tracing at grazing angles, the same limit that produced TERA's spike. TERA's own ray tracer overstated low angle gain by more than HFTA on one of the worst bearings in the study.

OpenHFTA is a reverse engineered version of the HFTA DLL, so the same findings apply to it. A new interface or newer elevation data doesn't change the underlying physics.

If your interest is high angle work, your HFTA analysis probably stands. If you are chasing DX requiring low angle paths, especially on 40m, rerun your site in TERA. Expect less low angle gain and more benefit from height.

Software Development using AI

"With great power comes great responsibility."

AI is an amazing tool for software development. I use Claude extensively both personally (as in my work on TERA) and professionally. Claude is my current preferred model.

Claude writes code faster than I can review it. The bottleneck isn't writing the code, it's checking it. Even with careful prompting, it makes mistakes. It will state a guess with the same confidence as fact. More than once it gave me a convincing explanation but retracted it when challenged.

Verification is critical. Every test needs a version that you know is wrong. Tighten tolerances as AI iterates on the code. Loose tolerances can hide real defects.

AI does not absolve the developer from knowing the underlying physics. If you cannot say how your program could be wrong, and how you have tested it, you do not know whether it is right. That applies to ANY software written for the Ham Community, with or without AI.

Closing out...

Developing TERA has been a fascinating journey. I learnt a lot as it forced me deeper into the physics and the field of evaluating antenna performance over real terrain. Using AI has been a real eye-opener, both in learning how to use it and seeing how widely it can be applied.

AI was pivotal for TERA's development, but all the engineering choices, the application of physics and conclusions, are mine.

The TERA verification reports are free to download and include a description of TERA's limitations. Start with the summary:

My sincere thanks to Dr Jim Breakall for his guidance throughout.