: 4nec2 & Other Antenna Design Modeling Software
stampeder 2009-05-08, 12:42 PM Also for Linux and Windows users OpenOffice.org (http://OpenOffice.org)'s Calc is pretty well a drop-in spreadsheet replacement for Excel (reads, writes, creates, saves to .xls format if you want) as long as Excel macros are not being used. It can do plots and graphical charts with only a small user adjustment in skill set from Excel.
firimari 2009-05-11, 02:17 PM So I now have a version of the NEC2 FORTRAN using zgetrf and zgetrs from Lapack to implement the FACTR and SOLVE subroutines. Unfortunately, it's an older version of the NEC2 base (circa 2000). I can't get Arie Voors' version running on the Cell (with or without the lapack modifications), as it just commits seppuku before I can even attach a debugger.
So now I get to hand-pick all the relevant bugfixes from 4nec2 to merge into the old version of nec2dx. Then, and only then, do I stand a chance of optimizing it for parallel computation.
It's times like this when I hate computers.
RamKat 2009-05-13, 05:45 AM Someone mentioned that he uses a spread sheet that reads 4nec2 output to plot the various curves. I remember something about seeing the link but cannot find it.
I have some interesting further optimization on the X086 that I would like to post.
firimari 2009-05-13, 08:44 AM I have some Java code that parses the .out files into csv files for Excel. I wouldn't call it 'releasable code', but I could certainly make it into a jar file and email it to you with usage instructions.
300ohm 2009-05-13, 10:34 AM Someone mentioned that he uses a spread sheet that reads 4nec2 output to plot the various curves.
No special spreadsheet needed. The "plot" file produced by 4nec2 at the end of a frequency sweep provides the .txt file output. (The file is really made for wgnuplot, see my previous posting below) Just copy and paste the figures into your favorite spreadsheet. I use Open Office, but it works just as well in MS Excel.
The Raw Gain, Real Impedance, and Imaginary Impedance data can be obtained when a Frequency Sweep is calculated. The 4nec2 program then outputs a Imp./SWR/Gain (F5) Line Chart. Under the "Plot" option is the option to plot Forw-gain, R-in (real), X-in (imag). It will give an error message, ie wGnuPlot.exe not found. Ignore it and it will output/display a text file with the needed data. Cut and paste the relevant data into a spreadsheet of your choice for your Net Gain calculations.
RamKat 2009-05-13, 10:51 PM The "plot" file produced by 4nec2 at the end of a frequency sweep provides the .txt file output Will try it - thought there was something wrong with my setup when I got the error message. I am still running some tweak optimizations, but I think I am approaching the limit. Will probably post the results towards the end of the weekend.
300ohm 2009-05-14, 09:47 AM thought there was something wrong with my setup when I got the error message.
Nope, functioning like normal, heh.
Walter Dnes 2009-05-14, 07:33 PM I'm quite hazy about optimization. How does one optimize over a frequency range, rather than just at one frequency? If nothing else, is there an automated way to run frequency sweeps while incrementing a variable (SY card)?
firimari 2009-05-15, 08:25 AM For frequency ranges, click the 'frequency sweep' checkbox in the Optimizer window of 4nec2.
To iterate over a range of values for a variable (SYmbol card), Choose 'sweep' under the function widget in the optimizer, click on the variable you want, and enter the minimum and maximum range (you can do this for more than one variable, but remember, 1 variable n steps, 2 variables n^2 steps, 3 variables n^3 steps...) The variable sweep doesn't let you do a frequency sweep at the same time.
firimari 2009-05-15, 08:30 AM On that note, I'm getting disillusioned by the effectiveness of the optimizer. Really, it should be no suprise, given that it does deterministic hill climbing, but I'm finding that it does a great job of finding a local maximum, while ignoring the fact that it could be doing much better. I think I'll take next week to explore the genetic 'Evolve' functionality. I just wish there was a way to put more complex constraints on the parameter space (like not sending my reflectors to 3 meters tall...)
RamKat 2009-05-15, 12:50 PM What I have found that works to some extend is to use evolve to get the design in the ball park and then use optimize to do the fine tuning. The only the pain with evolve is the additional effort to prevent segments from “jumping” across the symmetry lines so I have not used it as much as I would have liked. I am still trying to develop an electromagnetic eye to set-up the parameters so that changing a parameter would have the desired effect. For example – tilting a segment towards the source by only changing the angle not only changes it's tilt angle but also its projected length and therefore, any potentially positive gains that could have resulted by the increase in tilt angle may (or may not?) be negated by the reduced projected length. But in the same time keeping the projected length the same with a change in angle affects the real length, so that may not be the optimization solution either. Still working on it ………(when I have the spare time)
On that note, I'm getting disillusioned by the
effectiveness of the optimizer. Really, it should be no suprise, given
that it does deterministic hill climbing, but I'm finding that it does
a great job of finding a local maximum, while ignoring the fact that
it could be doing much better.
Do you know what algorithm and merit function are used?
Levenberg-Marquardt is fast at finding local minima. Nelder-Mead is
somewhat better but the tradeoff is that it typically requires more
function evaluations. For my optimization, I use a combination of
differential-evolution (DE) and Nelder-Mead. Unfortunately there is
no perfect algorithm. See http://www.no-free-lunch.org/.
Thanks, --John
RamKat 2009-05-15, 06:18 PM j3d said
For my optimization, I use a combination of
differential-evolution (DE) and Nelder-Mead. Do you do you optimization in one go or do you do a itterative process selecting different elements along the way?
Do you do you optimization in one go or do you
do a itterative process selecting different elements along the
way?
I allow all parameters to vary. But I compute the lengths, gaps, and
so on in terms of a smaller set of parameters. For example, consider
the gaps between the left and right halves of a colinear reflector.
Instead of varying the individual gaps, I define a "gap-function" that
has several parameters that vary instead. As an explicit example, let
g(i) represent the gap of the ith reflector element. Then a two
parameter gap function would be:
g(i) = g0 + i*dg
So instead of varying, say 20 gap parameters for a 20 reflector
antenna, only the parameters (2 in this case) that characterize the
gap function would vary.
--John
firimari 2009-05-15, 09:19 PM As an explicit example, let
g(i) represent the gap of the ith reflector element. Then a two
parameter gap function would be:
g(i) = g0 + i*dg
Ah, that makes much more sense as a way to keep the elements within their quadrant. Thanks.
As for the method 4nec2 does, I don't know the actual algorithm name, but it computes the partial derivative for each variable (adding delta*var for small delta and calculating the merit function) and then uses that to create a delta vector for that step in the algorithm. It keeps adding that delta vector until it decreases the merit function, then repeats.
Walter Dnes 2009-05-18, 07:41 PM How useful is auto-segmentation? I tried it, but ran into a situation where it claimed either angle too sharp or segments too short/thick. I turned it off and manually tweaked the segment counts until I got rid of the messages. No warnings, even when I manually run "Validate => Run segment checks".
A separate question; is there a way to model a plane surface? I'm thinking of a couple of 18 inch wide strips of aluminum foil to be used in a "corner reflector" type antenna.
300ohm 2009-05-18, 08:03 PM How useful is auto-segmentation?
Sometimes its a pain in the butt, heh.
A separate question; is there a way to model a plane surface? I'm thinking of a couple of 18 inch wide strips of aluminum foil to be used in a "corner reflector" type antenna.
Yep, 4nec2 comes with a separate "Build" program, that installs at the same time. Planes, spheres, cylinders etc.
Walter Dnes 2009-05-29, 03:14 AM There is a status window that shows up in 4NEC2 when running sweeps, etc, at the very bottom right. Most of the window is off screen. I'm running 4NEC2 under WINE in linux, and the WINE desktop already has the full vertical size of my LCD. Is there a setting somewhere to put the status window in a more useful position? The help menu didn't... help.
RamKat 2009-05-29, 06:08 AM at the very bottom right. Most of the window is off screen.
It is the same for Windows Vista
RichardGiroux 2009-06-12, 10:45 AM New NEC to DXF converter.
I've written a simple NEC to DXF (AutoCad) converter program. By importing the file into a CAD program, it will be easy to add dimensions and other notes. Secondly, free CAD programs are readily available and most will import DXF files. I'm using QCad for testing right now. (QCad is available in all platforms as well.)
My program (in very early stages) does a simple 2D 3 view drawing.
| |