Invntr
Source

All instruments

antenna_array

Linear antenna array of equally spaced isotropic elements: the array factor against angle from the array axis for N elements, spacing in wavelengths and a progressive phase step (or a steering angle), with uniform, binomial, Dolph-Chebyshev or custom symmetric amplitude taper. Gives beam direction, half-power and first-null beamwidths, every null, first and highest sidelobe, directivity (exact sum), and a grating-lobe check. Array factor only: element pattern, mutual coupling and losses are not modelled.

Field
Waves, optics and circuits
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replayantenna_array 0.1.0 · files f46a84d05c30…4b26
  1. r0001uniform broadside N = 4, d = lambda/2 (Balanis, Antenna Theory, sec. 6.3): nulls at cos(theta) = m lambda/(N d) = 0, +-1/2, +-1 -> 0, 60, 120, 180 deg; AF = cos(psi/2) cos(psi), so the sidelobe is 2/(3 sqrt 6) = -11.3033 dB and the half-power point solves cos(psi/2) cos(psi) = 1/sqrt 2; half-wave spacing gives D = N = 4; closed forms, 1e-6passed

    beam_angle_deg90 ± 1e-0990lockedunder 0.01 % of the tolerance used
    null_count= 44lockedexact match
    nulls_deg.0{"value": 0.0, "abs_tol": 1e-06}
    nulls_deg.1{"value": 60.0, "abs_tol": 1e-06}
    nulls_deg.2{"value": 120.0, "abs_tol": 1e-06}
    nulls_deg.3{"value": 180.0, "abs_tol": 1e-06}
    fnbw_deg60 ± 1e-0660lockedunder 0.01 % of the tolerance used
    first_sidelobe_db-11.3033 ± 1e-06-11.3033lockedunder 0.01 % of the tolerance used
    hpbw_deg26.323 ± 1e-0626.323lockedunder 0.01 % of the tolerance used
    directivity4 ± 4e-094lockedunder 0.01 % of the tolerance used
    grating_lobe_free= truetruelockedexact match
  2. r0002uniform broadside N = 3, d = lambda/2: AF = (1 + 2 cos psi)/3, nulls at cos(theta) = +-2/3, one sidelobe each side at endfire of level 1/3 = -9.5424 dB, D = N = 3; closed forms, 1e-6passed

    null_count= 22lockedexact match
    first_null_low_deg48.1897 ± 1e-0648.1897lockedunder 0.01 % of the tolerance used
    first_null_high_deg131.81 ± 1e-06131.81lockedunder 0.01 % of the tolerance used
    sidelobe_count= 22lockedexact match
    first_sidelobe_db-9.54243 ± 1e-06-9.54243lockedunder 0.01 % of the tolerance used
    directivity3 ± 3e-093lockedunder 0.01 % of the tolerance used
  3. r0003two elements in phase, d = lambda/2: AF = cos((pi/2) cos theta), no sidelobe, nulls on the axis (0 and 180 deg), half power at cos(theta) = +-1/2 so HPBW = 60 deg, D = 2; closed forms, 1e-6passed

    sidelobe_count= 00lockedexact match
    first_sidelobe_db= lockedexact match
    hpbw_deg60 ± 1e-0660lockedunder 0.01 % of the tolerance used
    first_null_low_deg0 ± 1e-060lockedunder 0.01 % of the tolerance used
    first_null_high_deg180 ± 1e-06180lockedunder 0.01 % of the tolerance used
    directivity2 ± 2e-092lockedunder 0.01 % of the tolerance used
  4. r0004two elements in phase, d = lambda/4: D = 2/(1 + sin(k d)/(k d)) = 2/(1 + 2/pi) = 1.2220309 (Kraus, Antennas, two isotropic sources); no null and no sidelobe (the pattern is exactly at half power on the axis, cos^2(pi/4) = 1/2, so the beamwidth is not graded); closed form, 1e-9passed

    directivity1.22203 ± 1.2e-091.22203lockedunder 0.01 % of the tolerance used
    null_count= 00lockedexact match
    sidelobe_count= 00lockedexact match
  5. r0005steering, N = 8, d = lambda/2, beta = -90 deg: peak where k d cos(theta) + beta = 0 -> cos(theta) = 1/2, 60 deg; first nulls at psi = +-2 pi/N -> cos(theta) = 3/4 and 1/4; half-power point solves sin(4 psi)/(8 sin(psi/2)) = 1/sqrt 2; half-wave spacing gives D = N = 8 at any scan; closed forms, 1e-6passed

    beam_angle_deg60 ± 1e-0960lockedunder 0.01 % of the tolerance used
    first_null_low_deg41.4096 ± 1e-0641.4096lockedunder 0.01 % of the tolerance used
    first_null_high_deg75.5225 ± 1e-0675.5225lockedunder 0.01 % of the tolerance used
    fnbw_deg34.1129 ± 1e-0634.1129lockedunder 0.01 % of the tolerance used
    hpbw_deg14.8356 ± 1e-0614.8356lockedunder 0.01 % of the tolerance used
    directivity8 ± 8e-098lockedunder 0.01 % of the tolerance used
    max_spacing_no_grating_wavelengths0.666667 ± 6.7e-100.666667lockedunder 0.01 % of the tolerance used
  6. r0006ordinary endfire, N = 10, d = lambda/4, beta = -k d = -90 deg (Balanis sec. 6.3.3): beam on the axis, first null at cos(theta) = 1 - lambda/(N d) = 0.6 -> 53.1301 deg, FNBW twice that; HPBW = 2 acos(1 - psi_h/(k d)) with sin(5 psi_h)/(10 sin(psi_h/2)) = 1/sqrt 2; every lag term sin(2 l k d) vanishes so D = N = 10; closed forms, 1e-6passed

    beam_angle_deg0 ± 1e-060lockedunder 0.01 % of the tolerance used
    first_null_high_deg53.1301 ± 1e-0653.1301lockedunder 0.01 % of the tolerance used
    fnbw_deg106.26 ± 1e-06106.26lockedunder 0.01 % of the tolerance used
    hpbw_deg69.4185 ± 1e-0669.4185lockedunder 0.01 % of the tolerance used
    directivity10 ± 1e-0810lockedunder 0.01 % of the tolerance used
  7. r0007large-N asymptotes at N = 200, d = lambda/2: first sidelobe tends to the sinc value -13.2615 dB (tan x = x at x = 4.4934; the N = 200 value differs by x^2/(6 N^2) = 0.0007 dB, so abs_tol 0.002 dB) and HPBW tends to 0.8859 lambda/(N d) rad = 0.50758 deg (terms of order 1/N^2 dropped, so rel_tol 1e-4); D = N = 200 exactlypassed

    first_sidelobe_db-13.2615 ± 0.002-13.2607locked37 % of the tolerance used
    hpbw_deg0.507579 ± 5.1e-050.507586locked14 % of the tolerance used
    directivity200 ± 2e-07200lockedunder 0.01 % of the tolerance used
    null_count= 200200lockedexact match
  8. r0008Dolph-Chebyshev N = 10, 26 dB, d = lambda/2 (Dolph 1946): AF = T9(x0 cos(psi/2)), T9(x0) = R: every sidelobe at -26 dB, first nulls where x0 cos(psi/2) = cos(pi/18), half power where T9 = R/sqrt 2 -> cosh(acosh(R/sqrt 2)/9)/x0; closed forms, 1e-6passed

    first_sidelobe_db-26 ± 1e-06-26lockedunder 0.01 % of the tolerance used
    max_sidelobe_db-26 ± 1e-06-26lockedunder 0.01 % of the tolerance used
    first_null_low_deg73.9909 ± 1e-0673.9909lockedunder 0.01 % of the tolerance used
    first_null_high_deg106.009 ± 1e-06106.009lockedunder 0.01 % of the tolerance used
    hpbw_deg12.3459 ± 1e-0612.3459lockedunder 0.01 % of the tolerance used
    null_count= 1010lockedexact match
  9. r0009Dolph-Chebyshev N = 3, 20 dB (R = 10): T2(x0 cos(psi/2)) = (x0^2 - 1) + x0^2 cos(psi) with x0^2 = (R + 1)/2, so centre/edge = 2 (R - 1)/(R + 1) = 18/11 and the sidelobe is -20 dB; closed forms, 1e-9 and 1e-6 dBpassed

    centre_over_edge1.63636 ± 1.6e-091.63636lockedunder 0.01 % of the tolerance used
    max_sidelobe_db-20 ± 1e-06-20lockedunder 0.01 % of the tolerance used
  10. r0010Dolph-Chebyshev weights N = 8, 30 dB, d = lambda/2: T7(x0 z), z = cos(psi/2), x0 = cosh(acosh(10^1.5)/7), expanded as a polynomial in z and turned into harmonics with cos^p = 2^-p sum C(p, j) cos((p - 2j) psi/2) (algebra, not the program's Fourier sum): weights 0.26221649, 0.51874705, 0.81196007, 1 (largest = 1); half-wave broadside so D = (sum a)^2/sum a^2 = 6.7328972; first null where x0 z = cos(pi/14); half power where T7 = R/sqrt 2; closed forms, 1e-9 relative and 1e-6 deg or dBpassed

    weights.0{"value": 0.2622164911915371, "rel_tol": 1e-09}
    weights.1{"value": 0.5187470541275406, "rel_tol": 1e-09}
    weights.2{"value": 0.8119600672627029, "rel_tol": 1e-09}
    weights.3{"value": 1.0, "rel_tol": 1e-12}
    weights.7{"value": 0.2622164911915371, "rel_tol": 1e-09}
    directivity6.7329 ± 6.7e-096.7329lockedunder 0.01 % of the tolerance used
    max_sidelobe_db-30 ± 1e-06-30lockedunder 0.01 % of the tolerance used
    first_null_low_deg67.573 ± 1e-0667.573lockedunder 0.01 % of the tolerance used
    hpbw_deg16.4432 ± 1e-0616.4432lockedunder 0.01 % of the tolerance used
    null_count= 88lockedexact match
  11. r0011binomial N = 5, d = lambda/2 (Stone's array): AF = cos^4(psi/2), no sidelobe, nulls only on the axis, HPBW = 2 asin((2/pi) acos(2^(-1/8))) = 30.2826 deg, D = (sum a)^2/sum a^2 = 256/70; closed forms, 1e-6passed

    sidelobe_count= 00lockedexact match
    null_count= 22lockedexact match
    hpbw_deg30.2826 ± 1e-0630.2826lockedunder 0.01 % of the tolerance used
    directivity3.65714 ± 3.7e-093.65714lockedunder 0.01 % of the tolerance used
    centre_over_edge6 ± 6e-126lockedunder 0.01 % of the tolerance used
  12. r0012grating lobe: N = 8, d = 0.7 lambda steered to 60 deg: beta = -360 (0.7)(0.5) = -126 deg; d exceeds 1/(1 + |cos 60|) = 2/3 lambda, so psi = -360 deg is visible at cos(theta) = 1/2 - 1/0.7 -> 158.2132 deg; closed forms, 1e-6passed

    phase_deg-126 ± 1e-09-126lockedunder 0.01 % of the tolerance used
    beam_angle_deg60 ± 1e-0960lockedunder 0.01 % of the tolerance used
    grating_lobe_free= falsefalselockedexact match
    grating_lobe_count= 11lockedexact match
    grating_lobe_angles_deg.0{"value": 158.2132107017382, "abs_tol": 1e-06}
    max_spacing_no_grating_wavelengths0.666667 ± 6.7e-100.666667lockedunder 0.01 % of the tolerance used
  13. r0013custom weights [1, 3, 3, 1], d = lambda/2: AF = cos^3(psi/2) (the N = 4 binomial array given by hand): nulls only on the axis, no sidelobe, D = (sum a)^2/sum a^2 = 64/20 = 3.2, HPBW =2 asin((2/pi) acos(2^(-1/6))) = 34.9334 deg; closed forms, 1e-6passed

    n_elements= 44lockedexact match
    null_count= 22lockedexact match
    sidelobe_count= 00lockedexact match
    directivity3.2 ± 3.2e-093.2lockedunder 0.01 % of the tolerance used
    hpbw_deg34.9334 ± 1e-0634.9334lockedunder 0.01 % of the tolerance used
  14. r0014main beam outside visible space: 4 elements at a quarter wavelength with a 180 deg phase step; |beta| = 180 deg exceeds k d = 90 deg, so there is no full-strength peak and the verdict must fail (closed form: visible only when |beta| <= 360 deg * d/lambda)passed

    main_beam_visible= falsefalselockedexact match
    single_main_beam= falsefalselockedexact match
14 of 14 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
n_elements18Number of elements N. With taper = custom the number of weights is used instead.
spacing_wavelengths10.5Element spacing divided by the wavelength, d / lambda.
phase_degdeg0Progressive phase beta from one element to the next. 0 is broadside; -360 d / lambda is endfire toward 0 deg. Ignored when steer_angle_deg is given.
steer_angle_degdegOptional: point the beam at this angle from the array axis (90 = broadside); sets beta = -360 (d / lambda) cos(angle) deg.
taperuniformAmplitude taper. binomial: C(N-1, n), no sidelobes at half-wave spacing. chebyshev: Dolph-Chebyshev, all sidelobes at sidelobe_db. custom: the weights input.
sidelobe_db26Chebyshev taper only: sidelobe level below the main beam, a positive number of dB.
weightstaper = custom only: one real amplitude per element, zero or positive, symmetric about the centre, 2 to 500 values.

Readings

NameUnitMeaning
n_elements1
taper1
spacing_wavelengths1
array_length_wavelengths1(N - 1) d / lambda
phase_degdegthe progressive phase used
main_beam_visible1false when |beta| > k d: no full-strength peak in visible space
beam_angle_degdegmain-beam direction from the array axis: cos(theta) = -beta / (k d)
beam_from_broadside_degdeg90 - beam_angle_deg
hpbw_degdeghalf-power beamwidth; for a beam on the axis, twice the angle from the axis to the half-power point; null when the pattern never drops 3 dB
half_power_low_degdeg
half_power_high_degdeg
fnbw_degdegwidth between the first nulls either side of the main beam
first_null_low_degdeg
first_null_high_degdeg
null_count1
nulls_degdegevery null in 0 to 180 deg, ascending (first 200; out/nulls.csv holds all)
sidelobe_count1lobe peaks in 0 to 180 deg other than the main beam and grating lobes
first_sidelobe_dbdB relative to the main beam: the higher of the two lobes next to the main beam; null when there is none
first_sidelobe_angle_degdeg
max_sidelobe_dbdB relative to the main beam: the highest sidelobe (grating lobes are counted separately)
max_sidelobe_angle_degdeg
directivity1peak power over the average over the sphere, isotropic elements
directivity_db10 log10(directivity), dBi
directivity_check_rel_diff1relative gap between the exact sum and Simpson's rule for the sphere average
taper_efficiency1(sum a)^2 / (N sum a^2)
centre_over_edge1largest weight over the end element's weight
weights1element amplitudes, largest = 1 (first 200; out/weights.csv holds all)
grating_lobe_free1true when no second full-strength peak (psi = 360 m deg) is in visible space
single_main_beamtrue when the main beam is in visible space and no grating lobe is: the verdict
grating_lobe_count1
grating_lobe_angles_degdeg
max_spacing_no_grating_wavelengths11 / (1 + |cos(beam angle)|): below this spacing no grating-lobe peak enters visible space; files: out/pattern.csv, out/lobes.csv, out/nulls.csv, out/weights.csv
warnings1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call