View Single Post
  #1   Report Post  
Old November 6th 06, 11:42 AM posted to rec.radio.amateur.antenna
neok neok is offline
external usenet poster
 
First recorded activity by RadioBanter: Aug 2006
Posts: 6
Default Fix up your NEC2! (Bug fix)

Hi,

I am taking the liberty of posting here a copy of an
email I received from Gerry Burke, in response to a
NEC2 bug report which I mentioned here a few days
ago. This email details the changes needed in the NEC2
FORTRAN code but it is also very informative on the
subject of wires connected to patches and the use of
the EK (extended thin-wire kernel) card.

Tim Molteno has already fixed his C++ port of the
NEC2 ( http://alioth.debian.org/projects/necpp/ ) and
also mentioned he would fix a copy of nec2c, my
translation to C of NEC2, which I understand will be
available in the same project site. At the moment I am
very short of time, and I expect to fix the "nec2c" and
"xnec2c" (X/GUI version) in my website after I complete
the work I am doing to make xnec2c multi-threading
(it is now in the alpha bug-fixing stage).

73's Neoklis 5B4AZ http://5b4az.chronos.org.uk/

G. Burkes bug-fix for the NEC2:

You are right, there is a bug in NEC-2 when the extended thin-wire
kernel is used with wires connected to patches. This has escaped
detection for over 20 years. I did not catch it yesterday, because I
had MAXSEG=10000, and ICON1 and ICON2 are dimensioned to
2*MAXSEG, so 10000 did not exceed the bound.

The problem can be fixed as shown below. In addition to subroutine
CMWW, where you encountered the problem, the same changes need to be
made in subroutines NEFLD and QDSRC. With this change the extended
kernel is not used at a wire end connected to a patch surface, but
would be used on the rest of the wire if it is straight .

The extended thin-wire kernel is only used on thick, straight wires,
so is not very useful. The code turns it off at junctions, bends and
changes in radius. Also, the connection of a wire to a patch surface
is not good in NEC-2 or 4. It works fairly well for something like a
monopole on a surface, but not for a half loop connected to the
surface. A wire grid surface provides a better connection for a wire
antenna.

NEC-4 does not have the extended kernel, but instead puts the current
on the wire surface with match points on the axis, and has an
approximation for wire end caps that reduces the instability when the
segment length to radius ratio is small. So NEC-4 would not have
this problem.

Thanks for finding this bug.

Jerry Burke
LLNL




To fix the extended thin-wire kernel with patches in NEC-2:

SUBROUTINE CMWW (J,I1,I2,CM,NR,CW,NW,ITRP)