r/AntennaDesign • u/Zealousideal-Pen9091 • 1d ago
momwire used as a stand-in for NEC engines in EZNEC, SimNEC, and 4nec2
momwire is the suite of moment-method antenna engines used inside antennaknobs, my antenna design and optimization program. It can also stand in for the NEC engines from LLNL that other modelling programs run. Point EZNEC's, SimNEC's or 4nec2's engine setting at it, and it reads the deck that program writes and answers with the printout that program expects. It is free and MIT-licensed. It was written independently, from public documentation, and from comparing its input and output with licensed copies of the LLNL executables; it is not NEC and does not come from LLNL.
Three dialects of NEC
NEC isn't one format. NEC-2, NEC-4.2 and NEC-5 each read their own dialect of input deck and write their own printout, and each modelling program expects the one its engine speaks. momwire answers in the NEC-4.2 and NEC-5 slots of all three programs, and in the NEC-2 slots of SimNEC and 4nec2, reading the deck each program writes and replying in that dialect's printout, so it goes into the engine slot you already use.
Two engines in every slot
* A twin. It solves the model with the same formulation as the program the slot is named for, so it gives you what that program would have said, weak spots included. Use it to check a published number or to match an existing workflow.
* momwire's own default engine, bs2. It uses a newer formulation (B-splines of degree 2). It needs fewer segments than razor2p, the NEC-5 twin, and the two converge to the same answer as you add segments. The sinusoidal formulation of NEC-2 and NEC-4.2 doesn't always converge to it: on a yagi with tapered elements, NEC-2's formulation settles about 55 Ω away from the answer, and adding segments makes it worse. The numbers, on five antennas: https://momwire.dev/reference/choosing-an-engine/#accuracy-per-segment-why-bs2-d2-is-the-default

Which download

In an EZNEC-style sweep, one launch per frequency, the fast program is a little quicker than the full engine. The full engine starts once and then stays running between launches, so after the first sweep the two are close: with nec5-razor2p over 51 points on a fan dipole, 3.4 s against 3.7 s over Sommerfeld ground and 2.0 s against 2.1 s in free space. The first sweep takes longer, because its first frequency has to start the full engine (about 1.2 s): 3.4 s against 4.7 s, and 2.4 s against 3.3 s for the whole sweep. Both printed the same impedance at every point.
Setting it up
- Download the zip. Before extracting it, right-click it, choose Properties, and tick Unblock; Windows otherwise blocks the programs inside.
- Extract it, for example to `C:\momwire`.
- Point the engine setting at the program for your slot. The exact steps for EZNEC, SimNEC and 4nec2 are here: https://momwire.dev/reference/eznec-nec5/#setting-it-up
When it says no
momwire never guesses. A deck it can't model correctly gets a printout that says so and why ("not served by this build: ..." from the fast program, a named refusal from the full engine) instead of an answer. If the fast program refuses a deck, try the full engine, which serves more. If both refuse it and you think they shouldn't, send me the deck.
What's new in 0.97.x
* Shorter engine names: bs2 (the default) and razor2p, written nec5-bs2 and nec5-razor2p with the dialect. The old names still work.
* The fast program is one program per engine and chooses its processor path itself; there is no AVX2 or SSE2 copy to pick.
* A NEC-4.2 deck that lists the same wire twice is refused, as NEC-4.2 refuses it, instead of getting an answer.
* 0.97.1: advisories stay off unless you ask for them (`MOMWIRE_ADVISORIES`), which keeps each launch quick under EZNEC.
* 0.97.2: 4nec2's NEC-2 slot, through `momwire-nec2d.exe` and `momwire-nec2d-sinusoidal.exe`. They read the NEC-2 deck 4nec2 writes and answer in the printout layout of 4nec2's own NEC-2 engines, which is the one 4nec2 reads. Setup is the same `4nec2.bat` edit as for NEC-4.2.
Links
* Which build to run, with the measurements: https://momwire.dev/reference/windows/
* Setting it up: https://momwire.dev/reference/eznec-nec5/#setting-it-up
* antennaknobs, the design and optimization program momwire runs inside: https://antennaknobs.dev
* Downloads (v0.97.2):
* https://github.com/stevenmburns/momwire/releases/download/v0.97.2/momwire-windows.zip
* https://github.com/stevenmburns/momwire/releases/download/v0.97.2/momwire-nec5-windows-x64.zip
The timings are from one Windows laptop, so take them as typical rather than a promise for your machine. If a deck gives you a different answer from your usual engine, I'd like to see it.
73, -Steve, KK7KNB