Mike Markowski,
mike.ab3ap@gmail.com
NOTE: These pages show completed work. The code itself cannot be shared publicly because it must be licensed from LLNL. However, NEC-81 is publicy available.
Complete Python/NumPy conversion of Lawrence Livermore National Laboratory's NEC-5 (NECMP) Method of Moments (MoM) electromagnetic simulator, replacing older point-matching with mixed-potential integral equations (MPIE), RWG/rooftop basis functions, and Sommerfeld potential tables (by Gerald J. Burke, LLNL-CODE-746721).
pip install pynec5-5.0.0-py3-none-any.whl
pip install "pynec5-5.0.0-py3-none-any.whl[plots]"
pip install "pynec5-5.0.0-py3-none-any.whl[full]"
nec5 # Open PySide6 GUI
nec5 -g antenna.nec # Open .nec deck or .cfg file in GUI
nec5 antenna.nec # Run deck and print report to stdout
nec5 antenna.nec -o out.txt # Write ASCII report to file
nec5 antenna.nec -p # Run solver + 3D/2D Matplotlib plots
nec5 -c antenna.cfg # Run from configuration file
nec5 -t my_antenna.cfg # Generate starter .cfg template
| Option | Description |
|---|---|
[target] |
Input .nec deck or .cfg file. |
-i / --input FILE |
Input NEC-5 deck path. |
-o / --output FILE |
Write ASCII report to FILE. |
-c / --config FILE |
Run from a .cfg file. |
-t / --write-template FILE |
Generate starter .cfg template. |
-g / --gui |
Launch the PySide6 desktop GUI. |
-p / --plots3d |
Generate 3D geometry/pattern/field plots. |
-n / --no-show |
Save plot files without opening windows. |
-d / --plot-dir DIR |
Directory for saved plots (default: plots). |
-f / --plot-format FMT |
Image format: png, svg, or pdf. |
-s / --pattern-style |
3D pattern style: wireframe or surface. |
GM/GR/GS/GX transforms before solving.F5), ASCII report, and embedded plot browser.antennaGeometry3d
(RF currents |I|, patches, sources, VSWR),
radiationPatternWireframe3d, polarCuts,
frequencySweep, and 3D near-field scatter plots.| Code | Name | Purpose |
|---|---|---|
CM / CE |
Comment | Header comment lines terminated by CE. |
PA |
Parameter | Defines named symbolic parameters for subsequent cards. |
GW / GC |
Wire / Taper | Straight or ratio-tapered wire segments. |
GA / GH |
Arc / Helix | Circular wire arc or uniform/tapered helix. |
SP / SM / SC |
Patches | Triangular RWG, quad, or CountX x CountY
rectangular patches. |
GM / GR / GS / GX |
Transforms | Move/copy, Z-rotation symmetry, scaling, and plane reflection symmetry. |
GE |
Geometry End | Builds RWG/rooftop/wire/1/ρ junction basis
functions. |
FR |
Frequency | Single frequency or linear/multiplicative sweep. |
EX |
Excitation | Voltage source (0), plane wave (1–3), or current source (4). |
GN / GD |
Ground | Free space (-1), reflection (0), PEC (1), Sommerfeld (2),
and cliff/screen (GD). |
LD / NT / TL |
Loads & Nets | RLC/conductivity loads, two-port [Y] networks,
and transmission lines. |
NE / NH / RP |
Fields | Near E/H grids, free-space/reflection far field
(RP 0), and ground wave (RP 1). |
XQ / EN |
Execute / End | Solves MoM system and terminates deck. |