File: optimise.1.html

package info (click to toggle)
yagiuda 1.19-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,728 kB
  • sloc: ansic: 5,222; sh: 3,293; makefile: 45
file content (819 lines) | stat: -rw-r--r-- 42,507 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
<HTML>
<BODY>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->

</PRE>
<H2>NAME</H2><PRE>
     optimise - Yagi-Uda project antenna optimiser


</PRE>
<H2>SYNOPSIS</H2><PRE>
     <B>optimise</B>   [   -<B>dhvwO</B>   ]   [   -<B>a</B><I>angular</I>_<I>stepsize</I>    ]    [
     -<B>b</B><I>boom</I>_<I>extension</I> ] [ -<B>c</B><I>cleanliness</I>_<I>of</I>_<I>pattern</I> ] [ -<B>e</B><I>elements</I>
     ] [ -<B>f</B><I>FBratio</I> ] [ -<B>g</B><I>GA</I>_<I>optimisation</I>_<I>method</I> ] -<B>l</B><I>percent</I>  ]  [
     -<B>m</B><I>min</I>_<I>offset</I>_<I>from</I>_<I>peak</I> ] [ -<B>o</B><I>optimisation</I>_<I>criteria</I> ] [ -<B>p</B><I>po-</I>
     <I>pulation</I> ] [ -<B>r</B><I>resistance</I> ] [ -<B>s</B><I>swr</I> ] [ -<B>t</B><I>length</I>_<I>tolerance</I> ]
     [  -<B>x</B><I>reactance</I>  ]  [  -<B>A</B><I>Auto</I>_<I>gain</I> ] [ -<B>C</B><I>Currents</I>_<I>similar</I> ] [
     -<B>F</B><I>weight</I>_<I>FB</I> ] [  -<B>G</B><I>weight</I>_<I>gain</I>  ]  [  -<B>K</B><I>keep</I>_<I>for</I>_<I>tries</I>  ]  [
     -<B>P</B><I>weight</I>_<I>pattern</I>_<I>cleanliness</I>  ]  [  -<B>R</B><I>weight</I>_<I>resistance</I>  ] [
     -<B>S</B><I>weight</I>_<I>swr</I>    ]     [     -<B>T</B><I>position</I>_<I>tolerance</I>     ]     [
     -<B>W</B><I>Weighted</I>_<I>algorithm</I>   ]   [  -<B>X</B><I>weight</I>_<I>reactance</I>  [  <B>-Z</B><I>Zo</I>  ]
     filename iterations


</PRE>
<H2>DESCRIPTION</H2><PRE>
     The program <B>optimise</B> is one of a number of  executable  pro-
     grams  that  forms  part  of a set of programs, collectively
     known as the <I>Yagi</I>-<I>Uda</I> <I>project</I>  ,  which  were  designed  for
     analysis  and  optimisation  of  Yagi-Uda antennas. <I>optimise</I>
     attempts to optimise the performance of a Yagi  antenna  for
     one  or  more parameters that are considered important, such
     as gain, F/B ratio, VSWR  etc.  It  does  this  by  randomly
     changing the lengths and positions, of one or more elements,
     then comparing the performance before and after the  change.
     Any   improvements   are   written  to  a  new  file  called
     <I>filename</I>.<I>bes</I> where filename  is  the  name  of  the  antenna
     description file created by <I>input</I> or <I>first</I>

     When Yagi's are designed on paper, or  using  this  program,
     its  possible  that they will be almost impossible to build,
     if their performance depends too critically  on  the  dimen-
     sions.  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  of  trying to optimise a poor design, optimise will
     calculate the minimum gain, maximum  VSWR,  and  minimum  FB
     ratio  of  a  number of designs, all slightly different from
     the input file. 99.7% of the components lie within 3  SD  of
     the  mean, so if you think you can cut elements to with 1 mm
     99.7% of the time, specify t0.33. If you can put them in the
     boom to within 3 mm 99.7% of the time, specify T1.

     If while <I>optimise</I> is running using the methods that  require
     weights  to be attached to the gain, FB, SWR etc, it becomes
     apparent, the weights are not optimum, its possible to pause
     the  program  and  re-adjust the weights. If a file with the
     name of <I>changes</I> is created, the  program  will  pause,  then
     request new weights are entered at the keyboard.


</PRE>
<H2>AVAILABILITY</H2><PRE>

</PRE>
<H2>OPTIONS</H2><PRE>
     -<B>d</B>   Print the  default  values  of  all  the  configureable
          parameters  to  stdout.  Typing  this  option  with any
          option  that  changes  a  parameter  (see  below)  will
          display the new value of the parameter, rather than the
          default.

     -<B>h</B>   Print a help message.

     -<B>v</B>   Print verbose status information.

     -<B>w</B>   Instead of  optimising  at  one  fixed  frequency  (the
          design frequency), this directs the program to optimise
          at 3 separate frequencies (lowest, design and  highest)
          then  to  average  data at all 3. This option is better
          for wideband antenna. Note  that  the  input  impedance
          printed is at the design frequency, *not* averaged over
          3 frequencies. Averaging an  impedance,  is  likely  to
          give  a very misleading impression. The impedance aver-
          aged over 3 frequencies can be 50+i0 Ohms, even if  the
          VSWR  is  very poor over all 3 frequencies, as the fol-
          lowing 3 pieces of data show.
          Z=147 + j 300  SWR= 15.46:1
          Z=2   + j 100  SWR= 125:1
          Z=1   - j 400  SWR= 3250:1
          note in the above three cases, the average impedance is
          50 + j 0, but average SWR is 1130:1.

     -<B>O</B>   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  any
          change, as long as the SWR stayed good, typically below
          1.1:1, would be allowed,  even  if  the  SWR  rose.  By
          default,  FB's  of 27 dB, VSWR's of 1.1 are acceptable.
          However, by using the -<B>O</B> option,  you  can  insist  the
          program always improves things, no matter how good they
          are.

          centage by setting <I>boom</I>_<I>extension</I> to whatever you wish.
          -<I>b30</I>  will limit the boom to no more than 30% more than
          the original length.

     -<B>c</B><I>cleanliness</I>_<I>of</I>_<I>pattern</I>
          Specify the number of dB down on the peak gain  to  aim
          to  get  the  pattern. Any antenna pattern cleaner than
          this will not effect the fitness, nor will it  be  con-
          sidered  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).

     -<B>e</B><I>elements</I>
          is an integer which specifies the type of elements that
          are changed in the optimisation cycle.  Possible values
          are:
           1 - alter only the driven element(s) length (useful to
           bring to resonance)
           2 - alter only  the  driven  element  position.  Don't
           change its length.
           4 - alter only the reflector length. The  position  is
           always at x=0.
           8 - alter only  the  director  lengths.  Don't  change
           positions.
           16 - alter only the director positions.  Don't  change
           lengths.
           32 - randomly adjust one element  length,  then  makes
           all other the same. Don't change the positions.
           64 - apply a linear taper to the lengths.
           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
           will  make it resonate and keep it there forever. How-
           ever '-e129' will bring to resonance,  then  alter  to
           maximuse performance.
         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.  The
         default is equivalent to -<I>e31</I> , which changes everything
         possible.  Note  the  reflector  position   is   *never*
         changed. It's always at x=0.

          greater than <I>FBratio</I> dB to be equal to <I>FBratio</I> dB. This
          avoids optimising to a very high  FB  ratio,  which  is
          impracticable,  as  the  bandwidth  over  which this FB
          ratio will be maintained is very small  and  mechanical
          considerations  will  prevent  you from constructing it
          with such a high FB  ratio  anyway.  If  this  was  not
          prevented, you might just happen to get an antenna with
          100 dB FB ratio,  but  poor  gain  and  swr.  Since  by
          default  all  parameters must improve, the optimisation
          routine will most likely never being able to improve on
          the  100  dB  FB  ratio, so no improvement will result.
          Most people would prefer to get a few extra dB of gain,
          even if the FB ratio dropped to 30 dB.

     -<B>g</B><I>GA</I>_<I>optimisation</I>_<I>method</I>
          Use a genetic algorithm. With  the  genetic  algorithm,
          the  program  does not take any account any of the ini-
          tial lengths/positions of  elements  specified  in  the
          input file. Rather it works by initialising a number of
          different antenna, then computing a 'fitness' value for
          each.   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 integer after the g tells  the  optimiser  what  to
          consider.  -g1  Use gain
          -g2  Use FB
          -g4  Use R
          -g8  Use X
          -g16 Use the SWR
          -g32 Use the level of the sidelobes.

          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.

     -<B>l</B><I>percent</I>
          is a parameter (floating point number) which  specifies
          the  maximum  percentage  change  in  the  positions or
          lengths of an elements at each iteration. If the option
          is  not  used, it will be set internally at 10% for the
          first 25% of the iterations, 1% for the next 25%,  0.1%
          for  the  third 25% of the iterations and 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.

     -<B>m</B><I>min</I>_<I>offset</I>-<I>from</I>_<I>peak</I>
          Sets the minimum angle in degrees offset from  theta=90
          degrees,  where  the side lobes start and the main lobe
          finishes. The higher the gain, the  smaller  it  should
          be.  It  is  set  internally  if not set on the command
          line.

     -<B>o</B><I>optimisation</I>_<I>criteria</I>
           1 -  Assume better if the gain has increased.
           2 -  Assume better if the  front  to  back  ratio  has
           improved.
           4 -  Assume better if  the  real  part  of  the  input
           impedance  is closer to the value that the program was
           compiled for, or set using the '-Z' option. This  will
           usually  be  50  Ohms, but you may wish to set this to
           12.5 Ohms if you use a 4:1 balun.  Generally  you  can
           get  higher  gain  from  a Yagi if you allow the input
           impedance to fall, but of course  feeding  it  becomes
           more difficult.
           8 -  Assume better if the magnitude  of  the  reactive
           component  of  the  input  impedance is lower (ie. the
           antenna is nearer resonance).
           16 - Assume better if the VSWR is lower.
           32 - Assume better if the level of  all  sidelobes  is
           lower.
         The <I>optimisation</I>_<I>criteria</I> may be formed from  a  logical
         AND  of these numbers, so for example choosing -<I>o19</I> will
         only consider a revised antenna better than  the  previ-
         ous,  if the SWR, gain and F/B ratio have all simultane-
         ously improved.

         Clearly an antenna which originally had 12 dB  gain  and
         1.01:1  VSWR  but  then  changes  to 20 dB gain @ 1.02:1
         VSWR, would to most people be better,  even  though  the
         VSWR  has increased. By default, <I>optimise</I> only optimises
         to sensible maximums, so to  not  let  the  optimisation
         stall  prematurely.  By  running  <I>optimise</I> with no argu-
         ments, the program will list the limits  of  acceptabil-
         ity.  These might be typically F/B ratio &gt; 27 dB, VSWR &lt;
         1.1:1, magnitude of input reactance less than 5 Ohms and
         the  real  part  of the input impedance within 5 Ohms of
         Zo. Choosing -<I>o19</I> (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 previous one, even if the SWR rose, as long as it
         stayed below 1.1:1 (or as was set  during  compilation).
         The default behaviour (no options) is equivalent to -<I>o37</I>
         which optimiseas for <B>gain(1)</B>, the real part of the input
         <B>impedance(4)</B>  and  <B>sidelobes(32)</B> but this may be changed
         at any time, so type <I>optimise</I> -<I>d</I> to  check  the  current
         settings.  If  you  insist on the program optimisang for
         the very best of all selected  parameters,  use  the  -O
         option  too, but be warned the optimisation will probely
         stick once it gets one parameter really good.

     -<B>p</B><I>population</I>
          This determines the initial population used   with  the
          genetic algorithm.

     -<B>r</B><I>resistance</I>
          When optimising an antenna, consider any  input  resis-
          tance  closer  to  Zo (usually 50 Ohms) than <I>resistance</I>
          Ohms to be acceptable. This  avoids  optimising  to  an
          input  resistance too close to Zo, which is impractica-
          ble, as the bandwidth over which the  input  resistance
          could  be  maintained is very small and mechanical con-
          siderations will  prevent  you  from  constructing  the
          antenna  with  such  an ideal input resistance. If this
          was not prevented, you might  just  happen  to  get  an
          antenna with an input resistance of 50.000001 Ohms, but
          poor gain, FB and possibly even  a  poor  swr,  if  the
          antenna  is  well away from resonance. Since by default
          all parameters must improve, the  optimisation  routine
          will get most likely never being able to improve on the
          antenna, whereas we might be happier with a few more dB
          gain,  if  the  input  resistance went to 50.1 Ohms. It
          should be noted that the default  optimisation  routine
          never  uses  the input resistance directly (only VSWR),
          so this option cant be used without the '-o' option  to
          optimise  for  other than the default parameters (gain,
          VSWR and FB ratio).

     -<B>s</B><I>swr</I>
          When optimising an antenna, consider any SWR less  than
          <I>swr</I> to be equal to <I>swr</I> This avoids optimising to a very
          low swr, which is impracticable, as the bandwidth  over
          which  such a low swr could be maintained would be very
          small and mechanical considerations  will  prevent  you
          from  constructing  such  an antenna anyway. If this is
          was not prevented, you might  just  happen  to  get  an
          antenna with an swr of 1.000000000001:1, but poor gain,
          FB ratio. Since by default all parameters must improve,
          the  optimisation  routine will most likely never being
          able to improve on the antenna, even though in practice
          you would like to get a few extra dB of gain if the SWR
          would rise to 1.02:1. The default was equivalent  to  -
          <I>s1</I>.<I>1</I>  but run <I>optimise</I> -<I>d</I> to display this and any other
          defaults.

     -<B>t</B><I>length</I>_<I>tolerance</I>
          <I>length</I>_<I>tolerance</I> is the standard deviation in mm of the
          accuracy  with  which you can cut elements. Since 99.7%
          of elements will be with 3 standard deviations  of  the
          mean length (stats theory says this), set -t0.2 if vir-
          tually  all  (well  99.7%)  of  elements   are   within
          3x0.2=0.6  mm of the correct length. This option *must*
          be used with the '-T'  option and can't  be  used  with
          any other options apart from

     -<B>x</B><I>reactance</I>
          When optimising an antenna, consider  any  input  reac-
          tance  of  less  than  <I>reactance</I>  to be <I>reactance</I>. This
          avoids over optimising the reactance, at the expense of
          something else.

     -<B>A</B><I>auto</I>_<I>gain</I>
          When the <I>auto</I>_<I>gain</I> option is used. the program  maximes
          the  gain of the antenna (ignoring all other parameters
          such as SWR, FB ratio etc) by adjusting the length (not
          position)  of  one element only. -A-1 will maximuse the
          gain, by adjusting the length  of  the  reflector,  -A0
          will  maximise  the gain by adjusting the length of the
          driven element. Its generally *not* a good idea to max-
          imise the gain by adjusting the driven element, but the
          program lets you do it, but using the option -A0. Using
          -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 ele-
          ments (&gt; 10 or so), you can pretty safely maximise  the
          8th  or  more  director, but doing it on the reflector,
          driven element or early directors often leads to  silly
          input  impedances - so beware! 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.

     -<B>C</B><I>currents</I>_<I>similar</I>
          If this option is used, where  <I>currents</I>_<I>similar</I>  is  an
          integer,  the program looks to make the currents in the
          last <I>currents</I>_<I>similar</I> 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  con-
          sidered  better. If <I>currents</I>_<I>similar</I> 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 <I>currents</I>_<I>similar</I> is equal to the number  of
          directors,  it  tries  to  make  all the directors have
          similar currents. If <I>currents</I>_<I>similar</I> is one more  than
          the  number  of  directors,  it  tries  to make all the
          directors and the reflector have similar  currents.  If
          <I>currents</I>_<I>similar</I>  is  equal to the total number of ele-
          ments, then it fails with an error message.

     -<B>F</B><I>weight</I>_<I>FB</I>
          is the floating point number (default  1.0)  specifying
          the  weight  to  attach  to 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,  cleanli-
          ness of antenna pattern). The '-F' option is similar to
          the options -G, -P, -R, -S, -X (which  specify  weights
          for  gain,  pattern  cleanliness, input resistance, SWR
          and input reactance). When  using  the  -W  option  the
          exact  algorithm used to compute the fitness (and hence
          the effect of this parameter) is best checked by  look-
          ing  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 parame-
          ter  have  a  greater  effect  on the fitness. 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  com-
          plete 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.

     -<B>G</B><I>weight</I>_<I>gain</I>
          is the floating point number (default  1.0)  specifying
          the  weight  to  attach to 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 similar to the
          options -F, -P, -R, -S, -X (which specify  weights  for
          FB  ratio,  pattern  cleanliness, input resistance, SWR
          and input reactance). When  using  the  -W  option  the
          exact  algorithm used to compute the fitness (and hence
          the effect of this parameter) is best checked by  look-
          ing  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 parame-
          ter  have  a  greater  effect  on the fitness. 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.

     -<B>K</B><I>keep</I>_<I>for</I>_<I>tries</I>
          <I>keep</I>_<I>for</I>_<I>tries</I> is the number of tries for the  optimise
          to persist using the original data file as the starting
          point for optimisation. By default it is 1, which means
          the  program immediately looks from a new position once
          a better one is found. It  is  theeoretically  possible
          that  this might result in a quick, but poor local max-
          imum. If however, <I>keep</I>_<I>for</I>_<I>tries</I> is 1000, it will  stay
          at  a  position  for  1000 iterations after finding the
          last best result, before considering this to be a  glo-
          bal  optimum.  Then  it starts for the new 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  sur-
          face  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.

     -<B>P</B><I>pattern</I>_<I>cleanlyiness</I>
          is the floating point number (default  1.0)  specifying
          the  weight  to  attach to 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). When using the -W option  the
          exact  algorithm used to compute the fitness (and hence
          the effect of this parameter) is best checked by  look-
          ing  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 parame-
          ter  have  a  greater  effect  on the fitness. 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.  With appropiate use of
          the  -W  option (eg -W49 for gain, SWR and a clean pat-
          tern), 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.

     -<B>R</B><I>weight</I>_<I>resistance</I>
          is the floating point number (default  1.0)  specifying
          the  weight  to attach to the obtaining an input resis-
          tance 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 resis-
          tance,  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).  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 parame-
          ter  have  a  greater  effect  on the fitness. 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.

     -<B>S</B><I>weight</I>_<I>swr</I>
          is the floating point number (default  1.0)  specifying
          the  weight  to  attach  to 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 similar to the
          options -F, -G, -P, -R, -X (which specify  weights  for
          FB,  gain,  pattern  cleanliness,  input resistance and
          input reactance). 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  fit-
          ness.  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 com-
          plete 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.

     -<B>T</B><I>position</I>_<I>tolerance</I>
          <I>position</I>_<I>tolerance</I> is the standard deviation in  mm  of
          the  accuracy  with  which  you can cut elements. Since
          99.7% of elements will be with 3 standard deviations of
          the  correct position (stats theory says this), set -T2
          if virtually all (well 99.7%) of  elements  are  within
          3x2=6  mm of the correct position.This option *must* be
          used with the '-t'  option and can't be used  with  any
          other options apart from

     -<B>W</B><I>Weighted</I>_<I>algorithm</I>
          Try to get an antenna which is better  according  to  a
          weighted combination of parameters, rather than require
          them all to improve. The integer specifies what to con-
          sider in the weighted parameters.
          W1 Gain.
          W2 FB
          W4 R
          W8 X
          W16 SWR
          W32 SIDE_LOBE
          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.

     -<B>X</B><I>weight</I>_<I>reactance</I>
          is the floating point number (default  1.0)  specifying
          the weight to attach to achieving a low input reactance
          on the antenna when using the '-W' option, which calcu-
          lates  a  fitness  for the antenna based on one or more
          parameters (FB, gain,  input  resistance,  input  reac-
          tance,  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). When using the
          -W  option the exact algorithm used to compute the fit-
          ness (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 parame-
          ter  have  a  greater  effect  on the fitness. 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 reacti-
          ance 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.

     -<B>Z</B><I>Zo</I>
          <I>Zo</I> is the characteristic impedance used when evaluating
          the VSWR, reflection coefficient and other similar cal-
          culations. The optimiser usually  tries  to  bring  the
          input impedance of the antenna to this value. It is set
          by default to 50 Ohms, so the default is equivalent  to
          -<I>Z50</I> but may be set to any positive number. Set to 12.5
          Ohms if you are going to feed the antenna  with  a  4:1
          balun.  Generally  speaking,  the gain of a Yagi can be
          higher for low input impedances,  but  of  course  such
          antennas are more difficult to feed.

     <I>filename</I>
          This is the name of the  file  containing  the  antenna
          description.  It  is expected to be in a format created
          by either <I>input</I> or <I>first</I> - two other  programs  in  the
          <I>Yagi</I>-<I>Uda</I> <I>project</I>. This is an ASCII text file.

     <I>iterations</I>
          is an integer specifying the number of  iterations  for
          the  optimiser  to  perform  to  try  to  get  the best
          antenna. Time will limit the number  you  choose.  1000
          iterations of a 1ele yagi takes about 5 seconds, a 6ele
          approximately 60 seconds, an 11 element 350 seconds,  a
          20 element 1030 seconds, a 33ele 2440 seconds, a 50ele-
          ment 5400 seconds, 100ele 21320 seconds all on  an  old
          25MHz 486 PC with no external cache.  When using the -<I>A</I>
          option the <I>iterations</I> is automatically  set  internally
          so  only  one attempt is made.  When using the '-t' and
          '-T' options, <I>iterations</I> specifies the number of itera-
          tions  to  attempt to get a poorer design, to check the
          sensitivity of the design to small manufacturing toler-
          ances.


</PRE>
<H2>EXAMPLES</H2><PRE>
     Here are a number of examples of using <I>optimise</I>.

     1) optimise 5ele 1000

     Here the file 5ele will be optimised using the default  sys-
     tem for 1000 iterations. The default might typically require
     gain, FB and SWR to all improve, but this may be changed  at
     any  time.  In  any  case,  the  program  tells you what its
     optimising for. By default the program will only optimise to
     the  selected  parameters  are good, not over-optimising any
     one at the detrement of the others.

     2) optimise -b30 -f50 -s2 5ele 1000

     This is similar to above, but the boom  can  not  extend  by
     more  than 30% from its  original length, FB ratios above 50
     dB are considered acceptable, as are SWR's  less  than  2:1.
     The  optimised resultant antenna is likely to have better FB
     ratio, but poorer SWR than in (1) above.

     3) optimise -o1 5ele 1000

     This will simply optimise 5ele for maximum forward gain. The
     resultant  antenna may have a poor FB ratio and is likely to
     have an unacceptably low  input  impedance  and  hence  high
     VSWR. This is not a very sensible method of optimisation.

     4) optimise -W49 -l7 5ele 10000

     This will optimise the file 5ele using for 10000 iterations.
     It will require that the weighted performance of the antenna
     in three important parameters (gain, sidelobe level and SWR)
     improves  from one design to the next. One or two parameters
     can actually get worst from one design to the next, but  the
     weighted  performance  is  better. The positions of the ele-
     ments or lengths of elements will not change by more than 7%
     in each iteration.

     5) optimise -g -S30 -G50 -F20 -p1500 5ele 10000

     This will optimise the file 5ele using a genetic  algorithm.
     1500  antennas will be randomly designed. The performance of
     each of these will  measured  using  a  'fitness'  function,
     weighted  30%  to  SWR, 50% to gain and 20% to FB ratio. The
     probability of breading from a pair of antennas  is  propor-
     tional to the fitness function.

     6) optimise -w atv_antenna 10000

     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.

     7) optimise -t0.1 -T1  good_design 100

     This will take the file good_design and make  100  different
     antennas from it, to simulate the effects of building toler-
     ances. Each element is assumed to be cut so  that  the  mean
     error  of  all elements is 0 mm, but a standard deviation of
     0.1 mm, so 68.4% of element lengths are within 0.1 mm, 95.4%
     within  0.2  mm  and  99.7%  with in 0.3 mm. The accuracy of
     placing elements along the boom is much lower,  so  here  we
     have  specified  a standard deviation of 1.0 mm, so 68.6% of
     elements are placed within 1 mm  of  the  correct  position,
     95.4%  within 2 mm of the correct position etc.  The program
     will report the *worst* performances achieved. If  the  per-
     formance  dips  too mush, then you either need to build them
     better, or get a design that's less critical!



</PRE>
<H2>STOPPING</H2><PRE>
     <I>Optimise</I> will stop after the number of iterations  specified
     in  the  parameter  <I>iterations</I>.  It will also stop if a file
     <I>stop</I> exits  in  the  current  directory  of  the  executable
     <I>optimise</I>  This  file  can  of course only be created using a
     multi-tasking operating system such as  Unix.  It  is  *not*
     advisable  to stop the program by hitting the DEL key (Unix)
     or CONTROL-C (DOS), as one of the files may be open  at  the
     time, resulting in an empty file. Files are not open for any
     longer than necessary (they  are  closed  immediately  after
     writing  to  them),  so this is not a likely occurrence, but
     can still occur.


</PRE>
<H2>LIMITATIONS</H2><PRE>
     I'm not aware of any limitations, apart from that filenames,
     including full path, can't exceed 90 characters.


</PRE>
<H2>FILES</H2><PRE>
     filename           Antenna description, created by input or first.
     filename.up    Update file, listing achievements of optimise.
     filename.bes       Best file, containing the best design to date.
     changes         File that causes the program to pause to re-adjust weights.
     stop            File that stops optimisation process.


</PRE>
<H2>SEE ALSO</H2><PRE>
     <B>first(1)</B>, <B>input(1)</B>, <B>output(1)</B>, <B>yagi(1)</B>,  <B>first(5)</B>,  <B>input(5)</B>
     <B>output(5)</B> and <B>optimise(5)</B>.



</PRE>
<H2>PLATFORMS</H2><PRE>
     Both DOS and Unix versions have been built. The DOS  version
     as  distributed requires a 386 PC with a 387 maths coproces-
     sor.

     Although I have altered the source to make it more  compati-
     ble  with DOS (reduced file name lengths etc), my wish is to
     build a decent program, rather than fit the  program  to  an
     outdated  operating  system.  If there is a *good* reason to
     use code that is incompatible with DOS, this will be done.
     Since <I>optimise</I> takes  a while to optimise an  antenna  (I've
     optimised  one design for a week), it is obviously more sen-
     sible to build this program under a multi-tasking  operating
     system, as otherwise a PC can be tied up for days.


</PRE>
<H2>BUGS</H2><PRE>
     Bugs should be reported  to  <B>david.kirkby@onetel.net</B>.   Bugs
     tend  actually to be fixed if they can be isolated, so it is
     in your interest to report them in such a way that they  can
     be easily reproduced.

     The program will dump core (crash) if asked  to  optimise  a
     1ele  beam,  without  any arguments.  This is because a 1ele
     beam has no parasitic elements and by  default  the  program
     only changes parasitic elements.

     Some of the options are not  checked  for  sensible  values,
     although  most are now checked and report if they are out of
     range.

     If the user specifies very large manufacturing errors  using
     the  '-t'  and  '-T'  options,  its possible for elements to
     overlap or for element lengths to become negative. This will
     cause numerical errors. Any reasonable values will not cause
     this.


     On long Yagi's (50 elements) optimise can go a bit silly. It
     can  optimise  say  a 1296MHz Yagi to get 20 dB at 1296 MHz,
     but less than 0 dB at only 1 MHz away. Needs some thought!

     The level of the sidelobes is not computed with  the  GA  or
     some other optimisation types. This will be corrected later.

     All those I don't know about.



</PRE>
<H2>AUTHORS</H2><PRE>
     Dr. David Kirkby G8WRB (david.kirkby@onetel.net).  with help
     with   converting   to   DOS   from   Dr.   Joe   Mack  NA3T
     (mack@fcrfv2.ncifcrf.gov)




























</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>