NEC-LIST: Precision in NEC-2

From: <BURKE_at_email.domain.hidden>
Date: Thu, 15 Oct 1998 12:12:01 -0800 (PST)

Re: Alexandre Kampouris's questions on single vs double precision

The parameter RX in subroutine INTX sets a target for accuracy, but
the result is often more accurate by as much as an order of magnitude.
It can also be less accurate if there is a lot of cancellation in the
integral, but that is usually not the case as it is used in NEC-2.
Cancellation occurs in the near-singular part for small separations,
but that is subtracted out and evaluated analytically. Then the
numerical integral evaluation contributes only a secondary component.
Also, the fields due to sin(ks) and cos(ks) currents are evaluated in
exact form, so the constant represents only a part of the total field.
Don't know that there has been a careful study of the effect of errors
from INTX, but tightening the accuracy set by RX does not seem to make
much difference. The exact forms for the field due to sin(ks) and
cos(ks) are very bad for numerical evaluation in single precision.
The radial field blows up as 1/rho as you approach the axis of the
wire, which is what the field does on the segment. However, off the
ends of the segment the radial field goes to zero as rho, so there is
a cancellation as rho^2. Treatment of that and other problems, such
as the field of the 1-cos(ks) current, are discussed in Appendix B of
the NEC-4 Theory Manual.

One of the worst precision problems in NEC-2 is that segments that
should be in a straight line are not quite. In single precision the
orientation angles "alpha" that should be 90 degrees often show up as
something like 89.999x. This together with the 1/rho problems causes
the solution for a straight dipole to turn to garbage for more than
about 40 segments. It probably is a good idea to always use the
double precision NEC-2. In NEC-4 we fixed many precision problems and
also rearranged evaluations to delay overflow or underflow. Hence,
single precision can be used in many cases where it could not in
NEC-2.

We have not done any fast series evaluation of the integrals for H,
since H is not used that much. Working out the series used to take a
bit of work before programs like Mathematica came along, but would be
much easier now.

Jerry Burke
LLNL
Received on Fri Oct 16 1998 - 09:48:07 EDT

This archive was generated by hypermail 2.2.0 : Sat Oct 02 2010 - 00:10:38 EDT