GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-necpp/necpp/example/optimized.py at master · tmolteno/python-necpp Expand file tree/ Copy pathoptimized.pyMore file actions 31 lines (26 loc) · 974 Bytes / Copy pathoptimized.pyFile metadata and controls31 lines (26 loc) · 974 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 # Copyright (c) 2008-2026 Tim Molteno ([email protected]) # # Automatically tune antenna # import monopole import scipy.optimize import numpy as np from antenna_util import reflection_coefficient # A function that will be minimized when the impedance is 50 Ohms # We convert the height and antenna length to positive # numbers using exp. because otherwise the antenna will lie # below ground and cause an error in simulation. def target(x): global freq base_height = np.exp(x[0]) # Make it positive length = np.exp(x[1]) # Make it positive z = monopole.impedance(freq, base_height, length) return reflection_coefficient(z, z0=50.0) # Starting value freq = 134.5 x0 = [-2.0, 0.0] # Carry out the minimization log_base, log_length = scipy.optimize.fmin(target, x0) base_height = np.exp(log_base) length = np.exp(log_length) print("Optimium base_height={}m, h={}m, impedance={} Ohms".format(base_height, length, monopole.impedance(freq, base_height, length))) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |