1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
5 'OMMON EX$
10 'LADDER2 - 2 Element Matching Network - 27 SEP 96 rev. 11 APR 97
20 '.....adapted from LADDER.BAS ver.1.2 by Brian Egan, ZL1LE
30 
40 COLOR 7,0,0
50 CLS:PI=3.141592:M=10^6:MM=9.999999E+11:OHM$=" ê"
60 KEY OFF:AR$="ÄÄÄ¯"
70 GOSUB 600
80 COLOR 0,7
90 PRINT: PRINT ;" Press 1 to continue or 0 to EXIT....."
100 COLOR 7,0
110 Y$=INKEY$:IF Y$=""THEN 110
120 IF Y$="0"THEN CLS:CHAIN"transmat"
130 IF Y$="1"THEN 150
140 GOTO 110
150 LOCATE CSRLIN-1:PRINT STRING$(40,32):LOCATE CSRLIN-1
160 PRINT "Do you wish to read the program notes (y/n)?"
170 Y$=INKEY$:IF Y$="" THEN 170
180 IF Y$="N" OR Y$="n" THEN 220
190 IF Y$="Y" OR Y$="y" THEN GOTO 210
200 GOTO 170
210 CLS:GOSUB 1490
220 CLS:U=0:V=0:GOSUB 600
230 PRINT TAB(20); "Ú";:FOR N=1 TO 30:PRINT "Ä";:NEXT N:PRINT "¿"
240 PRINT TAB(20);"³  NETWORK DESIGN PARAMETERS:  ³"
250 PRINT TAB(20); "À";:FOR N=1 TO 30:PRINT "Ä";:NEXT N:PRINT "Ù"
260 PRINT :INPUT "1.   ENTER frequency of operation in MHz:   ",F
270 INPUT "2.   ENTER value of input resistance, R1, in ohms:  ",R1
280 INPUT "3.   ENTER value of load resistance, R2, in ohms:   ",R2
290 INPUT "4.   ENTER value of load reactance, X2, in ohms:    ",X2
300 PRINT: FOR N=1 TO 79:PRINT "Ä";:NEXT N:PRINT
310 RI=R2:XI=X2:GOSUB 1010:SWR0=SWR
320 W=2*PI*F*M
330 Z=R2*R2+X2*X2:RP=Z/R2:IF X2=0 THEN XP=1.000000E+07 ELSE XP=RP*R2/X2
340 IF R1<=R2 THEN TYPE$="A" ELSE IF R1 >=RP THEN TYPE$="B" ELSE TYPE$="AB"
350 IF TYPE$="AB" THEN PRINT"both TYPE A and TYPE B networks will match prescribed source and load.";:GOTO 370
360 PRINT "a TYPE ";TYPE$;;" network is required to match prescribed source and load."
370 FOR N=1 TO 79:PRINT"Ä";:NEXT N:PRINT
380 PRINT "Press any key to continue......."
390 Y$=INKEY$:IF Y$="" THEN 390
400 CLS:PRINT TAB(20); "2-ELEMENT LADDER MATCHING NETWORK SOLUTIONS"
410 FOR N=1 TO 79:PRINT "Ä";:NEXT N:PRINT
420 D41$="####.#"
430 PRINT "Ú";:FOR N=1 TO 72:PRINT "Ä";:NEXT N:PRINT "¿"
440 PRINT "³ DESIGN PARAMETERS:";TAB(74);;"³"
450 PRINT "Ã";:FOR N=1 TO 72:PRINT "Ä";:NEXT N:PRINT "´"
460 PRINT "³ Frequency (MHz)    =   ";F;TAB(40);"Load Resistance  = ";:PRINT USING D41$;R2;:PRINT OHM$;TAB(74);"³"
470 PRINT "³ Source Resistance  =  ";:PRINT USING D41$;R1;:PRINT OHM$;TAB(40); "Load Reactance   = ";:PRINT USING D41$;X2;:PRINT OHM$;TAB(74);"³"
480 PRINT "À";:FOR N=1 TO 72:PRINT "Ä";:NEXT N:PRINT "Ù"
490 FOR N=1 TO 79:PRINT "Í";:NEXT N:PRINT
500 IF V=1 THEN GOSUB 1050
510 IF V=1 GOTO 540
520 IF TYPE$="A" THEN GOSUB 660 ELSE IF TYPE$="B" THEN GOSUB 1050 ELSE GOSUB 1440
530 REM GOSUB 1000
540 LOCATE 23,1:PRINT "Another design (y/n)?"
550 Y$=INKEY$:IF Y$="" THEN 550
560 IF Y$ = "y" OR Y$="Y" THEN 220
570 IF Y$="N" OR Y$="n" THEN 590
580 GOTO 550
590 LOCATE CSRLIN-1:PRINT STRING$(80,32);:GOSUB 3060:GOTO 50
600 REM*************SUBROUTINE HEADING*****************
610 PRINT TAB(20); "2-ELEMENT LADDER MATCHING NETWORK PROGRAM"
620 PRINT STRING$(80,196);:LOCATE CSRLIN-1,29
630 PRINT " by Brian Egan, ZL1LE ";:PRINT
640 A$= " Xa ":B$="Xb":Y=5:X=7:GOSUB 1740:Y=5:X=45:GOSUB 1830
650 FOR N=1 TO 79:PRINT "Ä";:NEXT N:PRINT:RETURN
660 REM ***********SUBROUTINE TYPE A*************
670 XS=SQR(R1*RP-R1*R1):XA1=-XS:XA2=XS:XT1=R1*RP/XS:XT2=-XT1
680 IF R1=R2 THEN XT1=(R1-1.000000E-01)*RP/XS:XT2=-XT1
690 K1=1/XT1-1/XP:K2=1/XT2-1/XP:XB1=1/K1:XB2=1/K2
700 IF XA1>0 THEN D1=XA1/R1 ELSE D1=0
710 IF XB1 > 0 THEN D2=(1+XA1*XA1/R1/R1)*R1/XB1 ELSE D2=0
720 D=D1+D2
730 IF XA1>=0 THEN A$=" La " ELSE A$= " Ca "
740 IF XB1>=0 THEN B$="Lb" ELSE B$="Cb"
750 IF XA1>=0 THEN AA$="La (uH) = " ELSE AA$= "Ca (pF) = "
760 IF XB1>=0 THEN BB$="Lb (uH) = " ELSE BB$= "Cb (pF) = "
770 IF XA1>0 THEN G1$="##.###" ELSE G1$="####.#"
780 IF XB1>0 THEN G2$="##.###" ELSE G2$="####.#"
790 IF XA1 >=0 THEN P1=XA1/W*M ELSE P1 = 1/W/ABS(XA1)*MM
800 IF XB1 >=0 THEN Q1=XB1/W*M ELSE Q1 = 1/W/ABS(XB1)*MM
810 PRINT TAB(5); "SOLUTION 1.";:PRINT TAB(5);;"ÄÄÄÄÄÄÄÄÄÄ"
820 PRINT AA$;:PRINT USING G1$;P1:PRINT BB$;:PRINT USING G2$;Q1:PRINT "delta   = ";:PRINT USING "##.##";D
830  Y=10:X=30:U=1:GOSUB 1740:U=0
840 FOR N=1 TO 79:PRINT "Í";:NEXT N:PRINT
850 IF XA2>0 THEN D1=XA2/R1 ELSE D1=0
860 IF XB2 > 0 THEN D2=(1+XA2*XA2/R1/R1)*R1/XB2 ELSE D2=0
870 D=D1+D2
880 IF XA2>=0 THEN A$=" La " ELSE A$= " Ca "
890 IF XB2>=0 THEN B$="Lb" ELSE B$="Cb"
900 IF XA2>=0 THEN AA$="La (uH) = " ELSE AA$= "Ca (pF) = "
910 IF XB2>=0 THEN BB$="Lb (uH) = " ELSE BB$= "Cb (pF) = "
920 IF XA2>0 THEN G1$="##.###" ELSE G1$="####.#"
930 IF XB2>0 THEN G2$="##.###" ELSE G2$="####.#"
940 IF XA2 >=0 THEN P1=XA2/W*M ELSE P1 = 1/W/ABS(XA2)*MM
950 IF XB2 >=0 THEN Q1=XB2/W*M ELSE Q1 = 1/W/ABS(XB2)*MM
960 PRINT TAB(5); "SOLUTION 2.";:PRINT TAB(5);;"ÄÄÄÄÄÄÄÄÄÄ"
970 PRINT AA$;:PRINT USING G1$;P1:PRINT BB$;:PRINT USING G2$;Q1:PRINT "delta   = ";:PRINT USING "##.##";D
980  Y=16:X=30:U=1:GOSUB 1740:U=0
990 FOR N=1 TO 79:PRINT "Í";:NEXT N
1000 GOSUB 1920:RETURN
1010 REM SUBROUTINE CALCULATE SWR
1020 UI = RI-R1:VI=RI+R1:P=UI*UI +XI*XI:Q=VI*VI+XI*XI
1030 GAMMA =SQR(P/Q):SWR = (1+GAMMA)/(1-GAMMA)
1040 RETURN
1050 REM ***********SUBROUTINE TYPE B*************
1060 XT=SQR(R1*R2-R2*R2):XP1=R1*R2/XT:XP2=-XP1:XB1=-XP1:XB2=-XP2
1070 XA1=XT-X2:XA2=-XT-X2
1080 IF XB1 >0 THEN D1=R1/XB1 ELSE D1=0
1090 IF XA1 >0 THEN D2=(1/XB1/XB1+1/R1/R1)*XA1*R1 ELSE D2=0
1100 D=D1+D2
1110 IF XA1>=0 THEN A$=" La " ELSE A$= " Ca "
1120 IF XB1>=0 THEN B$="Lb" ELSE B$="Cb"
1130 IF XA1>=0 THEN AA$="La (uH) = " ELSE AA$= "Ca (pF) = "
1140 IF XB1>=0 THEN BB$="Lb (uH) = " ELSE BB$= "Cb (pF) = "
1150 IF XA1>0 THEN G1$="##.###" ELSE G1$="####.#"
1160 IF XB1>0 THEN G2$="##.###" ELSE G2$="####.#"
1170 IF XA1 >=0 THEN P1=XA1/W*M ELSE P1 = 1/W/ABS(XA1)*MM
1180 IF XB1 >=0 THEN Q1=XB1/W*M ELSE Q1 = 1/W/ABS(XB1)*MM
1190 IF V=1 THEN N$="3" ELSE N$="1"
1200 PRINT TAB(5); "SOLUTION ";N$:PRINT TAB(5);"ÄÄÄÄÄÄÄÄÄÄ"
1210 PRINT AA$;:PRINT USING G1$;P1:PRINT BB$;:PRINT USING G2$;Q1:PRINT "delta   = ";:PRINT USING "##.##";D
1220 IF XA1=0 THEN A$="ÄÄÄÄ"
1230  Y=10:X=30:U=1:GOSUB 1830:U=0
1240 FOR N=1 TO 79:PRINT "Í";:NEXT N:PRINT
1250 IF XB2>0 THEN D1=R1/XB2 ELSE D1=0
1260 IF XA2 > 0 THEN D2=(1/XB2/XB2+1/R1/R1)*XA2*R1 ELSE D2=0
1270 D=D1+D2
1280 IF XA2>=0 THEN A$=" La " ELSE A$= " Ca "
1290 IF XB2>=0 THEN B$="Lb" ELSE B$="Cb"
1300 IF XA2>=0 THEN AA$="La (uH) = " ELSE AA$= "Ca (pF) = "
1310 IF XB2>=0 THEN BB$="Lb (uH) = " ELSE BB$= "Cb (pF) = "
1320 IF XA2>0 THEN G1$="##.###" ELSE G1$="####.#"
1330 IF XB2>0 THEN G2$="##.###" ELSE G2$="####.#"
1340 IF XA2 >=0 THEN P1=XA2/W*M ELSE P1 = 1/W/ABS(XA2)*MM
1350 IF XB2 >=0 THEN Q1=XB2/W*M ELSE Q1 = 1/W/ABS(XB2)*MM
1360 IF V=1 THEN N$="4" ELSE N$="2"
1370 PRINT TAB(5); "SOLUTION ";N$:PRINT TAB(5);"ÄÄÄÄÄÄÄÄÄÄ"
1380 PRINT AA$;:PRINT USING G1$;P1:PRINT BB$;:PRINT USING G2$;Q1:PRINT "delta   = ";:PRINT USING "##.##";D
1390 IF XA2=0 THEN A$="ÄÄÄÄ"
1400  Y=16:X=30:U=1:GOSUB 1830:U=0
1410 FOR N=1 TO 79:PRINT "Í";:NEXT N
1420 GOSUB 2460:RETURN
1430 FOR N=1 TO 79:PRINT "Í";:NEXT N:RETURN
1440 REM ***********SUBROUTINE TYPE AB*************
1450 V=0:GOSUB 660:GOSUB 3030:GOSUB 3060:GOSUB 3030
1460 LOCATE 23,1:PRINT "Press any key to display SOLUTIONS 3 and 4 ........"
1470 Y$= INKEY$:IF Y$="" THEN 1470
1480 V=1:GOTO 400
1490  REM ************PROGRAM NOTES SUBROUTINE**************
1500 FOR N=1 TO 79:PRINT "Ä";:NEXT N:PRINT
1510 PRINT TAB(15); "LADDER MATCHING NETWORK PROGRAM NOTES:"
1520 FOR N=1 TO 79:PRINT "Ä";:NEXT N:PRINT
1530 PRINT "1.   Ladder network TYPE is a function of the ratio R1/R2 where R1 is the"
1540 PRINT "desired input resistance and R2 is the resistive component of the network load."
1550 PRINT "For purely resistive loads the rules are simple. For R1 < R2 a Type A network"
1560 PRINT "is required and for R1 > R2 a Type B network. In the case of complex loads the"
1570 PRINT "same rules apply excepting that there is now an overlap region R2 < R1 < Rp."
1580 PRINT "(NOTE: Rp  =  R2 + X2ý/R2). In the overlap region a match can be effected using"
1590 PRINT "either network type."
1600 PRINT:PRINT ;"2.   There are 2 solutions to each matching problem (4 in the overlap region)."
1610 PRINT "Loosely, these may be interpreted as high-pass or low-pass solutions although"
1620 PRINT "with complex loads the distinction is not always apparent."
1630 PRINT:PRINT ;"3.   Values of a normalized loss function, delta, are listed for all solutions."
1640 PRINT "Delta provides a relative measure of network power loss (the lower delta the"
1650 PRINT "lower the loss. In evaluating delta it is assumed that both stray and capacitor"
1660 PRINT "losses are negligible, assumptions possibly suspect at higher frequencies."
1670 PRINT
1680 PRINT "4.   For SWR calculations comparison LOAD SWR is displayed in the ";
1690 PRINT "screen header"
1700 PRINT "on the right."
1710 LOCATE 25,35:PRINT "Press any key to continue .......";
1720 Y$=INKEY$:IF Y$="" THEN 1720
1730 RETURN
1740 REM *************TYPE A NETWORK SCHEMATIC SUBROUTINE**********
1750 IF U=0 THEN LOCATE Y-2,X-2:PRINT "TYPE `A' LADDER NETWORK"
1760 LOCATE Y,X:PRINT "o";:FOR N=1 TO 16:PRINT "Ä";:NEXT N:PRINT "o"
1770 LOCATE Y,X+4:PRINT A$:LOCATE Y,X+11:PRINT "Â"
1780 FOR N=1 TO 3:LOCATE Y+N,X+11:PRINT "³";:NEXT N
1790 LOCATE Y+2,X:PRINT AR$:LOCATE Y+2,X+11:PRINT B$;"   ";AR$
1800 LOCATE Y+3,X:PRINT "R1";:LOCATE Y+3,X+15:PRINT "Load"
1810 LOCATE Y+4,X+1:FOR N=1 TO 16:PRINT "Ä";:NEXT N:LOCATE Y+4,X+11:PRINT "Á
1820 RETURN
1830 REM *************TYPE B NETWORK SCHEMATIC SUBROUTINE**********
1840 IF U=0 THEN LOCATE Y-2,X-2:PRINT "TYPE `B' LADDER NETWORK"
1850 LOCATE Y,X:PRINT "o";:FOR N=1 TO 16:PRINT "Ä";:NEXT N:PRINT "o"
1860 LOCATE Y,X+10:PRINT A$:LOCATE Y,X+6:PRINT "Â"
1870 FOR N=1 TO 3:LOCATE Y+N,X+6:PRINT "³";:NEXT N
1880 LOCATE Y+2,X:PRINT AR$:LOCATE Y+2,X+6:PRINT B$:LOCATE Y+2,X+15:PRINT AR$
1890 LOCATE Y+3,X:PRINT "R1";:LOCATE Y+3,X+15:PRINT "Load"
1900 LOCATE Y+4,X+1:FOR N=1 TO 16:PRINT "Ä";:NEXT N:LOCATE Y+4,X+6:PRINT "Á
1910 RETURN
1920 REM SWR CALCULATION FOR TYPE A NETWORK
1930 LOCATE 4,48:COLOR 14:PRINT "LOAD SWR  =  ";:PRINT USING "##.##";SWR0:COLOR 7
1940 GOSUB 3030:LOCATE 23,1
1950 PRINT "CALCULATE SWR for variations in network values of SOLUTION 1 (y/n)....?"
1960 Y$=INKEY$:IF Y$="" THEN 1960
1970 IF Y$="N" OR Y$="n" THEN 2190
1980 IF Y$="Y" OR Y$="y" THEN 2000
1990 GOTO 2510
2000 IF XA1 >=0 THEN A1$="La (uH)" ELSE A1$= "Ca (pF)"
2010 IF XB1 >=0 THEN B1$="Lb (uH)" ELSE B1$= "Cb (pF)"
2020 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2030 LOCATE 22,1:PRINT "ENTER ladder component value ";A1$;:INPUT N1
2040 LOCATE 23,1:PRINT "ENTER ladder component value ";B1$;:INPUT N2
2050 VIEW PRINT 22 TO 24:CLS:VIEW PRINT
2060 LOCATE 11,55:COLOR 14:PRINT "For values"
2070 LOCATE 12,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 12,55:PRINT A1$;" = ";N1
2080 LOCATE 13,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 13,55:PRINT B1$;" = ";N2
2090 IF XA1 >=O THEN XA= W*N1*9.999999E-07 ELSE XA = -1/(W*N1*9.999999E-13)
2100 IF XB1 >=O THEN XB= W*N2*9.999999E-07 ELSE XB = -1/(W*N2*9.999999E-13)
2110 XT = 1/(1/XB +1/XP):K=RP*XT/(RP*RP+XT*XT):RI=K*XT:XI=XA+K*RP:GOSUB 1010
2120 LOCATE 14,55:PRINT "SWR     = ";:PRINT USING "##.##";SWR:COLOR 7
2130 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2140 LOCATE 23,1:PRINT "Make another SWR calculation for SOLUTION 1 (y/n)......?"
2150 Y$=INKEY$:IF Y$="" THEN 2150
2160 IF Y$="Y" OR Y$= "y" THEN 2020
2170 IF Y$="N" OR Y$= "n" THEN 2190
2180 GOTO 2150
2190 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2200 GOSUB 3030:LOCATE 23,1
2210 PRINT "CALCULATE SWR for variations in network values in SOLUTION 2 (y/n)....?"
2220 Y$=INKEY$:IF Y$="" THEN 2220
2230 IF Y$="N" OR Y$="n" THEN 2450
2240 IF Y$="Y" OR Y$="y" THEN 2260
2250 GOTO 2220
2260 IF XA2 >=0 THEN A2$="La (uH)" ELSE A2$= "Ca (pF)"
2270 IF XB2 >=0 THEN B2$="Lb (uH)" ELSE B2$= "Cb (pF)"
2280 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2290 LOCATE 22,1:PRINT "ENTER ladder component value ";A2$;:INPUT N1
2300 LOCATE 23,1:PRINT "ENTER ladder component value ";B2$;:INPUT N2
2310 VIEW PRINT 22 TO 24:CLS:VIEW PRINT
2320 LOCATE 17,55:COLOR 14:PRINT "For values"
2330 LOCATE 18,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 18,55:PRINT A2$;" = ";N1
2340 LOCATE 19,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 19,55:PRINT B2$;" = ";N2
2350 IF XA2 >=O THEN XA= W*N1*9.999999E-07 ELSE XA = -1/(W*N1*9.999999E-13)
2360 IF XB2 >=O THEN XB= W*N2*9.999999E-07 ELSE XB = -1/(W*N2*9.999999E-13)
2370 XT = 1/(1/XB +1/XP):K=RP*XT/(RP*RP+XT*XT):RI=K*XT:XI=XA+K*RP:GOSUB 1010
2380 LOCATE 20,55:PRINT "SWR     = ";:PRINT USING "##.##";SWR:COLOR 7
2390 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2400 LOCATE 23,1:PRINT "Make another SWR calculation for SOLUTION 2 (y/n)......?"
2410 Y$=INKEY$:IF Y$="" THEN 2410
2420 IF Y$="Y" OR Y$= "y" THEN 2280
2430 IF Y$="N" OR Y$= "n" THEN 2450
2440 GOTO 2410
2450 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T:RETURN
2460 REM ***********SWR CALCULATION FOR TYPE B NETWORK**********
2470 REM
2480 LOCATE 4,48:COLOR 14:PRINT "LOAD SWR  =  ";:PRINT USING "##.##";SWR0:COLOR 7
2490 GOSUB 3030:LOCATE 23,1:IF V=1 THEN N$="3" ELSE N$="1"
2500 PRINT "CALCULATE SWR for variations in network values of SOLUTION ";N$;;" (y/n)....?"
2510 Y$=INKEY$:IF Y$="" THEN 2510
2520 IF Y$="N" OR Y$="n" THEN GOSUB 3030:GOTO 2740
2530 IF Y$="Y" OR Y$="y" THEN GOSUB 3030:GOTO 2550
2540 GOTO 2510
2550 IF XA1 >=0 THEN A1$="La (uH)" ELSE A1$= "Ca (pF)"
2560 IF XB1 >=0 THEN B1$="Lb (uH)" ELSE B1$= "Cb (pF)"
2570 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2580 LOCATE 22,1:PRINT "ENTER ladder component value ";A1$;:INPUT N1
2590 LOCATE 23,1:PRINT "ENTER ladder component value ";B1$;:INPUT N2
2600 VIEW PRINT 22 TO 24:CLS:VIEW PRINT
2610 LOCATE 11,55:COLOR 14:PRINT "For values"
2620 LOCATE 12,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 12,55:PRINT A1$;" = ";N1
2630 LOCATE 13,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 13,55:PRINT B1$;" = ";N2
2640 IF XA1 >=O THEN XA= W*N1*9.999999E-07 ELSE XA = -1/(W*N1*9.999999E-13)
2650 IF XB1 >=O THEN XB= W*N2*9.999999E-07 ELSE XB = -1/(W*N2*9.999999E-13)
2660 XT=XA+X2:SQ=R2*R2+(XB+XT)*(XB+XT):RI=R2*XB*XB/SQ: XI=XB*(R2*R2+XT*(XB+XT))/SQ:GOSUB 1010
2670 LOCATE 14,55:PRINT "SWR     = ";:PRINT USING "##.##";SWR:COLOR 7
2680 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2690 LOCATE 23,1:PRINT "Make another SWR calculation for SOLUTION ";N$;;" (y/n)......?"
2700 Y$=INKEY$:IF Y$="" THEN 2700
2710 IF Y$="Y" OR Y$= "y" THEN 2570
2720 IF Y$="N" OR Y$= "n" THEN 2740
2730 GOTO 2700
2740 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2750 LOCATE 23,1:IF V=1 THEN N$="4" ELSE N$="2"
2760 PRINT "CALCULATE SWR for variations in network values in SOLUTION ";N$;;" (y/n)....?"
2770 Y$=INKEY$:IF Y$="" THEN 2770
2780 IF Y$="N" OR Y$="n" THEN 3010
2790 IF Y$="Y" OR Y$="y" THEN 2810
2800 GOTO 2770
2810 IF XA2 >=0 THEN A2$="La (uH)" ELSE A2$= "Ca (pF)"
2820 IF XB2 >=0 THEN B2$="Lb (uH)" ELSE B2$= "Cb (pF)"
2830 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2840 LOCATE 22,1:PRINT "ENTER ladder component value ";A2$;:INPUT N1
2850 LOCATE 23,1:PRINT "ENTER ladder component value ";B2$;:INPUT N2
2860 VIEW PRINT 22 TO 24:CLS:VIEW PRINT
2870 LOCATE 17,55:COLOR 14:PRINT "For values"
2880 LOCATE 18,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 18,55:PRINT A2$;" = ";N1
2890 LOCATE 19,55:FOR T=55 TO 79:PRINT" ";:NEXT T:LOCATE 19,55:PRINT B2$;" = ";N2
2900 IF XA2 >=O THEN XA= W*N1*9.999999E-07 ELSE XA = -1/(W*N1*9.999999E-13)
2910 IF XB2 >=O THEN XB= W*N2*9.999999E-07 ELSE XB = -1/(W*N2*9.999999E-13)
2920 XT=XA+X2:SQ=R2*R2+(XB+XT)*(XB+XT):RI=R2*XB*XB/SQ: XI=XB*(R2*R2+XT*(XB+XT))/SQ:GOSUB 1010
2930 LOCATE 20,55:PRINT "SWR     = ";:PRINT USING "##.##";SWR:COLOR 7
2940 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T
2950 LOCATE 23,1
2960 PRINT "Make another SWR calculation for SOLUTION ";N$;;" (y/n)......?"
2970 Y$=INKEY$:IF Y$="" THEN 2970
2980 IF Y$="Y" OR Y$= "y" THEN 2830
2990 IF Y$="N" OR Y$= "n" THEN 3010
3000 GOTO 2970
3010 LOCATE 23,1:FOR T=1 TO 79:PRINT " ";:NEXT T:RETURN
3020 '
3030 LOCATE 25,1:PRINT STRING$(80,32);                'blank screen line 25
3040 RETURN
3050 '
3060 '.....PRT
3070 KEY OFF:GOSUB 3140:LOCATE 25,5:COLOR 0,2
3080 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
3090 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
3100 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 3100 ELSE GOSUB 3140
3110 IF Z$="3"THEN RETURN
3120 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
3130 IF Z$="2"THEN LPRINT CHR$(12) ELSE 3070
3140 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
