Commit 4ceadfd8 authored by Vasilis Tsiligiannis's avatar Vasilis Tsiligiannis

nec2: Add GNU octave calculator and NEC2 file for 10-element Yagi/Uda UHF antenna

parent 61976376
#!/usr/bin/octave -qf
#
# Yagi-Uda antenna wavelength size calculator
#
# Copyright (C) 2014-2015 Vasilis Tsiligiannis <acinonyx@openwrt.gr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Describe antenna
#
# Elements are defined from reflector to directors. First column is
# the position and second the size of the element. First element
# position (reflector) should always be zero. All sizes are in
# Single reflector and single radiator design is assumed.
antenna.dc = 1;
antenna.elements = [ 0, 335e-3 * antenna.dc
145e-3, 323e-3 * antenna.dc
200e-3, 302e-3 * antenna.dc
375e-3, 291e-3 * antenna.dc
625e-3, 285e-3 * antenna.dc
910e-3, 282e-3 * antenna.dc
1200e-3, 279e-3 * antenna.dc
1485e-3, 279e-3 * antenna.dc
1770e-3, 283e-3 * antenna.dc
1985e-3, 279e-3 * antenna.dc ] * 425e6 / 435e6;
antenna.diameter = 8e-3;
# Center frequency
frequency = 435e6;
# NEC element segments
nec.segments = 41;
# DO NOT EDIT BELOW!!!
# Constants
# Speed of light
c = 299792458;
# Functions
# Appends half values from last column
#
# Parameters
# mat Matrix to append
#
# Returns
# mat-append Resulting matrix
function ret_mat = append_last_col_half (mat)
ret_mat = [ mat, mat(:, end) / 2];
endfunction
# Converts frequency to wavelength
#
# Parameters
# freq Frequency
# c Speed of light
#
# Returns
# wave Wavelength
function ret_wave = freq_to_wave (freq, c)
ret_wave = c / freq;
endfunction
# Main
# Sanity checks
# Check if we have at least 2 elements
if rows(antenna.elements) < 2
error("Antenna with less than two elements");
endif
# Check if reflector is at position zero
if antenna.elements(1, 1) != 0
error("Reflector position is not zero");
endif
# Calculate wavelength
wave = freq_to_wave(frequency, c);
# Duplicate last column
antenna.elements = append_last_col_half(antenna.elements);
# Divide by wavelength
antenna.wave = antenna.elements / wave;
# Print description
printf("Yagi-Uda antenna wavelength size calculator\n\n");
# Print wavelength
printf("Wavelength:\t%eλ\n\t\t(%eHz)\n", wave, frequency);
# Print element diameter
printf("Diameter:\t%eλ\n\t\t(%em)\n\n", antenna.diameter / wave, antenna.diameter);
# Print header row
printf("Element\t\tPosition\tLength\t\tHalf length\n");
# Print reflector
printf("Reflector:\t%eλ\t%eλ\t%eλ\n\t\t%em\t%em\t%em\n", [ antenna.wave'(:, 1); antenna.elements'(:, 1) ]);
# Print radiator
printf("Radiator:\t%eλ\t%eλ\t%eλ\n\t\t%em\t%em\t%em\n", [ antenna.wave'(:, 2); antenna.elements'(:, 2) ]);
# Check if directors exist and print them
if rows(antenna.elements) > 2
printf("Director:\t%eλ\t%eλ\t%eλ\n\t\t%em\t%em\t%em\n", [ antenna.wave'(:, 3:end); antenna.elements'(:, 3:end) ]);
endif
# Print NEC2
printf("\n\n-------- NEC2 wires --------\n");
# Print GW
for i = 1:rows(antenna.elements)
printf("GW\t%d\t%d\t%e\t%e\t%e\t%e\t%e\t%e\t%e\n", i, nec.segments, antenna.wave'(1, i), -antenna.wave'(3, i), 0, antenna.wave'([1, 3], i), 0, antenna.diameter / (2 * wave));
endfor
# Print GM
printf("GM\t%d\t%d\t%e\t%e\t%e\t%e\t%e\t%e\t%e\n", 0, 0, 90, 0, 0, -antenna.wave'([1], 2), 0, 0, 0);
# Print GS
printf("GS\t%d\t%d\t%e\t%e\t%e\t%e\t%e\t%e\t%e\n", 0, 0, wave, 0, 0, 0, 0, 0, 0);
CM SatNOGS 10-element Yagi Antenna
CM
CM Copyright (C) 2014-2015 Vasilis Tsiligiannis <[email protected]>
CM
CM This program is free software: you can redistribute it and/or modify
CM it under the terms of the GNU General Public License as published by
CM the Free Software Foundation, either version 3 of the License, or
CM (at your option) any later version.
CM
CM This program is distributed in the hope that it will be useful,
CM but WITHOUT ANY WARRANTY; without even the implied warranty of
CM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
CM GNU General Public License for more details.
CM
CM You should have received a copy of the GNU General Public License
CM along with this program. If not, see <http://www.gnu.org/licenses/>.
CM
CM Tuned at 435MHz
CM Vertical polarization
CM 2m above imperfect ground
CM Ground relative dielectric const. 5, conductivity 1mS/m
CM 8mm cylindrical aluminum wires, conductivity 35MS/m
CM
CE
GW 1 41 0.00000E+00 -2.37456E-01 0.00000E+00 0.00000E+00 2.37456E-01 0.00000E+00 5.80402E-03
GW 2 41 2.05559E-01 -2.28950E-01 0.00000E+00 2.05559E-01 2.28950E-01 0.00000E+00 5.80402E-03
GW 3 41 2.83529E-01 -2.14065E-01 0.00000E+00 2.83529E-01 2.14065E-01 0.00000E+00 5.80402E-03
GW 4 41 5.31618E-01 -2.06268E-01 0.00000E+00 5.31618E-01 2.06268E-01 0.00000E+00 5.80402E-03
GW 5 41 8.86030E-01 -2.02015E-01 0.00000E+00 8.86030E-01 2.02015E-01 0.00000E+00 5.80402E-03
GW 6 41 1.29006E+00 -1.99888E-01 0.00000E+00 1.29006E+00 1.99888E-01 0.00000E+00 5.80402E-03
GW 7 41 1.70118E+00 -1.97762E-01 0.00000E+00 1.70118E+00 1.97762E-01 0.00000E+00 5.80402E-03
GW 8 41 2.10521E+00 -1.97762E-01 0.00000E+00 2.10521E+00 1.97762E-01 0.00000E+00 5.80402E-03
GW 9 41 2.50924E+00 -2.00597E-01 0.00000E+00 2.50924E+00 2.00597E-01 0.00000E+00 5.80402E-03
GW 10 41 2.81403E+00 -1.97762E-01 0.00000E+00 2.81403E+00 1.97762E-01 0.00000E+00 5.80402E-03
GM 0 0 9.00000E+01 0.00000E+00 0.00000E+00 -2.05559E-01 0.00000E+00 0.00000E+00 0.00000E+00
GS 0 0 6.89178E-01 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
GM 0 0 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 2.00000E+00 0.00000E+00
GE 1 0 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
FR 0 101 0 0 4.30000E+02 1.00000E-01 4.40000E+02 0.00000E+00 0.00000E+00 0.00000E+00
EK 0 0 0 0 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 1 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 2 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 3 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 4 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 5 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 6 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 7 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 8 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 9 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
LD 5 10 0 0 3.50000E+07 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
KH 0 0 0 0 1.50000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
EX 0 2 21 0 1.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
GN 2 0 0 0 5.00000E+00 1.00000E-03 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
RP 0 91 72 1000 0.00000E+00 0.00000E+00 1.00000E+00 5.00000E+00 0.00000E+00 0.00000E+00
EN 0 0 0 0 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment