<s>
The	O
Numerical	B-Protocol
Electromagnetics	I-Protocol
Code	I-Protocol
,	O
or	O
NEC	O
,	O
is	O
a	O
popular	O
antenna	O
modeling	O
system	O
for	O
wire	O
and	O
surface	O
antennas	O
.	O
</s>
<s>
It	O
was	O
originally	O
written	O
in	O
FORTRAN	B-Application
during	O
the	O
1970s	O
by	O
Gerald	O
Burke	O
and	O
Andrew	O
Poggio	O
of	O
the	O
Lawrence	O
Livermore	O
National	O
Laboratory	O
.	O
</s>
<s>
The	O
code	O
was	O
made	O
publicly	O
available	O
for	O
general	O
use	O
and	O
has	O
subsequently	O
been	O
distributed	O
for	O
many	O
computer	O
platforms	O
from	O
mainframes	B-Architecture
to	O
PCs	O
.	O
</s>
<s>
By	O
far	O
the	O
most	O
common	O
version	O
is	O
NEC-2	B-Protocol
,	O
the	O
last	O
to	O
be	O
released	O
in	O
fully	O
public	O
form	O
.	O
</s>
<s>
There	O
is	O
a	O
wide	O
and	O
varied	O
market	O
of	O
applications	O
that	O
embed	O
the	O
NEC-2	B-Protocol
code	O
within	O
frameworks	O
to	O
simplify	O
or	O
automate	O
common	O
tasks	O
.	O
</s>
<s>
The	O
original	O
NEC	O
added	O
a	O
more	O
accurate	O
system	O
for	O
calculating	O
currents	O
along	O
the	O
wires	O
,	O
and	O
at	O
junctions	O
between	O
them	O
,	O
as	O
well	O
as	O
an	O
option	O
that	O
increased	O
the	O
accuracy	O
when	O
the	O
wire	O
was	O
thick	O
,	O
with	O
a	O
low	O
aspect	B-Device
ratio	I-Device
compared	O
to	O
its	O
length	O
.	O
</s>
<s>
NEC-2	B-Protocol
added	O
two	O
major	O
features	O
to	O
the	O
original	O
NEC	O
,	O
a	O
numerical	O
Green	O
's	O
function	O
for	O
working	O
with	O
large	O
planes	O
,	O
and	O
an	O
expansion	O
of	O
the	O
ground-plane	O
code	O
to	O
deal	O
with	O
partially	O
lossy	O
materials	O
that	O
are	O
more	O
realistic	O
for	O
antennas	O
near	O
the	O
ground	O
.	O
</s>
<s>
With	O
the	O
release	O
of	O
NEC-2	B-Protocol
,	O
the	O
original	O
became	O
known	O
as	O
NEC-1	O
.	O
</s>
<s>
All	O
of	O
these	O
programs	O
originated	O
in	O
the	O
mainframe	B-Architecture
era	O
,	O
originally	O
running	O
on	O
Control	O
Data	O
machines	O
.	O
</s>
<s>
The	O
code	O
was	O
written	O
in	O
FORTRAN	B-Application
and	O
designed	O
to	O
take	O
input	O
from	O
punch	B-Architecture
card	I-Architecture
stacks	O
in	O
column-delimited	O
format	O
and	O
then	O
print	O
the	O
results	O
on	O
a	O
line	O
printer	O
.	O
</s>
<s>
These	O
early	O
versions	O
were	O
widely	O
ported	O
to	O
a	O
number	O
of	O
other	O
big-iron	B-Architecture
platforms	O
.	O
</s>
<s>
AMP	O
added	O
support	O
for	O
disk-based	O
files	O
by	O
emulating	O
the	O
original	O
system	O
,	O
writing	O
out	O
the	O
data	O
from	O
a	O
single	O
punch	B-Architecture
card	I-Architecture
to	O
80-column	O
line	O
in	O
a	O
text	O
file	O
,	O
with	O
the	O
file	O
as	O
a	O
whole	O
representing	O
a	O
deck	O
of	O
cards	O
.	O
</s>
<s>
With	O
the	O
move	O
from	O
punch	B-Architecture
card	I-Architecture
input	O
to	O
the	O
use	O
of	O
text	O
files	O
,	O
a	O
profusion	O
of	O
slightly	O
different	O
file	O
formats	O
appeared	O
,	O
which	O
was	O
later	O
described	O
as	O
"	O
close	O
to	O
free	O
format	O
"	O
.	O
</s>
<s>
Versions	O
were	O
introduced	O
on	O
the	O
MS-DOS	B-Application
platform	O
in	O
the	O
late	O
1980s	O
,	O
mostly	O
using	O
FORTRAN	B-Application
compilers	O
capable	O
of	O
compiling	O
the	O
original	O
code	O
.	O
</s>
<s>
Later	O
versions	O
converted	O
the	O
FORTRAN	B-Application
to	O
the	O
C	B-Language
programming	I-Language
language	I-Language
,	O
either	O
by	O
hand	O
or	O
using	O
automated	O
tools	O
.	O
</s>
<s>
Modern	O
programs	O
usually	O
have	O
a	O
separate	O
graphical	B-Application
user	I-Application
interface	I-Application
(	O
GUI	B-Application
)	O
that	O
allows	O
the	O
user	O
to	O
draw	O
and	O
edit	O
the	O
antenna	O
.	O
</s>
<s>
When	O
that	O
is	O
complete	O
,	O
the	O
GUI	B-Application
converts	O
the	O
design	O
into	O
the	O
NEC-2	B-Protocol
deck	O
file	O
format	O
and	O
runs	O
NEC-2	B-Protocol
.	O
</s>
<s>
The	O
GUI	B-Application
then	O
parses	O
NEC-2	B-Protocol
'	O
s	O
output	O
and	O
graphically	O
displays	O
the	O
results	O
.	O
</s>
<s>
NEC-4	O
also	O
introduced	O
a	O
new	O
licensing	O
system	O
,	O
and	O
is	O
not	O
available	O
as	O
open	B-License
source	I-License
.	O
</s>
<s>
The	O
code	O
is	O
based	O
on	O
the	O
method	B-Algorithm
of	I-Algorithm
moments	I-Algorithm
solution	O
of	O
the	O
electric	B-Algorithm
field	I-Algorithm
integral	I-Algorithm
equation	I-Algorithm
(	O
EFIE	B-Algorithm
)	O
for	O
thin	O
wires	O
and	O
the	O
magnetic	O
field	O
integral	O
equation	O
(	O
MFIE	O
)	O
for	O
closed	O
,	O
conducting	O
surfaces	O
.	O
</s>
<s>
Programs	O
often	O
process	O
this	O
into	O
more	O
common	O
forms	O
like	O
Smith	B-Application
charts	I-Application
.	O
</s>
<s>
It	O
can	O
be	O
used	O
for	O
,	O
but	O
is	O
not	O
well	O
suited	O
to	O
,	O
slotted	B-Algorithm
waveguide	I-Algorithm
antennas	I-Algorithm
,	O
fractal	O
antennas	O
or	O
similar	O
designs	O
in	O
which	O
the	O
component	O
conductive	O
elements	O
are	O
not	O
rod-like	O
.	O
</s>
<s>
The	O
method	B-Algorithm
of	I-Algorithm
moments	I-Algorithm
algorithm	O
has	O
practical	O
limitations	O
as	O
well	O
;	O
the	O
number	O
of	O
calculations	O
required	O
to	O
model	O
a	O
three-dimensional	O
structure	O
of	O
N	O
radiating	O
elements	O
is	O
roughly	O
proportional	O
to	O
the	O
cube	O
of	O
N	O
.	O
Modeling	O
an	O
antenna	O
with	O
100wire	O
segments	O
requires	O
1003	O
=	O
1million	O
calculations	O
.	O
</s>
<s>
The	O
NEC	O
input	O
file	O
is	O
a	O
sequence	O
of	O
lines	O
;	O
the	O
input	O
file	O
is	O
known	O
as	O
a	O
"	O
deck	O
"	O
(	O
from	O
"	O
card	B-Architecture
deck	I-Architecture
 '	O
,	O
referring	O
to	O
the	O
original	O
punch	B-Architecture
card	I-Architecture
formats	O
)	O
and	O
uses	O
a	O
.deck	O
or	O
.nec	O
file	O
extension	O
.	O
</s>
<s>
The	O
following	O
example	O
of	O
a	O
complete	O
input	B-Architecture
deck	I-Architecture
models	O
a	O
log-periodic	O
antenna	O
,	O
like	O
those	O
used	O
for	O
VHF	O
television	O
reception	O
:	O
</s>
<s>
BRACT	O
was	O
a	O
pure	O
method	B-Algorithm
of	I-Algorithm
moments	I-Algorithm
implementation	O
,	O
suitable	O
for	O
use	O
on	O
antennas	O
consisting	O
of	O
uniform	O
diameter	O
conductors	O
arranged	O
in	O
free	O
space	O
and	O
connected	O
to	O
each	O
other	O
at	O
their	O
ends	O
(	O
if	O
at	O
all	O
)	O
.	O
</s>
<s>
The	O
original	O
NEC	O
,	O
later	O
known	O
as	O
NEC-1	O
when	O
NEC-2	B-Protocol
was	O
introduced	O
,	O
was	O
a	O
modification	O
of	O
the	O
earlier	O
AMP2	O
,	O
adding	O
a	O
more	O
accurate	O
current	O
expansion	O
along	O
wires	O
and	O
at	O
multiple	O
wire	O
junctions	O
,	O
and	O
an	O
option	O
in	O
the	O
wire	O
modeling	O
for	O
far	O
greater	O
accuracy	O
on	O
thick	O
wires	O
.	O
</s>
<s>
NEC-2	B-Protocol
is	O
the	O
highest	O
version	O
of	O
the	O
code	O
within	O
the	O
public	O
domain	O
without	O
a	O
license	O
.	O
</s>
<s>
NEC-3	O
modified	O
NEC-2	B-Protocol
to	O
include	O
a	O
Sommerfeld	O
model	O
to	O
properly	O
model	O
wires	O
buried	O
in	O
or	O
close	O
to	O
the	O
ground	O
.	O
</s>
<s>
NEC-5	O
solves	O
the	O
Electric-field	B-Algorithm
integral	I-Algorithm
equation	I-Algorithm
for	O
wires	O
and	O
surfaces	O
using	O
the	O
newer	O
mixed	O
potential	O
method	O
developed	O
by	O
Rao	O
,	O
Wilton	O
and	O
Glisson	O
.	O
</s>
<s>
It	O
uses	O
the	O
same	O
method	B-Algorithm
of	I-Algorithm
moments	I-Algorithm
algorithm	O
to	O
calculate	O
the	O
outcomes	O
,	O
but	O
using	O
entirely	O
original	O
code	O
.	O
</s>
<s>
The	O
first	O
versions	O
were	O
written	O
in	O
1980	O
in	O
BASIC	O
for	O
32kB	O
Apple	B-Device
II	I-Device
computers	O
,	O
and	O
after	O
following	O
some	O
advice	O
from	O
Professor	O
Wilton	O
at	O
the	O
University	O
of	O
Mississippi	O
,	O
the	O
first	O
public	O
release	O
was	O
made	O
in	O
1982	O
for	O
64kB	O
machines	O
.	O
</s>
<s>
An	O
improved	O
version	O
,	O
MININEC2	O
,	O
was	O
released	O
in	O
1984	O
,	O
followed	O
by	O
a	O
port	O
to	O
the	O
IBM	B-Device
PC	I-Device
as	O
MININEC3	O
in	O
1986	O
.	O
</s>
<s>
Like	O
the	O
original	O
NEC	O
,	O
MININEC	O
now	O
runs	O
on	O
many	O
platforms	O
,	O
although	O
its	O
popularity	O
has	O
fallen	O
with	O
the	O
more	O
widespread	O
availability	O
of	O
the	O
original	O
NEC	O
codes	O
in	O
C	B-Language
form	O
.	O
</s>
<s>
However	O
,	O
MININEC	O
handles	O
different	O
wire	O
diameters	O
better	O
than	O
NEC-2	B-Protocol
and	O
probably	O
NEC-4	O
;	O
this	O
includes	O
different	O
diameter	O
parallel	O
wires	O
,	O
different	O
diameter	O
wires	O
joined	O
at	O
an	O
angle	O
and	O
tapered	O
diameter	O
antenna	O
elements	O
.	O
</s>
<s>
Placing	O
sources	O
at	O
an	O
intersection	O
of	O
two	O
wires	O
is	O
a	O
problem	O
for	O
NEC-2	B-Protocol
but	O
not	O
MININEC	O
.	O
</s>
