Getting started with the 4NEC2 version 5.3 visualization and optimization tool for NEC-2/4. Content: 1) Create an antenna model using 'Geometry Edit'. 2) Show structure; generate data and view currents and phase distribution. 3) Generate Far-field data and view 2D polar and 3D far field patterns. 4) Generate frequency loop graphical-data. 5) Optimize antenna performance. 6) Sweep antenna variables. 7) Generate and view Near-field data. 8) Generate and use ItsHF area-coverage propagation data. [9) Generate and use ItsHF point-to-point propagation data.] Before starting this tutorial, note that there are two different ways of using the 4nec2 program. The first way is recommended for the starting modeler and uses the drawing-style 'Geometry editor' to create or modify an antenna model. This method however does not allow the user to directly use the traditional- and/or genetic- optimizer functions. To use the optimizer or sweeper it is required that the model includes at least one variable (SYmbol) to optimize. These variables however can only be specified using the 'Notepad' or 'NEC' editors. How to specify and use SYmbolic information is descri- bed in the items 2 to 8 below For these items 2 to 8 it is helpful if the reader has some basic knowledge about modelling 3-dimensional wire structures, using Nec-2 or Nec-4. Especially the use of GW, EX, FR and LD cards. Information's about this can be found in the initial pages of the Nec-2 user-manual available on the Internet at www.qsl.net/wb6tpu/swindex.html. 1) Create an antenna model using 'Geometry Edit' As a starting-point we will create a basic 20-meter dipole fed with 50-ohm feedline. To show none-metric unit usage we consider ourselves for a moment as an US-citizen using Inch and Feet as the basic length unit.... The below specifications apply: - antenna height 70 feet - wire length 33.7 feet - wire radius #12 AWG - feedline length 69 feet (electrical length) First we open one of the existing example files (e.g. 36dip.nec). If not already done so, specify 'Geometry Edit' as the prefered Edit method using the 'Settings' menu on the 'Main' window. Furthermore select 'Feet' as the length-unit and 'Inch/Awg' as the 'radius-unit' using this same 'Settings' menu. When done, select 'Edit -> Input-file' on the 'Main' window or use the key to start 'Geometry-edit'. A picture of the selected example file is displayed. If not already set, select 'Options -> Set Segmentation -> Medium' on the Edit window to set medium segmentation density To create a new model, Select 'File -> New' on the Edit-window. *) Setting design frequency When starting a new model, initially on the lower right, frequency 'data' is displayed. This because one of the first things we will have to do is specifying the antenna design-frequency. Enter 14.15 (MHz) in the 'frequency' text-box on the right part of the window. When entered, click the 'wire' button on top of the window (the one with the single line in it). Notice the grid-size changing from .025 to .5 feet, correspon- ding to about half a wavelength for the window-width. Furthermore the default 3D- display view is now set to 2 dimensional XZ plane. (The Y-axis is pointing backwards) *) Add new wire(s) To start adding a new wire, click the 'Add' button. The mouse-pointer changes to a cross-hair, indicating 'Add-mode' is activated. The Y-position text-box on the right is now highlighted. If required you can specify a certain 'depth' position, but for now we will stay in the XZ-plane for an Y-position equal zero. When you will try to locate a mouse-pointer position for which the height Z equals 70 feet, you shouldn't succeed, because the grid-size is too small to cover a Z posi- tion of 70 feet. First increase grid-size to 1 feet by clicking on the left arrow for the 'Zoom' scroll-bar. When done, point somewhere inside the picture-box (that part of the window where the antenna structure is displayed), hold down the right mouse-button and move the X-axis to almost at the bottom of the picture-box. Now you should be able to locate a position for which Z equals 70 feet somewhere in the upper region of the picture-box. Because we want to create a line at Z=70 feet with a length of 33.7 feet we will have to locate a point for which Z = 70 and X = -33.7/2 = 16.85 feet. However, because the 'Snap to grid' box is checked you won't succeed in this. For now we will locate a position for which X equals -17 feet. To start drawing the wire, click and hold down the left mouse-button and drag the mouse-pointer to the second position for which Z=70 and X=17 feet, then release the mouse-button. Because this is the first wire added to the model, a pop-up window is displayed asking for the initial/default wire diameter. Use the supplied default of .05 inch. Now the first wire, the dipole itself, is created. On the right of the picture-box all data belonging to this wire is listed. You can edit the end-1 or end-2 coor- dinates text-boxes to further refine the end positions. You will also notice that the number of segments is set to 25, corresponding to 'medium segmentation'. The second wire, to connect the other end of the feedline, is done the same way by drawing a line from x=-1 to X=+1 for a height Z=1. This second wire is automatically divided into 3 segments. Because we only need this wire to attach one end of the feed-line, manually change the number of segments to 1. Don't worry in case you did not position the wire-ends at the right coordinates. To move wire-ends, click the 'pointer' button and place the mouse-pointer on the wire- end to move. The mouse-pointer should now change to four-arrows, meaning you can move the wire end. Hold down the left-mouse button and move the wire end to the required position. As an alternative you can also directly edit the end-1 or -2 XYZ values. *) Add feed/transmission-line(s) Next we will have to add the feedline. But, before doing so we need some knowledge about how wires are identified in Nec-2/4. All wires are assigned a unique tag-nr. Mostly the tag-number equals the wire-number. Ater delete, copy or paste operations however this sequence may have changed. Tag-numbers should still be unique. You may use 'Resequence tag-numbers' in the 'Option' menu to make tagnumbers equal to the corresponding wire-numbers again. Each voltage/current-source, transmission-line or RLC-load (see below) is 'assigned' to a wire using this unique tag-number. To specify the position of the source, TR- line or load on the specified wire a segment-number between 1 and the nr-of-segments for the wire is used. Using Geometry-edit these tag- and segment-numbers are automatically assigned. It is allowed to change these number manually. When doing so please note how these tag- and segment-numbers are used within Nec-2/4. Adding/creating a transmission-line is done by clicking the 'TR-line' button (the one with the ladder picture). If not in 'Add-mode', click the 'Add' button to start adding a new Tr-line. Locate the mouse-pointer on the middle of the first wire and click and hold down your left mouse-button and move the mouse-pointer to the middle of the second wire. When reached release the mouse-button. When positioning was not too rude a new transmission-line is now added. If not, try again. Note also that we did not take the velocity-factor into account, we just used an electrical length of 70-1=96 feet. *) Add voltage source To prevent loosing the changes, backup the model using 'File->Save as' and choose a folder- and file-name for your new model. The next thing to do is add a voltage-source. While still in Add-mode, click the 'Source button' (right of the 'Wire button'). Next click and hold down your left mouse-button somewhere in the picture-box. At the current mouse-pointer position a new source-object is displayed. Drag the source-object to the middle of the second wire, just between the two lower wires-ends of the feedline and release the mouse- button. When properly positioned a new source is now added. If not try again. For now we will set a default voltage-source of 1+j0 volt (1V @ 0 deg.) Select the 'pointer' button to switch back to select-mode mode. The mouse-pointer changes to the default arrow-pointer indicating 'Select-mode' is active. *) Add wire-conductivity We use copper wire for our antenna, so we will have to include this in our model (the default is perfect wire with zero losses). To do this, click the 'Loading button' (the one with the RLC symbols), click somewhere in the picture-box and drag the new load-object to any place on the first (upper) wire and release the mouse- button. The new load-object is now 'connected' to the first wire. The default load however is a lumped load. To change this to a distributed/wire-load, change the 'Par-RLC' selection for the Load-data on the right of the screen to 'Wire-ld'. The box shape on the first wire should now have changed to a red line- segment. The initial conductivity is set to 10000 mho/m. Change this to 'Copper' by using the 'G (mho/m)' selection-box on the right of the picture. To specify wire-conductivity for the whole structure, first change from 'spot load' to 'single-wire' (see lower right) . Notice how the whole wire becomes 'wire-loaded'. Next change to 'Whole struct'. The 'Wire-conductivity' is not visible any more. This would not deliver us additional information because the whole structureis now loaded (both wires). To enable wire-loading display for the complete structure use 'Option -> Show wire loading'. For now we have added all required objects. Switch back to 'Select-mode'. *) Select/move objects The attentive user will have noticed that we did not yet explicitely specify our wire radius (half the diameter). We will do so now. While in 'Select-mode', click the wire button and select the upper wire (wire 1). The wire color will change to red (if not already set), indicating this wire is selected for modification. In the wire-data on the right part of the screen select #12 as the wire-radius for wire 1. Select wire 2 and change the radius also to #12. Also click the 'Trans-line' button to set the 'Char-Imp./Z0' to 50 ohms. To move a wire, click the 'Wire' button again and select the required wire. When the mouse-pointer is over the selected wire the pointer changes from the default to a two-point or four-point indicator. When a two-point indicator is visible one can move the whole wire at once. When a four-point indicator is visible one can move the corresponding wire-end. Move a wire(end) by clicking on the wire(end) and hold down the left mouse-pointer while dragging it to a new position and releasing the mouse- button. When XY, XZ or XY plane (2D) is selected you can move a wire(end) to any place inside the picture-box. When 3D-view is selected however be careful with this, because a moved wire(end) automatically connects to the another near wire-end. To undo the latest move-action use the 'Edit' menu or move the mouse-pointer over the wire(-end) till a two/four-point mouse-pointer becomes visible and click the right mouse-button. A pop-up window is now displayed in which you can select 'Undo move'. The same principles apply for moving sources, loads and transmission-lines. However these objects can only be moved from one wire(segment) to another wire(segment). You can textually change/edit XYZ-, wire-, tag- or segment-position by selecting the required object and modify the 'object' data on the right of the screen. If required, backup or save your model by using 'File->Save(as)' to be able to restore a previous model in case you made a serious mistake. *) Specify ground parameters By default a new model is located in 'Free space'. To model an antenna over ground, select the right-most 'Ground Params' button and select between Free-space, Perfect-, Finite- or SomNec-ground. For now we will use the finite-ground, also know as 'fast- ground'. Change from 'User-specified' to 'Average' (Clay/Forest) ground. Conducti- vity is now automatically set to 0.005 Siemens and 'Diel-const' is set to 13. To view the corresponding NEC-syntax for all wires and other objects we created, use 'Options->View Nec data'. *) Run NEC-engine and create far-field pattern. To run the NEC-engine and evaluate your model, click the 'Run Nec-engine' button (the one with the calculator picture) or push . A new pop-up window is displayed asking you for additional settings. To create a full 3D far-field pattern, select the second option 'far-field pattern', specify 'Full' and a 5 degree resolution. Then click . If the DirectX based version of 4nec2 is installed, push to visualize the new antenna-structure Select 'Pattern' or push the 'R' key to see the 3D far-field pattern. You can return back to your model by pushing or clicking the 'Geometry-edit' window. You may alter your model (e.g. set to 'Free-space') and recalculate to see the results of your changes. For another example of creating a T-antenna on a box, see appendix A at the end of this document. 2) Show structure, generate data and view currents and phase distribution. In this next example it is explained, how to open a NEC antenna model, view/edit (4)nec(2) input-file data the traditional way, generate NEC-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/windows are discussed. After starting the 4nec2 program by double clicking on the 4nec2 shortcut or on the 4nec2.exe program-file, a file selecttion window is displayed. This initial window is used to select the (4)nec(2) antenna model file to open and work with. In this first example please locate the file ..\4nec2\example1.nec and click the open button. If no NEC-output is generated yet for the selected file, the data loaded into 4nec2 will be that for the (4)nec(2) input-file. 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 (F2)' or the 'Geometry (F3)' form to the foreground. To indicate that the you are currently viewing the input-file data, the background for the 'Geometry' form is displayed in a none white color. Note also that in this case, most of the fields on the 'Main (F2)' form are empty. You may use the arrow key's to rotate, shift or zoom 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 you can also use the Control key together with one of the arrow-key's. Use the 'Home' key to reset the geometry form. If you have installed the 4nec2X extended version you could use the F9 key to view your nec-model using real-time 3D rendering techniques. Use your mouse-buttons (left, right or both) to rotate, shift and zoom the model. To view the textual contents for the NEC input-file, first check if the default editor is set to 'Notepad edit'. This is done using the 'Settings' menu-bar option on the 'Main (F2)' window. If set, push the 'F6' button or use the 'Edit->Input-file' menu-bar option on the 'Main' window to start the Edit session. The active *.nec input file is loaded in the editor, and you should see something like this: 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 First we see two CM (ComMent) cards, where some explanation is given about the file. After these comment cards always a CE (Comment End) card is required. CM cards are the original cards used to add NEC comment. 4nec2 also allows you to add comment by using a ' character. Everything after this character is treated as comment and ignored by the NEC engine. Next we see a GW (Geometry Wire) card, specifying a single dipole wire with a length of 2 times .2418 meter. The X, Y and Z coordinates for end-1 are ( 0, -0.2418, 0 ) and for end-2 ( 0, 0.2418, 0 ). This wire is given a 'tag' number of "1" and is divided into 9 equally long segments. After the GW card(s) always a GE (Geometry End) card is required. Then we find an EX (excitation) card of type "0", specifying the most commonly used voltage-source type. This voltage source is located on the wire with tag 1 and the segment with sequence number 5. (seen from end-1). The excitation voltage is spe- cified as a default 1 + j0 volts. (1 V at 0 degrees). The (design) frequency for this antenna is specified with the FR card. In the above example we specify this as (a single step for a frequency of) 300 Mhz. The end of the input file is marked with an EN card. To modify a (4)nec(2) input-file the 'Edit' window is used, but for now we quit this edit session without saving, by clicking the Notepad 'Close' button. To start the NEC engine and generate NEC output-data, be 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 or click the 'Generate' button. When this is done, a black DOS-box is displayed, indicating that the Nec2d.exe engine is running. This engine reads the active *.nec input file data, processes the given data and writes the calculation results back to the output file. This output file is created in the '..\4nec2\out' folder. Before starting the engine, the input-file data is pre-processed by 4nec2 to remove comment, calculate variables, convert current-sources or perform auto-segmentation. The intermediate file with the *.inp extension is sent to the NEC-engine. If NEC errors are reported you can inspect the output-file data using the F8 key or select 'Edit -> Output-file'. To view the 'raw' input-data send to the NEC engine use 'View->Last NEC input' on the 'Geometry (F3)' form. 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. Before starting the NEC-engine, optionally a 'geometry validation' test is done. If enabled, any geometry errors/warnings are logged. Calculations however are still performed. When calculations are done, 4nec2 performs a 'segment validation' test. In this test most of the NEC requirements concerning segment-length and -diameter are checked. If errors are detected a message is displayed and the wires/segments with errors/warnings are highlighted. Use 'Validate -> run geometry check / run segment check' to manually run the tests and/or get more textual information. To get more detailed segment info, select the desired segment with the mouse and use the left mouse button. With the 'Wire/Segment' 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 highlighted, 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 cartesian 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. 3) 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=wavelength/4 ' 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 Example 1, however if you use the F6 key you will notice some differences. First of all, special 4nec2 "SY" cards are inclu- ded. With this card it is possible to specify symbols(VARIABLES), constants or mathematical expressions (equations). In this example the dipole length is repre- sented by the symbol 'len'. It has the value 0.4836. In the GW card this variable is used as 'len/2' to specify the Y coordinates for both ends of the dipole wire. Furthermore a LD 5 (wire 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 in the Geometry form to view additional Wire information. To generate a 3D far-field pattern, press the F7 key and select the second option called 'Far-field pattern'. In the lower half of the form, additional fields are displayed to specify a certain pattern-resolution and a check-box to include the surface wave into the combined far-field pattern. The pattern-resolution specified how fine or course the generated pattern is. Fur- thermore this affects 4nec2 memory-usage and NEC processing-time. For 'simple' antennas like our dipole a resolution of 5 or 10 degrees will be fine. For multi- element antennas like the 'emeyagi.nec' a reolution of 1 degree may be needed. For now, the 'surface wave' option should not be selected. The option boxes on the right should be set to 'Default pattern'. Experienced NEC-users can use one of the other options or even use the 'more' button to get extra options. When the 'Generate' button is pushed, the NEC-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. To 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 mouse-buttons or 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 (elevation) or phi (azimuth) angle is highlighted. This helps you to understand where the selected 2D pattern is located in the full 3D-pattern. On the 'Pattern' form you can use the 'L' key to switch between linear and (semi) logarithmic scaling. By default the pattern is normalized for maximum gain for the current Theta(elevation)/Phi(azimuth) angle. The Max-gain value is displayed in the upper left corner. To normalize against the overall maximum gain, press the key. To disable all normalization, press the key again. A third push will bring you back to the default state. 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 beam-width. By default the 'total field' is displayed, to view the other generated patterns use the ','(<) and '.'(>) key's. Use the 3D-viewer/ (4nec2X only) to view the far-field data in 3D perspective. 4) Generate frequency loop graphical-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 NEC 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 a " ' " sign, so they are treated as 4nec2 comment. The other one (the GN 2) card is 'active', so in this example the high accuracy Sommerfeld-Norton ground is used. 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 average 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 GW 2 1 -0.1 0 hgh 0.1 0 hgh #12 ' #12 wire GW 3 20 0.1 0 hgh X 0 hgh-z #12 GE ' 'GN -1 ' Perfect ground 'GN 0 0 0 0 14 .006 ' Finite 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 In this example the 'sin' and 'cos' mathematical functions are used to calculate the delta-X and -Z distances for the outer ends of both sloping wires. To generate frequency loop (frequency sweep) data, Enter the F7 key, and select 'Use frequency loop'. With this calculation-option line-chart graphs are generated for Forward-gain, Front-to-Back ratio, Front-to-Rear-ratio, SWR and input impedance. When selecting this option additional input-boxes appear. For now we select the 'Gain' option. Please enter a frequency start-value of 3.5, a stop value of 4 and a step-size of .02 Mhz. Enter a value of 90 for the Phi angle and a value of 55 for the Theta angle, and click the 'Generate' button. When calculations are done a third window is displayed called the 'Line-chart (F5)' window. In this window you can switch between "S"(SWR), "G"(Gain) and "I"(impedance) display. Use the "L" key to switch between linear and logarithmic Y axis scaling. Use the "F" key to change to X-axis scaling. By default the SWR, R-in and Z-in graphs are set to logarithmic, the others default to linear. When linear scaling is set you can 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 key in conjunction with the cursor keys to 'add' a certain length of feedline. Use 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 step-size. Again enter 55 for the Theta- and 90 for the Phi-angle of our direction of interest. Click 'Generate' and when calculations are done, you can 'walk' through the dif- ferent vertical far-field patterns on the 'Pattern' (F4) form with the 'Left' and 'Right' arrow key's. Note: Select the Nec2dSX engine for increased accuracy when running a frequency- loop using SomNec ground settings. 5) Optimize antenna performance. In this example again the 'Example3.nec' input file is used, but now we will opti- mize antenna-performance. As a first try we will use the traditional hill-climbing optimizer and optimize radiator length for resonance. To do this, start the Optimi- zer by entering the F12 key. A new window appears with a number of selection- and input-boxes. First we set the traditional optimizer by selecting 'Optimize' in the Function-box and 'Default' in the Option-box. After this we select the variable(s) we want to optimize, by clicking on the 'len' variable in the list-box with the 'variables' heading. The selected variable(s) will show-up in the right list-box. Furthermore you must select one or more antenna properties to optimize, together with their "importance" (weighting factor, contributing in the total result). To optimize for resonance, please enter a value of 100 (%) in the 'X-a' box, (all other values must be set to zero) meaning only the Reactive component con- tributes for 100% in the total result. (FOM, figure of merit). To get resonance, this property must be minimized. This is the default for the 'X-a' property. (Click with the right mouse key on one of the property-boxes to change this default target) After clicking the 'Start' button the optimizing process starts and the button text changes to 'Halt'. In the upper right box, the selected variables together with the direction and relative amount in which they are changed are displayed. In the lower left box the calculated property values are displayed for each new optimization step, together with the calculated overall result (Res%) and the step-size used. In the lower right box the corresponding variable value(s) is/are listed, 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 premature 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. Sometimes it may be necessary to click the button once more. After the process is ready/aborted, you may change the variables or properties and continue optimization by clicking the 'Resume' button. If the optimization results are OK, you may use the 'Update NEC-file' button to up- date your NEC-file with the new variable value(s). Use 'Exit' to quit the optimizer without saving. In the same way you can optimize for Forward-Gain, Front-to-back- and/or Front-to- Rear-ratio. If one or more of these properties are selected, you must also specify the Forward-Gain and (for none default angles) backward-gain angle to calculate for. For quick optimizations, a resolution of "0" (zero) could be used. In this case only the Gain for the specified Forward- and backward-angles are calculated and no additional Front-to-Rear data is calculated. For more precise optimizations, a none-zero resolution (e.g. 5 degrees) could be set. Now a complete 3D pattern is calculated for each optimization step, so the difference between the Forward lobe and the largest side-lobe in the backward 180 degree part of the pattern is calculated and displayed as the Front-to-rear ratio. If optimizing for Gain or F/B, one may also specify a delta Theta and/or Phi for the forward- and/or the backward-angle. If a none-zero value is specified, the gain is averaged over the range between Phi - delta_phi and Phi + delta_phi. The same holds for the Theta angle. Mostly optimization is performed for total-gain. If required, however you may opti- mize for horizontal/vertical-gain or E-theta/E-phi. Optimization with included sur- face-wave is also possible. Variable changes are reflected on the Geometry view. To view them, after starting the optimization process, please move and/or resize the optimizer window to the lower left part of the screen. If optimization is done for Gain and a none-zero resolution is set, the far-field pattern changes are also reflected on the Geometry (if 3D pattern is enabled) and the Pattern form. The optimization steps are logged in the optimzer.log log-file. This file can be viewed with 'Show -> Optimizer log' in the Geometry window. 6) Sweep antenna variables. With version 5.3 and later it is possible to evaluate and graphically visualize the effect of antenna variable changes. To make this possible a variable-sweeping func- tion has been added in the Optimizer function box. If, after enabling the optimizer window (F12), this Sweeper function is selected, the optimizer window changes a bit. For each selected variable the minimum (start) and maximum )stop) values to sweep between is displayed. YOu can manually change these min/max values. Furthermore a 'Nr of steps' input-box is displayed, with a default value of 10. Using the 'Options' selection box ypou are able to select between the vertical of horizontal or 3D far-field pattern. To evaluate the effect of changing antenna height from 20 to 30 meters, we use the '3el-inverted-V.nec' file. After loading this input file, start the optimizer/sweeper, select 'Sweeper' and select 'hgh' as the variable to sweep. This variable is now added to the 'selected' list', default values of min = 10.5 and a max = 42 meters is set and a default number of 10 steps displayed. To sweep a height change from 20 to 30 meters select the 'hgh' value in the 'selected' list (click again if the variable is removed) and change the min and max values to 20 and 30. Set the Theta- and Phi-values to 55 and 90 degrees to specify the angle for which Gain is calculated. Specify a resolution of 10 degrees. (If resolution equals zero, this will increase sweeping speed, however no pattern is calculated and displayed) Click the Start button to start the sweeping process. First of all an initial step is made with the default height of 20 meters. After that 10 incremental steps are made in which each step the height is incremented by 1 meter. The resulting SWR, Gain, F/B, F/R, R-in, X-in and efficiency values for each step are reported in the 'Calculated Results' box. The resulting horizontal far-field pattern for each step is updated on the 'Pattern (F4)' and 'Geometry (F3)' window. If all steps are done, you may use the 'Exit' button to close the optimizer/sweeper window or change/add/remove variables, change settings and/or proceed with another range of steps, by clicking the 'Restart' button. After closing the window, all results for the last sweep are reported in the line- chart graphs on the 'F5' form. The horizontal or vertical patterns (according your selection) for the different calculation steps composing the sweep are available on the 'Geometry (F3)' form. Use the Right- and Left-arrow-key's to switch between steps. Use the 'Show Log' button to view or print the last sweeper results. Note however that as distinct from the default 4nec2 operation, the sweeper results are only stored in memory, and not in a NEC output-file. So, if 4nec2 is left or the input file is viewed or another 4nec2 file is selected. The sweeper results are lost. The log-file is kept as long as a new optimization or sweep is done. 7) Generate and view Near-field data As an example to generate near-field data, the file NearFld.nec is included in the package. To use this example, please load this file and push the F7 key to get the 'Generate' window. Select 'Use original file', to start the calculation. This input-file already contains the required NE card is, so it is not yet necessary to specify any near-field parameters. Calculations will take some time, because almost 30.000 near-field points are calculated. When calculations are done, the Pattern windows is displayed with the 'Near-field' lay-out. Initially you mostly will see a blue plane with on the left a color-bar telling on the left, telling you what field-strength is represented by a certain color. The maximum value will be in the range > 1e+4 volts/m. This is due to the fact that one or more of the calculation points will be very close (or maybe on) a geometry wire with high RF-voltage/current. To get rid of these 'unusable' high values, please use 'Near-field -> Ignore high values" or push the key. You are asked for maximum field-strength. Please enter a value of 250 (V/m). The display should now change to a more colorful view. The color-bar on the left is also updated. Another way to change the color-resolution, is to use the together with the or keys. This will change the linear scale to a more logarith- mic scale. Use 'Show -> Geometry' or the "G" key to display the geometry- structure. Initially the field-strength on the XY plane for a certain Z value is displayed. To change the Z-value use the cursor-left or -right key's. To change between XY, YZ and XZ plane, use the spacebar. On the Geometry form you are also able to display the Near-field points. Use 'Show -> Near/far field" or push the "R" key. Use the spacebar to switch between 3D view, or 2D XY, YZ or XZ view. Use plus the arrow-keys to change the 2D plane coordinates. Use / to change the dot-size. On the 'Pattern' form on the left and on the right of the 2D plane, two black indicator lines are displayed. These indicators are used to select a certain Y- or Z value for displaying the field-strength using a line-chart. Use the Up/Down arrow keys to change position, use / to switch between 2D and line- chart viewing. Use the 3D-viewer/ (4nec2X only) or the "Plot -> 3D" menu-bar command (if gnuplot is availle) to view the far-field data in 3D perspective. 8) Generate and use ItsHF area-coverage propagation data. This feature works in conjunction with the NTIA/ITS HF propagation software ICEPAC, VOACAP & REC533. This software is freely available on the internet. After installing this software, you should create a '\nec' sub-folder in the '\antenna', '\areadata' and the '\saved' folder under the ItsHF main-folder. These folders are used by 4nec2 to place the generated (data) files. Under 'Settings->Folders' please specify your ItsHF main-folder and the 'nec' sub- folder names, for instance 'C\ITSHFBC\ and 'NEC\'. Furthermore, be sure all 3 options under 'Settings->ItsHF settings->Area Coverage' are checked. With this first try, we use the 3el-inverted-V.nec as our input file. First we run a standard 3D far field calculation, to determine the Phi angle for the main lobe. For this antenna this is 90 degrees (positive theta). After pushing the key again, we now select the 'ItsHF area coverage' option. If not already set, specify 90 degrees for the main beam angle and 7.05 Mhz for the design frequency and push . After running the nec2d(xs) engine the ItsHF engine is started (characterized by the counting number sequence), and when done, a color-full map is displayed, indicating the signal power distribution for the selec- ted antenna over Europe. The plot settings for this map are set in the '3el-inve.ice' file (truncated to eight char's) located in the '\antenna\nec' folder. You may start the ItsHF ICEAREA pro- gram to open, view or modify this file. Use 'run->calculate->Save/Calculate/Screen' to create a new plot after you modified one or more settings. Just rerun the 4nec2 'Area-coverage' function to restore the original file. In the '3el-inve.ice' file you will see that for the TX-antenna, '3el-inve.n13' is set, indicating our NEC based antenna. This type-13 antenna-file is located in the '\antenna\nec' sub-folder. You may use the HFant program to open this file and view the pattern. Each time a 'Area-Coverage' calculation is done by 4nec2, a new *.ice input file is created. This file is based on the information included in a default ItsHF input- file called 4NEC2.ICE placed in the \antenna\default folder. Modify this file to specify your personnel settings, like transmitter/receiver location, power etc or to specify different time or date. The next time you run a 'area-coverage' calculation this data is imported in the .ice input file and reflected in the area-coverage plot. Sweep area-coverage: With the 'Sweeper' function it is possible to let 4nec2 automatically generate a specified range of area-plots for you. For instance, representing the area-coverage change when increasing the antenna height from 15 to 30 meters. To do this, again select the 3el-inverted-V.nec file as our antenna of interest and push to start the optimizer/sweeper. Select 'Sweeper' using the 'Function' box and select 'Area-coverage' using the 'Option' box. Select 'hgh' as the variable to sweep and specify min=15 and max=30 (meters). Set 90 degrees as the Phi angle for the main-beam and specify 10 steps of 10% variable change, and click . During all the calculations, which will take some time, you will see the windows popping on and off the screen. After some time this stops and the Sweeper title- bar will show 'Sweep ready'. You may now exit the sweeper and 4nec2. To view all the generated plots, we will use the 'Viewer' program, included in the 4nec2 package. After starting 'View.exe' in the 4nec2\exe folder, select 'File-> Open new picture' and select the '..\areadata\nec' folder in you ItsHF main-folder. Specify '*.ig1' as the file extension and select the '3el-inv00.ig1' file as the file to open. (the last two zeros specify the first picture for the generated plot sequence) Next you are asked for the number of pictures to load, If the previous sweep was completely finished, a number of 11 should be set. Select to load all eleven pictures. Again a number of (plot) windows will pop on and off the screen, automatically cutting and pasting the plot maps into the viewer program. After some time the message '11 pictures pasted' should show up, indicating all area-plots are loaded. Latest test-results on different systems show that this automatic cutting and pasting appears to be sensitive. If you should experience difficulties during this process, please contact me so I can deliver you an alternative. After confirming the message you can toggle between all loaded area-plots by using the up- and down-arrow keys. You are now able to evaluate the effect of changing antenna height on area-coverage. You will notice that for a height of around 21 meters the optimum F/B ratio is reached. This was the original height the antenna was optimized for. When leaving the 'Viewer' you are asked if you would want to save the loaded files as bitmap *.bmp files. This allows for faster loading the next time you want to view the generated area-plots. Choose Yes to convert all *.ig1 to *.bmp files. Choose No if you have limited disk space. To be continued..... (it is suggested to periodically check the 'unofficial Nec-page' for new versions) p.s. I apologize for my English which is far from perfect, but nevertheless I hope this document, including all the syntactical- and other errors, does deliver some usefull information. Appendix A: Example: Creating a T-antenna on a box using the Gometry editor The second example will give a brief description about one of many possibilities how to create a much more complex 3D-model consisting of a T-antenne on a grid-type box. The below might seem as a lot of work, but once you 'get the point' you will see the rather straightforward use of available possibilities. a) Create a new design using'New' in the Geometry-editor 'File' menu. b) Change default frequency of 299.8 to 299.9 Mhz, indicating frequency is set. c) Select 'Rect-grid' from the 'Create' menu and specify a (highlighted) 'Y'- coordinate of 0.2 to create the back-side of the box (Y-axis pointing backwards) d) Draw a rectangle from X=-0.2 and Z=+0.2 to X=+0.2 and Z=-0.2 meters, using 4 sections per side. e) One by one select left- and right outmost-wires and delete them, to avoid over- layed wires when attaching grids representing left- and right-side of the box. f) Select all left-over grid-lines again using the 'selection-box' method. g) Switch to XY-plane (view from above) and use +C and +V to copy and paste selected wires to create a second (front) side of the box. h) Move the new red-line, representing the new pasted 'grid' to an Y coordinate of -0.2 meters and an X coordinate from -0.2 to +0.2 meters. i) Switch to 3D-view, inspect structure and use 'File->Save as' to back-up the new structure as for instance 'try1.nec'. j) Switch to YZ-plane, select 'Rect-grid ' in the 'Create' menu and set a (high- lighted) X-coordinate of 0.2 meters to create the right side of the box. k) Now draw a rectangle from Y=-0.2 and Z=0.2 to Y=+0.2 and Z=-0.2 meters, using 4 sections per side. l) Switch to XY-plane (view from above) and use copy/paste to create the left side of the box and move the new 'grid' to an X-coordinate of -0.2 meters. m) Switch to 3D view, inspect structure, if okay, backup using 'File->Save' n) In 3D view, unselect by clicking anywhere near the structure while holding down the key. o) One by one select and delete all upper and lower wires to avoid overlayed wires when adding the top- and bottom-sides of the box. p) Switch to XY-plane, Use 'Create->Rect-grid' and set an Z-coordinate of 0.2 meter to create the upper side of the box and draw the required rectangle. q) Switch to 3D-plane, use copy/paste to create the bottom side of the box and move the grid to the correct position. r) Our box is now ready, backup it using 'File->Save'. s) Set XZ plane and use Right mouse-button to shift structure down to lower half of the window. t) Switch to 'Add-mode' and draw a wire from X=0 and Z=0.5 to X=0 and Z=0.2 u) Switch back to default 'Select-mode', select 3D-plane and locate mouse-pointer on connection between wire and box. v) Click right mouse-button for 'Edit' pop-up menu and use 'Disconnect end' and move end-2 to center of the upper-side of the box. w) Switch to 'Add-mode' and select XZ-plane to create two wires from X=-0.2 to X=0 and from X=0 to X=+0.2, both for a Z value of 0.5 meter. x) Select the 'Source' button and add a voltage source just above the connection for the vertical wire to the center of the box. y) Our T-antenna on a box is now ready, save it or use to generate a far-field pattern. As a check, compare your model with the T-box.nec file.