SkillAgentSearch skills...

AntennaSim

Web-based antenna simulator powered by NEC2. Design, simulate, and analyze antennas with real-time 3D visualization, radiation patterns, SWR, and impedance charts.

Install / Use

/learn @EA1FUO/AntennaSim
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

<h1 align="center">AntennaSim</h1> <p align="center"> <strong>Free, open-source antenna simulator for the browser -- powered by NEC2</strong> </p> <p align="center"> <img src="https://img.shields.io/badge/version-1.0.1-blue?style=flat-square" alt="Version"> <img src="https://img.shields.io/badge/license-GPL--3.0-green?style=flat-square" alt="License"> <img src="https://img.shields.io/badge/NEC2-engine-orange?style=flat-square" alt="NEC2"> <img src="https://img.shields.io/badge/docker-ready-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker"> <img src="https://img.shields.io/badge/WebAssembly-supported-654FF0?style=flat-square&logo=webassembly&logoColor=white" alt="WebAssembly"> <img src="https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square" alt="PRs Welcome"> </p> <p align="center"> <a href="https://EA1FUO.github.io/AntennaSim/"><strong>Try the live demo</strong></a> &middot; <code>docker run -p 80:80 ea1fuo/antennasim</code> </p> <br> <p align="center"> <img src="screenshots/simulator.png" alt="AntennaSim -- Simulator with 3D radiation pattern" width="100%"> </p> <p align="center"> <img src="screenshots/editor.png" alt="AntennaSim -- Wire editor with 3D viewport" width="100%"> </p> <br> <p align="center"> <strong>17 antenna templates</strong> &nbsp;&middot;&nbsp; <strong>3D radiation patterns</strong> &nbsp;&middot;&nbsp; <strong>SWR &amp; Smith charts</strong> &nbsp;&middot;&nbsp; <strong>Wire editor + optimizer</strong> &nbsp;&middot;&nbsp; <strong>NanoVNA overlay</strong> &nbsp;&middot;&nbsp; <strong>Dark / light theme</strong> </p> <br>

Design antennas from built-in templates or build your own from scratch in the wire editor. Run NEC2 simulations and instantly visualize SWR, impedance, Smith chart, 3D radiation patterns, current distribution, and near-field heatmaps -- all in your browser.

Two deployment modes: self-hosted with Docker (backend + Redis) or fully static via WebAssembly on GitHub Pages -- zero server required.


Table of Contents


Features

<details open> <summary><strong>Simulation Engine</strong></summary> <br>
  • Full NEC2 pipeline -- geometry definition to card deck generation to nec2c execution to parsed results, all automated
  • Frequency sweep -- simulate across any frequency range with configurable step size
  • 10 ground models -- free space, perfect ground, salt water, fresh water, pastoral, average, rocky, city, dry/sandy, and custom (user-defined dielectric constant and conductivity)
  • Lumped loads -- series RLC, parallel RLC, fixed impedance, and wire conductivity (copper, aluminum, steel, stainless steel)
  • Transmission lines -- characteristic impedance, length, velocity factor, and shunt admittance
  • GA/GM/GR cards -- wire arcs, coordinate transformations, and cylindrical symmetry for complex geometries
  • Redis caching -- simulation results cached with SHA-256 keys and zlib compression (1h TTL)
  • Rate limiting -- opt-in, configurable (default: 30/hour, 5 concurrent per IP when enabled)
  • Sandboxed execution -- subprocess.run(shell=False, timeout=180), isolated temp dirs, non-root container
</details> <details> <summary><strong>Interactive 3D Viewport</strong></summary> <br>
  • Real-time 3D rendering -- pan, rotate, zoom with orbit controls
  • Radiation pattern -- 3D surface mesh with perceptually uniform colormap (gain in dBi)
  • Volumetric shells -- alternative multi-shell pattern visualization
  • Current distribution -- wire segments colored by current magnitude with hot colormap
  • Animated current flow -- luminous particles traveling along wires proportional to current
  • Near-field heatmap -- E-field magnitude as a semi-transparent plane in 3D
  • Pattern slice -- animated cutting plane sweeping through the radiation pattern
  • Ground reflection -- ghost mirror showing antenna image below ground plane
  • Hover measurements -- tooltip follows cursor over any 3D object showing gain, wire dimensions, current magnitude, or field strength
  • Auto-framing -- camera automatically fits to antenna bounding box on load and template change
  • 3D orientation gizmo -- interactive axis cube in the viewport corner; click any face/edge/corner to snap to that camera angle
  • Compass rose for spatial orientation
</details> <details> <summary><strong>Charts &amp; Analysis</strong></summary> <br>
  • SWR vs. Frequency -- color-coded zones (green/amber/red), ham band markers, resonance annotation, crosshair tooltips
  • Impedance (R + jX) -- resistance and reactance curves, reference impedance line, resonance crossings where jX=0
  • Smith Chart -- impedance locus with frequency markers, constant SWR circles (1.5, 2.0, 3.0), click-to-inspect tooltip showing Z, SWR, and reflection coefficient
  • Polar Radiation Pattern -- azimuth (H-plane) and elevation (E-plane) cuts, -3dB beamwidth arc, max gain marker, concentric dBi grid
  • Chart popups -- click any chart to expand to a full-screen modal for detailed analysis
  • Legends -- every chart includes a clear legend explaining all colors, lines, and markers
  • Balun/Unun matching -- client-side impedance transformation with 10 presets (1:1 to 49:1) for viewing SWR relative to transformed impedance
  • .s1p overlay -- import NanoVNA measurement data and overlay on simulation SWR for comparison
</details> <details> <summary><strong>Wire Editor</strong></summary> <br>
  • Build from scratch -- click-to-add wires, drag endpoints, snap grid
  • Move mode -- drag endpoints or entire wires; Shift+drag for vertical-only movement
  • Undo/Redo -- full history with Ctrl+Z / Ctrl+Shift+Z
  • Wire properties -- edit coordinates, radius, segments per wire
  • Excitations -- set feed points with magnitude and phase
  • Loads & transmission lines -- add lumped RLC loads and TL models to any segment
  • Templates -- load any built-in template into the editor and modify it
  • Import/Export -- open and save .nec (NEC2 card deck) and .maa (MMANA-GAL) files
</details> <details> <summary><strong>Optimizer</strong></summary> <br>
  • Nelder-Mead algorithm (scipy, adaptive mode)
  • 5 objective functions -- minimize SWR (single freq), minimize SWR (band average), maximize gain, maximize front-to-back ratio, weighted combined
  • Up to 10 variables with min/max bounds
  • Real-time progress -- WebSocket streaming of iteration count, current best SWR, convergence chart
  • Cancel -- abort optimization mid-run
</details> <details> <summary><strong>Other</strong></summary> <br>
  • 17 antenna templates spanning wire, vertical, multiband, loop, and directional categories
  • Template library page -- browse and compare all templates with descriptions and difficulty ratings
  • Learn page -- educational content on NEC2, SWR, impedance, radiation patterns, and simulation tips
  • Mobile responsive -- usable on phones and tablets with touch-friendly controls
  • Dark/Light theme -- system-aware with manual toggle
  • Keyboard shortcuts -- 17 bindings for fast workflow (press ? to see them all)
</details>

Antenna Templates

AntennaSim ships with 17 ready-to-simulate templates organized by category:

| Category | Templates | |---|---| | Wire | Half-Wave Dipole, Inverted V, End-Fed Half-Wave | | Vertical | Ground Plane Vertical, J-Pole, Slim Jim | | Multiband | Off-Center Fed Dipole, G5RV, Fan Dipole | | Loop | Delta Loop, Horizontal Delta Loop, Cubical Quad, Small Magnetic Loop | | Directional | Yagi-Uda (2-6 el.), Moxon Rectangle, Hex Beam, Log-Periodic Dipole Array |

Every template includes configurable parameters (frequency, height, element lengths, spacing, wire diameter, etc.) with sensible defaults and validation ranges.


Quick Start

Prerequisites

One-liner (Docker Hub)

docker run -p 80:80 ea1fuo/antennasim

Open http://localhost in your browser. Done. This pulls the all-in-one image from Docker Hub with everything bundled (frontend, backend, Redis, nginx).

From source

git clone https://github.com/EA1FUO/AntennaSim.git
cd AntennaSim
cp .env.example .env
docker compose up --build

The first build takes a few minutes (downloading base images, compiling nec2c, installing dependencies). Subsequent starts are fast.


GitHub Pages (WebAssembly)

AntennaSim can run entirely in the browser -- no backend server needed. The NEC2 engine (nec2c) is compiled to WebAssembly and executes locally in a Web Worker.

Live demo: https://EA1FUO.github.io/AntennaSim/

This mode is enabled by setting VITE_ENGINE=wasm at build time. The GitHub Pages deployment is fully automated via the deploy-pages.yml workflow, which:

  1. Checks out the repo with the nec2c git submodule
  2. Compiles nec2c to WebAssembly using Emscripten
  3. Builds the frontend with VITE_ENGINE=wasm
  4. Deploys to GitHub Pages

Both deployment modes (Docker and WASM) are functionally equivalent -- same simulation engine, same UI, same results.

| | Docker | WebAssembly | |---|---|---| | Server required | Yes | No | | Simulation runs on | Backend (Pyt

View on GitHub
GitHub Stars172
CategoryDesign
Updated17h ago
Forks13

Languages

TypeScript

Security Score

85/100

Audited on Mar 27, 2026

No findings