<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="../gus_xslt.xsl"?>
<gus_xslt
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://starling.ws/XML/gus_xslt.xsd">
<head>
  <navigation ToC="Table of Contents" section="yes" topic="yes" subtopic="yes" subsubtopic="yes" links="yes"/>
  <cgi img="no" img_action="../cgi-bin/gus_web_photo.pl" img_path="../XML/wmtkd" />
  <pdfmarks body="no" section="no" topic="no" subtopic="no" subsubtopic="no"/>
  <title>NEC Segs</title>
  <description>Calculate non-redundent segmentation of NEC files.</description>
  <keywords>NEC, segs, segmentation, AN-SOF, Perl</keywords>
  <author>Gan Uesli Starling</author>
  <copyright>2024, Gan Uesli Starling</copyright>
</head>
<body>
<title>NEC Segmentation</title>
<p class="center">A free, open-source tool for calculating non-redundant values of segs/wavelength.</p>

<p class="center"><a class="button" href="https://ky8d.net/free">home: ky8d.net/free</a></p>

<section>
<title>Introduction</title>

<p>In re-segmenting an AN-SOF or NEC model, small changes occasionally clone an exactly identical file. Take, for instance, the model below, segmented at 13 and 18 segments-per-wavelength for 5.332 MHz.</p>

<images>
	<img src="./Current_60m_13segs.png" href="./Current_60m_13segs.png">13 segs/WL</img>
	<img src="./Current_60m_18segs.png" href="./Current_60m_18segs.png">18 segs/WL</img>
</images>

<p>They are exactly identical! The same would occur were I to have segmented it at 14, 15, 16, or 17 segs/WL. Not until 19 segs/WL will the above model change at all for 5.332 MHz.</p>
<p>Herewith I provide a means to avoid wasteful trial-and-error by discovering <i>beforehand</i> which segmentations produce <i>unique</i> models. One then may proceed to explore model convergence in an <i>efficient</i> manner.</p>
</section>

<section>
<title>Usage</title>
	<images>
			<img src="./nec_segs_screenshot.png" href="./nec_segs_screenshot_200pct.png">Screenshot</img>
	</images>
	<p>My free, open-source program works on both Windows and Linux like so.</p>
	
	<topic>
		<title>On Windows</title>
		<ul>
			<li>Copy the file <code>KY8D_NEC_Segs.exe</code> into any directory containing one or more <code>*.nec</code> files</li>
			<li>Double-click the <i>starling</i> icon for <code>KY8D_NEC_Segs.exe</code>.</li>
			<li>Within the pop-up CLI window, enter segmentation frequencies one per line.</li>
			<li>Enter nothing when done.</li>
			<li>Open the file <code>./segs_per_wavelength.txt</code></li>
		</ul>
	</topic>
	
	<topic>
		<title>On Linux</title>
		<ul>
			<li>Copy the script <code>KY8D_NEC_Segs.pl</code> into any directory containing one or more <code>*.nec</code> files</li>
			<li>CD into that same directory.</li>
			<li>Enter <code>perl KY8D_NEC_Segs.pl</code>.</li>
			<li>Enter segmentation frequencies one per line.</li>
			<li>Enter nothing when done.</li>
			<li>Open the file <code>./segs_per_wavelength.txt</code></li>
		</ul>		
	</topic>
	
	<topic>
		<title>Units of Measure</title>
		<p>In <code>NEC</code> decks, it is strangely allowed for plural <code>GS</code> (<note>Geometry Scaling</note>) cards to be present. Almost never does anyone do this, as it would exert a <i>cascade</i> effect. Each succeeding <code>GS</code> card would then re-scale all prior scalings before it. My program therefore anticipates no more than a single <code>GS</code> card to be present, if any. If plural are found, all but the final will be ignored, with it alone exerting <i>universal</i> effect. This <i>ought</i> to be no problem at all.</p>
	</topic>
	
	<topic>
		<title>The Example</title>
		<p>A 5.6m vertical can indeed be used at 5.332 MHz. I employ just such a vertical in conjunction with an <i>LDG RT-100</i> remote auto-tuner for portable work. This real-world antenna easily covers 10m through 60m, WARC included.</p>
		
		<p><b>Link: </b><a class="button" href="https://ky8d.net/tripod_mnt/">Camera Tripod Vertical</a></p>
	</topic>
</section>

<section>
	<title>Sample Output</title>
	<p>Below is an example output file. Shown is the result of running <code>KY8D_NEC_Segs.exe</code> in a directory containing a single <code>*.NEC</code> file. Had there been plural files, all would have been parsed.</p>
<pre>Non-redundant segments-per-wavelength.

File = 36-radial_vert.nec
GW lines tally = 74
Unique lengths (m): 0.100, 5.500, 2.460, 8.888

Freq = 5.332 MHz
Segs/wire @ 10/wl: 1, 1, 1, 2
Segs/wire @ 11/wl: 1, 2, 1, 2
Segs/wire @ 13/wl: 1, 2, 1, 3
Segs/wire @ 19/wl: 1, 2, 1, 4
Segs/wire @ 21/wl: 1, 3, 1, 4
Segs/wire @ 23/wl: 1, 3, 2, 4
Segs/wire @ 26/wl: 1, 3, 2, 5
Segs/wire @ 31/wl: 1, 4, 2, 5
Segs/wire @ 32/wl: 1, 4, 2, 6
Segs/wire @ 38/wl: 1, 4, 2, 7
Segs/wire @ 41/wl: 1, 5, 2, 7
Segs/wire @ 45/wl: 1, 5, 2, 8
Segs/wire @ 46/wl: 1, 5, 3, 8
Segs/wire @ 51/wl: 1, 5, 3, 9
Non-redundant segs: 10, 11, 13, 19, 21, 23, 26, 31, 32, 38, 41, 45, 46, 51

Freq = 7.035 MHz
Segs/wire @ 10/wl: 1, 2, 1, 3
Segs/wire @ 15/wl: 1, 2, 1, 4
Segs/wire @ 16/wl: 1, 3, 1, 4
Segs/wire @ 18/wl: 1, 3, 2, 4
Segs/wire @ 20/wl: 1, 3, 2, 5
Segs/wire @ 24/wl: 1, 4, 2, 6
Segs/wire @ 29/wl: 1, 4, 2, 7
Segs/wire @ 31/wl: 1, 5, 2, 7
Segs/wire @ 34/wl: 1, 5, 2, 8
Segs/wire @ 35/wl: 1, 5, 3, 8
Segs/wire @ 39/wl: 1, 6, 3, 9
Segs/wire @ 44/wl: 1, 6, 3, 10
Segs/wire @ 47/wl: 1, 7, 3, 10
Segs/wire @ 48/wl: 1, 7, 3, 11
Segs/wire @ 52/wl: 1, 7, 4, 11
Non-redundant segs: 10, 15, 16, 18, 20, 24, 29, 31, 34, 35, 39, 44, 47, 48, 52

Freq = 10.125 MHz
Segs/wire @ 10/wl: 1, 2, 1, 4
Segs/wire @ 11/wl: 1, 3, 1, 4
Segs/wire @ 13/wl: 1, 3, 2, 4
Segs/wire @ 14/wl: 1, 3, 2, 5
Segs/wire @ 17/wl: 1, 4, 2, 6
Segs/wire @ 20/wl: 1, 4, 2, 7
Segs/wire @ 22/wl: 1, 5, 2, 7
Segs/wire @ 24/wl: 1, 5, 2, 8
Segs/wire @ 25/wl: 1, 5, 3, 8
Segs/wire @ 27/wl: 1, 6, 3, 9
Segs/wire @ 30/wl: 1, 6, 3, 10
Segs/wire @ 33/wl: 1, 7, 3, 10
Segs/wire @ 34/wl: 1, 7, 3, 11
Segs/wire @ 37/wl: 1, 7, 4, 12
Segs/wire @ 38/wl: 1, 8, 4, 12
Segs/wire @ 40/wl: 1, 8, 4, 13
Segs/wire @ 44/wl: 1, 9, 4, 14
Segs/wire @ 47/wl: 1, 9, 4, 15
Segs/wire @ 49/wl: 1, 10, 5, 15
Segs/wire @ 50/wl: 1, 10, 5, 16
Non-redundant segs: 10, 11, 13, 14, 17, 20, 22, 24, 25, 27, 30, 33, 34, 37, 38, 40, 44, 47, 49, 50
</pre>
</section>

<section>
  <title>Download</title>
	<p><code>Version 2025-01-03</code> an update to disallow segment length &lt; 3 wire diameters</p>
		<ol>
			<li><a class="button" href="https://ky8d.net/nec_segs/KY8D_NEC_Segs.zip">KY8D_NEC_Segs.zip</a></li>
			<li>Unzips into two files: an <code>*.exe</code> for Windows; and also the <code>*.pl</code> source code.</li>
			<li>Best to employ a stand-alone<code> ZIP </code>archive software (like <a class="button" href="https://www.7-zip.org/">7-Zip</a>) for the extraction.</li>
		</ol>

</section>

<section>
	<title>Caveat Mutuum</title>
	<p>Latin for “Let the moocher beware”. I designed this for me, and used it with glee. I share it here with you for free, but offered without even so much as the smell of a dead warrantee (or wheriot, as the case may be). Whatsoever disasters of cosmic proportion as may result from the use of this program, any and all culpability rests wholly and solely with the user.</p>
</section>

</body>
</gus_xslt>

