07 марта 2021

PARABOLA.BAS

 10 ' PARA: PARABOLIC ANTENNA DESIGN AND ANALYSIS PROGRAM

20 ' Reflector profile (depth vs radius), gain and beamwidth calculations

30 ' The effect of various illumination tapers on gain, beamwidth and

40 ' sidelobe performance can also calculated.

50 ' Aperture illumination/sidelobe data from The Handbook of Antenna Design

60 ' Ch 1 Vol 1 edited by Rudge et al, published by Peter Pereginus

70 ' Inspired by a program by  WA6YOB

80 ' This program (c) by R P Blackwell  November 1992

90 '

100 ' constants

110 DEF FNLG (X) = LOG(X) / LOG(10)

120 TRUE = -1: FALSE = 0: PR = FALSE: PI = 3.141592

130 RD = 180 / (2 * PI): C = 30000

140 ' start

150 KEY OFF: CLS : CLOSE

160 COLOR 11, 0

170 LOCATE 1, 5: PRINT "PARA: Parabolic antenna design/analysis program  Version 2.0"

180 COLOR 3, 0

190 LOCATE 3, 5: PRINT "                by R P Blackwell G4PMK"

200 COLOR 7, 0

210 LOCATE 6, 5: PRINT "This program is written for circular parabolic reflectors."

220 LOCATE 8, 5: PRINT "For a given dish size and focal length (or f/D ratio), a table"

230 LOCATE 9, 5: PRINT "of reflector cross-section measurements can be generated,"

240 LOCATE 10, 5: PRINT "for constructing the reflector."

250 LOCATE 12, 5: PRINT "The associated gain and beamwidth, and the effect of different"

260 LOCATE 13, 5: PRINT "illumination tapers on the -3dB beamwidth and the position and"

270 LOCATE 14, 5: PRINT "size of the first sidelobe can also be found."

280 LOCATE 18, 5: PRINT "Do you want to see a pictorial definition of the terms"

290 LOCATE 19, 5: PRINT "used in this program? (y/N) > ";

300 GOSUB 1750: IF ZZ$ = "Y" THEN GOSUB 1270: ' GRAPHICS SUBROUTINE

310 ' reflector depth calculated at 1-unit intervals

320 CLS : COLOR 11

330 LOCATE 1, 20: PRINT "Parabolic reflector size": PRINT

340 COLOR 7

350 PRINT "Select Metric (cm) or Imperial (inch) units  (M/i) >";

360 GOSUB 1750: PRINT : IF ZZ$ = "I" THEN METRIC = FALSE ELSE METRIC = TRUE

370 IF METRIC THEN UNIT$ = "cm" ELSE UNIT$ = "inches"

380 PRINT : PRINT "Enter diameter of reflector in "; UNIT$;

390 INPUT ": ", DI

400 PRINT : PRINT "Enter required focal length of reflector (>1) in "; UNIT$

410 PRINT "or required f/D ratio (<1)";

420 INPUT ": ", FI

430 IF FI < 1! THEN FI = FI * DI:

440 FD = FI / DI

450 YF = DF / 2

460 YI = DI / 2

470 DIM ZZ(DI, 2)

480 FOR Y = 1 TO YI

490 ZZ(Y, 0) = Y

500 ZZ(Y, 1) = (INT(Y ^ 2 / (4 * FI) * 100)) / 100

510 NEXT Y

520 ' ***** SELECT OUTPUT DEVICE *****

530 PRINT : PRINT "Do you want printed results? (y/N) > ";

540 GOSUB 1750

550 IF ZZ$ = "Y" THEN PR = TRUE

560 ' ***** OUTPUT *****

570 PC = 0

580 CLS : CLOSE 1

590 IF PR THEN OPEN "LPT1:" FOR OUTPUT AS 1 ELSE OPEN "SCRN:" FOR OUTPUT AS 1

600 PRINT : PRINT "Do you want depth/radius calculations? (Y/n)> ";

610 GOSUB 1750: IF ZZ$ = "N" THEN GOTO 750

620 CLS : GOSUB 1780

630 PG = 0: IF PC = 1 THEN 650

640 FOR I = 0 TO YI STEP ABS(METRIC - 1)

650 PRINT #1, USING "#########"; ZZ(I, 0);

660 PRINT #1, SPC(25);

670 PRINT #1, USING "######.##"; ZZ(I, 1)

680 PG = PG + 1: IF PR THEN 730

690 IF PG < 17 THEN 730

700 PRINT

710 GOSUB 1940: GOSUB 1780

720 PG = 0

730 NEXT I

740 GOSUB 1940

750 PRINT : PRINT "Do you want to calculate the gain? (Y/n) > ";

760 GOSUB 1750

770 IF ZZ$ = "N" THEN GOTO 1220

780 PRINT : PRINT

790 INPUT "Enter operating frequency in GHz: ", F

800 F = F * 1000: WL = C / F

810 CLS : COLOR 11

820 LOCATE 1, 15: PRINT "Parabolic antenna gain and beamwidth "

830 COLOR 7: LOCATE 4, 1

840 IF NOT METRIC THEN DX = DI * 2.54 ELSE DX = DI

850  G1 = .6 * ((PI * DX / WL) ^ 2): G = 10 * FNLG(G1)

860 TH = (10 * (FNLG(27000) - FNLG(G1)) / 2): TH = (10 ^ (TH / 10))

870 PRINT #1,

880 PRINT #1, USING "    At a frequency of ##.## GHz (wavelength ##.##cm)"; F / 1000; WL

890 PRINT #1, USING "    a dish of ####.# & diameter and #.## f/D"; DI; LEFT$(UNIT$, 2); FD

900 PRINT #1, USING "    has a nominal gain of ##.# dB,"; G

910 PRINT #1, USING "    and an approximate -3dB beamwidth of ##.#ш"; TH

920 PRINT #1, : PRINT #1, "      This gain is based on an efficiency of 60% "

930 PRINT #1, : LOCATE 15, 1

940 PRINT "Do you want gain/sidelobe data for specific illumination patterns? (Y/n) >";

950 GOSUB 1750: IF ZZ$ = "N" THEN 1220

960 CLS

970 IF METRIC THEN D = DI / 100

980 IF NOT METRIC THEN D = DI * 2.54 / 100

990 PRINT : PRINT

1000 PRINT "Select feed illumination pattern:": PRINT

1010 PRINT "Uniform illumination      -  1"

1020 PRINT "Zero edge taper (1-rэ)    -  2"

1030 PRINT "Zero edge taper (1-rэ)э   -  3"

1040 PRINT "Tapered to 0.5 at edge"

1050 PRINT "            0.5+(1-rэ)э   -  4"

1060 PRINT "Taylor distribution       -  5"

1070 PRINT : PRINT "     Press 1 - 5 > ";

1080  ZZ = VAL(INPUT$(1))

1090 IF ZZ < 1 OR ZZ > 5 THEN GOTO 1070

1100 PRINT ZZ

1110 LOVERD = WL / (D * 100)

1120 ON ZZ GOSUB 1840, 1860, 1880, 1900, 1920

1130 BW = 2 * K1 * LOVERD * RD

1140 IF K2 <> 0 THEN NULL1 = K2 * LOVERD * RD ELSE NULL1 = 0

1150 PRINT #1, : PRINT #1, "Using a feed with "; FEED$ + ":"

1160 PRINT #1, USING "The - 3dB beamwidth is ##.##ш"; BW

1170 PRINT #1, USING "and the associated gain is ##.#dBi"; 10 * FNLG(41253! / (BW * BW))

1180 PRINT #1, USING "The first sidelobe is ###.# dB down"; SIDELOBE

1190 IF NULL1 <> 0 THEN PRINT #1, USING "The first null is at ##.#ш off-axis"; NULL1

1200 PRINT : PRINT "Another feed type? (y/N)> "; : GOSUB 1750: PRINT

1210 IF ZZ$ = "Y" THEN CLS : PRINT : GOTO 1000

1220 PRINT : CLOSE #1

1230 PRINT "Press [space] to run again, or Q to quit >";

1240 GOSUB 1750: IF ZZ$ = "Q" THEN CLS : END

1250 ERASE ZZ: GOTO 320

1260 ' show picture

1270 CLS

1290 SCREEN 8

1300 PSET (15, 50)

1310 DRAW "L5;R10;L5;D100;L5;R10;"

1320 PSET (50, 100)

1330 DRAW "U50;D100;U50;L10;R20;L10;U50;L5;R10;L5;D100;L5;R10;L5;U50;"

1340 FOR Y = 50 TO -50 STEP -.1

1350 Z = Y * Y / 30

1360 PSET (Z + 50, Y + 100)

1370 NEXT Y

1380 LOCATE 2, 35

1390 COLOR 11: PRINT "Parabolic reflector design"

1400 LOCATE 3, 35

1410 PRINT "Definition of terms used": COLOR 7

1420 LOCATE 5, 40

1430 COLOR 3: PRINT "D"; : COLOR 7: PRINT "  diameter of reflector"

1440 LOCATE 6, 40

1450 COLOR 3: PRINT "Y"; : COLOR 7: PRINT "  radius of reflector"

1460 LOCATE 7, 40

1470 COLOR 3: PRINT "Z"; : COLOR 7: PRINT "  reflector depth at point"

1480 LOCATE 8, 40

1490 COLOR 3: PRINT "F"; : COLOR 7: PRINT "  focal length"

1500 LOCATE 8, 8

1510 PRINT "ДД"; : COLOR 3: PRINT "Z"; : COLOR 7: PRINT "ДД"

1520 LOCATE 13, 25

1530 PRINT "focus"

1540 PSET (170, 100)

1550 CIRCLE (170, 100), 3

1560 FOR I = 160 TO 70 STEP -1

1570 IF I / 4 = INT(I / 4) THEN PSET (I, 100): GOTO 1590

1580 PRESET (I, 100)

1590 NEXT I

1600 LOCATE 13, 15

1610 COLOR 3: PRINT " F "

1620 LOCATE 13, 1

1630 PRINT "D"

1640 LOCATE 10, 4

1650 PRINT "Y"

1660 LOCATE 13, 3

1670 COLOR 7: PRINT "-"

1680 LOCATE 23, 40

1690 PRINT "Scale exaggerated for clarity"

1700 LOCATE 23, 1

1710 PRINT "Press [space] to continue"

1720 KK$ = INKEY$: IF KK$ = "" THEN 1720

1730 SCREEN 0: CLS

1740 RETURN

1750 ZZ$ = INPUT$(1)

1760 IF ZZ$ > "@" AND ZZ$ <= "z" THEN ZZ$ = CHR$(ASC(ZZ$) AND &H5F)

1770 RETURN

1780 COLOR 11: PRINT #1, "RADIAL DISTANCE (Y)"; SPC(18); "DEPTH (Z)"

1790 IF METRIC THEN PRINT #1, " cm from centre "; SPC(18); "    in cm"

1800 IF NOT METRIC THEN PRINT #1, " inches from centre "; SPC(18); " inches"

1810 COLOR 3: PRINT #1, "ДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДД-"

1820 LOCATE 4, 1: COLOR 7

1830 RETURN

1840 K1 = 1.02: K2 = 1.22: SIDELOBE = -17.6: FEED$ = "uniform illumination"

1850 RETURN

1860 K1 = 1.27: K2 = 1.63: SIDELOBE = -24.6: FEED$ = "zero edge taper (1-rэ)"

1870 RETURN

1880 K1 = 1.47: K2 = 2.03: SIDELOBE = -30.6: FEED$ = "zero edge taper (1-rэ)э"

1890 RETURN

1900 K1 = 1.16: K2 = 1.51: SIDELOBE = -25.6: FEED$ = "0.5 edge taper 0.5+(1-rэ)э"

1910 RETURN

1920 K1 = 1.31: K2 = 0: SIDELOBE = -40!: FEED$ = "Taylor distribution"

1930 RETURN

1940 PRINT : PRINT "Press [space] to continue > ";

1950 GOSUB 1750: CLS

1960 RETURN