# Using optimise (example #4)

In the following example, we optimise using a GA for gain and VSWR, but set the desired input resistance to be 12.5 Ohms and set the weighting factor for the gain to be 0.95 and VSWR 0.05. These don't need to add to one, but here the numbers indicate that 95% of the performance of the antenna is dependent on its gain, and the other 5% on the VSWR. Hence gain gets optimised as the expense of VSWR.

parrot /export/home/drkirkby/yagiuda-1.18/src % optimise -g 17 -G 0.95 -S 0.05 -Z 12.5 example1 1000
Will optimise using a genetic algorithm
Optimising for maximum possible gain.
Optimising for an input SWR as low as possible
G= 9.65dBi,FB= 12.30dB,SL= 0.00dB,SWR= 5.18,Z= 42.42-j 29.86,0.459
1 G=10.01dBi,FB= 15.75dB,SL= 0.00dB,SWR= 3.65,Z= 28.36+j 20.77,0.558
3 G=10.00dBi,FB= 15.24dB,SL= 0.00dB,SWR= 3.55,Z= 28.71+j 19.85,0.565
4 G=10.09dBi,FB= 14.76dB,SL= 0.00dB,SWR= 3.50,Z= 25.36+j 20.04,0.573
4 G= 9.55dBi,FB=  9.22dB,SL= 0.00dB,SWR= 1.60,Z= 19.63+j  1.91,0.707
5 G=11.23dBi,FB=  8.25dB,SL= 0.00dB,SWR= 1.60,Z= 10.48+j  5.05,0.820
9 G=10.77dBi,FB= 13.02dB,SL= 0.00dB,SWR= 1.20,Z= 13.71-j  2.02,0.852
9 G=10.92dBi,FB=  9.49dB,SL= 0.00dB,SWR= 1.16,Z= 13.19-j  1.77,0.870
12 G=11.02dBi,FB= 11.25dB,SL= 0.00dB,SWR= 1.13,Z= 12.78+j  1.50,0.882
15 G=12.07dBi,FB= 11.89dB,SL= 0.00dB,SWR= 1.19,Z= 11.87+j  2.02,0.942
19 G=12.08dBi,FB= 11.93dB,SL= 0.00dB,SWR= 1.19,Z= 11.82+j  1.95,0.943
21 G=12.20dBi,FB= 12.55dB,SL= 0.00dB,SWR= 1.18,Z= 11.54+j  1.70,0.954
21 G=12.03dBi,FB= 13.64dB,SL= 0.00dB,SWR= 1.11,Z= 12.79-j  1.29,0.954
22 G=12.11dBi,FB= 12.24dB,SL= 0.00dB,SWR= 1.12,Z= 11.91+j  1.24,0.958
23 G=12.22dBi,FB= 12.70dB,SL= 0.00dB,SWR= 1.15,Z= 11.14+j  0.88,0.960
25 G=12.14dBi,FB= 14.04dB,SL= 0.00dB,SWR= 1.05,Z= 12.00+j  0.23,0.975
30 G=12.08dBi,FB= 15.07dB,SL= 0.00dB,SWR= 1.02,Z= 12.69-j  0.18,0.976
38 G=12.17dBi,FB= 14.17dB,SL= 0.00dB,SWR= 1.04,Z= 12.35+j  0.47,0.978
42 G=12.15dBi,FB= 14.55dB,SL= 0.00dB,SWR= 1.03,Z= 12.60+j  0.31,0.979
59 G=12.17dBi,FB= 14.23dB,SL= 0.00dB,SWR= 1.03,Z= 12.26+j  0.30,0.980
62 G=12.15dBi,FB= 14.62dB,SL= 0.00dB,SWR= 1.01,Z= 12.51+j  0.15,0.983
67 G=12.16dBi,FB= 14.65dB,SL= 0.00dB,SWR= 1.01,Z= 12.45-j  0.03,0.984
103 G=12.16dBi,FB= 14.63dB,SL= 0.00dB,SWR= 1.00,Z= 12.49+j  0.05,0.985
The best design is in a file "example1.bes". You should check it thoroughly
and if its better than example1, copy example1.bes to example1
parrot /export/home/drkirkby/yagiuda-1.18/src %