~ubuntu-branches/ubuntu/precise/yagiuda/precise

« back to all changes in this revision

Viewing changes to man/man1/optimise.1

  • Committer: Bazaar Package Importer
  • Author(s): Joop Stakenborg
  • Date: 2005-08-22 20:20:13 UTC
  • Revision ID: james.westby@ubuntu.com-20050822202013-mhhxp4xirdxrdfx1
Tags: upstream-1.19
ImportĀ upstreamĀ versionĀ 1.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH OPTIMISE 1 "24 October 2000" "version 1.16"
 
2
.de BP
 
3
.sp
 
4
.ns
 
5
.ti -.2i
 
6
\(**
 
7
..
 
8
.SH NAME
 
9
optimise \- Yagi-Uda project antenna optimiser
 
10
.SH SYNOPSIS
 
11
.B optimise 
 
12
[
 
13
.B \-dhvwO
 
14
]
 
15
[
 
16
.BI \-a angular_stepsize
 
17
 
18
[
 
19
.BI \-b boom_extension
 
20
]
 
21
[
 
22
.BI \-c cleanliness_of_pattern
 
23
]
 
24
[
 
25
.BI \-e elements
 
26
]
 
27
[
 
28
.BI \-f FBratio
 
29
]
 
30
[
 
31
.BI \-g GA_optimisation_method
 
32
]
 
33
.BI \-l percent
 
34
]
 
35
[
 
36
.BI \-m min_offset_from_peak
 
37
]
 
38
 
39
.BI \-o optimisation_criteria
 
40
]
 
41
[
 
42
.BI \-p population
 
43
]
 
44
[
 
45
.BI \-r resistance
 
46
]
 
47
 
48
.BI \-s swr
 
49
]
 
50
 
51
.BI \-t length_tolerance
 
52
]
 
53
[
 
54
.BI \-x reactance
 
55
]
 
56
[
 
57
.BI \-A Auto_gain
 
58
]
 
59
[
 
60
.BI \-C Currents_similar
 
61
]
 
62
[
 
63
.BI \-F weight_FB
 
64
]
 
65
 
66
.BI \-G weight_gain
 
67
]
 
68
[
 
69
.BI \-K keep_for_tries
 
70
]
 
71
 
72
.BI \-P weight_pattern_cleanliness
 
73
]
 
74
[
 
75
.BI \-R weight_resistance 
 
76
]
 
77
[
 
78
.BI \-S weight_swr
 
79
]
 
80
[
 
81
.BI \-T position_tolerance
 
82
]
 
83
[
 
84
.BI \-W Weighted_algorithm
 
85
 
86
[
 
87
.BI \-X weight_reactance
 
88
 
89
.BI -Z Zo
 
90
]
 
91
filename iterations
 
92
.SH DESCRIPTION
 
93
The program 
 
94
.B optimise
 
95
is one of a number of executable programs that forms part of a set of 
 
96
programs, collectively known as the
 
97
.I Yagi-Uda project
 
98
, which were designed for analysis and optimisation of Yagi-Uda antennas. 
 
99
.I optimise 
 
100
attempts to optimise the performance of a Yagi antenna for one or more
 
101
parameters that are considered important, such as gain, F/B ratio, VSWR
 
102
etc. It does this by randomly changing the lengths and positions, of one 
 
103
or more elements, then comparing the performance before and after the change.
 
104
Any improvements are written to a new file called
 
105
.I filename.bes
 
106
where
 
107
filename is the name of the antenna description file created by 
 
108
.I input
 
109
or
 
110
.I first
 
111
.LP
 
112
When Yagi's are designed on paper, or using this program, its possible that they will be almost
 
113
impossible to build, if their performance depends too critically on the
 
114
dimensions. To determine if this is the case with a design, we run optimise with just the options 't' and 'T'. These specify the tolerance with which you can build the antenna, expressed as a standard deviation in mm. In this case, instead
 
115
of trying to optimise a poor design, optimise will calculate the minimum gain, maximum VSWR,
 
116
and minimum FB ratio of a number of designs, all slightly different from the input file. 99.7% of the components
 
117
lie within 3 SD of the mean, so if you think you can cut elements to with 1 mm 99.7% of the time,
 
118
specify t0.33. If you can put them in the boom to within 3 mm 99.7% of the time, specify T1.
 
119
.LP
 
120
If while 
 
121
.I optimise
 
122
is running using the methods that require weights to be attached to the gain,
 
123
FB, SWR etc, it becomes apparent, the weights are not optimum, its possible to
 
124
pause the program and re-adjust the weights. If a file with the name of
 
125
.I changes
 
126
is created, the program will pause, then request new weights are entered at  
 
127
the keyboard.
 
128
.SH AVAILABILITY
 
129
.SH OPTIONS
 
130
.TP
 
131
.B \-d  
 
132
Print the default values of all the configureable parameters to stdout. Typing this option with any
 
133
option that changes a parameter (see below) will display the new value of the parameter, rather
 
134
than the default.
 
135
.TP
 
136
.B \-h  
 
137
Print a help message.
 
138
.TP
 
139
.B \-v  
 
140
Print verbose status information.
 
141
.TP
 
142
.B \-w
 
143
Instead of optimising at one fixed frequency (the design frequency), this directs the program to
 
144
optimise at 3 separate frequencies (lowest, design and highest) then to average data at all 3. This
 
145
option is better for wideband antenna. Note that the input impedance printed is at the design
 
146
frequency, *not* averaged over 3 frequencies. Averaging an impedance, is likely to give a very
 
147
misleading impression. The impedance averaged over 3 frequencies can be 50+i0 Ohms, even
 
148
if the VSWR is very poor over all 3 frequencies, as the following 3 pieces of data show.
 
149
.br
 
150
Z=147 + j 300  SWR= 15.46:1
 
151
.br
 
152
Z=2   + j 100  SWR= 125:1
 
153
.br
 
154
Z=1   - j 400  SWR= 3250:1
 
155
.br
 
156
note in the above three cases, the average impedance is 50 + j 0, but 
 
157
average SWR is 1130:1. 
 
158
.TP
 
159
.B \-O
 
160
Over-optimisation allowed.  By default, the program does not over-optimise a parameter. For example, an SWR of 1.01 is usually considered good enough and 
 
161
any change, as long as the SWR stayed good, typically below 1.1:1, would
 
162
be allowed, even if the SWR rose. By default, FB's of 27 dB, VSWR's of 1.1 are
 
163
acceptable. However, by using the 
 
164
.B \-O
 
165
option, you can insist the program always improves things, no matter how good they are.
 
166
.TP
 
167
.TP
 
168
.BI \-a Angular_stepsize
 
169
When optimimising by trying to get a clean pattern, specifies the step size to
 
170
use when looking for features in the pattern. If its set too small, the program  runs slow. If its set too large, the program may miss features in the pattern, such as a sidelobe. Then the resulting antenna will have poor sidelobe performance, even though you think it will be good. The program attempts to calculate
 
171
a sensible value, based on 1/10th the approximate 3 dB beamwidth, if you don't 
 
172
set.
 
173
.TP
 
174
.BI \-b boom_extension
 
175
Generally speaking, the gain of a Yagi increases with boom length. Hence the optimiser would
 
176
often give you a Yagi with a much longer boom than the input file. This may not be what you
 
177
desire due to space restrictions. These long antennas often have high gain, but are very narrow in bandwidth. The default limits the antenna to 10x the original length, which
 
178
means effectively there is no boom length limitation.
 
179
You can adjust the percentage by setting 
 
180
.I boom_extension
 
181
to whatever you wish.
 
182
.I -b30
 
183
will limit the boom to no more than 30% more than the original length.
 
184
.TP
 
185
.BI \-c cleanliness_of_pattern
 
186
Specify the number of dB down on the peak gain to aim to get the pattern. Any
 
187
antenna pattern cleaner than this will not effect the fitness, nor will it
 
188
be considered any better when comparing to antenna designs. 20 dB seems reasonable, so the default is 20, but this may of course change if it's deceided too. Check the source code to be certain (see REASONABLE_SIDELOBE in yagi.h).
 
189
.TP
 
190
.BI \-e elements
 
191
is an integer which specifies the type of elements that are changed in the optimisation cycle.
 
192
Possible values are:
 
193
.br 
 
194
.in +1.5
 
195
1 - alter only the driven element(s) length (useful to bring to resonance)
 
196
.br 
 
197
2 - alter only the driven element position. Don't change its length.
 
198
.br 
 
199
4 - alter only the reflector length. The position is always at x=0.
 
200
.br
 
201
8 - alter only the director lengths. Don't change positions.
 
202
.br 
 
203
16 - alter only the director positions. Don't change lengths.
 
204
.br 
 
205
32 - randomly adjust one element length, then makes all other the same. Don't change the positions.
 
206
.br  
 
207
64 - apply a linear taper to the lengths.
 
208
.br
 
209
128 - Set the driven element to a resonate length. It may/may-not be altered after the first run, depending on the whether or not '1' is invoked too. Eg -e128
 
210
will make it resonate and keep it there forever. However '-e129' will bring to
 
211
resonance, then alter to maximuse performance.
 
212
.in -1.5
 
213
The elements altered is made from a logical AND of the above, so for example to alter everything, except the driven element length, use -e30, since 2+4+8+16=30.
 
214
The  default is equivalent to 
 
215
.I -e31
 
216
, which changes everything possible. Note the
 
217
reflector position is *never* changed. It's always at x=0.
 
218
.TP
 
219
.TP
 
220
.BI \-f FBratio
 
221
When optimising an antenna, consider any FB ratio greater than 
 
222
.I FBratio
 
223
dB to be equal to
 
224
.I FBratio
 
225
dB. This avoids optimising to a very high FB ratio, which is impracticable, as the bandwidth over
 
226
which this FB ratio will be maintained is very small and mechanical considerations will prevent
 
227
you from constructing it with such a high FB ratio anyway. If this was not prevented, you might
 
228
just happen to get an antenna with 100 dB FB ratio, but poor gain and swr. Since by default all
 
229
parameters must improve, the optimisation routine will most likely never being able to improve
 
230
on the 100 dB FB ratio, so no improvement will result. Most people would prefer to get a few extra dB of gain,
 
231
even if the FB ratio dropped to 30 dB.
 
232
.TP
 
233
.BI \-g GA_optimisation_method
 
234
Use a genetic algorithm. With the genetic algorithm, the program does
 
235
not take any account any of the initial lengths/positions of elements
 
236
specified in the input file. Rather it works by initialising a
 
237
number of different antenna, then computing a 'fitness' value for each.
 
238
The fitness value can depend on the gain, FB, real part of the input impedance, reactive part of the input impedance, VSWR or the level of the sidelobes. The
 
239
integer after the g tells the optimiser what to consider.
 
240
-g1  Use gain
 
241
.br
 
242
-g2  Use FB
 
243
.br
 
244
-g4  Use R
 
245
.br
 
246
-g8  Use X
 
247
.br
 
248
-g16 Use the SWR
 
249
.br
 
250
-g32 Use the level of the sidelobes.
 
251
.br
 
252
 
 
253
You can use a logical AND of these, so for example -g49 will use a genetic algorithm, optimising for gain, swr and sidelobe level, since 1(gain)+16(SWR)+32(sidelobe level)=49.
 
254
.TP
 
255
.BI \-l percent
 
256
is a parameter (floating point number) which specifies the maximum percentage
 
257
change in the positions or lengths of an elements at each iteration. If the
 
258
option is not used, it will be set internally at 10% for the first 25% of the
 
259
iterations, 1% for the next 25%, 0.1% for the third 25% of the iterations and
 
260
0.01% for the last 25% of the iterations. If set to a positive number x (eg optimise -l 0.3 145e10) then the percentage will be set at x% for 25% of iterations, x/10 for the  next 25%, x/100 for the next 25 and x/1000 for the last 25%. If set to a negative number y (eg optimise -l -0.5 145e10) then the paramters will stay fixed at y% (in this example 0.5%) all the time.
 
261
.TP
 
262
.BI \-m min_offset-from_peak
 
263
Sets the minimum angle in degrees offset from theta=90 degrees, where the
 
264
side lobes start and the main lobe finishes. The higher the gain, the smaller
 
265
it should be. It is set internally if not set on the command line.
 
266
.TP
 
267
.BI \-o optimisation_criteria
 
268
.br 
 
269
.in +1.5
 
270
1 -  Assume better if the gain has increased.
 
271
.br 
 
272
2 -  Assume better if the front to back ratio has improved.
 
273
.br 
 
274
4 -  Assume better if the real part of the input impedance is closer to the
 
275
value that the program was compiled for, or set using the '-Z' option. 
 
276
This will usually be 50 Ohms, but you may wish to set this to 12.5 Ohms if
 
277
you use a 4:1 balun. Generally you can get higher gain from a Yagi if you 
 
278
allow the input impedance to fall, but of course feeding it becomes more
 
279
difficult.
 
280
.br
 
281
8 -  Assume better if the magnitude of the reactive component of the input impedance is lower
 
282
(ie. the antenna is nearer resonance).
 
283
.br 
 
284
16 - Assume better if the VSWR is lower.
 
285
.br 
 
286
32 - Assume better if the level of all sidelobes is lower.
 
287
.in -1.5
 
288
The 
 
289
.I optimisation_criteria 
 
290
may be formed from a logical AND of these numbers, so for example choosing
 
291
.I -o19
 
292
will only consider a revised antenna better than the previous, if the SWR, 
 
293
gain and F/B ratio have all simultaneously improved.
 
294
.br 
 
295
 
 
296
Clearly an antenna which originally had 12 dB gain and 1.01:1 VSWR but then 
 
297
changes to 20 dB gain @ 1.02:1 VSWR, would to most people be better, even
 
298
though the VSWR has increased. By default, 
 
299
.I optimise
 
300
only optimises to sensible maximums, so to not let the optimisation stall prematurely. By running 
 
301
.I optimise
 
302
with no arguments, the program will list the limits of acceptability.
 
303
These might be typically F/B ratio > 27 dB, VSWR < 1.1:1, magnitude of input
 
304
reactance less than 5 Ohms and the real part of the input impedance within 
 
305
5 Ohms of Zo. Choosing 
 
306
.I -o19
 
307
(1+2+16=19) will optimise for gain (since G=1), FB (since FB=2) and SWR (Since SWR=16), but would consider a higher gain and FB ratio antenna better than a 
 
308
previous one, even if the SWR rose, as long as it stayed
 
309
below 1.1:1 (or as was set during compilation). The default behaviour (no options) is equivalent
 
310
to
 
311
.I -o37
 
312
which optimiseas for gain(1), the real part of the input impedance(4) and sidelobes(32)
 
313
but this may be changed at any time, so type
 
314
.I optimise -d
 
315
to check the current settings. If you insist on the program optimisang for the
 
316
very best of all selected parameters, use the -O option too, but be warned the
 
317
optimisation will probely stick once it gets one parameter really good.
 
318
.TP
 
319
.BI \-p population 
 
320
This determines the initial population used  with the genetic
 
321
algorithm.
 
322
.TP
 
323
.BI \-r resistance
 
324
When optimising an antenna, consider any input resistance closer to Zo (usually 50 Ohms) than 
 
325
.I resistance
 
326
Ohms to be acceptable. This avoids optimising to an input resistance too close to Zo, which is
 
327
impracticable, as the bandwidth over which the input resistance could be maintained is very small
 
328
and mechanical considerations will prevent you from constructing the antenna with such an ideal
 
329
input resistance. If this was not prevented, you might just happen to get an antenna with an input
 
330
resistance of 50.000001 Ohms, but poor gain, FB and possibly even a poor swr, if the
 
331
antenna is well away from resonance. Since by default all parameters must improve, the
 
332
optimisation routine will get most likely never being able to improve on the antenna, whereas
 
333
we might be happier with a few more dB gain, if the input resistance went to 50.1 Ohms. It
 
334
should be noted that the default optimisation routine never uses the input resistance directly (only
 
335
VSWR), so this option cant be used without the '-o' option to optimise for other than the default
 
336
parameters (gain, VSWR and FB ratio).
 
337
.TP
 
338
.BI \-s swr
 
339
When optimising an antenna, consider any SWR less than 
 
340
.I swr
 
341
to be equal to
 
342
.I swr
 
343
This avoids optimising to a very low swr, which is impracticable, as the bandwidth over which
 
344
such a low swr could be maintained would be very small and mechanical considerations will
 
345
prevent you from constructing such an antenna anyway. If this is was not prevented, you might
 
346
just happen to get an antenna with an swr of 1.000000000001:1, but poor gain, FB ratio. Since
 
347
by default all parameters must improve, the optimisation routine will most likely never being able
 
348
to improve on the antenna, even though in practice you would like to get a few extra dB of gain
 
349
if the SWR would rise to 1.02:1. The default was equivalent to
 
350
.I -s1.1
 
351
but run 
 
352
.I optimise -d
 
353
to display this and any other defaults.
 
354
.TP
 
355
.BI \-t length_tolerance
 
356
.I length_tolerance 
 
357
is the standard deviation in mm of the accuracy with which you can cut elements. Since 99.7%
 
358
of elements will be with 3 standard deviations of the mean length (stats theory says this), set
 
359
-t0.2 if virtually all (well 99.7%) of elements are within 3x0.2=0.6 mm of the correct length. This
 
360
option *must* be used with the '-T'  option and can't be used with any other options apart from
 
361
'-Z', '-v' and '-d'.
 
362
.TP
 
363
.BI \-x reactance
 
364
When optimising an antenna, consider any input reactance of less than 
 
365
.I reactance
 
366
to be
 
367
.I reactance.
 
368
This avoids over optimising the reactance, at the expense of something else.
 
369
.TP 
 
370
.BI \-A auto_gain
 
371
When the       
 
372
.I auto_gain
 
373
option is used. the program maximes the gain of the antenna (ignoring all other 
 
374
parameters such as SWR, FB ratio etc) by adjusting the length (not position)
 
375
of one element only. -A-1 will maximuse the gain, by adjusting the length of 
 
376
the reflector, -A0 will maximise the gain by adjusting the length of the driven
 
377
element. Its generally *not* a good idea to maximise the gain by adjusting the
 
378
driven element, but the program lets you do it, but using the option -A0. Using
 
379
-A1 will maximise gain by adjusting the length of the first director, -A2 the second director and so on, up to the last director. You must check carefully that the input impedance in particular does not fall to silly values if you use this option. On a yagi with many elements (> 10 or so), you can pretty safely maximise the 8th or more director, but doing it on the reflector, driven element or
 
380
early directors often leads to silly input impedances - so beware! 
 
381
Note, no matter how many iterations you specify, this process is only done once.Its unlikely you will be able to do it again, without things going out of hand, but if you must do it, you must re-run 'optimise' again.
 
382
.TP
 
383
.BI \-C currents_similar
 
384
If this option is used, where
 
385
.I currents_similar
 
386
is an integer, the program looks to make the
 
387
currents in the last 
 
388
.I currents_similar
 
389
elements as similar as possible. It computes the sum of the squares of the deviations of the absolute values of the element currents from the mean. If this falls, and the criteria specified with the -W option is also satisfied, the antenna is considered better. If 
 
390
.I
 
391
currents_similar
 
392
is three less than the number of directors, it tries to make the currents in the the directors (but ignoringing the first 3) all similar. If 
 
393
.I currents_similar
 
394
is equal to the number of directors, it tries to make all the directors have similar currents. If 
 
395
.I currents_similar
 
396
is one more than the number of directors, it tries to make all the directors and the reflector have similar currents. If 
 
397
.I currents_similar
 
398
is equal to the total number of elements, then it fails with an error message. 
 
399
.TP
 
400
.BI \-F weight_FB
 
401
is the floating point number (default 1.0) specifying the weight to attach to
 
402
the FB ratio of the antenna when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-F' option is 
 
403
similar to the options -G, -P, -R, -S, -X (which specify weights for gain, pattern cleanliness, input resistance, SWR and input reactance).  
 
404
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
405
However, unless you optimise for a high FB ratio with the -W option, then setting the -F option will have no effect. For example, setting the options -F2.5 -W1 is a complete waste of time. There you have used the -W1 option to optimise only for gain (see -W option section of man page) but have changed the weight of the FB ratio from its default 1.0 to 2.5. If you are not optimising for FB ratio, the weight you attach to it is irrelavent.
 
406
.TP
 
407
.BI \-G weight_gain
 
408
is the floating point number (default 1.0) specifying the weight to attach to
 
409
the gain of the antenna when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-G' option is 
 
410
similar to the options -F, -P, -R, -S, -X (which specify weights for FB ratio, pattern cleanliness, input resistance, SWR and input reactance).  
 
411
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
412
However, unless you optimise for gain with the -W option, then setting the -G option will have no effect. For example, setting the options -G2.5 -W2 is a complete waste of time. There you have used the -W2 option to optimise only for FB ratio (see -W option section of man page) but have changed the weight of the gain from its default 1.0 to 2.5. If you are not optimising for gain, the weight you attach to it is irrelavent.
 
413
.TP
 
414
.BI \-K keep_for_tries
 
415
.br
 
416
.I keep_for_tries
 
417
is the number of tries for the optimise to persist using the original data
 
418
file as the starting point for optimisation. By default it is 1, which means the
 
419
program immediately looks from a new position once a better one is found. It 
 
420
is theeoretically possible that this might result in a quick, but poor local maximum. If however, 
 
421
.I keep_for_tries
 
422
is 1000, it will
 
423
stay at a position for 1000 iterations after finding the last best result,
 
424
before considering this to be a global optimum. Then it starts for the new 
 
425
position. In practice, I have found this option to make matters worst in most cases. It was added to avoid the local-minimum problem, but it appears the optimisation surface is pretty smooth, so it just slows the program, without gaining much. Anyway, it can stay as an option, but check the results with/without carefully before using extensively. 
 
426
.TP
 
427
.BI \-P pattern_cleanlyiness
 
428
is the floating point number (default 1.0) specifying the weight to attach to
 
429
the cleanness of the antenna pattern when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-P' option is similar to the options -F, -G, -R, -S, -X (which specify weights for FB ratio, gain, input resistance, SWR and input reactance).  
 
430
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
431
However, unless you optimise for a clean antenna pattern with the -W option, then setting the -P option will have no effect. For example, setting the options -P2.5 -W1 is a complete waste of time. There you have used the -W1 option to optimise only for gain (see -W option section of man page) but have changed the weight of the pattern cleanliness from its default 1.0 to 2.5. If you are not optimising for a clean radiation pattern, the weight you attach to it is irrelavent.
 
432
With appropiate use of the -W option (eg -W49 for gain, SWR and a clean pattern), the computer program finds the level of the most significant sidelobe, wherever it may be outside the main bean. It then optimises to reduce this. The -P option tells it how much weight to put on reducing this sidelobe.
 
433
.TP
 
434
.BI \-R weight_resistance
 
435
is the floating point number (default 1.0) specifying the weight to attach to
 
436
the obtaining an input resistance close to Zo on the antenna when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-R' option is similar to the options -F, -G, -P, -S, -X (which specify weights for FB, gain, pattern cleanliness, SWR and input reactance).  
 
437
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
438
However, unless you optimise for an an input resistance close to Zo, with the -W option, then setting the -R option will have no effect. For example, setting the options -R2.5 -W1 is a complete waste of time. There you have used the -W1 option to optimise only for gain (see -W option section of man page) but have changed the weight of the resistance from its default 1.0 to 2.5. If you are not optimising for an input resistance close to Zo, the weight you attach to it is irrelavent.
 
439
.TP
 
440
.BI \-S weight_swr
 
441
is the floating point number (default 1.0) specifying the weight to attach to
 
442
the SWR of the antenna when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-S' option is 
 
443
similar to the options -F, -G, -P, -R, -X (which specify weights for FB, gain, pattern cleanliness, input resistance and input reactance).  
 
444
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
445
However, unless you optimise for SWR with the -W option, then setting the -S option will have no effect. For example, setting the options -S2.5 -W1 is a complete waste of time. There you have used the -W1 option to optimise only for gain (see -W option section of man page) but have changed the weight of the SWR from its default 1.0 to 2.5. If you are not optimising for SWR, the weight you attach to it is irrelavent.
 
446
.TP
 
447
.BI \-T position_tolerance
 
448
.I position_tolerance
 
449
is the standard deviation in mm of the accuracy with which you can cut elements. Since 99.7%
 
450
of elements will be with 3 standard deviations of the correct position (stats theory says this), set
 
451
-T2 if virtually all (well 99.7%) of elements are within 3x2=6 mm of the correct position.This
 
452
option *must* be used with the '-t'  option and can't be used with any other options apart from
 
453
'-Z', '-v' and '-d'.
 
454
.TP
 
455
.BI \-W  Weighted_algorithm
 
456
Try to get an antenna which is better according to a weighted combination of 
 
457
parameters, rather than require them all to improve. The integer specifies
 
458
what to consider in the weighted parameters.
 
459
.br
 
460
W1 Gain.
 
461
.br
 
462
W2 FB
 
463
.br    
 
464
W4 R
 
465
.br
 
466
W8 X
 
467
.br
 
468
W16 SWR
 
469
.br
 
470
W32 SIDE_LOBE 
 
471
.br
 
472
You can logically AND these together, so for example -W3 will optimise using a weighted combination of gain and FB. -W49, will use a weighted combination of gain, swr and sidelobe leve, since 32+16+1=49.
 
473
.TP
 
474
.BI \-X weight_reactance
 
475
is the floating point number (default 1.0) specifying the weight to attach to
 
476
achieving a low input reactance on the antenna when using the '-W' option, which calculates a fitness for the antenna based on one or more parameters (FB, gain, input resistance, input reactance, SWR, cleanliness of antenna pattern). The '-X' option is similar to the options -F, G, -P, -R and -S (which specify weights for FB ratio, gain, pattern cleanliness, input resistance, and SWR).  
 
477
When using the -W option the exact algorithm used to compute the fitness (and hence the effect of this parameter) is best checked by looking at the source code (see perform.c). This is one area of constant program improvement/changes/development, so its difficult to say exactly the effect the parameter has. However, increasing the weight of a parameter (using the -F, -G, -R, -S or -X options) will make  the associated parameter have a greater effect on the fitness. 
 
478
However, unless you optimise for a low input reactance with the -W option, then setting the -X option will have no effect. For example, setting the options -X2.5 -W1 is a complete waste of time. There you have used the -W1 option to optimise only for gain (see -W option section of man page) but have changed the weight of the reactiance from its default 1.0 to 2.5. If you are not optimising for a low input reactance, the weight you attach to it is irrelavent.
 
479
.TP
 
480
.BI \-Z Zo
 
481
.br
 
482
.I Zo
 
483
is the characteristic impedance used when evaluating the VSWR, reflection coefficient and other
 
484
similar calculations. The optimiser usually tries to bring the input impedance of the antenna to
 
485
this value. It is set by default to 50 Ohms, so the default is equivalent to
 
486
.I -Z50
 
487
but may be set to any positive number. Set to 12.5 Ohms if you are going to feed the antenna
 
488
with a 4:1 balun. Generally speaking, the gain of a Yagi
 
489
can be higher for low input impedances, but of course such antennas are
 
490
more difficult to feed.
 
491
.TP
 
492
.I  filename
 
493
This is the name of the file containing the antenna description. It is expected
 
494
to be in a format created by either
 
495
.I input
 
496
or
 
497
.I first
 
498
- two other programs in the 
 
499
.I Yagi-Uda project.
 
500
This is an ASCII text file.
 
501
.TP
 
502
.I iterations
 
503
is an integer specifying the number of iterations for the optimiser to perform to try to get the best
 
504
antenna. Time will limit the number you choose. 1000 iterations of a 1ele yagi takes about 5
 
505
seconds, a 6ele approximately 60 seconds, an 11 element 350 seconds, a 20 element 1030
 
506
seconds, a 33ele 2440 seconds, a 50element 5400 seconds, 100ele 21320 seconds all on an old
 
507
25MHz 486 PC with no external cache.
 
508
When using the 
 
509
.I -A
 
510
option the 
 
511
.I iterations 
 
512
is automatically set internally so only one attempt is
 
513
made.
 
514
When using the '-t' and '-T' options, 
 
515
.I iterations     
 
516
specifies the number of iterations to attempt to get a poorer design, to check the sensitivity of
 
517
the design to small manufacturing tolerances.
 
518
.SH EXAMPLES
 
519
Here are a number of examples of using 
 
520
.I optimise.
 
521
.PP
 
522
1) optimise 5ele 1000
 
523
.PP
 
524
Here the file 5ele will be optimised using the default system for 1000
 
525
iterations. The default might typically require gain, FB and SWR to
 
526
all improve, but this may be changed at any time. In any case, the
 
527
program tells you what its optimising for. By default the program will
 
528
only optimise to the selected parameters are good, not over-optimising any
 
529
one at the detrement of the others.
 
530
 
 
531
2) optimise -b30 -f50 -s2 5ele 1000
 
532
.PP
 
533
This is similar to above, but the boom can not extend by more than 30%
 
534
from its  original length, FB ratios above 50 dB are considered acceptable,
 
535
as are SWR's less than 2:1. The optimised resultant antenna is likely to have
 
536
better FB ratio, but poorer SWR than in (1) above.
 
537
 
 
538
3) optimise -o1 5ele 1000
 
539
.PP
 
540
This will simply optimise 5ele for maximum forward gain. The resultant
 
541
antenna may have a poor FB ratio and is likely to have an unacceptably
 
542
low input impedance and hence high VSWR. This is not a very sensible
 
543
method of optimisation.
 
544
 
 
545
4) optimise -W49 -l7 5ele 10000
 
546
.PP
 
547
This will optimise the file 5ele using for 10000 iterations. It will
 
548
require that the weighted performance of the antenna in three important
 
549
parameters (gain, sidelobe level and SWR) improves from one design to the
 
550
next. One or two parameters can actually get worst from one design to
 
551
the next, but the weighted performance is better. The positions of the elements or lengths of
 
552
elements will not change by more than 7% in each iteration.
 
553
.PP
 
554
5) optimise -g -S30 -G50 -F20 -p1500 5ele 10000
 
555
.PP
 
556
This will optimise the file 5ele using a genetic algorithm. 1500 antennas will be randomly
 
557
designed. The performance of each of these will measured using a 'fitness' function, weighted
 
558
30% to SWR, 50% to gain and 20% to FB ratio. The probability of breading from a pair of
 
559
antennas is proportional to the fitness function. 
 
560
.PP
 
561
6) optimise -w atv_antenna 10000
 
562
.PP
 
563
This will optimise the file atv_antenna for a best average performance over a wide band. The progrram calculates the gain, FB and SWR at three frequencies, then computes an average (mean) performance of the antenna over the band. N iterations will take 3x as long to execute as N iterations on the same antenna without the '-w' option.
 
564
.PP
 
565
7) optimise -t0.1 -T1  good_design 100
 
566
.PP
 
567
This will take the file good_design and make 100 different antennas from it,
 
568
to simulate the effects of building tolerances. Each element is assumed to be cut so that the mean
 
569
error of all elements is 0 mm, but a standard deviation of 0.1 mm, so 68.4% of element lengths
 
570
are within 0.1 mm, 95.4% within 0.2 mm and 99.7% with in 0.3 mm. The accuracy of placing
 
571
elements along the boom is much lower, so here we have specified a standard deviation of
 
572
1.0 mm, so 68.6% of elements are placed within 1 mm of the correct position, 95.4% within 2 mm
 
573
of the correct position etc.  The program will report the *worst* performances achieved. If the
 
574
performance dips too mush, then you either need to build them better, or get a design that's less critical!
 
575
 
 
576
.SH STOPPING
 
577
.I Optimise
 
578
will stop after the number of iterations specified in the parameter
 
579
.I iterations. 
 
580
It will also stop if a file 
 
581
.I stop
 
582
exits in the current directory of the executable 
 
583
.I optimise
 
584
This file can of course only be created using a multi-tasking operating
 
585
system such as Unix. It is *not* advisable to stop the program by
 
586
hitting the DEL key (Unix) or CONTROL-C (DOS), as one of the files may
 
587
be open at the time, resulting in an empty file. Files are not open for
 
588
any longer than necessary (they are closed immediately after writing to
 
589
them), so this is not a likely occurrence, but can still occur.
 
590
.SH LIMITATIONS
 
591
I'm not aware of any limitations, apart from that filenames, including full
 
592
path, can't exceed 90 characters. 
 
593
.SH FILES
 
594
.nf
 
595
filename           Antenna description, created by input or first.
 
596
filename.up    Update file, listing achievements of optimise.
 
597
filename.bes       Best file, containing the best design to date.
 
598
changes         File that causes the program to pause to re-adjust weights.
 
599
stop            File that stops optimisation process.
 
600
.br
 
601
.fi
 
602
.SH "SEE ALSO"
 
603
first(1), input(1), output(1), yagi(1), first(5), input(5) output(5) and optimise(5).
 
604
 
 
605
.SH PLATFORMS
 
606
Both DOS and Unix versions have been built. The DOS version as
 
607
distributed requires a 386 PC with a 387 maths coprocessor. 
 
608
 
 
609
Although I have altered the source to make it more compatible with DOS (reduced file name
 
610
lengths etc), my wish is to build a decent program, rather than fit the program to an outdated
 
611
operating system. If there is a *good* reason to use code that is incompatible with DOS, this will
 
612
be done.
 
613
.br
 
614
Since 
 
615
.I optimise
 
616
takes  a while to optimise an antenna (I've optimised one design for a week), it is obviously
 
617
more sensible to build this program under a multi-tasking operating system, as otherwise a PC
 
618
can be tied up for days.
 
619
.SH BUGS
 
620
Bugs should be reported to
 
621
.BR david.kirkby@onetel.net .
 
622
Bugs tend actually to be fixed if they can be isolated, so it is in your
 
623
interest to report them in such a way that they can be easily reproduced.
 
624
 
 
625
The program will dump core (crash) if asked to optimise a 1ele beam, without any arguments.
 
626
This is because a 1ele beam has no parasitic elements and by default the program only changes
 
627
parasitic elements.
 
628
 
 
629
Some of the options are not checked for sensible values, although most are 
 
630
now checked and report if they are out of range.
 
631
 
 
632
If the user specifies very large manufacturing errors using the '-t' and '-T'
 
633
options, its possible for elements to overlap or for element lengths to
 
634
become negative. This will cause numerical errors. Any reasonable values 
 
635
will not cause this.
 
636
 
 
637
 
 
638
On long Yagi's (50 elements) optimise can go a bit silly. It can optimise
 
639
say a 1296MHz Yagi to get 20 dB at 1296 MHz, but less than 0 dB at only 1 MHz 
 
640
away. Needs some thought!
 
641
 
 
642
The level of the sidelobes is not computed with the GA or some other optimisation types. This will be corrected later.
 
643
 
 
644
All those I don't know about. 
 
645
 
 
646
.nf
 
647
.SH AUTHORS
 
648
Dr. David Kirkby G8WRB (david.kirkby@onetel.net).
 
649
with help with converting to DOS from Dr. Joe Mack NA3T (mack@fcrfv2.ncifcrf.gov)