11
/* The maximum gain of a Yagi is given in the ARRL handbook, 1991, pp33-17
12
as 12dB at one wavelength boom length, rising at 2.6 dB
13
each time boom lengtrh is doubled */
15
double determine_maximum_gain(double f, double boom_length_in_m)
17
double lambda, wavelengths, max_gain;
21
wavelengths=boom_length_in_m/lambda; /* boom length in wavelengths */
25
max_gain = 12.0 + 2.6*log2(wavelengths);
29
fprintf(stderr,"Errno =%d in determine_maximum_gain() of max_gain.c\n", errno);
36
/* This is another algorithm. Its not as accurate as above, but it gives the
37
same result form given number of elements. This allows more accurate comparison
38
of fitnesss'es for the GA and -W algorithm, which would otherwise not be possible. */
39
double determine_maximum_gain2(int elements)
41
double wavelengths, max_gain;
44
wavelengths=(elements-1)*0.25; /* boom length in wavelengths */
45
max_gain = 12.0 + 2.6*log2(wavelengths);
49
fprintf(stderr,"Errno =%d in determine_maximum_gain2() of max_gain.c\n", errno);
58
return(log(x)/0.6931471);