Skip to content

test: add a Sommerfeld deck close to the ground - #137

Closed
charlieh0tel wants to merge 1 commit into
tmolteno:masterfrom
charlieh0tel:sommerfeld-near-ground-upstream
Closed

charlieh0tel wants to merge 1 commit into
tmolteno:masterfrom
charlieh0tel:sommerfeld-near-ground-upstream

Conversation

@charlieh0tel

Copy link
Copy Markdown
Contributor

Summary

Adds testharness/data/sommerfeld_near_ground.nec: a horizontal half-wave dipole 0.02 wavelengths above a Sommerfeld ground (GN 2) with sigma 1e10. At that conductivity the ground is effectively a perfect conductor, so the answer should match the same geometry with GN 1 (R = 0.9168 ohms, average power gain 1.9953). The existing sommerfeld decks all sit at 3.8 wavelengths or higher and never reach this regime.

R (ohms) Average power gain
exact / GN 1 0.9168 2 (1.9953 on this angular grid)
nec2++ (master) 1.7594 1.0430
nec2c 1.3 1.7591 1.0431
aegnec2 (Fortran SOMNEC) 1.75954 1.04296

Every engine misses both limits by the same amount, so this documents a NEC-2 Sommerfeld limitation near ground, not a translation bug. Before e3f81e6 fixed the c_ggrid interpolation cache, nec2++ gave R = 0.924 and gain 1.980 here, close to exact, but only because of the stale coefficients that commit removed.

The deck matches data/sommer*.nec, so it joins SOM_TESTS. It is not in the default DO_TESTS, so make runs the same tests as before.

Test plan

  • Runs to completion on master with nec2++, nec2c 1.3 and aegnec2; numbers above are from those runs
  • Swapping the GN card to GN 1 gives R ≈ 0.9168 and gain 1.9953 in all three

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uri4eguGitqE1abazuTstd

The sommerfeld decks in data/ all sit at 3.8 wavelengths or higher, so
none of them reach the regime where NEC-2 stops meeting limits that have
closed-form answers.

This one is a horizontal half-wave dipole 0.02 wavelengths up over a ground
with sigma 1e10. At that conductivity the half-space is a perfect conductor,
so the deck should reproduce what the same geometry gives with GN 1 -- swap
the GN card to get it. With GN 1 every engine gives R = 0.9168 ohms and an
average power gain of 1.9953. Two quantities, each against an exact value:

  feedpoint R, against the GN 1 value
    nec2++   1.7594   (about 92 percent high)
    nec2c    1.7591
    aegnec2  1.75954

  average power gain, exactly 2 over a perfect conductor; GN 1 reads 1.9953
  in every engine, so 0.23 percent is the angular grid's own error
    nec2++   1.0430   (-47.85%)
    nec2c    1.0431
    aegnec2  1.04296

aegnec2 links the original Fortran SOMNEC and lands on the same numbers,
so this is what NEC-2 does here rather than something a translation
introduced. (nec2c is 1.3; aegnec2 is built from source.)

Before e3f81e6 fixed the c_ggrid interpolation cache, nec2++ gave R = 0.924
and gain 1.980 here, close to the exact values, but only because of the
stale-coefficient bug that commit removed.

The deck matches data/sommer*.nec so it joins SOM_TESTS, and is not in the
default DO_TESTS, so it does not change what make runs by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uri4eguGitqE1abazuTstd
@charlieh0tel

Copy link
Copy Markdown
Contributor Author

Closing: with e3f81e6 in, nec2++ agrees with nec2c and aegnec2 on this deck, and nothing in CI runs the harness decks, so it adds little as it stands. Sorry for the noise.

@charlieh0tel
charlieh0tel deleted the sommerfeld-near-ground-upstream branch October 2, 2026 03:44
@tmolteno

tmolteno commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Actually @charlieh0tel , If we have an analytic result, and nec2++ (despite agreeing with everything else) is now getting it wrong. Please keep this open, and I'll look into it (I responded to a bug report then). Perhaps the NEC-2 reference is actually wrong, and we should keep the old values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants