Documentation
¶
Index ¶
- Constants
- Variables
- func BendMax(r, segL float64) float64
- func CheckDistances(segs []*Line, minD float64) (pos []int)
- func FormatDuration(v int64) string
- func FormatImpedance(z complex128, n int) string
- func FormatNumber(v float64, n int) string
- func FromReflection(g, z0 complex128) complex128
- func GenMdlParams(param float64, spec *Specification, ini, perf *Performance, ...) (cmts []string)
- func GetFrequencyRange(s string) (freq, sw int64, err error)
- func GetPlugin(name string) (pi *plugin.Plugin, err error)
- func GetRange(s string) (from, to float64, err error)
- func GetSymbol[T any](pi *plugin.Plugin, name string) (sym T, err error)
- func GminEvaluate(p *Performance, args string, feedZ complex128) (val float64)
- func InRange(v, from, to float64) bool
- func Intersects(segs []*Line) (pos []int)
- func IsNull(f float64) bool
- func IsotropeEvaluate(p *Performance, args string, feedZ complex128) (val float64)
- func MaterialProperties(label string, dia float64) (conductivity, inductance float64, err error)
- func ParseImpedance(s string) (Z complex128, err error)
- func ParseNumber(s string) (float64, error)
- func PlotStyle(pos int) (pat string, style draw.LineStyle)
- func Plotter(db *Database, sel *Selection, format string) (out map[string]string, err error)
- func Randomizer(seed int64) *rand.Rand
- func ReadConfig(fname string) (err error)
- func Regions(pos []int) (r [][2]int)
- func SplitParam(line string) (kind string, vals []string)
- func Sqr(v float64) float64
- func TblValue[T any](tbl *Table, row, col int) (v T)
- func ToReflection(z, z0 complex128) complex128
- type Action
- type Antenna
- func (a *Antenna) Add(s *Line)
- func (a *Antenna) DumpNEC(wrt io.Writer, spec *Specification, comments []string)
- func (a *Antenna) Eval(freq int64, wire Wire, ground Ground) (err error)
- func (a *Antenna) FixGeometry(minD float64)
- func (a *Antenna) SetExcitation(pos int)
- func (a *Antenna) Type() string
- type BoundingBox
- type Callback
- type Canvas
- type Change
- type Comparator
- type Config
- type Database
- func (db *Database) Close() error
- func (db *Database) GetRows(clause, order string) (list []*Row, err error)
- func (db *Database) Insert(rec *Record) error
- func (db *Database) ListPlotSets() (sets map[string]*PlotSet, err error)
- func (db *Database) Set(fdir string, filter Index) (set *Set, err error)
- func (db *Database) Stats() (stats *DbStats)
- func (db *Database) VarLists(set string) (kList, pList []float64, err error)
- type DbStats
- type Evaluate
- type Feedpt
- type Gain
- type GenGeo
- type GenStraight
- type GenStroll
- type GenTrespass
- type GenV
- type GenWalk
- type Generator
- type Geometry
- type Grid
- type Ground
- type Impedance
- type Index
- type IndexList
- type Line
- type LuaEvaluator
- type LuaGenerator
- type Matcher
- type Material
- type Model
- type ModelDipole
- type Node
- type Performance
- type PlotSet
- type RadPattern
- type Record
- type RenderConfig
- type Row
- type SDLCanvas
- func (c *SDLCanvas) Circle(x, y, r, w float64, clrBorder, clrFill *color.RGBA)
- func (c *SDLCanvas) Close() error
- func (c *SDLCanvas) Dump(fName string) error
- func (c *SDLCanvas) Line(x1, y1, x2, y2, w float64, clr *color.RGBA)
- func (c *SDLCanvas) Run(cb Action)
- func (c *SDLCanvas) SetHint(m string)
- func (c *SDLCanvas) Show(ant *Antenna, pos int, msg string)
- func (c *SDLCanvas) Text(x, y, fs float64, s string, clr *color.RGBA)
- type SVGCanvas
- func (c *SVGCanvas) Circle(x, y, r, w float64, clrBorder, clrFill *color.RGBA)
- func (c *SVGCanvas) Close() (err error)
- func (c *SVGCanvas) Dump(fName string) (err error)
- func (c *SVGCanvas) Line(x1, y1, x2, y2, w float64, clr *color.RGBA)
- func (c *SVGCanvas) Run(cb Action)
- func (c *SVGCanvas) SetHint(m string)
- func (c *SVGCanvas) Show(ant *Antenna, _ int, msg string)
- func (c *SVGCanvas) Text(x, y, fs float64, s string, clr *color.RGBA)
- type Selection
- type Set
- type Simulation
- type SmithChart
- type Source
- type Specification
- type Stats
- type Table
- type Task
- type TrackList
- type Vec3
- func (v Vec3) Add(u Vec3) (d Vec3)
- func (v Vec3) Dot(u Vec3) float64
- func (v Vec3) Equals(u Vec3) bool
- func (v Vec3) Length() float64
- func (v Vec3) MirrorX() (w Vec3)
- func (v Vec3) Move2D(r, a float64) (w Vec3)
- func (v Vec3) Mult(k float64) (d Vec3)
- func (v Vec3) Neg() (d Vec3)
- func (v Vec3) Norm() (u Vec3)
- func (v Vec3) Prod(u Vec3) (d Vec3)
- func (v Vec3) String() string
- func (v Vec3) Sub(u Vec3) (d Vec3)
- type Wire
Constants ¶
const ( C = 299792458 // c - speed of light (m/s) Mu_0 = 1.25663706212e-6 // μ₀ - permeability constant (~4π×10−7 H/m) Eps_0 = 8.8541878210e-12 // ε₀ - permittivity constant (F/m) )
const ( VaryK = 1 VaryP = 2 )
Varying flags
const ( // mathematical constants RectAng = math.Pi / 2 // right angle CircAng = 2 * math.Pi //full circle )
Global settings and defaults
const ( TRK_MARK = -1 TRK_SHORT = -2 TRK_LENGTH = -3 )
const Bulge = 100
Bulge specifies the number of segments involved in avoiding wire intersections.
const NumPlots = 15
NumPlots is the number of plot selections available in the GUI
Variables ¶
var ( ClrWhite = &color.RGBA{255, 255, 255, 0} ClrRed = &color.RGBA{255, 0, 0, 0} ClrRedTr = &color.RGBA{255, 0, 0, 224} ClrPink = &color.RGBA{255, 0, 255, 0} ClrBlack = &color.RGBA{0, 0, 0, 0} ClrGray = &color.RGBA{127, 127, 127, 0} ClrBlue = &color.RGBA{0, 0, 255, 0} ClrGreen = &color.RGBA{0, 255, 0, 0} ClrCyan = &color.RGBA{0, 255, 255, 0} )
Color definitions for drawing
var Cfg = &Config{ Def: &Specification{ K: 0.25, Wire: Wire{ Diameter: 0.002, Material: "", Conductivity: 0, Inductance: 0, }, Ground: Ground{ Height: 0, Mode: 0, Type: -1, NRadl: 0, Epse: 0, Sig: 0, }, Source: Source{ Z: Impedance{50, 0}, Power: 1, Freq: 435000000, Span: 5000000, }, Feedpt: Feedpt{ Gap: 0, Extension: 0, }, }, Sim: &Simulation{ MaxRounds: 5, MinZr: 1, MaxZr: 20000, MinChange: 0.001, ProgressCheck: 10, MinBend: 0.01, ExciteU: 1.0, PhiStep: 5.0, ThetaStep: 5.0, WireMax: 0.008, SegMinLambda: 0.002, SegMinWire: 4, MinRadius: 0.02, }, Render: &RenderConfig{ Canvas: "sdl", Width: 1024, Height: 768, }, Mat: map[string]*Material{ "Cu": { 5.96e7, 1.32e-6, }, "CuL": { 5.96e7, 1.1e-7, }, "Al": { 3.5e7, 2.5e-8, }, }, Plugins: make(map[string]string), }
Cfg is the globally-accessible configuration (pre-set)
var CustomEvaluators = make(map[string]Evaluate)
CustomEvaluators is a list of custom comparator implementations
var PlotSpecial = []string{
"Smith",
}
special graphs
var PlotValues = []string{
"Gmax",
"Gmean",
"SD",
"Zr",
"Zi",
"Geff",
"Loss",
"PwrFac",
}
list of plot targets
Functions ¶
func BendMax ¶
BendMax returns the max. bending angle between two segments of given length such that a resulting curve has a minimum radius of r.
func CheckDistances ¶
CheckDistances returns a list of segment indices where the smallest distance of segment to other segments in the list is below a given minimum. Only the higher index is reported.
func FormatImpedance ¶
func FormatImpedance(z complex128, n int) string
FormatImpedance with scaled numbers (magnitude)
func FromReflection ¶
func FromReflection(g, z0 complex128) complex128
FromReflection computes the impedance Z if a reference impedance Z0 and a complex reflection (Smith chart coordinate) are given.
func GenMdlParams ¶
func GenMdlParams( param float64, spec *Specification, ini, perf *Performance, mdl, gen, opt string, seed int64, tag string, total Stats, ) (cmts []string)
GenMdlParams assembles model parameters as list of strings. The output is parsable with ParseMdlParams().
func GetFrequencyRange ¶
GetFrequencyRange parses band limits
func GetPlugin ¶
GetPlugin by name. If name is prefixed with '@', it references a plugin entry in the configuration.
func GminEvaluate ¶
func GminEvaluate(p *Performance, args string, feedZ complex128) (val float64)
Gmin evaluator (minimizing Gmax)
func Intersects ¶
Intersects returns a list of segment indices that intersect other segments in the list. Only the higher index is reported.
func IsotropeEvaluate ¶
func IsotropeEvaluate(p *Performance, args string, feedZ complex128) (val float64)
IsotropeEvaluate implements the Compare prototype It returns a value representing how spherical the radiation pattern is.
func MaterialProperties ¶
MaterialProperties returns material properties for label
func ParseImpedance ¶
func ParseImpedance(s string) (Z complex128, err error)
ParseImpedance (complex value) from string. A valid string is formed from one or two numbers combined; the single number or one of the two numbers can be tagged by a "j" or "i" as imaginary. Spaces and multiplication signs in a string are ignored.
Examples of valid strings: * "50" // only real part -> (50,0) * "-j30.624" // only imaginary part -> (0,-30.624) * "87.37+j41.74" // complex number -> (87.37,41.74) * "j41.74+87.37" // complex number -> (87.37,41.74)
func Randomizer ¶
Randomizer initialized with seed for deterministic randomization.
func Regions ¶
Regions condenses a list of indices into regions. The list "3 5 6 7 8 12 15 16 19" would be returned as "[3,3] [5,8] [12,12] [15,16] [19,19]"
func SplitParam ¶
SplitParam dissects a parameter string
func ToReflection ¶
func ToReflection(z, z0 complex128) complex128
ToReflection computes the complex reflection factor between Z and Z0. The value is within a unit circle in the complex plane (Smith chart).
Types ¶
type Antenna ¶
type Antenna struct { Lambda float64 // wavelength at operating frequency Perf *Performance // antenna performance // contains filtered or unexported fields }
Antenna geometry, parameter and performance
func BuildAntenna ¶
func BuildAntenna(kind string, spec *Specification, nodes []*Node) (ant *Antenna)
BuildAntenna from given geometry
func NewAntenna ¶
NewAntenna instantiates a new kind of antenna
func (*Antenna) DumpNEC ¶
func (a *Antenna) DumpNEC(wrt io.Writer, spec *Specification, comments []string)
DumpNEC writes an antenna simulation card deck to writer.
func (*Antenna) FixGeometry ¶
FixGeometry makes sure that an antenna geometry can be used for simulations (e.g. avoiding wire intersections by "bridging" wire crossings).
func (*Antenna) SetExcitation ¶
SetExcitation places the feed point on a wire segment
type BoundingBox ¶
func NewBoundingBox ¶
func NewBoundingBox() *BoundingBox
func (*BoundingBox) Include ¶
func (b *BoundingBox) Include(v Vec3)
type Canvas ¶
type Canvas interface { // Start a new (dynamic) rendering Run(Action) // Show antenna Show(ant *Antenna, pos int, msg string) SetHint(m string) // Circle primitive Circle(x, y, r, w float64, clrBorder, clrFill *color.RGBA) // Text primitive Text(x, y, fs float64, s string, clr *color.RGBA) // Line primitive Line(x1, y1, x2, y2, w float64, clr *color.RGBA) // Dump canvas to file Dump(fName string) error // Close a canvas. No further operations are allowed Close() error }
Canvas for drawing the antenna
func GetCanvasFromCfg ¶
func GetCanvasFromCfg(cfg *RenderConfig, side float64) (Canvas, error)
GetCanvasFromCfg returns a canvas from configuration
type Comparator ¶
type Comparator struct {
// contains filtered or unexported fields
}
Comparator creates a standard metric for antenna results. It is used in the optimization loop to find improvements towards a goal. The optimization algorithms interprets higher values as "better" values.
func NewComparator ¶
func NewComparator(target string, spec *Specification) (cmp *Comparator, err error)
Create a new comparator for a target (and a possible target value). Known targets are: * Gmax: highest gain * Gmean: best mean gain * SD: smallest standard deviation * custom: custom comparator (possibly plugin)
func (*Comparator) Compare ¶
func (cmp *Comparator) Compare(curr, old *Performance) (sign int, val float64)
Compare antenna results based on the optimization target. Returns 0 if same, -1 if worse, 1 if better
func (*Comparator) Target ¶
func (cmp *Comparator) Target() string
Target returns the current optimization target
func (*Comparator) Value ¶
func (cmp *Comparator) Value(p *Performance) float64
Value returns the evaluated value from perfomance data.
type Config ¶
type Config struct { Def *Specification `json:"default"` Sim *Simulation `json:"simulation"` Mat map[string]*Material `json:"material"` Render *RenderConfig `json:"render"` Plugins map[string]string `json:"plugins"` }
Config for AntGen
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database for optimization results
func OpenDatabase ¶
Open SQLite3 database from file
func (*Database) ListPlotSets ¶
ListPlotSets returns a list of names for available plot sets
type DbStats ¶
type DbStats struct { NumAnt int64 // number of antennas NumSteps int64 // number of optimization steps NumSims int64 // number of simulations Elapsed int64 // elapsed simulation time (seconds) Duration string // human-readble duration }
DbStats holds database statistics
type Evaluate ¶
type Evaluate func(perf *Performance, args string, feedZ complex128) float64
Evaluate performance (metric value optimized to maximum)
type Feedpt ¶
type Gain ¶
type Gain struct { Max float64 // maximum gain Mean float64 // mean gain SD float64 // standard deviation of mean }
Gain of antenna
type GenGeo ¶
type GenGeo struct {
// contains filtered or unexported fields
}
GenGeo reads a geometry file instead of generating something new.
type GenStraight ¶
type GenStraight struct{}
GenStraight returns all segments lined-up in a straight line.
func (*GenStraight) Init ¶
func (g *GenStraight) Init(params string, lambda float64) error
Init generator with given parameters
func (*GenStraight) Nodes ¶
Nodes returns the initial antenna geometry made from 'num' segments of equal length 'segL'.
func (*GenStraight) Volatile ¶
func (g *GenStraight) Volatile() bool
Volatile returns true if the generator is randomized
type GenStroll ¶
type GenStroll struct {
// contains filtered or unexported fields
}
GenStroll grows a line (dipole leg) by moving in any direction but bounded by to positive x-coordinates.
type GenTrespass ¶
type GenTrespass struct {
// contains filtered or unexported fields
}
GenTrespass grows a line (dipole leg) by moving in any direction and widthout bounds.
func (*GenTrespass) Init ¶
func (g *GenTrespass) Init(params string, lambda float64) error
Init generator with given parameters
func (*GenTrespass) Nodes ¶
Nodes returns the initial antenna geometry made from 'num' segments of equal length 'segL'.
func (*GenTrespass) Volatile ¶
func (g *GenTrespass) Volatile() bool
Volatile returns true if the generator is randomized
type GenV ¶
type GenV struct {
// contains filtered or unexported fields
}
GenV returns a V-shaped dipole with 120° (¾π) angle between legs.
type GenWalk ¶
type GenWalk struct {
// contains filtered or unexported fields
}
GenWalk grows a line (dipole leg) by moving in one direction, so the maximum direction vector of a segment is ±½π.
type Generator ¶
type Generator interface { // Init generator with given parameters Init(param string, lambda float64) error // Nodes returns the initial antenna geometry made from 'num' segments // of equal length 'segL'. Volatile generators build varying geometries // based on randomization. Nodes(num int, segL float64, rnd *rand.Rand) []*Node // Name of generator Name() string // Info about generator Info() string // Volatile returns true if the generator is randomized Volatile() bool }
Generator interface
type Geometry ¶
type Geometry struct { Cmts []string `json:"comments"` // optimization info/comments Wire Wire `json:"wire"` // wire parameters Feedpt Feedpt `json:"feedpt"` // feed point parameters Height float64 `json:"height"` // height of antenna Nodes []*Node `json:"nodes"` // node list }
Geometry of 2D-bended antenna
type Grid ¶
type Grid struct {
// contains filtered or unexported fields
}
Grid implements the interface for heatmap grids
type Ground ¶
type Ground struct { Height float64 `json:"height"` // height of antenna above ground Mode int `json:"mode"` // ground mode (0=no ground, 1=sym ground, -1=no-sym ground) Type int `json:"type"` // NEC2 ground type (-1: free space, 0: finite, 1:conductive, 2: finite(SN)) NRadl int `json:"nradl"` // number of radial wires in the ground screen Epse float64 `json:"epse"` // relative dielectric constant for ground in the vicinity of the antenna Sig float64 `json:"sig"` // conductivity in mhos/meter of the ground in the vicinity of the antenna }
Ground parameters
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index to performance record. Either 'k' or 'param' can be NaN (skipped), but not both.
type IndexList ¶
type IndexList struct {
// contains filtered or unexported fields
}
IndexList is a list of unique indices (usually over a set of data)
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line in 3D space
type LuaEvaluator ¶
type LuaEvaluator struct {
// contains filtered or unexported fields
}
LuaEvaluator provides an Evaluate() function for optimization written in LUA script.
func NewLuaEvaluator ¶
func NewLuaEvaluator(script string) (ev *LuaEvaluator, err error)
NewLuaEvaluator instantiates a new LUA evaluator: 'param' is of form '<script filename>:<opt1>=<val>,<opt2>=...'
func (*LuaEvaluator) Evaluate ¶
func (ev *LuaEvaluator) Evaluate(perf *Performance, args string, feedZ complex128) float64
Evaluate antenna performance and return result
type LuaGenerator ¶
type LuaGenerator struct {
// contains filtered or unexported fields
}
LuaGenerator is a generator where the Nodes() method is implemented as a LUA script.
func (*LuaGenerator) Init ¶
func (g *LuaGenerator) Init(param string, lambda float64) error
Init generator with given parameters
func (*LuaGenerator) Nodes ¶
Nodes returns the initial antenna geometry made from 'num' segments of equal length 'segL'. Volatile generators build varying geometries based on randomization.
func (*LuaGenerator) Volatile ¶
func (g *LuaGenerator) Volatile() bool
Volatile returns true if the generator is randomized
type Matcher ¶
type Matcher struct { AtSource bool // placement of shunt element // contains filtered or unexported fields }
Matcher between impedances. The shunt element (Cp/Lp) is located at the side with higher impedance (load if swap=false or source if swap=true). The matcher is either a low-pass (Cp/Ls) or a high-pass (Cs/Lp) filter.
func Zmatch ¶
func Zmatch(Zs, Zl complex128) (Z complex128, m *Matcher)
Zmatch the source impedance Zs to the load impedance Zl. Z_L: load impedance (R_L + X_L*j) Z_P: Reactance parallel to load (X_P*j) [maxima-start]
Zl: Rl+Xl*%i; Zp: Xp*%i; Z: rectform((Zl*Zp)/(Zl+Zp)); R: expand(realpart(Z)); --> (Rl*Xp^2) / ((Xp+Xl)^2 + Rl^2) == Rs solve(R-Rs,Xp); --> Xp = (sqrt(Rl*Rs*Xl^2 - Rl^2*Rs^2 + Rl^3*Rs) + Rs*Xl) / (Rl-Rs) Xr: imagpart(Z);
[maxima-end]
type Material ¶
type Material struct { Conductivity float64 `json:"conductivity"` // wire conductivity (S/m) Inductance float64 `json:"inductance"` // wire inductance (H/m) }
Material spec for wires
type Model ¶
type Model interface { // Init model with antenna parameters and generator. Init(params string, spec *Specification, gen Generator) (side float64, err error) // Prepare initial geometry Prepare(seed int64, cb Callback) (ant *Antenna, err error) // Optimize antenna geometry based on random seed and comparator // (to evaluate progress during optimization) Optimize(seed int64, iter int, cmp *Comparator, cb Callback) (ant *Antenna, stats Stats, err error) // Info about the model (parameters) Info() string // Finalize model after optimization (write track and geometry files). Finalize(tag, outDir, outPrf string, cmts []string) }
Model of an antenna.
type ModelDipole ¶
type ModelDipole struct { Kind string // kind of model Spec *Specification // antenna specs Nodes []*Node // list of segments Num int // number of segments SegL float64 // segment length Track []*Change // list of changes }
Model of a dipole antenna with symmetrical legs. Each leg is made from segments of equal length.
func (*ModelDipole) Finalize ¶
func (mdl *ModelDipole) Finalize(tag, outDir, outPrf string, cmts []string)
Finalize model (write track and geometry files)
func (*ModelDipole) Init ¶
func (mdl *ModelDipole) Init(params string, spec *Specification, gen Generator) (side float64, err error)
Init base model
type Node ¶
type Node struct { Length float64 `json:"length"` // length of segment Theta float64 `json:"azimuth"` // azimuth (angle in XY plane) Phi float64 `json:"elevation"` // elevation (towards Z axis) }
Node in a 3D geometry (relative vector)
type Performance ¶
type Performance struct { Gain *Gain // antenna gain Z complex128 // antenna impedance Rp *RadPattern // radiation pattern }
Performance of antenna
func (*Performance) Attenuation ¶
func (p *Performance) Attenuation(Zs complex128) float64
Power factor (in dB) of a matched antenna.
func (*Performance) Loss ¶
func (p *Performance) Loss(Zs complex128) float64
Loss (in dB) of transfering power from a source with impedance Zs to an unmatched antenna with impedance r.Z
func (*Performance) Resonance ¶
func (p *Performance) Resonance() float64
Resonance is the "virtual loss" (in dB) due to antenna reactance. No loss implies resonance.
func (*Performance) SWR ¶
func (p *Performance) SWR(Zs complex128) float64
SWR for (unmatched) antenna at source impedance
func (*Performance) String ¶
func (p *Performance) String() string
String returns a human-readable performance text
type PlotSet ¶
type PlotSet struct { Tag string // plot tag Dir string // dataset directory Klist []float64 // list of possible 'k' values Plist []float64 // list of possible 'param' values Kidx int // 'k' selection in KList Pidx int // 'param' selection in PList }
func NewPlotSet ¶
type RadPattern ¶
RadPattern is the radiation pattern of an antenna
func (*RadPattern) Spherical ¶
func (rp *RadPattern) Spherical() (f float64)
Spherical is a metric for the isotropicity of a radition pattern. Values are positive; smaller numbers are "better". A value is calculated as ∑error(i)²/n over all points (with i = 1..n).
type Record ¶
type Record struct { Freq int64 // operating frequency Wire Wire // wire spec Gnd Ground // ground spec Feedpt Feedpt // feedpoint spec K float64 // k (dipole leg length) Param float64 // free parameter (generator) Perf Performance // final performance Mdl string // antenna model Gen string // antenna generator (initial geometry) Opt string // optimizer Seed int64 // random seed Stats Stats // optimization stats Path string // relative path Tag string // model tag }
Record in the database
func ParseMdlParams ¶
ParseMdlParams from model file (extract performance parameters)
type RenderConfig ¶
type RenderConfig struct { Canvas string `json:"canvas"` // render engine/canvas Width int `json:"width"` // width of canvas (usually in pixels) Height int `json:"height"` // height of canvas (usually in pixels) }
RenderConfig for rendering-related settings
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row in the performance table
type SDLCanvas ¶
type SDLCanvas struct {
// contains filtered or unexported fields
}
SDLCanvas for windowed display
func NewSDLCanvas ¶
NewSDLCanvas creates a new SDL canvas for display
type SVGCanvas ¶
type SVGCanvas struct {
// contains filtered or unexported fields
}
SVGCanvas for writing SVG streams
func NewSVGCanvas ¶
NewSVGCanvas creates a new SVG canvas
type Selection ¶
type Selection struct { Target string // Parameter (Gmax,Gmean,Zr,Zi) Sets [NumPlots]*PlotSet // list of PlotSets selected }
Selection of plot parameters
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set of performance data from one run; either 'k' or 'param' (or both!) are varied across a defined span. The set is identified by 'fdir' (optimization results are grouped in distinct directories).
type Simulation ¶
type Simulation struct { // optimization parameters (termination conditions) MaxRounds int `json:"maxRounds"` // max. number of rounds in optimization MinZr float64 `json:"minZr"` // min. resistance of antenna MaxZr float64 `json:"maxZr"` // max. resistance of antenna MinChange float64 `json:"minChange"` // progress check: min. change in target value ProgressCheck int `json:"progressCheck"` // number of steps between progress check MinBend float64 `json:"minBend"` // min. bending angle (fraction of max. angle) // simulation-related constants (NEC2 simulation) ExciteU float64 `json:"exciteU"` // excitation voltage PhiStep float64 `json:"phiStep"` // azimut step (degree) ThetaStep float64 `json:"thetaStep"` // elevation step (degree) // geometry-related constraints (NEC2 simulation) WireMax float64 `json:"wireMax"` // max. wire diameter (in wavelength) SegMinLambda float64 `json:"segMinLambda"` // min. segment length (in wavelength) SegMinWire float64 `json:"segMinWire"` // min. segment length (in wire diameter) MinRadius float64 `json:"minRadius"` // min. curve radius (in wavelength) }
Simulation parameters
type SmithChart ¶
type SmithChart struct {
// contains filtered or unexported fields
}
SmithChart holds tracks (sequences of impedances) for plotting. It implements the plot.Plotter interface.
type Source ¶
type Source struct { Z Impedance `json:"Z"` // source impedance Power float64 `json:"power"` // source power Freq int64 `json:"freq"` // frequency Span int64 `json:"span"` // freq span }
Source parameters
func ParseSource ¶
ParseSource converts a source spec into Source
type Specification ¶
type Specification struct { K float64 `json:"k"` // leg in wavelength Wire Wire `json:"wire"` // wire parameters Ground Ground `json:"ground"` // ground parameters Source Source `json:"source"` // source parameters Feedpt Feedpt `json:"feedpt"` // feed point parameters }
Specification of antenna parameters
type Table ¶
type Table struct { Name string // name of table (plot name) NumIdx int // number of indices (parameters) Dims []string // column names Vals [][]any // values (float64 or complex128) Refs []int // column references (to selection set) }
Table data for post-processing (plot)
type Task ¶
type Task struct { Ant *Antenna // antenna to be rendered Pos int // position of last change (-1 no change) Msg string // additional message for display }
Task send via channel to render engine
type TrackList ¶
type Vec3 ¶
type Vec3 [3]float64
Vec3 is a 3D vector
func BestFitSphere ¶
BestFitSphere returns the radius and center point of a sphere that bests fits the given points (least square fit).
type Wire ¶
type Wire struct { Diameter float64 `json:"dia"` // wire diameter Material string `json:"material"` // wire material Conductivity float64 `json:"G"` // wire conductivity (S/m) Inductance float64 `json:"L"` // wire inductivity (H/m) }
Wire parameters