# Table 1. # Octave code. f = 7.01; # FREQUENCY IN MHz d = 100; # LENGTH OF LINE IN FEET a = 2.0; # ATTENUATION IN dB PER 100 FEET v = 66; # VELOCITY FACTOR AS A PERCENTAGE #Zo = 50; Zo = 50 - 1j * 0.72; # CHARACTERISTIC IMPEDANCE IN OHMS # Specify source (transmitter) and load (antenna) VS = 2.0; RS = 50; Rt = 100; Xt = 0; # Convert inputs as required a = a ./ 1e2; # convert dB per 100 feet to dB per foot a = 0.1151 .* a; # convert dB to nepers c = 9.836e8; # speed of light in feet per second lambda = c ./ (1e6 .* f); # wavelength of signal in vacuum lambda = (v ./ 1e2) .* lambda; # adjust lambda for velocity B = (2 .* pi) ./ lambda; # calculate Beta ZL = Rt .+ j .* Xt; # calculate complex terminating impedance # Calculate elements of T-equivalent network # ZA = input series element # ZB = output series element # ZC = shunt element ZA = Zo .* tanh((a .+ j .*B) .* d ./ 2.); ZB = ZA; ZC = Zo ./ sinh((a .+ j .*B) .* d); # Prepare matrices for solution of currents right_side = [RS + ZA + ZC, -ZC; -ZC, ZB + ZC + ZL]; left_side = [VS; 0]; # Solve for currents denom = det(right_side); for m = 1: rows(right_side) numerator = right_side; for n = 1: rows(right_side) numerator(n, m) = left_side(n); endfor current(m) = det(numerator) / denom; endfor # Calculate T-network input impedance Zd = ZA .+ (ZC .* (ZB + ZL)) ./ (ZC .+ ZB .+ ZL); # Calculate input power to T-network from source Pwr_in = abs(current(1)) ^ 2 * real(Zd); # Calculate power delivered by T-network to load Pwr_load = abs(current(rows(right_side))) ^ 2 * real(ZL); # Calculate T-network line loss Line_loss = 10 * log10(Pwr_in / Pwr_load); printf("\n T-NETWORK LINE LOSS (in dB) = %-8.5g", Line_loss); # Calculate coefficients of ABCD matrix and solve # for input voltage and current Vt = 1.0; gamma_l = (a + 1j * B) * d; A = cosh(gamma_l); B = Zo * sinh(gamma_l); C = sinh(gamma_l) / Zo; D = cosh(gamma_l); It = Vt / ZL; Vi = A * Vt + B * It; Ii = C * Vt + D * It; # Calculate ABCD matrix input impedance Zin = Vi / Ii; # Calculate input power to line (ABCD matrix) from source Pwr_in = abs(Ii ^ 2) * real(Zin); # Calculate power dissipated in load Pwr_out = abs(It ^ 2) * real(ZL); # Calculate and print out ABCD matrix line loss Line_loss = 10 * log10(Pwr_in / Pwr_out); printf("\n ABCD MATRIX LINE LOSS (in dB) = %-8.5g\n", Line_loss); # Calculate and print out ARRL Antenna Book Total Loss (Eq. 16) refl_coef = (ZL - Zo) / (ZL + Zo); SWR = (1 + abs(refl_coef)) / (1 - abs(refl_coef)); adB = a / 0.1151; mllr = 10 ^ (d * adB / 10); Total_loss = 10 * log10((mllr ^ 2 - abs(refl_coef) ^ 2) / ... (mllr * (1 - abs(refl_coef) ^ 2))); printf(" ARRL EQ. 16 TOTAL LOSS (in dB) = %-8.5g\n\n", Total_loss); # Table 2. # Octave code. Zo = 50 ohms: T-NETWORK LINE LOSS (in dB) = 2.3145 ABCD MATRIX LINE LOSS (in dB) = 2.3145 ARRL EQ. 16 TOTAL LOSS (in dB) = 2.315 Zo = 50 - j0.72 ohms: T-NETWORK LINE LOSS (in dB) = 2.2907 ABCD MATRIX LINE LOSS (in dB) = 2.2907 ARRL EQ. 16 TOTAL LOSS (in dB) = 2.3151 # Table 3. # Octave code. graphics_toolkit gnuplot; #gamma = 1j * 0.5; # Used to generate Figure 1 gamma = 0.01 + 1j * 0.5; # Used to generate Figure 2 V1 = 1.0; V2 = 0.5; rho = V2 / V1; p = log(1 / sqrt(abs(rho))); q = -0.5 * arg(rho); l = 16 * pi; z = linspace(0, l, 200); d = l .- z; Vdabs = sqrt((sinh(real(gamma) .* d .+ p)) .^ 2 + (cos(imag(gamma) .* d .+ q)) .^ 2); # (8.17) scale_factor = abs(2 .* V1 * e .^ (-1j .* imag(gamma) .* l) .* sqrt(rho)); Vdabs = scale_factor .* Vdabs; upper_bound = scale_factor .* cosh(real(gamma) .* d .+ p); lower_bound = scale_factor .* sinh(real(gamma) .* d .+ p); plot(d, Vdabs, d, upper_bound, d, lower_bound); grid(); xlabel("DISTANCE ALONG LINE => TOWARD TRANSMITTER"); ylabel("LINE VOLTAGE: ABSOLUTE VALUE"); pause;