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!
  #3   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

  #4   Report Post  
Old June 18th 07, 06:47 PM posted to rec.radio.amateur.antenna
external usenet poster
 
First recorded activity by RadioBanter: Mar 2007
Posts: 801
Default Antenna programming tool/language/compiler/preprocessor?

wrote:
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


What you are looking for is essentially a way to specify a mechanical
design, which would then be processed into an appropriate description
for a modeling code to use.

For trivial antennas, it would be pretty easy to have a text language to
describe things. You could have macros and such. However, at a basic
level, all you're doing is exchanging the somewhat cryptic NEC cards for
something more readable.

As soon as it gets more complex, you're looking at defining your own
shape/geometry definition language, and that's quite a chore.. and has
been done to boot.

A better approach is to use an off the shelf drawing package of some
sort, and build a parser that takes the mechanical drawing and turns it
into a EM model. In the commercial world, there's a lot of activity for
this sort of gridding process.

Typically you'd start with something like an IGES or DXF file.



  #5   Report Post  
Old June 16th 07, 01:14 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 16:11:24 -0700, wrote:
from
I 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


  #7   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
  #8   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
  #9   Report Post  
Old June 16th 07, 04:54 PM 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 Sat, 16 Jun 2007 09:43:00 -0500, Tom Ring
wrote:

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


Hi Tom,

I would like to say Trilogy, which is also a declarative language, but
long gone by nearly 20 years.

On the active front, there is XPCE/Prolog (google this) out of
Amsterdam. It appears to be the product of a one-man show and to my
mind suffers from what he thinks the language should be (and not what
it was). I suppose my attitude would be better if I could have read
the users manual which, unfortunately, mimics all the poorly written
user manuals that have come down the pike since PL/M.

73's
Richard Clark, KB7QHC
  #10   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



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 10:20 PM.

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

About Us

"It's about Radio"

 

Copyright © 2017