Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old June 16th 07, 12:11 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jun 2007
Posts: 22
Default Antenna programming tool/language/compiler/preprocessor?

Hello everybody,

I am searching for an antenna programming tool/compiler/preprocessor/
language. To finilize my work with similar subject (based on NEC2/
NEC4, especially on 4NEC2 from Arie Voors), I want to catch some good
ideas for this. Are you knowing some good tools, that provide to model
your antenna with a program code?
It should look like a program source code (like Basic, C or else) with
mathematical equations, variables, etc. It should not a GUI-Program,
where antenna parameters can be given in edit windows. (I hate this.)

So far, I am able to create construction models of antenna, so antenna
parameters can be optimized via 4NEC2. The complete output NEC file
has symbolic parameters instead of hard coded numbers. It supports
many features, that makes antenna modeling easy for you and me.
Especially for old "C"-programmers like me. With this work, it will be
soon able to model very complex antennas.

Please help me, to make a new standard of antenna modeling tool/
language. You will be get an advantage of this soon.

Regards,
Aziz

Some cut of source code (from offset parabolic reflector generator):
....snipped..
//--- Intermediate Symbols ---
P_y0 = -P_W/2 // Starting y position

#if (P_Type==3)
P_z0 = -P_Tp // Starting z position for offset parabola
#else //--if (P_Type==3)
P_z0 = -P_Hp/2 // Starting z position for center parabola
#endif //--if (P_Type==3)

P_dy = P_W/P_nsegw // Step width (y)
P_dz = P_Hp/P_nsegh // Step height (z)

//--- Generate Surface Patches or wires ---
for (z=0; z P_nsegh; z=z+1)
{
for (y=0; y P_nsegw; y=y+1)
{
// Elliptischer Test, wenn aktiv
#if ( (P_Shape == 1) || (sq(%%z+0.5-P_nsegh/2)/sq(P_nsegh/2) +
sq(%%y+0.5-P_nsegw/2)/sq(P_nsegw/2) = 1) ) //-- y=%%y, z=%%z

// if model is constructed with wires, correct wire flags must
be set.
P_wrflags = %%(_P1P2|_P2P3)

#if ( (z == P_nsegh-1) || ( (P_Shape == 2) && (sq(%%(z+1)+0.5-
P_nsegh/2)/sq(P_nsegh/2) + sq(%%y+0.5-P_nsegw/2)/sq(P_nsegw/2)
1)) )
P_wrflags = %%(P_wrflags | _P3P4)
#endif

#if ( (y == 0) || ( (P_Shape == 2) && (sq(%%z+0.5-P_nsegh/2)/
sq(P_nsegh/2) + sq(%%(y-1)+0.5-P_nsegw/2)/sq(P_nsegw/2) 1)) )
P_wrflags = %%(P_wrflags | _P4P1)
#endif

#SP4 1 1 P_a*(P_y0+%%y*P_dy)*(P_y0+%%y*P_dy)+P_a*(P_z0+%
%z*P_dz)*(P_z0+%%z*P_dz) P_y0+%%y*P_dy P_z0+%%z*P_dz P_a*(P_y0+%%(y
+1)*P_dy)*(P_y0+%%(y+1)*P_dy)+P_a*(P_z0+%%z*P_dz)* (P_z0+%%z*P_dz) P_y0+
%%(y+1)*P_dy P_z0+%%z*P_dz P_a*(P_y0+%%(y+1)*P_dy)*(P_y0+%%(y+1)*P_dy)
+P_a*(P_z0+%%(z+1)*P_dz)*(P_z0+%%(z+1)*P_dz) P_y0+%%(y+1)*P_dy P_z0+%%
(z+1)*P_dz P_a*(P_y0+%%y*P_dy)*(P_y0+%%y*P_dy)+P_a*(P_z0+%%(z
+1)*P_dz)*(P_z0+%%(z+1)*P_dz) P_y0+%%y*P_dy P_z0+%%(z+1)*P_dz
P_wrflags

#endif

} // for y

} // for z

.........
This source code must be compiled and you get some output code like
below...
(note: _8 is not a number but an intermediate variable (symbol))

Some cut off output code of other example:
....snipped..
SY _8 = (0+(BQ_RW)/2-(0+(BQ_RW)/2))/8
SY _9 = (0+(BQ_RH)/2-(0-(BQ_RH)/2))/8
SP 0 3 0+0*_1-0*(_7+0*(_1+_4)/8) 0+(BQ_RW)/2+0*_2-0*(_8+0*(_2+_5)/8)
0+(BQ_RH)/2+0*_3-0*(_9+0*(_3+_6)/8) 0+1*_1-0*(_7+1*(_1+_4)/8) 0+
(BQ_RW)/2+1*_2-0*(_8+1*(_2+_5)/8) 0+(BQ_RH)/2+1*_3-0*(_9+1*(_3+_6)/8)
SC 0 3 0+1*_1-1*(_7+1*(_1+_4)/8) 0+(BQ_RW)/2+1*_2-1*(_8+1*(_2+_5)/8)
0+(BQ_RH)/2+1*_3-1*(_9+1*(_3+_6)/8) 0+0*_1-1*(_7+0*(_1+_4)/8) 0+
(BQ_RW)/2+0*_2-1*(_8+0*(_2+_5)/8) 0+(BQ_RH)/2+0*_3-1*(_9+0*(_3+_6)/8)
....
SP 0 3 P_a*(P_y0+29*P_dy)*(P_y0+29*P_dy)
+P_a*(P_z0+20*P_dz)*(P_z0+20*P_dz) P_y0+29*P_dy P_z0+20*P_dz
P_a*(P_y0+30*P_dy)*(P_y0+30*P_dy)+P_a*(P_z0+20*P_d z)*(P_z0+20*P_dz)
P_y0+30*P_dy P_z0+20*P_dz
SC 0 3 P_a*(P_y0+30*P_dy)*(P_y0+30*P_dy)
+P_a*(P_z0+21*P_dz)*(P_z0+21*P_dz) P_y0+30*P_dy P_z0+21*P_dz
P_a*(P_y0+29*P_dy)*(P_y0+29*P_dy)+P_a*(P_z0+21*P_d z)*(P_z0+21*P_dz)
P_y0+29*P_dy P_z0+21*P_dz
....
etc... generates very complex output NEC files...
I am still wondering, that 4NEC2 can handle such complex NEC files.
But it works well.

  #2   Report Post  
Old June 16th 07, 12:36 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jul 2006
Posts: 464
Default Antenna programming tool/language/compiler/preprocessor?

In article om,
wrote:
Hello everybody,

I am searching for an antenna programming tool/compiler/preprocessor/
language. To finilize my work with similar subject (based on NEC2/
NEC4, especially on 4NEC2 from Arie Voors), I want to catch some good
ideas for this. Are you knowing some good tools, that provide to model
your antenna with a program code?


I've used a PERL pre-processing script which allows the embedding of
PERL expressions/calculations into a NEC input file, and substitution
of the results of these calculations into the statements in the deck.

It's somewhat simple-minded and doesn't have all of the flexibility
that you seem to be shooting for, but it might get you started.

Google for nec_param_util.Z - it's in most of the NEC2 archive
repositories, I believe.

--
Dave Platt AE6EO
Friends of Jade Warrior home page: http://www.radagast.org/jade-warrior
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!
  #4   Report Post  
Old June 16th 07, 01:34 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jun 2007
Posts: 22
Default Antenna programming tool/language/compiler/preprocessor?

Hello Dave,

thanks for your hint. I know the problem with perl scripts. What I am
searching is, that no text or symbol replacement or calculating
symbols is done on your source nec file. I am searching for a compiler/
pre-processor, that makes from source file (antenna model) a
compatible nec file (still left in symbolic 4nec2-format).
I am sick off, to code many symbolic lines of nec code. It is boring
and difficult, when your model gets complex and has much more
segments.
Therefore I started with my pre-processor few month ago, that makes
the code for me automatically. It supports primitive object and
complex structures. It also let you "to program" your antenna model.
But the most advantage of letting the nec file symbolic, you can
optimize the antenna parameters.
I tried and constructed many antenna models and wont miss the
optimizer tool from 4nec2.

I am wondering, that nobody made such a tool till now.

Aziz

  #6   Report Post  
Old June 16th 07, 01:54 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jun 2007
Posts: 22
Default Antenna programming tool/language/compiler/preprocessor?

On 16 Jun., 02:14, Richard Clark wrote:
On Fri, 15 Jun 2007 16:11:24 -0700, wrote:

fromI am searching for an antenna programming tool/compiler/preprocessor/
language.

to
Especially for old "C"-programmers like me.


suggests defining your language using BNF and building the compiler
with YACC. Anyway, how I've done similar projects for 30 years. You
could gussy it up with Prolog, but who wants to go down that path (at
least if you want it distributable)?

73's
Richard Clark, KB7QHC


Due to the similarity to 4nec2 and nec2 format, I implemented a very
simple line based parser. Of course, it looks like C, but the pre-
processer has limitations. It is kept left simple except the
expression parser for calculation (fully c compatible). I started with
very simple one and the implementation growed up till now. It is not
finished yet - a big mile stone for documentation must be realized.
Also testing is not finished. And I found new bugs, when I implemented
a regression test model. But it is a good time now, to implement some
usefull features or ideas.

Regard,
Aziz

  #8   Report Post  
Old June 16th 07, 07:37 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jul 2006
Posts: 2,951
Default Antenna programming tool/language/compiler/preprocessor?

On Fri, 15 Jun 2007 19:49:41 -0500, Tom Ring
wrote:

Prolog.

Been a long while since I heard that. I thought it was long buried.


Hi Tom,

The current iteration is so vastly removed from the early days as to
be unrecognizable.

73's
Richard Clark, KB7QHC
  #9   Report Post  
Old June 16th 07, 08:13 AM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Dec 2006
Posts: 1,154
Default Antenna programming tool/language/compiler/preprocessor?

Richard Clark wrote:

...
programmer. Besides, C is a pretty crummy language with even more
horrid library syntaxes (assembler is far more elegant).

73's
Richard Clark, KB7QHC


A lot of people like to think themselves programmers, real programmers
use C/C++. (Weekend programmers use visual basic)

C is simply a macro language which calls assembler procedures and
functions--Dennis Richie was a real assembly language programmer, he
simply designed a "shorthand" language for using assembler--C itself was
written in assembler--nowadays C can compile and link itself ... a real
C programmer will add to the C libraries and include files using
assembler definitions, procedures and functions. While every subroutine
of a C program is a function, they can be written as procedures which
are only cloaked as functions. Example:

#include iostream

void helloworldprocedure(void)
{
cout "hello world!" endl;
}

void main(void)
{
helloworldprocedure();
}

.... takes no parameters, returns none ...

I think most C programmers prefer to program in assembly (but with
windows allowing NO direct access of devices, peripherals, memory or
disk--why bother, assembly can only be used as a wrapper to call windows
libs/dlls/activex/scripts/etc., or custom ones--linux can be made to
allow direct access), however, C adds a productivity factor of
magnitudes over assembly.

No other language offers the efficiency of program "character text"
(source code) to actual binary code compiled/linked by C. Indeed, any C
compiler I have ever seen gives a option to spit out assembler source
.... and the assembler source so generated is quite capable of being
assembled/linked by an assembler/linker for the platform in question.

C simply has no rules which cannot be broken, even if it breaks all
programming rules, and you want to override them, go ahead! (bill gates
won't let you break windows rules though :-( )--C is only structured if
you program in a structured style. For that reason alone, it is not a
good language for newbie programmers ...

JS
  #10   Report Post  
Old June 16th 07, 03:43 PM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Jul 2006
Posts: 230
Default Antenna programming tool/language/compiler/preprocessor?

Richard Clark wrote:
On Fri, 15 Jun 2007 19:49:41 -0500, Tom Ring
wrote:

Prolog.

Been a long while since I heard that. I thought it was long buried.


Hi Tom,

The current iteration is so vastly removed from the early days as to
be unrecognizable.

73's
Richard Clark, KB7QHC


Any open source version(s) you would recommend? I may have to have a
look again.

Thanks.

tom
K0TAR
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FA: 1-Day-Left: 3 Books: MICROPROCESSORS, ASSEMBLY LANGUAGE Programming, 8080, Z-80, Etc. David Equipment 0 April 19th 06 12:42 PM
PicBasic Pro Compiler Ver 2.43 tk Homebrew 0 October 12th 03 03:11 PM
PicBasic Pro Compiler Ver 2.43 tk Homebrew 0 October 12th 03 03:11 PM


All times are GMT +1. The time now is 05:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 RadioBanter.
The comments are property of their posters.
 

About Us

"It's about Radio"

 

Copyright © 2017