Getting started with the 4NEC2 version 4.2 visualization and optimization tool for NEC-2.

	For this introduction on 4nec2 it is assumed that the reader has basic knowledge
	about the nec2 syntax, especially the GW, EX, LD, GN (and RP) cards. If this is 
	not the case, please first consult the nec2 user manual available on the internet
	at www.qsl.net/wb6tpu/swindex.html

1) Show structure, generate data and view currents and phase distribution.

	In this first basic example it is explained, how to open an existing nec-2 antenna
	model, generate nec-2 output, examine and validate structure geometry and display
	the current- and phase-distribution along the structure. Furthermore some of the
	more general menu-bar options as available on the different 4nec2 forms are 
	discussed.   

	After starting the 4nec2 program by double clicking on the 4nec2 shortcut or on
	the 4nec2.exe program-file, a pop-up window is displayed. This initial window is 
	used to select the active nec-2 antenna model file to work with. In this first 
	example, please locate the file ..\4nec2\example1.nec and click the open button.

	If no nec-2 output is generated yet for the selected file, the data loaded into 
	4nec2 will be the nec-2 input-file data and the wire geometry structure specified
	in this file is displayed on the 'geometry' form. You may use the F2 or F3 key's 
	to bring the 'Main' or the 'Geometry' form to the foreground.
	The background for the 'Geometry' form is displayed in a none white color,
	indicating that the structure displayed on the form is related to the *.nec input-
	file. Note also that most of the fields on the 'main' form are empty.

	You may use the arrow key's to rotate the structure, or the Page-up and Page-down
	key's to zoom-in or -out. To shift the structure up/down or left/right use the
	Control key together with one of the arrow-key's. Use the 'Home' key to reset
	the geometry form. 

	To view the contents for the nec-2 input file, use the 'F6' button or the 'Edit->
	Input-file' menu-bar option on the main form. The active *.nec input file is loaded
	in the new nec2 based editor, and you should see something like the following:


CM Example 1 :	Dipole in free space 	' Comment cards
CM 		See GetStarted.txt
CE 					' End of comment
'
GW 1 9 0 .2418 0 0 .2418 0 .0001	' Wire 1, 9 segments, halve wavelength long.
GE 0					' End of geometry
'
EX 0 1 5 0 1 0				' Voltage source (1+j0) at wire 1 segment 5.
'
FR 0 1 0 0 300 0			' Set design frequency (300 Mc).
'
EN					' End of NEC input


	In this nec-2 file a 2*.2481 meters long dipole devided into 9 segments is speci-
	fied. This wire is in parallel with the Y axis. The voltages source is located
	in the middle of this wire on segment 5, the frequency is specified as 300 Mhz.

	To modify the nec-2 input file this 'Edit' window is used, but for now we quit 
	this edit session without saving, by clocking the 'Quit' button.

	To start the nec-2 engine and generate nec-2 output data, bu sure one of the
	4nec2 forms is on top (has the focus) and push the F7 key. A new pop-up window
	called 'Generate' is displayed. In this window you will be able to specify 
	different  calculation options. Lets start with the first one, called 'use original
	file'.  If not already selected, please select this option and push <Enter> or 
	click the 'Generate' button.
	When this is done, a black DOS-box is displayed, indicating that the nec2d.exe
	engine is running. All output, generated by the nec2d engine is written to an
	output file which is created in the '..\4nec2\out' directory.

	When calculations are done, the DOS-box disappears and 4nec2 opens the output
	file, reads and displays the generated data on the 'Main' and 'Geometry' form.
	Note that the 'Geometry' background color changes to white and that most fields
	on the 'Main' form are filled with data.

	When reading and displaying output data, 4nec2 performs a 'structure validation'
	test. In this test some of the the nec-2 requirements concerning segment-length 
	and -diameter are checked. If errors are detected a message is displayed. With the
	menu-bar option 'Show -> Validate' it is possible to highlight the wires/segments 
	with error conditions. With the 'ouput to logfile' option, all warnings and error
	are reported as a text file.

	To get more detailed segment info, select the desired segment with the mouse and
	use the left mouse button. With the 'Wire/Segm' menu-bar option you can get the
	same information. Detailed wire information is also available when viewing the 
	input-file structure. The selected wire is displayed in blue color, with an open 
	and a closed circle. The closed circle represents end-1, the open circle end-2.

	To view all Segment, use the 'S'(egment) key or select 'Show->Segments'. To view 
	the open Ends, use the 'E'(nds) key or select 'Show->open Ends'. To show the Current
	distribution along the dipole wire use the 'C'(urrent) key or select 'Show->Current'
	To toggle the Phase relationship on and off, enter the 'P'(hase) key or select 
	'Show->Phase'. If detailed segment info is selected (see above), the numerical
	values for the segment current is displayed. With the 'X' key or the 'Wire/Segm->
	Polar/Cartesian' option you can toggle between polar or carthesion notation.

	Another way to show the current distribution along a wire is to select the 'Show->
	single/multi-color' option. This option may be used to evaluate the currents for
	complex structures.
	

2) Generate Far-field data and view 2D polar and 3D far field patterns.

	In this example the Example2.nec input file is used. If 4nec2 is already active,
	please use 'Ctrl+O' or 'File->Open' on the 'main' and select the Example2.nec file.


CM Example 2 :	Loaded dipole in free space
CM 		See GetStarted.txt
CE 					' End of comment
'
SY len=.4836				' Symbol: Length for WL/2
'
GW 1 9 0 -len/2 0 0 len/2 0 .0001	' Wire 1, 9 segments, halve wavelength long.
GE 0					' End of geometry
'
LD 5 1 0 0 5.8001E7			' Wire conductivity for copper
'
EX 0 1 5 0 1 0				' Voltage source (1+j0) at wire 1 segment 5.
FR 0 1 0 0 300 0			' Set design frequency (300 Mc).
EN					' End of NEC input


	At first the structure looks the same as Example1, however if you use the F6 key
	you wil notice some differences. First of all a special 4nec2 card 'SY' is included.
	With this card it is possible to specify symbols, constants or mathematical-
	expressions. In this example the dipole length is represented by the symbol 'len'.
	It has the value 0.4836. In the GW card this symbol is used in 'len/2' to specify
	the Y coordinates for both ends of the dipole wire.

	Furthermore a LD (loading) card was added to specify the wire conductivity for
	the dipole. In the 'Geometry' form you can use the 'W'(ire) key of 'Show->Wire 
	loading' to examine all the loaded segments, they are displayed in a orange/brown 
	color. You may also use 'Show->Excitation/Loading info' on the Main form or click
	on or near a wire to view additional Wire info.
	
	To generate the far-field pattern, press the F7 key and select the second option
	called 'Far-field pattern'. In the lower half of the form, new fields are displayed
	to specify the start, stop and stepsize angles for the far-field pattern. 

	Mostly full 3D patterns are wanted, meaning that Phi angles (horizontal) should 
	range from 0 to 360 degrees and Theta angles (vertical) for free-space should range
	from -180 to +180 degrees (-90 to +90 if ground(plane) is specified)
	The 'Add surface wave' option should not be selected, the 'XNDA' field should be 
	set to '1000'. The other fields are not yet relevant. (Please consult the RP card
	in the nec2 user manual for detailed information).

	When the 'Generate' button is pushed, the nec2d engine starts and new output data is
	generated. After the calculations are done a third form called the 'Pattern' form 
	is displayed. In this form the 2D horizontal or vertical polar far-field patterns 
	are made available. If this form is on top, with the arrow-keys you can select the 
	pattern for different theta or phi angles. With the 'G'(eometry) key or the 'Show->
	Structure' the geometry structure is displayed on the pattern form. 

	The view the 3D pattern, select the 'Geometry' form (F3) and push the 'R' key or
	use the 'Show->Near/Far-field' option. You may use the arrow- and page-up/down keys
	to move, rotate or zoom the 3D pattern.
	If the 3D pattern on the 'Geometry' form is enabled and the 'Pattern' form is 
	selected (F4), the color for the 3D pattern changes and the 2D pattern for the
	selected theta or phi angle is highlighted. This helps you to understand where
	the selected 2D pattern is located inside the full 3D pattern.

	On the 'Pattern' form you may use the 'L' key to switch between linear and loga-
	rithmic scaling. Use the Page-up/down key's in combination with the <Shift> or
	<Ctrl> key to change the high and low ranges or the stepsize. These functions are
	also available through the 'Far field' menu-bar option. 
	To set your own personal settings, you may use the 'Settings->Polar-plot settings' 
	on the 'Main' form. These settings are saved and re-used the next time you start 
	4nec2.

	To get the gain and angle for a particular point on the pattern it is possible to 
	select a point on the pattern line with the mouse and click the right mouse button.
	Use the 'I'(nfo) key or 'Show->Info' the get additional information about maximum
	gain, front to back ratio and beamwidth. 

	Use the <Home> key once to 'normalize' the far field pattern for the actual pattern.
	To 'normalize' as opposed to the overall maximum gain, push the <Home> key again.
	A third push will bring you back to the default un-normalized mode.
	By default the total field is displayed, to view the other generated patterns use
	the ','(<) and '.'(>) key's.	


3) Generate frequency loop data

	In this third example the Example3.nec input file is loaded. In this file an
	inverted-V antenna for 80 meter is used. The top of this antenna is brought to
	a height of 20 meters, and a ground specification (GN card) is included.
	For easy reading, Tab characters are used to separate the different nec2 card 
	values. If you take a look at the 4nec2 input file (F6), you will see three types 
	of 'GN' cards, two of them are preceded by an "'" sign, so they are treated as 
	4nec2 comment. The other one (default the GN 2) card is 'active', so in this 
	example the Sommerfeld-Norton ground for a conductivity of 0.006 S/m and a 
	dielectric constant of 14 is used (average ground, see the 4nec2 help)   

CM Example 3 :	Inverted-V over ground
CM 		See GetStarted.txt
CE 
SY hgh=20				' Height
SY len=20				' Wire length
SY ang=110 				' Angle between sloping wires
SY Z=len*cos(ang/2), X=len*sin(ang/2)	' Get delta-Z and -X distances
'
GW	1	20	-X	0	hgh-Z	-0.1	0	hgh	#12 ' radius for #12 wire
GW	2	1	-0.1	0	hgh	0.1	0	hgh	#12
GW	3	20	0.1	0	hgh	X	0	hgh-z	#12
GE
'
'GN	-1
'GN	0	0	0	0	14	.006	' Sommerfeld ground
GN	2	0	0	0	14	.006	' Sommerfeld ground
EX	0	2	1	0	1	0	' Default voltage source
FR	0	1	0	0	3.680		' Design frequency
'
EN							' End of file

	To generate frequency loop data, Enter the F7 key, and select 'use frequency loop'.
	By default this setting generates a graph showing antenna input impedance for the
	specified frequency range.  On the lower half of the window additional input boxes
	appear. For now we select the 'None' option, indicating we are not yet interested 
	in the far field pattern changes. Please enter a frequency start-value	of 3.5, 
	a stop value of 4 and a stepsize of .02 Mhz, and click the 'Generate' button.
	When calculations are done a third window is displayed called the 'Impedance' win-
	dow. In this window you can switch between the impedance or SWR/refl-coeff. graph 
	by using the 'Show' menu-bar option. Use the 'Up','Down', 'Page-up' and 'Page-Down'
	keys to move and zoom the graph. Use the 'Tab' key to select one or both graphs.
	
	4nec2 also has the possibility to display the input impedances on a Smith chart. 
	Enter the F11 key to select this option. Use the cursor keys to select a specific
	frequency. More experienced users may use the <Shift> key in conjunction with the
	cursor keys to 'add' a certain length of feedline. Use <Home> to (de)normalize.

	To view the changing for, for example, the vertical far-field pattern when fre-
	quency increases from 3 to 30 Mhz, please enter F7, 'use frequency loop' and select
	the 'Ver'tical option. Enter 3, 30 and .5 for frequency start, stop and stepsize. 
	Enter -90, 90 and 2 for Theta start, stop and enter 90 degrees for the Phi angle of 
	interest. Click 'Generate' and when calculations are done, you can 'walk' through
	the different vertical far-field patterns on the 'Pattern' (F4) form with the 
	'Left' and 'Right' arrow key's.

4) Optimizing radiator length for resonance.

	In this example again the 'Example3.nec' input file is used, but now we will opti-
	mize the radiator length for resonance. To do this, start the Optimzer by entering
	the F12 key. A new window appears, in which in the upper left side, under 'Avail-
	Vars' you can select one ore more Varaibles (Symbols) to optimize. Furthermore you
	must select one or more antenna parameters to optimize. To optimize for resonance,
	please enter a value of 100 in the 'X-ant' box, meaning the Reactive component for
	the input impedance is minimized. (Click with the right mouse key on one of the
	parameters to change the target) Be sure all other parameters are set to zero. 
	Next select 'len' as the variable to optimize. This variable should be the only 
	one in the 'Sel-Vars' box. After clicking the 'Optimize' button the optimizing pro-
	cess starts and the button text changes to 'Halt'.

	In the upper right box, the selected variables and the direction, and the relative
	amount in which they are changed are displayed. In the lower left box the calcula-
	ted parameter values are displayed for each new optimization step. In the lower 
	left window the corresponding variable size(s) is/are displayed, so it is possible
	to follow the optimizing process.
	After some time the process should stop with the message 'Optimized in XX steps',
	indicating the optimization is ready. To abort the process, you may click the 'Halt'
	button. It is possible the process is not immediately halted. If so, please wait
	till the active calculation step is ready, or click the 'Halt' button again. 
	After the process is ready or aborted, you may change the variables or parameters
	and continue optimization by clicking the 'Resume' button.	

	If the optimization results are OK, you may use the 'Save results' button to save 
	the new variable value(s) in the *.nec input-file. Use 'Exit' to quit the optimizer
	without saving.

	Variabele changes are reflected on the Geometry view. To view them, after starting
	the optimization process, please move the optimizer window to the lower left of the
	screen. If optimization is done for Gain and/or Front to Back ratio, and a resolu-
	tion not equal zero is set, the far-field pattern changes are also reflected on the
	Geometry (if 3D pattern is enabled) and Pattern screen.


		To be continued.........


