wrong vis. routine: single dipole no rotational symmetry

Bug #1083301 reported by Bohumir Jelinek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
antennavis (Ubuntu)
New
Undecided
Bohumir Jelinek

Bug Description

Dear Antennavis maintainers,

I am Bohumir, co-author of http://yagi-logper.sourceforge.net/.
Thanks for maintaining antennavis package. I am fond of antennavis.

I believe I found a small bug in the antennavis visualization routines.
It appears, for example, when you give Antennavis a single dipole as input, as
attached. Result should be a rotationally symmetric around the axis of
the dipole, but it is not.

Following three lines, in PlotPoint() function, VisField.c file are wrong:

   glRotatef(azimuth, 0.0, 1.0, 0.0);
   glRotatef(elevation, 1.0, 0.0, 0.0);
   glTranslatef(0.0, 0.0, dist * POINT_DIST_SCALE);

They should be replaced by:

   glRotatef(elevation, 0.0, 1.0, 0.0);
   glRotatef(azimuth, 0.0, 0.0, -1.0);
   glTranslatef(0.0, dist * POINT_DIST_SCALE, 0.0);

The above change will fix the problem.

I would be very glad if you can implement the above change.
I can supply it in a form of patch if needed.

Best,
-Bohumir
  http://www.cavs.msstate.edu/directory/information.php?eid=69

Revision history for this message
Bohumir Jelinek (bohumir) wrote :
Revision history for this message
Bohumir Jelinek (bohumir) wrote :

Dear Antennavis maintainers (or upstream developers),

I tested my fix with many input files. It corrects the visualization issue.

Try e.g. the attached input file. As you Load "D12K6_190.nec" and click on "Compute RF Field", those side lobes of radiation pattern should point dominantly in "up" and "down" directions, not in left and right. Left and right is due to Antennavis bug.

To verify that those side lobes should point dominantly "up" and "down", try another antenna modeling code, "xnec2c":

xnec2c -i D12K6_190.nec

   click "View"->"Radiation Pattern"

and in the new window that shows up:

   click "Gain Pattern" and "View -> Gain Scaling -> Linear Voltage"

xnec2c shows side lobes pointing "up" and "down" - the same way as Antennavis with my fix.

Best,
-Bohumir

Revision history for this message
Bohumir Jelinek (bohumir) wrote :
Revision history for this message
Bohumir Jelinek (bohumir) wrote :

To clarify why the fix is needed, I suggest this temporary code
change:

In the "WriteCardFile" function, "pccard.c" file line 321, replace
this line:

     increment, increment, step_size, step_size);

by this line:

     3, 10, 5, 5);

That will calculate and plot antenna gain for only 3 theta angles and
10 phi angles, starting from theta=0 (z axis), increment of 5 degrees.

Axis and angles in NEC2 are oriented according to this Figure:

  http://nec2.org/part_3/gifs/fig18.gif

  (In antennavis, +x points to the right, and phi angle grows in the
   direction backward from the screen. Note that the "azimuth"
   argument to the PlotPoint is theta (contrary to what one could
   expect: azimuth=phi).)

The above temporary change is only for you to verify that my bug-fix
will fix the result - it is not to be kept in the code permanently.

Best,
-Bohumir

Revision history for this message
Bohumir Jelinek (bohumir) wrote :

Could someone please check if my statements make sense?

I will be glad to explain if something is not clear.

Thanks,
-Bohumir

Changed in antennavis (Ubuntu):
assignee: nobody → Bohumir Jelinek (bohumir)
Revision history for this message
Bohumir Jelinek (bohumir) wrote :

Anyone had a chance to confirm/reject this bug?
I believe visualization from antennavis is incorrect.

Revision history for this message
Bohumir Jelinek (bohumir) wrote :

This turned up to be a known bug - according to the Antennavis package TODO file:

KNOWN BUGS:
  ...
  - I think the axes are screwed up; in trying to do multiple .nec input
    files, something got changed, and all RF patterns are 90 degrees CW or CCW
    (I forget) from where they should be.
  ...

Following the advice of Joop Stakenborg and Nanakos Chrysostomos,
I became a member of the Antennavis group at Savannah:
  https://savannah.nongnu.org/projects/antennavis/
Savannah Antennavis repository was outdated and without maintainer.
I merged the changes from the Ubuntu and include.gr Antennavis repositories into the Savannah version.

I kept the original, Savannah version of "Models/*.nec" files, since the new model files (i.e. ubuntu/include.gr) have comma delimited values - that seems not-standard.

I am open to suggestions for Antennavis improvement.

-Bohumir

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.